fix(mcp): add shared operations and secure scene APIs
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { SceneBridge } from '../../bridge/scene-bridge'
|
||||
import { createSceneOperations, type SceneOperations } from '../../operations'
|
||||
import {
|
||||
type SceneListOptions,
|
||||
type SceneMeta,
|
||||
@@ -15,6 +17,20 @@ export function parseToolText(content: StoredTextContent[]): Record<string, unkn
|
||||
return JSON.parse(content[0]!.text) as Record<string, unknown>
|
||||
}
|
||||
|
||||
export function createTestSceneOperations(options?: {
|
||||
bridge?: SceneBridge
|
||||
store?: InMemorySceneStore
|
||||
}): {
|
||||
bridge: SceneBridge
|
||||
store: InMemorySceneStore
|
||||
operations: SceneOperations
|
||||
} {
|
||||
const bridge = options?.bridge ?? new SceneBridge()
|
||||
const store = options?.store ?? new InMemorySceneStore()
|
||||
const operations = createSceneOperations({ bridge, store })
|
||||
return { bridge, store, operations }
|
||||
}
|
||||
|
||||
/**
|
||||
* In-memory `SceneStore` for tests. Backed by a plain `Map` keyed by id.
|
||||
* Implements the full interface including optimistic concurrency via
|
||||
|
||||
Reference in New Issue
Block a user