MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getModifyContext

Method getModifyContext

packages/core/src/tools/memoryTool.ts:417–436  ·  view source on GitHub ↗
(_abortSignal: AbortSignal)

Source from the content-addressed store, hash-verified

415 }
416
417 getModifyContext(_abortSignal: AbortSignal): ModifyContext<SaveMemoryParams> {
418 return {
419 getFilePath: (_params: SaveMemoryParams) => getGlobalMemoryFilePath(),
420 getCurrentContent: async (_params: SaveMemoryParams): Promise<string> =>
421 readMemoryFileContent(),
422 getProposedContent: async (params: SaveMemoryParams): Promise<string> => {
423 const currentContent = await readMemoryFileContent();
424 return computeNewContent(currentContent, params.fact);
425 },
426 createUpdatedParams: (
427 _oldContent: string,
428 modifiedProposedContent: string,
429 originalParams: SaveMemoryParams,
430 ): SaveMemoryParams => ({
431 ...originalParams,
432 modified_by_user: true,
433 modified_content: modifiedProposedContent,
434 }),
435 };
436 }
437}

Callers

nothing calls this directly

Calls 3

getGlobalMemoryFilePathFunction · 0.85
readMemoryFileContentFunction · 0.85
computeNewContentFunction · 0.85

Tested by

no test coverage detected