locadex 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # locadex
2
2
 
3
+ ## 0.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#392](https://github.com/generaltranslation/gt/pull/392) [`cebc905`](https://github.com/generaltranslation/gt/commit/cebc905cb5364bdcc218d4e93a6aee606d804419) Thanks [@brian-lou](https://github.com/brian-lou)! - Fix require not being present in ESM package
8
+
9
+ - Updated dependencies [[`cebc905`](https://github.com/generaltranslation/gt/commit/cebc905cb5364bdcc218d4e93a6aee606d804419)]:
10
+ - gtx-cli@1.2.27
11
+
3
12
  ## 0.1.6
4
13
 
5
14
  ### Patch Changes
@@ -20,7 +20,7 @@ export async function fixErrorsTask() {
20
20
  await cleanupAgent.run(fixPrompt, {
21
21
  maxTurns: 200,
22
22
  timeoutSec: 300,
23
- maxRetries: 1,
23
+ maxRetries: 2,
24
24
  }, {});
25
25
  reports.push(`## Fixed errors\n${cleanupAgent.generateReport()}`);
26
26
  }
@@ -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;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;;;;;;;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: 1,\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;;;;;;;;;;;;;;;;;;;;;;;;;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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locadex",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "An AI agent for internationalization",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "dependency-tree": "^11.1.1",
24
24
  "dotenv": "^16.4.5",
25
25
  "express": "^5.1.0",
26
- "gtx-cli": "^1.2.26",
26
+ "gtx-cli": "^1.2.27",
27
27
  "micromatch": "^4.0.8",
28
28
  "posthog-node": "^4.18.0"
29
29
  },