@wise/wds-codemods 1.3.0-experimental-072931c → 1.3.0-experimental-402f706

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-AexZXiET.js";
1
+ import { t as CONSOLE_ICONS } from "./common-nTdKnfMB.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-D6IwFmoz.js.map
239
+ //# sourceMappingURL=claude-cHSlHbX1.js.map
@@ -1 +1 @@
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,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,OAAQ;CAClF,OAAO,QAAQ,UAAU,aAAa,WAAW,WAAW,aAAa;AAC3E;;;;ACHA,SAAgB,oBAAoB,WAA2B;CAE7D,MAAM,cAAc,KAAK,OADT,KAAK,IACiB,IAAI,aAAa,GAAI;CAC3D,M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BAAiB,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"}
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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dKnfMB.js.map
@@ -1 +1 @@
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
+ {"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,4 +1,4 @@
1
- import { t as CONSOLE_ICONS } from "./common-AexZXiET.js";
1
+ import { t as CONSOLE_ICONS } from "./common-nTdKnfMB.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.8.2/node_modules/semver/internal/constants.js
31
+ //#region node_modules/.pnpm/semver@7.7.4/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.8.2/node_modules/semver/internal/debug.js
56
+ //#region node_modules/.pnpm/semver@7.7.4/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.8.2/node_modules/semver/internal/re.js
61
+ //#region node_modules/.pnpm/semver@7.7.4/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.8.2/node_modules/semver/internal/parse-options.js
140
+ //#region node_modules/.pnpm/semver@7.7.4/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.8.2/node_modules/semver/internal/identifiers.js
152
+ //#region node_modules/.pnpm/semver@7.7.4/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,19 +169,13 @@ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
169
169
  };
170
170
  }));
171
171
  //#endregion
172
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/classes/semver.js
172
+ //#region node_modules/.pnpm/semver@7.7.4/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
- };
185
179
  module.exports = class SemVer {
186
180
  constructor(version, options) {
187
181
  options = parseOptions(options);
@@ -338,9 +332,8 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
338
332
  if (identifier) {
339
333
  let prerelease = [identifier, base];
340
334
  if (identifierBase === false) prerelease = [identifier];
341
- if (isPrereleaseIdentifier(this.prerelease, identifier)) {
342
- const prereleaseBase = this.prerelease[identifier.split(".").length];
343
- if (isNaN(prereleaseBase)) this.prerelease = prerelease;
335
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
336
+ if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
344
337
  } else this.prerelease = prerelease;
345
338
  }
346
339
  break;
@@ -354,7 +347,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
354
347
  };
355
348
  }));
356
349
  //#endregion
357
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/parse.js
350
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js
358
351
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
359
352
  const SemVer = require_semver$1();
360
353
  const parse = (version, options, throwErrors = false) => {
@@ -369,7 +362,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
369
362
  module.exports = parse;
370
363
  }));
371
364
  //#endregion
372
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/valid.js
365
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js
373
366
  var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
374
367
  const parse = require_parse();
375
368
  const valid = (version, options) => {
@@ -379,7 +372,7 @@ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
379
372
  module.exports = valid;
380
373
  }));
381
374
  //#endregion
382
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/clean.js
375
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js
383
376
  var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
384
377
  const parse = require_parse();
385
378
  const clean = (version, options) => {
@@ -389,7 +382,7 @@ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
389
382
  module.exports = clean;
390
383
  }));
391
384
  //#endregion
392
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/inc.js
385
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js
393
386
  var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
394
387
  const SemVer = require_semver$1();
395
388
  const inc = (version, release, options, identifier, identifierBase) => {
@@ -407,7 +400,7 @@ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
407
400
  module.exports = inc;
408
401
  }));
409
402
  //#endregion
410
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/diff.js
403
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js
411
404
  var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
412
405
  const parse = require_parse();
413
406
  const diff = (version1, version2) => {
@@ -435,28 +428,28 @@ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
435
428
  module.exports = diff;
436
429
  }));
437
430
  //#endregion
438
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/major.js
431
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js
439
432
  var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
440
433
  const SemVer = require_semver$1();
441
434
  const major = (a, loose) => new SemVer(a, loose).major;
442
435
  module.exports = major;
443
436
  }));
444
437
  //#endregion
445
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/minor.js
438
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js
446
439
  var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
447
440
  const SemVer = require_semver$1();
448
441
  const minor = (a, loose) => new SemVer(a, loose).minor;
449
442
  module.exports = minor;
450
443
  }));
451
444
  //#endregion
452
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/patch.js
445
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js
453
446
  var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
454
447
  const SemVer = require_semver$1();
455
448
  const patch = (a, loose) => new SemVer(a, loose).patch;
456
449
  module.exports = patch;
457
450
  }));
458
451
  //#endregion
459
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/prerelease.js
452
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js
460
453
  var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
461
454
  const parse = require_parse();
462
455
  const prerelease = (version, options) => {
@@ -466,28 +459,28 @@ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
466
459
  module.exports = prerelease;
467
460
  }));
468
461
  //#endregion
469
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/compare.js
462
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js
470
463
  var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
471
464
  const SemVer = require_semver$1();
472
465
  const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
473
466
  module.exports = compare;
474
467
  }));
475
468
  //#endregion
476
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/rcompare.js
469
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js
477
470
  var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
478
471
  const compare = require_compare();
479
472
  const rcompare = (a, b, loose) => compare(b, a, loose);
480
473
  module.exports = rcompare;
481
474
  }));
482
475
  //#endregion
483
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/compare-loose.js
476
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js
484
477
  var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
485
478
  const compare = require_compare();
486
479
  const compareLoose = (a, b) => compare(a, b, true);
487
480
  module.exports = compareLoose;
488
481
  }));
489
482
  //#endregion
490
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/compare-build.js
483
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js
491
484
  var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
492
485
  const SemVer = require_semver$1();
493
486
  const compareBuild = (a, b, loose) => {
@@ -498,63 +491,63 @@ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
498
491
  module.exports = compareBuild;
499
492
  }));
500
493
  //#endregion
501
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/sort.js
494
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js
502
495
  var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
503
496
  const compareBuild = require_compare_build();
504
497
  const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
505
498
  module.exports = sort;
506
499
  }));
507
500
  //#endregion
508
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/rsort.js
501
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js
509
502
  var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
510
503
  const compareBuild = require_compare_build();
511
504
  const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
512
505
  module.exports = rsort;
513
506
  }));
514
507
  //#endregion
515
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/gt.js
508
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js
516
509
  var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
517
510
  const compare = require_compare();
518
511
  const gt = (a, b, loose) => compare(a, b, loose) > 0;
519
512
  module.exports = gt;
520
513
  }));
521
514
  //#endregion
522
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/lt.js
515
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js
523
516
  var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
524
517
  const compare = require_compare();
525
518
  const lt = (a, b, loose) => compare(a, b, loose) < 0;
526
519
  module.exports = lt;
527
520
  }));
528
521
  //#endregion
529
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/eq.js
522
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js
530
523
  var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
531
524
  const compare = require_compare();
532
525
  const eq = (a, b, loose) => compare(a, b, loose) === 0;
533
526
  module.exports = eq;
534
527
  }));
535
528
  //#endregion
536
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/neq.js
529
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js
537
530
  var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
538
531
  const compare = require_compare();
539
532
  const neq = (a, b, loose) => compare(a, b, loose) !== 0;
540
533
  module.exports = neq;
541
534
  }));
542
535
  //#endregion
543
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/gte.js
536
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js
544
537
  var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
545
538
  const compare = require_compare();
546
539
  const gte = (a, b, loose) => compare(a, b, loose) >= 0;
547
540
  module.exports = gte;
548
541
  }));
549
542
  //#endregion
550
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/lte.js
543
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js
551
544
  var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
552
545
  const compare = require_compare();
553
546
  const lte = (a, b, loose) => compare(a, b, loose) <= 0;
554
547
  module.exports = lte;
555
548
  }));
556
549
  //#endregion
557
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/cmp.js
550
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js
558
551
  var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
559
552
  const eq = require_eq();
560
553
  const neq = require_neq();
@@ -586,7 +579,7 @@ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
586
579
  module.exports = cmp;
587
580
  }));
588
581
  //#endregion
589
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/coerce.js
582
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js
590
583
  var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
591
584
  const SemVer = require_semver$1();
592
585
  const parse = require_parse();
@@ -614,40 +607,7 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
614
607
  module.exports = coerce;
615
608
  }));
616
609
  //#endregion
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
610
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js
651
611
  var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
652
612
  var LRUCache = class {
653
613
  constructor() {
@@ -680,7 +640,7 @@ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
680
640
  module.exports = LRUCache;
681
641
  }));
682
642
  //#endregion
683
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/classes/range.js
643
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js
684
644
  var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
685
645
  const SPACE_CHARACTERS = /\s+/g;
686
646
  module.exports = class Range {
@@ -734,7 +694,6 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
734
694
  return this.range;
735
695
  }
736
696
  parseRange(range) {
737
- range = range.replace(BUILDSTRIPRE, "");
738
697
  const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
739
698
  const cached = cache.get(memoKey);
740
699
  if (cached) return cached;
@@ -793,9 +752,8 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
793
752
  const Comparator = require_comparator();
794
753
  const debug = require_debug();
795
754
  const SemVer = require_semver$1();
796
- const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
755
+ const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
797
756
  const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
798
- const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
799
757
  const isNullSet = (c) => c.value === "<0.0.0-0";
800
758
  const isAny = (c) => c.value === "";
801
759
  const isSatisfiable = (comparators, options) => {
@@ -954,7 +912,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
954
912
  };
955
913
  }));
956
914
  //#endregion
957
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/classes/comparator.js
915
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js
958
916
  var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
959
917
  const ANY = Symbol("SemVer ANY");
960
918
  module.exports = class Comparator {
@@ -1024,7 +982,7 @@ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1024
982
  const Range = require_range();
1025
983
  }));
1026
984
  //#endregion
1027
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/functions/satisfies.js
985
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js
1028
986
  var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1029
987
  const Range = require_range();
1030
988
  const satisfies = (version, range, options) => {
@@ -1038,14 +996,14 @@ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1038
996
  module.exports = satisfies;
1039
997
  }));
1040
998
  //#endregion
1041
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/to-comparators.js
999
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js
1042
1000
  var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1043
1001
  const Range = require_range();
1044
1002
  const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1045
1003
  module.exports = toComparators;
1046
1004
  }));
1047
1005
  //#endregion
1048
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/max-satisfying.js
1006
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js
1049
1007
  var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1050
1008
  const SemVer = require_semver$1();
1051
1009
  const Range = require_range();
@@ -1071,7 +1029,7 @@ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1071
1029
  module.exports = maxSatisfying;
1072
1030
  }));
1073
1031
  //#endregion
1074
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/min-satisfying.js
1032
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js
1075
1033
  var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1076
1034
  const SemVer = require_semver$1();
1077
1035
  const Range = require_range();
@@ -1097,7 +1055,7 @@ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1097
1055
  module.exports = minSatisfying;
1098
1056
  }));
1099
1057
  //#endregion
1100
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/min-version.js
1058
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js
1101
1059
  var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1102
1060
  const SemVer = require_semver$1();
1103
1061
  const Range = require_range();
@@ -1137,7 +1095,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1137
1095
  module.exports = minVersion;
1138
1096
  }));
1139
1097
  //#endregion
1140
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/valid.js
1098
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js
1141
1099
  var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1142
1100
  const Range = require_range();
1143
1101
  const validRange = (range, options) => {
@@ -1150,7 +1108,7 @@ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1150
1108
  module.exports = validRange;
1151
1109
  }));
1152
1110
  //#endregion
1153
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/outside.js
1111
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js
1154
1112
  var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1155
1113
  const SemVer = require_semver$1();
1156
1114
  const Comparator = require_comparator();
@@ -1203,21 +1161,21 @@ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1203
1161
  module.exports = outside;
1204
1162
  }));
1205
1163
  //#endregion
1206
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/gtr.js
1164
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js
1207
1165
  var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1208
1166
  const outside = require_outside();
1209
1167
  const gtr = (version, range, options) => outside(version, range, ">", options);
1210
1168
  module.exports = gtr;
1211
1169
  }));
1212
1170
  //#endregion
1213
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/ltr.js
1171
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js
1214
1172
  var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1215
1173
  const outside = require_outside();
1216
1174
  const ltr = (version, range, options) => outside(version, range, "<", options);
1217
1175
  module.exports = ltr;
1218
1176
  }));
1219
1177
  //#endregion
1220
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/intersects.js
1178
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js
1221
1179
  var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1222
1180
  const Range = require_range();
1223
1181
  const intersects = (r1, r2, options) => {
@@ -1228,7 +1186,7 @@ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1228
1186
  module.exports = intersects;
1229
1187
  }));
1230
1188
  //#endregion
1231
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/simplify.js
1189
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js
1232
1190
  var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1233
1191
  const satisfies = require_satisfies();
1234
1192
  const compare = require_compare();
@@ -1258,7 +1216,7 @@ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1258
1216
  };
1259
1217
  }));
1260
1218
  //#endregion
1261
- //#region node_modules/.pnpm/semver@7.8.2/node_modules/semver/ranges/subset.js
1219
+ //#region node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js
1262
1220
  var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1263
1221
  const Range = require_range();
1264
1222
  const Comparator = require_comparator();
@@ -1322,7 +1280,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1322
1280
  if (c.operator === ">" || c.operator === ">=") {
1323
1281
  higher = higherGT(gt, c, options);
1324
1282
  if (higher === c && higher !== gt) return false;
1325
- } else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
1283
+ } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
1326
1284
  }
1327
1285
  if (lt) {
1328
1286
  if (needDomLTPre) {
@@ -1331,7 +1289,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1331
1289
  if (c.operator === "<" || c.operator === "<=") {
1332
1290
  lower = lowerLT(lt, c, options);
1333
1291
  if (lower === c && lower !== lt) return false;
1334
- } else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
1292
+ } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
1335
1293
  }
1336
1294
  if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
1337
1295
  }
@@ -1383,7 +1341,6 @@ var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exp
1383
1341
  lte: require_lte(),
1384
1342
  cmp: require_cmp(),
1385
1343
  coerce: require_coerce(),
1386
- truncate: require_truncate(),
1387
1344
  Comparator: require_comparator(),
1388
1345
  Range: require_range(),
1389
1346
  satisfies: require_satisfies(),
@@ -1944,4 +1901,4 @@ function validateClaudeConfig() {
1944
1901
  //#endregion
1945
1902
  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 };
1946
1903
 
1947
- //# sourceMappingURL=helpers-CPf8C-KU.js.map
1904
+ //# sourceMappingURL=helpers-CPecHtc3.js.map