diff --git a/packages/tools/src/claude-memory.test.ts b/packages/tools/src/claude-memory.test.ts index afe16dcf..7337441a 100644 --- a/packages/tools/src/claude-memory.test.ts +++ b/packages/tools/src/claude-memory.test.ts @@ -39,7 +39,7 @@ const NEIGHBOUR_DOCUMENT = { content: "backup stuff", } -function mockDocuments(documents: typeof FILE_DOCUMENT[]) { +function mockDocuments(documents: (typeof FILE_DOCUMENT)[]) { documentsListMock.mockResolvedValue({ memories: documents.map((document) => ({ id: document.id, @@ -191,20 +191,22 @@ describe("ClaudeMemoryTool str_replace replacement literalness", () => { tool = new ClaudeMemoryTool("test-api-key") }) - it.each(["$&", "$'", "$`", "$$"])( - "stores %s literally instead of expanding it as a replacement pattern", - async (dollarSequence) => { - const result = await tool.handleCommand({ - command: "str_replace", - path: FILE_PATH, - old_str: "line3", - new_str: `price is ${dollarSequence} today`, - }) + it.each([ + "$&", + "$'", + "$`", + "$$", + ])("stores %s literally instead of expanding it as a replacement pattern", async (dollarSequence) => { + const result = await tool.handleCommand({ + command: "str_replace", + path: FILE_PATH, + old_str: "line3", + new_str: `price is ${dollarSequence} today`, + }) - expect(result.success).toBe(true) - expect(addMock).toHaveBeenCalledTimes(1) - const stored = addMock.mock.calls[0]?.[0]?.content as string - expect(stored).toContain(`price is ${dollarSequence} today`) - }, - ) + expect(result.success).toBe(true) + expect(addMock).toHaveBeenCalledTimes(1) + const stored = addMock.mock.calls[0]?.[0]?.content as string + expect(stored).toContain(`price is ${dollarSequence} today`) + }) }) diff --git a/packages/tools/src/claude-memory.ts b/packages/tools/src/claude-memory.ts index 3792e9f8..867c4d82 100644 --- a/packages/tools/src/claude-memory.ts +++ b/packages/tools/src/claude-memory.ts @@ -150,7 +150,7 @@ export class ClaudeMemoryTool { default: return { success: false, - error: `Unknown command: ${(command as any).command}`, + error: `Unknown command: ${(command as { command: string }).command}`, } } } catch (error) { diff --git a/packages/tools/src/openai/tools.ts b/packages/tools/src/openai/tools.ts index 06a26935..22257727 100644 --- a/packages/tools/src/openai/tools.ts +++ b/packages/tools/src/openai/tools.ts @@ -15,9 +15,7 @@ import type { SupermemoryToolsConfig } from "../types" */ export interface MemorySearchResult { success: boolean - results?: Awaited< - ReturnType - >["results"] + results?: Awaited>["results"] count?: number error?: string } diff --git a/packages/tools/src/tools-shared.ts b/packages/tools/src/tools-shared.ts index dffc7093..c0a3b540 100644 --- a/packages/tools/src/tools-shared.ts +++ b/packages/tools/src/tools-shared.ts @@ -47,7 +47,8 @@ export const PARAMETER_DESCRIPTIONS = { "Profile-memory ID from query-backed getProfile searchResults. Soft-forgets one learned fact; document and chunk IDs from searchMemories are not valid.", memoryContent: "Exact text of the profile memory to forget (alternative to memoryId). Must match precisely; if unsure, query getProfile and use a search-result memory ID.", - reason: "Optional reason recorded when forgetting (e.g. outdated, user correction)", + reason: + "Optional reason recorded when forgetting (e.g. outdated, user correction)", } as const // Default values @@ -77,7 +78,9 @@ export function getContainerTags(config?: { } if (config?.projectId !== undefined) { if (config.projectId.trim() === "") { - throw new Error("Supermemory tools config requires a non-empty projectId.") + throw new Error( + "Supermemory tools config requires a non-empty projectId.", + ) } return [`${CONTAINER_TAG_CONSTANTS.projectPrefix}${config.projectId}`] } @@ -104,7 +107,9 @@ export async function deleteDocumentById( const response = await client.documents.deleteBulk({ ids: [documentId] }) if (response.success && response.deletedCount === 1) return - const detail = response.errors?.find((error) => error.id === documentId)?.error + const detail = response.errors?.find( + (error) => error.id === documentId, + )?.error throw new Error( detail ? `Failed to delete document ${documentId}: ${detail}`