locadex 0.1.0-alpha.1 → 0.1.0-alpha.10
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/dist/cli.js +6 -79
- package/dist/cli.js.map +1 -1
- package/dist/commands/i18n.d.ts +3 -1
- package/dist/commands/i18n.d.ts.map +1 -1
- package/dist/commands/i18n.js +36 -4
- package/dist/commands/i18n.js.map +1 -1
- package/dist/commands/setup.d.ts +6 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +36 -4
- package/dist/commands/setup.js.map +1 -1
- package/dist/tasks/i18n.d.ts.map +1 -1
- package/dist/tasks/i18n.js +37 -43
- package/dist/tasks/i18n.js.map +1 -1
- package/dist/tasks/setup.d.ts.map +1 -1
- package/dist/tasks/setup.js +8 -3
- package/dist/tasks/setup.js.map +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +2 -3
- package/dist/telemetry.js.map +1 -1
- package/dist/types/cli.d.ts +0 -2
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/cli.js +2 -2
- package/dist/types/cli.js.map +1 -1
- package/dist/utils/claudeCode.d.ts +4 -3
- package/dist/utils/claudeCode.d.ts.map +1 -1
- package/dist/utils/claudeCode.js +26 -32
- package/dist/utils/claudeCode.js.map +1 -1
- package/dist/utils/config.d.ts +0 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +2 -11
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/dag/extractFiles.d.ts +7 -0
- package/dist/utils/dag/extractFiles.d.ts.map +1 -0
- package/dist/utils/dag/extractFiles.js +32 -0
- package/dist/utils/dag/extractFiles.js.map +1 -0
- package/dist/utils/dag/matchFiles.d.ts +2 -1
- package/dist/utils/dag/matchFiles.d.ts.map +1 -1
- package/dist/utils/dag/matchFiles.js +27 -6
- package/dist/utils/dag/matchFiles.js.map +1 -1
- package/dist/utils/locadexManager.d.ts +5 -2
- package/dist/utils/locadexManager.d.ts.map +1 -1
- package/dist/utils/locadexManager.js +32 -18
- package/dist/utils/locadexManager.js.map +1 -1
- package/dist/utils/packages/installPackage.d.ts.map +1 -1
- package/dist/utils/packages/installPackage.js +13 -5
- package/dist/utils/packages/installPackage.js.map +1 -1
- package/dist/utils/shared.d.ts.map +1 -1
- package/dist/utils/shared.js +3 -2
- package/dist/utils/shared.js.map +1 -1
- package/dist/utils/shutdown.d.ts.map +1 -1
- package/dist/utils/shutdown.js +3 -4
- package/dist/utils/shutdown.js.map +1 -1
- package/package.json +5 -3
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!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]="
|
|
3
|
+
!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]="959468dc-cf43-5ab1-8999-d1c300fa7053")}catch(e){}}();
|
|
4
4
|
import dotenv from 'dotenv';
|
|
5
5
|
dotenv.config({ path: '.env' });
|
|
6
6
|
dotenv.config({ path: '.env.local', override: true });
|
|
@@ -10,13 +10,8 @@ import { Command } from 'commander';
|
|
|
10
10
|
import { readFileSync } from 'node:fs';
|
|
11
11
|
import { fromPackageRoot } from './utils/getPaths.js';
|
|
12
12
|
import { setupCommand } from './commands/setup.js';
|
|
13
|
-
import { withTelemetry } from './telemetry.js';
|
|
14
13
|
import { i18nCommand } from './commands/i18n.js';
|
|
15
|
-
import { displayHeader } from './logging/console.js';
|
|
16
14
|
import { main } from 'gtx-cli/index';
|
|
17
|
-
import { LocadexManager } from './utils/locadexManager.js';
|
|
18
|
-
import { logger } from './logging/logger.js';
|
|
19
|
-
import { exit } from './utils/shutdown.js';
|
|
20
15
|
const packageJson = JSON.parse(readFileSync(fromPackageRoot('package.json'), 'utf8'));
|
|
21
16
|
const program = new Command();
|
|
22
17
|
program
|
|
@@ -30,45 +25,11 @@ program
|
|
|
30
25
|
.option('-d, --debug', 'Debug output')
|
|
31
26
|
.option('-b, --batch-size <number>', 'File batch size', '10')
|
|
32
27
|
.option('-c, --concurrency <number>', 'Max number of concurrent agents', '1')
|
|
33
|
-
.option('-
|
|
34
|
-
.option('-e, --extensions <extensions>', 'Comma-separated list of file extensions to match')
|
|
28
|
+
.option('-m, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files')
|
|
35
29
|
.option('--package-manager <manager>', 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)')
|
|
36
30
|
.option('-y, --bypass-prompts', 'Bypass interactive prompts')
|
|
37
31
|
.option('--no-telemetry', 'Disable telemetry')
|
|
38
|
-
.action(
|
|
39
|
-
const parentOptions = command.parent?.opts() || {};
|
|
40
|
-
const allOptions = { ...parentOptions, ...options };
|
|
41
|
-
const telemetryEnabled = !allOptions.noTelemetry;
|
|
42
|
-
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
43
|
-
const batchSize = Number(allOptions.batchSize) || 1;
|
|
44
|
-
const concurrency = Number(allOptions.concurrency) || 1;
|
|
45
|
-
if (concurrency < 1 || batchSize < 1) {
|
|
46
|
-
logger.error('Batch size and concurrency must be greater than 0');
|
|
47
|
-
await exit(1);
|
|
48
|
-
}
|
|
49
|
-
displayHeader(telemetryEnabled);
|
|
50
|
-
LocadexManager.initialize({
|
|
51
|
-
mcpTransport: 'sse',
|
|
52
|
-
metadata: {},
|
|
53
|
-
cliOptions: allOptions,
|
|
54
|
-
options: {
|
|
55
|
-
...(allOptions.matchingFiles && {
|
|
56
|
-
matchingFiles: allOptions.matchingFiles
|
|
57
|
-
.split(',')
|
|
58
|
-
.map((file) => file.trim()),
|
|
59
|
-
}),
|
|
60
|
-
...(allOptions.matchingExtensions && {
|
|
61
|
-
matchingExtensions: allOptions.matchingExtensions
|
|
62
|
-
.split(',')
|
|
63
|
-
.map((ext) => ext.trim()),
|
|
64
|
-
}),
|
|
65
|
-
maxConcurrency: concurrency,
|
|
66
|
-
batchSize,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
await setupCommand(!!allOptions.bypassPrompts, allOptions.packageManager);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
32
|
+
.action(setupCommand);
|
|
72
33
|
program
|
|
73
34
|
.command('i18n')
|
|
74
35
|
.description('Run Locadex i18n on your project')
|
|
@@ -76,44 +37,10 @@ program
|
|
|
76
37
|
.option('-d, --debug', 'Debug output')
|
|
77
38
|
.option('-b, --batch-size <number>', 'File batch size', '10')
|
|
78
39
|
.option('-c, --concurrency <number>', 'Max number of concurrent agents', '1')
|
|
79
|
-
.option('-
|
|
80
|
-
.option('-e, --extensions <extensions>', 'Comma-separated list of file extensions to match')
|
|
40
|
+
.option('-m, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files')
|
|
81
41
|
.option('--no-telemetry', 'Disable telemetry')
|
|
82
|
-
.action(
|
|
83
|
-
const parentOptions = command.parent?.opts() || {};
|
|
84
|
-
const allOptions = { ...parentOptions, ...options };
|
|
85
|
-
const telemetryEnabled = !allOptions.noTelemetry;
|
|
86
|
-
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
87
|
-
const batchSize = Number(allOptions.batchSize) || 1;
|
|
88
|
-
const concurrency = Number(allOptions.concurrency) || 1;
|
|
89
|
-
if (concurrency < 1 || batchSize < 1) {
|
|
90
|
-
logger.error('Batch size and concurrency must be greater than 0');
|
|
91
|
-
await exit(1);
|
|
92
|
-
}
|
|
93
|
-
displayHeader(telemetryEnabled);
|
|
94
|
-
LocadexManager.initialize({
|
|
95
|
-
mcpTransport: 'sse',
|
|
96
|
-
metadata: {},
|
|
97
|
-
cliOptions: allOptions,
|
|
98
|
-
options: {
|
|
99
|
-
...(allOptions.matchingFiles && {
|
|
100
|
-
matchingFiles: allOptions.matchingFiles
|
|
101
|
-
.split(',')
|
|
102
|
-
.map((file) => file.trim()),
|
|
103
|
-
}),
|
|
104
|
-
...(allOptions.matchingExtensions && {
|
|
105
|
-
matchingExtensions: allOptions.matchingExtensions
|
|
106
|
-
.split(',')
|
|
107
|
-
.map((ext) => ext.trim()),
|
|
108
|
-
}),
|
|
109
|
-
maxConcurrency: concurrency,
|
|
110
|
-
batchSize,
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
await i18nCommand();
|
|
114
|
-
});
|
|
115
|
-
});
|
|
42
|
+
.action(i18nCommand);
|
|
116
43
|
main(program);
|
|
117
44
|
program.parse();
|
|
118
45
|
//# sourceMappingURL=cli.js.map
|
|
119
|
-
//# debugId=
|
|
46
|
+
//# debugId=959468dc-cf43-5ab1-8999-d1c300fa7053
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n\nimport dotenv from 'dotenv';\n\ndotenv.config({ path: '.env' });\ndotenv.config({ path: '.env.local', override: true });\ndotenv.config({ path: '.env.production', override: true });\n\nimport './telemetry.js';\nimport { Command } from 'commander';\nimport { readFileSync } from 'node:fs';\nimport { fromPackageRoot } from './utils/getPaths.js';\nimport { setupCommand } from './commands/setup.js';\nimport {
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n\nimport dotenv from 'dotenv';\n\ndotenv.config({ path: '.env' });\ndotenv.config({ path: '.env.local', override: true });\ndotenv.config({ path: '.env.production', override: true });\n\nimport './telemetry.js';\nimport { Command } from 'commander';\nimport { readFileSync } from 'node:fs';\nimport { fromPackageRoot } from './utils/getPaths.js';\nimport { setupCommand } from './commands/setup.js';\nimport { i18nCommand } from './commands/i18n.js';\nimport { main } from 'gtx-cli/index';\n\nconst packageJson = JSON.parse(\n readFileSync(fromPackageRoot('package.json'), 'utf8')\n);\n\nconst program = new Command();\n\nprogram\n .name('locadex')\n .description('AI agent for internationalization')\n .version(packageJson.version);\n\nprogram\n .command('start')\n .description('Run Locadex on your project')\n .option('-v, --verbose', 'Verbose output')\n .option('-d, --debug', 'Debug output')\n .option('-b, --batch-size <number>', 'File batch size', '10')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents', '1')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files'\n )\n .option(\n '--package-manager <manager>',\n 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)'\n )\n .option('-y, --bypass-prompts', 'Bypass interactive prompts')\n .option('--no-telemetry', 'Disable telemetry')\n .action(setupCommand);\n\nprogram\n .command('i18n')\n .description('Run Locadex i18n on your project')\n .option('-v, --verbose', 'Verbose output')\n .option('-d, --debug', 'Debug output')\n .option('-b, --batch-size <number>', 'File batch size', '10')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents', '1')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files'\n )\n .option('--no-telemetry', 'Disable telemetry')\n .action(i18nCommand);\n\nmain(program);\n\nprogram.parse();\n"],"names":[],"mappings":";;;AAEA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAChC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAE3D,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,E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CAAC;KAC5D,MAAM,CAAC,4BAA4B,EAAE,iCAAiC,EAAE,GAAG,CAAC;KAC5E,MAAM,CACL,6BAA6B,EAC7B,6DAA6D,CAC9D;KACA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;KAC7C,MAAM,CAAC,WAAW,CAAC,CAAC;AAEvB,IAAI,CAAC,OAAO,CAAC,CAAC;AAEd,OAAO,CAAC,KAAK,EAAE,CAAC","debug_id":"959468dc-cf43-5ab1-8999-d1c300fa7053"}
|
package/dist/commands/i18n.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["commands/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["commands/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,wBAAsB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,iBAkCtE"}
|
package/dist/commands/i18n.js
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
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]="
|
|
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]="cc9ba649-3dd8-541f-b697-dbaabc4d678a")}catch(e){}}();
|
|
3
|
+
import { logger } from '../logging/logger.js';
|
|
3
4
|
import { i18nTask } from '../tasks/i18n.js';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { withTelemetry } from '../telemetry.js';
|
|
6
|
+
import { LocadexManager } from '../utils/locadexManager.js';
|
|
7
|
+
import { displayHeader } from '../logging/console.js';
|
|
8
|
+
import { exit } from '../utils/shutdown.js';
|
|
9
|
+
export async function i18nCommand(options, command) {
|
|
10
|
+
const parentOptions = command.parent?.opts() || {};
|
|
11
|
+
const allOptions = { ...parentOptions, ...options };
|
|
12
|
+
const telemetryEnabled = !allOptions.noTelemetry;
|
|
13
|
+
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
14
|
+
const batchSize = Number(allOptions.batchSize) || 1;
|
|
15
|
+
const concurrency = Number(allOptions.concurrency) || 1;
|
|
16
|
+
if (concurrency < 1 || batchSize < 1) {
|
|
17
|
+
logger.error('Batch size and concurrency must be greater than 0');
|
|
18
|
+
await exit(1);
|
|
19
|
+
}
|
|
20
|
+
displayHeader(telemetryEnabled);
|
|
21
|
+
LocadexManager.initialize({
|
|
22
|
+
mcpTransport: 'sse',
|
|
23
|
+
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
24
|
+
metadata: {},
|
|
25
|
+
cliOptions: allOptions,
|
|
26
|
+
options: {
|
|
27
|
+
...(allOptions.matchingFiles && {
|
|
28
|
+
matchingFiles: allOptions.matchingFiles
|
|
29
|
+
.split(',')
|
|
30
|
+
.map((file) => file.trim()),
|
|
31
|
+
}),
|
|
32
|
+
maxConcurrency: concurrency,
|
|
33
|
+
batchSize,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
await i18nTask();
|
|
37
|
+
});
|
|
6
38
|
}
|
|
7
39
|
//# sourceMappingURL=i18n.js.map
|
|
8
|
-
//# debugId=
|
|
40
|
+
//# debugId=cc9ba649-3dd8-541f-b697-dbaabc4d678a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sources":["commands/i18n.ts"],"sourceRoot":"/","sourcesContent":["import { i18nTask } from '../tasks/i18n.js';\n\nexport async function i18nCommand() {\n await i18nTask();\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"i18n.js","sources":["commands/i18n.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from 'commander';\nimport { logger } from '../logging/logger.js';\nimport { i18nTask } from '../tasks/i18n.js';\nimport { CliOptions } from '../types/cli.js';\nimport { withTelemetry } from '../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport { exit } from '../utils/shutdown.js';\n\nexport async function i18nCommand(options: CliOptions, command: Command) {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n const telemetryEnabled = !allOptions.noTelemetry;\n withTelemetry(\n { enabled: telemetryEnabled, options: allOptions },\n async () => {\n const batchSize = Number(allOptions.batchSize) || 1;\n const concurrency = Number(allOptions.concurrency) || 1;\n\n if (concurrency < 1 || batchSize < 1) {\n logger.error('Batch size and concurrency must be greater than 0');\n await exit(1);\n }\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n mcpTransport: 'sse',\n apiKey: process.env.ANTHROPIC_API_KEY || '',\n metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles\n .split(',')\n .map((file) => file.trim()),\n }),\n maxConcurrency: concurrency,\n batchSize,\n },\n });\n await i18nTask();\n }\n );\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAmB,EA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a"}
|
package/dist/commands/setup.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { CliOptions } from '../types/cli.js';
|
|
3
|
+
export declare function setupCommand(options: CliOptions & {
|
|
4
|
+
packageManager?: string;
|
|
5
|
+
bypassPrompts?: boolean;
|
|
6
|
+
}, command: Command): Promise<void>;
|
|
2
7
|
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,wBAAsB,YAAY,CAChC,OAAO,EAAE,UAAU,GAAG;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,OAAO,EAAE,OAAO,iBAmCjB"}
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
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]="
|
|
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]="0234f3c4-20e5-57b1-95fc-8c874a072c67")}catch(e){}}();
|
|
3
|
+
import { logger } from '../logging/logger.js';
|
|
3
4
|
import { setupTask } from '../tasks/setup.js';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { withTelemetry } from '../telemetry.js';
|
|
6
|
+
import { LocadexManager } from '../utils/locadexManager.js';
|
|
7
|
+
import { displayHeader } from '../logging/console.js';
|
|
8
|
+
import { exit } from '../utils/shutdown.js';
|
|
9
|
+
export async function setupCommand(options, command) {
|
|
10
|
+
const parentOptions = command.parent?.opts() || {};
|
|
11
|
+
const allOptions = { ...parentOptions, ...options };
|
|
12
|
+
const telemetryEnabled = !allOptions.noTelemetry;
|
|
13
|
+
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
14
|
+
const batchSize = Number(allOptions.batchSize) || 1;
|
|
15
|
+
const concurrency = Number(allOptions.concurrency) || 1;
|
|
16
|
+
if (concurrency < 1 || batchSize < 1) {
|
|
17
|
+
logger.error('Batch size and concurrency must be greater than 0');
|
|
18
|
+
await exit(1);
|
|
19
|
+
}
|
|
20
|
+
displayHeader(telemetryEnabled);
|
|
21
|
+
LocadexManager.initialize({
|
|
22
|
+
mcpTransport: 'sse',
|
|
23
|
+
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
24
|
+
metadata: {},
|
|
25
|
+
cliOptions: allOptions,
|
|
26
|
+
options: {
|
|
27
|
+
...(allOptions.matchingFiles && {
|
|
28
|
+
matchingFiles: allOptions.matchingFiles
|
|
29
|
+
.split(',')
|
|
30
|
+
.map((file) => file.trim()),
|
|
31
|
+
}),
|
|
32
|
+
maxConcurrency: concurrency,
|
|
33
|
+
batchSize,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
await setupTask(!!allOptions.bypassPrompts, allOptions.packageManager);
|
|
37
|
+
});
|
|
6
38
|
}
|
|
7
39
|
//# sourceMappingURL=setup.js.map
|
|
8
|
-
//# debugId=
|
|
40
|
+
//# debugId=0234f3c4-20e5-57b1-95fc-8c874a072c67
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sources":["commands/setup.ts"],"sourceRoot":"/","sourcesContent":["import { setupTask } from '../tasks/setup.js';\n\nexport async function setupCommand(\n
|
|
1
|
+
{"version":3,"file":"setup.js","sources":["commands/setup.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from 'commander';\nimport { logger } from '../logging/logger.js';\nimport { setupTask } from '../tasks/setup.js';\nimport { CliOptions } from '../types/cli.js';\nimport { withTelemetry } from '../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport { exit } from '../utils/shutdown.js';\n\nexport async function setupCommand(\n options: CliOptions & {\n packageManager?: string;\n bypassPrompts?: boolean;\n },\n command: Command\n) {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n const telemetryEnabled = !allOptions.noTelemetry;\n withTelemetry(\n { enabled: telemetryEnabled, options: allOptions },\n async () => {\n const batchSize = Number(allOptions.batchSize) || 1;\n const concurrency = Number(allOptions.concurrency) || 1;\n\n if (concurrency < 1 || batchSize < 1) {\n logger.error('Batch size and concurrency must be greater than 0');\n await exit(1);\n }\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n mcpTransport: 'sse',\n apiKey: process.env.ANTHROPIC_API_KEY || '',\n metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles\n .split(',')\n .map((file) => file.trim()),\n }),\n maxConcurrency: concurrency,\n batchSize,\n },\n });\n await setupTask(!!allOptions.bypassPrompts, allOptions.packageManager);\n }\n );\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAA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UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IACzE,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"0234f3c4-20e5-57b1-95fc-8c874a072c67"}
|
package/dist/tasks/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["tasks/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["tasks/i18n.ts"],"names":[],"mappings":"AAqBA,wBAAsB,QAAQ,kBAoS7B"}
|
package/dist/tasks/i18n.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
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]="
|
|
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]="ac943023-bde7-59d5-a4e4-81a08fa08644")}catch(e){}}();
|
|
3
3
|
import { createSpinner } from '../logging/console.js';
|
|
4
4
|
import { allMcpPrompt } from '../prompts/system.js';
|
|
5
5
|
import { exit } from '../utils/shutdown.js';
|
|
6
6
|
import { logger } from '../logging/logger.js';
|
|
7
|
-
import { createDag } from '../utils/dag/createDag.js';
|
|
8
|
-
import { findTsConfig, findWebpackConfig, findRequireConfig, } from '../utils/fs/findConfigs.js';
|
|
9
7
|
import { LocadexManager } from '../utils/locadexManager.js';
|
|
10
8
|
import { addFilesToManager, markFileAsEdited, markFileAsInProgress, } from '../utils/dag/getFiles.js';
|
|
11
9
|
import { outro } from '@clack/prompts';
|
|
@@ -15,11 +13,12 @@ import { validateInitialConfig } from '../utils/config.js';
|
|
|
15
13
|
import { detectFormatter, formatFiles } from 'gtx-cli/hooks/postProcess';
|
|
16
14
|
import { generateSettings } from 'gtx-cli/config/generateSettings';
|
|
17
15
|
import path from 'node:path';
|
|
18
|
-
import {
|
|
19
|
-
import { getChangedFiles, updateLockfile, cleanupLockfile, } from '../utils/lockfile.js';
|
|
16
|
+
import { updateLockfile, cleanupLockfile } from '../utils/lockfile.js';
|
|
20
17
|
import { installClaudeCode } from '../utils/packages/installPackage.js';
|
|
18
|
+
import { extractFiles } from '../utils/dag/extractFiles.js';
|
|
21
19
|
export async function i18nTask() {
|
|
22
20
|
await validateInitialConfig();
|
|
21
|
+
logger.debugMessage('Current working directory: ' + process.cwd());
|
|
23
22
|
const gtSettings = await generateSettings({});
|
|
24
23
|
if (gtSettings.framework !== 'next-app') {
|
|
25
24
|
logger.error('Currently, locadex only supports Next.js App Router. Please use Next.js App Router.');
|
|
@@ -31,42 +30,30 @@ export async function i18nTask() {
|
|
|
31
30
|
const spinner = createSpinner();
|
|
32
31
|
spinner.start('Initializing Locadex...');
|
|
33
32
|
const manager = LocadexManager.getInstance();
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
// Get lockfile path from manager
|
|
37
|
-
const lockfilePath = manager.getLockFilePath();
|
|
38
|
-
// Filter files to only include those with changed content hashes
|
|
39
|
-
const changedFiles = getChangedFiles(allFiles, lockfilePath);
|
|
40
|
-
if (changedFiles.length === 0) {
|
|
33
|
+
const { files, dag } = extractFiles(manager);
|
|
34
|
+
if (files.length === 0) {
|
|
41
35
|
spinner.stop('No files have changed since last run');
|
|
42
36
|
outro(chalk.green('✅ Locadex i18n complete - no changes detected!'));
|
|
43
37
|
await exit(0);
|
|
44
38
|
}
|
|
45
|
-
logger.verboseMessage(`Processing ${changedFiles.length} changed files out of ${allFiles.length} total files`);
|
|
46
|
-
const dag = createDag(changedFiles, {
|
|
47
|
-
tsConfig: findTsConfig(),
|
|
48
|
-
webpackConfig: findWebpackConfig(),
|
|
49
|
-
requireConfig: findRequireConfig(),
|
|
50
|
-
});
|
|
51
39
|
const filesStateFilePath = manager.getFilesStateFilePath();
|
|
52
40
|
const concurrency = manager.getMaxConcurrency();
|
|
53
41
|
const batchSize = manager.getBatchSize();
|
|
54
42
|
// Create the list of files (aka tasks) to process
|
|
55
|
-
const taskQueue =
|
|
56
|
-
const topologicalOrder = [...dag.getTopologicalOrder()];
|
|
43
|
+
const taskQueue = Array.from(files);
|
|
57
44
|
// Add files to manager
|
|
58
45
|
const stateFilePath = addFilesToManager(filesStateFilePath, taskQueue);
|
|
59
46
|
spinner.stop('Locadex initialized');
|
|
60
|
-
logger.verboseMessage(`
|
|
61
|
-
logger.message(`Using ${concurrency} concurrent agents`);
|
|
47
|
+
logger.verboseMessage(`Processing ${files.length} modified files`);
|
|
62
48
|
logger.debugMessage(`Track progress here: ${stateFilePath}`);
|
|
63
49
|
logger.debugMessage(`Order:\n${taskQueue.join('\n')}`);
|
|
50
|
+
logger.message(`Using ${concurrency} concurrent agents`);
|
|
64
51
|
logger.initializeProgressBar(taskQueue.length);
|
|
65
52
|
const fileProcessingStartTime = Date.now();
|
|
66
53
|
logger.progressBar.start(`Processing ${taskQueue.length} files...`);
|
|
67
54
|
// Main parallel processing loop
|
|
68
55
|
let processedCount = 0;
|
|
69
|
-
const
|
|
56
|
+
const agentAbortController = manager.getAgentAbortController();
|
|
70
57
|
let firstError = null;
|
|
71
58
|
// Mutex for task queue access
|
|
72
59
|
let taskQueueMutex = Promise.resolve();
|
|
@@ -82,9 +69,9 @@ export async function i18nTask() {
|
|
|
82
69
|
});
|
|
83
70
|
};
|
|
84
71
|
const processTask = async () => {
|
|
85
|
-
while (taskQueue.length > 0 && !
|
|
72
|
+
while (taskQueue.length > 0 && !agentAbortController.signal.aborted) {
|
|
86
73
|
// Check if we should abort early
|
|
87
|
-
if (
|
|
74
|
+
if (agentAbortController.signal.aborted) {
|
|
88
75
|
return;
|
|
89
76
|
}
|
|
90
77
|
// Get an available agent atomically
|
|
@@ -93,7 +80,7 @@ export async function i18nTask() {
|
|
|
93
80
|
// No available agents, wait a bit (but check for abort)
|
|
94
81
|
await new Promise((resolve) => {
|
|
95
82
|
const timeout = global.setTimeout(resolve, 100);
|
|
96
|
-
|
|
83
|
+
agentAbortController.signal.addEventListener('abort', () => {
|
|
97
84
|
global.clearTimeout(timeout);
|
|
98
85
|
resolve(undefined);
|
|
99
86
|
});
|
|
@@ -134,20 +121,22 @@ export async function i18nTask() {
|
|
|
134
121
|
manager.markAgentFree(agentId);
|
|
135
122
|
}
|
|
136
123
|
catch (error) {
|
|
124
|
+
// Check if this is an abort
|
|
125
|
+
if (agentAbortController.signal.aborted) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
137
128
|
// Capture the first error and signal all other agents to abort
|
|
138
129
|
if (!firstError) {
|
|
139
|
-
firstError = new Error(`
|
|
130
|
+
firstError = new Error(`Error in claude i18n process (${agentId}): ${error}`);
|
|
140
131
|
logger.debugMessage(firstError.message);
|
|
141
|
-
abortController.abort();
|
|
142
|
-
manager.cleanupAgents();
|
|
143
132
|
}
|
|
144
|
-
|
|
145
|
-
return;
|
|
133
|
+
await exit(1); // Exit this agent's processing immediately
|
|
134
|
+
return;
|
|
146
135
|
}
|
|
147
136
|
// Mark tasks as complete
|
|
148
137
|
await Promise.all(tasks.map((task) => markFileAsEdited(task, filesStateFilePath)));
|
|
149
138
|
processedCount += tasks.length;
|
|
150
|
-
logger.progressBar.advance(tasks.length, `Processed ${Number((processedCount /
|
|
139
|
+
logger.progressBar.advance(tasks.length, `Processed ${Number((processedCount / files.length) * 100).toFixed(2)}% of files`);
|
|
151
140
|
manager.stats.updateStats({
|
|
152
141
|
newProcessedFiles: tasks.length,
|
|
153
142
|
});
|
|
@@ -161,20 +150,23 @@ export async function i18nTask() {
|
|
|
161
150
|
await Promise.all(processingPromises);
|
|
162
151
|
}
|
|
163
152
|
catch (error) {
|
|
153
|
+
// Check if this is an abort
|
|
154
|
+
if (agentAbortController.signal.aborted) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
164
157
|
// This shouldn't happen since we handle errors within processTask
|
|
165
|
-
logger.debugMessage(`
|
|
158
|
+
logger.debugMessage(`Unexpected error in parallel processing: ${error}`);
|
|
166
159
|
if (!firstError) {
|
|
167
160
|
firstError = new Error(`Unexpected error in parallel processing: ${error}`);
|
|
168
161
|
}
|
|
169
162
|
}
|
|
170
|
-
logger.progressBar.stop(`Processed ${
|
|
163
|
+
logger.progressBar.stop(`Processed ${files.length} files [${Math.round((Date.now() - fileProcessingStartTime) / 1000)}s]`);
|
|
171
164
|
// TODO: uncomment
|
|
172
165
|
// // Always clean up the file list when done, regardless of success or failure
|
|
173
166
|
// logger.info(`Cleaning up file list: ${stateFilePath}`);
|
|
174
167
|
// cleanUp(stateFilePath);
|
|
175
168
|
// If there was an error, clean up and exit with code 1
|
|
176
169
|
if (firstError) {
|
|
177
|
-
manager.cleanupAgents();
|
|
178
170
|
logger.error(firstError.message);
|
|
179
171
|
outro(chalk.red('❌ Locadex i18n failed!'));
|
|
180
172
|
await exit(1);
|
|
@@ -189,7 +181,10 @@ export async function i18nTask() {
|
|
|
189
181
|
reports.push(`## Fixed errors\n${cleanupAgent.generateReport()}`);
|
|
190
182
|
}
|
|
191
183
|
catch (error) {
|
|
192
|
-
|
|
184
|
+
// Check if this is an abort
|
|
185
|
+
if (agentAbortController.signal.aborted) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
193
188
|
logger.debugMessage(`[claude_cleanup_agent] Fixing errors failed: ${error}`);
|
|
194
189
|
manager.stats.recordTelemetry(false);
|
|
195
190
|
outro(chalk.red('❌ Locadex i18n failed!'));
|
|
@@ -205,15 +200,14 @@ ${reports.join('\n')}`;
|
|
|
205
200
|
// cleanup
|
|
206
201
|
const formatter = await detectFormatter();
|
|
207
202
|
if (formatter) {
|
|
208
|
-
await formatFiles(
|
|
203
|
+
await formatFiles(files, formatter);
|
|
209
204
|
}
|
|
205
|
+
const lockfilePath = manager.getLockFilePath();
|
|
210
206
|
// Update lockfile with processed files
|
|
211
|
-
updateLockfile(
|
|
207
|
+
updateLockfile(files, lockfilePath);
|
|
212
208
|
// Clean up stale entries from lockfile
|
|
213
|
-
cleanupLockfile(
|
|
214
|
-
logger.message(`Updated lockfile with ${
|
|
215
|
-
// Clean up after successful completion
|
|
216
|
-
manager.cleanup();
|
|
209
|
+
cleanupLockfile(files, lockfilePath);
|
|
210
|
+
logger.message(chalk.dim(`Updated lockfile with ${files.length} files`));
|
|
217
211
|
logger.info(chalk.dim(`Total Cost: $${manager.stats.getStats().totalCost.toFixed(2)}
|
|
218
212
|
Total wall time: ${Math.round((Date.now() - manager.stats.getStats().startTime) / 1000)}s
|
|
219
213
|
Total files processed: ${manager.stats.getStats().processedFiles}`));
|
|
@@ -333,4 +327,4 @@ ${allMcpPrompt}
|
|
|
333
327
|
return prompt;
|
|
334
328
|
}
|
|
335
329
|
//# sourceMappingURL=i18n.js.map
|
|
336
|
-
//# debugId=
|
|
330
|
+
//# debugId=ac943023-bde7-59d5-a4e4-81a08fa08644
|
package/dist/tasks/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sources":["tasks/i18n.ts"],"sourceRoot":"/","sourcesContent":["import { createSpinner } from '../logging/console.js';\nimport { allMcpPrompt } from '../prompts/system.js';\nimport { exit } from '../utils/shutdown.js';\n\nimport { logger } from '../logging/logger.js';\nimport { createDag } from '../utils/dag/createDag.js';\nimport {\n findTsConfig,\n findWebpackConfig,\n findRequireConfig,\n} from '../utils/fs/findConfigs.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport {\n addFilesToManager,\n markFileAsEdited,\n markFileAsInProgress,\n} from '../utils/dag/getFiles.js';\nimport { outro } from '@clack/prompts';\nimport chalk from 'chalk';\nimport { appendFileSync } from 'node:fs';\nimport { validateInitialConfig } from '../utils/config.js';\nimport { detectFormatter, formatFiles } from 'gtx-cli/hooks/postProcess';\nimport { generateSettings } from 'gtx-cli/config/generateSettings';\nimport path from 'node:path';\nimport { findSourceFiles } from '../utils/dag/matchFiles.js';\nimport {\n getChangedFiles,\n updateLockfile,\n cleanupLockfile,\n} from '../utils/lockfile.js';\nimport { installClaudeCode } from '../utils/packages/installPackage.js';\n\nexport async function i18nTask() {\n await validateInitialConfig();\n\n const gtSettings = await generateSettings({});\n if (gtSettings.framework !== 'next-app') {\n logger.error(\n 'Currently, locadex only supports Next.js App Router. Please use Next.js App Router.'\n );\n await exit(1);\n }\n\n // Install claude-code if not installed\n await installClaudeCode();\n\n // Init message\n const spinner = createSpinner();\n spinner.start('Initializing Locadex...');\n const manager = LocadexManager.getInstance();\n\n const config = manager.getConfig();\n\n const allFiles = findSourceFiles(\n config.matchingFiles,\n config.matchingExtensions\n );\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(allFiles, lockfilePath);\n\n if (changedFiles.length === 0) {\n spinner.stop('No files have changed since last run');\n outro(chalk.green('✅ Locadex i18n complete - no changes detected!'));\n await exit(0);\n }\n\n logger.verboseMessage(\n `Processing ${changedFiles.length} changed files out of ${allFiles.length} total files`\n );\n\n const dag = createDag(changedFiles, {\n tsConfig: findTsConfig(),\n webpackConfig: findWebpackConfig(),\n requireConfig: findRequireConfig(),\n });\n\n const filesStateFilePath = manager.getFilesStateFilePath();\n const concurrency = manager.getMaxConcurrency();\n const batchSize = manager.getBatchSize();\n\n // Create the list of files (aka tasks) to process\n const taskQueue = [...dag.getTopologicalOrder()];\n const topologicalOrder = [...dag.getTopologicalOrder()];\n\n // Add files to manager\n const stateFilePath = addFilesToManager(filesStateFilePath, taskQueue);\n spinner.stop('Locadex initialized');\n\n logger.verboseMessage(\n `Number of files to process: ${dag.getTopologicalOrder().length}`\n );\n logger.message(`Using ${concurrency} concurrent agents`);\n logger.debugMessage(`Track progress here: ${stateFilePath}`);\n logger.debugMessage(`Order:\\n${taskQueue.join('\\n')}`);\n\n logger.initializeProgressBar(taskQueue.length);\n\n const fileProcessingStartTime = Date.now();\n logger.progressBar.start(`Processing ${taskQueue.length} files...`);\n\n // Main parallel processing loop\n let processedCount = 0;\n const abortController = new AbortController();\n let firstError: Error | null = null;\n\n // Mutex for task queue access\n let taskQueueMutex = Promise.resolve();\n\n // Shared across all agents\n const reports: string[] = [];\n\n // Helper function to safely get tasks from queue\n const getNextTasks = async (batchSize: number): Promise<string[]> => {\n return new Promise((resolve) => {\n taskQueueMutex = taskQueueMutex.then(() => {\n const tasks = taskQueue.splice(0, batchSize);\n resolve(tasks);\n });\n });\n };\n\n const processTask = async (): Promise<void> => {\n while (taskQueue.length > 0 && !abortController.signal.aborted) {\n // Check if we should abort early\n if (abortController.signal.aborted) {\n return;\n }\n\n // Get an available agent atomically\n const agentInfo = await manager.getAvailableAgent();\n if (!agentInfo) {\n // No available agents, wait a bit (but check for abort)\n await new Promise((resolve) => {\n const timeout = global.setTimeout(resolve, 100);\n abortController.signal.addEventListener('abort', () => {\n global.clearTimeout(timeout);\n resolve(undefined);\n });\n });\n continue;\n }\n\n const { id: agentId, agent, sessionId } = agentInfo;\n\n // Get the next batch of tasks (thread-safe)\n const tasks = await getNextTasks(batchSize);\n if (tasks.length === 0) {\n manager.markAgentFree(agentId);\n break;\n }\n\n logger.debugMessage(\n `Using agent ${agentId} for ${batchSize} files. Files: ${tasks.join(\n ', '\n )}`\n );\n\n // Mark tasks as in progress\n await Promise.all(\n tasks.map((task) => markFileAsInProgress(task, filesStateFilePath))\n );\n\n // Construct prompt\n const dependencies = Object.fromEntries(\n tasks.map((task) => [\n task,\n Array.from(new Set(dag.getDependencies(task))),\n ])\n );\n const dependents = Object.fromEntries(\n tasks.map((task) => [\n task,\n Array.from(new Set(dag.getDependents(task))),\n ])\n );\n const prompt = getPrompt({\n targetFile: tasks,\n dependencyFiles: dependencies,\n dependentFiles: dependents,\n });\n\n // Claude call\n try {\n await agent.run(\n {\n prompt,\n sessionId,\n },\n {}\n );\n reports.push(agent.generateReport());\n manager.markAgentFree(agentId);\n } catch (error) {\n // Capture the first error and signal all other agents to abort\n if (!firstError) {\n firstError = new Error(\n `[i18n] Error in claude i18n process (agent ${agentId}): ${error}`\n );\n logger.debugMessage(firstError.message);\n abortController.abort();\n manager.cleanupAgents();\n }\n manager.markAgentFree(agentId);\n return; // Exit this agent's processing immediately\n }\n\n // Mark tasks as complete\n await Promise.all(\n tasks.map((task) => markFileAsEdited(task, filesStateFilePath))\n );\n processedCount += tasks.length;\n logger.progressBar.advance(\n tasks.length,\n `Processed ${Number((processedCount / topologicalOrder.length) * 100).toFixed(2)}% of files`\n );\n manager.stats.updateStats({\n newProcessedFiles: tasks.length,\n });\n }\n };\n\n // Create agent pool\n manager.createAgentPool();\n\n // Start parallel processing\n const processingPromises = Array.from({ length: concurrency }, () =>\n processTask()\n );\n\n try {\n await Promise.all(processingPromises);\n } catch (error) {\n // This shouldn't happen since we handle errors within processTask\n logger.debugMessage(\n `[i18n] Unexpected error in parallel processing: ${error}`\n );\n if (!firstError) {\n firstError = new Error(\n `Unexpected error in parallel processing: ${error}`\n );\n }\n }\n\n logger.progressBar.stop(\n `Processed ${topologicalOrder.length} files [${Math.round(\n (Date.now() - fileProcessingStartTime) / 1000\n )}s]`\n );\n\n // TODO: uncomment\n // // Always clean up the file list when done, regardless of success or failure\n // logger.info(`Cleaning up file list: ${stateFilePath}`);\n // cleanUp(stateFilePath);\n\n // If there was an error, clean up and exit with code 1\n if (firstError) {\n manager.cleanupAgents();\n logger.error(firstError.message);\n outro(chalk.red('❌ Locadex i18n failed!'));\n await exit(1);\n }\n\n // Create a clean agent for cleanup\n const cleanupAgent = manager.createSingleAgent('claude_cleanup_agent');\n logger.initializeSpinner();\n logger.spinner.start('Fixing errors...');\n const fixPrompt = getFixPrompt();\n try {\n await cleanupAgent.run(\n { prompt: fixPrompt, sessionId: cleanupAgent.getSessionId() },\n {}\n );\n reports.push(`## Fixed errors\\n${cleanupAgent.generateReport()}`);\n } catch (error) {\n manager.cleanupAgents();\n logger.debugMessage(\n `[claude_cleanup_agent] Fixing errors failed: ${error}`\n );\n manager.stats.recordTelemetry(false);\n outro(chalk.red('❌ Locadex i18n failed!'));\n await exit(1);\n }\n logger.spinner.stop('Fixed errors');\n\n // Generate report\n const reportSummary = `# Summary of locadex i18n changes\n${reports.join('\\n')}`;\n const summaryFilePath = path.join(\n manager.getWorkingDir(),\n 'locadex-report.md'\n );\n appendFileSync(summaryFilePath, reportSummary);\n logger.step(`Saved summary of changes to: ${summaryFilePath}`);\n\n // cleanup\n\n const formatter = await detectFormatter();\n if (formatter) {\n await formatFiles(topologicalOrder, formatter);\n }\n\n // Update lockfile with processed files\n updateLockfile(changedFiles, lockfilePath);\n\n // Clean up stale entries from lockfile\n cleanupLockfile(allFiles, lockfilePath);\n\n logger.message(`Updated lockfile with ${changedFiles.length} files`);\n\n // Clean up after successful completion\n manager.cleanup();\n\n logger.info(\n chalk.dim(\n `Total Cost: $${manager.stats.getStats().totalCost.toFixed(2)}\nTotal wall time: ${Math.round(\n (Date.now() - manager.stats.getStats().startTime) / 1000\n )}s\nTotal files processed: ${manager.stats.getStats().processedFiles}`\n )\n );\n\n const finalStats = manager.stats.getStats();\n\n // Record telemetry for final stats\n manager.stats.recordTelemetry(true);\n\n logger.verboseMessage(\n `Total input tokens: ${finalStats.inputTokens}\nTotal cached input tokens: ${finalStats.cachedInputTokens}\nTotal output tokens: ${finalStats.outputTokens}\nTotal turns: ${finalStats.turns}`\n );\n\n outro(chalk.green('✅ Locadex i18n complete!'));\n await exit(0);\n}\n\nfunction getPrompt({\n targetFile,\n dependencyFiles,\n dependentFiles,\n}: {\n targetFile: string[];\n dependencyFiles: Record<string, string[]>;\n dependentFiles: Record<string, string[]>;\n}) {\n const prompt = `# Task: Internationalize the target file(s) using gt-next.\n\n## INSTRUCTIONS\n\n- You are given a list of target files and their corresponding dependency/dependent files.\n- The project is already setup for internationalization. Do not try to setup the project again for i18n.\n\n## Workflow:\n1. **Gather context** Read the target files closely (you should not have to read the dependency/dependent files).\n2. **Evaluate if i18n is necessary** Evaluate if the target files need to be internationalized using gt-next \n - If the target files have no relevant content, are already internationalized, or contain build-time code (e.g. nextjs plugins) they should never be internationalized.\n**IMPORTANT**: IF NONE OF THE TARGET FILES NEED TO BE INTERNATIONALIZED, YOUR TASK IS COMPLETE AND YOU MAY RETURN.\n3. **Identify the tools to use** Given the contents of the files, ask yourself which tools and guides you need to use to get the necessary knowledge to internationalize the target files. Here are some helpful questions to evaluate for tool selection:\n - 3.a. Does this file contain a component? If so, is it a server-side component or a client-side component?\n - 3.b. Is the content that needs to be i18ned being used in this same file, or is it being used in another file?\n - 3.c. Is there any string interpolation that needs to be i18ned?\n - 3.d. Is there any conditional logic or rendering that needs to be i18ned?\n - 3.e. Is the content that needs to be i18ned HTML/JSX or a string?\n4. **Internationalize** You now have the necessary knowledge. Internationalize the files using the information from the tools provided to you.\n - 4.a. Do not worry about running tsc. We will do that later.\n\n## RULES:\n- ALWAYS use the <T> component to internationalize HTML/JSX content.\n- ALWAYS use getGT() or useGT() and getDict() or useDict() to internationalize string content (strings created with '', \"\", or \\`\\`).\n - When possible, avoid using getDict() or useDict(); getGT() and useGT() are preferred.\n- DO NOT internationalize non-user facing content or content that is functional, such as ids, class names, error strings, logical strings, etc.\n- Do not add i18n middleware to the app.\n- When adding 'useGT()' or 'useDict()' to a client component, you must add 'use client' to the top of the file.\n- Always adhere to the guides provided via the 'mcp__locadex__' tools.\n - These guides provide additional knowledge about how to internationalize the content.\n- Minimize the footprint of your changes.\n- Focus on internationalizing the content of the target files.\n- NEVER move internationalized content to a different file. All content MUST remain in the same file where it came from.\n- NEVER CREATE OR REMOVE ANY FILES (especially .bak files)\n- Internationalize all user facing content in the target files. \n- NEVER EDIT FILES THAT ARE NOT GIVEN TO YOU.\n\n## TARGET FILE INFORMATION\n${targetFile.map(\n (file, index) => `\nTARGET FILE ${index + 1}:\n${file}\n\nDEPENDENCY FILES (files imported by target file ${index + 1}):\n${dependencyFiles[file].length > 0 ? ` ${dependencyFiles[file].join(', ')}` : 'none'}\n\nDEPENDENT FILES (files that import target file ${index + 1}):\n${dependentFiles[file].length > 0 ? ` ${dependentFiles[file].join(', ')}` : 'none'}\n`\n)}\n\n---\n\n## MCP TOOLS\n\n${allMcpPrompt}\n\n## Final output\n- When you are done, please return a brief summary of the files you modified, following this format.\n- **DO NOT** include any other text in your response. \n- If there were issues with some files, please include the issues in the list of changes for that file.\n\n[file 1 path]\n- List of changes to file 1\n`;\n\n return prompt;\n}\n\n// check (dry run and ts check) should be at the end\n\nfunction getFixPrompt() {\n const prompt = `# Task: Fix internationalization errors in the project.\n\n## INSTRUCTIONS\n\nPreviously, you helped me internationalize a set of files in this project.\nYour new task is as follows:\n\n1. Run the gt-next validator.\n2. Fix all errors output by the gt-next validator.\n3. Whenever you are finished with your changes, run the gt-next validator.\n4. Repeat steps 1-3 until there are no more errors, or until you believe that you have fixed all errors.\n5. If the project is setup with linting, lint the project and fix all lint errors.\n\n## RULES:\n- ONLY modify files that are relevant to the internationalization of the project.\n- ONLY fix errors that result from your current or previous implementation.\n- Resolve unused imports from 'gt-next'. \n - In particular, if a file contains user-facing content that should be internationalized and is not, you should internationalize it.\n- Resolve missing imports from 'gt-next'. If a file is missing an import from 'gt-next', add it.\n\nTo run the gt-next validator, run the following command:\n'npx locadex translate --dry-run'\n\n## MCP TOOLS\n\n${allMcpPrompt}\n\n## Final output\n- When you are done, please return a brief summary of the files you modified, following this format.\n- **DO NOT** include any other text in your response. \n- If there were issues with some files, please include the issues in the list of changes for that file.\n\n[file 1 path]\n- List of changes to file 1\n`;\n\n return prompt;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MA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","sources":["tasks/i18n.ts"],"sourceRoot":"/","sourcesContent":["import { createSpinner } from '../logging/console.js';\nimport { allMcpPrompt } from '../prompts/system.js';\nimport { exit } from '../utils/shutdown.js';\nimport { logger } from '../logging/logger.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport {\n addFilesToManager,\n markFileAsEdited,\n markFileAsInProgress,\n} from '../utils/dag/getFiles.js';\nimport { outro } from '@clack/prompts';\nimport chalk from 'chalk';\nimport { appendFileSync } from 'node:fs';\nimport { validateInitialConfig } from '../utils/config.js';\nimport { detectFormatter, formatFiles } from 'gtx-cli/hooks/postProcess';\nimport { generateSettings } from 'gtx-cli/config/generateSettings';\nimport path from 'node:path';\nimport { updateLockfile, cleanupLockfile } from '../utils/lockfile.js';\nimport { installClaudeCode } from '../utils/packages/installPackage.js';\nimport { extractFiles } from '../utils/dag/extractFiles.js';\n\nexport async function i18nTask() {\n await validateInitialConfig();\n\n logger.debugMessage('Current working directory: ' + process.cwd());\n const gtSettings = await generateSettings({});\n if (gtSettings.framework !== 'next-app') {\n logger.error(\n 'Currently, locadex only supports Next.js App Router. Please use Next.js App Router.'\n );\n await exit(1);\n }\n\n // Install claude-code if not installed\n await installClaudeCode();\n\n // Init message\n const spinner = createSpinner();\n spinner.start('Initializing Locadex...');\n\n const manager = LocadexManager.getInstance();\n\n const { files, dag } = extractFiles(manager);\n\n if (files.length === 0) {\n spinner.stop('No files have changed since last run');\n outro(chalk.green('✅ Locadex i18n complete - no changes detected!'));\n await exit(0);\n }\n\n const filesStateFilePath = manager.getFilesStateFilePath();\n const concurrency = manager.getMaxConcurrency();\n const batchSize = manager.getBatchSize();\n\n // Create the list of files (aka tasks) to process\n const taskQueue = Array.from(files);\n\n // Add files to manager\n const stateFilePath = addFilesToManager(filesStateFilePath, taskQueue);\n spinner.stop('Locadex initialized');\n\n logger.verboseMessage(`Processing ${files.length} modified files`);\n logger.debugMessage(`Track progress here: ${stateFilePath}`);\n logger.debugMessage(`Order:\\n${taskQueue.join('\\n')}`);\n\n logger.message(`Using ${concurrency} concurrent agents`);\n logger.initializeProgressBar(taskQueue.length);\n\n const fileProcessingStartTime = Date.now();\n logger.progressBar.start(`Processing ${taskQueue.length} files...`);\n\n // Main parallel processing loop\n let processedCount = 0;\n const agentAbortController = manager.getAgentAbortController();\n let firstError: Error | null = null;\n\n // Mutex for task queue access\n let taskQueueMutex = Promise.resolve();\n\n // Shared across all agents\n const reports: string[] = [];\n\n // Helper function to safely get tasks from queue\n const getNextTasks = async (batchSize: number): Promise<string[]> => {\n return new Promise((resolve) => {\n taskQueueMutex = taskQueueMutex.then(() => {\n const tasks = taskQueue.splice(0, batchSize);\n resolve(tasks);\n });\n });\n };\n\n const processTask = async (): Promise<void> => {\n while (taskQueue.length > 0 && !agentAbortController.signal.aborted) {\n // Check if we should abort early\n if (agentAbortController.signal.aborted) {\n return;\n }\n\n // Get an available agent atomically\n const agentInfo = await manager.getAvailableAgent();\n if (!agentInfo) {\n // No available agents, wait a bit (but check for abort)\n await new Promise((resolve) => {\n const timeout = global.setTimeout(resolve, 100);\n agentAbortController.signal.addEventListener('abort', () => {\n global.clearTimeout(timeout);\n resolve(undefined);\n });\n });\n continue;\n }\n\n const { id: agentId, agent, sessionId } = agentInfo;\n\n // Get the next batch of tasks (thread-safe)\n const tasks = await getNextTasks(batchSize);\n if (tasks.length === 0) {\n manager.markAgentFree(agentId);\n break;\n }\n\n logger.debugMessage(\n `Using agent ${agentId} for ${batchSize} files. Files: ${tasks.join(\n ', '\n )}`\n );\n\n // Mark tasks as in progress\n await Promise.all(\n tasks.map((task) => markFileAsInProgress(task, filesStateFilePath))\n );\n\n // Construct prompt\n const dependencies = Object.fromEntries(\n tasks.map((task) => [\n task,\n Array.from(new Set(dag.getDependencies(task))),\n ])\n );\n const dependents = Object.fromEntries(\n tasks.map((task) => [\n task,\n Array.from(new Set(dag.getDependents(task))),\n ])\n );\n const prompt = getPrompt({\n targetFile: tasks,\n dependencyFiles: dependencies,\n dependentFiles: dependents,\n });\n\n // Claude call\n try {\n await agent.run(\n {\n prompt,\n sessionId,\n },\n {}\n );\n reports.push(agent.generateReport());\n manager.markAgentFree(agentId);\n } catch (error) {\n // Check if this is an abort\n if (agentAbortController.signal.aborted) {\n return;\n }\n\n // Capture the first error and signal all other agents to abort\n if (!firstError) {\n firstError = new Error(\n `Error in claude i18n process (${agentId}): ${error}`\n );\n logger.debugMessage(firstError.message);\n }\n await exit(1); // Exit this agent's processing immediately\n return;\n }\n\n // Mark tasks as complete\n await Promise.all(\n tasks.map((task) => markFileAsEdited(task, filesStateFilePath))\n );\n processedCount += tasks.length;\n logger.progressBar.advance(\n tasks.length,\n `Processed ${Number((processedCount / files.length) * 100).toFixed(2)}% of files`\n );\n manager.stats.updateStats({\n newProcessedFiles: tasks.length,\n });\n }\n };\n\n // Create agent pool\n manager.createAgentPool();\n\n // Start parallel processing\n const processingPromises = Array.from({ length: concurrency }, () =>\n processTask()\n );\n\n try {\n await Promise.all(processingPromises);\n } catch (error) {\n // Check if this is an abort\n if (agentAbortController.signal.aborted) {\n return;\n }\n\n // This shouldn't happen since we handle errors within processTask\n logger.debugMessage(`Unexpected error in parallel processing: ${error}`);\n if (!firstError) {\n firstError = new Error(\n `Unexpected error in parallel processing: ${error}`\n );\n }\n }\n\n logger.progressBar.stop(\n `Processed ${files.length} files [${Math.round(\n (Date.now() - fileProcessingStartTime) / 1000\n )}s]`\n );\n\n // TODO: uncomment\n // // Always clean up the file list when done, regardless of success or failure\n // logger.info(`Cleaning up file list: ${stateFilePath}`);\n // cleanUp(stateFilePath);\n\n // If there was an error, clean up and exit with code 1\n if (firstError) {\n logger.error(firstError.message);\n outro(chalk.red('❌ Locadex i18n failed!'));\n await exit(1);\n }\n\n // Create a clean agent for cleanup\n const cleanupAgent = manager.createSingleAgent('claude_cleanup_agent');\n logger.initializeSpinner();\n logger.spinner.start('Fixing errors...');\n const fixPrompt = getFixPrompt();\n try {\n await cleanupAgent.run(\n { prompt: fixPrompt, sessionId: cleanupAgent.getSessionId() },\n {}\n );\n reports.push(`## Fixed errors\\n${cleanupAgent.generateReport()}`);\n } catch (error) {\n // Check if this is an abort\n if (agentAbortController.signal.aborted) {\n return;\n }\n logger.debugMessage(\n `[claude_cleanup_agent] Fixing errors failed: ${error}`\n );\n manager.stats.recordTelemetry(false);\n outro(chalk.red('❌ Locadex i18n failed!'));\n await exit(1);\n }\n logger.spinner.stop('Fixed errors');\n\n // Generate report\n const reportSummary = `# Summary of locadex i18n changes\n${reports.join('\\n')}`;\n const summaryFilePath = path.join(\n manager.getWorkingDir(),\n 'locadex-report.md'\n );\n appendFileSync(summaryFilePath, reportSummary);\n logger.step(`Saved summary of changes to: ${summaryFilePath}`);\n\n // cleanup\n const formatter = await detectFormatter();\n if (formatter) {\n await formatFiles(files, formatter);\n }\n\n const lockfilePath = manager.getLockFilePath();\n\n // Update lockfile with processed files\n updateLockfile(files, lockfilePath);\n\n // Clean up stale entries from lockfile\n cleanupLockfile(files, lockfilePath);\n\n logger.message(chalk.dim(`Updated lockfile with ${files.length} files`));\n\n logger.info(\n chalk.dim(\n `Total Cost: $${manager.stats.getStats().totalCost.toFixed(2)}\nTotal wall time: ${Math.round(\n (Date.now() - manager.stats.getStats().startTime) / 1000\n )}s\nTotal files processed: ${manager.stats.getStats().processedFiles}`\n )\n );\n\n const finalStats = manager.stats.getStats();\n\n // Record telemetry for final stats\n manager.stats.recordTelemetry(true);\n\n logger.verboseMessage(\n `Total input tokens: ${finalStats.inputTokens}\nTotal cached input tokens: ${finalStats.cachedInputTokens}\nTotal output tokens: ${finalStats.outputTokens}\nTotal turns: ${finalStats.turns}`\n );\n\n outro(chalk.green('✅ Locadex i18n complete!'));\n await exit(0);\n}\n\nfunction getPrompt({\n targetFile,\n dependencyFiles,\n dependentFiles,\n}: {\n targetFile: string[];\n dependencyFiles: Record<string, string[]>;\n dependentFiles: Record<string, string[]>;\n}) {\n const prompt = `# Task: Internationalize the target file(s) using gt-next.\n\n## INSTRUCTIONS\n\n- You are given a list of target files and their corresponding dependency/dependent files.\n- The project is already setup for internationalization. Do not try to setup the project again for i18n.\n\n## Workflow:\n1. **Gather context** Read the target files closely (you should not have to read the dependency/dependent files).\n2. **Evaluate if i18n is necessary** Evaluate if the target files need to be internationalized using gt-next \n - If the target files have no relevant content, are already internationalized, or contain build-time code (e.g. nextjs plugins) they should never be internationalized.\n**IMPORTANT**: IF NONE OF THE TARGET FILES NEED TO BE INTERNATIONALIZED, YOUR TASK IS COMPLETE AND YOU MAY RETURN.\n3. **Identify the tools to use** Given the contents of the files, ask yourself which tools and guides you need to use to get the necessary knowledge to internationalize the target files. Here are some helpful questions to evaluate for tool selection:\n - 3.a. Does this file contain a component? If so, is it a server-side component or a client-side component?\n - 3.b. Is the content that needs to be i18ned being used in this same file, or is it being used in another file?\n - 3.c. Is there any string interpolation that needs to be i18ned?\n - 3.d. Is there any conditional logic or rendering that needs to be i18ned?\n - 3.e. Is the content that needs to be i18ned HTML/JSX or a string?\n4. **Internationalize** You now have the necessary knowledge. Internationalize the files using the information from the tools provided to you.\n - 4.a. Do not worry about running tsc. We will do that later.\n\n## RULES:\n- ALWAYS use the <T> component to internationalize HTML/JSX content.\n- ALWAYS use getGT() or useGT() and getDict() or useDict() to internationalize string content (strings created with '', \"\", or \\`\\`).\n - When possible, avoid using getDict() or useDict(); getGT() and useGT() are preferred.\n- DO NOT internationalize non-user facing content or content that is functional, such as ids, class names, error strings, logical strings, etc.\n- Do not add i18n middleware to the app.\n- When adding 'useGT()' or 'useDict()' to a client component, you must add 'use client' to the top of the file.\n- Always adhere to the guides provided via the 'mcp__locadex__' tools.\n - These guides provide additional knowledge about how to internationalize the content.\n- Minimize the footprint of your changes.\n- Focus on internationalizing the content of the target files.\n- NEVER move internationalized content to a different file. All content MUST remain in the same file where it came from.\n- NEVER CREATE OR REMOVE ANY FILES (especially .bak files)\n- Internationalize all user facing content in the target files. \n- NEVER EDIT FILES THAT ARE NOT GIVEN TO YOU.\n\n## TARGET FILE INFORMATION\n${targetFile.map(\n (file, index) => `\nTARGET FILE ${index + 1}:\n${file}\n\nDEPENDENCY FILES (files imported by target file ${index + 1}):\n${dependencyFiles[file].length > 0 ? ` ${dependencyFiles[file].join(', ')}` : 'none'}\n\nDEPENDENT FILES (files that import target file ${index + 1}):\n${dependentFiles[file].length > 0 ? ` ${dependentFiles[file].join(', ')}` : 'none'}\n`\n)}\n\n---\n\n## MCP TOOLS\n\n${allMcpPrompt}\n\n## Final output\n- When you are done, please return a brief summary of the files you modified, following this format.\n- **DO NOT** include any other text in your response. \n- If there were issues with some files, please include the issues in the list of changes for that file.\n\n[file 1 path]\n- List of changes to file 1\n`;\n\n return prompt;\n}\n\n// check (dry run and ts check) should be at the end\n\nfunction getFixPrompt() {\n const prompt = `# Task: Fix internationalization errors in the project.\n\n## INSTRUCTIONS\n\nPreviously, you helped me internationalize a set of files in this project.\nYour new task is as follows:\n\n1. Run the gt-next validator.\n2. Fix all errors output by the gt-next validator.\n3. Whenever you are finished with your changes, run the gt-next validator.\n4. Repeat steps 1-3 until there are no more errors, or until you believe that you have fixed all errors.\n5. If the project is setup with linting, lint the project and fix all lint errors.\n\n## RULES:\n- ONLY modify files that are relevant to the internationalization of the project.\n- ONLY fix errors that result from your current or previous implementation.\n- Resolve unused imports from 'gt-next'. \n - In particular, if a file contains user-facing content that should be internationalized and is not, you should internationalize it.\n- Resolve missing imports from 'gt-next'. If a file is missing an import from 'gt-next', add it.\n\nTo run the gt-next validator, run the following command:\n'npx locadex translate --dry-run'\n\n## MCP TOOLS\n\n${allMcpPrompt}\n\n## Final output\n- When you are done, please return a brief summary of the files you modified, following this format.\n- **DO NOT** include any other text in your response. \n- If there were issues with some files, please include the issues in the list of changes for that file.\n\n[file 1 path]\n- List of changes to file 1\n`;\n\n return prompt;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,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