(args: z.infer<typeof RememberArgs>, ctx: ToolContext)
| 45 | argsSchema = RememberArgs; |
| 46 | |
| 47 | async execute(args: z.infer<typeof RememberArgs>, ctx: ToolContext): Promise<ToolResult> { |
| 48 | const cwd = ctx.cwd ?? process.cwd(); |
| 49 | const scope = args.scope ?? 'project'; |
| 50 | getSessionStore().addFact(ctx.sessionId, cwd, args.fact, scope); |
| 51 | const { exportMemory } = await import('../../context/memory-mirror.js'); |
| 52 | await exportMemory(cwd); // keep the human-readable MEMORY.md mirror in sync (best-effort) |
| 53 | const where = scope === 'user' ? 'all projects (user memory)' : cwd; |
| 54 | return { content: `Remembered for ${where}:\n ${args.fact}` }; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | const RecallArgs = z.object({ |
nothing calls this directly
no test coverage detected