locadex 0.1.7 → 0.1.9

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cli.js +11 -8
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/fixErrors.js +1 -1
  5. package/dist/commands/fixErrors.js.map +1 -1
  6. package/dist/commands/i18n.js +2 -2
  7. package/dist/commands/i18n.js.map +1 -1
  8. package/dist/commands/setup.d.ts +4 -0
  9. package/dist/commands/setup.d.ts.map +1 -1
  10. package/dist/commands/setup.js +36 -2
  11. package/dist/commands/setup.js.map +1 -1
  12. package/dist/logging/console.d.ts.map +1 -1
  13. package/dist/logging/console.js +2 -1
  14. package/dist/logging/console.js.map +1 -1
  15. package/dist/mcp-stdio.d.ts +3 -0
  16. package/dist/mcp-stdio.d.ts.map +1 -0
  17. package/dist/mcp-stdio.js +36 -0
  18. package/dist/mcp-stdio.js.map +1 -0
  19. package/dist/tasks/fixErrors.js +4 -1
  20. package/dist/tasks/fixErrors.js.map +1 -1
  21. package/dist/tasks/i18n.d.ts +6 -1
  22. package/dist/tasks/i18n.d.ts.map +1 -1
  23. package/dist/tasks/i18n.js +22 -13
  24. package/dist/tasks/i18n.js.map +1 -1
  25. package/dist/tasks/setup.d.ts +7 -1
  26. package/dist/tasks/setup.d.ts.map +1 -1
  27. package/dist/tasks/setup.js +36 -10
  28. package/dist/tasks/setup.js.map +1 -1
  29. package/dist/types/cli.d.ts +1 -0
  30. package/dist/types/cli.d.ts.map +1 -1
  31. package/dist/types/cli.js.map +1 -1
  32. package/dist/utils/config.d.ts +1 -1
  33. package/dist/utils/config.d.ts.map +1 -1
  34. package/dist/utils/config.js +7 -1
  35. package/dist/utils/config.js.map +1 -1
  36. package/dist/utils/exec.d.ts +1 -1
  37. package/dist/utils/exec.d.ts.map +1 -1
  38. package/dist/utils/exec.js +23 -7
  39. package/dist/utils/exec.js.map +1 -1
  40. package/dist/utils/locadexManager.d.ts.map +1 -1
  41. package/dist/utils/locadexManager.js +53 -35
  42. package/dist/utils/locadexManager.js.map +1 -1
  43. package/dist/utils/lockfile.d.ts.map +1 -1
  44. package/dist/utils/lockfile.js +12 -0
  45. package/dist/utils/lockfile.js.map +1 -1
  46. package/guides/next/advanced/mapping-expressions.md +1 -0
  47. package/package.json +4 -3
  48. package/resources/ghaYaml.yml +5 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # locadex
2
2
 
3
+ ## 0.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#397](https://github.com/generaltranslation/gt/pull/397) [`80a1395`](https://github.com/generaltranslation/gt/commit/80a13955db9ff46e5883ac8b0909ab294c63d001) Thanks [@brian-lou](https://github.com/brian-lou)! - Run translate after i18n
8
+
9
+ - Updated dependencies [[`80a1395`](https://github.com/generaltranslation/gt/commit/80a13955db9ff46e5883ac8b0909ab294c63d001)]:
10
+ - gtx-cli@1.2.28
11
+
12
+ ## 0.1.8
13
+
14
+ ### Patch Changes
15
+
16
+ - [#394](https://github.com/generaltranslation/gt/pull/394) [`f5d2fd2`](https://github.com/generaltranslation/gt/commit/f5d2fd2d34359a05eb9ba45c9cf0fbdcc732eedc) Thanks [@brian-lou](https://github.com/brian-lou)! - Switch default mcp to stdio
17
+
3
18
  ## 0.1.7
4
19
 
5
20
  ### Patch Changes
package/dist/cli.js CHANGED
@@ -8,10 +8,9 @@ import './utils/shutdown.js';
8
8
  import { Command } from 'commander';
9
9
  import { readFileSync } from 'node:fs';
10
10
  import { fromPackageRoot } from './utils/getPaths.js';
11
- import { setupCommand } from './commands/setup.js';
11
+ import { autoSetupCommand, setupCommand } from './commands/setup.js';
12
12
  import { i18nCommand } from './commands/i18n.js';
13
13
  import { main } from 'gtx-cli/index';
14
- import { fixErrorsCommand } from './commands/fixErrors.js';
15
14
  const packageJson = JSON.parse(readFileSync(fromPackageRoot('package.json'), 'utf8'));
16
15
  const program = new Command();
17
16
  program
@@ -30,23 +29,26 @@ program
30
29
  .option('--package-manager <manager>', 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)')
31
30
  .option('-y, --bypass-prompts', 'Bypass interactive prompts')
32
31
  .option('--no-telemetry', 'Disable telemetry')
32
+ .option('--no-translate', 'Disable translation step')
33
33
  .option('--app-dir <dir>', 'Relative path to the application directory', '.')
34
34
  .action(setupCommand);
35
35
  program
36
- .command('i18n')
37
- .description('Run Locadex i18n on your project')
36
+ .command('auto')
37
+ .description('Run Locadex with auto-setup on your project')
38
38
  .option('-v, --verbose', 'Verbose output')
39
39
  .option('-d, --debug', 'Debug output')
40
40
  .option('-b, --batch-size <number>', 'File batch size')
41
41
  .option('-t, --timeout <number>', 'Timeout for each file in a batch')
42
42
  .option('-c, --concurrency <number>', 'Max number of concurrent agents')
43
43
  .option('-m, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.')
44
+ .option('--package-manager <manager>', 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)')
44
45
  .option('--no-telemetry', 'Disable telemetry')
46
+ .option('--no-translate', 'Disable translation step')
45
47
  .option('--app-dir <dir>', 'Relative path to the application directory', '.')
46
- .action(i18nCommand);
48
+ .action(autoSetupCommand);
47
49
  program
48
- .command('fix')
49
- .description('Run Locadex to validate your project and fix errors')
50
+ .command('i18n')
51
+ .description('Run Locadex i18n on your project')
50
52
  .option('-v, --verbose', 'Verbose output')
51
53
  .option('-d, --debug', 'Debug output')
52
54
  .option('-b, --batch-size <number>', 'File batch size')
@@ -54,8 +56,9 @@ program
54
56
  .option('-c, --concurrency <number>', 'Max number of concurrent agents')
55
57
  .option('-m, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.')
56
58
  .option('--no-telemetry', 'Disable telemetry')
59
+ .option('--no-translate', 'Disable translation step')
57
60
  .option('--app-dir <dir>', 'Relative path to the application directory', '.')
58
- .action(fixErrorsCommand);
61
+ .action(i18nCommand);
59
62
  main(program);
60
63
  program.parse();
61
64
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"/","sources":["cli.ts"],"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,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,YAAY,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CACtD,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,mCAAmC,CAAC;KAChD,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAEhC,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,6BAA6B,CAAC;KAC1C,M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AAE,kCAAkC,CAAC;KACpE,MAAM,CAAC,4BAA4B,EAAE,iCAAiC,CAAC;KACvE,MAAM,CACL,6BAA6B,EAC7B,oGAAoG,CACrG;KACA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;KAC7C,MAAM,CAAC,iBAAiB,EAAE,4CAA4C,EAAE,GAAG,CAAC;KAC5E,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE5B,IAAI,CAAC,OAAO,CAAC,CAAC;AAEd,OAAO,CAAC,KAAK,EAAE,CAAC","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 './utils/shutdown.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';\nimport { fixErrorsCommand } from './commands/fixErrors.js';\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')\n .option('-t, --timeout <number>', 'Timeout for each file in a batch')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.'\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 .option('--app-dir <dir>', 'Relative path to the application directory', '.')\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')\n .option('-t, --timeout <number>', 'Timeout for each file in a batch')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.'\n )\n .option('--no-telemetry', 'Disable telemetry')\n .option('--app-dir <dir>', 'Relative path to the application directory', '.')\n .action(i18nCommand);\n\nprogram\n .command('fix')\n .description('Run Locadex to validate your project and fix errors')\n .option('-v, --verbose', 'Verbose output')\n .option('-d, --debug', 'Debug output')\n .option('-b, --batch-size <number>', 'File batch size')\n .option('-t, --timeout <number>', 'Timeout for each file in a batch')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.'\n )\n .option('--no-telemetry', 'Disable telemetry')\n .option('--app-dir <dir>', 'Relative path to the application directory', '.')\n .action(fixErrorsCommand);\n\nmain(program);\n\nprogram.parse();\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"/","sources":["cli.ts"],"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,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAA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AAe,EAAE,gBAAgB,CAAC;KACzC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC;KACrC,MAAM,CAAC,2BAA2B,EAAE,iBAAiB,CAAC;KACtD,MAAM,CAAC,wBAAwB,EAAE,kCAAkC,CAAC;KACpE,MAAM,CAAC,4BAA4B,EAAE,iCAAiC,CAAC;KACvE,MAAM,CACL,6BAA6B,EAC7B,oGAAoG,CACrG;KACA,MAAM,CACL,6BAA6B,EAC7B,kEAAkE,CACnE;KACA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;KAC7C,MAAM,CAAC,gBAAgB,EAAE,0BAA0B,CAAC;KACpD,MAAM,CAAC,iBAAiB,EAAE,4CAA4C,EAAE,GAAG,CAAC;KAC5E,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE5B,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,kCAAkC,CAAC;KAC/C,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC;KACzC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC;KACrC,MAAM,CAAC,2BAA2B,EAAE,iBAAiB,CAAC;KACtD,MAAM,CAAC,wBAAwB,EAAE,kCAAkC,CAAC;KACpE,MAAM,CAAC,4BAA4B,EAAE,iCAAiC,CAAC;KACvE,MAAM,CACL,6BAA6B,EAC7B,oGAAoG,CACrG;KACA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;KAC7C,MAAM,CAAC,gBAAgB,EAAE,0BAA0B,CAAC;KACpD,MAAM,CAAC,iBAAiB,EAAE,4CAA4C,EAAE,GAAG,CAAC;KAC5E,MAAM,CAAC,WAAW,CAAC,CAAC;AAEvB,IAAI,CAAC,OAAO,CAAC,CAAC;AAEd,OAAO,CAAC,KAAK,EAAE,CAAC","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 './utils/shutdown.js';\nimport { Command } from 'commander';\nimport { readFileSync } from 'node:fs';\nimport { fromPackageRoot } from './utils/getPaths.js';\nimport { autoSetupCommand, 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')\n .option('-t, --timeout <number>', 'Timeout for each file in a batch')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.'\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 .option('--no-translate', 'Disable translation step')\n .option('--app-dir <dir>', 'Relative path to the application directory', '.')\n .action(setupCommand);\n\nprogram\n .command('auto')\n .description('Run Locadex with auto-setup on your project')\n .option('-v, --verbose', 'Verbose output')\n .option('-d, --debug', 'Debug output')\n .option('-b, --batch-size <number>', 'File batch size')\n .option('-t, --timeout <number>', 'Timeout for each file in a batch')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.'\n )\n .option(\n '--package-manager <manager>',\n 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)'\n )\n .option('--no-telemetry', 'Disable telemetry')\n .option('--no-translate', 'Disable translation step')\n .option('--app-dir <dir>', 'Relative path to the application directory', '.')\n .action(autoSetupCommand);\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')\n .option('-t, --timeout <number>', 'Timeout for each file in a batch')\n .option('-c, --concurrency <number>', 'Max number of concurrent agents')\n .option(\n '-m, --match-files <pattern>',\n 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.'\n )\n .option('--no-telemetry', 'Disable telemetry')\n .option('--no-translate', 'Disable translation step')\n .option('--app-dir <dir>', 'Relative path to the application directory', '.')\n .action(i18nCommand);\n\nmain(program);\n\nprogram.parse();\n"]}
@@ -14,7 +14,7 @@ export async function fixErrorsCommand(options, command) {
14
14
  LocadexManager.initialize({
15
15
  rootDirectory: process.cwd(),
16
16
  appDirectory: path.resolve(process.cwd(), allOptions.appDir),
17
- mcpTransport: 'sse',
17
+ mcpTransport: 'stdio',
18
18
  apiKey: process.env.ANTHROPIC_API_KEY || '',
19
19
  metadata: {},
20
20
  cliOptions: allOptions,
@@ -1 +1 @@
1
- {"version":3,"file":"fixErrors.js","sourceRoot":"/","sources":["commands/fixErrors.ts"],"names":[],"mappings":"AAEA,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,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAmB,EAAE,OAAgB;IAC1E,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnD,MAAM,UAAU,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpD,MAAM,gBAAg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'../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport path from 'node:path';\nimport { validateConfig } from '../utils/config.js';\nimport { fixErrorsTask } from '../tasks/fixErrors.js';\n\nexport async function fixErrorsCommand(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 await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\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 ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await fixErrorsTask();\n }\n );\n}\n"]}
1
+ {"version":3,"file":"fixErrors.js","sourceRoot":"/","sources":["commands/fixErrors.ts"],"names":[],"mappings":"AAEA,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,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAmB,EAAE,OAAgB;IAC1E,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,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ACH,MAAM,aAAa,EAAE,CAAC;IACxB,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { Command } from 'commander';\nimport { CliOptions } from '../types/cli.js';\nimport { withTelemetry } from '../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport path from 'node:path';\nimport { validateConfig } from '../utils/config.js';\nimport { fixErrorsTask } from '../tasks/fixErrors.js';\n\nexport async function fixErrorsCommand(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 await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\n mcpTransport: 'stdio',\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 ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await fixErrorsTask();\n }\n );\n}\n"]}
@@ -14,7 +14,7 @@ export async function i18nCommand(options, command) {
14
14
  LocadexManager.initialize({
15
15
  rootDirectory: process.cwd(),
16
16
  appDirectory: path.resolve(process.cwd(), allOptions.appDir),
17
- mcpTransport: 'sse',
17
+ mcpTransport: 'stdio',
18
18
  apiKey: process.env.ANTHROPIC_API_KEY || '',
19
19
  metadata: {},
20
20
  cliOptions: allOptions,
@@ -35,7 +35,7 @@ export async function i18nCommand(options, command) {
35
35
  }),
36
36
  },
37
37
  });
38
- await i18nTask();
38
+ await i18nTask(allOptions);
39
39
  });
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9B,aAAa,EAAE,UAAU,CAAC,aAAa;yBACpC,KAAK,CAAC,GAAG,CAAC;yBACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC9B,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI;oBAC5B,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;iBAC/C,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,SAAS,IAAI;oBAC1B,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;iBACxC,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,OAAO,IAAI;oBACxB,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;iBACpC,CAAC;aACH;SACF,CAAC,CAAC;QACH,MAAM,QAAQ,EAAE,CAAC;IACnB,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { Command } from 'commander';\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 path from 'node:path';\nimport { validateConfig } from '../utils/config.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 await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\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 ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await i18nTask();\n }\n );\n}\n"]}
1
+ {"version":3,"file":"i18n.js","sourceRoot":"/","sources":["commands/i18n.ts"],"names":[],"mappings":"AACA,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,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAmB,EAAE,OAAgB;IACrE,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnD,MAAM,UAAU,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpD,MAAM,gBAAgB,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC;IACjD,aAAa,CACX,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,EAClD,KAAK,IAAI,EAAE;QACT,MAAM,cAAc,CAAC,UAAU,CAAC,CAAC;QAEjC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAChC,cAAc,CAAC,UAAU,CAAC;YACxB,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE;YAC5B,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,MAAM,CAAC;YAC5D,YAAY,EAAE,OAAO;YACrB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE;YAC3C,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,UAAU;YACtB,OAAO,EAAE;gBACP,GAAG,CAAC,UAAU,CAAC,aAAa,IAAI;oBAC9B,aAAa,EAAE,UAAU,CAAC,aAAa;yBACpC,KAAK,CAAC,GAAG,CAAC;yBACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC9B,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI;oBAC5B,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;iBAC/C,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,SAAS,IAAI;oBAC1B,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;iBACxC,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,OAAO,IAAI;oBACxB,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;iBACpC,CAAC;aACH;SACF,CAAC,CAAC;QACH,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { Command } from 'commander';\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 path from 'node:path';\nimport { validateConfig } from '../utils/config.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 await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\n mcpTransport: 'stdio',\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 ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await i18nTask(allOptions);\n }\n );\n}\n"]}
@@ -4,4 +4,8 @@ export declare function setupCommand(options: CliOptions & {
4
4
  packageManager?: string;
5
5
  bypassPrompts?: boolean;
6
6
  }, command: Command): Promise<void>;
7
+ export declare function autoSetupCommand(options: CliOptions & {
8
+ packageManager?: string;
9
+ bypassPrompts?: boolean;
10
+ }, command: Command): Promise<void>;
7
11
  //# sourceMappingURL=setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7C,wBAAsB,YAAY,CAChC,OAAO,EAAE,UAAU,GAAG;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,OAAO,EAAE,OAAO,iBAsCjB"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7C,wBAAsB,YAAY,CAChC,OAAO,EAAE,UAAU,GAAG;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,OAAO,EAAE,OAAO,iBA2CjB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,UAAU,GAAG;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,OAAO,EAAE,OAAO,iBA2CjB"}
@@ -14,7 +14,7 @@ export async function setupCommand(options, command) {
14
14
  LocadexManager.initialize({
15
15
  rootDirectory: process.cwd(),
16
16
  appDirectory: path.resolve(process.cwd(), allOptions.appDir),
17
- mcpTransport: 'sse',
17
+ mcpTransport: 'stdio',
18
18
  apiKey: process.env.ANTHROPIC_API_KEY || '',
19
19
  metadata: {},
20
20
  cliOptions: allOptions,
@@ -35,7 +35,41 @@ export async function setupCommand(options, command) {
35
35
  }),
36
36
  },
37
37
  });
38
- await setupTask(!!allOptions.bypassPrompts, allOptions.packageManager);
38
+ await setupTask(allOptions, false, !!allOptions.bypassPrompts, allOptions.packageManager);
39
+ });
40
+ }
41
+ export async function autoSetupCommand(options, command) {
42
+ const parentOptions = command.parent?.opts() || {};
43
+ const allOptions = { ...parentOptions, ...options };
44
+ const telemetryEnabled = !allOptions.noTelemetry;
45
+ withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
46
+ await validateConfig(allOptions);
47
+ displayHeader(telemetryEnabled);
48
+ LocadexManager.initialize({
49
+ rootDirectory: process.cwd(),
50
+ appDirectory: path.resolve(process.cwd(), allOptions.appDir),
51
+ mcpTransport: 'stdio',
52
+ apiKey: process.env.ANTHROPIC_API_KEY || '',
53
+ metadata: {},
54
+ cliOptions: allOptions,
55
+ options: {
56
+ ...(allOptions.matchingFiles && {
57
+ matchingFiles: allOptions.matchingFiles
58
+ .split(',')
59
+ .map((file) => file.trim()),
60
+ }),
61
+ ...(allOptions.concurrency && {
62
+ maxConcurrency: Number(allOptions.concurrency),
63
+ }),
64
+ ...(allOptions.batchSize && {
65
+ batchSize: Number(allOptions.batchSize),
66
+ }),
67
+ ...(allOptions.timeout && {
68
+ timeout: Number(allOptions.timeout),
69
+ }),
70
+ },
71
+ });
72
+ await setupTask(allOptions, true, !!allOptions.bypassPrompts, allOptions.packageManager);
39
73
  });
40
74
  }
41
75
  //# sourceMappingURL=setup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"AACA,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,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAGC,EACD,OAAgB;IAEhB,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnD,MAAM,UAAU,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpD,MAAM,gBAAgB,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC;IACjD,aAAa,CACX,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,EAClD,KAAK,IAAI,EAAE;QACT,MAAM,cAAc,CAAC,UAAU,CAAC,CAAC;QAEjC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAChC,cAAc,CAAC,UAAU,CAAC;YACxB,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE;YAC5B,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,MAAM,CAAC;YAC5D,YAAY,EAAE,KAAK;YACnB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE;YAC3C,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,UAAU;YACtB,OAAO,EAAE;gBACP,GAAG,CAAC,UAAU,CAAC,aAAa,IAAI;oBAC9B,aAAa,EAAE,UAAU,CAAC,aAAa;yBACpC,KAAK,CAAC,GAAG,CAAC;yBACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC9B,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI;oBAC5B,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;iBAC/C,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,SAAS,IAAI;oBAC1B,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;iBACxC,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,OAAO,IAAI;oBACxB,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;iBACpC,CAAC;aACH;SACF,CAAC,CAAC;QACH,MAAM,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IACzE,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { Command } from 'commander';\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 path from 'node:path';\nimport { validateConfig } from '../utils/config.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 await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\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 ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await setupTask(!!allOptions.bypassPrompts, allOptions.packageManager);\n }\n );\n}\n"]}
1
+ {"version":3,"file":"setup.js","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"AACA,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,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAGC,EACD,OAAgB;IAEhB,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnD,MAAM,UAAU,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpD,MAAM,gBAAgB,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC;IACjD,aAAa,CACX,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,EAClD,KAAK,IAAI,EAAE;QACT,MAAM,cAAc,CAAC,UAAU,CAAC,CAAC;QAEjC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAChC,cAAc,CAAC,UAAU,CAAC;YACxB,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE;YAC5B,YAAY,EAAE,IAAI,CAAC,OAAO,C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liOptions } from '../types/cli.js';\nimport { withTelemetry } from '../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport path from 'node:path';\nimport { validateConfig } from '../utils/config.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 await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\n mcpTransport: 'stdio',\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 ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await setupTask(\n allOptions,\n false,\n !!allOptions.bypassPrompts,\n allOptions.packageManager\n );\n }\n );\n}\n\nexport async function autoSetupCommand(\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 await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\n mcpTransport: 'stdio',\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 ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await setupTask(\n allOptions,\n true,\n !!allOptions.bypassPrompts,\n allOptions.packageManager\n );\n }\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"console.d.ts","sourceRoot":"/","sources":["logging/console.ts"],"names":[],"mappings":"AAmBA,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,QAEtC;AACD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAEzC;AACD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,QAEvC;AACD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAEzC;AACD,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,QAEtC;AACD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAEzC;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,iBAGpD;AAGD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,QAE3C;AACD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAEzC;AAGD,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,OAAO,QAItD;AA6BD,wBAAgB,aAAa,CAAC,SAAS,GAAE,MAAM,GAAG,OAAiB,0CAElE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,2CAE9C;AAGD,wBAAsB,UAAU,CAAC,EAC/B,OAAO,EACP,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,MAA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AED,wBAAsB,aAAa,CAAC,EAClC,OAAO,EACP,YAAmB,EACnB,aAAqC,GACtC,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,6BAYA;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM;;;;EAE/C"}
@@ -53,7 +53,8 @@ function displayInitializingText(telemetryEnabled) {
53
53
  // eslint-disable-next-line no-console
54
54
  console.log(`\n${chalk.bold.blue('General Translation, Inc.')}
55
55
  ${chalk.dim('https://generaltranslation.com/docs')}
56
- ${telemetryEnabled ? chalk.dim('\nLocadex is configured to collect anonymous telemetry data. You can opt out by running with the --no-telemetry flag.') : ''}
56
+ ${telemetryEnabled ? chalk.dim('\nLocadex is configured to collect anonymous telemetry data. You can opt out by running with the --no-telemetry flag.\n') : ''}
57
+ Locadex is in open beta and may make mistakes. Please report any bugs or issues to https://github.com/generaltranslation/gt/issues.
57
58
  `);
58
59
  }
59
60
  // Spinner functionality
@@ -1 +1 @@
1
- {"version":3,"file":"console.js","sourceRoot":"/","sources":["logging/console.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,WAAW,EACX,OAAO,EACP,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,0BAA0B;AAC1B,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpB,CAAC;AACD,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,GAAG,CAAC,IAAI,CAAC,OAAO,C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Y,GAAG,IAAI,EACnB,aAAa,GAAG,qBAAqB,GAKtC;IACC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;QAC3B,OAAO;QACP,YAAY,EAAE,YAAY;KAC3B,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,MAAM,CAAC,aAAa,CAAC,CAAC;QACtB,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import {\n log,\n spinner,\n intro,\n outro,\n text,\n select,\n confirm,\n isCancel,\n cancel,\n multiselect,\n taskLog,\n progress,\n} from '@clack/prompts';\nimport chalk from 'chalk';\nimport { getLocadexVersion } from '../utils/getPaths.js';\nimport { exit } from '../utils/shutdown.js';\n\n// Basic logging functions\nexport function logInfo(message: string) {\n log.info(message);\n}\nexport function logWarning(message: string) {\n log.warn(message);\n}\nexport function logError(message: string) {\n log.error(message);\n}\nexport function logSuccess(message: string) {\n log.success(message);\n}\nexport function logStep(message: string) {\n log.step(message);\n}\nexport function logMessage(message: string) {\n log.message(message, { symbol: chalk.cyan('~') });\n}\n\nexport async function logErrorAndExit(message: string) {\n log.error(message);\n await exit(1);\n}\n\n// Clack prompts\nexport function startCommand(message: string) {\n intro(chalk.cyan(message));\n}\nexport function endCommand(message: string) {\n outro(chalk.cyan(message));\n}\n\n// GT specific logging\nexport function displayHeader(telemetryEnabled: boolean) {\n displayAsciiTitle();\n displayInitializingText(telemetryEnabled);\n startCommand(chalk.cyan(`Locadex v${getLocadexVersion()}`));\n}\n\nfunction displayAsciiTitle() {\n // eslint-disable-next-line no-console\n console.log(\n chalk.cyan(\n `\\n ,ad8888ba, 888888888888 \n d8\"' \\`\"8b 88 \nd8' 88 \n88 88 \n88 88888 88 \nY8, 88 88 \n Y8a. .a88 88 \n \\`\"Y88888P\" 88 `\n )\n );\n}\n\nfunction displayInitializingText(telemetryEnabled: boolean) {\n // eslint-disable-next-line no-console\n console.log(\n `\\n${chalk.bold.blue('General Translation, Inc.')}\n${chalk.dim('https://generaltranslation.com/docs')}\n${telemetryEnabled ? chalk.dim('\\nLocadex is configured to collect anonymous telemetry data. You can opt out by running with the --no-telemetry flag.') : ''}\n`\n );\n}\n\n// Spinner functionality\nexport function createSpinner(indicator: 'dots' | 'timer' = 'timer') {\n return spinner({ indicator });\n}\n\nexport function createProgressBar(total: number) {\n return progress({ max: total });\n}\n\n// Input prompts\nexport async function promptText({\n message,\n defaultValue,\n validate,\n}: {\n message: string;\n defaultValue?: string;\n validate?: (value: string) => boolean | string;\n}) {\n const result = await text({\n message,\n placeholder: defaultValue,\n validate: validate\n ? (value) => {\n const validation = validate(value || '');\n return validation === true ? undefined : validation.toString();\n }\n : undefined,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result;\n}\n\nexport async function promptSelect<T>({\n message,\n options,\n defaultValue,\n}: {\n message: string;\n options: Array<{ value: T; label: string; hint?: string }>;\n defaultValue?: T;\n}) {\n // Convert options to the format expected by clack\n const clackOptions = options.map((opt) => ({\n value: opt.value,\n label: opt.label,\n hint: opt.hint,\n }));\n\n const result = await select({\n message,\n options: clackOptions as any,\n initialValue: defaultValue,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result as T;\n}\n\nexport async function promptMultiSelect<T extends string>({\n message,\n options,\n required = true,\n}: {\n message: string;\n options: Array<{ value: T; label: string; hint?: string }>;\n required?: boolean;\n}) {\n // Convert options to the format expected by clack\n const clackOptions = options.map((opt) => ({\n value: opt.value,\n label: opt.label,\n hint: opt.hint,\n }));\n\n const result = await multiselect({\n message,\n options: clackOptions as any,\n required,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result as Array<T>;\n}\n\nexport async function promptConfirm({\n message,\n defaultValue = true,\n cancelMessage = 'Operation cancelled',\n}: {\n message: string;\n defaultValue?: boolean;\n cancelMessage?: string;\n}) {\n const result = await confirm({\n message,\n initialValue: defaultValue,\n });\n\n if (isCancel(result)) {\n cancel(cancelMessage);\n await exit(0);\n }\n\n return result;\n}\n\nexport function createTaskLogger(message: string) {\n return taskLog({ title: message });\n}\n"]}
1
+ {"version":3,"file":"console.js","sourceRoot":"/","sources":["logging/console.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,WAAW,EACX,OAAO,EACP,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,0BAA0B;AAC1B,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpB,CAAC;AACD,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpB,CAAC;AACD,MAAM,UAAU,QAAQ,CAAC,OAAe;IACtC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AACD,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC;AACD,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpB,CAAC;AACD,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE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AO,EAAE,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import {\n log,\n spinner,\n intro,\n outro,\n text,\n select,\n confirm,\n isCancel,\n cancel,\n multiselect,\n taskLog,\n progress,\n} from '@clack/prompts';\nimport chalk from 'chalk';\nimport { getLocadexVersion } from '../utils/getPaths.js';\nimport { exit } from '../utils/shutdown.js';\n\n// Basic logging functions\nexport function logInfo(message: string) {\n log.info(message);\n}\nexport function logWarning(message: string) {\n log.warn(message);\n}\nexport function logError(message: string) {\n log.error(message);\n}\nexport function logSuccess(message: string) {\n log.success(message);\n}\nexport function logStep(message: string) {\n log.step(message);\n}\nexport function logMessage(message: string) {\n log.message(message, { symbol: chalk.cyan('~') });\n}\n\nexport async function logErrorAndExit(message: string) {\n log.error(message);\n await exit(1);\n}\n\n// Clack prompts\nexport function startCommand(message: string) {\n intro(chalk.cyan(message));\n}\nexport function endCommand(message: string) {\n outro(chalk.cyan(message));\n}\n\n// GT specific logging\nexport function displayHeader(telemetryEnabled: boolean) {\n displayAsciiTitle();\n displayInitializingText(telemetryEnabled);\n startCommand(chalk.cyan(`Locadex v${getLocadexVersion()}`));\n}\n\nfunction displayAsciiTitle() {\n // eslint-disable-next-line no-console\n console.log(\n chalk.cyan(\n `\\n ,ad8888ba, 888888888888 \n d8\"' \\`\"8b 88 \nd8' 88 \n88 88 \n88 88888 88 \nY8, 88 88 \n Y8a. .a88 88 \n \\`\"Y88888P\" 88 `\n )\n );\n}\n\nfunction displayInitializingText(telemetryEnabled: boolean) {\n // eslint-disable-next-line no-console\n console.log(\n `\\n${chalk.bold.blue('General Translation, Inc.')}\n${chalk.dim('https://generaltranslation.com/docs')}\n${telemetryEnabled ? chalk.dim('\\nLocadex is configured to collect anonymous telemetry data. You can opt out by running with the --no-telemetry flag.\\n') : ''}\nLocadex is in open beta and may make mistakes. Please report any bugs or issues to https://github.com/generaltranslation/gt/issues.\n`\n );\n}\n\n// Spinner functionality\nexport function createSpinner(indicator: 'dots' | 'timer' = 'timer') {\n return spinner({ indicator });\n}\n\nexport function createProgressBar(total: number) {\n return progress({ max: total });\n}\n\n// Input prompts\nexport async function promptText({\n message,\n defaultValue,\n validate,\n}: {\n message: string;\n defaultValue?: string;\n validate?: (value: string) => boolean | string;\n}) {\n const result = await text({\n message,\n placeholder: defaultValue,\n validate: validate\n ? (value) => {\n const validation = validate(value || '');\n return validation === true ? undefined : validation.toString();\n }\n : undefined,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result;\n}\n\nexport async function promptSelect<T>({\n message,\n options,\n defaultValue,\n}: {\n message: string;\n options: Array<{ value: T; label: string; hint?: string }>;\n defaultValue?: T;\n}) {\n // Convert options to the format expected by clack\n const clackOptions = options.map((opt) => ({\n value: opt.value,\n label: opt.label,\n hint: opt.hint,\n }));\n\n const result = await select({\n message,\n options: clackOptions as any,\n initialValue: defaultValue,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result as T;\n}\n\nexport async function promptMultiSelect<T extends string>({\n message,\n options,\n required = true,\n}: {\n message: string;\n options: Array<{ value: T; label: string; hint?: string }>;\n required?: boolean;\n}) {\n // Convert options to the format expected by clack\n const clackOptions = options.map((opt) => ({\n value: opt.value,\n label: opt.label,\n hint: opt.hint,\n }));\n\n const result = await multiselect({\n message,\n options: clackOptions as any,\n required,\n });\n\n if (isCancel(result)) {\n cancel('Operation cancelled');\n await exit(0);\n }\n\n return result as Array<T>;\n}\n\nexport async function promptConfirm({\n message,\n defaultValue = true,\n cancelMessage = 'Operation cancelled',\n}: {\n message: string;\n defaultValue?: boolean;\n cancelMessage?: string;\n}) {\n const result = await confirm({\n message,\n initialValue: defaultValue,\n });\n\n if (isCancel(result)) {\n cancel(cancelMessage);\n await exit(0);\n }\n\n return result;\n}\n\nexport function createTaskLogger(message: string) {\n return taskLog({ title: message });\n}\n"]}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import './telemetry.js';
3
+ //# sourceMappingURL=mcp-stdio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-stdio.d.ts","sourceRoot":"/","sources":["mcp-stdio.ts"],"names":[],"mappings":";AAEA,OAAO,gBAAgB,CAAC"}
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import './telemetry.js';
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
5
+ import { addDocsTools } from './mcp/tools/docs.js';
6
+ import { existsSync, readFileSync } from 'node:fs';
7
+ import { fromPackageRoot } from './utils/getPaths.js';
8
+ import { addGuidesTools } from './mcp/tools/guides.js';
9
+ import { logger } from './logging/logger.js';
10
+ async function main() {
11
+ const stateFile = process.env.LOCADEX_FILES_STATE_FILE_PATH;
12
+ const logFile = process.env.LOCADEX_LOG_FILE_PATH;
13
+ const verbose = process.env.LOCADEX_VERBOSE === 'true';
14
+ const debug = process.env.LOCADEX_DEBUG === 'true';
15
+ logger.initialize({ verbose, debug }, logFile);
16
+ if (stateFile && existsSync(stateFile)) {
17
+ const state = JSON.parse(readFileSync(stateFile, 'utf8'));
18
+ logger.log(`[locadex-mcp] state: ${JSON.stringify(state, null, 2)}`);
19
+ }
20
+ else {
21
+ throw new Error(`[locadex-mcp] state file not found: ${stateFile}`);
22
+ }
23
+ const server = new McpServer({
24
+ name: 'Locadex: AI Agent for Internationalization',
25
+ version: JSON.parse(readFileSync(fromPackageRoot('package.json'), 'utf8'))
26
+ .version,
27
+ });
28
+ addDocsTools(server);
29
+ addGuidesTools(server);
30
+ logger.log('[locadex-mcp] All tools registered');
31
+ const transport = new StdioServerTransport();
32
+ await server.connect(transport);
33
+ logger.log('[locadex-mcp] started on stdio');
34
+ }
35
+ main();
36
+ //# sourceMappingURL=mcp-stdio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-stdio.js","sourceRoot":"/","sources":["mcp-stdio.ts"],"names":[],"mappings":";AAEA,O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CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;aACvE,OAAO;KACX,CAAC,CAAC;IAEH,YAAY,CAAC,MAAM,CAAC,CAAC;IACrB,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvB,MAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAC/C,CAAC;AACD,IAAI,EAAE,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport './telemetry.js';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { addDocsTools } from './mcp/tools/docs.js';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { fromPackageRoot } from './utils/getPaths.js';\nimport { addGuidesTools } from './mcp/tools/guides.js';\nimport { logger } from './logging/logger.js';\n\nasync function main() {\n const stateFile = process.env.LOCADEX_FILES_STATE_FILE_PATH;\n const logFile = process.env.LOCADEX_LOG_FILE_PATH;\n const verbose = process.env.LOCADEX_VERBOSE === 'true';\n const debug = process.env.LOCADEX_DEBUG === 'true';\n\n logger.initialize({ verbose, debug }, logFile);\n\n if (stateFile && existsSync(stateFile)) {\n const state = JSON.parse(readFileSync(stateFile, 'utf8'));\n logger.log(`[locadex-mcp] state: ${JSON.stringify(state, null, 2)}`);\n } else {\n throw new Error(`[locadex-mcp] state file not found: ${stateFile}`);\n }\n\n const server = new McpServer({\n name: 'Locadex: AI Agent for Internationalization',\n version: JSON.parse(readFileSync(fromPackageRoot('package.json'), 'utf8'))\n .version,\n });\n\n addDocsTools(server);\n addGuidesTools(server);\n\n logger.log('[locadex-mcp] All tools registered');\n const transport = new StdioServerTransport();\n await server.connect(transport);\n logger.log('[locadex-mcp] started on stdio');\n}\nmain();\n"]}
@@ -60,8 +60,11 @@ Your new task is to fix any errors that were introduced by your previous impleme
60
60
  - These guides provide additional knowledge about how to internationalize the content.
61
61
  - NEVER move content to a different file. All content MUST remain in the same file where it came from.
62
62
  - NEVER CREATE OR DELETE ANY FILES (especially .bak files)
63
+ - YOU MAY NOT RUN ANY COMMANDS THAT ARE NOT LISTED BELOW:
64
+ - 'locadex validate'
65
+ - 'tsc --noEmit'
63
66
 
64
- To run the gt-next validator, run the following command from the app root:
67
+ To run the gt-next validator, run the following command from the app root directory:
65
68
  'locadex validate' (global command)
66
69
  The app root is: "${appDirectory}"
67
70
 
@@ -1 +1 @@
1
- {"version":3,"file":"fixErrors.js","sourceRoot":"/","sources":["tasks/fixErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,OAAO,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,uCAAuC;IACvC,MAAM,oBAAoB,CAAC,2BAA2B,EAAE,mBAAmB,CAAC,CAAC;IAE7E,mCAAmC;IACnC,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;IAE3E,MAAM,CAAC,iBAAiB,EAAE,CAAC;IAC3B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACrD,IAAI,CAAC;QACH,MAAM,YAAY,CAAC,GAAG,CACpB,SAAS,EACT;YACE,QAAQ,EAAE,GAAG;YACb,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,CAAC;SACd,EACD,EAAE,CACH,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,oBAAoB,YAAY,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CAAC,cAAc,EAAE,CAAC;QAC9B,MAAM,CAAC,YAAY,CACjB,gDAAgD,KAAK,EAAE,CACxD,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;QAC3C,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,OAAO;IACT,CAAC;IACD,YAAY,CAAC,cAAc,EAAE,CAAC;IAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACpC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,oDAAoD;AAEpD,SAAS,YAAY,CAAC,YAAoB;IACxC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;oBAyBG,YAAY;;;;EAI9B,YAAY;;;;;;;;;CASb,CAAC;IAEA,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { allMcpPrompt } from '../prompts/system.js';\nimport { exit } from '../utils/shutdown.js';\nimport { logger } from '../logging/logger.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { outro } from '@clack/prompts';\nimport chalk from 'chalk';\nimport { CLAUDE_CODE_VERSION } from '../utils/shared.js';\nimport { installGlobalPackage } from '../utils/packages/installPackage.js';\n\nexport async function fixErrorsTask() {\n const manager = LocadexManager.getInstance();\n const reports: string[] = [];\n // Install claude-code if not installed\n await installGlobalPackage('@anthropic-ai/claude-code', CLAUDE_CODE_VERSION);\n\n // Create a clean agent for cleanup\n const cleanupAgent = manager.createSingleAgent('claude_cleanup_agent', {});\n\n logger.initializeSpinner();\n logger.spinner.start('Fixing errors...');\n const fixPrompt = getFixPrompt(manager.appDirectory);\n try {\n await cleanupAgent.run(\n fixPrompt,\n {\n maxTurns: 200,\n timeoutSec: 300,\n maxRetries: 2,\n },\n {}\n );\n reports.push(`## Fixed errors\\n${cleanupAgent.generateReport()}`);\n } catch (error) {\n cleanupAgent.aggregateStats();\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 return;\n }\n cleanupAgent.aggregateStats();\n logger.spinner.stop('Fixed errors');\n return reports;\n}\n\n// check (dry run and ts check) should be at the end\n\nfunction getFixPrompt(appDirectory: string) {\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 to fix any errors that were introduced by your previous implementation.\n\n## Steps:\n1. Run the gt-next validator.\n2. Fix all errors output by the gt-next validator.\n3. Repeat steps 1-2 until there are no more errors, or until you believe that you have fixed all 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- ALWAYS adhere to the guides provided via the 'mcp__locadex__' tools.\n - These guides provide additional knowledge about how to internationalize the content.\n- NEVER move content to a different file. All content MUST remain in the same file where it came from.\n- NEVER CREATE OR DELETE ANY FILES (especially .bak files)\n\nTo run the gt-next validator, run the following command from the app root:\n'locadex validate' (global command)\nThe app root is: \"${appDirectory}\"\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"]}
1
+ {"version":3,"file":"fixErrors.js","sourceRoot":"/","sources":["tasks/fixErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,OAAO,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,uCAAuC;IACvC,MAAM,oBAAoB,CAAC,2BAA2B,EAAE,mBAAmB,CAAC,CAAC;IAE7E,mCAAmC;IACnC,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;IAE3E,MAAM,CAAC,iBAAiB,EAAE,CAAC;IAC3B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACrD,IAAI,CAAC;QACH,MAAM,YAAY,CAAC,GAAG,CACpB,SAAS,EACT;YACE,QAAQ,EAAE,GAAG;YACb,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,CAAC;SACd,EACD,EAAE,CACH,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,oBAAoB,YAAY,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CAAC,cAAc,EAAE,CAAC;QAC9B,MAAM,CAAC,YAAY,CACjB,gDAAgD,KAAK,EAAE,CACxD,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;QAC3C,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,OAAO;IACT,CAAC;IACD,YAAY,CAAC,cAAc,EAAE,CAAC;IAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACpC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,oDAAoD;AAEpD,SAAS,YAAY,CAAC,YAAoB;IACxC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA4BG,YAAY;;;;EAI9B,YAAY;;;;;;;;;CASb,CAAC;IAEA,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { allMcpPrompt } from '../prompts/system.js';\nimport { exit } from '../utils/shutdown.js';\nimport { logger } from '../logging/logger.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { outro } from '@clack/prompts';\nimport chalk from 'chalk';\nimport { CLAUDE_CODE_VERSION } from '../utils/shared.js';\nimport { installGlobalPackage } from '../utils/packages/installPackage.js';\n\nexport async function fixErrorsTask() {\n const manager = LocadexManager.getInstance();\n const reports: string[] = [];\n // Install claude-code if not installed\n await installGlobalPackage('@anthropic-ai/claude-code', CLAUDE_CODE_VERSION);\n\n // Create a clean agent for cleanup\n const cleanupAgent = manager.createSingleAgent('claude_cleanup_agent', {});\n\n logger.initializeSpinner();\n logger.spinner.start('Fixing errors...');\n const fixPrompt = getFixPrompt(manager.appDirectory);\n try {\n await cleanupAgent.run(\n fixPrompt,\n {\n maxTurns: 200,\n timeoutSec: 300,\n maxRetries: 2,\n },\n {}\n );\n reports.push(`## Fixed errors\\n${cleanupAgent.generateReport()}`);\n } catch (error) {\n cleanupAgent.aggregateStats();\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 return;\n }\n cleanupAgent.aggregateStats();\n logger.spinner.stop('Fixed errors');\n return reports;\n}\n\n// check (dry run and ts check) should be at the end\n\nfunction getFixPrompt(appDirectory: string) {\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 to fix any errors that were introduced by your previous implementation.\n\n## Steps:\n1. Run the gt-next validator.\n2. Fix all errors output by the gt-next validator.\n3. Repeat steps 1-2 until there are no more errors, or until you believe that you have fixed all 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- ALWAYS adhere to the guides provided via the 'mcp__locadex__' tools.\n - These guides provide additional knowledge about how to internationalize the content.\n- NEVER move content to a different file. All content MUST remain in the same file where it came from.\n- NEVER CREATE OR DELETE ANY FILES (especially .bak files)\n- YOU MAY NOT RUN ANY COMMANDS THAT ARE NOT LISTED BELOW:\n - 'locadex validate'\n - 'tsc --noEmit'\n\nTo run the gt-next validator, run the following command from the app root directory:\n'locadex validate' (global command)\nThe app root is: \"${appDirectory}\"\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"]}
@@ -1,2 +1,7 @@
1
- export declare function i18nTask(): Promise<void>;
1
+ import { CliOptions } from '../types/cli.js';
2
+ /**
3
+ * Run Locadex i18n on the project
4
+ * This task requires no human intervention and is safe to run in CI/CD pipelines.
5
+ */
6
+ export declare function i18nTask(cliOptions: CliOptions): Promise<void>;
2
7
  //# sourceMappingURL=i18n.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["tasks/i18n.ts"],"names":[],"mappings":"AA4BA,wBAAsB,QAAQ,kBAoM7B"}
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["tasks/i18n.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,UAAU,EAAE,UAAU,iBAiNpD"}
@@ -20,7 +20,11 @@ import { fixErrorsTask } from './fixErrors.js';
20
20
  import { getLocadexVersion } from '../utils/getPaths.js';
21
21
  import { execFunction } from '../utils/exec.js';
22
22
  import { isGTAuthConfigured } from '../utils/config.js';
23
- export async function i18nTask() {
23
+ /**
24
+ * Run Locadex i18n on the project
25
+ * This task requires no human intervention and is safe to run in CI/CD pipelines.
26
+ */
27
+ export async function i18nTask(cliOptions) {
24
28
  const manager = LocadexManager.getInstance();
25
29
  // have to use the package.json from the appDir
26
30
  const packageJson = await getPackageJson(manager.appDirectory);
@@ -135,31 +139,36 @@ ${reports.join('\n')}`;
135
139
  deleteAddedFiles([path.relative(manager.rootDirectory, manager.locadexDirectory)], ['dictionary.json', 'gt.config.json', 'locadex.yml']);
136
140
  cleanupOnExit();
137
141
  // Run translate cmd
138
- if (isGTAuthConfigured()) {
142
+ if (isGTAuthConfigured(manager.appDirectory) && !cliOptions.noTranslate) {
139
143
  try {
140
- await execFunction('locadex', ['translate'], false, manager.appDirectory);
141
- logger.step(`Translations generated!`);
144
+ logger.initializeSpinner();
145
+ logger.spinner.start('Running locadex translate...');
146
+ await execFunction('locadex', ['translate'], false, manager.appDirectory, manager.getAgentAbortController());
147
+ logger.spinner.stop('Translations generated!');
148
+ }
149
+ catch (error) {
150
+ logger.spinner.stop('Translations failed!');
151
+ logger.error(`Error running 'locadex translate': ${error.message}`);
142
152
  }
143
- catch (error) { }
144
153
  }
145
154
  else {
146
- logger.step(`No GT_API_KEY or GT_PROJECT_ID found. Skipping translation...`);
155
+ logger.step(`No GT_API_KEY or GT_PROJECT_ID found. Skipping translation step...`);
147
156
  }
148
157
  outro(chalk.green('✅ Locadex i18n complete!'));
149
158
  await exit(0);
150
159
  }
151
160
  function cleanupOnExit() {
152
161
  const manager = LocadexManager.getInstance();
153
- logger.info(chalk.dim(`Total Cost: $${manager.stats.getStats().totalCost.toFixed(2)}
154
- Total wall time: ${Math.round((Date.now() - manager.stats.getStats().startTime) / 1000)}s
155
- Total files processed: ${manager.stats.getStats().processedFiles}`));
162
+ logger.info(chalk.dim(`Locadex Cost: $${manager.stats.getStats().totalCost.toFixed(2)}
163
+ Locadex wall time: ${Math.round((Date.now() - manager.stats.getStats().startTime) / 1000)}s
164
+ Locadex files processed: ${manager.stats.getStats().processedFiles}`));
156
165
  const finalStats = manager.stats.getStats();
157
166
  // Record telemetry for final stats
158
167
  manager.stats.recordTelemetry(true);
159
- logger.verboseMessage(`Total input tokens: ${finalStats.inputTokens}
160
- Total cached input tokens: ${finalStats.cachedInputTokens}
161
- Total output tokens: ${finalStats.outputTokens}
162
- Total turns: ${finalStats.turns}`);
168
+ logger.verboseMessage(`Locadex input tokens: ${finalStats.inputTokens}
169
+ Locadex cached input tokens: ${finalStats.cachedInputTokens}
170
+ Locadex output tokens: ${finalStats.outputTokens}
171
+ Locadex turns: ${finalStats.turns}`);
163
172
  }
164
173
  function getPrompt({ targetFile, dependencyFiles, dependentFiles, }) {
165
174
  const prompt = `# Task: Internationalize the target file(s) using gt-next.