locadex 0.0.2-alpha.5 → 0.0.2-alpha.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.
Files changed (110) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +67 -9
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/i18n.d.ts +1 -2
  5. package/dist/commands/i18n.d.ts.map +1 -1
  6. package/dist/commands/i18n.js +5 -256
  7. package/dist/commands/i18n.js.map +1 -1
  8. package/dist/commands/setup.d.ts +1 -1
  9. package/dist/commands/setup.d.ts.map +1 -1
  10. package/dist/commands/setup.js +5 -142
  11. package/dist/commands/setup.js.map +1 -1
  12. package/dist/logging/console.d.ts +3 -3
  13. package/dist/logging/console.d.ts.map +1 -1
  14. package/dist/logging/console.js +9 -8
  15. package/dist/logging/console.js.map +1 -1
  16. package/dist/logging/logger.d.ts +4 -2
  17. package/dist/logging/logger.d.ts.map +1 -1
  18. package/dist/logging/logger.js +33 -7
  19. package/dist/logging/logger.js.map +1 -1
  20. package/dist/mcp/getDocs.d.ts.map +1 -1
  21. package/dist/mcp/getDocs.js +2 -3
  22. package/dist/mcp/getDocs.js.map +1 -1
  23. package/dist/mcp/getPort.d.ts +2 -0
  24. package/dist/mcp/getPort.d.ts.map +1 -0
  25. package/dist/mcp/getPort.js +25 -0
  26. package/dist/mcp/getPort.js.map +1 -0
  27. package/dist/mcp/tools/docs.d.ts.map +1 -1
  28. package/dist/mcp/tools/docs.js +9 -2
  29. package/dist/mcp/tools/docs.js.map +1 -1
  30. package/dist/mcp/tools/guides.d.ts.map +1 -1
  31. package/dist/mcp/tools/guides.js +5 -2
  32. package/dist/mcp/tools/guides.js.map +1 -1
  33. package/dist/mcp-sse.d.ts.map +1 -1
  34. package/dist/mcp-sse.js +10 -28
  35. package/dist/mcp-sse.js.map +1 -1
  36. package/dist/tasks/i18n.d.ts +2 -0
  37. package/dist/tasks/i18n.d.ts.map +1 -0
  38. package/dist/tasks/i18n.js +317 -0
  39. package/dist/tasks/i18n.js.map +1 -0
  40. package/dist/tasks/setup.d.ts +2 -0
  41. package/dist/tasks/setup.d.ts.map +1 -0
  42. package/dist/tasks/setup.js +171 -0
  43. package/dist/tasks/setup.js.map +1 -0
  44. package/dist/telemetry.d.ts +1 -3
  45. package/dist/telemetry.d.ts.map +1 -1
  46. package/dist/telemetry.js +27 -25
  47. package/dist/telemetry.js.map +1 -1
  48. package/dist/types/cli.d.ts +9 -0
  49. package/dist/types/cli.d.ts.map +1 -1
  50. package/dist/types/cli.js +2 -2
  51. package/dist/types/cli.js.map +1 -1
  52. package/dist/utils/claudeCode.d.ts +7 -2
  53. package/dist/utils/claudeCode.d.ts.map +1 -1
  54. package/dist/utils/claudeCode.js +50 -31
  55. package/dist/utils/claudeCode.js.map +1 -1
  56. package/dist/utils/config.d.ts +10 -0
  57. package/dist/utils/config.d.ts.map +1 -0
  58. package/dist/utils/config.js +66 -0
  59. package/dist/utils/config.js.map +1 -0
  60. package/dist/utils/dag/createDag.d.ts +1 -1
  61. package/dist/utils/dag/createDag.d.ts.map +1 -1
  62. package/dist/utils/dag/createDag.js +4 -41
  63. package/dist/utils/dag/createDag.js.map +1 -1
  64. package/dist/utils/dag/matchFiles.d.ts +2 -0
  65. package/dist/utils/dag/matchFiles.d.ts.map +1 -0
  66. package/dist/utils/dag/matchFiles.js +40 -0
  67. package/dist/utils/dag/matchFiles.js.map +1 -0
  68. package/dist/utils/getFiles.d.ts +2 -3
  69. package/dist/utils/getFiles.d.ts.map +1 -1
  70. package/dist/utils/getFiles.js +23 -14
  71. package/dist/utils/getFiles.js.map +1 -1
  72. package/dist/utils/locadexManager.d.ts +69 -0
  73. package/dist/utils/locadexManager.d.ts.map +1 -0
  74. package/dist/utils/locadexManager.js +250 -0
  75. package/dist/utils/locadexManager.js.map +1 -0
  76. package/dist/utils/session.d.ts +2 -0
  77. package/dist/utils/session.d.ts.map +1 -0
  78. package/dist/utils/session.js +12 -0
  79. package/dist/utils/session.js.map +1 -0
  80. package/dist/utils/shared.d.ts +2 -1
  81. package/dist/utils/shared.d.ts.map +1 -1
  82. package/dist/utils/shared.js +37 -14
  83. package/dist/utils/shared.js.map +1 -1
  84. package/dist/utils/shutdown.d.ts +20 -0
  85. package/dist/utils/shutdown.d.ts.map +1 -0
  86. package/dist/utils/shutdown.js +63 -0
  87. package/dist/utils/shutdown.js.map +1 -0
  88. package/dist/utils/stats.d.ts +13 -0
  89. package/dist/utils/stats.d.ts.map +1 -1
  90. package/dist/utils/stats.js +55 -2
  91. package/dist/utils/stats.js.map +1 -1
  92. package/package.json +2 -5
  93. package/.locadex-mcp-stdio.json +0 -9
  94. package/.locadex-mcp.json +0 -8
  95. package/dist/utils/agentManager.d.ts +0 -34
  96. package/dist/utils/agentManager.d.ts.map +0 -1
  97. package/dist/utils/agentManager.js +0 -123
  98. package/dist/utils/agentManager.js.map +0 -1
  99. package/dist/utils/debugLogger.d.ts +0 -3
  100. package/dist/utils/debugLogger.d.ts.map +0 -1
  101. package/dist/utils/debugLogger.js +0 -36
  102. package/dist/utils/debugLogger.js.map +0 -1
  103. package/dist/utils/mcpConfig.d.ts +0 -10
  104. package/dist/utils/mcpConfig.d.ts.map +0 -1
  105. package/dist/utils/mcpConfig.js +0 -13
  106. package/dist/utils/mcpConfig.js.map +0 -1
  107. package/dist/utils/validateConfig.d.ts +0 -2
  108. package/dist/utils/validateConfig.d.ts.map +0 -1
  109. package/dist/utils/validateConfig.js +0 -12
  110. package/dist/utils/validateConfig.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"guides.js","sources":["mcp/tools/guides.ts"],"sourceRoot":"/","sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport getGuide from '../getGuide.js';\n\ntype Guide = {\n id: string;\n description: string;\n path: string;\n type: 'important' | 'basic' | 'advanced';\n};\n\nexport const guides: Guide[] = [\n {\n id: 'important_next-functions',\n description:\n 'Important documentation outlining the imports available in `gt-next`.',\n path: 'guides/next/important/functions.md',\n type: 'important',\n },\n {\n id: 'basic_next-jsx',\n description:\n 'Basic guide for translating JSX and HTML content in a Next.js project.',\n path: 'guides/next/basic/jsx.md',\n type: 'basic',\n },\n {\n id: 'basic_next-branches',\n description:\n 'Basic guide for using branch components and dealing with conditional logic in or pluralization in JSX in a Next.js project.',\n path: 'guides/next/basic/branches.md',\n type: 'basic',\n },\n {\n id: 'basic_next-strings',\n description:\n 'Basic guide for how to use `useGT()` and `getGT()` to internationalize strings in a Next.js project.',\n path: 'guides/next/basic/strings.md',\n type: 'basic',\n },\n {\n id: 'basic_next-variables',\n description:\n 'Basic guide for using internationalizing variable content (Currency, DateTime, Numbers, and other dynamic content) in a Next.js project.',\n path: 'guides/next/basic/variables.md',\n type: 'basic',\n },\n {\n id: 'basic_next-client-side-components',\n description:\n 'Basic guide on how to internationalize client-side components.',\n path: 'guides/next/basic/client-side-components.md',\n type: 'basic',\n },\n {\n id: 'basic_next-server-side-components',\n description:\n 'Basic guide on how to internationalize server-side components.',\n path: 'guides/next/basic/server-side-components.md',\n type: 'basic',\n },\n {\n id: 'advanced_next-outside-client-component',\n description:\n 'Advanced guide for wherever you see a `const` or `let` or a function outside of a function scope that needs to be internationalized. This guide is specifically for when these variables are ONLY used or imported by client side components.',\n path: 'guides/next/advanced/var-outside-client-component.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-outside-server-component',\n description:\n 'Advanced guide for wherever you see a `const` or `let` or a function outside of a function scope that needs to be internationalized. This guide is specifically for when these variables are ONLY used or imported by server side components.',\n path: 'guides/next/advanced/var-outside-server-component.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-outside-client-server-component',\n description:\n 'Advanced guide for wherever you see a `const` or `let` or a function outside of a function scope that needs to be internationalized. This guide is specifically for when these variables are used or imported by both client side and server side components.',\n path: 'guides/next/advanced/var-outside-client-server-component.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-ternary-operators',\n description:\n 'Advanced guide for complex scenarios with ternary operators or conditional statements that needs to be internationalized.',\n path: 'guides/next/advanced/ternary-operators.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-complicated-mapping-expressions',\n description:\n 'Advanced guide for wherever you see a mapping expression or mapping expression for a nested data structure that needs to be internationalized.',\n path: 'guides/next/advanced/complicated-mapping-expressions.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-interpolated-strings',\n description:\n 'Advanced guide for wherever you see a string with variables within/around it or interpolated string (template string literal with quasis) that needs to be internationalized.',\n path: 'guides/next/advanced/interpolated-strings.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-migrating',\n description:\n 'Advanced guide for migrating from an existing i18n library such as react-i18next or next-i18next to gt-next.',\n path: 'guides/next/advanced/migrating.md',\n type: 'advanced',\n },\n];\n\nexport function addGuidesTools(server: McpServer) {\n guides.forEach((guide) => {\n server.tool(guide.id, guide.description, {}, async () => {\n const path = guide.path;\n const { content, error } = await getGuide(path);\n\n if (error) {\n return {\n content: [\n {\n type: 'text',\n text: `Error fetching guide: ${error}`,\n },\n ],\n isError: true,\n };\n }\n return {\n content: [\n {\n type: 'text',\n text: content ?? '',\n },\n ],\n };\n });\n });\n}\n"],"names":[],"mappings":";;AACA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAStC,MAAM,CAAC,MAAM,MAAM,GAAY;IAC7B;QACE,EAAE,EAAE,0BAA0B;QAC9B,WAAW,EACT,uEAAuE;QACzE,IAAI,EAAE,oCAAoC;QAC1C,IAAI,EAAE,WAAW;KAClB;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,WAAW,EACT,wEAAwE;QAC1E,IAAI,EAAE,0BAA0B;QAChC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,WAAW,EACT,6HAA6H;QAC/H,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,oBAAoB;QACxB,WAAW,EACT,sGAAsG;QACxG,IAAI,EAAE,8BA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AAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,IAAI,EAAE;YACtD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YACxB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;YAEhD,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,yBAAyB,KAAK,EAAE;yBACvC;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,OAAO,IAAI,EAAE;qBACpB;iBACF;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","debug_id":"604b5440-6ac7-5be9-8c0f-f3eed2a06ee8"}
1
+ {"version":3,"file":"guides.js","sources":["mcp/tools/guides.ts"],"sourceRoot":"/","sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport getGuide from '../getGuide.js';\nimport { logger } from '../../logging/logger.js';\n\ntype Guide = {\n id: string;\n description: string;\n path: string;\n type: 'important' | 'basic' | 'advanced';\n};\n\nexport const guides: Guide[] = [\n {\n id: 'important_next-functions',\n description:\n 'Important documentation outlining the imports available in `gt-next`.',\n path: 'guides/next/important/functions.md',\n type: 'important',\n },\n {\n id: 'basic_next-jsx',\n description:\n 'Basic guide for translating JSX and HTML content in a Next.js project.',\n path: 'guides/next/basic/jsx.md',\n type: 'basic',\n },\n {\n id: 'basic_next-branches',\n description:\n 'Basic guide for using branch components and dealing with conditional logic in or pluralization in JSX in a Next.js project.',\n path: 'guides/next/basic/branches.md',\n type: 'basic',\n },\n {\n id: 'basic_next-strings',\n description:\n 'Basic guide for how to use `useGT()` and `getGT()` to internationalize strings in a Next.js project.',\n path: 'guides/next/basic/strings.md',\n type: 'basic',\n },\n {\n id: 'basic_next-variables',\n description:\n 'Basic guide for using internationalizing variable content (Currency, DateTime, Numbers, and other dynamic content) in a Next.js project.',\n path: 'guides/next/basic/variables.md',\n type: 'basic',\n },\n {\n id: 'basic_next-client-side-components',\n description:\n 'Basic guide on how to internationalize client-side components.',\n path: 'guides/next/basic/client-side-components.md',\n type: 'basic',\n },\n {\n id: 'basic_next-server-side-components',\n description:\n 'Basic guide on how to internationalize server-side components.',\n path: 'guides/next/basic/server-side-components.md',\n type: 'basic',\n },\n {\n id: 'advanced_next-outside-client-component',\n description:\n 'Advanced guide for wherever you see a `const` or `let` or a function outside of a function scope that needs to be internationalized. This guide is specifically for when these variables are ONLY used or imported by client side components.',\n path: 'guides/next/advanced/var-outside-client-component.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-outside-server-component',\n description:\n 'Advanced guide for wherever you see a `const` or `let` or a function outside of a function scope that needs to be internationalized. This guide is specifically for when these variables are ONLY used or imported by server side components.',\n path: 'guides/next/advanced/var-outside-server-component.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-outside-client-server-component',\n description:\n 'Advanced guide for wherever you see a `const` or `let` or a function outside of a function scope that needs to be internationalized. This guide is specifically for when these variables are used or imported by both client side and server side components.',\n path: 'guides/next/advanced/var-outside-client-server-component.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-ternary-operators',\n description:\n 'Advanced guide for complex scenarios with ternary operators or conditional statements that needs to be internationalized.',\n path: 'guides/next/advanced/ternary-operators.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-complicated-mapping-expressions',\n description:\n 'Advanced guide for wherever you see a mapping expression or mapping expression for a nested data structure that needs to be internationalized.',\n path: 'guides/next/advanced/complicated-mapping-expressions.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-interpolated-strings',\n description:\n 'Advanced guide for wherever you see a string with variables within/around it or interpolated string (template string literal with quasis) that needs to be internationalized.',\n path: 'guides/next/advanced/interpolated-strings.md',\n type: 'advanced',\n },\n {\n id: 'advanced_next-migrating',\n description:\n 'Advanced guide for migrating from an existing i18n library such as react-i18next or next-i18next to gt-next.',\n path: 'guides/next/advanced/migrating.md',\n type: 'advanced',\n },\n];\n\nexport function addGuidesTools(server: McpServer) {\n guides.forEach((guide) => {\n server.tool(guide.id, guide.description, {}, async () => {\n const path = guide.path;\n const { content, error } = await getGuide(path);\n if (error) {\n logger.log(`[locadex-mcp: ${guide.id}] Error fetching guide: ${path}`);\n return {\n content: [\n {\n type: 'text',\n text: `Error fetching guide: ${error}`,\n },\n ],\n isError: true,\n };\n }\n logger.log(\n `[locadex-mcp: ${guide.id}] Guide fetched successfully: ${path}`\n );\n return {\n content: [\n {\n type: 'text',\n text: content ?? '',\n },\n ],\n };\n });\n });\n}\n"],"names":[],"mappings":";;AACA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AASjD,MAAM,CAAC,MAAM,MAAM,GAAY;IAC7B;QACE,EAAE,EAAE,0BAA0B;QAC9B,WAAW,EACT,uEAAuE;QACzE,IAAI,EAAE,oCAAoC;QAC1C,IAAI,EAAE,WAAW;KAClB;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,WAAW,EACT,wEAAwE;QAC1E,IAAI,EAAE,0BAA0B;QAChC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,WAAW,EACT,6HAA6H;QAC/H,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,oBAAoB;QACxB,WAAW,EACT,sGAAsG;QACxG,IAAI,EAAE,8BAA8B;QACpC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,WAAW,EACT,0IAA0I;QAC5I,IAA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WAAW,EAAE,EAAE,EAAE,KAAK,IAAI,EAAE;YACtD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YACxB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;YAChD,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,EAAE,2BAA2B,IAAI,EAAE,CAAC,CAAC;gBACvE,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,yBAAyB,KAAK,EAAE;yBACvC;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,MAAM,CAAC,GAAG,CACR,iBAAiB,KAAK,CAAC,EAAE,iCAAiC,IAAI,EAAE,CACjE,CAAC;YACF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,OAAO,IAAI,EAAE;qBACpB;iBACF;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","debug_id":"f1b44bfa-e246-56f1-affa-624eaaeb4b91"}
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-sse.d.ts","sourceRoot":"/","sources":["mcp-sse.ts"],"names":[],"mappings":";AAmCA,wBAAsB,KAAK,kBAsE1B"}
1
+ {"version":3,"file":"mcp-sse.d.ts","sourceRoot":"/","sources":["mcp-sse.ts"],"names":[],"mappings":";AAcA,wBAAsB,KAAK,kBAuE1B"}
package/dist/mcp-sse.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]="ec071f2d-6d98-5b71-bce6-58436c1599e5")}catch(e){}}();
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]="1077fad8-46e0-5d35-8ffc-cc8350fa9d60")}catch(e){}}();
4
4
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
5
  import { addDocsTools } from './mcp/tools/docs.js';
6
6
  import { existsSync, readFileSync } from 'node:fs';
@@ -9,40 +9,22 @@ import { addGuidesTools } from './mcp/tools/guides.js';
9
9
  import express from 'express';
10
10
  import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
11
11
  import { logger } from './logging/logger.js';
12
- import { createServer } from 'node:http';
13
- async function findAvailablePort(startPort) {
14
- return new Promise((resolve, reject) => {
15
- const server = createServer();
16
- server.listen(startPort, () => {
17
- const port = server.address()?.port;
18
- server.close(() => resolve(port));
19
- });
20
- server.on('error', (err) => {
21
- if (err.code === 'EADDRINUSE') {
22
- // Port is in use, try the next one
23
- findAvailablePort(startPort + 1)
24
- .then(resolve)
25
- .catch(reject);
26
- }
27
- else {
28
- reject(err);
29
- }
30
- });
31
- });
32
- }
12
+ import { findAvailablePort } from './mcp/getPort.js';
13
+ import { exit } from './utils/shutdown.js';
33
14
  export async function start() {
34
15
  const stateFile = process.env.LOCADEX_FILES_STATE_FILE_PATH;
16
+ const logFile = process.env.LOCADEX_LOG_FILE_PATH;
35
17
  const requestedPort = process.env.PORT ? parseInt(process.env.PORT) : 8888;
36
18
  const port = await findAvailablePort(requestedPort);
37
19
  const verbose = process.env.LOCADEX_VERBOSE === 'true';
38
20
  const debug = process.env.LOCADEX_DEBUG === 'true';
39
- logger.initialize({ verbose, debug });
21
+ logger.initialize({ verbose, debug }, logFile);
40
22
  if (stateFile && existsSync(stateFile)) {
41
23
  const state = JSON.parse(readFileSync(stateFile, 'utf8'));
42
- logger.debugMessage(`[locadex-mcp] state: ${JSON.stringify(state, null, 2)}`);
24
+ logger.debugMessage(`[locadex-mcp-sse] state: ${JSON.stringify(state, null, 2)}`);
43
25
  }
44
26
  else {
45
- throw new Error(`[locadex-mcp] state file not found: ${stateFile}`);
27
+ throw new Error(`[locadex-mcp-sse] state file not found: ${stateFile}`);
46
28
  }
47
29
  const mcpServer = new McpServer({
48
30
  name: 'Locadex: AI Agent for Internationalization',
@@ -87,9 +69,9 @@ export async function start() {
87
69
  });
88
70
  }
89
71
  // Start the SSE server
90
- start().catch((error) => {
72
+ start().catch(async (error) => {
91
73
  logger.error(`[locadex-mcp-sse] Failed to start: ${error instanceof Error ? error.message : String(error)}`);
92
- process.exit(1);
74
+ await exit(1);
93
75
  });
94
76
  //# sourceMappingURL=mcp-sse.js.map
95
- //# debugId=ec071f2d-6d98-5b71-bce6-58436c1599e5
77
+ //# debugId=1077fad8-46e0-5d35-8ffc-cc8350fa9d60
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-sse.js","sources":["mcp-sse.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.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 express from 'express';\nimport { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';\nimport { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';\nimport { logger } from './logging/logger.js';\nimport { createServer } from 'node:http';\n\nasync function findAvailablePort(startPort: number): Promise<number> {\n return new Promise((resolve, reject) => {\n const server = createServer();\n\n server.listen(startPort, () => {\n const port = (server.address() as any)?.port;\n server.close(() => resolve(port));\n });\n\n server.on('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n // Port is in use, try the next one\n findAvailablePort(startPort + 1)\n .then(resolve)\n .catch(reject);\n } else {\n reject(err);\n }\n });\n });\n}\n\nexport async function start() {\n const stateFile = process.env.LOCADEX_FILES_STATE_FILE_PATH;\n const requestedPort = process.env.PORT ? parseInt(process.env.PORT) : 8888;\n const port = await findAvailablePort(requestedPort);\n\n const verbose = process.env.LOCADEX_VERBOSE === 'true';\n const debug = process.env.LOCADEX_DEBUG === 'true';\n\n logger.initialize({ verbose, debug });\n\n if (stateFile && existsSync(stateFile)) {\n const state = JSON.parse(readFileSync(stateFile, 'utf8'));\n logger.debugMessage(\n `[locadex-mcp] state: ${JSON.stringify(state, null, 2)}`\n );\n } else {\n throw new Error(`[locadex-mcp] state file not found: ${stateFile}`);\n }\n\n const mcpServer = new McpServer({\n name: 'Locadex: AI Agent for Internationalization',\n version: JSON.parse(readFileSync(fromPackageRoot('package.json'), 'utf8'))\n .version,\n });\n\n const app = express();\n app.use(express.json());\n\n // Store transports for each session type\n const transports = {\n streamable: {} as Record<string, StreamableHTTPServerTransport>,\n sse: {} as Record<string, SSEServerTransport>,\n };\n\n addDocsTools(mcpServer);\n addGuidesTools(mcpServer);\n\n // SSE endpoint for legacy clients\n // Claude Code only supports SSE as of 2025-06-04\n app.get('/sse', async (req, res) => {\n const transport = new SSEServerTransport('/messages', res);\n transports.sse[transport.sessionId] = transport;\n\n res.on('close', () => {\n delete transports.sse[transport.sessionId];\n });\n\n await mcpServer.connect(transport);\n });\n\n // Companion endpoint for sending messages\n app.post('/messages', async (req, res) => {\n const sessionId = req.query.sessionId as string;\n const transport = transports.sse[sessionId];\n if (transport) {\n await transport.handlePostMessage(req, res, req.body);\n } else {\n res.status(400).send('No transport found for sessionId');\n }\n });\n\n app.listen(port, () => {\n const portMessage =\n port !== requestedPort\n ? `${port} (requested ${requestedPort} was in use)`\n : `${port}`;\n logger.debugMessage(\n `[locadex-mcp] started on port ${portMessage} with state file ${stateFile}`\n );\n });\n}\n\n// Start the SSE server\nstart().catch((error) => {\n logger.error(\n `[locadex-mcp-sse] Failed to start: ${error instan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QACpB,MAAM,WAAW,GACf,IAAI,KAAK,aAAa;YACpB,CAAC,CAAC,GAAG,IAAI,eAAe,aAAa,cAAc;YACnD,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC;QAChB,MAAM,CAAC,YAAY,CACjB,iCAAiC,WAAW,oBAAoB,SAAS,EAAE,CAC5E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,uBAAuB;AACvB,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACtB,MAAM,CAAC,KAAK,CACV,sCAAsC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC/F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC","debug_id":"ec071f2d-6d98-5b71-bce6-58436c1599e5"}
1
+ {"version":3,"file":"mcp-sse.js","sources":["mcp-sse.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.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 express from 'express';\nimport { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';\nimport { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';\nimport { logger } from './logging/logger.js';\nimport { findAvailablePort } from './mcp/getPort.js';\nimport { exit } from './utils/shutdown.js';\n\nexport async function start() {\n const stateFile = process.env.LOCADEX_FILES_STATE_FILE_PATH;\n const logFile = process.env.LOCADEX_LOG_FILE_PATH;\n const requestedPort = process.env.PORT ? parseInt(process.env.PORT) : 8888;\n const port = await findAvailablePort(requestedPort);\n\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.debugMessage(\n `[locadex-mcp-sse] state: ${JSON.stringify(state, null, 2)}`\n );\n } else {\n throw new Error(`[locadex-mcp-sse] state file not found: ${stateFile}`);\n }\n\n const mcpServer = new McpServer({\n name: 'Locadex: AI Agent for Internationalization',\n version: JSON.parse(readFileSync(fromPackageRoot('package.json'), 'utf8'))\n .version,\n });\n\n const app = express();\n app.use(express.json());\n\n // Store transports for each session type\n const transports = {\n streamable: {} as Record<string, StreamableHTTPServerTransport>,\n sse: {} as Record<string, SSEServerTransport>,\n };\n\n addDocsTools(mcpServer);\n addGuidesTools(mcpServer);\n\n // SSE endpoint for legacy clients\n // Claude Code only supports SSE as of 2025-06-04\n app.get('/sse', async (req, res) => {\n const transport = new SSEServerTransport('/messages', res);\n transports.sse[transport.sessionId] = transport;\n\n res.on('close', () => {\n delete transports.sse[transport.sessionId];\n });\n\n await mcpServer.connect(transport);\n });\n\n // Companion endpoint for sending messages\n app.post('/messages', async (req, res) => {\n const sessionId = req.query.sessionId as string;\n const transport = transports.sse[sessionId];\n if (transport) {\n await transport.handlePostMessage(req, res, req.body);\n } else {\n res.status(400).send('No transport found for sessionId');\n }\n });\n\n app.listen(port, () => {\n const portMessage =\n port !== requestedPort\n ? `${port} (requested ${requestedPort} was in use)`\n : `${port}`;\n logger.debugMessage(\n `[locadex-mcp] started on port ${portMessage} with state file ${stateFile}`\n );\n });\n}\n\n// Start the SSE server\nstart().catch(async (error) => {\n logger.error(\n `[locadex-mcp-sse] Failed to start: ${error instanceof Error ? error.message : String(error)}`\n );\n await exit(1);\n});\n"],"names":[],"mappings":";;;AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,YAAY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,KAAK,CAAC,SAAmB,CAAC;QAChD,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACpB,MAAM,WAAW,GACf,IAAI,KAAK,aAAa;YACpB,CAAC,CAAC,GAAG,IAAI,eAAe,aAAa,cAAc;YACnD,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC;QAChB,MAAM,CAAC,YAAY,CACjB,iCAAiC,WAAW,oBAAoB,SAAS,EAAE,CAC5E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,uBAAuB;AACvB,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IAC5B,MAAM,CAAC,KAAK,CACV,sCAAsC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC/F,CAAC;IACF,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;AAChB,CAAC,CAAC,CAAC","debug_id":"1077fad8-46e0-5d35-8ffc-cc8350fa9d60"}
@@ -0,0 +1,2 @@
1
+ export declare function i18nTask(): Promise<void>;
2
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["tasks/i18n.ts"],"names":[],"mappings":"AA0BA,wBAAsB,QAAQ,kBAwR7B"}
@@ -0,0 +1,317 @@
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]="7fc29ecc-f339-52f2-9748-babdbdd4afb9")}catch(e){}}();
3
+ import { createSpinner } from '../logging/console.js';
4
+ import { allMcpPrompt } from '../prompts/system.js';
5
+ import { exit } from '../utils/shutdown.js';
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
+ import { LocadexManager } from '../utils/locadexManager.js';
10
+ import { addFilesToManager, markFileAsEdited, markFileAsInProgress, } from '../utils/getFiles.js';
11
+ import { outro } from '@clack/prompts';
12
+ import chalk from 'chalk';
13
+ import { appendFileSync } from 'node:fs';
14
+ import { validateInitialConfig } from '../utils/config.js';
15
+ import { detectFormatter, formatFiles } from 'gtx-cli/hooks/postProcess';
16
+ import { generateSettings } from 'gtx-cli/config/generateSettings';
17
+ import path from 'node:path';
18
+ import { findSourceFiles } from '../utils/dag/matchFiles.js';
19
+ export async function i18nTask() {
20
+ await validateInitialConfig();
21
+ const gtSettings = await generateSettings({});
22
+ if (gtSettings.framework !== 'next-app') {
23
+ logger.error('Currently, locadex only supports Next.js App Router. Please use Next.js App Router.');
24
+ await exit(1);
25
+ }
26
+ // Init message
27
+ const spinner = createSpinner();
28
+ spinner.start('Initializing Locadex...');
29
+ const manager = LocadexManager.getInstance();
30
+ const config = manager.getConfig();
31
+ const allFiles = findSourceFiles(config.matchingFiles, config.matchingExtensions);
32
+ const dag = createDag(allFiles, {
33
+ tsConfig: findTsConfig(),
34
+ webpackConfig: findWebpackConfig(),
35
+ requireConfig: findRequireConfig(),
36
+ });
37
+ const filesStateFilePath = manager.getFilesStateFilePath();
38
+ const concurrency = manager.getMaxConcurrency();
39
+ const batchSize = manager.getBatchSize();
40
+ // Create the list of files (aka tasks) to process
41
+ const taskQueue = [...dag.getTopologicalOrder()];
42
+ const topologicalOrder = [...dag.getTopologicalOrder()];
43
+ // Add files to manager
44
+ const stateFilePath = addFilesToManager(filesStateFilePath, taskQueue);
45
+ spinner.stop('Locadex initialized');
46
+ logger.verboseMessage(`Number of files to process: ${dag.getTopologicalOrder().length}`);
47
+ logger.message(`Using ${concurrency} concurrent agents`);
48
+ logger.debugMessage(`Track progress here: ${stateFilePath}`);
49
+ logger.debugMessage(`Order:\n${taskQueue.join('\n')}`);
50
+ logger.initializeProgressBar(taskQueue.length);
51
+ const fileProcessingStartTime = Date.now();
52
+ logger.progressBar.start(`Processing ${taskQueue.length} files...`);
53
+ // Main parallel processing loop
54
+ let processedCount = 0;
55
+ const abortController = new AbortController();
56
+ let firstError = null;
57
+ // Mutex for task queue access
58
+ let taskQueueMutex = Promise.resolve();
59
+ // Shared across all agents
60
+ const reports = [];
61
+ // Helper function to safely get tasks from queue
62
+ const getNextTasks = async (batchSize) => {
63
+ return new Promise((resolve) => {
64
+ taskQueueMutex = taskQueueMutex.then(() => {
65
+ const tasks = taskQueue.splice(0, batchSize);
66
+ resolve(tasks);
67
+ });
68
+ });
69
+ };
70
+ const processTask = async () => {
71
+ while (taskQueue.length > 0 && !abortController.signal.aborted) {
72
+ // Check if we should abort early
73
+ if (abortController.signal.aborted) {
74
+ return;
75
+ }
76
+ // Get an available agent atomically
77
+ const agentInfo = await manager.getAvailableAgent();
78
+ if (!agentInfo) {
79
+ // No available agents, wait a bit (but check for abort)
80
+ await new Promise((resolve) => {
81
+ const timeout = global.setTimeout(resolve, 100);
82
+ abortController.signal.addEventListener('abort', () => {
83
+ global.clearTimeout(timeout);
84
+ resolve(undefined);
85
+ });
86
+ });
87
+ continue;
88
+ }
89
+ const { id: agentId, agent, sessionId } = agentInfo;
90
+ // Get the next batch of tasks (thread-safe)
91
+ const tasks = await getNextTasks(batchSize);
92
+ if (tasks.length === 0) {
93
+ manager.markAgentFree(agentId);
94
+ break;
95
+ }
96
+ logger.debugMessage(`Using agent ${agentId} for ${batchSize} files. Files: ${tasks.join(', ')}`);
97
+ // Mark tasks as in progress
98
+ await Promise.all(tasks.map((task) => markFileAsInProgress(task, filesStateFilePath)));
99
+ // Construct prompt
100
+ const dependencies = Object.fromEntries(tasks.map((task) => [
101
+ task,
102
+ Array.from(new Set(dag.getDependencies(task))),
103
+ ]));
104
+ const dependents = Object.fromEntries(tasks.map((task) => [
105
+ task,
106
+ Array.from(new Set(dag.getDependents(task))),
107
+ ]));
108
+ const prompt = getPrompt({
109
+ targetFile: tasks,
110
+ dependencyFiles: dependencies,
111
+ dependentFiles: dependents,
112
+ });
113
+ // Claude call
114
+ try {
115
+ await agent.run({
116
+ prompt,
117
+ sessionId,
118
+ }, {});
119
+ reports.push(agent.generateReport());
120
+ manager.markAgentFree(agentId);
121
+ }
122
+ catch (error) {
123
+ // Capture the first error and signal all other agents to abort
124
+ if (!firstError) {
125
+ firstError = new Error(`[i18n] Error in claude i18n process (agent ${agentId}): ${error}`);
126
+ logger.debugMessage(firstError.message);
127
+ abortController.abort();
128
+ manager.cleanupAgents();
129
+ }
130
+ manager.markAgentFree(agentId);
131
+ return; // Exit this agent's processing immediately
132
+ }
133
+ // Mark tasks as complete
134
+ await Promise.all(tasks.map((task) => markFileAsEdited(task, filesStateFilePath)));
135
+ processedCount += tasks.length;
136
+ logger.progressBar.advance(tasks.length, `Processed ${Number((processedCount / topologicalOrder.length) * 100).toFixed(2)}% of files`);
137
+ manager.stats.updateStats({
138
+ newProcessedFiles: tasks.length,
139
+ });
140
+ }
141
+ };
142
+ // Create agent pool
143
+ manager.createAgentPool();
144
+ // Start parallel processing
145
+ const processingPromises = Array.from({ length: concurrency }, () => processTask());
146
+ try {
147
+ await Promise.all(processingPromises);
148
+ }
149
+ catch (error) {
150
+ // This shouldn't happen since we handle errors within processTask
151
+ logger.debugMessage(`[i18n] Unexpected error in parallel processing: ${error}`);
152
+ if (!firstError) {
153
+ firstError = new Error(`Unexpected error in parallel processing: ${error}`);
154
+ }
155
+ }
156
+ logger.progressBar.stop(`Processed ${topologicalOrder.length} files [${Math.round((Date.now() - fileProcessingStartTime) / 1000)}s]`);
157
+ // TODO: uncomment
158
+ // // Always clean up the file list when done, regardless of success or failure
159
+ // logger.info(`Cleaning up file list: ${stateFilePath}`);
160
+ // cleanUp(stateFilePath);
161
+ // If there was an error, clean up and exit with code 1
162
+ if (firstError) {
163
+ manager.cleanupAgents();
164
+ logger.error(firstError.message);
165
+ outro(chalk.red('❌ Locadex i18n failed!'));
166
+ await exit(1);
167
+ }
168
+ // Create a clean agent for cleanup
169
+ const cleanupAgent = manager.createSingleAgent('claude_cleanup_agent');
170
+ logger.initializeSpinner();
171
+ logger.spinner.start('Fixing errors...');
172
+ const fixPrompt = getFixPrompt();
173
+ try {
174
+ await cleanupAgent.run({ prompt: fixPrompt, sessionId: cleanupAgent.getSessionId() }, {});
175
+ reports.push(`## Fixed errors\n${cleanupAgent.generateReport()}`);
176
+ }
177
+ catch (error) {
178
+ manager.cleanupAgents();
179
+ logger.debugMessage(`[claude_cleanup_agent] Fixing errors failed: ${error}`);
180
+ manager.stats.recordTelemetry(false);
181
+ outro(chalk.red('❌ Locadex i18n failed!'));
182
+ await exit(1);
183
+ }
184
+ logger.spinner.stop('Fixed errors');
185
+ // Generate report
186
+ const reportSummary = `# Summary of locadex i18n changes
187
+ ${reports.join('\n')}`;
188
+ const summaryFilePath = path.join(manager.getWorkingDir(), 'locadex-report.md');
189
+ appendFileSync(summaryFilePath, reportSummary);
190
+ logger.step(`Saved summary of changes to: ${summaryFilePath}`);
191
+ // cleanup
192
+ const formatter = await detectFormatter();
193
+ if (formatter) {
194
+ await formatFiles(topologicalOrder, formatter);
195
+ }
196
+ // Clean up after successful completion
197
+ manager.cleanup();
198
+ logger.info(chalk.dim(`Total Cost: $${manager.stats.getStats().totalCost.toFixed(2)}
199
+ Total wall time: ${Math.round((Date.now() - manager.stats.getStats().startTime) / 1000)}s
200
+ Total files processed: ${manager.stats.getStats().processedFiles}`));
201
+ const finalStats = manager.stats.getStats();
202
+ // Record telemetry for final stats
203
+ manager.stats.recordTelemetry(true);
204
+ logger.verboseMessage(`Total input tokens: ${finalStats.inputTokens}
205
+ Total cached input tokens: ${finalStats.cachedInputTokens}
206
+ Total output tokens: ${finalStats.outputTokens}
207
+ Total turns: ${finalStats.turns}`);
208
+ outro(chalk.green('✅ Locadex i18n complete!'));
209
+ await exit(0);
210
+ }
211
+ function getPrompt({ targetFile, dependencyFiles, dependentFiles, }) {
212
+ const prompt = `# Task: Internationalize the target file(s) using gt-next.
213
+
214
+ ## INSTRUCTIONS
215
+
216
+ - You are given a list of target files and their corresponding dependency/dependent files.
217
+ - The project is already setup for internationalization. Do not try to setup the project again for i18n.
218
+
219
+ ## Workflow:
220
+ 1. **Gather context** Read the target files closely (you should not have to read the dependency/dependent files).
221
+ 2. **Evaluate if i18n is necessary** Evaluate if the target files need to be internationalized using gt-next
222
+ - 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.
223
+ **IMPORTANT**: IF NONE OF THE TARGET FILES NEED TO BE INTERNATIONALIZED, YOUR TASK IS COMPLETE AND YOU MAY RETURN.
224
+ 3. **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:
225
+ - 3.a. Does this file contain a component? If so, is it a server-side component or a client-side component?
226
+ - 3.b. Is the content that needs to be i18ned being used in this same file, or is it being used in another file?
227
+ - 3.c. Is there any string interpolation that needs to be i18ned?
228
+ - 3.d. Is there any conditional logic or rendering that needs to be i18ned?
229
+ - 3.e. Is the content that needs to be i18ned HTML/JSX or a string?
230
+ 4. **Internationalize** You now have the necessary knowledge. Internationalize the files using the information from the tools provided to you.
231
+ - 4.a. Do not worry about running tsc. We will do that later.
232
+
233
+ ## RULES:
234
+ - ALWAYS use the <T> component to internationalize HTML/JSX content.
235
+ - ALWAYS use getGT() or useGT() and getDict() or useDict() to internationalize string content (strings created with '', "", or \`\`).
236
+ - When possible, avoid using getDict() or useDict(); getGT() and useGT() are preferred.
237
+ - DO NOT internationalize non-user facing content or content that is functional, such as ids, class names, error strings, logical strings, etc.
238
+ - Do not add i18n middleware to the app.
239
+ - When adding 'useGT()' or 'useDict()' to a client component, you must add 'use client' to the top of the file.
240
+ - Always adhere to the guides provided via the 'mcp__locadex__' tools.
241
+ - These guides provide additional knowledge about how to internationalize the content.
242
+ - Minimize the footprint of your changes.
243
+ - Focus on internationalizing the content of the target files.
244
+ - NEVER move internationalized content to a different file. All content MUST remain in the same file where it came from.
245
+ - NEVER CREATE OR REMOVE ANY FILES (especially .bak files)
246
+ - Internationalize all user facing content in the target files.
247
+ - NEVER EDIT FILES THAT ARE NOT GIVEN TO YOU.
248
+
249
+ ## TARGET FILE INFORMATION
250
+ ${targetFile.map((file, index) => `
251
+ TARGET FILE ${index + 1}:
252
+ ${file}
253
+
254
+ DEPENDENCY FILES (files imported by target file ${index + 1}):
255
+ ${dependencyFiles[file].length > 0 ? ` ${dependencyFiles[file].join(', ')}` : 'none'}
256
+
257
+ DEPENDENT FILES (files that import target file ${index + 1}):
258
+ ${dependentFiles[file].length > 0 ? ` ${dependentFiles[file].join(', ')}` : 'none'}
259
+ `)}
260
+
261
+ ---
262
+
263
+ ## MCP TOOLS
264
+
265
+ ${allMcpPrompt}
266
+
267
+ ## Final output
268
+ - When you are done, please return a brief summary of the files you modified, following this format.
269
+ - **DO NOT** include any other text in your response.
270
+ - If there were issues with some files, please include the issues in the list of changes for that file.
271
+
272
+ [file 1 path]
273
+ - List of changes to file 1
274
+ `;
275
+ return prompt;
276
+ }
277
+ // check (dry run and ts check) should be at the end
278
+ function getFixPrompt() {
279
+ const prompt = `# Task: Fix internationalization errors in the project.
280
+
281
+ ## INSTRUCTIONS
282
+
283
+ Previously, you helped me internationalize a set of files in this project.
284
+ Your new task is as follows:
285
+
286
+ 1. Run the gt-next validator.
287
+ 2. Fix all errors output by the gt-next validator.
288
+ 3. Whenever you are finished with your changes, run the gt-next validator.
289
+ 4. Repeat steps 1-3 until there are no more errors, or until you believe that you have fixed all errors.
290
+ 5. If the project is setup with linting, lint the project and fix all lint errors.
291
+
292
+ ## RULES:
293
+ - ONLY modify files that are relevant to the internationalization of the project.
294
+ - ONLY fix errors that result from your current or previous implementation.
295
+ - Resolve unused imports from 'gt-next'.
296
+ - In particular, if a file contains user-facing content that should be internationalized and is not, you should internationalize it.
297
+ - Resolve missing imports from 'gt-next'. If a file is missing an import from 'gt-next', add it.
298
+
299
+ To run the gt-next validator, run the following command:
300
+ 'npx locadex translate --dry-run'
301
+
302
+ ## MCP TOOLS
303
+
304
+ ${allMcpPrompt}
305
+
306
+ ## Final output
307
+ - When you are done, please return a brief summary of the files you modified, following this format.
308
+ - **DO NOT** include any other text in your response.
309
+ - If there were issues with some files, please include the issues in the list of changes for that file.
310
+
311
+ [file 1 path]
312
+ - List of changes to file 1
313
+ `;
314
+ return prompt;
315
+ }
316
+ //# sourceMappingURL=i18n.js.map
317
+ //# debugId=7fc29ecc-f339-52f2-9748-babdbdd4afb9
@@ -0,0 +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/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';\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 // 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 const dag = createDag(allFiles, {\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 // 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,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC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EAAE,CAC9B,CAAC;IAEF,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAC/C,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,SAAS,CAAC,EACjB,UAAU,EACV,eAAe,EACf,cAAc,GAKf;IACC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCf,UAAU,CAAC,GAAG,CACd,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;cACL,KAAK,GAAG,CAAC;EACrB,IAAI;;kDAE4C,KAAK,GAAG,CAAC;EACzD,eAAe,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;;iDAEnC,KAAK,GAAG,CAAC;EACxD,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;CACjF,CACA;;;;;;EAMC,YAAY;;;;;;;;;CASb,CAAC;IAEA,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,oDAAoD;AAEpD,SAAS,YAAY;IACnB,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;EAyBf,YAAY;;;;;;;;;CASb,CAAC;IAEA,OAAO,MAAM,CAAC;AAChB,CAAC","debug_id":"7fc29ecc-f339-52f2-9748-babdbdd4afb9"}
@@ -0,0 +1,2 @@
1
+ export declare function setupTask(bypassPrompts: boolean, specifiedPackageManager?: string): Promise<void>;
2
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["tasks/setup.ts"],"names":[],"mappings":"AA6BA,wBAAsB,SAAS,CAC7B,aAAa,EAAE,OAAO,EACtB,uBAAuB,CAAC,EAAE,MAAM,iBA2HjC"}