/
opt
/
canhelp
/
node_modules
/
@anthropic-ai
/
sdk
/
src
/
helpers
/
beta
/
/opt/canhelp/node_modules/@anthropic-ai/sdk/src/helpers/beta
mkdir
upload
Name
Size
Mode
Actions
json-schema.ts
2592
0644
edit
dl
rm
mcp.ts
21157
0644
edit
dl
rm
memory.ts
904
0644
edit
dl
rm
zod.ts
2720
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/@anthropic-ai/sdk/src/helpers/beta/memory.ts
(904B)
import { BetaRunnableTool, Promisable } from '../../lib/tools/BetaRunnableTool'; import { BetaMemoryTool20250818Command, BetaToolResultContentBlockParam } from '../../resources/beta'; type Command = BetaMemoryTool20250818Command['command']; export type MemoryToolHandlers = { [K in Command]: ( command: Extract<BetaMemoryTool20250818Command, { command: K }>, ) => Promisable<string | Array<BetaToolResultContentBlockParam>>; }; export function betaMemoryTool( handlers: MemoryToolHandlers, ): BetaRunnableTool<BetaMemoryTool20250818Command> { return { type: 'memory_20250818', name: 'memory', parse: (content) => content as BetaMemoryTool20250818Command, run: (args) => { const handler = handlers[args.command]; if (!handler) { throw new Error(`${args.command} not implemented`); } return handler.bind(handlers)(args as any); }, }; }
Save
cmd:
run