{"version":3,"file":"experimental-auth.mjs","names":[],"sources":["../../../src/codemods/v1/experimental-auth.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\n\n/**\n * Renames experimental_auth to auth in Mastra configuration.\n */\nexport default createTransformer((fileInfo, api, options, context) => {\n  const { j, root } = context;\n\n  // Find all new Mastra({ ... }) expressions\n  root\n    .find(j.NewExpression, {\n      callee: { type: 'Identifier', name: 'Mastra' },\n    })\n    .forEach(mastraPath => {\n      const configArg = mastraPath.node.arguments[0];\n      if (!configArg || configArg.type !== 'ObjectExpression') return;\n\n      // Find experimental_auth property in the Mastra config object\n      configArg.properties?.forEach(prop => {\n        if (\n          (prop.type === 'Property' || prop.type === 'ObjectProperty') &&\n          prop.key &&\n          prop.key.type === 'Identifier' &&\n          prop.key.name === 'experimental_auth'\n        ) {\n          // Rename to 'auth'\n          prop.key.name = 'auth';\n          context.hasChanges = true;\n        }\n      });\n    });\n\n  if (context.hasChanges) {\n    context.messages.push(`Renamed experimental_auth to auth in Mastra configuration`);\n  }\n});\n"],"mappings":";;;;;AAKA,IAAA,4BAAe,mBAAmB,UAAU,KAAK,SAAS,YAAY;CACpE,MAAM,EAAE,GAAG,SAAS;CAGpB,KACG,KAAK,EAAE,eAAe,EACrB,QAAQ;EAAE,MAAM;EAAc,MAAM;CAAS,EAC/C,CAAC,CAAC,CACD,SAAQ,eAAc;EACrB,MAAM,YAAY,WAAW,KAAK,UAAU;EAC5C,IAAI,CAAC,aAAa,UAAU,SAAS,oBAAoB;EAGzD,UAAU,YAAY,SAAQ,SAAQ;GACpC,KACG,KAAK,SAAS,cAAc,KAAK,SAAS,qBAC3C,KAAK,OACL,KAAK,IAAI,SAAS,gBAClB,KAAK,IAAI,SAAS,qBAClB;IAEA,KAAK,IAAI,OAAO;IAChB,QAAQ,aAAa;GACvB;EACF,CAAC;CACH,CAAC;CAEH,IAAI,QAAQ,YACV,QAAQ,SAAS,KAAK,2DAA2D;AAErF,CAAC"}