summaryrefslogtreecommitdiff
path: root/packages/cli/src/config/memoryUtils.ts
diff options
context:
space:
mode:
authorAllen Hutchison <[email protected]>2025-05-23 08:47:19 -0700
committerGitHub <[email protected]>2025-05-23 08:47:19 -0700
commitf8c4276e69cb8262433a4059540c873c2c996420 (patch)
tree93cb2fa4cd8666bf5fb78b79a44b57d2a792e222 /packages/cli/src/config/memoryUtils.ts
parent70277591c417cbc6bcb4b80ffa1873f52a983830 (diff)
Refactor(cli): Move memory add logic to server tool call (#493)
Diffstat (limited to 'packages/cli/src/config/memoryUtils.ts')
-rw-r--r--packages/cli/src/config/memoryUtils.ts37
1 files changed, 0 insertions, 37 deletions
diff --git a/packages/cli/src/config/memoryUtils.ts b/packages/cli/src/config/memoryUtils.ts
deleted file mode 100644
index 63a7734f..00000000
--- a/packages/cli/src/config/memoryUtils.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * @license
- * Copyright 2025 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import * as fs from 'fs/promises';
-import * as path from 'path';
-import { homedir } from 'os';
-import { SETTINGS_DIRECTORY_NAME } from './settings.js';
-import {
- // getErrorMessage, // Removed as it's not used
- MemoryTool,
- GEMINI_MD_FILENAME,
- // MEMORY_SECTION_HEADER, // Removed as it's not used
-} from '@gemini-code/server';
-
-/**
- * Gets the absolute path to the global GEMINI.md file.
- */
-export function getGlobalMemoryFilePath(): string {
- return path.join(homedir(), SETTINGS_DIRECTORY_NAME, GEMINI_MD_FILENAME);
-}
-
-/**
- * Adds a new memory entry to the global GEMINI.md file under the specified header.
- */
-export async function addMemoryEntry(text: string): Promise<void> {
- const filePath = getGlobalMemoryFilePath();
- // The performAddMemoryEntry method from MemoryTool will handle its own errors
- // and throw an appropriately formatted error if needed.
- await MemoryTool.performAddMemoryEntry(text, filePath, {
- readFile: fs.readFile,
- writeFile: fs.writeFile,
- mkdir: fs.mkdir,
- });
-}