locadex 0.1.15 → 0.1.17
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.
- package/CHANGELOG.md +6 -0
- package/dist/cli.js +5 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/fixErrors.js +4 -1
- package/dist/commands/fixErrors.js.map +1 -1
- package/dist/commands/i18n.js +4 -1
- package/dist/commands/i18n.js.map +1 -1
- package/dist/commands/setup.js +4 -1
- package/dist/commands/setup.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/logging/console.js +4 -1
- package/dist/logging/console.js.map +1 -1
- package/dist/logging/logger.js +4 -1
- package/dist/logging/logger.js.map +1 -1
- package/dist/mcp/getDocs.js +4 -1
- package/dist/mcp/getDocs.js.map +1 -1
- package/dist/mcp/getGuide.js +4 -1
- package/dist/mcp/getGuide.js.map +1 -1
- package/dist/mcp/getPort.js +4 -1
- package/dist/mcp/getPort.js.map +1 -1
- package/dist/mcp/tools/docs.js +4 -1
- package/dist/mcp/tools/docs.js.map +1 -1
- package/dist/mcp/tools/guides.js +4 -1
- package/dist/mcp/tools/guides.js.map +1 -1
- package/dist/mcp/tools/validate.js +4 -1
- package/dist/mcp/tools/validate.js.map +1 -1
- package/dist/mcp/validateEnv.js +4 -1
- package/dist/mcp/validateEnv.js.map +1 -1
- package/dist/mcp-sse.js +4 -1
- package/dist/mcp-sse.js.map +1 -1
- package/dist/mcp-stdio.js +4 -1
- package/dist/mcp-stdio.js.map +1 -1
- package/dist/prompts/system.js +4 -1
- package/dist/prompts/system.js.map +1 -1
- package/dist/resources/getResource.js +4 -1
- package/dist/resources/getResource.js.map +1 -1
- package/dist/tasks/concurrency.js +4 -1
- package/dist/tasks/concurrency.js.map +1 -1
- package/dist/tasks/fixErrors.js +4 -1
- package/dist/tasks/fixErrors.js.map +1 -1
- package/dist/tasks/i18n.js +4 -1
- package/dist/tasks/i18n.js.map +1 -1
- package/dist/tasks/setup.js +4 -1
- package/dist/tasks/setup.js.map +1 -1
- package/dist/telemetry.js +4 -1
- package/dist/telemetry.js.map +1 -1
- package/dist/types/cli.js +4 -1
- package/dist/types/cli.js.map +1 -1
- package/dist/utils/claudeCode.js +4 -1
- package/dist/utils/claudeCode.js.map +1 -1
- package/dist/utils/config.js +4 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/dag/createDag.js +4 -1
- package/dist/utils/dag/createDag.js.map +1 -1
- package/dist/utils/dag/extractFiles.js +4 -1
- package/dist/utils/dag/extractFiles.js.map +1 -1
- package/dist/utils/dag/getFiles.js +4 -1
- package/dist/utils/dag/getFiles.js.map +1 -1
- package/dist/utils/dag/matchFiles.js +4 -1
- package/dist/utils/dag/matchFiles.js.map +1 -1
- package/dist/utils/errors.js +4 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/exec.js +4 -1
- package/dist/utils/exec.js.map +1 -1
- package/dist/utils/fs/findConfigs.js +4 -1
- package/dist/utils/fs/findConfigs.js.map +1 -1
- package/dist/utils/fs/formatFiles.js +4 -1
- package/dist/utils/fs/formatFiles.js.map +1 -1
- package/dist/utils/fs/getFiles.js +4 -1
- package/dist/utils/fs/getFiles.js.map +1 -1
- package/dist/utils/fs/git.js +4 -1
- package/dist/utils/fs/git.js.map +1 -1
- package/dist/utils/fs/writeFiles.js +4 -1
- package/dist/utils/fs/writeFiles.js.map +1 -1
- package/dist/utils/getPaths.js +4 -1
- package/dist/utils/getPaths.js.map +1 -1
- package/dist/utils/locadexManager.js +4 -1
- package/dist/utils/locadexManager.js.map +1 -1
- package/dist/utils/lockfile.js +4 -1
- package/dist/utils/lockfile.js.map +1 -1
- package/dist/utils/packages/installPackage.js +4 -1
- package/dist/utils/packages/installPackage.js.map +1 -1
- package/dist/utils/session.js +4 -1
- package/dist/utils/session.js.map +1 -1
- package/dist/utils/shared.js +4 -1
- package/dist/utils/shared.js.map +1 -1
- package/dist/utils/shutdown.js +4 -1
- package/dist/utils/shutdown.js.map +1 -1
- package/dist/utils/stats.js +4 -1
- package/dist/utils/stats.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudeCode.js","sourceRoot":"/","sources":["utils/claudeCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EACL,KAAK,GAIN,MAAM,2BAA2B,CAAC;AAkBnC,MAAM,qBAAqB,GAAG;IAC5B,0BAA0B;IAC1B,yBAAyB;IACzB,gCAAgC;IAChC,MAAM;IACN,MAAM;IACN,WAAW;IACX,OAAO;CACR,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAE7D,MAAM,gBAAgB,GAAG,CAAC,cAAc,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAEnE,MAAM,OAAO,gBAAgB;IAwBjB;IAvBF,EAAE,CAAS;IACX,SAAS,CAAqB;IAC9B,SAAS,CAA8B;IACvC,OAAO,CAAiB;IACxB,OAAO,GAAa,EAAE,CAAC;IACvB,UAAU,CAAkB;IAC5B,aAAa,CAAS;IACtB,KAAK,GAAW,CAAC,CAAC;IAElB,KAAK,CASX;IAEF,YACE,OAAuB,EACvB,UAA2B,EACnB,OAKP;QALO,YAAO,GAAP,OAAO,CAKd;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,OA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AC,UAAU,CAAC;YACzC,CAAC;QACH,CAAC;QACD,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACF","sourcesContent":["import { guides } from '../mcp/tools/guides.js';\nimport { logger } from '../logging/logger.js';\nimport { posthog } from '../telemetry.js';\nimport { LocadexManager } from './locadexManager.js';\nimport { getSessionId } from './session.js';\nimport * as Sentry from '@sentry/node';\nimport { TimeoutError, UserAbortError, AgentProcessError } from './errors.js';\nimport {\n query,\n type Options,\n type SDKMessage,\n type McpServerConfig,\n} from '@anthropic-ai/claude-code';\n\nexport type ClaudeRunOptions = {\n additionalSystemPrompt?: string;\n additionalAllowedTools?: string[];\n maxTurns?: number; // Hard limit on the number of turns per Claude Code call\n\n // required\n timeoutSec: number; // Timeout per .run() call\n maxRetries: number; // Max number of retries per .run() call\n};\n\nexport type ClaudeRunnerOptions = {\n softTurnLimit?: number; // Soft limit on the number of turns per Claude runner\n};\n\nexport interface ClaudeCodeObservation {}\n\nconst DEFAULT_ALLOWED_TOOLS = [\n 'mcp__locadex__fetch-docs',\n 'mcp__locadex__list-docs',\n 'mcp__locadex__validate-project',\n 'Bash',\n 'Edit',\n 'MultiEdit',\n 'Write',\n].concat(guides.map((guide) => `mcp__locadex__${guide.id}`));\n\nconst DISALLOWED_TOOLS = ['NotebookEdit', 'WebFetch', 'WebSearch'];\n\nexport class ClaudeCodeRunner {\n private id: string;\n private sessionId: string | undefined;\n private mcpConfig: McpServerConfig | undefined;\n private manager: LocadexManager;\n private changes: string[] = [];\n private controller: AbortController;\n private softTurnLimit: number;\n private turns: number = 0;\n\n private stats: {\n cost: number;\n wallDuration: number;\n apiDuration: number;\n turns: number;\n mcpToolCalls: number;\n inputTokens: number;\n outputTokens: number;\n cachedInputTokens: number;\n };\n\n constructor(\n manager: LocadexManager,\n controller: AbortController,\n private options: {\n id: string;\n apiKey: string;\n mcpConfig: McpServerConfig;\n softTurnLimit: number;\n }\n ) {\n this.manager = manager;\n this.id = options.id;\n this.mcpConfig = options.mcpConfig;\n this.controller = controller;\n this.softTurnLimit = options.softTurnLimit;\n\n this.stats = {\n cost: 0,\n wallDuration: 0,\n apiDuration: 0,\n turns: 0,\n mcpToolCalls: 0,\n inputTokens: 0,\n outputTokens: 0,\n cachedInputTokens: 0,\n };\n\n // Ensure API key is set\n if (!process.env.ANTHROPIC_API_KEY && !this.options.apiKey) {\n throw new Error(\n 'ANTHROPIC_API_KEY environment variable or apiKey option is required'\n );\n }\n }\n\n getSessionId(): string | undefined {\n return this.sessionId;\n }\n reset() {\n this.sessionId = undefined;\n this.turns = 0;\n this.resetStats();\n }\n resetStats() {\n this.aggregateStats();\n this.stats = {\n cost: 0,\n wallDuration: 0,\n apiDuration: 0,\n turns: 0,\n mcpToolCalls: 0,\n inputTokens: 0,\n outputTokens: 0,\n cachedInputTokens: 0,\n };\n }\n aggregateStats() {\n logger.verboseMessage(\n `[${this.id}] Aggregating stats.\\nCost: $${this.stats.cost.toFixed(\n 2\n )}\\nDuration: ${this.stats.wallDuration / 1000}s`\n );\n this.manager.stats.updateStats({\n newCost: this.stats.cost,\n newWallDuration: this.stats.wallDuration,\n newApiDuration: this.stats.apiDuration,\n newTurns: this.stats.turns,\n newToolCalls: this.stats.mcpToolCalls,\n newInputTokens: this.stats.inputTokens,\n newOutputTokens: this.stats.outputTokens,\n newCachedInputTokens: this.stats.cachedInputTokens,\n });\n }\n\n /**\n * Wraps a promise with a timeout mechanism that can abort the underlying operation\n */\n private async withTimeout<T>(\n promiseFactory: (abortController: AbortController) => Promise<T>,\n timeoutSec: number,\n timeoutMessage?: string\n ): Promise<T> {\n const timeoutController = new AbortController();\n let timeoutId: ReturnType<typeof global.setTimeout>;\n\n const timeoutPromise = new Promise<never>((_, reject) => {\n timeoutId = global.setTimeout(() => {\n timeoutController.abort();\n reject(\n new TimeoutError(\n timeoutMessage || `Operation timed out after ${timeoutSec}s`,\n timeoutSec\n )\n );\n }, timeoutSec * 1000);\n });\n\n const promise = promiseFactory(timeoutController);\n return Promise.race([promise, timeoutPromise]).finally(() => {\n // Clear the timeout regardless of how the promise resolves\n global.clearTimeout(timeoutId);\n });\n }\n\n /**\n * Retries an async operation with exponential backoff\n * Retries on TimeoutError but not on UserAbortError\n */\n private async withRetry<T>(\n operation: () => Promise<T>,\n maxRetries: number = 1,\n baseDelayMs: number = 1000\n ): Promise<T> {\n let lastError: Error;\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n try {\n return await operation();\n } catch (error) {\n lastError = error as Error;\n\n // Don't retry on user aborts - these are intentional\n if (\n lastError instanceof UserAbortError ||\n lastError.name === 'AbortError'\n ) {\n logger.debugMessage(`Claude Code operation aborted by user`);\n throw lastError;\n }\n\n // Don't retry on the last attempt\n if (attempt === maxRetries) {\n throw lastError;\n }\n\n const delay = baseDelayMs * Math.pow(2, attempt);\n\n // Log different messages for different error types\n if (lastError instanceof TimeoutError) {\n logger.debugMessage(\n `Claude Code operation timed out (attempt ${attempt + 1}/${maxRetries + 1}), retrying in ${delay}ms: ${lastError.message}`\n );\n // reset the session id\n this.reset();\n } else {\n logger.debugMessage(\n `Claude Code operation failed (attempt ${attempt + 1}/${maxRetries + 1}), retrying in ${delay}ms: ${lastError.message}`\n );\n }\n\n await new Promise((resolve) => global.setTimeout(resolve, delay));\n }\n }\n\n throw lastError!;\n }\n\n async run(\n prompt: string,\n options: ClaudeRunOptions,\n _obs: ClaudeCodeObservation\n ): Promise<string> {\n this.changes = [];\n return this.withRetry(\n () =>\n Sentry.startSpan(\n {\n name: 'claude-code-exec',\n op: 'claude-code.exec',\n attributes: {\n 'process.command': 'claude',\n },\n },\n () =>\n this.withTimeout(\n async (timeoutController: AbortController) => {\n // Create a combined abort controller that triggers on either user abort or timeout\n const combinedController = new AbortController();\n\n const abortHandler = () => {\n combinedController.abort();\n };\n\n this.controller.signal.addEventListener('abort', abortHandler);\n timeoutController.signal.addEventListener(\n 'abort',\n abortHandler\n );\n\n try {\n // Build query options\n const queryOptions: Options = {\n maxTurns: options.maxTurns,\n allowedTools: [\n ...DEFAULT_ALLOWED_TOOLS,\n ...(options?.additionalAllowedTools || []),\n ],\n disallowedTools: DISALLOWED_TOOLS,\n };\n\n if (options.additionalSystemPrompt) {\n queryOptions.appendSystemPrompt =\n options.additionalSystemPrompt;\n }\n\n if (this.mcpConfig) {\n queryOptions.mcpServers = {\n locadex: this.mcpConfig,\n };\n }\n\n if (this.sessionId && this.turns < this.softTurnLimit) {\n queryOptions.resume = this.sessionId;\n } else if (this.turns >= this.softTurnLimit) {\n logger.debugMessage(\n `[${this.id}] Resetting session id because of soft turn limit reached: ${this.turns} >= ${this.softTurnLimit}`\n );\n this.reset();\n }\n\n if (this.options.apiKey) {\n process.env.ANTHROPIC_API_KEY = this.options.apiKey;\n }\n\n logger.debugMessage(\n `[${this.id}] Running Claude Code SDK with options: ${JSON.stringify(\n {\n maxTurns: options.maxTurns,\n softTurnLimit: this.softTurnLimit,\n timeoutSec: options.timeoutSec,\n maxRetries: options.maxRetries,\n sessionId: this.sessionId,\n mcpConfig: this.mcpConfig,\n additionalAllowedTools: options.additionalAllowedTools,\n },\n null,\n 2\n )}. API key is ${process.env.ANTHROPIC_API_KEY ? 'set' : 'not set'}`\n );\n\n try {\n for await (const message of query({\n prompt,\n abortController: combinedController,\n options: queryOptions,\n })) {\n const result = this.handleSDKOutput(message, _obs);\n if (!result.success) {\n throw new AgentProcessError(\n `[${this.id}] Claude Code error: ${result.error}`,\n undefined\n );\n }\n }\n } finally {\n // pass\n }\n\n return '';\n } finally {\n // Clean up event listeners\n this.controller.signal.removeEventListener(\n 'abort',\n abortHandler\n );\n timeoutController.signal.removeEventListener(\n 'abort',\n abortHandler\n );\n }\n },\n options.timeoutSec,\n `Claude Code operation timed out after ${options.timeoutSec}s`\n )\n ),\n options.maxRetries\n );\n }\n\n private handleSDKOutput(\n outputData: SDKMessage,\n _obs: ClaudeCodeObservation\n ): { success: boolean; error?: string } {\n if (outputData.type === 'assistant') {\n logger.log(\n `[${this.id}] Assistant message: ${JSON.stringify(\n outputData.message.content,\n null,\n 2\n )}`\n );\n const text: string[] = [];\n const toolUses: string[] = [];\n outputData.message.content.forEach((c) => {\n if (c.type === 'text') {\n text.push(c.text);\n }\n if (c.type === 'tool_use') {\n toolUses.push(c.name);\n if (c.name.startsWith('mcp__locadex__')) {\n posthog.capture({\n distinctId: getSessionId(),\n event: 'tool_used',\n properties: {\n tool: c.name,\n },\n });\n }\n }\n });\n if (text.length > 0) {\n logger.verboseMessage(`[${this.id}] ${text.join('').trim()}`);\n }\n if (toolUses.length > 0) {\n logger.debugMessage(`[${this.id}] used tools: ${toolUses.join(', ')}`);\n }\n this.stats.mcpToolCalls += toolUses.length;\n this.stats.inputTokens += outputData.message.usage.input_tokens;\n this.stats.outputTokens += outputData.message.usage.output_tokens;\n this.stats.cachedInputTokens +=\n outputData.message.usage.cache_read_input_tokens ?? 0;\n } else if (outputData.type === 'result') {\n logger.log(\n `[${this.id}] Result message: ${JSON.stringify(outputData, null, 2)}`\n );\n this.stats.cost = outputData.total_cost_usd;\n this.stats.wallDuration = outputData.duration_ms;\n this.stats.apiDuration = outputData.duration_api_ms;\n this.stats.turns = outputData.num_turns;\n this.turns = outputData.num_turns;\n if (!outputData.is_error) {\n logger.verboseMessage(`[${this.id}] finished task.`);\n } else {\n logger.verboseMessage(\n `[${this.id}] finished task with error: ${outputData.subtype}`\n );\n return {\n success: false,\n error: outputData.subtype,\n };\n }\n if (outputData.subtype === 'success') {\n this.changes.push(outputData.result);\n }\n } else if (outputData.type === 'system') {\n logger.log(`[${this.id}] System Initialized`);\n if (outputData.subtype === 'init') {\n this.sessionId = outputData.session_id;\n }\n }\n return {\n success: true,\n };\n }\n\n generateReport(): string {\n return this.changes.join('\\n');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"claudeCode.js","sources":["utils/claudeCode.ts"],"sourceRoot":"/","sourcesContent":["import { guides } from '../mcp/tools/guides.js';\nimport { logger } from '../logging/logger.js';\nimport { posthog } from '../telemetry.js';\nimport { LocadexManager } from './locadexManager.js';\nimport { getSessionId } from './session.js';\nimport * as Sentry from '@sentry/node';\nimport { TimeoutError, UserAbortError, AgentProcessError } from './errors.js';\nimport {\n query,\n type Options,\n type SDKMessage,\n type McpServerConfig,\n} from '@anthropic-ai/claude-code';\n\nexport type ClaudeRunOptions = {\n additionalSystemPrompt?: string;\n additionalAllowedTools?: string[];\n maxTurns?: number; // Hard limit on the number of turns per Claude Code call\n\n // required\n timeoutSec: number; // Timeout per .run() call\n maxRetries: number; // Max number of retries per .run() call\n};\n\nexport type ClaudeRunnerOptions = {\n softTurnLimit?: number; // Soft limit on the number of turns per Claude runner\n};\n\nexport interface ClaudeCodeObservation {}\n\nconst DEFAULT_ALLOWED_TOOLS = [\n 'mcp__locadex__fetch-docs',\n 'mcp__locadex__list-docs',\n 'mcp__locadex__validate-project',\n 'Bash',\n 'Edit',\n 'MultiEdit',\n 'Write',\n].concat(guides.map((guide) => `mcp__locadex__${guide.id}`));\n\nconst DISALLOWED_TOOLS = ['NotebookEdit', 'WebFetch', 'WebSearch'];\n\nexport class ClaudeCodeRunner {\n private id: string;\n private sessionId: string | undefined;\n private mcpConfig: McpServerConfig | undefined;\n private manager: LocadexManager;\n private changes: string[] = [];\n private controller: AbortController;\n private softTurnLimit: number;\n private turns: number = 0;\n\n private stats: {\n cost: number;\n wallDuration: number;\n apiDuration: number;\n turns: number;\n mcpToolCalls: number;\n inputTokens: number;\n outputTokens: number;\n cachedInputTokens: number;\n };\n\n constructor(\n manager: LocadexManager,\n controller: AbortController,\n private options: {\n id: string;\n apiKey: string;\n mcpConfig: McpServerConfig;\n softTurnLimit: number;\n }\n ) {\n this.manager = manager;\n this.id = options.id;\n this.mcpConfig = options.mcpConfig;\n this.controller = controller;\n this.softTurnLimit = options.softTurnLimit;\n\n this.stats = {\n cost: 0,\n wallDuration: 0,\n apiDuration: 0,\n turns: 0,\n mcpToolCalls: 0,\n inputTokens: 0,\n outputTokens: 0,\n cachedInputTokens: 0,\n };\n\n // Ensure API key is set\n if (!process.env.ANTHROPIC_API_KEY && !this.options.apiKey) {\n throw new Error(\n 'ANTHROPIC_API_KEY environment variable or apiKey option is required'\n );\n }\n }\n\n getSessionId(): string | undefined {\n return this.sessionId;\n }\n reset() {\n this.sessionId = undefined;\n this.turns = 0;\n this.resetStats();\n }\n resetStats() {\n this.aggregateStats();\n this.stats = {\n cost: 0,\n wallDuration: 0,\n apiDuration: 0,\n turns: 0,\n mcpToolCalls: 0,\n inputTokens: 0,\n outputTokens: 0,\n cachedInputTokens: 0,\n };\n }\n aggregateStats() {\n logger.verboseMessage(\n `[${this.id}] Aggregating stats.\\nCost: $${this.stats.cost.toFixed(\n 2\n )}\\nDuration: ${this.stats.wallDuration / 1000}s`\n );\n this.manager.stats.updateStats({\n newCost: this.stats.cost,\n newWallDuration: this.stats.wallDuration,\n newApiDuration: this.stats.apiDuration,\n newTurns: this.stats.turns,\n newToolCalls: this.stats.mcpToolCalls,\n newInputTokens: this.stats.inputTokens,\n newOutputTokens: this.stats.outputTokens,\n newCachedInputTokens: this.stats.cachedInputTokens,\n });\n }\n\n /**\n * Wraps a promise with a timeout mechanism that can abort the underlying operation\n */\n private async withTimeout<T>(\n promiseFactory: (abortController: AbortController) => Promise<T>,\n timeoutSec: number,\n timeoutMessage?: string\n ): Promise<T> {\n const timeoutController = new AbortController();\n let timeoutId: ReturnType<typeof global.setTimeout>;\n\n const timeoutPromise = new Promise<never>((_, reject) => {\n timeoutId = global.setTimeout(() => {\n timeoutController.abort();\n reject(\n new TimeoutError(\n timeoutMessage || `Operation timed out after ${timeoutSec}s`,\n timeoutSec\n )\n );\n }, timeoutSec * 1000);\n });\n\n const promise = promiseFactory(timeoutController);\n return Promise.race([promise, timeoutPromise]).finally(() => {\n // Clear the timeout regardless of how the promise resolves\n global.clearTimeout(timeoutId);\n });\n }\n\n /**\n * Retries an async operation with exponential backoff\n * Retries on TimeoutError but not on UserAbortError\n */\n private async withRetry<T>(\n operation: () => Promise<T>,\n maxRetries: number = 1,\n baseDelayMs: number = 1000\n ): Promise<T> {\n let lastError: Error;\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n try {\n return await operation();\n } catch (error) {\n lastError = error as Error;\n\n // Don't retry on user aborts - these are intentional\n if (\n lastError instanceof UserAbortError ||\n lastError.name === 'AbortError'\n ) {\n logger.debugMessage(`Claude Code operation aborted by user`);\n throw lastError;\n }\n\n // Don't retry on the last attempt\n if (attempt === maxRetries) {\n throw lastError;\n }\n\n const delay = baseDelayMs * Math.pow(2, attempt);\n\n // Log different messages for different error types\n if (lastError instanceof TimeoutError) {\n logger.debugMessage(\n `Claude Code operation timed out (attempt ${attempt + 1}/${maxRetries + 1}), retrying in ${delay}ms: ${lastError.message}`\n );\n // reset the session id\n this.reset();\n } else {\n logger.debugMessage(\n `Claude Code operation failed (attempt ${attempt + 1}/${maxRetries + 1}), retrying in ${delay}ms: ${lastError.message}`\n );\n }\n\n await new Promise((resolve) => global.setTimeout(resolve, delay));\n }\n }\n\n throw lastError!;\n }\n\n async run(\n prompt: string,\n options: ClaudeRunOptions,\n _obs: ClaudeCodeObservation\n ): Promise<string> {\n this.changes = [];\n return this.withRetry(\n () =>\n Sentry.startSpan(\n {\n name: 'claude-code-exec',\n op: 'claude-code.exec',\n attributes: {\n 'process.command': 'claude',\n },\n },\n () =>\n this.withTimeout(\n async (timeoutController: AbortController) => {\n // Create a combined abort controller that triggers on either user abort or timeout\n const combinedController = new AbortController();\n\n const abortHandler = () => {\n combinedController.abort();\n };\n\n this.controller.signal.addEventListener('abort', abortHandler);\n timeoutController.signal.addEventListener(\n 'abort',\n abortHandler\n );\n\n try {\n // Build query options\n const queryOptions: Options = {\n maxTurns: options.maxTurns,\n allowedTools: [\n ...DEFAULT_ALLOWED_TOOLS,\n ...(options?.additionalAllowedTools || []),\n ],\n disallowedTools: DISALLOWED_TOOLS,\n };\n\n if (options.additionalSystemPrompt) {\n queryOptions.appendSystemPrompt =\n options.additionalSystemPrompt;\n }\n\n if (this.mcpConfig) {\n queryOptions.mcpServers = {\n locadex: this.mcpConfig,\n };\n }\n\n if (this.sessionId && this.turns < this.softTurnLimit) {\n queryOptions.resume = this.sessionId;\n } else if (this.turns >= this.softTurnLimit) {\n logger.debugMessage(\n `[${this.id}] Resetting session id because of soft turn limit reached: ${this.turns} >= ${this.softTurnLimit}`\n );\n this.reset();\n }\n\n if (this.options.apiKey) {\n process.env.ANTHROPIC_API_KEY = this.options.apiKey;\n }\n\n logger.debugMessage(\n `[${this.id}] Running Claude Code SDK with options: ${JSON.stringify(\n {\n maxTurns: options.maxTurns,\n softTurnLimit: this.softTurnLimit,\n timeoutSec: options.timeoutSec,\n maxRetries: options.maxRetries,\n sessionId: this.sessionId,\n mcpConfig: this.mcpConfig,\n additionalAllowedTools: options.additionalAllowedTools,\n },\n null,\n 2\n )}. API key is ${process.env.ANTHROPIC_API_KEY ? 'set' : 'not set'}`\n );\n\n try {\n for await (const message of query({\n prompt,\n abortController: combinedController,\n options: queryOptions,\n })) {\n const result = this.handleSDKOutput(message, _obs);\n if (!result.success) {\n throw new AgentProcessError(\n `[${this.id}] Claude Code error: ${result.error}`,\n undefined\n );\n }\n }\n } finally {\n // pass\n }\n\n return '';\n } finally {\n // Clean up event listeners\n this.controller.signal.removeEventListener(\n 'abort',\n abortHandler\n );\n timeoutController.signal.removeEventListener(\n 'abort',\n abortHandler\n );\n }\n },\n options.timeoutSec,\n `Claude Code operation timed out after ${options.timeoutSec}s`\n )\n ),\n options.maxRetries\n );\n }\n\n private handleSDKOutput(\n outputData: SDKMessage,\n _obs: ClaudeCodeObservation\n ): { success: boolean; error?: string } {\n if (outputData.type === 'assistant') {\n logger.log(\n `[${this.id}] Assistant message: ${JSON.stringify(\n outputData.message.content,\n null,\n 2\n )}`\n );\n const text: string[] = [];\n const toolUses: string[] = [];\n outputData.message.content.forEach((c) => {\n if (c.type === 'text') {\n text.push(c.text);\n }\n if (c.type === 'tool_use') {\n toolUses.push(c.name);\n if (c.name.startsWith('mcp__locadex__')) {\n posthog.capture({\n distinctId: getSessionId(),\n event: 'tool_used',\n properties: {\n tool: c.name,\n },\n });\n }\n }\n });\n if (text.length > 0) {\n logger.verboseMessage(`[${this.id}] ${text.join('').trim()}`);\n }\n if (toolUses.length > 0) {\n logger.debugMessage(`[${this.id}] used tools: ${toolUses.join(', ')}`);\n }\n this.stats.mcpToolCalls += toolUses.length;\n this.stats.inputTokens += outputData.message.usage.input_tokens;\n this.stats.outputTokens += outputData.message.usage.output_tokens;\n this.stats.cachedInputTokens +=\n outputData.message.usage.cache_read_input_tokens ?? 0;\n } else if (outputData.type === 'result') {\n logger.log(\n `[${this.id}] Result message: ${JSON.stringify(outputData, null, 2)}`\n );\n this.stats.cost = outputData.total_cost_usd;\n this.stats.wallDuration = outputData.duration_ms;\n this.stats.apiDuration = outputData.duration_api_ms;\n this.stats.turns = outputData.num_turns;\n this.turns = outputData.num_turns;\n if (!outputData.is_error) {\n logger.verboseMessage(`[${this.id}] finished task.`);\n } else {\n logger.verboseMessage(\n `[${this.id}] finished task with error: ${outputData.subtype}`\n );\n return {\n success: false,\n error: outputData.subtype,\n };\n }\n if (outputData.subtype === 'success') {\n this.changes.push(outputData.result);\n }\n } else if (outputData.type === 'system') {\n logger.log(`[${this.id}] System Initialized`);\n if (outputData.subtype === 'init') {\n this.sessionId = outputData.session_id;\n }\n }\n return {\n success: true,\n };\n }\n\n generateReport(): string {\n return this.changes.join('\\n');\n }\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,MAAM,MA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IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC;YACxC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC;YAClC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACzB,MAAM,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,EAAE,kBAAkB,CAAC,CAAC;YACvD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,cAAc,CACnB,IAAI,IAAI,CAAC,EAAE,+BAA+B,UAAU,CAAC,OAAO,EAAE,CAC/D,CAAC;gBACF,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,UAAU,CAAC,OAAO;iBAC1B,CAAC;YACJ,CAAC;YACD,IAAI,UAAU,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;gBACrC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;aAAM,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAC;YAC9C,IAAI,UAAU,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;gBAClC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC;YACzC,CAAC;QACH,CAAC;QACD,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACF","debug_id":"070567fd-e919-55a4-9087-541b6f403b97"}
|
package/dist/utils/config.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a9d36be0-8d57-5830-bbee-293c35965c0d")}catch(e){}}();
|
|
1
3
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
4
|
import { logger } from '../logging/logger.js';
|
|
3
5
|
import path from 'node:path';
|
|
@@ -78,4 +80,5 @@ export function getConfig(locadexDir, rootDir, appDir, options = {}) {
|
|
|
78
80
|
const mergedConfig = { ...DEFAULT_CONFIG, ...fileConfig, ...options };
|
|
79
81
|
return mergedConfig;
|
|
80
82
|
}
|
|
81
|
-
//# sourceMappingURL=config.js.map
|
|
83
|
+
//# sourceMappingURL=config.js.map
|
|
84
|
+
//# debugId=a9d36be0-8d57-5830-bbee-293c35965c0d
|
package/dist/utils/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","
|
|
1
|
+
{"version":3,"file":"config.js","sources":["utils/config.ts"],"sourceRoot":"/","sourcesContent":["import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { logger } from '../logging/logger.js';\nimport path from 'node:path';\nimport { CliOptions, LocadexConfig } from '../types/cli.js';\nimport { exit } from './shutdown.js';\nimport dotenv from 'dotenv';\n\nexport async function validateConfig(options: CliOptions) {\n // Validate ANTHROPIC_API_KEY\n if (!process.env.ANTHROPIC_API_KEY) {\n console.error(\n 'ANTHROPIC_API_KEY is not set! Please set it as an environment variable or in a .env | .env.local file.'\n );\n await exit(1);\n }\n\n if (options.timeout) {\n const timeout = Number(options.timeout);\n if (isNaN(timeout) || timeout <= 0) {\n console.error('Invalid timeout value. Please provide a positive number.');\n await exit(1);\n }\n }\n if (options.batchSize) {\n const batchSize = Number(options.batchSize);\n if (isNaN(batchSize) || batchSize < 1) {\n console.error('Invalid batch size. Please provide a positive number.');\n await exit(1);\n }\n }\n if (options.concurrency) {\n const concurrency = Number(options.concurrency);\n if (isNaN(concurrency) || concurrency < 1) {\n console.error('Invalid concurrency. Please provide a positive number.');\n await exit(1);\n }\n }\n}\n\nexport function isGTAuthConfigured(cwd?: string) {\n if (cwd) {\n dotenv.config({ path: path.join(cwd, '.env.production') });\n dotenv.config({ path: path.join(cwd, '.env.local') });\n dotenv.config({ path: path.join(cwd, '.env') });\n }\n return process.env.GT_API_KEY && process.env.GT_PROJECT_ID;\n}\n\nconst CONFIG_FILE_NAME = 'locadex.config.json';\n\nexport function createConfig(\n directory: string,\n options: {\n batchSize: number;\n maxConcurrency: number;\n matchingFiles: string[];\n timeout: number;\n }\n) {\n const configPath = path.resolve(directory, CONFIG_FILE_NAME);\n if (existsSync(configPath)) {\n return;\n }\n\n const config = {\n batchSize: options.batchSize,\n maxConcurrency: options.maxConcurrency,\n matchingFiles: options.matchingFiles,\n timeout: options.timeout,\n };\n\n writeFileSync(configPath, JSON.stringify(config, null, 2));\n}\n\nexport function getConfig(\n locadexDir: string,\n rootDir: string,\n appDir: string,\n options: Partial<LocadexConfig> = {}\n): LocadexConfig {\n const DEFAULT_CONFIG: LocadexConfig = {\n batchSize: 10,\n maxConcurrency: 1,\n matchingFiles: [\n `${path.relative(rootDir, appDir) || '.'}/**/*.{ts,tsx,js,jsx}`,\n ],\n timeout: 60,\n };\n const configPath = path.resolve(locadexDir, CONFIG_FILE_NAME);\n let fileConfig: Partial<LocadexConfig> = {};\n\n // Load config file if it exists\n if (existsSync(configPath)) {\n try {\n fileConfig = JSON.parse(readFileSync(configPath, 'utf8'));\n } catch (error) {\n logger.error(\n `Error parsing config file ${configPath}: ${error instanceof Error ? error.message : String(error)}`\n );\n // Continue with empty file config on parse error\n }\n }\n\n // Merge configurations: defaults < file config < passed options\n const mergedConfig = { ...DEFAULT_CONFIG, ...fileConfig, ...options };\n\n return mergedConfig;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO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,EAAE;YACb,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,GAAG,uBAAuB;SAChE;QACD,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAC9D,IAAI,UAAU,GAA2B,EAAE,CAAC;IAE5C,gCAAgC;IAChC,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;QAC5D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CACV,6BAA6B,UAAU,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACrG,CAAC;YACF,iDAAiD;QACnD,CAAC;IACH,CAAC;IAED,gEAAgE;IAChE,MAAM,YAAY,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,EAAE,CAAC;IAEtE,OAAO,YAAY,CAAC;AACtB,CAAC","debug_id":"a9d36be0-8d57-5830-bbee-293c35965c0d"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5a5ea809-661d-5672-9edf-42b802f85a5c")}catch(e){}}();
|
|
1
3
|
import { logger } from '../../logging/logger.js';
|
|
2
4
|
import dependencyTree from 'dependency-tree';
|
|
3
5
|
import * as path from 'node:path';
|
|
@@ -140,4 +142,5 @@ function mergeTrees(trees) {
|
|
|
140
142
|
});
|
|
141
143
|
return result;
|
|
142
144
|
}
|
|
143
|
-
//# sourceMappingURL=createDag.js.map
|
|
145
|
+
//# sourceMappingURL=createDag.js.map
|
|
146
|
+
//# debugId=5a5ea809-661d-5672-9edf-42b802f85a5c
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDag.js","
|
|
1
|
+
{"version":3,"file":"createDag.js","sources":["utils/dag/createDag.ts"],"sourceRoot":"/","sourcesContent":["import { logger } from '../../logging/logger.js';\nimport dependencyTree, { Tree } from 'dependency-tree';\nimport * as path from 'node:path';\nimport { LocadexManager } from '../locadexManager.js';\n\nexport type DagOptions = {\n tsConfig?: string;\n webpackConfig?: string;\n requireConfig?: string;\n};\n\nexport type DagNode = {\n [filename: string]: DagNode;\n};\n\nexport class Dag {\n private dag: DagNode;\n private reverseDag: Record<string, string[]>;\n private dependenciesMap: Record<string, string[]>;\n private topologicalOrder: string[];\n\n constructor(dag: DagNode) {\n this.dag = dag;\n const { reverseDag, dependenciesMap } = this.buildMaps(dag);\n this.reverseDag = reverseDag;\n this.dependenciesMap = dependenciesMap;\n this.topologicalOrder = this.buildTopologicalOrder();\n }\n\n private buildMaps(dag: DagNode): {\n reverseDag: Record<string, string[]>;\n dependenciesMap: Record<string, string[]>;\n } {\n const reverseDag: Record<string, string[]> = {};\n const dependenciesMap: Record<string, string[]> = {};\n\n // Clean the file paths recursively\n const cleanedDag = cleanFilePaths(\n dag,\n LocadexManager.getInstance().rootDirectory\n );\n\n function traverse(node: DagNode, parent?: string): void {\n for (const [filename, subtree] of Object.entries(node)) {\n // Build dependencies map - direct dependencies are the keys of subtree\n if (!dependenciesMap[filename]) {\n dependenciesMap[filename] = Object.keys(subtree);\n }\n\n // Build reverse DAG - if we have a parent, parent depends on filename\n // So filename has parent as a dependent\n if (parent) {\n if (!reverseDag[filename]) {\n reverseDag[filename] = [];\n }\n reverseDag[filename].push(parent);\n }\n\n // Recursively traverse the subtree\n if (typeof subtree === 'object' && subtree !== null) {\n traverse(subtree, filename);\n }\n }\n }\n\n traverse(cleanedDag);\n return { reverseDag, dependenciesMap };\n }\n\n // No need to worry about cycles since the DAG is a tree\n private buildTopologicalOrder(): string[] {\n const visited = new Set<string>();\n const result: string[] = [];\n\n const dfs = (file: string) => {\n if (visited.has(file)) return;\n visited.add(file);\n\n const dependencies = this.dependenciesMap[file] || [];\n for (const dep of dependencies) {\n dfs(dep);\n }\n\n result.push(file);\n };\n\n // Visit all files in the DAG\n for (const file of Object.keys(this.dependenciesMap)) {\n dfs(file);\n }\n\n return result;\n }\n // Get all direct dependencies of a file\n getDependencies(filename: string): string[] {\n // return this.dependenciesMap[filename] || [];\n return this.reverseDag[filename] || [];\n }\n // Get all children of a file\n getDependents(filename: string): string[] {\n // return this.reverseDag[filename] || [];\n return this.dependenciesMap[filename] || [];\n }\n\n getDag(): DagNode {\n return this.dag;\n }\n\n getReverseDag(): Record<string, string[]> {\n return this.reverseDag;\n }\n\n getTopologicalOrder(): string[] {\n return this.topologicalOrder;\n }\n}\n\nexport function createDag(files: string[], options: DagOptions): Dag {\n const allTrees: Tree[] = [];\n const visited: dependencyTree.Tree = {};\n const nonExistent: string[] = [];\n\n logger.debugMessage(\n `Creating combined tree for ${files.length} source files`\n );\n\n const appDir = LocadexManager.getInstance().appDirectory;\n\n files.forEach((file) => {\n if (visited[file]) {\n return;\n }\n\n try {\n const tree = dependencyTree({\n directory: appDir,\n filename: file,\n filter: (path: string) => !path.includes('node_modules'),\n visited: visited,\n nonExistent: nonExistent,\n tsConfig: options.tsConfig,\n webpackConfig: options.webpackConfig,\n requireConfig: options.requireConfig,\n });\n allTrees.push(tree);\n } catch (error) {\n logger.debugMessage(`Failed to create tree for ${file}: ${error}`);\n }\n });\n\n return new Dag(mergeTrees(allTrees));\n}\n\nfunction cleanFilePath(filePath: string, dir: string): string {\n return path.relative(dir, filePath);\n}\n\nfunction cleanFilePaths(dag: DagNode, dir: string): DagNode {\n const result: DagNode = {};\n\n for (const [filename, subtree] of Object.entries(dag)) {\n const cleanedFilename = cleanFilePath(filename, dir);\n result[cleanedFilename] = cleanFilePaths(subtree, dir);\n }\n\n return result;\n}\n\nfunction mergeTrees(trees: Tree[]): DagNode {\n const result: DagNode = {};\n\n function mergeTree(tree: Tree, target: DagNode): void {\n if (typeof tree === 'object' && tree !== null) {\n for (const [filename, subtree] of Object.entries(tree)) {\n if (!target[filename]) {\n target[filename] = {};\n }\n mergeTree(subtree, target[filename]);\n }\n }\n }\n\n // Process each tree\n trees.forEach((tree) => {\n mergeTree(tree, result);\n });\n\n return result;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,cAAwB,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAYtD,MAAM,OAAO,GAAG;IACN,GAAG,CAAU;IACb,UAAU,CAA2B;IACrC,eAAe,CAA2B;IAC1C,gBAAgB,CAAW;IAEnC,YAAY,GAAY;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACvD,CAAC;IAEO,SAAS,CAAC,GAAY;QAI5B,MAAM,UAAU,GAA6B,EAAE,CAAC;QAChD,MAAM,eAAe,GAA6B,EAAE,CAAC;QAErD,mCAAmC;QACnC,MAAM,UAAU,GAAG,cAAc,CAC/B,GAAG,EACH,cAAc,CAAC,WAAW,EAAE,CAAC,aAAa,CAC3C,CAAC;QAEF,SAAS,QAAQ,CAAC,IAAa,EAAE,MAAe;YAC9C,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,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC9C,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACtB,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;gBACxB,CAAC;gBACD,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","debug_id":"5a5ea809-661d-5672-9edf-42b802f85a5c"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7bef5459-c914-57ff-ad70-97aa6ca0a1a3")}catch(e){}}();
|
|
1
3
|
import { getChangedFiles } from '../lockfile.js';
|
|
2
4
|
import { findSourceFiles, filterFiles } from './matchFiles.js';
|
|
3
5
|
import { createDag } from './createDag.js';
|
|
@@ -26,4 +28,5 @@ export function extractFiles(manager) {
|
|
|
26
28
|
logger.debugMessage(`Detected ${changedFiles.length} modified files`);
|
|
27
29
|
return { files: changedFiles, dag };
|
|
28
30
|
}
|
|
29
|
-
//# sourceMappingURL=extractFiles.js.map
|
|
31
|
+
//# sourceMappingURL=extractFiles.js.map
|
|
32
|
+
//# debugId=7bef5459-c914-57ff-ad70-97aa6ca0a1a3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractFiles.js","
|
|
1
|
+
{"version":3,"file":"extractFiles.js","sources":["utils/dag/extractFiles.ts"],"sourceRoot":"/","sourcesContent":["import { LocadexManager } from '../locadexManager.js';\nimport { getChangedFiles } from '../lockfile.js';\nimport { findSourceFiles, filterFiles } from './matchFiles.js';\nimport { createDag, Dag } from './createDag.js';\nimport {\n findTsConfig,\n findWebpackConfig,\n findRequireConfig,\n} from '../fs/findConfigs.js';\nimport { logger } from '../../logging/logger.js';\n\n// extracts list of files that should be processed\nexport function extractFiles(manager: LocadexManager): {\n files: string[];\n dag: Dag;\n} {\n const config = manager.getConfig();\n\n // files with absolute paths\n const allFiles = findSourceFiles(config.matchingFiles, manager.rootDirectory);\n\n logger.debugMessage(`Found ${allFiles.length} matching files`);\n\n const dag = createDag(allFiles, {\n tsConfig: findTsConfig(manager.appDirectory),\n webpackConfig: findWebpackConfig(manager.appDirectory),\n requireConfig: findRequireConfig(manager.appDirectory),\n });\n\n // Create deep copy of topological order\n const topologicalOrder = Array.from(dag.getTopologicalOrder());\n\n // 2nd filter pass\n const filteredFiles = filterFiles(\n config.matchingFiles,\n topologicalOrder,\n manager.rootDirectory\n );\n\n logger.debugMessage(`Post-filter: ${filteredFiles.length} files`);\n\n // Get lockfile path from manager\n const lockfilePath = manager.getLockFilePath();\n\n // Filter files to only include those with changed content hashes\n const changedFiles = getChangedFiles(filteredFiles, lockfilePath);\n\n logger.debugMessage(`Detected ${changedFiles.length} modified files`);\n\n return { files: changedFiles, dag };\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAO,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE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|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ef5714a0-3d85-5392-a2d6-89fc52160884")}catch(e){}}();
|
|
1
3
|
import { readdirSync, statSync, existsSync, } from 'node:fs';
|
|
2
4
|
import { join, relative } from 'node:path';
|
|
3
5
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
@@ -110,4 +112,5 @@ export async function markFileAsEdited(filePath, stateFilePath) {
|
|
|
110
112
|
export function getCurrentFileList(stateFilePath) {
|
|
111
113
|
return getFileList(stateFilePath);
|
|
112
114
|
}
|
|
113
|
-
//# sourceMappingURL=getFiles.js.map
|
|
115
|
+
//# sourceMappingURL=getFiles.js.map
|
|
116
|
+
//# debugId=ef5714a0-3d85-5392-a2d6-89fc52160884
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFiles.js","
|
|
1
|
+
{"version":3,"file":"getFiles.js","sources":["utils/dag/getFiles.ts"],"sourceRoot":"/","sourcesContent":["import {\n readdirSync,\n statSync,\n existsSync,\n mkdirSync,\n unlinkSync,\n rmSync,\n} from 'node:fs';\nimport { join, relative, dirname } from 'node:path';\nimport { readFileSync, writeFileSync } from 'node:fs';\nimport { logger } from '../../logging/logger.js';\n\n// Mutex for thread-safe file operations\nconst fileMutexes = new Map<string, Promise<void>>();\n\nexport interface FileEntry {\n path: string;\n addedAt: string;\n setToInProgressAt: string | null;\n setToEditedAt: string | null;\n status: 'pending' | 'in_progress' | 'edited';\n}\n\nfunction getFileList(filePath: string): FileEntry[] {\n if (!existsSync(filePath)) {\n return [];\n }\n try {\n return JSON.parse(readFileSync(filePath, 'utf8'));\n } catch {\n return [];\n }\n}\n\nfunction saveFileList(files: FileEntry[], filePath: string): void {\n writeFileSync(filePath, JSON.stringify(files, null, 2));\n}\n\nasync function withFileMutex<T>(\n filePath: string,\n operation: () => T\n): Promise<T> {\n const existingMutex = fileMutexes.get(filePath) || Promise.resolve();\n const newMutex = existingMutex\n .then(() => operation())\n .catch((error) => {\n throw error;\n });\n fileMutexes.set(\n filePath,\n newMutex.then(() => {}).catch(() => {})\n ); // Store the promise but ignore errors for the next operation\n return newMutex;\n}\n\nfunction addFileToList(\n filePath: string,\n stateFilePath: string,\n status: 'pending' | 'in_progress' | 'edited' = 'pending'\n): void {\n const files = getFileList(stateFilePath);\n const existingIndex = files.findIndex((f) => f.path === filePath);\n const now = new Date().toISOString();\n\n if (existingIndex >= 0) {\n const file = files[existingIndex];\n const previousStatus = file.status;\n file.status = status;\n\n if (status === 'in_progress' && previousStatus !== 'in_progress') {\n file.setToInProgressAt = now;\n } else if (status === 'edited' && previousStatus !== 'edited') {\n file.setToEditedAt = now;\n }\n } else {\n files.push({\n path: filePath,\n addedAt: now,\n setToInProgressAt: status === 'in_progress' ? now : null,\n setToEditedAt: status === 'edited' ? now : null,\n status,\n });\n }\n\n saveFileList(files, stateFilePath);\n}\n\nfunction isTypeScriptFile(filePath: string): boolean {\n const fileName = filePath.split('/').pop() || '';\n return fileName.endsWith('.ts') || fileName.endsWith('.tsx');\n}\n\nfunction scanDirectory(dirPath: string, basePath: string): string[] {\n const files: string[] = [];\n\n if (!existsSync(dirPath)) {\n return files;\n }\n\n try {\n const items = readdirSync(dirPath);\n\n for (const item of items) {\n const fullPath = join(dirPath, item);\n const stat = statSync(fullPath);\n\n if (stat.isDirectory()) {\n // Skip node_modules, .next, and other common directories to ignore\n if (\n !['node_modules', '.next', '.git', 'dist', 'build', 'out'].includes(\n item\n )\n ) {\n files.push(...scanDirectory(fullPath, basePath));\n }\n } else if (stat.isFile()) {\n const relativePath = relative(basePath, fullPath);\n if (isTypeScriptFile(relativePath)) {\n files.push(relativePath);\n }\n }\n }\n } catch (error) {\n logger.warning(`Warning: Could not read directory ${dirPath}: ${error}`);\n }\n\n return files;\n}\n\n// Used by dag command\nexport function addFilesToManager(\n filesStateFilePath: string,\n files: string[]\n): string {\n const existingFiles = getFileList(filesStateFilePath);\n const existingPaths = new Set(existingFiles.map((f) => f.path));\n files = files.filter((f) => !existingPaths.has(f));\n\n files.forEach((filePath) =>\n addFileToList(filePath, filesStateFilePath, 'pending')\n );\n\n return filesStateFilePath;\n}\n\n// Used by dag command\nexport async function markFileAsInProgress(\n filePath: string,\n stateFilePath: string\n): Promise<void> {\n return withFileMutex(stateFilePath, () => {\n addFileToList(filePath, stateFilePath, 'in_progress');\n });\n}\n\n// Used by dag command\nexport async function markFileAsEdited(\n filePath: string,\n stateFilePath: string\n): Promise<void> {\n return withFileMutex(stateFilePath, () => {\n addFileToList(filePath, stateFilePath, 'edited');\n });\n}\n\nexport function getCurrentFileList(stateFilePath: string): {\n path: string;\n addedAt: string;\n setToInProgressAt: string | null;\n setToEditedAt: string | null;\n status: 'pending' | 'in_progress' | 'edited';\n}[] {\n return getFileList(stateFilePath);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,UAAU,GAIX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAW,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,wCAAwC;AACxC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAyB,CAAC;AAUrD,SAAS,WAAW,CAAC,QAAgB;IACnC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,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EF,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,sBAAsB;AACtB,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,aAAqB;IAErB,OAAO,aAAa,CAAC,aAAa,EAAE,GAAG,EAAE;QACvC,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,sBAAsB;AACtB,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAAgB,EAChB,aAAqB;IAErB,OAAO,aAAa,CAAC,aAAa,EAAE,GAAG,EAAE;QACvC,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,aAAqB;IAOtD,OAAO,WAAW,CAAC,aAAa,CAAC,CAAC;AACpC,CAAC","debug_id":"ef5714a0-3d85-5392-a2d6-89fc52160884"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="96ee8449-89b9-5a5d-b9a6-b55ddd8d34ae")}catch(e){}}();
|
|
1
3
|
import { logger } from '../../logging/logger.js';
|
|
2
4
|
import * as path from 'node:path';
|
|
3
5
|
import fg from 'fast-glob';
|
|
@@ -55,4 +57,5 @@ export function filterFiles(globPatterns, filePaths, cwd) {
|
|
|
55
57
|
});
|
|
56
58
|
});
|
|
57
59
|
}
|
|
58
|
-
//# sourceMappingURL=matchFiles.js.map
|
|
60
|
+
//# sourceMappingURL=matchFiles.js.map
|
|
61
|
+
//# debugId=96ee8449-89b9-5a5d-b9a6-b55ddd8d34ae
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchFiles.js","
|
|
1
|
+
{"version":3,"file":"matchFiles.js","sources":["utils/dag/matchFiles.ts"],"sourceRoot":"/","sourcesContent":["import { logger } from '../../logging/logger.js';\nimport * as path from 'node:path';\nimport fg from 'fast-glob';\nimport micromatch from 'micromatch';\nconst { isMatch } = micromatch;\nimport {\n DAG_IGNORED_EXTENSIONS,\n DAG_IGNORED_FILES,\n DAG_IGNORED_PATTERNS,\n} from '../shared.js';\n\nexport function findSourceFiles(globPatterns: string[], cwd: string): string[] {\n const allFiles: string[] = [];\n\n for (const pattern of globPatterns) {\n try {\n const matchedFiles = fg.sync(pattern, {\n cwd,\n absolute: true,\n onlyFiles: true,\n ignore: DAG_IGNORED_PATTERNS,\n });\n\n allFiles.push(...matchedFiles);\n } catch (error) {\n logger.debugMessage(\n `Failed to process glob pattern \"${pattern}\": ${error}`\n );\n }\n }\n\n // Remove duplicates\n const uniqueFiles = Array.from(new Set(allFiles));\n\n // Filter by extensions and apply blacklists\n const filteredFiles = uniqueFiles.filter((file) => {\n const filename = path.basename(file);\n\n const hasBlacklistedExtension = DAG_IGNORED_EXTENSIONS.some(\n (blacklistedExt) => filename.endsWith(blacklistedExt)\n );\n\n // Skip blacklisted extensions and files\n if (hasBlacklistedExtension || DAG_IGNORED_FILES.includes(filename)) {\n return false;\n }\n\n return true;\n });\n\n return filteredFiles;\n}\n\nexport function filterFiles(\n globPatterns: string[],\n filePaths: string[],\n cwd: string\n): string[] {\n if (globPatterns.length === 0) {\n return filePaths;\n }\n\n return filePaths.filter((filePath) => {\n // Convert to relative path if absolute\n const relativePath = path.isAbsolute(filePath)\n ? path.relative(cwd, filePath)\n : filePath;\n\n // Check if file matches any of the glob patterns\n return globPatterns.some((pattern) => {\n try {\n return isMatch(relativePath, pattern);\n } catch (error) {\n logger.debugMessage(\n `Failed to match file \"${filePath}\" against pattern \"${pattern}\": ${error}`\n );\n return false;\n }\n });\n });\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,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AQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpE,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,YAAsB,EACtB,SAAmB,EACnB,GAAW;IAEX,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QACnC,uCAAuC;QACvC,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5C,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;YAC9B,CAAC,CAAC,QAAQ,CAAC;QAEb,iDAAiD;QACjD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YACnC,IAAI,CAAC;gBACH,OAAO,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YACxC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,YAAY,CACjB,yBAAyB,QAAQ,sBAAsB,OAAO,MAAM,KAAK,EAAE,CAC5E,CAAC;gBACF,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","debug_id":"96ee8449-89b9-5a5d-b9a6-b55ddd8d34ae"}
|
package/dist/utils/errors.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7d93cd57-f940-503e-afc8-039ef9ce7221")}catch(e){}}();
|
|
1
3
|
export class AgentError extends Error {
|
|
2
4
|
code;
|
|
3
5
|
constructor(message, code) {
|
|
@@ -36,4 +38,5 @@ export class AgentSpawnError extends AgentError {
|
|
|
36
38
|
this.name = 'AgentSpawnError';
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
//# sourceMappingURL=errors.js.map
|
|
41
|
+
//# sourceMappingURL=errors.js.map
|
|
42
|
+
//# debugId=7d93cd57-f940-503e-afc8-039ef9ce7221
|
package/dist/utils/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["utils/errors.ts"],"sourceRoot":"/","sourcesContent":["export class AgentError extends Error {\n constructor(\n message: string,\n public readonly code?: string\n ) {\n super(message);\n this.name = 'AgentError';\n }\n}\n\nexport class TimeoutError extends AgentError {\n constructor(\n message: string,\n public readonly timeoutSec: number\n ) {\n super(message, 'TIMEOUT');\n this.name = 'TimeoutError';\n }\n}\n\nexport class UserAbortError extends AgentError {\n constructor(message: string = 'Operation was aborted by user') {\n super(message, 'USER_ABORT');\n this.name = 'UserAbortError';\n }\n}\n\nexport class AgentProcessError extends AgentError {\n constructor(\n message: string,\n public readonly exitCode?: number\n ) {\n super(message, 'PROCESS_ERROR');\n this.name = 'AgentProcessError';\n }\n}\n\nexport class AgentSpawnError extends AgentError {\n constructor(\n message: string,\n public readonly originalError: Error\n ) {\n super(message, 'SPAWN_ERROR');\n this.name = 'AgentSpawnError';\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,OAAO,UAAW,SAAQ,KAAK;IAGjB;IAFlB,YACE,OAAe,EACC,IAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,SAAI,GAAJ,IAAI,CAAS;QAG7B,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,UAAU;IAGxB;IAFlB,YACE,OAAe,EACC,UAAkB;QAElC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAFV,eAAU,GAAV,UAAU,CAAQ;QAGlC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC5C,YAAY,UAAkB,+BAA+B;QAC3D,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAG7B;IAFlB,YACE,OAAe,EACC,QAAiB;QAEjC,KAAK,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QAFhB,aAAQ,GAAR,QAAQ,CAAS;QAGjC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAG3B;IAFlB,YACE,OAAe,EACC,aAAoB;QAEpC,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAFd,kBAAa,GAAb,aAAa,CAAO;QAGpC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF","debug_id":"7d93cd57-f940-503e-afc8-039ef9ce7221"}
|
package/dist/utils/exec.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0051b367-ed4a-5b80-bc98-b49b64a0f46e")}catch(e){}}();
|
|
1
3
|
import chalk from 'chalk';
|
|
2
4
|
import { spawn } from 'node:child_process';
|
|
3
5
|
import { logger } from '../logging/logger.js';
|
|
@@ -62,4 +64,5 @@ export async function execFunction(command, args, pipeStdout = true, cwd = proce
|
|
|
62
64
|
});
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
|
-
//# sourceMappingURL=exec.js.map
|
|
67
|
+
//# sourceMappingURL=exec.js.map
|
|
68
|
+
//# debugId=0051b367-ed4a-5b80-bc98-b49b64a0f46e
|
package/dist/utils/exec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","
|
|
1
|
+
{"version":3,"file":"exec.js","sources":["utils/exec.ts"],"sourceRoot":"/","sourcesContent":["import chalk from 'chalk';\nimport { spawn } from 'node:child_process';\nimport { logger } from '../logging/logger.js';\n\n// Utility function for executing a command and returning the output (and error)\n// If pipeStdout is true, the output will be logged to the console\nexport async function execFunction(\n command: string,\n args: string[],\n pipeStdout: boolean = true,\n cwd: string = process.cwd(),\n parentAbortController?: AbortController,\n timeoutMs: number = 5 * 60 * 1000\n): Promise<{ stdout: string; stderr: string; code: number }> {\n return new Promise<{ stdout: string; stderr: string; code: number }>(\n (resolve, reject) => {\n const abortController = new AbortController();\n\n // Listen for parent abort signal\n if (parentAbortController) {\n parentAbortController.signal.addEventListener('abort', () => {\n abortController.abort();\n reject(new Error('Process aborted by parent'));\n });\n }\n\n const childProcess = spawn(command, args, {\n stdio: ['ignore', 'pipe', 'pipe'],\n cwd,\n signal: abortController.signal,\n });\n\n let stdOutOutput = '';\n let stdErrOutput = '';\n\n const timeout = global.setTimeout(() => {\n abortController.abort();\n reject(new Error(`Process timed out after ${timeoutMs / 1000}s`));\n }, timeoutMs);\n\n childProcess.stderr.on('data', (data) => {\n stdErrOutput += data.toString();\n });\n\n childProcess.stdout.on('data', (data) => {\n const output = data.toString();\n stdOutOutput += output;\n if (!pipeStdout) {\n logger.log(output);\n } else {\n // eslint-disable-next-line no-console\n console.log(output);\n }\n });\n\n childProcess.on('error', (error) => {\n global.clearTimeout(timeout);\n reject(error);\n });\n\n childProcess.on('close', (code) => {\n global.clearTimeout(timeout);\n if (code === 0) {\n resolve({ stdout: stdOutOutput, stderr: stdErrOutput, code });\n } else {\n logger.log(\n chalk.red(\n `${command} ${args.join(' ')} failed with exit code ${code} in ${cwd}`\n )\n );\n if (stdErrOutput) {\n logger.log(chalk.red(`Error details: ${stdErrOutput}`));\n }\n // reject with the most recent output\n resolve({\n stdout: stdOutOutput,\n stderr: stdErrOutput,\n code: code ?? 1,\n });\n }\n });\n }\n );\n}\n"],"names":[],"mappings":";;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,gFAAgF;AAChF,kEAAkE;AAClE,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAAe,EACf,IAAc,EACd,aAAsB,IAAI,EAC1B,MAAc,OAAO,CAAC,GAAG,EAAE,EAC3B,qBAAuC,EACvC,YAAoB,CAAC,GAAG,EAAE,GAAG,IAAI;IAEjC,OAAO,IAAI,OAAO,CAChB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAClB,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAE9C,iCAAiC;QACjC,IAAI,qBAAqB,EAAE,CAAC;YAC1B,qBAAqB,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;gBAC1D,eAAe,CAAC,KAAK,EAAE,CAAC;gBACxB,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC;QAED,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE;YACxC,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;YACjC,GAAG;YACH,MAAM,EAAE,eAAe,CAAC,MAAM;SAC/B,CAAC,CAAC;QAEH,IAAI,YAAY,GAAG,EAAE,CAAC;QACtB,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,MAAM,OAAO,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,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,IAAI,OAAO,GAAG,EAAE,CACvE,CACF,CAAC;gBACF,IAAI,YAAY,EAAE,CAAC;oBACjB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,YAAY,EAAE,CAAC,CAAC,CAAC;gBAC1D,CAAC;gBACD,qCAAqC;gBACrC,OAAO,CAAC;oBACN,MAAM,EAAE,YAAY;oBACpB,MAAM,EAAE,YAAY;oBACpB,IAAI,EAAE,IAAI,IAAI,CAAC;iBAChB,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"0051b367-ed4a-5b80-bc98-b49b64a0f46e"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="09f8aaac-8544-5225-91c7-82ee27407983")}catch(e){}}();
|
|
1
3
|
import path from 'node:path';
|
|
2
4
|
import fs from 'node:fs';
|
|
3
5
|
export function findTsConfig(cwd) {
|
|
@@ -54,4 +56,5 @@ export function findFilepaths(paths, cwd) {
|
|
|
54
56
|
}
|
|
55
57
|
return resolvedPaths;
|
|
56
58
|
}
|
|
57
|
-
//# sourceMappingURL=findConfigs.js.map
|
|
59
|
+
//# sourceMappingURL=findConfigs.js.map
|
|
60
|
+
//# debugId=09f8aaac-8544-5225-91c7-82ee27407983
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findConfigs.js","
|
|
1
|
+
{"version":3,"file":"findConfigs.js","sources":["utils/fs/findConfigs.ts"],"sourceRoot":"/","sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs';\n\nexport function findTsConfig(cwd: string): string | undefined {\n const possiblePaths = [\n path.join(cwd, 'tsconfig.json'),\n path.join(cwd, 'tsconfig.app.json'),\n path.join(cwd, 'jsconfig.json'),\n ];\n\n for (const configPath of possiblePaths) {\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n\n return undefined;\n}\n\nexport function findWebpackConfig(cwd: string): string | undefined {\n const possiblePaths = [\n path.join(cwd, 'webpack.config.js'),\n path.join(cwd, 'webpack.config.ts'),\n path.join(cwd, 'next.config.js'),\n path.join(cwd, 'next.config.ts'),\n ];\n\n for (const configPath of possiblePaths) {\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n\n return undefined;\n}\n/**\n * Resolve the file paths from the given file paths or default paths.\n * @param {string[]} paths - The file paths to resolve.\n * @param {string} errorMessage - The error message to throw if no paths are found.\n * @returns {string[]} - The resolved file paths.\n */\nexport function findRequireConfig(cwd: string): string | undefined {\n const possiblePaths = [\n path.join(cwd, 'require.config.js'),\n path.join(cwd, 'requirejs.config.js'),\n ];\n\n for (const configPath of possiblePaths) {\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n\n return undefined;\n}\n\nexport function findFilepaths(paths: string[], cwd: string): string[] {\n const resolvedPaths: string[] = [];\n for (const possiblePath of paths) {\n if (fs.existsSync(path.resolve(cwd, possiblePath))) {\n resolvedPaths.push(path.resolve(cwd, possiblePath));\n }\n }\n return resolvedPaths;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,aAAa,GAAG;QACpB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC;KAChC,CAAC;IAEF,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE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G,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC;YACnD,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC","debug_id":"09f8aaac-8544-5225-91c7-82ee27407983"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="87ca1c99-0d4b-5c78-9b56-72b66d0cecfb")}catch(e){}}();
|
|
1
3
|
import { logger } from '../../logging/logger.js';
|
|
2
4
|
import { execFunction } from '../exec.js';
|
|
3
5
|
export async function formatFiles(cmd, manager) {
|
|
@@ -10,4 +12,5 @@ export async function formatFiles(cmd, manager) {
|
|
|
10
12
|
logger.step(`Formatted files with ${cmd}`);
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
|
-
//# sourceMappingURL=formatFiles.js.map
|
|
15
|
+
//# sourceMappingURL=formatFiles.js.map
|
|
16
|
+
//# debugId=87ca1c99-0d4b-5c78-9b56-72b66d0cecfb
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatFiles.js","
|
|
1
|
+
{"version":3,"file":"formatFiles.js","sources":["utils/fs/formatFiles.ts"],"sourceRoot":"/","sourcesContent":["import { LocadexManager } from '../locadexManager.js';\nimport { logger } from '../../logging/logger.js';\nimport { execFunction } from '../exec.js';\n\nexport async function formatFiles(cmd: string, manager: LocadexManager) {\n logger.verboseMessage(`Running ${cmd}... in ${manager.appDirectory}`);\n const { stderr, code } = await execFunction(\n 'sh',\n ['-c', cmd],\n false,\n manager.appDirectory,\n manager.getAgentAbortController()\n );\n if (code !== 0) {\n logger.error(`Error running ${cmd} in ${manager.appDirectory}: ${stderr}`);\n } else {\n logger.step(`Formatted files with ${cmd}`);\n }\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,OAAuB;IACpE,MAAM,CAAC,cAAc,CAAC,WAAW,GAAG,UAAU,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACtE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,YAAY,CACzC,IAAI,EACJ,CAAC,IAAI,EAAE,GAAG,CAAC,EACX,KAAK,EACL,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,uBAAuB,EAAE,CAClC,CAAC;IACF,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,iBAAiB,GAAG,OAAO,OAAO,CAAC,YAAY,KAAK,MAAM,EAAE,CAAC,CAAC;IAC7E,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,wBAAwB,GAAG,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC","debug_id":"87ca1c99-0d4b-5c78-9b56-72b66d0cecfb"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="af13a5a4-10ec-5ee2-a2f0-544dad4cacb7")}catch(e){}}();
|
|
1
3
|
import { findFilepaths } from './findConfigs.js';
|
|
2
4
|
export function getNextDirectories(cwd) {
|
|
3
5
|
return findFilepaths(['./src', './app', './pages'], cwd);
|
|
4
6
|
}
|
|
5
|
-
//# sourceMappingURL=getFiles.js.map
|
|
7
|
+
//# sourceMappingURL=getFiles.js.map
|
|
8
|
+
//# debugId=af13a5a4-10ec-5ee2-a2f0-544dad4cacb7
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFiles.js","
|
|
1
|
+
{"version":3,"file":"getFiles.js","sources":["utils/fs/getFiles.ts"],"sourceRoot":"/","sourcesContent":["import { findFilepaths } from './findConfigs.js';\n\nexport function getNextDirectories(cwd: string): string[] {\n return findFilepaths(['./src', './app', './pages'], cwd);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,aAAa,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3D,CAAC","debug_id":"af13a5a4-10ec-5ee2-a2f0-544dad4cacb7"}
|
package/dist/utils/fs/git.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ad25eee6-d20b-5bb0-9fcf-10cac6e031c2")}catch(e){}}();
|
|
1
3
|
import { execSync } from 'child_process';
|
|
2
4
|
import { unlinkSync } from 'fs';
|
|
3
5
|
import { logger } from '../../logging/logger.js';
|
|
@@ -32,4 +34,5 @@ export function deleteAddedFiles(ignoreDirectories = [], ignoreFiles = []) {
|
|
|
32
34
|
}
|
|
33
35
|
logger.verboseMessage(`Deleted ${filesToDelete.length} untracked files`);
|
|
34
36
|
}
|
|
35
|
-
//# sourceMappingURL=git.js.map
|
|
37
|
+
//# sourceMappingURL=git.js.map
|
|
38
|
+
//# debugId=ad25eee6-d20b-5bb0-9fcf-10cac6e031c2
|
package/dist/utils/fs/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","
|
|
1
|
+
{"version":3,"file":"git.js","sources":["utils/fs/git.ts"],"sourceRoot":"/","sourcesContent":["import { execSync } from 'child_process';\nimport { unlinkSync } from 'fs';\nimport { logger } from '../../logging/logger.js';\n\n/**\n * Deletes any newly created (untracked) files, except those in ignoreDirectories and ignoreFiles.\n * @param ignoreDirectories - Array of directory names to ignore (relative to repo root).\n * @param ignoreFiles - Array of file names to ignore (relative to repo root).\n */\nexport function deleteAddedFiles(\n ignoreDirectories: string[] = [],\n ignoreFiles: string[] = []\n) {\n logger.debugMessage(\n `Deleting untracked files, ignoring directories: ${ignoreDirectories.join(\n ', '\n )}${ignoreFiles.length > 0 ? `, ignoring files: ${ignoreFiles.join(', ')}` : ''}`\n );\n // Get list of untracked files from git\n const output = execSync('git status --porcelain', { encoding: 'utf-8' });\n const untrackedFiles = output\n .split('\\n')\n .filter((line) => line.startsWith('?? '))\n .map((line) => line.slice(3).trim())\n .filter((file) => file.length > 0);\n\n // Filter out files in ignored directories and specific files\n const filesToDelete = untrackedFiles.filter((file) => {\n const isInIgnoredDirectory = ignoreDirectories.some(\n (dir) => file === dir || file.startsWith(dir + '/')\n );\n const isIgnoredFile = ignoreFiles.some((pattern) => file.includes(pattern));\n return !isInIgnoredDirectory && !isIgnoredFile;\n });\n\n // Delete each file\n for (const file of filesToDelete) {\n try {\n unlinkSync(file);\n } catch (err) {\n // Optionally log or handle errors\n }\n }\n logger.verboseMessage(`Deleted ${filesToDelete.length} untracked files`);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,oBAA8B,EAAE,EAChC,cAAwB,EAAE;IAE1B,MAAM,CAAC,YAAY,CACjB,mDA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AAC,OAAO,GAAG,EAAE,CAAC;YACb,kCAAkC;QACpC,CAAC;IACH,CAAC;IACD,MAAM,CAAC,cAAc,CAAC,WAAW,aAAa,CAAC,MAAM,kBAAkB,CAAC,CAAC;AAC3E,CAAC","debug_id":"ad25eee6-d20b-5bb0-9fcf-10cac6e031c2"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2167fd1f-2d12-53df-8e71-446f613756d0")}catch(e){}}();
|
|
1
3
|
import path from 'node:path';
|
|
2
4
|
import fs from 'node:fs';
|
|
3
5
|
// Add a file to the .gitignore file
|
|
@@ -13,4 +15,5 @@ export async function addToGitIgnore(relativeDirPath, fileName) {
|
|
|
13
15
|
await fs.promises.writeFile(gitignoreFile, `# Locadex\n${fileName}\n`, 'utf8');
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
|
-
//# sourceMappingURL=writeFiles.js.map
|
|
18
|
+
//# sourceMappingURL=writeFiles.js.map
|
|
19
|
+
//# debugId=2167fd1f-2d12-53df-8e71-446f613756d0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeFiles.js","
|
|
1
|
+
{"version":3,"file":"writeFiles.js","sources":["utils/fs/writeFiles.ts"],"sourceRoot":"/","sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs';\n\n// Add a file to the .gitignore file\nexport async function addToGitIgnore(\n relativeDirPath: string,\n fileName: string\n) {\n const gitignoreFile = path.join(relativeDirPath, '.gitignore');\n if (fs.existsSync(gitignoreFile)) {\n const gitignoreContent = await fs.promises.readFile(gitignoreFile, 'utf8');\n if (!gitignoreContent.includes(fileName)) {\n await fs.promises.appendFile(\n gitignoreFile,\n `\\n# Locadex\\n${fileName}\\n`,\n 'utf8'\n );\n }\n } else {\n await fs.promises.writeFile(\n gitignoreFile,\n `# Locadex\\n${fileName}\\n`,\n 'utf8'\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,oCAAoC;AACpC,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,eAAuB,EACvB,QAAgB;IAEhB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;IAC/D,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,MAAM,gBAAgB,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC3E,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzC,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAC1B,aAAa,EACb,gBAAgB,QAAQ,IAAI,EAC5B,MAAM,CACP,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CACzB,aAAa,EACb,cAAc,QAAQ,IAAI,EAC1B,MAAM,CACP,CAAC;IACJ,CAAC;AACH,CAAC","debug_id":"2167fd1f-2d12-53df-8e71-446f613756d0"}
|
package/dist/utils/getPaths.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="753d767d-b755-5567-ae1a-f45989169bc4")}catch(e){}}();
|
|
1
3
|
import path, { dirname } from 'node:path';
|
|
2
4
|
import { fileURLToPath } from 'node:url';
|
|
3
5
|
import fs from 'node:fs';
|
|
@@ -17,4 +19,5 @@ export function getLocadexVersion() {
|
|
|
17
19
|
return 'unknown';
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
|
-
//# sourceMappingURL=getPaths.js.map
|
|
22
|
+
//# sourceMappingURL=getPaths.js.map
|
|
23
|
+
//# debugId=753d767d-b755-5567-ae1a-f45989169bc4
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPaths.js","sourceRoot":"/","
|
|
1
|
+
{"version":3,"file":"getPaths.js","sources":["utils/getPaths.ts"],"sourceRoot":"/","sourcesContent":["import path, { dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fs from 'node:fs';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport function fromPackageRoot(relative: string) {\n return path.resolve(__dirname, `../../`, relative);\n}\n\nexport function getLocadexVersion(): string {\n const packageJsonPath = fromPackageRoot('package.json');\n\n if (!fs.existsSync(packageJsonPath)) {\n return 'unknown';\n }\n try {\n return JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')).version;\n } catch (error) {\n return 'unknown';\n }\n}\n"],"names":[],"mappings":";;AAAA,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,MAAM,eAAe,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAExD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IACtE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","debug_id":"753d767d-b755-5567-ae1a-f45989169bc4"}
|