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.

fix(mcp): continue compatible updates without reconnecting

罗高943d7c7cf2e6
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f5e73fb4..80af3498 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -70,7 +70,7 @@ jobs:
npm run typecheck:studio
npm run build:studio
- name: Validate standalone installation and packaging
- run: node --experimental-strip-types --test tests/install.test.ts tests/npm-installer.test.ts tests/npm-package.test.ts tests/test-package.test.ts tests/source-install.test.ts tests/bootstrap.test.ts tests/mcp-registry.test.ts tests/mcp-runtime.test.ts tests/phase1.test.ts tests/adapters.test.ts tests/package.test.ts tests/recreate-measure.test.ts tests/workflow.test.ts tests/catalog.test.ts tests/prism-templates.test.ts tests/extension-boundary.test.ts tests/connections.test.ts
+ run: node --experimental-strip-types --test tests/install.test.ts tests/npm-installer.test.ts tests/npm-package.test.ts tests/test-package.test.ts tests/source-install.test.ts tests/bootstrap.test.ts tests/mcp-registry.test.ts tests/mcp-runtime.test.ts tests/mcp-upgrade.test.ts tests/preview.test.ts tests/phase1.test.ts tests/adapters.test.ts tests/package.test.ts tests/recreate-measure.test.ts tests/workflow.test.ts tests/catalog.test.ts tests/prism-templates.test.ts tests/extension-boundary.test.ts tests/connections.test.ts
- name: Studio regression
run: npm run test:studio -- --maxWorkers=2
- name: Build phase-one ZIP and exercise all public tools
diff --git a/docs/mcp-phase1-tools.md b/docs/mcp-phase1-tools.md
index 86620591..b84a3c82 100644
--- a/docs/mcp-phase1-tools.md
+++ b/docs/mcp-phase1-tools.md
@@ -98,7 +98,13 @@ action=record_review 要求 projectId/requestId/jobId/review;只能对本项
- npm run package:phase1 构建 Studio 并生成 dist/motion-0.6.2-phase1.zip;npm run package:plugin 默认也沿用 phase1。该插件 ZIP 不带原生 Node/浏览器/FFmpeg:使用支持的本机 Node、首次安装锁定依赖,FFmpeg/ffprobe 需本机可用。
- 四宿主薄适配器从同一运行时导出,scope.json 记录 profile,复制上述5个 Skill;不另维护 allowlist。数据目录放在 runtime/插件缓存之外。资源指导通过本地文件或 resources/list、resources/read 取得,不另增加 workflow Tool。
- 完整原生测试包的 build <target> <beta-version> [phase1|legacy] 使用同表检查并写 release.json;本次不声称重新制作/验收各平台原生安装包。
-- 内部兼容 handler 与显式 legacy 开发构建保留,不能作为本次一期发布;旧调用在一期包中明确 MCP_TOOL_NOT_EXPOSED。宿主升级后须刷新发现和 Skill,不能继续缓存旧 schema。
+- Internal compatibility handlers and explicit legacy development builds remain separate; hidden calls return MCP_TOOL_NOT_EXPOSED in phase-one packages. Existing supported phase-one calls continue across compatible updates. Newly added Tools, changed discovery metadata and Skills require host refresh before use.
+
+### Phase-one API compatibility
+
+`shared/phase1-tools.ts` defines API protocol 1 and the available Tool names. Both editor and preview health advertise these capabilities. A phase-one stdio adapter can forward to another version/build only when the backend explicitly supports the same API protocol and requested Tool; the backend validates the complete input again before execution. Service, workspace, instance and authority protocol checks still apply. Internal legacy calls retain exact version/build checks.
+
+Protocol 1 preserves existing request/response shapes and semantics. New Tools and optional fields are additive; incompatible required fields, removed fields or changed semantics must increment the protocol. A supported older connection keeps its project binding, stable request IDs and existing export queries through a compatible plugin or backend replacement without another MCP initialization. Running exports stay with the live authority; recovery does not terminate it or replay an uncertain mutation. An already-closed host transport and an incompatible protocol cannot be repaired by this negotiation.
## 开发顺序与放行
diff --git a/docs/npm-installation.md b/docs/npm-installation.md
index 5c29bfef..180deeeb 100644
--- a/docs/npm-installation.md
+++ b/docs/npm-installation.md
@@ -29,7 +29,7 @@ npx --yes --package /absolute/dist/npm-local/openmotion-installer-0.6.3-local.1.
Claude Code 和 WorkBuddy 的平铺技能目录内写入 `openmotion-install.json`,记录应用位置;共享文档链接在安装时改写为有效绝对路径。Codex/Harness 保留完整包的相对资料布局。新会话或重新加载后使用 Skills。
-升级前关闭旧 MCP 连接,并按 [共享编辑器说明](shared-editor.md) 停止同一数据目录的旧后台;安装后重新连接 MCP、重新加载 Skills。后台身份包含 npm 原生下载器和原生锁文件,遇到版本或代码不兼容会报错要求停止旧后台,安装器不自动结束已有进程。
+Compatible phase-one updates do not require closing existing MCP connections or stopping the same workspace's backend. Connections negotiate the API protocol and requested Tool, retaining running exports and completed results; see [shared editor recovery](shared-editor.md). The installer does not terminate existing processes. Incompatible protocols or internal legacy ABIs still require updating the connection and idle backend together. Refresh the host to discover new Tools or reload changed Skills; an already-closed transport needs host reconnection.
`--skills-dir` 可选择 Codex、Claude Code、WorkBuddy 的技能根目录;Harness 使用其专属 provider 根目录,不改动用户的全局技能目录。`--codex`、`--claude`、`--dsh` 可指定可执行文件,Harness 的 `--profile` 默认 `web`;macOS 本机没有 dsh 命令时优先使用已安装桌面包的官方 CLI。Windows 应使用能直接启动的宿主可执行文件。注册阶段使用宿主自身配置根(`CODEX_HOME`、`CLAUDE_CONFIG_DIR`、`DSH_HOME`、`WORKBUDDY_CONFIG_DIR`);应用根始终由 `--home` 控制,二者不混用。
diff --git a/docs/product/architecture.md b/docs/product/architecture.md
index 5fdf5549..8a10039b 100644
--- a/docs/product/architecture.md
+++ b/docs/product/architecture.md
@@ -68,6 +68,8 @@ Model Gateway 是共用的素材生成服务,可由 Motion Viewer 或 MCP 调
### 应保持的架构约束
1. **两类入口共用领域能力。** Studio 与 MCP 使用同一 Gateway 合约和持久化数据。macOS 的 stdio 适配器按数据目录连接唯一后台,共用网关、任务与工程能力;每条连接绑定自己的工程。Windows / Linux 保留原生命周期。唯一后台依赖系统文件锁与私有身份验证,不以固定端口或 PID 文件作为唯一依据,见 [共享编辑器](../shared-editor.md)。
+
+ Public phase-one MCP calls negotiate a stable API protocol and supported Tool independently of the editor version/build. Compatible plugin updates preserve existing stdio connections, workspace/project bindings and active exports; they do not restart the authority or replay mutations. Private authority identity and protocol checks remain strict, and internal legacy calls retain exact version/build checks. This boundary does not refresh host discovery metadata or revive a transport the host already closed; see [API compatibility](../mcp-phase1-tools.md#phase-one-api-compatibility).
2. **作品与执行配置分开。** 原生工程包含作品源文件与媒体;供应商凭据、模型默认路由和生成任务属于工作区。项目包可以交给别人继续编辑,使用者无需继承原作者的 Key。
3. **素材成功不自动成为编辑成功。** 生成任务产生候选文件,采用结果才触发原生放置/替换。撤销作品修改不删除候选文件,也不撤销已经发生的供应商调用或费用。
4. **上下文不能随等待漂移。** 提交时固定生成工程和参考输入,采用时验证编辑目标;切换工程、合成、删除或改换原素材引用后,旧回调不得覆盖新目标。
diff --git a/docs/shared-editor.md b/docs/shared-editor.md
index c2de7936..9b308c9a 100644
--- a/docs/shared-editor.md
+++ b/docs/shared-editor.md
@@ -37,12 +37,15 @@ flowchart LR
| 显式打开预览 | 按需启动或复用原生 Studio;返回已有完整/嵌入链接契约 |
| 全部 MCP 会话退出 | 后台继续服务网页与导出;不会因某个 Agent 退出取消其他人的工作 |
| 用户停止后台 | 私有停止接口拒绝正在执行的 MCP、视频导出或素材任务;空闲时关闭子服务并退出 |
-| Runtime protocol/version/build mismatch | Refuse the call with expected/actual identity; reconnect a stale MCP client before considering an idle older backend shutdown. Never automatically kill or launch a competing backend. |
-| A live MCP client's plugin directory was replaced or removed | Return `MCP_RUNTIME_RELOAD_REQUIRED` with `applied: false` before dispatch; reload the host connection. |
+| Compatible plugin/backend version or build change | Existing phase-one connections continue through the same workspace authority when it advertises the same MCP API protocol and requested Tool; keep running exports and request IDs intact. |
+| Incompatible authority/API protocol, missing Tool or legacy version/build mismatch | Refuse before dispatch with expected/actual identity. Never automatically kill or launch a competing backend. |
+| A live MCP client's plugin directory was replaced or removed | Phase-one calls keep their stdio connection and reuse a compatible live backend. Internal legacy connections return `MCP_RUNTIME_RELOAD_REQUIRED`. A transport already closed by the host cannot be revived by the plugin. |
| 同目录已有旧版预览服务 | 拒绝另外启动共享后台;退出旧服务后重试 |
macOS 使用系统 `/usr/bin/perl` 取得 `flock` 后直接 exec Node;Perl 不常驻。锁描述符同时由后台和 Studio 守卫持有。后台死亡后,守卫先清理旧 Studio,再释放锁,新后台才能启动。锁文件保留不等于锁仍被占用;不通过删除锁文件来恢复。
+Phase-one compatibility is independent of the editor's implementation build. Authenticated private health and public preview health advertise `mcp.protocol` and `mcp.tools`; forwarding retains service, workspace, instance and authority-protocol validation. Compatible updates reuse the current authority without restarting it or replaying mutations. If an idle authority is separately replaced, the next call discovers or starts the same workspace's compatible replacement using the existing stdio connection. This does not hot-reload the UI, refresh host Tool metadata or automatically install updates. See the [API compatibility contract](mcp-phase1-tools.md#phase-one-api-compatibility).
+
显式停止(必须指定同一个数据目录):
```sh
diff --git a/editor-runtime.ts b/editor-runtime.ts
index 6517799d..0c18dd8c 100644
--- a/editor-runtime.ts
+++ b/editor-runtime.ts
@@ -7,6 +7,7 @@ import { fileURLToPath } from 'node:url';
import { WorkspaceStore, Conflict } from './workspace.ts';
import { isMain } from './shared/entry.ts';
import { templateConfig } from './shared/template-config.ts';
+import { phase1McpCapabilities, supportsPhase1Tool } from './shared/phase1-tools.ts';
export const sharedEditorEnabled = process.platform === 'darwin';
const root = fileURLToPath(new URL('./', import.meta.url));
@@ -44,7 +45,7 @@ export async function editorRequest(registry: EditorRegistry, route: string, bod
if (!response.ok) throw Object.assign(new Error(result.error || '编辑器请求失败'), { status: response.status, code: result.code });
return result;
}
-export async function ensureEditor(directory: string): Promise<EditorRegistry> {
+export async function ensureEditor(directory: string, mcpTool?: string): Promise<EditorRegistry> {
const { data, runtime } = await editorDirectory(directory);
let launcher: ReturnType<typeof spawn> | undefined;
for (let attempt = 0; attempt < 600; attempt++) {
@@ -53,14 +54,15 @@ export async function ensureEditor(directory: string): Promise<EditorRegistry> {
try {
const health = await editorRequest(registry, '/editor-api/health', undefined, 1200);
if (health.service !== service || health.dataDirectory !== data || health.instanceId !== registry.instanceId) throw Object.assign(new Error('编辑器实例身份不匹配'), { terminal: true });
- if (health.protocol !== protocol || health.version !== version || health.build !== editorBuild) throw Object.assign(
+ const compatible = mcpTool ? supportsPhase1Tool(health, mcpTool) : health.version === version && health.build === editorBuild;
+ if (health.protocol !== protocol || !compatible) throw Object.assign(
new Error('Editor runtime incompatible. Reconnect the Motion MCP connection to the installed runtime and compare the expected and actual versions/builds. Stop an older editor only after confirming it is idle; do not bypass MCP or switch workspaces to continue.'),
{ terminal: true, code: 'EDITOR_RUNTIME_INCOMPATIBLE', details: {
dataDirectory: data, expected: { protocol, version, build: editorBuild },
actual: { protocol: health.protocol, version: health.version, build: health.build },
} },
);
- return registry;
+ return { ...registry, version: health.version, build: health.build };
} catch (error) { if ((error as any).terminal || (error as any).status) throw error; }
}
if (!launcher || launcher.exitCode !== null || launcher.signalCode !== null) {
@@ -108,7 +110,7 @@ export async function serveEditor(directory: string) {
const { startServer } = await import('./server.ts');
const { callTool, tools } = await import('./mcp-tools.ts');
const { stopCommands } = await import('./hyperframes.ts');
- const identity = () => ({ service, protocol, version, build: editorBuild, instanceId, pid: process.pid, dataDirectory: data });
+ const identity = () => ({ service, protocol, version, build: editorBuild, instanceId, pid: process.pid, dataDirectory: data, mcp: phase1McpCapabilities });
let active = 0, stopping = false, queue = Promise.resolve();
const running = await startServer(store, 0, { editor: false, editorToken: token, privateHandler: async (req, res) => {
if (!req.url?.startsWith('/editor-api/')) return false;
diff --git a/mcp.ts b/mcp.ts
index 17443757..e98aa63d 100644
--- a/mcp.ts
+++ b/mcp.ts
@@ -33,11 +33,13 @@ export async function rpc(message: any, store = new WorkspaceStore(), registry =
if (message.method === 'tools/list') return result({ tools: registry.tools });
if (message.method === 'tools/call') {
try {
- const current = statSync(runtimeRoot, { throwIfNoEntry: false });
- if (!current || current.dev !== runtimeDirectory.dev || current.ino !== runtimeDirectory.ino) throw Object.assign(
- new Error('The Motion plugin directory was replaced or removed. Reload the Motion MCP connection in the host before retrying; no project operation was applied.'),
- { code: 'MCP_RUNTIME_RELOAD_REQUIRED' },
- );
+ if (registry.profile !== 'phase1') {
+ const current = statSync(runtimeRoot, { throwIfNoEntry: false });
+ if (!current || current.dev !== runtimeDirectory.dev || current.ino !== runtimeDirectory.ino) throw Object.assign(
+ new Error('The Motion plugin directory was replaced or removed. Reload this internal legacy MCP connection before retrying; no project operation was applied.'),
+ { code: 'MCP_RUNTIME_RELOAD_REQUIRED' },
+ );
+ }
if (!registry.tools.some(tool => tool.name === message.params?.name)) throw new Error('MCP_TOOL_NOT_EXPOSED: ' + String(message.params?.name));
if (registry.profile === 'phase1') {
const name = message.params.name;
@@ -46,7 +48,7 @@ export async function rpc(message: any, store = new WorkspaceStore(), registry =
validateInput(definition.inputSchema, args);
if (name === 'motion_open_preview' && !args.projectId && !args.sessionId && args.action !== 'record_review') args.sessionId = selections.get(store)?.sessionId;
if (args.sessionId === undefined) delete args.sessionId;
- const service = await ensureService(store), origin = new URL(service.previewUrl).origin;
+ const service = await ensureService(store, undefined, name), origin = new URL(service.previewUrl).origin;
const response = await fetch(origin + '/motion-api/phase1/call', { method: 'POST', headers: await editorHeaders(store, origin),
body: JSON.stringify({ name, arguments: args }), signal: AbortSignal.timeout(600_000) });
const value = await response.json();
diff --git a/preview.ts b/preview.ts
index 45be3832..ebd9fef6 100644
--- a/preview.ts
+++ b/preview.ts
@@ -5,10 +5,11 @@ import { fileURLToPath } from 'node:url';
import { readFileSync } from 'node:fs';
import { WorkspaceStore } from './workspace.ts';
import { ensureEditor, editorRequest, readEditor, sharedEditorEnabled } from './editor-runtime.ts';
+import { supportsPhase1Tool } from './shared/phase1-tools.ts';
const pluginRoot = fileURLToPath(new URL('./', import.meta.url));
export const VERSION: string = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version;
-export type Health = { service: string; protocol: number; version: string; dataDirectory: string; ffmpeg: boolean; ready: boolean; editorReady?: boolean; studioUrl?: string; hyperframesCli?: string; authoringGuide?: string };
+export type Health = { service: string; protocol: number; version: string; dataDirectory: string; ffmpeg: boolean; ready: boolean; editorReady?: boolean; studioUrl?: string; hyperframesCli?: string; authoringGuide?: string; mcp?: { protocol: number; tools: string[] } };
export type Probe = { kind: 'free' | 'busy'; health?: never } | { kind: 'motion'; health: Health };
export type Started = { pid?: number; alive: () => boolean; error: () => string; stop: () => void };
export type PreviewRuntime = {
@@ -77,11 +78,11 @@ async function requestEditor(port: number) {
// Background tool calls must not initialize or stamp the active source before
// applying the caller's revision. Opening the editor is a separate operation.
-export async function ensureService(store = new WorkspaceStore(), environment: PreviewRuntime = runtime) {
- return openPreview(store, environment, { editor: false });
+export async function ensureService(store = new WorkspaceStore(), environment: PreviewRuntime = runtime, mcpTool?: string) {
+ return openPreview(store, environment, { editor: false, mcpTool });
}
-export async function openPreview(store = new WorkspaceStore(), environment: PreviewRuntime = runtime, options = { editor: true }) {
+export async function openPreview(store = new WorkspaceStore(), environment: PreviewRuntime = runtime, options: { editor: boolean; mcpTool?: string } = { editor: true }) {
let existingLegacy = false;
if (sharedEditorEnabled && environment === runtime && !await readEditor(store.directory)) {
const port = await registeredPort(store);
@@ -91,10 +92,10 @@ export async function openPreview(store = new WorkspaceStore(), environment: Pre
}
}
if (sharedEditorEnabled && environment === runtime && !existingLegacy) {
- const before = await readEditor(store.directory), editor = await ensureEditor(store.directory);
+ const before = await readEditor(store.directory), editor = await ensureEditor(store.directory, options.mcpTool);
const opened = await editorRequest(editor, '/editor-api/preview', { projectId: store.projectId, editor: options.editor });
const file = path.join(store.directory, 'preview.json'), temporary = file + '.' + crypto.randomUUID() + '.tmp';
- try { await writeFile(temporary, JSON.stringify({ port: Number(new URL(editor.endpoint).port), pid: editor.pid, version: VERSION }), { mode: 0o600 }); await rename(temporary, file); }
+ try { await writeFile(temporary, JSON.stringify({ port: Number(new URL(editor.endpoint).port), pid: editor.pid, version: editor.version }), { mode: 0o600 }); await rename(temporary, file); }
finally { await rm(temporary, { force: true }); }
return { ...opened, revision: (await store.get()).revision, reused: before?.instanceId === editor.instanceId,
previewTarget: 'host-built-in-browser', nextAction: 'Open the exact previewUrl in the host built-in browser when available; otherwise return the URL and mark visual/player checks as not_run. Do not start another editor or ask the user to run a terminal server.' };
@@ -115,7 +116,8 @@ export async function openPreview(store = new WorkspaceStore(), environment: Pre
const firstPort = initialPort(), previous = await registeredPort(store);
const candidates = [...new Set([...(previous ? [previous] : []), ...Array.from({ length: 10 }, (_, i) => firstPort + i)])];
let available: number | null = null;
- const matches = (result: Probe) => result.kind === 'motion' && result.health.ready && result.health.version === VERSION && path.resolve(result.health.dataDirectory) === store.directory;
+ const matches = (result: Probe) => result.kind === 'motion' && result.health.service === 'motion-preview' && result.health.protocol === 2 && result.health.ready
+ && (options.mcpTool ? supportsPhase1Tool(result.health, options.mcpTool) : result.health.version === VERSION) && path.resolve(result.health.dataDirectory) === store.directory;
async function ready(port: number, health: Health, reused: boolean, pid?: number) {
if (options.editor && !health.studioUrl) {
await (environment.openEditor || requestEditor)(port);
@@ -124,17 +126,21 @@ export async function openPreview(store = new WorkspaceStore(), environment: Pre
health = updated.health;
}
const file = path.join(store.directory, 'preview.json'); const temporary = file + '.' + crypto.randomUUID() + '.tmp';
- try { await writeFile(temporary, JSON.stringify({ port, pid, version: VERSION }), { mode: 0o600 }); await rename(temporary, file); }
+ try { await writeFile(temporary, JSON.stringify({ port, pid, version: health.version }), { mode: 0o600 }); await rename(temporary, file); }
finally { await rm(temporary, { force: true }); }
return { previewUrl: `http://localhost:${port}`, studioUrl: health.studioUrl, hyperframesCli: health.hyperframesCli, authoringGuide: health.authoringGuide, engine: 'hyperframes', ready: true, reused, ffmpeg: health.ffmpeg, revision: (await store.get()).revision,
dataDirectory: store.directory, editorReady: Boolean(health.studioUrl), browserOpened: false, previewTarget: 'host-built-in-browser',
nextAction: options.editor ? 'Use the host built-in browser to open previewUrl in this conversation. Do not ask the user to run a server or launch an external browser. If the host has no built-in browser, return the URL and state that the embedded preview is unavailable.' : 'Background service ready. Opening the editor is not required for template application or export.' };
}
- // Prefer reusing the exact same Motion version and workspace, even when the
- // first port is occupied. Never kill or reuse an unrelated local service.
+ // Public MCP negotiates its API; other callers retain exact-version reuse.
for (const port of candidates) {
const result = await environment.probe(port);
if (matches(result)) return await ready(port, (result as { health: Health }).health, true);
+ if (options.mcpTool && result.kind === 'motion' && result.health.service === 'motion-preview' && path.resolve(result.health.dataDirectory) === store.directory) throw Object.assign(
+ new Error('Editor runtime incompatible with this MCP call; update the incompatible components together when idle. No competing backend was started.'),
+ { code: 'EDITOR_RUNTIME_INCOMPATIBLE', details: { dataDirectory: store.directory, expected: { protocol: 2, version: VERSION, mcpTool: options.mcpTool },
+ actual: { protocol: result.health.protocol, version: result.health.version, mcp: result.health.mcp } } },
+ );
if (result.kind === 'free' && available === null) available = port;
}
if (available === null) throw new Error('本地预览端口均已占用;未停止或替换任何已有服务。');
diff --git a/server.ts b/server.ts
index f7d5c2f3..d71e6f7a 100644
--- a/server.ts
+++ b/server.ts
@@ -22,6 +22,7 @@ import { creationMode, creationModes, artifactViewers, type CreativeSession, typ
import { gatewayFor } from './gateway/service.ts';
import { WorkspaceBrowser } from './browser.ts';
import { Phase1Service } from './phase1.ts';
+import { phase1McpCapabilities } from './shared/phase1-tools.ts';
import { recoverProjectTransactions } from './phase1-versions.ts';
import { verifyExport } from './scripts/verify-export.ts';
@@ -279,7 +280,7 @@ export async function handler(req: IncomingMessage, res: ServerResponse, store =
res.writeHead(302, { Location: '/?panel=connections&host=' + integrationHost(url.searchParams.get('host')) }); return res.end();
}
if (url.pathname === '/api/health' && req.method === 'GET') return json(res, 200, {
- service: 'motion-preview', protocol: 2, version: VERSION, dataDirectory: store.directory,
+ service: 'motion-preview', protocol: 2, version: VERSION, dataDirectory: store.directory, mcp: phase1McpCapabilities,
engine: 'hyperframes', engineVersion: HYPERFRAMES_VERSION, editor: 'opendesign-motion', ffmpeg: Boolean(context.ffmpeg),
ready: Boolean(context.runtimeRoot && (!context.studio || context.studio.alive())), editorReady: Boolean(context.studio?.alive()), studioUrl: context.studio?.alive() ? editorUrl : undefined, nativeStudioUrl: context.studio?.url,
...(context.runtimeRoot ? { hyperframesCli: cliPath(context.runtimeRoot), authoringGuide: path.join(context.runtimeRoot, 'node_modules/hyperframes/dist/skills/hyperframes/SKILL.md') } : {}),
diff --git a/shared/mcp-profiles.json b/shared/mcp-profiles.json
index 20ae8ccd..42375efa 100644
--- a/shared/mcp-profiles.json
+++ b/shared/mcp-profiles.json
@@ -17,6 +17,6 @@
"motion_restore_version",
"motion_export_cancel"
],
- "instructions": "Use only the tools returned by tools/list. Follow the installed phase-one production skills. Read the selected project and current content version before editing. Save native source through motion_edit_project; preview and export perform their required checks internally. Use motion_list_versions to find project snapshots and motion_restore_version to restore one as a new version while retaining later history. A transport cancellation does not prove a background export stopped. Report actual export state and accessible results; technical validation does not replace visual, audio and player review. Never guess a project from another conversation. Read skills locally or with resources/list and resources/read (motion://workflow/production/start, or the selected specialist); engine authoring guidance is motion://engine/SKILL.md and relative Markdown references under motion://engine/. For new work create explicitly; motion_open_preview never silently creates a project. Persisted create/import/edit/restore/export/cancel and review requests require a stable requestId; preview action=open does not. Edits require projectId, expectedRevision and expectedVersionId. Query export progress through motion_get_project with projectId and exportJobId. Project list and version list are five per page; follow nextCursor. For template discovery, call motion_list_templates to obtain a local JSONL index path, then search that file with local tools. It does not return search results. Read the selected ID with motion_get_template; create its independent editable copy with motion_create_project projectType=template. Use the connected Motion MCP tools for project operations and exports; a shell HTTP call is not an MCP tool invocation. Before opening a project, verify the connection dataDirectory and project/version with motion_get_project. Browser URLs and project IDs do not select another workspace. If the transport is closed, the runtime was replaced or compatibility fails, reload the matching MCP connection and repeat the read; do not silently bypass MCP or change workspaces."
+ "instructions": "Use only the tools returned by tools/list. Follow the installed phase-one production skills. Read the selected project and current content version before editing. Save native source through motion_edit_project; preview and export perform their required checks internally. Use motion_list_versions to find project snapshots and motion_restore_version to restore one as a new version while retaining later history. A transport cancellation does not prove a background export stopped. Report actual export state and accessible results; technical validation does not replace visual, audio and player review. Never guess a project from another conversation. Read skills locally or with resources/list and resources/read (motion://workflow/production/start, or the selected specialist); engine authoring guidance is motion://engine/SKILL.md and relative Markdown references under motion://engine/. For new work create explicitly; motion_open_preview never silently creates a project. Persisted create/import/edit/restore/export/cancel and review requests require a stable requestId; preview action=open does not. Edits require projectId, expectedRevision and expectedVersionId. Query export progress through motion_get_project with projectId and exportJobId. Project list and version list are five per page; follow nextCursor. For template discovery, call motion_list_templates to obtain a local JSONL index path, then search that file with local tools. It does not return search results. Read the selected ID with motion_get_template; create its independent editable copy with motion_create_project projectType=template. Use the connected Motion MCP tools for project operations and exports; a shell HTTP call is not an MCP tool invocation. Before opening a project, verify the connection dataDirectory and project/version with motion_get_project. Browser URLs and project IDs do not select another workspace. Compatible phase-one plugin/backend updates continue automatically on the existing connection through API protocol and Tool negotiation; keep the workspace, project binding and running exports. If the API is incompatible, update the incompatible components together when idle. Only an already-closed host transport or an internal legacy runtime replacement requires reconnection. Do not silently bypass MCP or change workspaces."
}
}
diff --git a/shared/phase1-tools.ts b/shared/phase1-tools.ts
index 04a1e5d2..0ccb6a4c 100644
--- a/shared/phase1-tools.ts
+++ b/shared/phase1-tools.ts
@@ -33,6 +33,15 @@ export const phase1Tools = [
inputSchema: object({ projectId, requestId: id, jobId: id }, ['projectId', 'requestId', 'jobId']), annotations: write },
];
+// Increment for incompatible request/response semantics; optional fields and new Tools are additive.
+export const phase1McpCapabilities = { protocol: 1, tools: phase1Tools.map(tool => tool.name) };
+
+export function supportsPhase1Tool(health: { mcp?: { protocol?: unknown; tools?: unknown } }, tool?: string): boolean {
+ return typeof tool === 'string' && phase1McpCapabilities.tools.includes(tool)
+ && health.mcp?.protocol === phase1McpCapabilities.protocol
+ && Array.isArray(health.mcp.tools) && health.mcp.tools.includes(tool);
+}
+
export function validateInput(schema: any, value: any, field = 'arguments'): void {
if (schema.enum && !schema.enum.includes(value)) throw new Error('INVALID_ARGUMENT: ' + field);
if (schema.type === 'object') {
diff --git a/skills/motion-production/references/production.md b/skills/motion-production/references/production.md
index 07ee02ae..25b6ef06 100644
--- a/skills/motion-production/references/production.md
+++ b/skills/motion-production/references/production.md
@@ -21,7 +21,7 @@ Use the host's connected Motion MCP tools for project creation, reads, saves, pr
Before opening a project for an Agent workflow, call `motion_get_project` through that connection and verify its `dataDirectory`, project/session identity and current version. Create new work through `motion_create_project`, then save and open the returned project through MCP. A browser URL or a matching project ID alone does not bind the connection to that workspace. A repository-only UI fixture can remain isolated, but must be identified as such; exporting it through MCP requires a matching connection or an explicitly scoped project import/copy, not an implicit data-directory change.
-For `MCP_RUNTIME_RELOAD_REQUIRED`, `EDITOR_RUNTIME_INCOMPATIBLE` or a closed transport, repair/reload the host connection and repeat the scoped read before writing. Compare the reported expected and actual version/build; a stale connection can disagree with a healthy current backend. Do not stop a matching backend or silently substitute shell/HTTP exports for failed MCP calls. Preserve existing projects and completed jobs, and query an applicable export before creating another.
+Existing phase-one MCP connections automatically reuse a compatible backend after plugin updates, keeping the same workspace and running exports. Version/build differences alone do not require reconnecting: the backend must advertise the same phase-one API protocol and the requested Tool. For `EDITOR_RUNTIME_INCOMPATIBLE`, compare the expected/actual identity and update the incompatible components together when idle; internal legacy connections may also return `MCP_RUNTIME_RELOAD_REQUIRED`. A transport already closed by the host requires host reconnection. Do not stop a compatible backend or silently substitute shell/HTTP exports for failed MCP calls. Preserve existing projects and completed jobs, and query an applicable export before creating another.
1. Reuse complete guidance already read. Installed Skills and MCP resources/read provide the same documents; production start only routes a task that lacks a specialist. Changes to existing content use [edit workflow](edit.md). Missing instructions/source reads return to the model before dependent writes.
2. Reuse the target projectId or explicitly create a new one. Read its current revision and content version. No global most-recent project fallback. Five is a list page size, not a retention policy.
diff --git a/tests/mcp-runtime.test.ts b/tests/mcp-runtime.test.ts
index a72f2ccf..acd1a4b8 100644
--- a/tests/mcp-runtime.test.ts
+++ b/tests/mcp-runtime.test.ts
@@ -16,14 +16,22 @@ async function incompatibleEditor(directory: string, changed: Record<string, unk
const registry = { service: 'opendesign-editor', protocol: 1, version: JSON.parse(await readFile(path.join(pluginRoot, 'package.json'), 'utf8')).version,
build: editorBuild, dataDirectory: data, instanceId: 'test-instance', pid: process.pid, token: 'a'.repeat(64), endpoint: '' };
const health = { ...registry, ...changed, token: undefined };
- const server = createServer((req, res) => {
+ const calls: any[] = [];
+ const server = createServer(async (req, res) => {
requests.push(req.url!);
- res.setHeader('Content-Type', 'application/json'); res.end(JSON.stringify(health));
+ res.setHeader('Content-Type', 'application/json');
+ if (req.url === '/editor-api/preview') return res.end(JSON.stringify({ previewUrl: registry.endpoint, ready: true, dataDirectory: data }));
+ if (req.url === '/motion-api/phase1/call') {
+ let body = ''; for await (const chunk of req) body += chunk;
+ calls.push(JSON.parse(body));
+ return res.end(JSON.stringify({ projectId: 'project', sessionId: 'project', authority: 'compatible-backend', job: { id: 'existing-export' } }));
+ }
+ res.end(JSON.stringify(health));
});
await new Promise<void>(resolve => server.listen(0, '127.0.0.1', resolve));
registry.endpoint = `http://127.0.0.1:${(server.address() as any).port}/`;
await writeFile(path.join(runtime, 'runtime.json'), JSON.stringify(registry), { mode: 0o600 });
- return { requests, health, registry, close: async () => {
+ return { requests, calls, health, registry, close: async () => {
server.closeAllConnections(); await new Promise<void>(resolve => server.close(() => resolve()));
} };
}
@@ -52,27 +60,52 @@ test('MCP reports incompatible editor identity fields without starting an export
});
});
-test('a replaced or removed plugin directory tells a live stdio MCP client to reload before dispatch', async t => {
+test('a live phase1 MCP connection survives a replaced or removed plugin directory without reconnecting', { skip: !sharedEditorEnabled }, async t => {
for (const replaced of [true, false]) await t.test(replaced ? 'replaced' : 'removed', async () => {
const temporary = await mkdtemp(path.join(tmpdir(), 'motion-stale-plugin-'));
const app = path.join(temporary, 'app'), directory = path.join(temporary, 'data');
await cp(pluginRoot, app, { recursive: true, filter: source => !['.git', 'node_modules', 'studio', 'dist', '.artifacts'].includes(path.relative(pluginRoot, source).split(path.sep)[0]) });
await symlink(path.join(pluginRoot, 'node_modules'), path.join(app, 'node_modules'), 'dir');
- const editor = await incompatibleEditor(directory, { protocol: 999 });
+ const editor = await incompatibleEditor(directory, { version: '0.6.4', build: '0'.repeat(64), mcp: { protocol: 1, tools: ['motion_get_project', 'motion_export_request'] } });
const { Client } = await import(pathToFileURL(path.join(app, 'tests/shared-editor-client.mjs')).href);
const client = new Client(directory);
try {
await client.initialize();
+ const pid = client.child.pid;
await rename(app, path.join(temporary, 'previous'));
if (replaced) await mkdir(app);
for (const params of [{ name: 'motion_get_project', arguments: {} }, exportCall.params]) {
const response = await client.rpc('tools/call', params);
- assert.equal(response.structuredContent.error.code, 'MCP_RUNTIME_RELOAD_REQUIRED');
- assert.equal(response.structuredContent.error.applied, false);
- assert.match(response.structuredContent.error.message, /reload/i);
+ assert.equal(response.isError, undefined);
+ assert.equal(response.structuredContent.authority, 'compatible-backend');
}
- assert.deepEqual(editor.requests, []);
- assert.deepEqual(await readdir(directory), ['.editor-runtime']);
+ assert.equal(client.child.pid, pid);
+ assert.equal(client.trace.filter((item: any) => item.method === 'initialize').length, 1);
+ assert.deepEqual(editor.calls, [{ name: 'motion_get_project', arguments: {} }, exportCall.params]);
+ assert.ok(!editor.requests.includes('/editor-api/shutdown'));
+ assert.deepEqual((await readdir(directory)).sort(), ['.editor-runtime', 'preview.json']);
} finally { await client.close(); await editor.close(); await rm(temporary, { recursive: true, force: true }); }
});
});
+
+test('phase1 recovery still refuses unsupported tools, incompatible protocols and a different authority', { skip: !sharedEditorEnabled }, async t => {
+ const mcp = { protocol: 1, tools: ['motion_export_request'] };
+ for (const changed of [
+ { version: '0.6.4', mcp: { ...mcp, tools: ['motion_get_project'] } },
+ { version: '0.6.4', mcp: { ...mcp, protocol: 2 } },
+ { mcp: { ...mcp, protocol: 2 } },
+ { protocol: 999, mcp },
+ { dataDirectory: '/other-workspace', mcp },
+ { instanceId: 'another-authority', mcp },
+ ]) await t.test(JSON.stringify(changed), async () => {
+ const directory = await mkdtemp(path.join(tmpdir(), 'motion-unsafe-recovery-'));
+ const editor = await incompatibleEditor(directory, changed);
+ try {
+ const response: any = await rpc(exportCall, new WorkspaceStore(directory));
+ assert.equal(response.result.isError, true);
+ assert.deepEqual(editor.calls, []);
+ assert.deepEqual(editor.requests, ['/editor-api/health']);
+ assert.ok(!JSON.stringify(response).includes(editor.registry.token));
+ } finally { await editor.close(); await rm(directory, { recursive: true, force: true }); }
+ });
+});
diff --git a/tests/mcp-upgrade.test.ts b/tests/mcp-upgrade.test.ts
new file mode 100644
index 00000000..f8bb1fda
--- /dev/null
+++ b/tests/mcp-upgrade.test.ts
@@ -0,0 +1,89 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { cp, mkdir, mkdtemp, readFile, realpath, rename, rm, symlink, writeFile } from 'node:fs/promises';
+import { createHash } from 'node:crypto';
+import { tmpdir } from 'node:os';
+import path from 'node:path';
+import { pathToFileURL } from 'node:url';
+import { editorRequest, readEditor, sharedEditorEnabled } from '../editor-runtime.ts';
+import { pluginRoot } from '../hyperframes.ts';
+import { closeFixtureEditor } from './fixtures.ts';
+
+const pause = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
+
+test('one stdio connection exports across a compatible plugin update and an idle backend replacement', { skip: !sharedEditorEnabled, timeout: 240_000 }, async () => {
+ const temporary = await realpath(await mkdtemp(path.join(tmpdir(), 'motion-mcp-upgrade-')));
+ const app = path.join(temporary, 'app'), replacement = path.join(temporary, 'replacement'), data = path.join(temporary, 'data');
+ const clients: any[] = [], observations: any[] = [];
+ const evidence = process.env.OPENMOTION_UPGRADE_EVIDENCE;
+ async function copyRuntime(target: string) {
+ await cp(pluginRoot, target, { recursive: true, filter: source => !['.git', 'node_modules', 'studio', 'dist', '.artifacts'].includes(path.relative(pluginRoot, source).split(path.sep)[0]) });
+ await symlink(path.join(pluginRoot, 'node_modules'), path.join(target, 'node_modules'), 'dir');
+ await mkdir(path.join(target, 'studio'));
+ await symlink(path.join(pluginRoot, 'studio/build'), path.join(target, 'studio/build'), 'dir');
+ }
+ async function waitJob(client: any, projectId: string, jobId: string) {
+ for (let i = 0; i < 360; i++) {
+ const job = (await client.call('motion_get_project', { projectId, exportJobId: jobId })).exportJob;
+ assert.ok(!['failed', 'cancelled'].includes(job.state), JSON.stringify(job));
+ if (job.state === 'completed') {
+ assert.equal(job.verification.status, 'passed', JSON.stringify(job.verification));
+ return job;
+ }
+ await pause(250);
+ }
+ assert.fail('export did not complete');
+ }
+ try {
+ await copyRuntime(app); await copyRuntime(replacement);
+ const pkg = JSON.parse(await readFile(path.join(replacement, 'package.json'), 'utf8'));
+ pkg.version = '0.6.4';
+ await writeFile(path.join(replacement, 'package.json'), JSON.stringify(pkg));
+ const runtimeFile = path.join(replacement, 'editor-runtime.ts');
+ await writeFile(runtimeFile, await readFile(runtimeFile, 'utf8') + '\n// Compatible upgrade fixture.\n');
+ const { Client } = await import(pathToFileURL(path.join(app, 'tests/shared-editor-client.mjs')).href);
+ const old = new Client(data); clients.push(old); await old.initialize();
+ const pid = old.child.pid;
+ const project = await old.call('motion_create_project', { requestId: 'create-a', projectType: 'natural_language', title: 'Upgrade A', requirements: 'Keep this project and its exports across a compatible update' });
+ const html = `<!doctype html><html><head><meta charset="utf-8"><script src="assets/gsap.min.js"></script><style>body{margin:0}#main{position:relative;width:320px;height:180px;background:#d3e7ae}#box{position:absolute;top:60px;left:20px;width:40px;height:40px;background:#203021}</style></head><body><div id="main" data-composition-id="main" data-start="0" data-duration="1" data-width="320" data-height="180" data-fps="10"><div id="box"></div></div><script>window.__timelines={main:gsap.timeline({paused:true}).fromTo('#box',{x:0},{x:200,duration:1,ease:'none'})};</script></body></html>`;
+ await old.call('motion_edit_project', { projectId: project.projectId, requestId: 'film', expectedRevision: project.revision, expectedVersionId: project.currentVersionId, files: [{ path: 'index.html', content: html }] });
+ const current = await old.call('motion_get_project', { projectId: project.projectId });
+ const args = { projectId: project.projectId, requestId: 'before-update', expectedRevision: current.revision, versionId: current.currentVersionId, audio: 'silent' };
+ const submitted = await old.call('motion_export_request', args);
+ const before = (await readEditor(data))!;
+ await assert.rejects(editorRequest(before, '/editor-api/shutdown', {}), /active work/);
+ await rename(app, path.join(temporary, 'previous')); await rename(replacement, app);
+ const { Client: UpdatedClient } = await import(pathToFileURL(path.join(app, 'tests/shared-editor-client.mjs')).href + '?updated');
+ const fresh = new UpdatedClient(data); clients.push(fresh); await fresh.initialize();
+ const throughNew = await fresh.call('motion_get_project', { projectId: project.projectId, exportJobId: submitted.job.id });
+ assert.equal(throughNew.exportJob.id, submitted.job.id);
+ assert.equal((await readEditor(data))!.instanceId, before.instanceId);
+ const completed = await waitJob(old, project.projectId, submitted.job.id);
+ assert.equal((await old.call('motion_export_request', args)).job.id, submitted.job.id, 'a stable request must not create another export');
+ const originalHash = createHash('sha256').update(await readFile(completed.path)).digest('hex');
+ observations.push({ scenario: 'update-during-export', stdioPid: pid, jobId: completed.id, backendInstanceId: before.instanceId, verification: completed.verification.status, sha256: originalHash });
+ await fresh.call('motion_create_project', { requestId: 'create-b', projectType: 'natural_language', title: 'Upgrade B', requirements: 'Another conversation must not replace the original binding' });
+ // Simulate an updater retiring only this isolated, now-idle authority.
+ await editorRequest(before, '/editor-api/shutdown', {});
+ for (let i = 0; i < 100 && await readEditor(data); i++) await pause(50);
+ assert.equal(await readEditor(data), null);
+ assert.equal((await old.call('motion_open_preview')).projectId, project.projectId, 'the old connection must keep its project binding');
+ const after = (await readEditor(data))!;
+ assert.notEqual(after.instanceId, before.instanceId); assert.equal(after.version, '0.6.4'); assert.notEqual(after.build, before.build);
+ assert.equal((await old.call('motion_get_project', { projectId: project.projectId, exportJobId: completed.id })).exportJob.state, 'completed');
+ const latest = await old.call('motion_get_project', { projectId: project.projectId });
+ assert.ok(latest.project.html.includes('x:200'));
+ const next = await old.call('motion_export_request', { ...args, requestId: 'after-update', expectedRevision: latest.revision, versionId: latest.currentVersionId });
+ const exported = await waitJob(old, project.projectId, next.job.id);
+ assert.notEqual(exported.id, completed.id);
+ assert.equal(createHash('sha256').update(await readFile(completed.path)).digest('hex'), originalHash);
+ assert.equal(old.child.pid, pid); assert.equal(old.trace.filter((item: any) => item.method === 'initialize').length, 1);
+ observations.push({ scenario: 'export-after-backend-replacement', stdioPid: pid, initializeCount: 1, projectId: project.projectId, jobId: exported.id, backendVersion: after.version, backendInstanceId: after.instanceId, verification: exported.verification.status, previousExportUnchanged: true });
+ if (evidence) { await mkdir(evidence, { recursive: true }); await cp(exported.path, path.join(evidence, 'continued-export.mp4')); }
+ } finally {
+ await Promise.all(clients.map(client => client.close()));
+ await closeFixtureEditor(data);
+ if (evidence) { await mkdir(evidence, { recursive: true }); await writeFile(path.join(evidence, 'observations.json'), JSON.stringify({ observations, traces: clients.map(client => client.trace) }, null, 2)); }
+ await rm(temporary, { recursive: true, force: true });
+ }
+});
diff --git a/tests/preview.test.ts b/tests/preview.test.ts
index e761123f..918e1071 100644
--- a/tests/preview.test.ts
+++ b/tests/preview.test.ts
@@ -6,6 +6,7 @@ import { ensureService, openPreview, previewUrl, VERSION } from '../preview.ts';
import type { Probe, PreviewRuntime } from '../preview.ts';
import { WorkspaceStore } from '../workspace.ts';
import { pluginRoot } from '../hyperframes.ts';
+import { phase1McpCapabilities } from '../shared/phase1-tools.ts';
import { fixture } from './fixtures.ts';
function runtime(store: WorkspaceStore) {
@@ -15,7 +16,7 @@ function runtime(store: WorkspaceStore) {
launch: async (port, directory, log, background) => {
assert.equal(directory, store.directory); assert.equal(log, path.join(directory, 'preview.log')); launches.push(port);
if (!background) await store.initialize(pluginRoot);
- occupied.set(port, { kind: 'motion', health: { service: 'motion-preview', protocol: 2, version: VERSION, dataDirectory: directory, ffmpeg: true, ready: true, studioUrl: background ? undefined : `http://localhost:${port + 1}/#project/project` } });
+ occupied.set(port, { kind: 'motion', health: { service: 'motion-preview', protocol: 2, version: VERSION, dataDirectory: directory, ffmpeg: true, ready: true, mcp: phase1McpCapabilities, studioUrl: background ? undefined : `http://localhost:${port + 1}/#project/project` } });
return { pid: 1234, alive: () => true, error: () => '', stop: () => { stops.push(port); } };
},
openEditor: async port => {
@@ -56,6 +57,37 @@ test('unrelated services and mismatched versions or data directories are left in
const result = await openPreview(store, mock.environment);
assert.equal(result.previewUrl, `http://localhost:${port + 3}`); assert.deepEqual(mock.stops, []);
}));
+test('a phase1 call reuses a compatible newer backend without restarting it or changing workspaces', () => fixture(async store => {
+ const mock = runtime(store), port = Number(process.env.PORT || 4173);
+ mock.occupied.set(port, { kind: 'motion', health: { service: 'motion-preview', protocol: 2, version: '0.6.4',
+ dataDirectory: store.directory, ffmpeg: true, ready: true, mcp: { protocol: 1, tools: ['motion_export_request'] } } });
+ const before = await store.get();
+ const result = await ensureService(store, mock.environment, 'motion_export_request');
+ assert.equal(result.previewUrl, `http://localhost:${port}`);
+ assert.equal(result.reused, true);
+ assert.deepEqual(mock.launches, []); assert.deepEqual(mock.stops, []);
+ assert.deepEqual(await store.get(), before);
+ assert.equal(JSON.parse(await readFile(path.join(store.directory, 'preview.json'), 'utf8')).version, '0.6.4');
+}, false));
+test('phase1 port discovery leaves unrelated services and other workspaces intact', () => fixture(async store => {
+ const mock = runtime(store), port = Number(process.env.PORT || 4173);
+ const health = { service: 'motion-preview', protocol: 2, version: '0.6.4', dataDirectory: store.directory, ffmpeg: true, ready: true, mcp: { protocol: 1, tools: ['motion_export_request'] } };
+ const changes = [{ dataDirectory: '/other' }, { service: 'unrelated-service' }];
+ changes.forEach((change, i) => mock.occupied.set(port + i, { kind: 'motion', health: { ...health, ...change } }));
+ const result = await ensureService(store, mock.environment, 'motion_export_request');
+ assert.equal(result.previewUrl, `http://localhost:${port + changes.length}`);
+ assert.deepEqual(mock.stops, []);
+}, false));
+test('phase1 port discovery refuses an incompatible same-workspace authority without launching another', async t => {
+ for (const change of [{ protocol: 999 }, { version: VERSION, mcp: { protocol: 2, tools: ['motion_export_request'] } }, { mcp: { protocol: 1, tools: ['motion_get_project'] } }, { mcp: undefined }]) await t.test(JSON.stringify(change), () => fixture(async store => {
+ const mock = runtime(store), port = Number(process.env.PORT || 4173);
+ mock.occupied.set(port, { kind: 'motion', health: { service: 'motion-preview', protocol: 2, version: '0.6.4', dataDirectory: store.directory, ffmpeg: true, ready: true, ...change } });
+ const before = await store.get();
+ await assert.rejects(ensureService(store, mock.environment, 'motion_export_request'), { code: 'EDITOR_RUNTIME_INCOMPATIBLE' });
+ assert.deepEqual(mock.launches, []); assert.deepEqual(mock.stops, []);
+ assert.deepEqual(await store.get(), before);
+ }, false));
+});
test('concurrent preview requests create one process and preserve existing source', () => fixture(async store => {
const current = await store.get(); await store.writeFiles(current.revision, [{ path: 'notes.md', content: 'preserve me' }]);
const before = await store.get(), mock = runtime(store);