fix(mcp): add shared operations and secure scene APIs

This commit is contained in:
Aymeric Rabot
2026-04-27 17:10:25 -04:00
parent 058ee747c9
commit 8dfd1a9429
81 changed files with 1332 additions and 1786 deletions
+4 -8
View File
@@ -2,8 +2,8 @@ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import { cloneLevelSubtree } from '@pascal-app/core/clone-scene-graph'
import type { AnyNode, AnyNodeId } from '@pascal-app/core/schema'
import { z } from 'zod'
import type { Patch as BridgePatch, SceneBridge } from '../bridge/scene-bridge'
import type { SceneStore } from '../storage/types'
import type { Patch as BridgePatch } from '../bridge/scene-bridge'
import type { SceneOperations } from '../operations'
import { ErrorCode, throwMcpError } from './errors'
import { publishLiveSceneSnapshot } from './live-sync'
import { NodeIdSchema } from './schemas'
@@ -17,11 +17,7 @@ export const duplicateLevelOutput = {
newNodeIds: z.array(z.string()),
}
export function registerDuplicateLevel(
server: McpServer,
bridge: SceneBridge,
store?: SceneStore,
): void {
export function registerDuplicateLevel(server: McpServer, bridge: SceneOperations): void {
server.registerTool(
'duplicate_level',
{
@@ -63,7 +59,7 @@ export function registerDuplicateLevel(
})
const result = bridge.applyPatch(patches)
await publishLiveSceneSnapshot(bridge, store, 'duplicate_level')
await publishLiveSceneSnapshot(bridge, 'duplicate_level')
const payload = {
newLevelId: newLevelId as string,