Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

Merge latest Motion development changes

qindong1d90993be774
diff --cc tests/multi-project.test.ts
index 0520792a,bb246823..b581402c
--- a/tests/multi-project.test.ts
+++ b/tests/multi-project.test.ts
@@@ -59,14 -51,17 +59,25 @@@ test('one native service keeps both pro
for (const id of [a, b]) {
const history = await fetch(`${base()}/api/projects/${id}/history`);
assert.equal(history.status, 200, await history.clone().text());
+ const postHistory = (projectId: string, action: string) => fetch(`${base()}/api/projects/${projectId}/history/${action}`, {
+ method: 'POST', headers: { Origin: base(), 'Content-Type': 'application/json' }, body: JSON.stringify({ label: 'Agent edit', exclusive: true }),
+ });
+ const opened = await postHistory(id, 'window');
+ assert.equal(opened.status, 200, await opened.clone().text());
+ const { windowId } = await opened.json();
+ assert.equal((await postHistory(id === a ? b : a, `window/${windowId}/close`)).status, 409);
+ await writeFile(path.join(store.projectDirectoryFor(id), 'notes.txt'), `Updated by ${id}`);
+ const closed = await postHistory(id, `window/${windowId}/close`);
+ assert.equal(closed.status, 200, await closed.clone().text());
+ assert.ok((await closed.json()).entry, 'a history window must survive separate requests for its own project');
+ const project = await call('motion_get_project', { projectId: id });
+ const edit = await call('motion_edit_project', {
+ projectId: id, requestId: crypto.randomUUID(), expectedRevision: project.revision,
+ expectedVersionId: project.currentVersionId, presentation: 'background',
+ files: [{ path: 'agent-notes.txt', content: `Edited in ${id}` }],
+ });
+ assert.equal(edit.changed, true);
+ assert.equal(await readFile(path.join(store.projectDirectoryFor(id), 'agent-notes.txt'), 'utf8'), `Edited in ${id}`);
}
for (const id of [crypto.randomUUID(), '..%2Fescape']) {
assert.ok([400, 404].includes((await fetch(`${base()}/api/projects/${id}/files/index.html`)).status));