{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/codemods/lib/utils.ts"],"sourcesContent":["// Shared utility functions for codemods\n\nimport type { Collection, JSCodeshift } from 'jscodeshift';\n\n/**\n * Finds all local names (including aliases) used to import a specific class from a module.\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param className - Name of the class to find imports for\n * @param moduleName - Module to search for imports from (e.g., '@mastra/memory')\n * @returns Set of local names used for the class (includes aliases)\n */\nexport function findImportAliases(\n  j: JSCodeshift,\n  root: Collection<any>,\n  className: string,\n  moduleName: string,\n): Set<string> {\n  const aliases = new Set<string>();\n\n  root.find(j.ImportDeclaration).forEach(path => {\n    const source = path.value.source.value;\n    if (typeof source !== 'string' || source !== moduleName) return;\n\n    if (!path.value.specifiers) return;\n\n    path.value.specifiers.forEach((specifier: any) => {\n      if (\n        specifier.type === 'ImportSpecifier' &&\n        specifier.imported.type === 'Identifier' &&\n        specifier.imported.name === className\n      ) {\n        // Use the local name (which could be an alias or the original name)\n        const localName = specifier.local?.name || className;\n        aliases.add(localName);\n      }\n    });\n  });\n\n  return aliases;\n}\n\n/**\n * Efficiently tracks instances of a specific class by finding all `new ClassName()` expressions\n * and extracting the variable names they're assigned to.\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param className - Name of the class to track\n * @param moduleName - Optional module name to also track aliased imports from\n * @returns Set of variable names that are instances of the class\n */\nexport function trackClassInstances(\n  j: JSCodeshift,\n  root: Collection<any>,\n  className: string,\n  moduleName?: string,\n): Set<string> {\n  const instances = new Set<string>();\n\n  // Find all names that refer to this class\n  let classNames: Set<string>;\n\n  if (moduleName) {\n    // When moduleName is specified, only track usages if the class is actually imported from that module\n    const aliases = findImportAliases(j, root, className, moduleName);\n    if (aliases.size === 0) {\n      // Class is not imported from the specified module, skip transformation\n      return instances;\n    }\n    classNames = aliases;\n  } else {\n    // When no moduleName is specified, use the className directly\n    classNames = new Set<string>([className]);\n  }\n\n  root.find(j.NewExpression).forEach(path => {\n    const { callee } = path.value;\n    if (callee.type !== 'Identifier') return;\n    if (!classNames.has(callee.name)) return;\n\n    const parent = path.parent.value;\n    if (parent.type === 'VariableDeclarator' && parent.id.type === 'Identifier') {\n      instances.add(parent.id.name);\n    }\n  });\n\n  return instances;\n}\n\n/**\n * Efficiently tracks instances of multiple classes in a single pass.\n * This is optimized for codemods that need to track several store types or class variants.\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param classNames - Array of class names to track\n * @returns Set of variable names that are instances of any of the classes\n */\nexport function trackMultipleClassInstances(j: JSCodeshift, root: Collection<any>, classNames: string[]): Set<string> {\n  const instances = new Set<string>();\n  const classNameSet = new Set(classNames);\n\n  root.find(j.NewExpression).forEach(path => {\n    const { callee } = path.value;\n    if (callee.type !== 'Identifier') return;\n    if (!classNameSet.has(callee.name)) return;\n\n    const parent = path.parent.value;\n    if (parent.type === 'VariableDeclarator' && parent.id.type === 'Identifier') {\n      instances.add(parent.id.name);\n    }\n  });\n\n  return instances;\n}\n\n/**\n * Efficiently finds and transforms method calls on tracked instances.\n * This combines finding, filtering, and transforming in a single pass.\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param instances - Set of instance variable names to track\n * @param methodName - Name of the method to find (or undefined to match any method)\n * @param transform - Callback to transform matching call expressions\n * @returns Number of transformations made\n */\nexport function transformMethodCalls(\n  j: JSCodeshift,\n  root: Collection<any>,\n  instances: Set<string>,\n  methodName: string | undefined,\n  transform: (path: any) => void,\n): number {\n  if (instances.size === 0) return 0;\n\n  let count = 0;\n\n  root.find(j.CallExpression).forEach(path => {\n    const { callee } = path.value;\n    if (callee.type !== 'MemberExpression') return;\n    if (callee.object.type !== 'Identifier') return;\n    if (callee.property.type !== 'Identifier') return;\n\n    // Only process if called on a tracked instance\n    if (!instances.has(callee.object.name)) return;\n\n    // Only process if it's the method we want (or any method if undefined)\n    if (methodName && callee.property.name !== methodName) return;\n\n    transform(path);\n    count++;\n  });\n\n  return count;\n}\n\n/**\n * Renames a method on tracked instances efficiently in a single pass.\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param instances - Set of instance variable names to track\n * @param oldMethodName - Current method name\n * @param newMethodName - New method name\n * @returns Number of renames performed\n */\nexport function renameMethod(\n  j: JSCodeshift,\n  root: Collection<any>,\n  instances: Set<string>,\n  oldMethodName: string,\n  newMethodName: string,\n): number {\n  if (instances.size === 0) return 0;\n\n  let count = 0;\n\n  root.find(j.CallExpression).forEach(path => {\n    const { callee } = path.value;\n    if (callee.type !== 'MemberExpression') return;\n    if (callee.object.type !== 'Identifier') return;\n    if (callee.property.type !== 'Identifier') return;\n\n    // Only process if called on tracked instance\n    if (!instances.has(callee.object.name)) return;\n\n    // Only process if it's the method we want to rename\n    if (callee.property.name !== oldMethodName) return;\n\n    callee.property.name = newMethodName;\n    count++;\n  });\n\n  return count;\n}\n\n/**\n * Renames multiple methods on tracked instances in a single pass.\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param instances - Set of instance variable names to track\n * @param methodRenames - Map of old method names to new method names\n * @returns Number of renames performed\n */\nexport function renameMethods(\n  j: JSCodeshift,\n  root: Collection<any>,\n  instances: Set<string>,\n  methodRenames: Record<string, string>,\n): number {\n  if (instances.size === 0) return 0;\n\n  let count = 0;\n\n  root.find(j.CallExpression).forEach(path => {\n    const { callee } = path.value;\n    if (callee.type !== 'MemberExpression') return;\n    if (callee.object.type !== 'Identifier') return;\n    if (callee.property.type !== 'Identifier') return;\n\n    // Only process if called on tracked instance\n    if (!instances.has(callee.object.name)) return;\n\n    // Check if this is one of the methods we want to rename\n    const oldName = callee.property.name;\n    const newName = methodRenames[oldName];\n\n    if (newName) {\n      callee.property.name = newName;\n      count++;\n    }\n  });\n\n  return count;\n}\n\n/**\n * Transforms object properties in method call arguments.\n * This is a helper for codemods that need to rename properties in object arguments.\n *\n * @param obj - Object expression to transform\n * @param propertyRenames - Map of old property names to new property names\n * @returns Number of properties renamed\n */\nexport function transformObjectProperties(obj: any, propertyRenames: Record<string, string>): number {\n  let count = 0;\n\n  const recurse = (o: any) => {\n    if (!o.properties) return;\n\n    o.properties.forEach((prop: any) => {\n      if ((prop.type === 'Property' || prop.type === 'ObjectProperty') && prop.key?.type === 'Identifier') {\n        const oldName = prop.key.name;\n        const newName = propertyRenames[oldName];\n\n        if (newName) {\n          prop.key.name = newName;\n          count++;\n        }\n\n        // Recursively transform nested objects\n        if (prop.value?.type === 'ObjectExpression') {\n          recurse(prop.value);\n        }\n      }\n    });\n  };\n\n  recurse(obj);\n  return count;\n}\n\n/**\n * Checks if a node is a member expression accessing a specific property on tracked instances.\n *\n * @param node - AST node to check\n * @param instances - Set of instance variable names to track\n * @param propertyName - Property name to match (or undefined to match any property)\n * @returns true if the node matches\n */\nexport function isMemberExpressionOnInstance(node: any, instances: Set<string>, propertyName?: string): boolean {\n  if (node.type !== 'MemberExpression') return false;\n  if (node.object.type !== 'Identifier') return false;\n  if (!instances.has(node.object.name)) return false;\n\n  if (propertyName && node.property.type === 'Identifier' && node.property.name !== propertyName) {\n    return false;\n  }\n\n  return true;\n}\n\n/**\n * Renames an import and all its usages in a single optimized pass.\n * Handles aliased imports correctly - only transforms usages for non-aliased imports.\n * Handles multiple imports of the same name (with different aliases) correctly.\n *\n * For non-aliased imports: Renames both import and all usages\n *   import { oldName } → import { newName }\n *   oldName() → newName()\n *\n * For aliased imports: Only renames the import, keeps alias in usages\n *   import { oldName as alias } → import { newName as alias }\n *   alias() → alias() (unchanged)\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param packageName - Package to import from (e.g., '@mastra/core/evals')\n * @param oldName - Current import name\n * @param newName - New import name\n * @returns Number of changes made\n */\nexport function renameImportAndUsages(\n  j: JSCodeshift,\n  root: Collection<any>,\n  packageName: string,\n  oldName: string,\n  newName: string,\n): number {\n  let changes = 0;\n  const localNamesToReplace = new Set<string>();\n\n  // First: Transform import specifiers from the specific package and collect local names to replace\n  root\n    .find(j.ImportDeclaration)\n    .filter(path => {\n      const source = path.value.source.value;\n      return typeof source === 'string' && source === packageName;\n    })\n    .forEach(path => {\n      if (!path.value.specifiers) return;\n\n      path.value.specifiers.forEach((specifier: any) => {\n        if (\n          specifier.type === 'ImportSpecifier' &&\n          specifier.imported.type === 'Identifier' &&\n          specifier.imported.name === oldName\n        ) {\n          const isAliased = specifier.local && specifier.local.name !== oldName;\n\n          // Always rename the imported name\n          specifier.imported.name = newName;\n          changes++;\n\n          // Only rename the local name and track for usage replacement if NOT aliased\n          if (!isAliased) {\n            if (specifier.local) {\n              specifier.local.name = newName;\n            }\n            // Track for usage replacement (only non-aliased imports)\n            localNamesToReplace.add(oldName);\n          }\n        }\n      });\n    });\n\n  // Second: Transform usages only for non-aliased imports\n  localNamesToReplace.forEach(localName => {\n    root.find(j.Identifier, { name: localName }).forEach(path => {\n      // Skip identifiers that are part of import declarations\n      const parent = path.parent;\n      if (parent && parent.value.type === 'ImportSpecifier') {\n        return;\n      }\n\n      path.value.name = newName;\n      changes++;\n    });\n  });\n\n  return changes;\n}\n\n/**\n * Tracks variables assigned from method calls on tracked instances.\n * Useful for tracking objects returned from factory methods like `client.getAgent()`.\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param instances - Set of instance variable names to track\n * @param methodName - Name of the method to track (or undefined to match any method)\n * @returns Set of variable names that are assigned from the method calls\n */\nexport function trackMethodCallResults(\n  j: JSCodeshift,\n  root: Collection<any>,\n  instances: Set<string>,\n  methodName?: string,\n): Set<string> {\n  const results = new Set<string>();\n\n  if (instances.size === 0) return results;\n\n  root.find(j.CallExpression).forEach(path => {\n    const { callee } = path.value;\n    if (callee.type !== 'MemberExpression') return;\n    if (callee.object.type !== 'Identifier') return;\n    if (callee.property.type !== 'Identifier') return;\n\n    // Only process if called on a tracked instance\n    if (!instances.has(callee.object.name)) return;\n\n    // Only process if it's the method we want (or any method if undefined)\n    if (methodName && callee.property.name !== methodName) return;\n\n    // Track the variable this is assigned to\n    const parent = path.parent.value;\n    if (parent.type === 'VariableDeclarator' && parent.id.type === 'Identifier') {\n      results.add(parent.id.name);\n    }\n  });\n\n  return results;\n}\n\n/**\n * Transforms properties in constructor call arguments.\n *\n * @param j - JSCodeshift API\n * @param root - Root collection\n * @param className - Name of the class whose constructor to transform\n * @param propertyRenames - Map of old property names to new property names\n * @returns Number of properties renamed\n */\nexport function transformConstructorProperties(\n  j: JSCodeshift,\n  root: Collection<any>,\n  className: string,\n  propertyRenames: Record<string, string>,\n): number {\n  let count = 0;\n\n  root\n    .find(j.NewExpression, {\n      callee: { type: 'Identifier', name: className },\n    })\n    .forEach(path => {\n      const args = path.value.arguments;\n      if (args.length === 0) return;\n\n      const firstArg = args[0];\n      if (!firstArg || firstArg.type !== 'ObjectExpression' || !firstArg.properties) return;\n\n      firstArg.properties.forEach((prop: any) => {\n        if ((prop.type === 'Property' || prop.type === 'ObjectProperty') && prop.key?.type === 'Identifier') {\n          const oldName = prop.key.name;\n          const newName = propertyRenames[oldName];\n\n          if (newName) {\n            prop.key.name = newName;\n            count++;\n          }\n        }\n      });\n    });\n\n  return count;\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,kBACd,GACA,MACA,WACA,YACa;CACb,MAAM,0BAAU,IAAI,IAAY;CAEhC,KAAK,KAAK,EAAE,iBAAiB,CAAC,CAAC,SAAQ,SAAQ;EAC7C,MAAM,SAAS,KAAK,MAAM,OAAO;EACjC,IAAI,OAAO,WAAW,YAAY,WAAW,YAAY;EAEzD,IAAI,CAAC,KAAK,MAAM,YAAY;EAE5B,KAAK,MAAM,WAAW,SAAS,cAAmB;GAChD,IACE,UAAU,SAAS,qBACnB,UAAU,SAAS,SAAS,gBAC5B,UAAU,SAAS,SAAS,WAC5B;IAEA,MAAM,YAAY,UAAU,OAAO,QAAQ;IAC3C,QAAQ,IAAI,SAAS;GACvB;EACF,CAAC;CACH,CAAC;CAED,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,oBACd,GACA,MACA,WACA,YACa;CACb,MAAM,4BAAY,IAAI,IAAY;CAGlC,IAAI;CAEJ,IAAI,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