MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / updateMemory

Function updateMemory

ts/workflow-builder/src/utils/memoryOperations.ts:35–49  ·  view source on GitHub ↗
(id: string, patch: { label?: string; arguments?: Record<string, unknown> })

Source from the content-addressed store, hash-verified

33 * at creation (the user picks a type when adding), so it is never patched here.
34 */
35export function updateMemory(id: string, patch: { label?: string; arguments?: Record<string, unknown> }): void {
36 const key = id;
37 useEditorStore.getState().setMemory((mem) => {
38 const existing = mem[key];
39 if (!existing) return mem;
40 return {
41 ...mem,
42 [key]: {
43 ...existing,
44 ...(patch.label !== undefined ? { label: patch.label } : {}),
45 ...(patch.arguments ? { arguments: { ...existing.arguments, ...patch.arguments } } : {}),
46 },
47 };
48 });
49}
50
51export function deleteMemory(id: string): void {
52 const key = id;

Callers 1

MemoryConfigPanelFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected