@mengine/medeo-tool 2.0.1-alpha.7 → 2.0.1-alpha.9
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/{entity-contract-G4HxwNXl.d.mts → entity-contract-Bpe6NRIQ.d.mts} +23 -6
- package/dist/{entity-sandbox-DSFbfybl.mjs → entity-sandbox-CJeLcNcx.mjs} +132 -30
- package/dist/entity-sandbox-CJeLcNcx.mjs.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +30 -9
- package/dist/index.mjs.map +1 -1
- package/dist/sandbox-api.d.mts +22 -5
- package/dist/worker-entry.d.mts +1 -1
- package/dist/worker-entry.mjs +13 -15
- package/dist/worker-entry.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/entity-sandbox-DSFbfybl.mjs.map +0 -1
package/dist/sandbox-api.d.mts
CHANGED
|
@@ -67,8 +67,10 @@ interface EntityPayloadByKind {
|
|
|
67
67
|
};
|
|
68
68
|
clip: JsonObject;
|
|
69
69
|
video: BoundedNativeSequencePayload & MediaAssetPayload;
|
|
70
|
+
/** Every playable sound, including video original audio and synthesized voiceovers. */
|
|
70
71
|
audio: BoundedNativeSequencePayload & MediaAssetPayload;
|
|
71
|
-
|
|
72
|
+
/** A timbre identity, never playable content; the rendered take is an `audio` entity. */
|
|
73
|
+
voice: VoiceIdentityPayload;
|
|
72
74
|
image: UnboundedConstantSequencePayload & MediaAssetPayload;
|
|
73
75
|
'sequence-marker': JsonObject & {
|
|
74
76
|
sourceRange: {
|
|
@@ -160,7 +162,7 @@ interface JsonObject {
|
|
|
160
162
|
type JsonPrimitive = string | number | boolean | null;
|
|
161
163
|
type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
162
164
|
type KnownEntityKind = 'axvideo' | 'timeline' | 'track' | 'clip' | 'video' | 'audio' | 'voice' | 'image' | 'sequence-marker' | 'viewport' | 'audio-script' | 'phonetic-script' | 'caption';
|
|
163
|
-
type KnownRelationKind = 'timeline-track' | 'track-clip' | 'clip-marker' | 'marker-content' | 'axvideo-marker' | 'marker-timeline' | 'generated' | 'caption-alignment' | 'clip-anchor' | 'phonetic-script-render' | 'audio-script-source' | 'audio-script-marker';
|
|
165
|
+
type KnownRelationKind = 'timeline-track' | 'track-clip' | 'clip-marker' | 'marker-content' | 'axvideo-marker' | 'marker-timeline' | 'generated' | 'caption-alignment' | 'clip-anchor' | 'phonetic-script-render' | 'voice-timbre' | 'audio-script-source' | 'audio-script-marker';
|
|
164
166
|
interface LinkRelationBase {
|
|
165
167
|
relation_id?: string;
|
|
166
168
|
endpoint_0_entity_id: string;
|
|
@@ -199,8 +201,15 @@ type ScriptTextSegment = JsonObject & {
|
|
|
199
201
|
text: string;
|
|
200
202
|
language?: string;
|
|
201
203
|
};
|
|
202
|
-
/**
|
|
203
|
-
|
|
204
|
+
/**
|
|
205
|
+
* Stored own fields; a variant may obtain required content fields from its
|
|
206
|
+
* declared bases.
|
|
207
|
+
*
|
|
208
|
+
* Caption and Audio may also be declared resource-only: the ASR transcript and
|
|
209
|
+
* the synthesized voiceover are attached by the host, which then fills in the
|
|
210
|
+
* remaining factual fields.
|
|
211
|
+
*/
|
|
212
|
+
type StoredEntityPayload<K extends KnownEntityKind> = EntityPayloadByKind[K] | (K extends 'caption' | 'audio' ? JsonObject & Pick<MediaAssetPayload, 'external'> : never) | (JsonObject & Partial<EntityPayloadByKind[K]> & {
|
|
204
213
|
baseEntityIds: string[];
|
|
205
214
|
});
|
|
206
215
|
interface UnboundedConstantSequencePayload extends JsonObject {
|
|
@@ -219,6 +228,14 @@ interface UpdateEntityInput {
|
|
|
219
228
|
entity_id: string;
|
|
220
229
|
payload: JsonObject;
|
|
221
230
|
}
|
|
231
|
+
/** The voice-library timbre a synthesized Audio was rendered with. */
|
|
232
|
+
type VoiceIdentityPayload = JsonObject & {
|
|
233
|
+
voice: {
|
|
234
|
+
system: 'voice-library';
|
|
235
|
+
key: string;
|
|
236
|
+
name?: string;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
222
239
|
declare const entities: BusinessEntityFacade;
|
|
223
240
|
declare const relations: BusinessRelationFacade;
|
|
224
241
|
/** Resolve this Entity's attached resource through the host; await before using an uninitialized Caption or Voice. */
|
|
@@ -233,5 +250,5 @@ declare const console: {
|
|
|
233
250
|
error(...values: unknown[]): void;
|
|
234
251
|
};
|
|
235
252
|
//#endregion
|
|
236
|
-
export type { BoundedDerivedSequencePayload, BoundedNativeSequencePayload, BusinessEntityFacade, BusinessRelationFacade, CaptionTextSelection, CreateEntityInput, DeleteEntityInput, EntityAssetContent, EntityPayloadByKind, EntitySandboxCheckpoint, EntityUpdateInput, FieldChange, FieldPath, JsonObject, JsonPrimitive, JsonValue, KnownEntityKind, KnownRelationKind, LinkRelationInput, MediaAssetPayload, RelationUpdateInput, SandboxEntity, SandboxRelation, ScriptTextSegment, StoredEntityPayload, UnboundedConstantSequencePayload, UnlinkRelationInput, UpdateEntityInput, checkpoint, console, entities, inputs, relations, rgetAssetFromEntity, rollbackTo };
|
|
253
|
+
export type { BoundedDerivedSequencePayload, BoundedNativeSequencePayload, BusinessEntityFacade, BusinessRelationFacade, CaptionTextSelection, CreateEntityInput, DeleteEntityInput, EntityAssetContent, EntityPayloadByKind, EntitySandboxCheckpoint, EntityUpdateInput, FieldChange, FieldPath, JsonObject, JsonPrimitive, JsonValue, KnownEntityKind, KnownRelationKind, LinkRelationInput, MediaAssetPayload, RelationUpdateInput, SandboxEntity, SandboxRelation, ScriptTextSegment, StoredEntityPayload, UnboundedConstantSequencePayload, UnlinkRelationInput, UpdateEntityInput, VoiceIdentityPayload, checkpoint, console, entities, inputs, relations, rgetAssetFromEntity, rollbackTo };
|
|
237
254
|
//# sourceMappingURL=sandbox-api.d.mts.map
|
package/dist/worker-entry.d.mts
CHANGED
package/dist/worker-entry.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as isJsonObject, n as toDslRows, r as businessFacades, t as EntitySandbox } from "./entity-sandbox-
|
|
1
|
+
import { a as isJsonObject, n as toDslRows, r as businessFacades, t as EntitySandbox } from "./entity-sandbox-CJeLcNcx.mjs";
|
|
2
2
|
import { LoroEntityDocument, assertCanonicalEditorResources, assertMediaAssetWritePolicy, audioScriptAssetContent, audioScriptAssetFields, base64ToBytes, bytesToBase64, hasAudioScriptAsset, projectEntityTimeline } from "@mengine/medeo-client";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -17,7 +17,14 @@ function captionAssetSegments(content) {
|
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Persisted voiceover Audio facts, resolved by the host rather than inferred
|
|
22
|
+
* from transcript timing.
|
|
23
|
+
*
|
|
24
|
+
* A returned voice-library descriptor is validated but never written here: the
|
|
25
|
+
* timbre is its own Voice entity linked by a `voice-timbre` Relation, so the
|
|
26
|
+
* rendered Audio row stays resource-only.
|
|
27
|
+
*/
|
|
21
28
|
function speechAssetFields(content) {
|
|
22
29
|
if (!content || typeof content !== "object" || Array.isArray(content) || typeof content.storageKey !== "string" || !content.storageKey.trim() || !Number.isSafeInteger(content.durationMs) || content.durationMs <= 0) throw new Error("Speech Asset requires factual storageKey and positive millisecond duration");
|
|
23
30
|
const voice = content.voice;
|
|
@@ -30,8 +37,7 @@ function speechAssetFields(content) {
|
|
|
30
37
|
end: content.durationMs
|
|
31
38
|
},
|
|
32
39
|
sampling: "native",
|
|
33
|
-
coordinateSpace: "milliseconds"
|
|
34
|
-
...voice === void 0 ? {} : { voice }
|
|
40
|
+
coordinateSpace: "milliseconds"
|
|
35
41
|
};
|
|
36
42
|
}
|
|
37
43
|
/** Only resource facts participate; user placement and other fields remain untouched. */
|
|
@@ -41,8 +47,7 @@ function speechAssetSignature(payload) {
|
|
|
41
47
|
"storageKey",
|
|
42
48
|
"extent",
|
|
43
49
|
"sampling",
|
|
44
|
-
"coordinateSpace"
|
|
45
|
-
"voice"
|
|
50
|
+
"coordinateSpace"
|
|
46
51
|
].map((key) => payload[key]));
|
|
47
52
|
}
|
|
48
53
|
//#endregion
|
|
@@ -126,19 +131,12 @@ var EntityEditSandboxSession = class {
|
|
|
126
131
|
if (result.assetId !== external.key) throw new Error("Host returned a different Entity Asset");
|
|
127
132
|
const current = this.entitySandbox.entities.get(entityId);
|
|
128
133
|
if (!current || JSON.stringify(current.payload.external) !== JSON.stringify(external)) throw new Error("Entity resource changed during its read");
|
|
129
|
-
if (entity.entity_kind === "
|
|
134
|
+
if (entity.entity_kind === "audio" && external.system === "memota-speech") {
|
|
130
135
|
const fields = speechAssetFields(result.content);
|
|
131
136
|
if (Object.entries(fields).some(([key, value]) => JSON.stringify(current.payload[key]) !== JSON.stringify(value))) this.entitySandbox.entities.declareFields({
|
|
132
137
|
entity_id: entityId,
|
|
133
138
|
payload: fields
|
|
134
139
|
});
|
|
135
|
-
if (fields.voice === void 0 && current.payload.voice !== void 0) this.entitySandbox.entities.changeFields({
|
|
136
|
-
entity_id: entityId,
|
|
137
|
-
changes: [{
|
|
138
|
-
op: "unset",
|
|
139
|
-
path: ["voice"]
|
|
140
|
-
}]
|
|
141
|
-
});
|
|
142
140
|
this.resolvedSpeechAssets.set(entityId, speechAssetSignature(this.entitySandbox.entities.get(entityId).payload));
|
|
143
141
|
}
|
|
144
142
|
if (entity.entity_kind === "caption" && !this.initializedAsset(entityId, external.key)) {
|
|
@@ -229,7 +227,7 @@ var EntityEditSandboxSession = class {
|
|
|
229
227
|
for (const entity of this.entitySandbox.entities.list()) {
|
|
230
228
|
if (this.entitySandbox.resourceEntity(entity.entity_id)?.entity_id !== entity.entity_id) continue;
|
|
231
229
|
const external = entity.payload.external;
|
|
232
|
-
if (external && typeof external === "object" && !Array.isArray(external) && typeof external.key === "string" && (entity.entity_kind === "caption" && !this.initializedAsset(entity.entity_id, external.key) || entity.entity_kind === "
|
|
230
|
+
if (external && typeof external === "object" && !Array.isArray(external) && typeof external.key === "string" && (entity.entity_kind === "caption" && !this.initializedAsset(entity.entity_id, external.key) || entity.entity_kind === "audio" && external.system === "memota-speech" && !this.initializedSpeech(entity))) await this.rgetAssetFromEntity(entity.entity_id, load);
|
|
233
231
|
}
|
|
234
232
|
}
|
|
235
233
|
/** Direct script writes save a resource before the entity graph can be committed. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-entry.mjs","names":[],"sources":["../src/entity/entity-asset.ts","../src/sandbox/entity-script-session.ts","../src/sandbox/worker-entry.ts"],"sourcesContent":["import type { JsonObject, JsonValue, SandboxEntity } from './entity-contract.ts';\n\n/** Immutable resource content resolved by the host for a document Entity. */\nexport interface EntityAssetContent {\n assetId: string;\n content: JsonValue;\n}\n\n/** Host-only I/O. The sandbox supplies an Entity, never an arbitrary Asset query. */\nexport type EntityAssetLoader = (docId: string, entity: SandboxEntity) => Promise<EntityAssetContent>;\n\n/** Program-only initial resource creation; never exposed as a sandbox API. */\nexport type EntityAssetWriter = (\n docId: string,\n entity: SandboxEntity,\n content: JsonValue,\n) => Promise<EntityAssetContent>;\n\nexport interface CaptionAssetSegment {\n text: string;\n start_time_ms: number;\n end_time_ms: number;\n}\n\n/** MCAP's output_caption JSON contract; unknown formats never become invented captions. */\nexport function captionAssetSegments(content: JsonValue): CaptionAssetSegment[] {\n if (!content || typeof content !== 'object' || Array.isArray(content) || !Array.isArray(content.segments))\n throw new Error('Caption Asset must contain an output_caption object with segments');\n if (!content.segments.length) throw new Error('Caption Asset contains no speech segments');\n return content.segments.map((value) => {\n if (\n !value ||\n typeof value !== 'object' ||\n Array.isArray(value) ||\n typeof value.text !== 'string' ||\n !value.text.trim() ||\n !Number.isSafeInteger(value.start_time_ms) ||\n !Number.isSafeInteger(value.end_time_ms) ||\n (value.start_time_ms as number) < 0 ||\n (value.end_time_ms as number) <= (value.start_time_ms as number)\n )\n throw new Error('Caption Asset has invalid text or millisecond timing');\n return { text: value.text, start_time_ms: value.start_time_ms as number, end_time_ms: value.end_time_ms as number };\n });\n}\n\n/** Persisted Speech facts, resolved by the host rather than inferred from transcript timing. */\nexport function speechAssetFields(content: JsonValue): JsonObject {\n if (\n !content ||\n typeof content !== 'object' ||\n Array.isArray(content) ||\n typeof content.storageKey !== 'string' ||\n !content.storageKey.trim() ||\n !Number.isSafeInteger(content.durationMs) ||\n (content.durationMs as number) <= 0\n )\n throw new Error('Speech Asset requires factual storageKey and positive millisecond duration');\n const voice = content.voice;\n if (\n voice !== undefined &&\n (!voice ||\n typeof voice !== 'object' ||\n Array.isArray(voice) ||\n voice.system !== 'voice-library' ||\n typeof voice.key !== 'string' ||\n !voice.key.trim())\n )\n throw new Error('Speech Asset has an invalid voice-library identity');\n return {\n storageKey: content.storageKey,\n extent: { kind: 'bounded', start: 0, end: content.durationMs },\n sampling: 'native',\n coordinateSpace: 'milliseconds',\n ...(voice === undefined ? {} : { voice }),\n };\n}\n\n/** Only resource facts participate; user placement and other fields remain untouched. */\nexport function speechAssetSignature(payload: JsonObject): string {\n return JSON.stringify(\n ['external', 'storageKey', 'extent', 'sampling', 'coordinateSpace', 'voice'].map((key) => payload[key]),\n );\n}\n","import {\n LoroEntityDocument,\n audioScriptAssetContent,\n audioScriptAssetFields,\n hasAudioScriptAsset,\n projectEntityTimeline,\n base64ToBytes,\n bytesToBase64,\n assertCanonicalEditorResources,\n assertMediaAssetWritePolicy,\n} from '@mengine/medeo-client';\nimport { isJsonObject, type EntityRelationRows } from '@mengine/medeo-dsl';\n\nimport {\n captionAssetSegments,\n speechAssetFields,\n speechAssetSignature,\n type EntityAssetContent,\n} from '../entity/entity-asset.ts';\nimport type {\n BusinessEntityFacade,\n BusinessRelationFacade,\n EntitySandboxCheckpoint,\n SandboxEntity,\n JsonObject,\n} from '../entity/entity-contract.ts';\nimport { EntitySandbox, toDslRows, type DomainIdFactory } from '../entity/entity-sandbox.ts';\nimport { businessFacades } from './business-facades.ts';\nimport type { ChangePlan, ConsoleShim, EditSandboxSessionOptions } 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/** Entity/relation script session; compilation retains the ordered operation journal. */\nexport class EntityEditSandboxSession {\n private readonly docId: string;\n private readonly entitySandbox: EntitySandbox;\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 readonly directScriptWrites = new Set<string>();\n private readonly resolvedCaptionAssets = new Set<string>();\n private logCapped = false;\n private readonly resolvedSpeechAssets = new Map<string, string>();\n\n readonly entities: BusinessEntityFacade;\n readonly relations: BusinessRelationFacade;\n readonly console: ConsoleShim;\n readonly checkpoint: () => EntitySandboxCheckpoint;\n readonly rollbackTo: (cp: EntitySandboxCheckpoint) => void;\n\n // The Entity sandbox edits Entity rows only; the legacy VideoDocument\n // projection is not an input to it (P7M14 separated content from identity).\n constructor(options?: EditSandboxSessionOptions) {\n this.docId = options?.docId ?? '';\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 const business = businessFacades(this.entitySandbox.entities, this.entitySandbox.relations, (id) =>\n this.directScriptWrites.add(id),\n );\n this.entities = business.entities;\n this.relations = business.relations;\n this.console = this.buildConsoleShim();\n const checkpoints = new Map<EntitySandboxCheckpoint, { index: number; scripts: Set<string> }>();\n this.checkpoint = () => {\n const token = Object.freeze({}) as EntitySandboxCheckpoint;\n checkpoints.set(token, { index: this.entitySandbox.commandCount, scripts: new Set(this.directScriptWrites) });\n return token;\n };\n this.rollbackTo = (cp) => {\n const index = checkpoints.get(cp);\n if (index === undefined) throw new Error('Invalid or expired sandbox checkpoint');\n this.entitySandbox.rollbackTo(index.index);\n this.directScriptWrites.clear();\n for (const id of index.scripts) this.directScriptWrites.add(id);\n let later = false;\n for (const token of checkpoints.keys()) {\n if (later) checkpoints.delete(token);\n if (token === cp) later = true;\n }\n };\n }\n\n /** Resolve only the resource attached to this Entity; I/O remains in the parent host. */\n async rgetAssetFromEntity(\n entityId: string,\n load: (entity: SandboxEntity) => Promise<EntityAssetContent>,\n ): Promise<EntityAssetContent> {\n const requested = this.entitySandbox.entities.get(entityId);\n const entity = requested ? this.entitySandbox.resourceEntity(entityId) : null;\n if (!entity || entity.entity_kind === 'asset') throw new Error(`Business Entity not found: ${entityId}`);\n const external = entity.payload.external;\n if (!external || typeof external !== 'object' || Array.isArray(external) || typeof external.key !== 'string')\n throw new Error(`Entity ${entityId} has no attached Asset`);\n if (entity.entity_id !== entityId) return this.rgetAssetFromEntity(entity.entity_id, load);\n const assetId = external.key;\n const result = await load(entity);\n if (result.assetId !== external.key) throw new Error('Host returned a different Entity Asset');\n const current = this.entitySandbox.entities.get(entityId);\n if (!current || JSON.stringify(current.payload.external) !== JSON.stringify(external))\n throw new Error('Entity resource changed during its read');\n if (entity.entity_kind === 'voice' && external.system === 'memota-speech') {\n const fields = speechAssetFields(result.content);\n // Host declarations initialize nested facts; native compilation writes only\n // their changed leaves against this session's original causal baseline.\n if (Object.entries(fields).some(([key, value]) => JSON.stringify(current.payload[key]) !== JSON.stringify(value)))\n this.entitySandbox.entities.declareFields({ entity_id: entityId, payload: fields });\n if (fields.voice === undefined && current.payload.voice !== undefined)\n this.entitySandbox.entities.changeFields({ entity_id: entityId, changes: [{ op: 'unset', path: ['voice'] }] });\n this.resolvedSpeechAssets.set(entityId, speechAssetSignature(this.entitySandbox.entities.get(entityId)!.payload));\n }\n if (entity.entity_kind === 'caption' && !this.initializedAsset(entityId, external.key)) {\n const timed = captionAssetSegments(result.content);\n const segments = timed.map((segment, index) => ({\n segmentId: `asset:${assetId}:${index}`,\n text: segment.text,\n }));\n // An explicit composition determines the owner, never the panel selection.\n // Resource-only captions establish their own independent complete script.\n const bases = current.payload.baseEntityIds as string[] | undefined;\n const scriptId = bases?.length\n ? this.entitySandbox.captionAudioScriptId(entityId)\n : this.entitySandbox.entities.create({ entity_kind: 'audio-script', payload: { segments: [] } });\n const script = this.entitySandbox.entities.get(scriptId)!;\n const existing = script.payload.segments as { segmentId: string; text: string }[];\n const additions = segments.filter((segment) => !existing.some((item) => item.segmentId === segment.segmentId));\n this.entitySandbox.entities.update({ entity_id: scriptId, payload: { segments: [...existing, ...additions] } });\n const ranges = timed.map((segment, index) => ({\n segmentId: segments[index]!.segmentId,\n startMs: segment.start_time_ms,\n endMs: segment.end_time_ms,\n }));\n // One resource retains one complete script, but each Caption quotes only one segment.\n const selection = current.payload.selection;\n if (selection !== undefined && (!isJsonObject(selection) || typeof selection.segmentId !== 'string'))\n throw new Error('Caption selection must be one segment selection object');\n const selected =\n selection === undefined ? ranges : ranges.filter((range) => range.segmentId === selection.segmentId);\n if (!selected.length) throw new Error('Caption selection does not name a segment of its resource');\n for (const [index, range] of selected.entries()) {\n const payload: JsonObject & { baseEntityIds: string[] } = {\n baseEntityIds: bases?.length ? bases : [scriptId],\n external,\n ...(current.payload.style === undefined ? {} : { style: current.payload.style }),\n selection: selection ?? { segmentId: range.segmentId },\n extent: { kind: 'bounded', start: range.startMs, end: range.endMs },\n sampling: 'native',\n coordinateSpace: 'milliseconds',\n segmentRanges: [range],\n };\n const id = index === 0 ? entityId : this.entitySandbox.entities.create({ entity_kind: 'caption', payload });\n if (index === 0) this.entitySandbox.entities.update({ entity_id: id, payload });\n this.resolvedCaptionAssets.add(`${id}:${assetId}`);\n }\n const markerId = this.entitySandbox.entities.create({\n entity_kind: 'sequence-marker',\n payload: {\n sourceRange: {\n start: Math.min(...ranges.map((r) => r.startMs)),\n end: Math.max(...ranges.map((r) => r.endMs)),\n },\n duration: { mode: 'from-source' },\n segmentRanges: ranges,\n },\n });\n this.entitySandbox.relations.link({\n relation_kind: 'audio-script-marker',\n endpoint_0_entity_id: scriptId,\n endpoint_1_entity_id: markerId,\n });\n }\n this.resolvedCaptionAssets.add(`${entityId}:${assetId}`);\n return result;\n }\n\n private initializedAsset(entityId: string, assetId: string): boolean {\n const current = this.entitySandbox.entities.get(entityId);\n if (\n this.resolvedCaptionAssets.has(`${entityId}:${assetId}`) &&\n isJsonObject(current?.payload.selection) &&\n Array.isArray(current?.payload.baseEntityIds)\n )\n return true;\n const baseline = this.baseRows.entities.find((row) => row.entityId === entityId);\n const external = baseline?.payload.external;\n return (\n !!external &&\n typeof external === 'object' &&\n !Array.isArray(external) &&\n 'key' in external &&\n external.key === assetId\n );\n }\n\n private initializedSpeech(entity: SandboxEntity): boolean {\n const signature = speechAssetSignature(entity.payload);\n if (this.resolvedSpeechAssets.get(entity.entity_id) === signature) return true;\n const baseline = this.baseRows.entities.find((row) => row.entityId === entity.entity_id);\n return baseline !== undefined && speechAssetSignature(baseline.payload as JsonObject) === signature;\n }\n\n /** Finish resource initialization before validation; no partial rows are published. */\n async prepareEntityAssets(load: (entity: SandboxEntity) => Promise<EntityAssetContent>): Promise<void> {\n for (const entity of this.entitySandbox.entities.list()) {\n if (this.entitySandbox.resourceEntity(entity.entity_id)?.entity_id !== entity.entity_id) continue;\n const external = entity.payload.external;\n if (\n external &&\n typeof external === 'object' &&\n !Array.isArray(external) &&\n typeof external.key === 'string' &&\n ((entity.entity_kind === 'caption' && !this.initializedAsset(entity.entity_id, external.key)) ||\n (entity.entity_kind === 'voice' && external.system === 'memota-speech' && !this.initializedSpeech(entity)))\n )\n await this.rgetAssetFromEntity(entity.entity_id, load);\n }\n }\n\n /** Direct script writes save a resource before the entity graph can be committed. */\n async persistAudioScriptAssets(\n write: (\n entity: SandboxEntity,\n content: import('../entity/entity-contract.ts').JsonValue,\n ) => Promise<EntityAssetContent>,\n ): Promise<void> {\n for (const entity of this.entitySandbox.entities.list()) {\n if (entity.entity_kind !== 'audio-script') continue;\n // Existing script resources are versioned by the server after native merge.\n if (hasAudioScriptAsset(entity.payload) || !this.directScriptWrites.has(entity.entity_id)) continue;\n const content = audioScriptAssetContent(entity.payload) as JsonObject;\n const saved = await write(entity, content);\n if (JSON.stringify(saved.content) !== JSON.stringify(content))\n throw new Error('AudioScript resource writer changed the submitted content');\n this.entitySandbox.entities.declareFields({\n entity_id: entity.entity_id,\n payload: audioScriptAssetFields(entity.payload, saved.assetId) as JsonObject,\n });\n }\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));\n return {\n ...(entityPlan.rows.loroSnapshot\n ? {\n loro_update: bytesToBase64(this.compileJournal(entityPlan)),\n }\n : {}),\n plan_kind: 'entities',\n doc_id: this.docId,\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 private compileJournal(plan: ReturnType<EntitySandbox['buildPlan']>): Uint8Array {\n const editor = LoroEntityDocument.fromSnapshot(base64ToBytes(plan.rows.loroSnapshot!), (state) => {\n assertCanonicalEditorResources(state.rows);\n projectEntityTimeline(state.rows);\n });\n return editor.transact((draft) => {\n for (const command of plan.commands) {\n switch (command.kind) {\n case 'create-entity': {\n const rows = toDslRows({\n revision: 0,\n audioScriptEntityId: null,\n entities: [command.entity],\n relations: [],\n });\n draft.create(rows.entities[0]!);\n if (\n command.entity.entity_kind === 'audio-script' &&\n command.entity.entity_id === plan.rows.audioScriptEntityId\n )\n draft.attach('audioScriptEntityId', command.entity.entity_id);\n break;\n }\n case 'update-entity':\n draft.replaceOwned(command.entity_id, command.payload);\n break;\n case 'change-entity':\n draft.change(command.entity_id, command.changes);\n break;\n case 'delete-entity':\n draft.delete(command.entity_id);\n break;\n case 'link-relation': {\n const rows = toDslRows({\n revision: 0,\n audioScriptEntityId: null,\n entities: [],\n relations: [command.relation],\n });\n draft.link(rows.relations[0]!);\n break;\n }\n case 'change-relation':\n draft.changeRelation(command.relation_id, command.changes);\n break;\n case 'unlink-relation':\n draft.unlink(command.relation_id);\n break;\n }\n }\n draft.reconcileOrder(toDslRows(plan.rows));\n });\n }\n\n getLogs(): readonly string[] {\n return this.logs;\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 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\" />\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 { EntityAssetContent } from '../entity/entity-asset.ts';\nimport type { SandboxEntity } from '../entity/entity-contract.ts';\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 { 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 docId: string;\n document: VideoDocument;\n script: string;\n inputs?: Record<string, unknown>;\n entityState?: EntityStoreSnapshot;\n idLabel?: string;\n}\n\ntype HostMessage =\n | { t: 'entity-asset'; requestId: number; entity: SandboxEntity }\n | { t: 'write-entity-asset'; requestId: number; entity: SandboxEntity; content: EntityAssetContent['content'] }\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;\nlet requestId = 0;\nconst pending = new Map<number, { resolve: (result: EntityAssetContent) => void; reject: (error: Error) => void }>();\nport.on('message', (message: { t: string; requestId: number; result: EntityAssetContent; error?: string }) => {\n if (message.t !== 'entity-asset-result') return;\n const waiter = pending.get(message.requestId);\n pending.delete(message.requestId);\n if (message.error) waiter?.reject(new Error(message.error));\n else waiter?.resolve(message.result);\n});\nfunction loadEntityAsset(entity: SandboxEntity): Promise<EntityAssetContent> {\n return new Promise((resolve, reject) => {\n const id = ++requestId;\n pending.set(id, { resolve, reject });\n port.postMessage({ t: 'entity-asset', requestId: id, entity });\n });\n}\n\nfunction writeEntityAsset(entity: SandboxEntity, content: EntityAssetContent['content']): Promise<EntityAssetContent> {\n return new Promise((resolve, reject) => {\n const id = ++requestId;\n pending.set(id, { resolve, reject });\n port.postMessage({ t: 'write-entity-asset', requestId: id, entity, content });\n });\n}\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 docId: data.docId,\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 = new EntityEditSandboxSession(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 (entities, relations, checkpoint, rollbackTo, inputs, console, rgetAssetFromEntity) => {${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 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 rgetAssetFromEntity: (entityId: string) => Promise<EntityAssetContent>,\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.entities,\n session.relations,\n session.checkpoint,\n session.rollbackTo,\n data.inputs ?? {},\n session.console,\n async (entityId) => {\n await session.persistAudioScriptAssets(writeEntityAsset);\n return session.rgetAssetFromEntity(entityId, loadEntityAsset);\n },\n );\n await session.prepareEntityAssets(loadEntityAsset);\n await session.persistAudioScriptAssets(writeEntityAsset);\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":";;;;;;;AAyBA,SAAgB,qBAAqB,SAA2C;CAC9E,IAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,KAAK,CAAC,MAAM,QAAQ,QAAQ,QAAQ,GACtG,MAAM,IAAI,MAAM,mEAAmE;CACrF,IAAI,CAAC,QAAQ,SAAS,QAAQ,MAAM,IAAI,MAAM,2CAA2C;CACzF,OAAO,QAAQ,SAAS,KAAK,UAAU;EACrC,IACE,CAAC,SACD,OAAO,UAAU,YACjB,MAAM,QAAQ,KAAK,KACnB,OAAO,MAAM,SAAS,YACtB,CAAC,MAAM,KAAK,KAAK,KACjB,CAAC,OAAO,cAAc,MAAM,aAAa,KACzC,CAAC,OAAO,cAAc,MAAM,WAAW,KACtC,MAAM,gBAA2B,KACjC,MAAM,eAA2B,MAAM,eAExC,MAAM,IAAI,MAAM,sDAAsD;EACxE,OAAO;GAAE,MAAM,MAAM;GAAM,eAAe,MAAM;GAAyB,aAAa,MAAM;EAAsB;CACpH,CAAC;AACH;;AAGA,SAAgB,kBAAkB,SAAgC;CACh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ts","../src/sandbox/entity-script-session.ts","../src/sandbox/worker-entry.ts"],"sourcesContent":["import type { JsonObject, JsonValue, SandboxEntity } from './entity-contract.ts';\n\n/** Immutable resource content resolved by the host for a document Entity. */\nexport interface EntityAssetContent {\n assetId: string;\n content: JsonValue;\n}\n\n/** Host-only I/O. The sandbox supplies an Entity, never an arbitrary Asset query. */\nexport type EntityAssetLoader = (docId: string, entity: SandboxEntity) => Promise<EntityAssetContent>;\n\n/** Program-only initial resource creation; never exposed as a sandbox API. */\nexport type EntityAssetWriter = (\n docId: string,\n entity: SandboxEntity,\n content: JsonValue,\n) => Promise<EntityAssetContent>;\n\nexport interface CaptionAssetSegment {\n text: string;\n start_time_ms: number;\n end_time_ms: number;\n}\n\n/** MCAP's output_caption JSON contract; unknown formats never become invented captions. */\nexport function captionAssetSegments(content: JsonValue): CaptionAssetSegment[] {\n if (!content || typeof content !== 'object' || Array.isArray(content) || !Array.isArray(content.segments))\n throw new Error('Caption Asset must contain an output_caption object with segments');\n if (!content.segments.length) throw new Error('Caption Asset contains no speech segments');\n return content.segments.map((value) => {\n if (\n !value ||\n typeof value !== 'object' ||\n Array.isArray(value) ||\n typeof value.text !== 'string' ||\n !value.text.trim() ||\n !Number.isSafeInteger(value.start_time_ms) ||\n !Number.isSafeInteger(value.end_time_ms) ||\n (value.start_time_ms as number) < 0 ||\n (value.end_time_ms as number) <= (value.start_time_ms as number)\n )\n throw new Error('Caption Asset has invalid text or millisecond timing');\n return { text: value.text, start_time_ms: value.start_time_ms as number, end_time_ms: value.end_time_ms as number };\n });\n}\n\n/**\n * Persisted voiceover Audio facts, resolved by the host rather than inferred\n * from transcript timing.\n *\n * A returned voice-library descriptor is validated but never written here: the\n * timbre is its own Voice entity linked by a `voice-timbre` Relation, so the\n * rendered Audio row stays resource-only.\n */\nexport function speechAssetFields(content: JsonValue): JsonObject {\n if (\n !content ||\n typeof content !== 'object' ||\n Array.isArray(content) ||\n typeof content.storageKey !== 'string' ||\n !content.storageKey.trim() ||\n !Number.isSafeInteger(content.durationMs) ||\n (content.durationMs as number) <= 0\n )\n throw new Error('Speech Asset requires factual storageKey and positive millisecond duration');\n const voice = content.voice;\n if (\n voice !== undefined &&\n (!voice ||\n typeof voice !== 'object' ||\n Array.isArray(voice) ||\n voice.system !== 'voice-library' ||\n typeof voice.key !== 'string' ||\n !voice.key.trim())\n )\n throw new Error('Speech Asset has an invalid voice-library identity');\n return {\n storageKey: content.storageKey,\n extent: { kind: 'bounded', start: 0, end: content.durationMs },\n sampling: 'native',\n coordinateSpace: 'milliseconds',\n };\n}\n\n/** Only resource facts participate; user placement and other fields remain untouched. */\nexport function speechAssetSignature(payload: JsonObject): string {\n return JSON.stringify(['external', 'storageKey', 'extent', 'sampling', 'coordinateSpace'].map((key) => payload[key]));\n}\n","import {\n LoroEntityDocument,\n audioScriptAssetContent,\n audioScriptAssetFields,\n hasAudioScriptAsset,\n projectEntityTimeline,\n base64ToBytes,\n bytesToBase64,\n assertCanonicalEditorResources,\n assertMediaAssetWritePolicy,\n} from '@mengine/medeo-client';\nimport { isJsonObject, type EntityRelationRows } from '@mengine/medeo-dsl';\n\nimport {\n captionAssetSegments,\n speechAssetFields,\n speechAssetSignature,\n type EntityAssetContent,\n} from '../entity/entity-asset.ts';\nimport type {\n BusinessEntityFacade,\n BusinessRelationFacade,\n EntitySandboxCheckpoint,\n SandboxEntity,\n JsonObject,\n} from '../entity/entity-contract.ts';\nimport { EntitySandbox, toDslRows, type DomainIdFactory } from '../entity/entity-sandbox.ts';\nimport { businessFacades } from './business-facades.ts';\nimport type { ChangePlan, ConsoleShim, EditSandboxSessionOptions } 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/** Entity/relation script session; compilation retains the ordered operation journal. */\nexport class EntityEditSandboxSession {\n private readonly docId: string;\n private readonly entitySandbox: EntitySandbox;\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 readonly directScriptWrites = new Set<string>();\n private readonly resolvedCaptionAssets = new Set<string>();\n private logCapped = false;\n private readonly resolvedSpeechAssets = new Map<string, string>();\n\n readonly entities: BusinessEntityFacade;\n readonly relations: BusinessRelationFacade;\n readonly console: ConsoleShim;\n readonly checkpoint: () => EntitySandboxCheckpoint;\n readonly rollbackTo: (cp: EntitySandboxCheckpoint) => void;\n\n // The Entity sandbox edits Entity rows only; the legacy VideoDocument\n // projection is not an input to it (P7M14 separated content from identity).\n constructor(options?: EditSandboxSessionOptions) {\n this.docId = options?.docId ?? '';\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 const business = businessFacades(this.entitySandbox.entities, this.entitySandbox.relations, (id) =>\n this.directScriptWrites.add(id),\n );\n this.entities = business.entities;\n this.relations = business.relations;\n this.console = this.buildConsoleShim();\n const checkpoints = new Map<EntitySandboxCheckpoint, { index: number; scripts: Set<string> }>();\n this.checkpoint = () => {\n const token = Object.freeze({}) as EntitySandboxCheckpoint;\n checkpoints.set(token, { index: this.entitySandbox.commandCount, scripts: new Set(this.directScriptWrites) });\n return token;\n };\n this.rollbackTo = (cp) => {\n const index = checkpoints.get(cp);\n if (index === undefined) throw new Error('Invalid or expired sandbox checkpoint');\n this.entitySandbox.rollbackTo(index.index);\n this.directScriptWrites.clear();\n for (const id of index.scripts) this.directScriptWrites.add(id);\n let later = false;\n for (const token of checkpoints.keys()) {\n if (later) checkpoints.delete(token);\n if (token === cp) later = true;\n }\n };\n }\n\n /** Resolve only the resource attached to this Entity; I/O remains in the parent host. */\n async rgetAssetFromEntity(\n entityId: string,\n load: (entity: SandboxEntity) => Promise<EntityAssetContent>,\n ): Promise<EntityAssetContent> {\n const requested = this.entitySandbox.entities.get(entityId);\n const entity = requested ? this.entitySandbox.resourceEntity(entityId) : null;\n if (!entity || entity.entity_kind === 'asset') throw new Error(`Business Entity not found: ${entityId}`);\n const external = entity.payload.external;\n if (!external || typeof external !== 'object' || Array.isArray(external) || typeof external.key !== 'string')\n throw new Error(`Entity ${entityId} has no attached Asset`);\n if (entity.entity_id !== entityId) return this.rgetAssetFromEntity(entity.entity_id, load);\n const assetId = external.key;\n const result = await load(entity);\n if (result.assetId !== external.key) throw new Error('Host returned a different Entity Asset');\n const current = this.entitySandbox.entities.get(entityId);\n if (!current || JSON.stringify(current.payload.external) !== JSON.stringify(external))\n throw new Error('Entity resource changed during its read');\n if (entity.entity_kind === 'audio' && external.system === 'memota-speech') {\n const fields = speechAssetFields(result.content);\n // Host declarations initialize nested facts; native compilation writes only\n // their changed leaves against this session's original causal baseline.\n if (Object.entries(fields).some(([key, value]) => JSON.stringify(current.payload[key]) !== JSON.stringify(value)))\n this.entitySandbox.entities.declareFields({ entity_id: entityId, payload: fields });\n this.resolvedSpeechAssets.set(entityId, speechAssetSignature(this.entitySandbox.entities.get(entityId)!.payload));\n }\n if (entity.entity_kind === 'caption' && !this.initializedAsset(entityId, external.key)) {\n const timed = captionAssetSegments(result.content);\n const segments = timed.map((segment, index) => ({\n segmentId: `asset:${assetId}:${index}`,\n text: segment.text,\n }));\n // An explicit composition determines the owner, never the panel selection.\n // Resource-only captions establish their own independent complete script.\n const bases = current.payload.baseEntityIds as string[] | undefined;\n const scriptId = bases?.length\n ? this.entitySandbox.captionAudioScriptId(entityId)\n : this.entitySandbox.entities.create({ entity_kind: 'audio-script', payload: { segments: [] } });\n const script = this.entitySandbox.entities.get(scriptId)!;\n const existing = script.payload.segments as { segmentId: string; text: string }[];\n const additions = segments.filter((segment) => !existing.some((item) => item.segmentId === segment.segmentId));\n this.entitySandbox.entities.update({ entity_id: scriptId, payload: { segments: [...existing, ...additions] } });\n const ranges = timed.map((segment, index) => ({\n segmentId: segments[index]!.segmentId,\n startMs: segment.start_time_ms,\n endMs: segment.end_time_ms,\n }));\n // One resource retains one complete script, but each Caption quotes only one segment.\n const selection = current.payload.selection;\n if (selection !== undefined && (!isJsonObject(selection) || typeof selection.segmentId !== 'string'))\n throw new Error('Caption selection must be one segment selection object');\n const selected =\n selection === undefined ? ranges : ranges.filter((range) => range.segmentId === selection.segmentId);\n if (!selected.length) throw new Error('Caption selection does not name a segment of its resource');\n for (const [index, range] of selected.entries()) {\n const payload: JsonObject & { baseEntityIds: string[] } = {\n baseEntityIds: bases?.length ? bases : [scriptId],\n external,\n ...(current.payload.style === undefined ? {} : { style: current.payload.style }),\n selection: selection ?? { segmentId: range.segmentId },\n extent: { kind: 'bounded', start: range.startMs, end: range.endMs },\n sampling: 'native',\n coordinateSpace: 'milliseconds',\n segmentRanges: [range],\n };\n const id = index === 0 ? entityId : this.entitySandbox.entities.create({ entity_kind: 'caption', payload });\n if (index === 0) this.entitySandbox.entities.update({ entity_id: id, payload });\n this.resolvedCaptionAssets.add(`${id}:${assetId}`);\n }\n const markerId = this.entitySandbox.entities.create({\n entity_kind: 'sequence-marker',\n payload: {\n sourceRange: {\n start: Math.min(...ranges.map((r) => r.startMs)),\n end: Math.max(...ranges.map((r) => r.endMs)),\n },\n duration: { mode: 'from-source' },\n segmentRanges: ranges,\n },\n });\n this.entitySandbox.relations.link({\n relation_kind: 'audio-script-marker',\n endpoint_0_entity_id: scriptId,\n endpoint_1_entity_id: markerId,\n });\n }\n this.resolvedCaptionAssets.add(`${entityId}:${assetId}`);\n return result;\n }\n\n private initializedAsset(entityId: string, assetId: string): boolean {\n const current = this.entitySandbox.entities.get(entityId);\n if (\n this.resolvedCaptionAssets.has(`${entityId}:${assetId}`) &&\n isJsonObject(current?.payload.selection) &&\n Array.isArray(current?.payload.baseEntityIds)\n )\n return true;\n const baseline = this.baseRows.entities.find((row) => row.entityId === entityId);\n const external = baseline?.payload.external;\n return (\n !!external &&\n typeof external === 'object' &&\n !Array.isArray(external) &&\n 'key' in external &&\n external.key === assetId\n );\n }\n\n private initializedSpeech(entity: SandboxEntity): boolean {\n const signature = speechAssetSignature(entity.payload);\n if (this.resolvedSpeechAssets.get(entity.entity_id) === signature) return true;\n const baseline = this.baseRows.entities.find((row) => row.entityId === entity.entity_id);\n return baseline !== undefined && speechAssetSignature(baseline.payload as JsonObject) === signature;\n }\n\n /** Finish resource initialization before validation; no partial rows are published. */\n async prepareEntityAssets(load: (entity: SandboxEntity) => Promise<EntityAssetContent>): Promise<void> {\n for (const entity of this.entitySandbox.entities.list()) {\n if (this.entitySandbox.resourceEntity(entity.entity_id)?.entity_id !== entity.entity_id) continue;\n const external = entity.payload.external;\n if (\n external &&\n typeof external === 'object' &&\n !Array.isArray(external) &&\n typeof external.key === 'string' &&\n ((entity.entity_kind === 'caption' && !this.initializedAsset(entity.entity_id, external.key)) ||\n (entity.entity_kind === 'audio' && external.system === 'memota-speech' && !this.initializedSpeech(entity)))\n )\n await this.rgetAssetFromEntity(entity.entity_id, load);\n }\n }\n\n /** Direct script writes save a resource before the entity graph can be committed. */\n async persistAudioScriptAssets(\n write: (\n entity: SandboxEntity,\n content: import('../entity/entity-contract.ts').JsonValue,\n ) => Promise<EntityAssetContent>,\n ): Promise<void> {\n for (const entity of this.entitySandbox.entities.list()) {\n if (entity.entity_kind !== 'audio-script') continue;\n // Existing script resources are versioned by the server after native merge.\n if (hasAudioScriptAsset(entity.payload) || !this.directScriptWrites.has(entity.entity_id)) continue;\n const content = audioScriptAssetContent(entity.payload) as JsonObject;\n const saved = await write(entity, content);\n if (JSON.stringify(saved.content) !== JSON.stringify(content))\n throw new Error('AudioScript resource writer changed the submitted content');\n this.entitySandbox.entities.declareFields({\n entity_id: entity.entity_id,\n payload: audioScriptAssetFields(entity.payload, saved.assetId) as JsonObject,\n });\n }\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));\n return {\n ...(entityPlan.rows.loroSnapshot\n ? {\n loro_update: bytesToBase64(this.compileJournal(entityPlan)),\n }\n : {}),\n plan_kind: 'entities',\n doc_id: this.docId,\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 private compileJournal(plan: ReturnType<EntitySandbox['buildPlan']>): Uint8Array {\n const editor = LoroEntityDocument.fromSnapshot(base64ToBytes(plan.rows.loroSnapshot!), (state) => {\n assertCanonicalEditorResources(state.rows);\n projectEntityTimeline(state.rows);\n });\n return editor.transact((draft) => {\n for (const command of plan.commands) {\n switch (command.kind) {\n case 'create-entity': {\n const rows = toDslRows({\n revision: 0,\n audioScriptEntityId: null,\n entities: [command.entity],\n relations: [],\n });\n draft.create(rows.entities[0]!);\n if (\n command.entity.entity_kind === 'audio-script' &&\n command.entity.entity_id === plan.rows.audioScriptEntityId\n )\n draft.attach('audioScriptEntityId', command.entity.entity_id);\n break;\n }\n case 'update-entity':\n draft.replaceOwned(command.entity_id, command.payload);\n break;\n case 'change-entity':\n draft.change(command.entity_id, command.changes);\n break;\n case 'delete-entity':\n draft.delete(command.entity_id);\n break;\n case 'link-relation': {\n const rows = toDslRows({\n revision: 0,\n audioScriptEntityId: null,\n entities: [],\n relations: [command.relation],\n });\n draft.link(rows.relations[0]!);\n break;\n }\n case 'change-relation':\n draft.changeRelation(command.relation_id, command.changes);\n break;\n case 'unlink-relation':\n draft.unlink(command.relation_id);\n break;\n }\n }\n draft.reconcileOrder(toDslRows(plan.rows));\n });\n }\n\n getLogs(): readonly string[] {\n return this.logs;\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 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\" />\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 { EntityAssetContent } from '../entity/entity-asset.ts';\nimport type { SandboxEntity } from '../entity/entity-contract.ts';\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 { 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 docId: string;\n document: VideoDocument;\n script: string;\n inputs?: Record<string, unknown>;\n entityState?: EntityStoreSnapshot;\n idLabel?: string;\n}\n\ntype HostMessage =\n | { t: 'entity-asset'; requestId: number; entity: SandboxEntity }\n | { t: 'write-entity-asset'; requestId: number; entity: SandboxEntity; content: EntityAssetContent['content'] }\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;\nlet requestId = 0;\nconst pending = new Map<number, { resolve: (result: EntityAssetContent) => void; reject: (error: Error) => void }>();\nport.on('message', (message: { t: string; requestId: number; result: EntityAssetContent; error?: string }) => {\n if (message.t !== 'entity-asset-result') return;\n const waiter = pending.get(message.requestId);\n pending.delete(message.requestId);\n if (message.error) waiter?.reject(new Error(message.error));\n else waiter?.resolve(message.result);\n});\nfunction loadEntityAsset(entity: SandboxEntity): Promise<EntityAssetContent> {\n return new Promise((resolve, reject) => {\n const id = ++requestId;\n pending.set(id, { resolve, reject });\n port.postMessage({ t: 'entity-asset', requestId: id, entity });\n });\n}\n\nfunction writeEntityAsset(entity: SandboxEntity, content: EntityAssetContent['content']): Promise<EntityAssetContent> {\n return new Promise((resolve, reject) => {\n const id = ++requestId;\n pending.set(id, { resolve, reject });\n port.postMessage({ t: 'write-entity-asset', requestId: id, entity, content });\n });\n}\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 docId: data.docId,\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 = new EntityEditSandboxSession(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 (entities, relations, checkpoint, rollbackTo, inputs, console, rgetAssetFromEntity) => {${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 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 rgetAssetFromEntity: (entityId: string) => Promise<EntityAssetContent>,\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.entities,\n session.relations,\n session.checkpoint,\n session.rollbackTo,\n data.inputs ?? {},\n session.console,\n async (entityId) => {\n await session.persistAudioScriptAssets(writeEntityAsset);\n return session.rgetAssetFromEntity(entityId, loadEntityAsset);\n },\n );\n await session.prepareEntityAssets(loadEntityAsset);\n await session.persistAudioScriptAssets(writeEntityAsset);\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":";;;;;;;AAyBA,SAAgB,qBAAqB,SAA2C;CAC9E,IAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,KAAK,CAAC,MAAM,QAAQ,QAAQ,QAAQ,GACtG,MAAM,IAAI,MAAM,mEAAmE;CACrF,IAAI,CAAC,QAAQ,SAAS,QAAQ,MAAM,IAAI,MAAM,2CAA2C;CACzF,OAAO,QAAQ,SAAS,KAAK,UAAU;EACrC,IACE,CAAC,SACD,OAAO,UAAU,YACjB,MAAM,QAAQ,KAAK,KACnB,OAAO,MAAM,SAAS,YACtB,CAAC,MAAM,KAAK,KAAK,KACjB,CAAC,OAAO,cAAc,MAAM,aAAa,KACzC,CAAC,OAAO,cAAc,MAAM,WAAW,KACtC,MAAM,gBAA2B,KACjC,MAAM,eAA2B,MAAM,eAExC,MAAM,IAAI,MAAM,sDAAsD;EACxE,OAAO;GAAE,MAAM,MAAM;GAAM,eAAe,MAAM;GAAyB,aAAa,MAAM;EAAsB;CACpH,CAAC;AACH;;;;;;;;;AAUA,SAAgB,kBAAkB,SAAgC;CAChE,IACE,CAAC,WACD,OAAO,YAAY,YACnB,MAAM,QAAQ,OAAO,KACrB,OAAO,QAAQ,eAAe,YAC9B,CAAC,QAAQ,WAAW,KAAK,KACzB,CAAC,OAAO,cAAc,QAAQ,UAAU,KACvC,QAAQ,cAAyB,GAElC,MAAM,IAAI,MAAM,4EAA4E;CAC9F,MAAM,QAAQ,QAAQ;CACtB,IACE,UAAU,KAAA,MACT,CAAC,SACA,OAAO,UAAU,YACjB,MAAM,QAAQ,KAAK,KACnB,MAAM,WAAW,mBACj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AG;GAAQ,OAAO;GAAW,OADxB,kBAAkB,OAAO,KAAK,QAAQ,SACL;EAAE,CAAC;EAChD;CACF;CAEA,MAAM,OAAO,QAAQ,UAAU,EAAE;CACjC,KAAK;EACH,GAAG;EACH,GAAI,KAAK,cAAc,EAAE,YAAY,KAAK,YAAY,IAAI,CAAC;EAC3D,SAAS,KAAK;EACd,UAAU,KAAK,IAAI;EACnB,qBAAqB,KAAK,gBAAgB;EAC1C,oBAAoB,KAAK;EACzB,GAAI,KAAK,gBAAgB,KAAA,IAAY,EAAE,YAAY,KAAK,YAAY,IAAI,CAAC;EACzE,kBAAkB,KAAK,sBAAsB,CAAC;EAC9C,oBAAoB,KAAK,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mengine/medeo-tool",
|
|
3
|
-
"version": "2.0.1-alpha.
|
|
3
|
+
"version": "2.0.1-alpha.9",
|
|
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": "2.0.1-alpha.
|
|
27
|
+
"@mengine/medeo-client": "2.0.1-alpha.9"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^25.9.1",
|