@mengine/medeo-tool 1.4.1-alpha.0 → 1.4.1-alpha.1
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/README.md +7 -5
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{script-session-DTq_VPEA.mjs → script-session-AukLN7x7.mjs} +3 -3
- package/dist/script-session-AukLN7x7.mjs.map +1 -0
- package/dist/worker-entry.mjs +1 -1
- package/package.json +2 -2
- package/dist/script-session-DTq_VPEA.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -57,11 +57,13 @@ const entityRun = await medeo.handle({
|
|
|
57
57
|
await medeo.close();
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
The
|
|
61
|
-
read, create, update, delete, import
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
`external
|
|
60
|
+
The sandbox exposes only business Entity/Relation operations. It has no Asset
|
|
61
|
+
lookup, read, create, update, delete, import or binding API. `ensureMedia`,
|
|
62
|
+
`findByAssetId` and Asset-based editor shortcuts remain host-only.
|
|
63
|
+
Generation tools may return Asset IDs. Entity operations accept these IDs in
|
|
64
|
+
`external: { system: 'memota', key: assetId }`; assembled entity reads preserve
|
|
65
|
+
that reference. An Asset ID is not an Entity ID, a composition base or a Relation
|
|
66
|
+
endpoint. Physical `storageKey` access and Asset rows remain host-only.
|
|
65
67
|
|
|
66
68
|
`materializeResources` is a host API. It creates media entities from factual
|
|
67
69
|
resources, or Caption with composed AudioScript text, ASR annotation markers
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createEntityId, c as collectAffectedPartIds, i as businessState, l as renderPreview, n as EntitySandbox, o as createRelationId, s as isMediaAssetVariantKind, t as EditSandboxSession, u as renderCompactProjection } from "./script-session-
|
|
1
|
+
import { a as createEntityId, c as collectAffectedPartIds, i as businessState, l as renderPreview, n as EntitySandbox, o as createRelationId, s as isMediaAssetVariantKind, t as EditSandboxSession, u as renderCompactProjection } from "./script-session-AukLN7x7.mjs";
|
|
2
2
|
import { LoroEntityDocument, ManualSyncDoc, MengineHttpClient, MengineHttpRequestError, ValidationError, base64ToBytes, bytesToBase64, compileEntityRows, createMirrorVideoDocument, createPlainMemoryAdapter, decodeDocVersionMark, encodeDocVersionMark, ensureEditorFoundation, replayJournal, toVideoDocument } from "@mengine/medeo-client";
|
|
3
3
|
import { Worker } from "node:worker_threads";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -1108,13 +1108,13 @@ Operations:
|
|
|
1108
1108
|
|
|
1109
1109
|
Default flow: snapshot → run-edit-script with auto_commit=false → inspect preview → commit-plan. Use auto_commit=true only for low-risk edits when the host does not need user confirmation. Concurrent edits do not require replaying the script against a newer snapshot. If a domain conflict is reported, inspect the merged state and resolve it explicitly; never replace the complete document to force the edit through.
|
|
1110
1110
|
|
|
1111
|
-
|
|
1111
|
+
Generation tools return Asset references, not domain Entity ids. An Asset id may be passed as an entity resource field: external: { system: "memota", key: assetId }. Create or update the domain Entity using entities.*, then place its Entity id with edit.insertClip. Asset ids are not Entity ids, baseEntityIds or Relation endpoints. The sandbox exposes no Asset creation, lookup, reading or storage API; the host resolves resource references. Each placement has its own Clip and SequenceMarker. Generation lineage is host-synced; relations.of(entityId) is endpoint-agnostic.
|
|
1112
1112
|
`.trim();
|
|
1113
1113
|
const MEDEO_TOOL_EXECUTION_RULES = `
|
|
1114
1114
|
The host supplies the current document. Do not ask for, invent, or pass a document id.
|
|
1115
1115
|
timeline.snapshot() returns the Entity/Relation graph with its revision, not a legacy VideoDraft. Inspect Timeline, Track, Clip, SequenceMarker and their relations to plan edits.
|
|
1116
|
-
Inspect existing Image/Video/Audio/Voice Entities and their factual extents before placing them.
|
|
1117
|
-
Caption composes AudioScript text. Its optional
|
|
1116
|
+
Inspect existing Image/Video/Audio/Voice Entities and their factual extents before placing them. For an uploaded or generated resource, create its media Entity with the returned Asset id in external.key and the factual media extent. The host resolves its physical resource. Replace a Clip's content using another content Entity id. Never fabricate a duration.
|
|
1117
|
+
Caption composes AudioScript text. Its optional external field may carry the Caption Asset id; the host resolves that resource. A Caption created from AudioScript may have no physical resource. Read and edit assembled fields through entities; do not create Asset entities or physical-asset Relations.
|
|
1118
1118
|
The editor projection supports the existing four Track roles: video_clip (Image/Video), speech (Voice), caption (Caption), and bgm (Audio), one of each. Clip.volume is decibels (-60 to 20, 0 = original). Marker.sourceRange is the selected source interval; Marker.duration is effective display/playback duration. Coordinates and duration are whole milliseconds for this reader, not a global DSL restriction. Placement is exactly one of Clip.order, Marker.targetRange, or clip-anchor(child,host) plus Marker.anchorOffset. Use the native move/delete/voiceover helpers so placement and cascade decisions are in the same entity plan. Reading the graph never rebinds anchors or invents empty clips. Linear timeRemapping is {kind:'linear',rate:2,mode:'constant'} and agrees with rounded source span divided by rate. Image remains unbounded/constant; an explicit linear rate scales its display window, not an invented media extent. Nonlinear speed and multiple visual overlay tracks are unsupported.
|
|
1119
1119
|
Entities own fields; ordinary Relations express associations; variants directly hold baseEntityIds and assemble the referenced entities. These foundations are fixed: implementation must follow them, never redefine them. Any entity may compose multiple bases. Equal field names from multiple bases (even equal values) are errors, even when the variant declares that field itself. After validating all base fields are unambiguous, explicitly declared own fields may override base fields without mutating the bases. Base ordering never resolves conflicts. AudioScript owns segmented text. Caption and PhoneticScript persist baseEntityIds including their AudioScript, plus their own fields; no composition Relation exists. Create the real bases before reading or committing a variant. Inside the DSL sandbox, entities.get/list expose complete assembled fields. Consumers read fields without inspecting base IDs or merging bases. entities.update patches supplied fields and routes inherited fields to their declaring entity; omitted fields remain unchanged. entities.declareFields explicitly declares own overrides and is distinct from an ordinary field edit. Persistence keeps owned fields only. entities.readCaptionContent(id) and entities.readPhoneticScriptContent(id) return assembled text. Missing/cyclic bases and field conflicts fail before persistence.
|
|
1120
1120
|
Use edit.insertCaptionClip with baseEntityIds and selections, plus captionEntityId when generation returned a Caption identity; each voiceover caption also supplies baseEntityIds. A selection names segmentId and may use a half-open Unicode code-point textRange to split a segment for the screen without rewriting AudioScript. Generate Voice from an existing PhoneticScript, then use phoneticScriptEntityId in the voiceover helper or relations.linkPhoneticScriptRender({output_entity_id,phonetic_script_entity_id}) for its render relation. Caption and Voice have their own Clips; display anchoring is explicit and independent of composition/alignment.
|