MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / updateNode

Method updateNode

apps/webuiapps/src/lib/FileSystemStore.ts:231–259  ·  view source on GitHub ↗

* Update a node

(id: string, updates: UpdateFileNodeParams)

Source from the content-addressed store, hash-verified

229 * Update a node
230 */
231 updateNode(id: string, updates: UpdateFileNodeParams): FileNode | undefined {
232 const node = this.nodes.get(id);
233 if (!node) {
234 return undefined;
235 }
236
237 // Apply updates
238 if (updates.name !== undefined) {
239 node.name = updates.name;
240 }
241 if (updates.content !== undefined) {
242 node.content = updates.content;
243 }
244 if (updates.metadata !== undefined) {
245 node.metadata = {
246 ...node.metadata,
247 ...updates.metadata,
248 updatedAt: Date.now(),
249 };
250 } else {
251 node.metadata = {
252 ...node.metadata,
253 updatedAt: Date.now(),
254 };
255 }
256
257 this.emit('node_updated', id, node.path);
258 return node;
259 }
260
261 /**
262 * Remove a node

Callers 1

useFileSystemFunction · 0.80

Calls 1

emitMethod · 0.95

Tested by

no test coverage detected