{"version":3,"file":"memory-query-to-recall.mjs","names":[],"sources":["../../../src/codemods/v1/memory-query-to-recall.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\nimport { trackClassInstances, renameMethod } from '../lib/utils';\n\n/**\n * Renames memory.query() to memory.recall().\n * This better describes the action of retrieving messages from memory.\n *\n * Before:\n * const result = await memory.query({ threadId: 'thread-123' });\n *\n * After:\n * const result = await memory.recall({ threadId: 'thread-123' });\n */\nexport default createTransformer((_fileInfo, _api, _options, context) => {\n  const { j, root } = context;\n\n  // Track Memory instances and rename query to recall in a single optimized pass\n  const memoryInstances = trackClassInstances(j, root, 'Memory');\n  const count = renameMethod(j, root, memoryInstances, 'query', 'recall');\n\n  if (count > 0) {\n    context.hasChanges = true;\n    context.messages.push('Renamed query to recall on Memory instances');\n  }\n});\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAA,iCAAe,mBAAmB,WAAW,MAAM,UAAU,YAAY;CACvE,MAAM,EAAE,GAAG,SAAS;CAMpB,IAFc,aAAa,GAAG,MADN,oBAAoB,GAAG,MAAM,QACH,GAAG,SAAS,QAEtD,IAAI,GAAG;EACb,QAAQ,aAAa;EACrB,QAAQ,SAAS,KAAK,6CAA6C;CACrE;AACF,CAAC"}