@wise/wds-codemods 1.3.0-experimental-91568d6 → 1.3.0-experimental-4955ae2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"claude-cHSlHbX1.js","names":[],"sources":["../src/constants/claude.ts","../src/helpers/common/pathUtils.ts","../src/helpers/common/timerUtils.ts","../src/helpers/common/vpnUtils.ts","../src/helpers/claude/query.ts","../src/helpers/claude/transformer.ts"],"sourcesContent":["export const CLAUDE_SETTINGS_FILE = '.claude/settings.json';\nexport const VPN_COUNTDOWN_TIMEOUT = 5;\nexport const DIRECTORY_CONCURRENCY_LIMIT = 3;\nexport const FILE_CONCURRENCY_LIMIT = 10;\n\nexport const INITIAL_CLAUDE_PROMPT = `You are a code migration assistant that helps migrate TypeScript/JSX code of deprecated Wise Design System (WDS) components from '@transferwise/components', to their new replacement components as detailed in the relevant migration guide. The following is a list of rules that must always be followed throughout the migration process.\n\nRules:\n1. Only ever modify files via the Edit tool - do not use the Write tool\n2. When identifying what code to migrate within a file, explain how you identified it first.\n3. Migrate components per provided migration rules\n4. Maintain TypeScript type safety and update types to match new API\n5. Map props: handle renamed, deprecated, new required, and changed types\n6. Update imports to new WDS components and types\n7. Preserve code style, formatting, and calculated logic\n8. Handle conditional rendering, spread props, and complex expressions\n9. Note: New components may lack feature parity with legacy versions\n10. Only modify code requiring changes per migration rules, and any impacted surrounding code for context.\n11. Final result response should just be whether the migration was successful overall, or if any errors were encountered\n - Do not summarise or explain the changes made\n12. Explain your reasoning and justification before making changes, as you edit each file.\n - Keep it concise and succinct, as only bullet points\n13. After modifying the file, do not summarise the changes made.\n14. If you do not have permission to edit a file, still attempt to edit it and then move onto the next file.\n\nAdditionally you'll receive:\n- File paths to migrate in individual queries\n- Deprecated component names at the end of this prompt\n- Migration context and guide for each deprecated component`;\n","/** Split the path string to get the relative path after the directory, and wrap with ANSI color codes */\nexport function formatPathOutput(directory: string, path?: string, asDim?: boolean): string {\n const relativePath = path ? (path.split(directory.replace('.', ''))[1] ?? path) : directory;\n return asDim ? `\\x1b[2m${relativePath}\\x1b[0m` : `\\x1b[32m${relativePath}\\x1b[0m`;\n}\n","/** Generates a formatted string representing the total elapsed time since the given start time */\nexport function generateElapsedTime(startTime: number): string {\n const endTime = Date.now();\n const elapsedTime = Math.floor((endTime - startTime) / 1000);\n const hours = Math.floor(elapsedTime / 3600);\n const minutes = Math.floor((elapsedTime % 3600) / 60);\n const seconds = elapsedTime % 60;\n\n return `${hours ? `${hours}h ` : ''}${minutes ? `${minutes}m ` : ''}${seconds ? `${seconds}s` : ''}`;\n}\n","import https from 'node:https';\n\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\n\nimport { VPN_COUNTDOWN_TIMEOUT } from '../../constants/claude';\n\n/** Checks VPN connectivity by pinging the provided base URL's /health endpoint, with countdown retries */\nexport async function checkVPN(\n baseUrl: string | undefined,\n task: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n): Promise<void> {\n if (!baseUrl) return;\n\n const checkOnce = async (): Promise<boolean> =>\n new Promise<boolean>((resolveCheck) => {\n const url = new URL('/health', baseUrl);\n const req = https.get(url, { timeout: 2000, rejectUnauthorized: false }, (res) => {\n const ok = !!(res.statusCode && res.statusCode >= 200 && res.statusCode < 400);\n res.resume();\n resolveCheck(ok);\n });\n req.on('timeout', () => {\n req.destroy(new Error('timeout'));\n });\n req.on('error', () => resolveCheck(false));\n });\n\n while (true) {\n const ok = await checkOnce();\n if (ok) {\n // eslint-disable-next-line no-param-reassign\n task.title = 'Connected to VPN';\n break;\n }\n\n // Countdown from 5s\n for (let countdown = VPN_COUNTDOWN_TIMEOUT; countdown > 0; countdown -= 1) {\n // eslint-disable-next-line no-param-reassign\n task.output = `Please connect to VPN... retrying in ${countdown}s`;\n await new Promise<void>((response) => {\n setTimeout(response, 1000);\n });\n }\n }\n}\n","import { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nimport { type Options, query } from '@anthropic-ai/claude-agent-sdk';\nimport type { Manager } from '@listr2/manager';\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\n\nimport {\n CLAUDE_SETTINGS_FILE,\n DIRECTORY_CONCURRENCY_LIMIT,\n INITIAL_CLAUDE_PROMPT,\n} from '../../constants/claude';\nimport { CONSOLE_ICONS } from '../../constants/common';\nimport { checkVPN, formatPathOutput, generateElapsedTime } from '../common';\n\ninterface ClaudeSettings {\n apiKeyHelper?: string;\n env?: {\n ANTHROPIC_BASE_URL?: string;\n ANTHROPIC_CUSTOM_HEADERS?: string;\n ANTHROPIC_DEFAULT_SONNET_MODEL?: string;\n ANTHROPIC_DEFAULT_HAIKU_MODEL?: string;\n ANTHROPIC_DEFAULT_OPUS_MODEL?: string;\n API_TIMEOUT_MS?: string;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\ninterface QueryOptionProps {\n additionalPromptContext?: string;\n}\n\n/**\n * Creates reusable query options for Claude session, including authentication and system prompt\n */\nfunction getQueryOptions({ additionalPromptContext }: QueryOptionProps): Options {\n // Read settings from ~/.claude/settings.json to get headers and apiKeyHelper\n const claudeSettingsPath = resolve(process.env.HOME || '', CLAUDE_SETTINGS_FILE);\n const settings = JSON.parse(readFileSync(claudeSettingsPath, 'utf-8')) as ClaudeSettings;\n\n // Get API key by executing the apiKeyHelper script, for authenticating with Okta via LLM Gateway\n let apiKey;\n try {\n apiKey = execSync(`bash ${settings.apiKeyHelper}`, {\n encoding: 'utf-8',\n }).trim();\n } catch {}\n\n if (!apiKey || !settings.env?.ANTHROPIC_BASE_URL) {\n throw new Error(\n 'Failed to retrieve Anthropic API key or Base URL. Please check your Claude Code x LLM Gateway configuration - https://transferwise.atlassian.net/wiki/x/_YUe3Q',\n );\n }\n\n const { ANTHROPIC_CUSTOM_HEADERS, ...restEnvVars } = settings?.env ?? {};\n\n const envVars = {\n ANTHROPIC_AUTH_TOKEN: apiKey,\n ANTHROPIC_CUSTOM_HEADERS,\n ...restEnvVars,\n PATH: process.env.PATH, // Specifying PATH, as Claude Agent SDK seems to struggle consuming the actual environment PATH\n };\n\n return {\n env: envVars,\n permissionMode: 'acceptEdits',\n systemPrompt: {\n type: 'preset',\n preset: 'claude_code',\n append: `${INITIAL_CLAUDE_PROMPT}\\n${additionalPromptContext}`,\n },\n allowedTools: ['Grep', 'Read'],\n settingSources: ['local', 'project', 'user'],\n };\n}\n\n/**\n * Initiate a new Claude session/conversation and return reusable options\n */\nexport async function initiateClaudeSessionOptions(\n manager: Manager,\n additionalPromptContext: string,\n): Promise<Options> {\n let options: Options = {};\n\n manager.add([\n {\n title: 'Configuring Claude connection and instance...',\n task: async (ctx, task) => {\n options = getQueryOptions({ additionalPromptContext });\n\n return task.newListr([\n {\n title: 'Checking VPN connection...',\n task: async (\n subCtx,\n subtask: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => checkVPN(options.env?.ANTHROPIC_BASE_URL, subtask),\n },\n {\n title: 'Initialising Claude session',\n task: async (\n subCtx,\n subtask: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => {\n // eslint-disable-next-line no-param-reassign\n subtask.output = 'Your browser may open for Okta authentication if required';\n\n const result = query({\n options,\n prompt: `This is an initialisation query to start a new Claude code migration session. No text response is needed.`,\n });\n\n for await (const message of result) {\n switch (message.type) {\n case 'system':\n if (message.subtype === 'init' && !options.resume) {\n // Set the session ID to resume the conversation in future queries\n options.resume = message.session_id;\n }\n break;\n default:\n if (message.type === 'result' && message.subtype !== 'success') {\n throw new Error(\n `Claude encountered an error when initialising: ${message.errors.join('\\n')}`,\n );\n }\n }\n }\n\n // eslint-disable-next-line no-param-reassign\n task.title = 'Successfully configured and initialised Claude\\n';\n },\n },\n ]);\n },\n },\n ]);\n\n // Set manager to run tasks concurrently, once initialisation steps are done\n await manager.runAll().finally(() => {\n // eslint-disable-next-line no-param-reassign\n manager.options = {\n concurrent: DIRECTORY_CONCURRENCY_LIMIT,\n };\n });\n\n return options;\n}\n\n/**\n * Queries Claude with the given path and handles logging of success/error messages\n */\nexport async function queryClaude(\n directory: string,\n filePath: string,\n options: Options,\n task: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n isDebug = false,\n) {\n const startTime = Date.now();\n const result = query({\n options,\n prompt: filePath,\n });\n\n for await (const message of result) {\n switch (message.type) {\n case 'result':\n if (message.subtype === 'success' && isDebug) {\n // eslint-disable-next-line no-param-reassign\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n // eslint-disable-next-line no-param-reassign\n task.output = `\\x1b[2mMigrated in ${generateElapsedTime(startTime)}\\x1b[0m`;\n } else if (message.is_error) {\n // eslint-disable-next-line no-param-reassign\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n // eslint-disable-next-line no-param-reassign\n task.output = `${CONSOLE_ICONS.error} Claude encountered an error: ${JSON.stringify(message)}`;\n }\n break;\n default:\n }\n }\n}\n","import { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\n\nimport { Manager } from '@listr2/manager';\nimport {\n type DefaultRenderer,\n Listr,\n type ListrTask,\n type ListrTaskWrapper,\n type SimpleRenderer,\n} from 'listr2';\n\nimport { FILE_CONCURRENCY_LIMIT } from '../../constants/claude';\nimport { formatPathOutput, generateElapsedTime } from '../common';\nimport { initiateClaudeSessionOptions, queryClaude } from './query';\n\ninterface ClaudeTransformerOptions {\n targetDirectories: string[];\n componentGrepPattern: RegExp;\n additionalPromptContext: string;\n isDebug?: boolean;\n}\n\n/**\n * Performs code migration using Claude for the specified target directories, for the provided deprecated components and migration guides.\n * @param targetDirectories - Array of directory paths to process\n * @param componentGrepPattern - RegExp pattern to identify files needing migration (e.g. via deprecated component imports)\n * @param isDebug - Whether to enable debug logging\n * @param additionalPromptContext - Additional context to include in the initial Claude prompt before processing files\n */\nexport const claudeTransformer = async ({\n targetDirectories,\n componentGrepPattern,\n additionalPromptContext,\n isDebug = false,\n}: ClaudeTransformerOptions) => {\n process.setMaxListeners(20); // Resolves potential memory issues with how Claude handles its own event listeners\n const startTime = Date.now();\n // Create manager for handling multiple listr instances\n const manager = new Manager({\n concurrent: true,\n });\n const queryOptions = await initiateClaudeSessionOptions(manager, additionalPromptContext);\n\n manager.add([\n {\n title: 'Processing target directories for migration...',\n task: async (ctx, task) => {\n return task.newListr(\n targetDirectories.map((directory) => {\n // Find all .tsx files in the directory\n const allTsxFiles = execSync(`find \"${directory}\" -name \"*.tsx\" -type f`, {\n encoding: 'utf-8',\n })\n .trim()\n .split('\\n')\n .filter(Boolean);\n\n // Filter files that match the pattern by reading and testing each file\n const matchingFilePaths = allTsxFiles.filter((filePath) => {\n const content = readFileSync(filePath, 'utf-8');\n return componentGrepPattern.test(content);\n });\n\n // No files to process in this directory, so we add a task that's immediately skipped\n if (matchingFilePaths.length === 0) {\n return {\n title: `\\x1b[2m${formatPathOutput(directory)} - No files need migration\\x1b[0m`,\n task: (subCtx: ListrTask): void => {\n // eslint-disable-next-line no-param-reassign\n subCtx.skip = true;\n },\n };\n }\n\n return {\n title: `${formatPathOutput(directory)} - Found \\x1b[32m${matchingFilePaths.length}\\x1b[0m file(s) needing migration`,\n task: async (subCtx, parentTask) => {\n // eslint-disable-next-line no-param-reassign\n parentTask.title = `${formatPathOutput(directory)} - Migrating \\x1b[32m${matchingFilePaths.length}\\x1b[0m file(s)...`;\n const completedFilesInDirectory = { count: 0 };\n return parentTask\n .newListr(\n matchingFilePaths.map((filePath) => ({\n title: '', // No title so it runs in the background without any console output\n task: async (\n fileCtx,\n fileTask: ListrTaskWrapper<\n never,\n typeof DefaultRenderer,\n typeof SimpleRenderer\n >,\n ) => {\n await queryClaude(\n directory,\n filePath,\n queryOptions,\n fileTask,\n isDebug,\n ).finally(() => {\n // Update parent task title with progress for each completed file migration\n completedFilesInDirectory.count += 1;\n const isDim =\n completedFilesInDirectory.count === matchingFilePaths.length;\n // eslint-disable-next-line no-param-reassign\n parentTask.title = `${isDim ? '\\x1b[2m' : ''}${formatPathOutput(directory)} - Migrated \\x1b[32m${completedFilesInDirectory.count}\\x1b[0m/\\x1b[32m${matchingFilePaths.length}\\x1b[0m files${isDim ? '\\x1b[0m' : ''}`;\n });\n },\n })),\n { concurrent: FILE_CONCURRENCY_LIMIT },\n )\n .run();\n },\n };\n }),\n { rendererOptions: { suffixSkips: false, collapseSubtasks: false } },\n );\n },\n },\n ]);\n\n // Run all directory tasks concurrently, with final follow up/summary task\n await manager.runAll().finally(async () => {\n await new Listr([\n {\n title: `Finished migrating - elapsed time: \\x1b[32m${generateElapsedTime(startTime)}\\x1b[0m `,\n task: async () => {\n // Task completes immediately\n },\n },\n ]).run();\n });\n};\n"],"mappings":";;;;;;;;;AAAA,MAAa,uBAAuB;AAKpC,MAAa,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJrC,SAAgB,iBAAiB,WAAmB,MAAe,OAAyB;CAC1F,MAAM,eAAe,OAAQ,KAAK,MAAM,UAAU,QAAQ,KAAK,GAAG,CAAC,CAAC,MAAM,OAAQ;AAClF,QAAO,QAAQ,UAAU,aAAa,WAAW,WAAW,aAAa;;;;;ACF3E,SAAgB,oBAAoB,WAA2B;CAE7D,MAAM,cAAc,KAAK,OADT,KAAK,KAAK,GACgB,aAAa,IAAK;CAC5D,MAAM,QAAQ,KAAK,MAAM,cAAc,KAAK;CAC5C,MAAM,UAAU,KAAK,MAAO,cAAc,OAAQ,GAAG;CACrD,MAAM,UAAU,cAAc;AAE9B,QAAO,GAAG,QAAQ,GAAG,MAAM,MAAM,KAAK,UAAU,GAAG,QAAQ,MAAM,KAAK,UAAU,GAAG,QAAQ,KAAK;;;;;ACDlG,eAAsB,SACpB,SACA,MACe;AACf,KAAI,CAAC,QAAS;CAEd,MAAM,YAAY,YAChB,IAAI,SAAkB,iBAAiB;EACrC,MAAM,MAAM,IAAI,IAAI,WAA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OAAO,eAAe,QAAQ,YAAY;UAC/M;;OAEL,EAAE,EACH,EAAE,YAAA,IAAoC,CACvC,CACA,KAAK;;KAEX;KACD,EACF,EAAE,iBAAiB;IAAE,aAAa;IAAO,kBAAkB;IAAO,EAAE,CACrE;;EAEJ,CACF,CAAC;AAGF,OAAM,QAAQ,QAAQ,CAAC,QAAQ,YAAY;AACzC,QAAM,IAAI,MAAM,CACd;GACE,OAAO,8CAA8C,oBAAoB,UAAU,CAAC;GACpF,MAAM,YAAY;GAGnB,CACF,CAAC,CAAC,KAAK;GACR"}
1
+ {"version":3,"file":"claude-cHSlHbX1.js","names":[],"sources":["../src/constants/claude.ts","../src/helpers/common/pathUtils.ts","../src/helpers/common/timerUtils.ts","../src/helpers/common/vpnUtils.ts","../src/helpers/claude/query.ts","../src/helpers/claude/transformer.ts"],"sourcesContent":["export const CLAUDE_SETTINGS_FILE = '.claude/settings.json';\nexport const VPN_COUNTDOWN_TIMEOUT = 5;\nexport const DIRECTORY_CONCURRENCY_LIMIT = 3;\nexport const FILE_CONCURRENCY_LIMIT = 10;\n\nexport const INITIAL_CLAUDE_PROMPT = `You are a code migration assistant that helps migrate TypeScript/JSX code of deprecated Wise Design System (WDS) components from '@transferwise/components', to their new replacement components as detailed in the relevant migration guide. The following is a list of rules that must always be followed throughout the migration process.\n\nRules:\n1. Only ever modify files via the Edit tool - do not use the Write tool\n2. When identifying what code to migrate within a file, explain how you identified it first.\n3. Migrate components per provided migration rules\n4. Maintain TypeScript type safety and update types to match new API\n5. Map props: handle renamed, deprecated, new required, and changed types\n6. Update imports to new WDS components and types\n7. Preserve code style, formatting, and calculated logic\n8. Handle conditional rendering, spread props, and complex expressions\n9. Note: New components may lack feature parity with legacy versions\n10. Only modify code requiring changes per migration rules, and any impacted surrounding code for context.\n11. Final result response should just be whether the migration was successful overall, or if any errors were encountered\n - Do not summarise or explain the changes made\n12. Explain your reasoning and justification before making changes, as you edit each file.\n - Keep it concise and succinct, as only bullet points\n13. After modifying the file, do not summarise the changes made.\n14. If you do not have permission to edit a file, still attempt to edit it and then move onto the next file.\n\nAdditionally you'll receive:\n- File paths to migrate in individual queries\n- Deprecated component names at the end of this prompt\n- Migration context and guide for each deprecated component`;\n","/** Split the path string to get the relative path after the directory, and wrap with ANSI color codes */\nexport function formatPathOutput(directory: string, path?: string, asDim?: boolean): string {\n const relativePath = path ? (path.split(directory.replace('.', ''))[1] ?? path) : directory;\n return asDim ? `\\x1b[2m${relativePath}\\x1b[0m` : `\\x1b[32m${relativePath}\\x1b[0m`;\n}\n","/** Generates a formatted string representing the total elapsed time since the given start time */\nexport function generateElapsedTime(startTime: number): string {\n const endTime = Date.now();\n const elapsedTime = Math.floor((endTime - startTime) / 1000);\n const hours = Math.floor(elapsedTime / 3600);\n const minutes = Math.floor((elapsedTime % 3600) / 60);\n const seconds = elapsedTime % 60;\n\n return `${hours ? `${hours}h ` : ''}${minutes ? `${minutes}m ` : ''}${seconds ? `${seconds}s` : ''}`;\n}\n","import https from 'node:https';\n\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\n\nimport { VPN_COUNTDOWN_TIMEOUT } from '../../constants/claude';\n\n/** Checks VPN connectivity by pinging the provided base URL's /health endpoint, with countdown retries */\nexport async function checkVPN(\n baseUrl: string | undefined,\n task: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n): Promise<void> {\n if (!baseUrl) return;\n\n const checkOnce = async (): Promise<boolean> =>\n new Promise<boolean>((resolveCheck) => {\n const url = new URL('/health', baseUrl);\n const req = https.get(url, { timeout: 2000, rejectUnauthorized: false }, (res) => {\n const ok = !!(res.statusCode && res.statusCode >= 200 && res.statusCode < 400);\n res.resume();\n resolveCheck(ok);\n });\n req.on('timeout', () => {\n req.destroy(new Error('timeout'));\n });\n req.on('error', () => resolveCheck(false));\n });\n\n while (true) {\n const ok = await checkOnce();\n if (ok) {\n // eslint-disable-next-line no-param-reassign\n task.title = 'Connected to VPN';\n break;\n }\n\n // Countdown from 5s\n for (let countdown = VPN_COUNTDOWN_TIMEOUT; countdown > 0; countdown -= 1) {\n // eslint-disable-next-line no-param-reassign\n task.output = `Please connect to VPN... retrying in ${countdown}s`;\n await new Promise<void>((response) => {\n setTimeout(response, 1000);\n });\n }\n }\n}\n","import { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nimport { type Options, query } from '@anthropic-ai/claude-agent-sdk';\nimport type { Manager } from '@listr2/manager';\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\n\nimport {\n CLAUDE_SETTINGS_FILE,\n DIRECTORY_CONCURRENCY_LIMIT,\n INITIAL_CLAUDE_PROMPT,\n} from '../../constants/claude';\nimport { CONSOLE_ICONS } from '../../constants/common';\nimport { checkVPN, formatPathOutput, generateElapsedTime } from '../common';\n\ninterface ClaudeSettings {\n apiKeyHelper?: string;\n env?: {\n ANTHROPIC_BASE_URL?: string;\n ANTHROPIC_CUSTOM_HEADERS?: string;\n ANTHROPIC_DEFAULT_SONNET_MODEL?: string;\n ANTHROPIC_DEFAULT_HAIKU_MODEL?: string;\n ANTHROPIC_DEFAULT_OPUS_MODEL?: string;\n API_TIMEOUT_MS?: string;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\ninterface QueryOptionProps {\n additionalPromptContext?: string;\n}\n\n/**\n * Creates reusable query options for Claude session, including authentication and system prompt\n */\nfunction getQueryOptions({ additionalPromptContext }: QueryOptionProps): Options {\n // Read settings from ~/.claude/settings.json to get headers and apiKeyHelper\n const claudeSettingsPath = resolve(process.env.HOME || '', CLAUDE_SETTINGS_FILE);\n const settings = JSON.parse(readFileSync(claudeSettingsPath, 'utf-8')) as ClaudeSettings;\n\n // Get API key by executing the apiKeyHelper script, for authenticating with Okta via LLM Gateway\n let apiKey;\n try {\n apiKey = execSync(`bash ${settings.apiKeyHelper}`, {\n encoding: 'utf-8',\n }).trim();\n } catch {}\n\n if (!apiKey || !settings.env?.ANTHROPIC_BASE_URL) {\n throw new Error(\n 'Failed to retrieve Anthropic API key or Base URL. Please check your Claude Code x LLM Gateway configuration - https://transferwise.atlassian.net/wiki/x/_YUe3Q',\n );\n }\n\n const { ANTHROPIC_CUSTOM_HEADERS, ...restEnvVars } = settings?.env ?? {};\n\n const envVars = {\n ANTHROPIC_AUTH_TOKEN: apiKey,\n ANTHROPIC_CUSTOM_HEADERS,\n ...restEnvVars,\n PATH: process.env.PATH, // Specifying PATH, as Claude Agent SDK seems to struggle consuming the actual environment PATH\n };\n\n return {\n env: envVars,\n permissionMode: 'acceptEdits',\n systemPrompt: {\n type: 'preset',\n preset: 'claude_code',\n append: `${INITIAL_CLAUDE_PROMPT}\\n${additionalPromptContext}`,\n },\n allowedTools: ['Grep', 'Read'],\n settingSources: ['local', 'project', 'user'],\n };\n}\n\n/**\n * Initiate a new Claude session/conversation and return reusable options\n */\nexport async function initiateClaudeSessionOptions(\n manager: Manager,\n additionalPromptContext: string,\n): Promise<Options> {\n let options: Options = {};\n\n manager.add([\n {\n title: 'Configuring Claude connection and instance...',\n task: async (ctx, task) => {\n options = getQueryOptions({ additionalPromptContext });\n\n return task.newListr([\n {\n title: 'Checking VPN connection...',\n task: async (\n subCtx,\n subtask: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => checkVPN(options.env?.ANTHROPIC_BASE_URL, subtask),\n },\n {\n title: 'Initialising Claude session',\n task: async (\n subCtx,\n subtask: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => {\n // eslint-disable-next-line no-param-reassign\n subtask.output = 'Your browser may open for Okta authentication if required';\n\n const result = query({\n options,\n prompt: `This is an initialisation query to start a new Claude code migration session. No text response is needed.`,\n });\n\n for await (const message of result) {\n switch (message.type) {\n case 'system':\n if (message.subtype === 'init' && !options.resume) {\n // Set the session ID to resume the conversation in future queries\n options.resume = message.session_id;\n }\n break;\n default:\n if (message.type === 'result' && message.subtype !== 'success') {\n throw new Error(\n `Claude encountered an error when initialising: ${message.errors.join('\\n')}`,\n );\n }\n }\n }\n\n // eslint-disable-next-line no-param-reassign\n task.title = 'Successfully configured and initialised Claude\\n';\n },\n },\n ]);\n },\n },\n ]);\n\n // Set manager to run tasks concurrently, once initialisation steps are done\n await manager.runAll().finally(() => {\n // eslint-disable-next-line no-param-reassign\n manager.options = {\n concurrent: DIRECTORY_CONCURRENCY_LIMIT,\n };\n });\n\n return options;\n}\n\n/**\n * Queries Claude with the given path and handles logging of success/error messages\n */\nexport async function queryClaude(\n directory: string,\n filePath: string,\n options: Options,\n task: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n isDebug = false,\n) {\n const startTime = Date.now();\n const result = query({\n options,\n prompt: filePath,\n });\n\n for await (const message of result) {\n switch (message.type) {\n case 'result':\n if (message.subtype === 'success' && isDebug) {\n // eslint-disable-next-line no-param-reassign\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n // eslint-disable-next-line no-param-reassign\n task.output = `\\x1b[2mMigrated in ${generateElapsedTime(startTime)}\\x1b[0m`;\n } else if (message.is_error) {\n // eslint-disable-next-line no-param-reassign\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n // eslint-disable-next-line no-param-reassign\n task.output = `${CONSOLE_ICONS.error} Claude encountered an error: ${JSON.stringify(message)}`;\n }\n break;\n default:\n }\n }\n}\n","import { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\n\nimport { Manager } from '@listr2/manager';\nimport {\n type DefaultRenderer,\n Listr,\n type ListrTask,\n type ListrTaskWrapper,\n type SimpleRenderer,\n} from 'listr2';\n\nimport { FILE_CONCURRENCY_LIMIT } from '../../constants/claude';\nimport { formatPathOutput, generateElapsedTime } from '../common';\nimport { initiateClaudeSessionOptions, queryClaude } from './query';\n\ninterface ClaudeTransformerOptions {\n targetDirectories: string[];\n componentGrepPattern: RegExp;\n additionalPromptContext: string;\n isDebug?: boolean;\n}\n\n/**\n * Performs code migration using Claude for the specified target directories, for the provided deprecated components and migration guides.\n * @param targetDirectories - Array of directory paths to process\n * @param componentGrepPattern - RegExp pattern to identify files needing migration (e.g. via deprecated component imports)\n * @param isDebug - Whether to enable debug logging\n * @param additionalPromptContext - Additional context to include in the initial Claude prompt before processing files\n */\nexport const claudeTransformer = async ({\n targetDirectories,\n componentGrepPattern,\n additionalPromptContext,\n isDebug = false,\n}: ClaudeTransformerOptions) => {\n process.setMaxListeners(20); // Resolves potential memory issues with how Claude handles its own event listeners\n const startTime = Date.now();\n // Create manager for handling multiple listr instances\n const manager = new Manager({\n concurrent: true,\n });\n const queryOptions = await initiateClaudeSessionOptions(manager, additionalPromptContext);\n\n manager.add([\n {\n title: 'Processing target directories for migration...',\n task: async (ctx, task) => {\n return task.newListr(\n targetDirectories.map((directory) => {\n // Find all .tsx files in the directory\n const allTsxFiles = execSync(`find \"${directory}\" -name \"*.tsx\" -type f`, {\n encoding: 'utf-8',\n })\n .trim()\n .split('\\n')\n .filter(Boolean);\n\n // Filter files that match the pattern by reading and testing each file\n const matchingFilePaths = allTsxFiles.filter((filePath) => {\n const content = readFileSync(filePath, 'utf-8');\n return componentGrepPattern.test(content);\n });\n\n // No files to process in this directory, so we add a task that's immediately skipped\n if (matchingFilePaths.length === 0) {\n return {\n title: `\\x1b[2m${formatPathOutput(directory)} - No files need migration\\x1b[0m`,\n task: (subCtx: ListrTask): void => {\n // eslint-disable-next-line no-param-reassign\n subCtx.skip = true;\n },\n };\n }\n\n return {\n title: `${formatPathOutput(directory)} - Found \\x1b[32m${matchingFilePaths.length}\\x1b[0m file(s) needing migration`,\n task: async (subCtx, parentTask) => {\n // eslint-disable-next-line no-param-reassign\n parentTask.title = `${formatPathOutput(directory)} - Migrating \\x1b[32m${matchingFilePaths.length}\\x1b[0m file(s)...`;\n const completedFilesInDirectory = { count: 0 };\n return parentTask\n .newListr(\n matchingFilePaths.map((filePath) => ({\n title: '', // No title so it runs in the background without any console output\n task: async (\n fileCtx,\n fileTask: ListrTaskWrapper<\n never,\n typeof DefaultRenderer,\n typeof SimpleRenderer\n >,\n ) => {\n await queryClaude(\n directory,\n filePath,\n queryOptions,\n fileTask,\n isDebug,\n ).finally(() => {\n // Update parent task title with progress for each completed file migration\n completedFilesInDirectory.count += 1;\n const isDim =\n completedFilesInDirectory.count === matchingFilePaths.length;\n // eslint-disable-next-line no-param-reassign\n parentTask.title = `${isDim ? '\\x1b[2m' : ''}${formatPathOutput(directory)} - Migrated \\x1b[32m${completedFilesInDirectory.count}\\x1b[0m/\\x1b[32m${matchingFilePaths.length}\\x1b[0m files${isDim ? '\\x1b[0m' : ''}`;\n });\n },\n })),\n { concurrent: FILE_CONCURRENCY_LIMIT },\n )\n .run();\n },\n };\n }),\n { rendererOptions: { suffixSkips: false, collapseSubtasks: false } },\n );\n },\n },\n ]);\n\n // Run all directory tasks concurrently, with final follow up/summary task\n await manager.runAll().finally(async () => {\n await new Listr([\n {\n title: `Finished migrating - elapsed time: \\x1b[32m${generateElapsedTime(startTime)}\\x1b[0m `,\n task: async () => {\n // Task completes immediately\n },\n },\n ]).run();\n });\n};\n"],"mappings":";;;;;;;;;AAAA,MAAa,uBAAuB;AAKpC,MAAa,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJrC,SAAgB,iBAAiB,WAAmB,MAAe,OAAyB;CAC1F,MAAM,eAAe,OAAQ,KAAK,MAAM,UAAU,QAAQ,KAAK,GAAG,CAAC,CAAC,MAAM,OAAQ;AAClF,QAAO,QAAQ,UAAU,aAAa,WAAW,WAAW,aAAa;;;;;ACF3E,SAAgB,oBAAoB,WAA2B;CAE7D,MAAM,cAAc,KAAK,OADT,KAAK,KACkB,GAAG,aAAa,IAAK;CAC5D,MAAM,QAAQ,KAAK,MAAM,cAAc,KAAK;CAC5C,MAAM,UAAU,KAAK,MAAO,cAAc,OAAQ,GAAG;CACrD,MAAM,UAAU,cAAc;AAE9B,QAAO,GAAG,QAAQ,GAAG,MAAM,MAA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WACA,UACA,cACA,UACA,QACD,CAAC,cAAc;AAEd,mCAA0B,SAAS;SACnC,MAAM,QACJ,0BAA0B,UAAU,kBAAkB;AAExD,oBAAW,QAAQ,GAAG,QAAQ,YAAY,KAAK,iBAAiB,UAAU,CAAC,sBAAsB,0BAA0B,MAAM,kBAAkB,kBAAkB,OAAO,eAAe,QAAQ,YAAY;UAC/M;;OAEL,EAAE,EACH,EAAE,YAAA,IAAoC,CACvC,CACA,KAAK;;KAEX;KACD,EACF,EAAE,iBAAiB;IAAE,aAAa;IAAO,kBAAkB;IAAO,EAAE,CACrE;;EAEJ,CACF,CAAC;AAGF,OAAM,QAAQ,QAAQ,CAAC,QAAQ,YAAY;AACzC,QAAM,IAAI,MAAM,CACd;GACE,OAAO,8CAA8C,oBAAoB,UAAU,CAAC;GACpF,MAAM,YAAY;GAGnB,CACF,CAAC,CAAC,KAAK;GACR"}
@@ -12,7 +12,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
13
13
  var __getProtoOf = Object.getPrototypeOf;
14
14
  var __hasOwnProp = Object.prototype.hasOwnProperty;
15
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
15
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
16
16
  var __copyProps = (to, from, except, desc) => {
17
17
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
18
18
  key = keys[i];
@@ -28,7 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  enumerable: true
29
29
  }) : target, mod));
30
30
  //#endregion
31
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js
31
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/constants.js
32
32
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
33
33
  const SEMVER_SPEC_VERSION = "2.0.0";
34
34
  const MAX_LENGTH = 256;
@@ -53,12 +53,12 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
53
53
  };
54
54
  }));
55
55
  //#endregion
56
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js
56
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/debug.js
57
57
  var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
58
58
  module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
59
59
  }));
60
60
  //#endregion
61
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js
61
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/re.js
62
62
  var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
63
63
  const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
64
64
  const debug = require_debug();
@@ -137,7 +137,7 @@ var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
137
137
  createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
138
138
  }));
139
139
  //#endregion
140
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js
140
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/parse-options.js
141
141
  var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
142
142
  const looseOption = Object.freeze({ loose: true });
143
143
  const emptyOpts = Object.freeze({});
@@ -149,7 +149,7 @@ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) =>
149
149
  module.exports = parseOptions;
150
150
  }));
151
151
  //#endregion
152
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js
152
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/identifiers.js
153
153
  var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
154
154
  const numeric = /^[0-9]+$/;
155
155
  const compareIdentifiers = (a, b) => {
@@ -169,7 +169,7 @@ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
169
169
  };
170
170
  }));
171
171
  //#endregion
172
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js
172
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/semver.js
173
173
  var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
174
174
  const debug = require_debug();
175
175
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
@@ -347,7 +347,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
347
347
  };
348
348
  }));
349
349
  //#endregion
350
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js
350
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/parse.js
351
351
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
352
352
  const SemVer = require_semver$1();
353
353
  const parse = (version, options, throwErrors = false) => {
@@ -362,7 +362,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
362
362
  module.exports = parse;
363
363
  }));
364
364
  //#endregion
365
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js
365
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/valid.js
366
366
  var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
367
367
  const parse = require_parse();
368
368
  const valid = (version, options) => {
@@ -372,7 +372,7 @@ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372
372
  module.exports = valid;
373
373
  }));
374
374
  //#endregion
375
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js
375
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/clean.js
376
376
  var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
377
377
  const parse = require_parse();
378
378
  const clean = (version, options) => {
@@ -382,7 +382,7 @@ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
382
382
  module.exports = clean;
383
383
  }));
384
384
  //#endregion
385
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js
385
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/inc.js
386
386
  var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
387
387
  const SemVer = require_semver$1();
388
388
  const inc = (version, release, options, identifier, identifierBase) => {
@@ -400,7 +400,7 @@ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
400
400
  module.exports = inc;
401
401
  }));
402
402
  //#endregion
403
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js
403
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/diff.js
404
404
  var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
405
405
  const parse = require_parse();
406
406
  const diff = (version1, version2) => {
@@ -428,28 +428,28 @@ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
428
428
  module.exports = diff;
429
429
  }));
430
430
  //#endregion
431
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js
431
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/major.js
432
432
  var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
433
433
  const SemVer = require_semver$1();
434
434
  const major = (a, loose) => new SemVer(a, loose).major;
435
435
  module.exports = major;
436
436
  }));
437
437
  //#endregion
438
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js
438
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/minor.js
439
439
  var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
440
440
  const SemVer = require_semver$1();
441
441
  const minor = (a, loose) => new SemVer(a, loose).minor;
442
442
  module.exports = minor;
443
443
  }));
444
444
  //#endregion
445
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js
445
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/patch.js
446
446
  var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
447
447
  const SemVer = require_semver$1();
448
448
  const patch = (a, loose) => new SemVer(a, loose).patch;
449
449
  module.exports = patch;
450
450
  }));
451
451
  //#endregion
452
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js
452
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/prerelease.js
453
453
  var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
454
454
  const parse = require_parse();
455
455
  const prerelease = (version, options) => {
@@ -459,28 +459,28 @@ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
459
459
  module.exports = prerelease;
460
460
  }));
461
461
  //#endregion
462
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js
462
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare.js
463
463
  var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
464
464
  const SemVer = require_semver$1();
465
465
  const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
466
466
  module.exports = compare;
467
467
  }));
468
468
  //#endregion
469
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js
469
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rcompare.js
470
470
  var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
471
471
  const compare = require_compare();
472
472
  const rcompare = (a, b, loose) => compare(b, a, loose);
473
473
  module.exports = rcompare;
474
474
  }));
475
475
  //#endregion
476
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js
476
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-loose.js
477
477
  var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
478
478
  const compare = require_compare();
479
479
  const compareLoose = (a, b) => compare(a, b, true);
480
480
  module.exports = compareLoose;
481
481
  }));
482
482
  //#endregion
483
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js
483
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-build.js
484
484
  var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
485
485
  const SemVer = require_semver$1();
486
486
  const compareBuild = (a, b, loose) => {
@@ -491,63 +491,63 @@ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
491
491
  module.exports = compareBuild;
492
492
  }));
493
493
  //#endregion
494
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js
494
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/sort.js
495
495
  var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
496
496
  const compareBuild = require_compare_build();
497
497
  const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
498
498
  module.exports = sort;
499
499
  }));
500
500
  //#endregion
501
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js
501
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rsort.js
502
502
  var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
503
503
  const compareBuild = require_compare_build();
504
504
  const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
505
505
  module.exports = rsort;
506
506
  }));
507
507
  //#endregion
508
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js
508
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gt.js
509
509
  var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
510
510
  const compare = require_compare();
511
511
  const gt = (a, b, loose) => compare(a, b, loose) > 0;
512
512
  module.exports = gt;
513
513
  }));
514
514
  //#endregion
515
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js
515
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lt.js
516
516
  var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
517
517
  const compare = require_compare();
518
518
  const lt = (a, b, loose) => compare(a, b, loose) < 0;
519
519
  module.exports = lt;
520
520
  }));
521
521
  //#endregion
522
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js
522
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/eq.js
523
523
  var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
524
524
  const compare = require_compare();
525
525
  const eq = (a, b, loose) => compare(a, b, loose) === 0;
526
526
  module.exports = eq;
527
527
  }));
528
528
  //#endregion
529
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js
529
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/neq.js
530
530
  var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
531
531
  const compare = require_compare();
532
532
  const neq = (a, b, loose) => compare(a, b, loose) !== 0;
533
533
  module.exports = neq;
534
534
  }));
535
535
  //#endregion
536
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js
536
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gte.js
537
537
  var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
538
538
  const compare = require_compare();
539
539
  const gte = (a, b, loose) => compare(a, b, loose) >= 0;
540
540
  module.exports = gte;
541
541
  }));
542
542
  //#endregion
543
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js
543
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lte.js
544
544
  var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
545
545
  const compare = require_compare();
546
546
  const lte = (a, b, loose) => compare(a, b, loose) <= 0;
547
547
  module.exports = lte;
548
548
  }));
549
549
  //#endregion
550
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js
550
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/cmp.js
551
551
  var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
552
552
  const eq = require_eq();
553
553
  const neq = require_neq();
@@ -579,7 +579,7 @@ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
579
579
  module.exports = cmp;
580
580
  }));
581
581
  //#endregion
582
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js
582
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/coerce.js
583
583
  var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
584
584
  const SemVer = require_semver$1();
585
585
  const parse = require_parse();
@@ -607,7 +607,40 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
607
607
  module.exports = coerce;
608
608
  }));
609
609
  //#endregion
610
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js
610
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/truncate.js
611
+ var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
612
+ const parse = require_parse();
613
+ const constants = require_constants();
614
+ const SemVer = require_semver$1();
615
+ const truncate = (version, truncation, options) => {
616
+ if (!constants.RELEASE_TYPES.includes(truncation)) return null;
617
+ const clonedVersion = cloneInputVersion(version, options);
618
+ return clonedVersion && doTruncation(clonedVersion, truncation);
619
+ };
620
+ const cloneInputVersion = (version, options) => {
621
+ return parse(version instanceof SemVer ? version.version : version, options);
622
+ };
623
+ const doTruncation = (version, truncation) => {
624
+ if (isPrerelease(truncation)) return version.version;
625
+ version.prerelease = [];
626
+ switch (truncation) {
627
+ case "major":
628
+ version.minor = 0;
629
+ version.patch = 0;
630
+ break;
631
+ case "minor":
632
+ version.patch = 0;
633
+ break;
634
+ }
635
+ return version.format();
636
+ };
637
+ const isPrerelease = (type) => {
638
+ return type.startsWith("pre");
639
+ };
640
+ module.exports = truncate;
641
+ }));
642
+ //#endregion
643
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/lrucache.js
611
644
  var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
612
645
  var LRUCache = class {
613
646
  constructor() {
@@ -640,7 +673,7 @@ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
640
673
  module.exports = LRUCache;
641
674
  }));
642
675
  //#endregion
643
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js
676
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/range.js
644
677
  var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
645
678
  const SPACE_CHARACTERS = /\s+/g;
646
679
  module.exports = class Range {
@@ -912,7 +945,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
912
945
  };
913
946
  }));
914
947
  //#endregion
915
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js
948
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/comparator.js
916
949
  var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
917
950
  const ANY = Symbol("SemVer ANY");
918
951
  module.exports = class Comparator {
@@ -982,7 +1015,7 @@ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
982
1015
  const Range = require_range();
983
1016
  }));
984
1017
  //#endregion
985
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js
1018
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/satisfies.js
986
1019
  var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
987
1020
  const Range = require_range();
988
1021
  const satisfies = (version, range, options) => {
@@ -996,14 +1029,14 @@ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
996
1029
  module.exports = satisfies;
997
1030
  }));
998
1031
  //#endregion
999
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js
1032
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/to-comparators.js
1000
1033
  var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1001
1034
  const Range = require_range();
1002
1035
  const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1003
1036
  module.exports = toComparators;
1004
1037
  }));
1005
1038
  //#endregion
1006
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js
1039
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/max-satisfying.js
1007
1040
  var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1008
1041
  const SemVer = require_semver$1();
1009
1042
  const Range = require_range();
@@ -1029,7 +1062,7 @@ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1029
1062
  module.exports = maxSatisfying;
1030
1063
  }));
1031
1064
  //#endregion
1032
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js
1065
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-satisfying.js
1033
1066
  var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1034
1067
  const SemVer = require_semver$1();
1035
1068
  const Range = require_range();
@@ -1055,7 +1088,7 @@ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1055
1088
  module.exports = minSatisfying;
1056
1089
  }));
1057
1090
  //#endregion
1058
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js
1091
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-version.js
1059
1092
  var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1060
1093
  const SemVer = require_semver$1();
1061
1094
  const Range = require_range();
@@ -1083,6 +1116,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1083
1116
  break;
1084
1117
  case "<":
1085
1118
  case "<=": break;
1119
+ /* istanbul ignore next */
1086
1120
  default: throw new Error(`Unexpected operation: ${comparator.operator}`);
1087
1121
  }
1088
1122
  });
@@ -1094,7 +1128,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1094
1128
  module.exports = minVersion;
1095
1129
  }));
1096
1130
  //#endregion
1097
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js
1131
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/valid.js
1098
1132
  var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1099
1133
  const Range = require_range();
1100
1134
  const validRange = (range, options) => {
@@ -1107,7 +1141,7 @@ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1107
1141
  module.exports = validRange;
1108
1142
  }));
1109
1143
  //#endregion
1110
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js
1144
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/outside.js
1111
1145
  var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1112
1146
  const SemVer = require_semver$1();
1113
1147
  const Comparator = require_comparator();
@@ -1160,21 +1194,21 @@ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1160
1194
  module.exports = outside;
1161
1195
  }));
1162
1196
  //#endregion
1163
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js
1197
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/gtr.js
1164
1198
  var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1165
1199
  const outside = require_outside();
1166
1200
  const gtr = (version, range, options) => outside(version, range, ">", options);
1167
1201
  module.exports = gtr;
1168
1202
  }));
1169
1203
  //#endregion
1170
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js
1204
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/ltr.js
1171
1205
  var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1172
1206
  const outside = require_outside();
1173
1207
  const ltr = (version, range, options) => outside(version, range, "<", options);
1174
1208
  module.exports = ltr;
1175
1209
  }));
1176
1210
  //#endregion
1177
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js
1211
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/intersects.js
1178
1212
  var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1179
1213
  const Range = require_range();
1180
1214
  const intersects = (r1, r2, options) => {
@@ -1185,7 +1219,7 @@ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1185
1219
  module.exports = intersects;
1186
1220
  }));
1187
1221
  //#endregion
1188
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js
1222
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/simplify.js
1189
1223
  var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1190
1224
  const satisfies = require_satisfies();
1191
1225
  const compare = require_compare();
@@ -1215,7 +1249,7 @@ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1215
1249
  };
1216
1250
  }));
1217
1251
  //#endregion
1218
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js
1252
+ //#region node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/subset.js
1219
1253
  var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1220
1254
  const Range = require_range();
1221
1255
  const Comparator = require_comparator();
@@ -1310,8 +1344,8 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1310
1344
  module.exports = subset;
1311
1345
  }));
1312
1346
  //#endregion
1313
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js
1314
- var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1347
+ //#region src/controller/helpers/getCodemodConfig.ts
1348
+ var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
1315
1349
  const internalRe = require_re();
1316
1350
  const constants = require_constants();
1317
1351
  const SemVer = require_semver$1();
@@ -1340,6 +1374,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1340
1374
  lte: require_lte(),
1341
1375
  cmp: require_cmp(),
1342
1376
  coerce: require_coerce(),
1377
+ truncate: require_truncate(),
1343
1378
  Comparator: require_comparator(),
1344
1379
  Range: require_range(),
1345
1380
  satisfies: require_satisfies(),
@@ -1363,9 +1398,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1363
1398
  compareIdentifiers: identifiers.compareIdentifiers,
1364
1399
  rcompareIdentifiers: identifiers.rcompareIdentifiers
1365
1400
  };
1366
- }));
1367
- //#endregion
1368
- //#region src/controller/helpers/getCodemodConfig.ts
1401
+ })))(), 1);
1369
1402
  /** Retrieves a JSON object from a file path, returning null if the file does not exist */
1370
1403
  const getJsonFromPath = (baseDir, fileName) => {
1371
1404
  const jsonPath = join(baseDir, fileName);
@@ -1474,7 +1507,6 @@ const renderTable = (data, indexHeading = "index") => {
1474
1507
  };
1475
1508
  //#endregion
1476
1509
  //#region src/controller/helpers/dependencyChecks.ts
1477
- var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
1478
1510
  /**
1479
1511
  * Checks if the installed version satisfies the given version requirement.
1480
1512
  */
@@ -1903,4 +1935,4 @@ function validateClaudeConfig() {
1903
1935
  //#endregion
1904
1936
  export { getOptions as a, assessPrerequisitesBatch as c, getCodemodConfig as d, loadTransformModules as i, findPackages as l, runTransformPrompts as n, logToInquirer as o, reportManualReview as r, assessPrerequisites as s, validateClaudeConfig as t, findProjectRoot as u };
1905
1937
 
1906
- //# sourceMappingURL=helpers-9e0vtyED.js.map
1938
+ //# sourceMappingURL=helpers-1cvsnoa6.js.map