@wise/wds-codemods 1.3.0-experimental-9823f2a → 1.3.0-experimental-e136682

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,4 +1,4 @@
1
- import { t as CONSOLE_ICONS } from "./common-nTdKnfMB.js";
1
+ import { t as CONSOLE_ICONS } from "./common-AexZXiET.js";
2
2
  import { execSync } from "node:child_process";
3
3
  import { resolve } from "node:path";
4
4
  import { readFileSync } from "node:fs";
@@ -236,4 +236,4 @@ const claudeTransformer = async ({ targetDirectories, componentGrepPattern, addi
236
236
  //#endregion
237
237
  export { claudeTransformer as t };
238
238
 
239
- //# sourceMappingURL=claude-cHSlHbX1.js.map
239
+ //# sourceMappingURL=claude-D6IwFmoz.js.map
@@ -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,KACkB,GAAG,aAAa,IAAK;CAC5D,MAAM,QAA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AAO;MAClG,MAAM,4BAA4B,EAAE,OAAO,GAAG;AAC9C,aAAO,WACJ,SACC,kBAAkB,KAAK,cAAc;OACnC,OAAO;OACP,MAAM,OACJ,SACA,aAKG;AACH,cAAM,YACJ,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"}
1
+ {"version":3,"file":"claude-D6IwFmoz.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,QA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;KAC9C,OAAO,qBAAqB,KAAK,OAAO;IAC1C,CAAC;IAGD,IAAI,kBAAkB,WAAW,GAC/B,OAAO;KACL,OAAO,UAAU,iBAAiB,SAAS,EAAE;KAC7C,OAAO,WAA4B;MAEjC,OAAO,OAAO;KAChB;IACF;IAGF,OAAO;KACL,OAAO,GAAG,iBAAiB,SAAS,EAAE,mBAAmB,kBAAkB,OAAO;KAClF,MAAM,OAAO,QAAQ,eAAe;MAElC,WAAW,QAAQ,GAAG,iBAAiB,SAAS,EAAE,uBAAuB,kBAAkB,OAAO;MAClG,MAAM,4BAA4B,EAAE,OAAO,EAAE;MAC7C,OAAO,WACJ,SACC,kBAAkB,KAAK,cAAc;OACnC,OAAO;OACP,MAAM,OACJ,SACA,aAKG;QACH,MAAM,YACJ,WACA,UACA,cACA,UACA,OACF,CAAC,CAAC,cAAc;SAEd,0BAA0B,SAAS;SACnC,MAAM,QACJ,0BAA0B,UAAU,kBAAkB;SAExD,WAAW,QAAQ,GAAG,QAAQ,YAAY,KAAK,iBAAiB,SAAS,EAAE,sBAAsB,0BAA0B,MAAM,kBAAkB,kBAAkB,OAAO,eAAe,QAAQ,YAAY;QACjN,CAAC;OACH;MACF,EAAE,GACF,EAAE,YAAA,GAAmC,CACvC,CAAC,CACA,IAAI;KACT;IACF;GACF,CAAC,GACD,EAAE,iBAAiB;IAAE,aAAa;IAAO,kBAAkB;GAAM,EAAE,CACrE;EACF;CACF,CACF,CAAC;CAGD,MAAM,QAAQ,OAAO,CAAC,CAAC,QAAQ,YAAY;EACzC,MAAM,IAAI,MAAM,CACd;GACE,OAAO,8CAA8C,oBAAoB,SAAS,EAAE;GACpF,MAAM,YAAY,CAElB;EACF,CACF,CAAC,CAAC,CAAC,IAAI;CACT,CAAC;AACH"}
@@ -10,4 +10,4 @@ const CONSOLE_ICONS = {
10
10
  //#endregion
11
11
  export { CONSOLE_ICONS as t };
12
12
 
13
- //# sourceMappingURL=common-nTdKnfMB.js.map
13
+ //# sourceMappingURL=common-AexZXiET.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common-nTdKnfMB.js","names":[],"sources":["../src/constants/common.ts"],"sourcesContent":["export const CONSOLE_ICONS = {\n info: '\\x1b[34mℹ\\x1b[0m', // Blue info icon\n focus: '\\x1b[34m➙\\x1b[0m', // Blue arrow icon\n success: '\\x1b[32m✔\\x1b[0m', // Green checkmark\n warning: '\\x1b[33m⚠\\x1b[0m', // Yellow warning icon\n error: '\\x1b[31m✖\\x1b[0m', // Red cross icon\n claude: '\\x1b[35m💬\\x1b[0m', // Speech bubble\n};\n"],"mappings":";AAAA,MAAa,gBAAgB;CAC3B,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACT"}
1
+ {"version":3,"file":"common-AexZXiET.js","names":[],"sources":["../src/constants/common.ts"],"sourcesContent":["export const CONSOLE_ICONS = {\n info: '\\x1b[34mℹ\\x1b[0m', // Blue info icon\n focus: '\\x1b[34m➙\\x1b[0m', // Blue arrow icon\n success: '\\x1b[32m✔\\x1b[0m', // Green checkmark\n warning: '\\x1b[33m⚠\\x1b[0m', // Yellow warning icon\n error: '\\x1b[31m✖\\x1b[0m', // Red cross icon\n claude: '\\x1b[35m💬\\x1b[0m', // Speech bubble\n};\n"],"mappings":";AAAA,MAAa,gBAAgB;CAC3B,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;AACV"}
@@ -1,4 +1,4 @@
1
- import { t as CONSOLE_ICONS } from "./common-nTdKnfMB.js";
1
+ import { t as CONSOLE_ICONS } from "./common-AexZXiET.js";
2
2
  import { exec, execSync } from "node:child_process";
3
3
  import fs from "node:fs/promises";
4
4
  import path, { dirname, join, relative, resolve } from "node:path";
@@ -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.2/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.2/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.2/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.2/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.2/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,13 +169,19 @@ 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.2/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();
176
176
  const { safeRe: re, t } = require_re();
177
177
  const parseOptions = require_parse_options();
178
178
  const { compareIdentifiers } = require_identifiers();
179
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
180
+ const identifiers = identifier.split(".");
181
+ if (identifiers.length > prerelease.length) return false;
182
+ for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
183
+ return true;
184
+ };
179
185
  module.exports = class SemVer {
180
186
  constructor(version, options) {
181
187
  options = parseOptions(options);
@@ -332,8 +338,9 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
332
338
  if (identifier) {
333
339
  let prerelease = [identifier, base];
334
340
  if (identifierBase === false) prerelease = [identifier];
335
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
336
- if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
341
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
342
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
343
+ if (isNaN(prereleaseBase)) this.prerelease = prerelease;
337
344
  } else this.prerelease = prerelease;
338
345
  }
339
346
  break;
@@ -347,7 +354,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
347
354
  };
348
355
  }));
349
356
  //#endregion
350
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js
357
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/parse.js
351
358
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
352
359
  const SemVer = require_semver$1();
353
360
  const parse = (version, options, throwErrors = false) => {
@@ -362,7 +369,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
362
369
  module.exports = parse;
363
370
  }));
364
371
  //#endregion
365
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js
372
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/valid.js
366
373
  var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
367
374
  const parse = require_parse();
368
375
  const valid = (version, options) => {
@@ -372,7 +379,7 @@ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372
379
  module.exports = valid;
373
380
  }));
374
381
  //#endregion
375
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js
382
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/clean.js
376
383
  var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
377
384
  const parse = require_parse();
378
385
  const clean = (version, options) => {
@@ -382,7 +389,7 @@ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
382
389
  module.exports = clean;
383
390
  }));
384
391
  //#endregion
385
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js
392
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/inc.js
386
393
  var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
387
394
  const SemVer = require_semver$1();
388
395
  const inc = (version, release, options, identifier, identifierBase) => {
@@ -400,7 +407,7 @@ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
400
407
  module.exports = inc;
401
408
  }));
402
409
  //#endregion
403
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js
410
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/diff.js
404
411
  var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
405
412
  const parse = require_parse();
406
413
  const diff = (version1, version2) => {
@@ -428,28 +435,28 @@ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
428
435
  module.exports = diff;
429
436
  }));
430
437
  //#endregion
431
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js
438
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/major.js
432
439
  var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
433
440
  const SemVer = require_semver$1();
434
441
  const major = (a, loose) => new SemVer(a, loose).major;
435
442
  module.exports = major;
436
443
  }));
437
444
  //#endregion
438
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js
445
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/minor.js
439
446
  var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
440
447
  const SemVer = require_semver$1();
441
448
  const minor = (a, loose) => new SemVer(a, loose).minor;
442
449
  module.exports = minor;
443
450
  }));
444
451
  //#endregion
445
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js
452
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/patch.js
446
453
  var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
447
454
  const SemVer = require_semver$1();
448
455
  const patch = (a, loose) => new SemVer(a, loose).patch;
449
456
  module.exports = patch;
450
457
  }));
451
458
  //#endregion
452
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js
459
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/prerelease.js
453
460
  var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
454
461
  const parse = require_parse();
455
462
  const prerelease = (version, options) => {
@@ -459,28 +466,28 @@ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
459
466
  module.exports = prerelease;
460
467
  }));
461
468
  //#endregion
462
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js
469
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/compare.js
463
470
  var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
464
471
  const SemVer = require_semver$1();
465
472
  const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
466
473
  module.exports = compare;
467
474
  }));
468
475
  //#endregion
469
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js
476
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/rcompare.js
470
477
  var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
471
478
  const compare = require_compare();
472
479
  const rcompare = (a, b, loose) => compare(b, a, loose);
473
480
  module.exports = rcompare;
474
481
  }));
475
482
  //#endregion
476
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js
483
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/compare-loose.js
477
484
  var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
478
485
  const compare = require_compare();
479
486
  const compareLoose = (a, b) => compare(a, b, true);
480
487
  module.exports = compareLoose;
481
488
  }));
482
489
  //#endregion
483
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js
490
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/compare-build.js
484
491
  var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
485
492
  const SemVer = require_semver$1();
486
493
  const compareBuild = (a, b, loose) => {
@@ -491,63 +498,63 @@ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
491
498
  module.exports = compareBuild;
492
499
  }));
493
500
  //#endregion
494
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js
501
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/sort.js
495
502
  var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
496
503
  const compareBuild = require_compare_build();
497
504
  const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
498
505
  module.exports = sort;
499
506
  }));
500
507
  //#endregion
501
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js
508
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/rsort.js
502
509
  var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
503
510
  const compareBuild = require_compare_build();
504
511
  const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
505
512
  module.exports = rsort;
506
513
  }));
507
514
  //#endregion
508
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js
515
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/gt.js
509
516
  var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
510
517
  const compare = require_compare();
511
518
  const gt = (a, b, loose) => compare(a, b, loose) > 0;
512
519
  module.exports = gt;
513
520
  }));
514
521
  //#endregion
515
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js
522
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/lt.js
516
523
  var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
517
524
  const compare = require_compare();
518
525
  const lt = (a, b, loose) => compare(a, b, loose) < 0;
519
526
  module.exports = lt;
520
527
  }));
521
528
  //#endregion
522
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js
529
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/eq.js
523
530
  var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
524
531
  const compare = require_compare();
525
532
  const eq = (a, b, loose) => compare(a, b, loose) === 0;
526
533
  module.exports = eq;
527
534
  }));
528
535
  //#endregion
529
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js
536
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/neq.js
530
537
  var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
531
538
  const compare = require_compare();
532
539
  const neq = (a, b, loose) => compare(a, b, loose) !== 0;
533
540
  module.exports = neq;
534
541
  }));
535
542
  //#endregion
536
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js
543
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/gte.js
537
544
  var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
538
545
  const compare = require_compare();
539
546
  const gte = (a, b, loose) => compare(a, b, loose) >= 0;
540
547
  module.exports = gte;
541
548
  }));
542
549
  //#endregion
543
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js
550
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/lte.js
544
551
  var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
545
552
  const compare = require_compare();
546
553
  const lte = (a, b, loose) => compare(a, b, loose) <= 0;
547
554
  module.exports = lte;
548
555
  }));
549
556
  //#endregion
550
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js
557
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/cmp.js
551
558
  var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
552
559
  const eq = require_eq();
553
560
  const neq = require_neq();
@@ -579,7 +586,7 @@ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
579
586
  module.exports = cmp;
580
587
  }));
581
588
  //#endregion
582
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js
589
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/coerce.js
583
590
  var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
584
591
  const SemVer = require_semver$1();
585
592
  const parse = require_parse();
@@ -607,7 +614,40 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
607
614
  module.exports = coerce;
608
615
  }));
609
616
  //#endregion
610
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js
617
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/truncate.js
618
+ var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
619
+ const parse = require_parse();
620
+ const constants = require_constants();
621
+ const SemVer = require_semver$1();
622
+ const truncate = (version, truncation, options) => {
623
+ if (!constants.RELEASE_TYPES.includes(truncation)) return null;
624
+ const clonedVersion = cloneInputVersion(version, options);
625
+ return clonedVersion && doTruncation(clonedVersion, truncation);
626
+ };
627
+ const cloneInputVersion = (version, options) => {
628
+ return parse(version instanceof SemVer ? version.version : version, options);
629
+ };
630
+ const doTruncation = (version, truncation) => {
631
+ if (isPrerelease(truncation)) return version.version;
632
+ version.prerelease = [];
633
+ switch (truncation) {
634
+ case "major":
635
+ version.minor = 0;
636
+ version.patch = 0;
637
+ break;
638
+ case "minor":
639
+ version.patch = 0;
640
+ break;
641
+ }
642
+ return version.format();
643
+ };
644
+ const isPrerelease = (type) => {
645
+ return type.startsWith("pre");
646
+ };
647
+ module.exports = truncate;
648
+ }));
649
+ //#endregion
650
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/internal/lrucache.js
611
651
  var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
612
652
  var LRUCache = class {
613
653
  constructor() {
@@ -640,7 +680,7 @@ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
640
680
  module.exports = LRUCache;
641
681
  }));
642
682
  //#endregion
643
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js
683
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/classes/range.js
644
684
  var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
645
685
  const SPACE_CHARACTERS = /\s+/g;
646
686
  module.exports = class Range {
@@ -694,6 +734,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
694
734
  return this.range;
695
735
  }
696
736
  parseRange(range) {
737
+ range = range.replace(BUILDSTRIPRE, "");
697
738
  const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
698
739
  const cached = cache.get(memoKey);
699
740
  if (cached) return cached;
@@ -752,8 +793,9 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
752
793
  const Comparator = require_comparator();
753
794
  const debug = require_debug();
754
795
  const SemVer = require_semver$1();
755
- const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
796
+ const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
756
797
  const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
798
+ const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
757
799
  const isNullSet = (c) => c.value === "<0.0.0-0";
758
800
  const isAny = (c) => c.value === "";
759
801
  const isSatisfiable = (comparators, options) => {
@@ -912,7 +954,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
912
954
  };
913
955
  }));
914
956
  //#endregion
915
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js
957
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/classes/comparator.js
916
958
  var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
917
959
  const ANY = Symbol("SemVer ANY");
918
960
  module.exports = class Comparator {
@@ -982,7 +1024,7 @@ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
982
1024
  const Range = require_range();
983
1025
  }));
984
1026
  //#endregion
985
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js
1027
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/satisfies.js
986
1028
  var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
987
1029
  const Range = require_range();
988
1030
  const satisfies = (version, range, options) => {
@@ -996,14 +1038,14 @@ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
996
1038
  module.exports = satisfies;
997
1039
  }));
998
1040
  //#endregion
999
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js
1041
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/to-comparators.js
1000
1042
  var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1001
1043
  const Range = require_range();
1002
1044
  const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1003
1045
  module.exports = toComparators;
1004
1046
  }));
1005
1047
  //#endregion
1006
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js
1048
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/max-satisfying.js
1007
1049
  var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1008
1050
  const SemVer = require_semver$1();
1009
1051
  const Range = require_range();
@@ -1029,7 +1071,7 @@ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1029
1071
  module.exports = maxSatisfying;
1030
1072
  }));
1031
1073
  //#endregion
1032
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js
1074
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/min-satisfying.js
1033
1075
  var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1034
1076
  const SemVer = require_semver$1();
1035
1077
  const Range = require_range();
@@ -1055,7 +1097,7 @@ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1055
1097
  module.exports = minSatisfying;
1056
1098
  }));
1057
1099
  //#endregion
1058
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js
1100
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/min-version.js
1059
1101
  var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1060
1102
  const SemVer = require_semver$1();
1061
1103
  const Range = require_range();
@@ -1095,7 +1137,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1095
1137
  module.exports = minVersion;
1096
1138
  }));
1097
1139
  //#endregion
1098
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js
1140
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/valid.js
1099
1141
  var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1100
1142
  const Range = require_range();
1101
1143
  const validRange = (range, options) => {
@@ -1108,7 +1150,7 @@ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1108
1150
  module.exports = validRange;
1109
1151
  }));
1110
1152
  //#endregion
1111
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js
1153
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/outside.js
1112
1154
  var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1113
1155
  const SemVer = require_semver$1();
1114
1156
  const Comparator = require_comparator();
@@ -1161,21 +1203,21 @@ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1161
1203
  module.exports = outside;
1162
1204
  }));
1163
1205
  //#endregion
1164
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js
1206
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/gtr.js
1165
1207
  var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1166
1208
  const outside = require_outside();
1167
1209
  const gtr = (version, range, options) => outside(version, range, ">", options);
1168
1210
  module.exports = gtr;
1169
1211
  }));
1170
1212
  //#endregion
1171
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js
1213
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/ltr.js
1172
1214
  var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1173
1215
  const outside = require_outside();
1174
1216
  const ltr = (version, range, options) => outside(version, range, "<", options);
1175
1217
  module.exports = ltr;
1176
1218
  }));
1177
1219
  //#endregion
1178
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js
1220
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/intersects.js
1179
1221
  var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1180
1222
  const Range = require_range();
1181
1223
  const intersects = (r1, r2, options) => {
@@ -1186,7 +1228,7 @@ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1186
1228
  module.exports = intersects;
1187
1229
  }));
1188
1230
  //#endregion
1189
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js
1231
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/simplify.js
1190
1232
  var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1191
1233
  const satisfies = require_satisfies();
1192
1234
  const compare = require_compare();
@@ -1216,7 +1258,7 @@ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1216
1258
  };
1217
1259
  }));
1218
1260
  //#endregion
1219
- //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js
1261
+ //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/subset.js
1220
1262
  var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1221
1263
  const Range = require_range();
1222
1264
  const Comparator = require_comparator();
@@ -1280,7 +1322,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1280
1322
  if (c.operator === ">" || c.operator === ">=") {
1281
1323
  higher = higherGT(gt, c, options);
1282
1324
  if (higher === c && higher !== gt) return false;
1283
- } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
1325
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
1284
1326
  }
1285
1327
  if (lt) {
1286
1328
  if (needDomLTPre) {
@@ -1289,7 +1331,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1289
1331
  if (c.operator === "<" || c.operator === "<=") {
1290
1332
  lower = lowerLT(lt, c, options);
1291
1333
  if (lower === c && lower !== lt) return false;
1292
- } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
1334
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
1293
1335
  }
1294
1336
  if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
1295
1337
  }
@@ -1341,6 +1383,7 @@ var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exp
1341
1383
  lte: require_lte(),
1342
1384
  cmp: require_cmp(),
1343
1385
  coerce: require_coerce(),
1386
+ truncate: require_truncate(),
1344
1387
  Comparator: require_comparator(),
1345
1388
  Range: require_range(),
1346
1389
  satisfies: require_satisfies(),
@@ -1901,4 +1944,4 @@ function validateClaudeConfig() {
1901
1944
  //#endregion
1902
1945
  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 };
1903
1946
 
1904
- //# sourceMappingURL=helpers-CPecHtc3.js.map
1947
+ //# sourceMappingURL=helpers-CPf8C-KU.js.map