fix(mcp): add shared operations and secure scene APIs
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user