feat(mcp): add guided construction workflows
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
||||
import { z } from 'zod'
|
||||
import type { SceneBridge } from '../bridge/scene-bridge'
|
||||
import type { SceneStore } from '../storage/types'
|
||||
import { publishLiveSceneSnapshot } from './live-sync'
|
||||
|
||||
export const redoInput = {
|
||||
steps: z.number().int().positive().optional(),
|
||||
@@ -10,7 +12,7 @@ export const redoOutput = {
|
||||
redone: z.number(),
|
||||
}
|
||||
|
||||
export function registerRedo(server: McpServer, bridge: SceneBridge): void {
|
||||
export function registerRedo(server: McpServer, bridge: SceneBridge, store?: SceneStore): void {
|
||||
server.registerTool(
|
||||
'redo',
|
||||
{
|
||||
@@ -22,6 +24,7 @@ export function registerRedo(server: McpServer, bridge: SceneBridge): void {
|
||||
},
|
||||
async ({ steps }) => {
|
||||
const redone = bridge.redo(steps ?? 1)
|
||||
if (redone > 0) await publishLiveSceneSnapshot(bridge, store, 'redo')
|
||||
const payload = { redone }
|
||||
return {
|
||||
content: [{ type: 'text' as const, text: JSON.stringify(payload) }],
|
||||
|
||||
Reference in New Issue
Block a user