locadex 0.1.0-alpha.9 → 0.1.0
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 +12 -0
- package/README.md +3 -5
- package/dist/cli.js +11 -10
- package/dist/cli.js.map +1 -1
- package/dist/commands/i18n.d.ts.map +1 -1
- package/dist/commands/i18n.js +15 -14
- package/dist/commands/i18n.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +15 -14
- package/dist/commands/setup.js.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/logging/console.js +2 -5
- package/dist/logging/console.js.map +1 -1
- package/dist/logging/logger.d.ts +4 -2
- package/dist/logging/logger.d.ts.map +1 -1
- package/dist/logging/logger.js +1 -4
- package/dist/logging/logger.js.map +1 -1
- package/dist/mcp/getDocs.js +1 -4
- package/dist/mcp/getDocs.js.map +1 -1
- package/dist/mcp/getGuide.js +1 -4
- package/dist/mcp/getGuide.js.map +1 -1
- package/dist/mcp/getPort.js +1 -4
- package/dist/mcp/getPort.js.map +1 -1
- package/dist/mcp/tools/docs.js +1 -4
- package/dist/mcp/tools/docs.js.map +1 -1
- package/dist/mcp/tools/guides.js +1 -4
- package/dist/mcp/tools/guides.js.map +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +57 -17
- package/dist/mcp.js.map +1 -1
- package/dist/prompts/system.js +1 -4
- package/dist/prompts/system.js.map +1 -1
- package/dist/tasks/concurrency.d.ts +72 -0
- package/dist/tasks/concurrency.d.ts.map +1 -0
- package/dist/tasks/concurrency.js +132 -0
- package/dist/tasks/concurrency.js.map +1 -0
- package/dist/tasks/i18n.d.ts.map +1 -1
- package/dist/tasks/i18n.js +60 -127
- package/dist/tasks/i18n.js.map +1 -1
- package/dist/tasks/setup.d.ts.map +1 -1
- package/dist/tasks/setup.js +38 -44
- package/dist/tasks/setup.js.map +1 -1
- package/dist/telemetry.js +1 -4
- package/dist/telemetry.js.map +1 -1
- package/dist/types/claude-sdk.d.ts +1 -1
- package/dist/types/claude-sdk.d.ts.map +1 -1
- package/dist/types/claude-sdk.js +1 -4
- package/dist/types/claude-sdk.js.map +1 -1
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/cli.js +1 -4
- package/dist/types/cli.js.map +1 -1
- package/dist/utils/claudeCode.d.ts +6 -5
- package/dist/utils/claudeCode.d.ts.map +1 -1
- package/dist/utils/claudeCode.js +50 -17
- package/dist/utils/claudeCode.js.map +1 -1
- package/dist/utils/config.d.ts +4 -3
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +33 -20
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/dag/createDag.d.ts.map +1 -1
- package/dist/utils/dag/createDag.js +10 -11
- package/dist/utils/dag/createDag.js.map +1 -1
- package/dist/utils/dag/extractFiles.d.ts.map +1 -1
- package/dist/utils/dag/extractFiles.js +6 -9
- package/dist/utils/dag/extractFiles.js.map +1 -1
- package/dist/utils/dag/getFiles.d.ts +1 -12
- package/dist/utils/dag/getFiles.d.ts.map +1 -1
- package/dist/utils/dag/getFiles.js +5 -53
- package/dist/utils/dag/getFiles.js.map +1 -1
- package/dist/utils/dag/matchFiles.d.ts +2 -2
- package/dist/utils/dag/matchFiles.d.ts.map +1 -1
- package/dist/utils/dag/matchFiles.js +3 -6
- package/dist/utils/dag/matchFiles.js.map +1 -1
- package/dist/utils/fs/findConfigs.d.ts +4 -4
- package/dist/utils/fs/findConfigs.d.ts.map +1 -1
- package/dist/utils/fs/findConfigs.js +7 -13
- package/dist/utils/fs/findConfigs.js.map +1 -1
- package/dist/utils/fs/getFiles.d.ts +1 -1
- package/dist/utils/fs/getFiles.d.ts.map +1 -1
- package/dist/utils/fs/getFiles.js +3 -6
- package/dist/utils/fs/getFiles.js.map +1 -1
- package/dist/utils/fs/git.d.ts +6 -0
- package/dist/utils/fs/git.d.ts.map +1 -0
- package/dist/utils/fs/git.js +32 -0
- package/dist/utils/fs/git.js.map +1 -0
- package/dist/utils/fs/writeFiles.js +1 -4
- package/dist/utils/fs/writeFiles.js.map +1 -1
- package/dist/utils/getPaths.js +1 -4
- package/dist/utils/getPaths.js.map +1 -1
- package/dist/utils/locadexManager.d.ts +15 -5
- package/dist/utils/locadexManager.d.ts.map +1 -1
- package/dist/utils/locadexManager.js +80 -73
- package/dist/utils/locadexManager.js.map +1 -1
- package/dist/utils/lockfile.d.ts +2 -2
- package/dist/utils/lockfile.d.ts.map +1 -1
- package/dist/utils/lockfile.js +8 -17
- package/dist/utils/lockfile.js.map +1 -1
- package/dist/utils/packages/installPackage.d.ts +4 -0
- package/dist/utils/packages/installPackage.d.ts.map +1 -1
- package/dist/utils/packages/installPackage.js +41 -5
- package/dist/utils/packages/installPackage.js.map +1 -1
- package/dist/utils/session.js +1 -4
- package/dist/utils/session.js.map +1 -1
- package/dist/utils/shared.js +1 -4
- package/dist/utils/shared.js.map +1 -1
- package/dist/utils/shutdown.d.ts.map +1 -1
- package/dist/utils/shutdown.js +1 -9
- package/dist/utils/shutdown.js.map +1 -1
- package/dist/utils/stats.js +1 -4
- package/dist/utils/stats.js.map +1 -1
- package/guides/next/advanced/var-outside-client-server-component.md +1 -1
- package/package.json +4 -6
- package/dist/mcp/debugger.d.ts +0 -3
- package/dist/mcp/debugger.d.ts.map +0 -1
- package/dist/mcp/debugger.js +0 -37
- package/dist/mcp/debugger.js.map +0 -1
- package/dist/mcp-sse.d.ts +0 -3
- package/dist/mcp-sse.d.ts.map +0 -1
- package/dist/mcp-sse.js +0 -77
- package/dist/mcp-sse.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# locadex
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#358](https://github.com/generaltranslation/gt/pull/358) [`b0ea226`](https://github.com/generaltranslation/gt/commit/b0ea226310abb04ef5aa9ef1af23ee37b9e18cd1) Thanks [@brian-lou](https://github.com/brian-lou)! - Release Locadex (Beta) version
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`b0ea226`](https://github.com/generaltranslation/gt/commit/b0ea226310abb04ef5aa9ef1af23ee37b9e18cd1)]:
|
|
12
|
+
- gtx-cli@1.2.24
|
package/README.md
CHANGED
|
@@ -6,17 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
# Locadex
|
|
8
8
|
|
|
9
|
-
Locadex is an AI
|
|
10
|
-
|
|
11
|
-
Start it with
|
|
9
|
+
Locadex is an AI agent to automate i18n in complex codebases.
|
|
12
10
|
|
|
13
11
|
```bash
|
|
14
|
-
npx locadex@latest
|
|
12
|
+
npx locadex@latest start
|
|
15
13
|
```
|
|
16
14
|
|
|
17
15
|
## Documentation
|
|
18
16
|
|
|
19
|
-
Full documentation, including guides, examples, and API references, can be found at [General Translation Docs](generaltranslation.com/docs).
|
|
17
|
+
Full documentation, including guides, examples, and API references, can be found at [General Translation Docs](https://generaltranslation.com/docs).
|
|
20
18
|
|
|
21
19
|
## Contributing
|
|
22
20
|
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
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]="959468dc-cf43-5ab1-8999-d1c300fa7053")}catch(e){}}();
|
|
4
2
|
import dotenv from 'dotenv';
|
|
5
3
|
dotenv.config({ path: '.env' });
|
|
6
4
|
dotenv.config({ path: '.env.local', override: true });
|
|
@@ -23,24 +21,27 @@ program
|
|
|
23
21
|
.description('Run Locadex on your project')
|
|
24
22
|
.option('-v, --verbose', 'Verbose output')
|
|
25
23
|
.option('-d, --debug', 'Debug output')
|
|
26
|
-
.option('-b, --batch-size <number>', 'File batch size'
|
|
27
|
-
.option('-
|
|
28
|
-
.option('-
|
|
24
|
+
.option('-b, --batch-size <number>', 'File batch size')
|
|
25
|
+
.option('-t, --timeout <number>', 'Timeout for each file in a batch')
|
|
26
|
+
.option('-c, --concurrency <number>', 'Max number of concurrent agents')
|
|
27
|
+
.option('-m, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.')
|
|
29
28
|
.option('--package-manager <manager>', 'Package manager to use. (npm, pnpm, yarn_v1, yarn_v2, bun, deno)')
|
|
30
29
|
.option('-y, --bypass-prompts', 'Bypass interactive prompts')
|
|
31
30
|
.option('--no-telemetry', 'Disable telemetry')
|
|
31
|
+
.option('--app-dir <dir>', 'Relative path to the application directory', '.')
|
|
32
32
|
.action(setupCommand);
|
|
33
33
|
program
|
|
34
34
|
.command('i18n')
|
|
35
35
|
.description('Run Locadex i18n on your project')
|
|
36
36
|
.option('-v, --verbose', 'Verbose output')
|
|
37
37
|
.option('-d, --debug', 'Debug output')
|
|
38
|
-
.option('-b, --batch-size <number>', 'File batch size'
|
|
39
|
-
.option('-
|
|
40
|
-
.option('-
|
|
38
|
+
.option('-b, --batch-size <number>', 'File batch size')
|
|
39
|
+
.option('-t, --timeout <number>', 'Timeout for each file in a batch')
|
|
40
|
+
.option('-c, --concurrency <number>', 'Max number of concurrent agents')
|
|
41
|
+
.option('-m, --match-files <pattern>', 'Comma-separated list of glob patterns to match source files. Should be relative to root directory.')
|
|
41
42
|
.option('--no-telemetry', 'Disable telemetry')
|
|
43
|
+
.option('--app-dir <dir>', 'Relative path to the application directory', '.')
|
|
42
44
|
.action(i18nCommand);
|
|
43
45
|
main(program);
|
|
44
46
|
program.parse();
|
|
45
|
-
//# sourceMappingURL=cli.js.map
|
|
46
|
-
//# debugId=959468dc-cf43-5ab1-8999-d1c300fa7053
|
|
47
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sources":["cli.ts"],"
|
|
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,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;AAErC,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,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,CACL,6BAA6B,EAC7B,kEAAkE,CACnE;KACA,MAAM,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;KAC5D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;KAC7C,MAAM,CAAC,iBAAiB,EAAE,4CAA4C,EAAE,GAAG,CAAC;KAC5E,MAAM,CAAC,YAAY,CAAC,CAAC;AAExB,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,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 { Command } from 'commander';\nimport { readFileSync } from 'node:fs';\nimport { fromPackageRoot } from './utils/getPaths.js';\nimport { setupCommand } from './commands/setup.js';\nimport { i18nCommand } from './commands/i18n.js';\nimport { main } from 'gtx-cli/index';\n\nconst packageJson = JSON.parse(\n readFileSync(fromPackageRoot('package.json'), 'utf8')\n);\n\nconst program = new Command();\n\nprogram\n .name('locadex')\n .description('AI agent for internationalization')\n .version(packageJson.version);\n\nprogram\n .command('start')\n .description('Run Locadex on your project')\n .option('-v, --verbose', 'Verbose output')\n .option('-d, --debug', 'Debug output')\n .option('-b, --batch-size <number>', 'File batch size')\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\nmain(program);\n\nprogram.parse();\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["commands/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"/","sources":["commands/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7C,wBAAsB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,iBAqCtE"}
|
package/dist/commands/i18n.js
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
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]="cc9ba649-3dd8-541f-b697-dbaabc4d678a")}catch(e){}}();
|
|
3
|
-
import { logger } from '../logging/logger.js';
|
|
4
1
|
import { i18nTask } from '../tasks/i18n.js';
|
|
5
2
|
import { withTelemetry } from '../telemetry.js';
|
|
6
3
|
import { LocadexManager } from '../utils/locadexManager.js';
|
|
7
4
|
import { displayHeader } from '../logging/console.js';
|
|
8
|
-
import
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { validateConfig } from '../utils/config.js';
|
|
9
7
|
export async function i18nCommand(options, command) {
|
|
10
8
|
const parentOptions = command.parent?.opts() || {};
|
|
11
9
|
const allOptions = { ...parentOptions, ...options };
|
|
12
10
|
const telemetryEnabled = !allOptions.noTelemetry;
|
|
13
11
|
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
14
|
-
|
|
15
|
-
const concurrency = Number(allOptions.concurrency) || 1;
|
|
16
|
-
if (concurrency < 1 || batchSize < 1) {
|
|
17
|
-
logger.error('Batch size and concurrency must be greater than 0');
|
|
18
|
-
await exit(1);
|
|
19
|
-
}
|
|
12
|
+
await validateConfig(allOptions);
|
|
20
13
|
displayHeader(telemetryEnabled);
|
|
21
14
|
LocadexManager.initialize({
|
|
15
|
+
rootDirectory: process.cwd(),
|
|
16
|
+
appDirectory: path.resolve(process.cwd(), allOptions.appDir),
|
|
22
17
|
mcpTransport: 'sse',
|
|
23
18
|
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
24
19
|
metadata: {},
|
|
@@ -29,12 +24,18 @@ export async function i18nCommand(options, command) {
|
|
|
29
24
|
.split(',')
|
|
30
25
|
.map((file) => file.trim()),
|
|
31
26
|
}),
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
...(allOptions.concurrency && {
|
|
28
|
+
maxConcurrency: Number(allOptions.concurrency),
|
|
29
|
+
}),
|
|
30
|
+
...(allOptions.batchSize && {
|
|
31
|
+
batchSize: Number(allOptions.batchSize),
|
|
32
|
+
}),
|
|
33
|
+
...(allOptions.timeout && {
|
|
34
|
+
timeout: Number(allOptions.timeout),
|
|
35
|
+
}),
|
|
34
36
|
},
|
|
35
37
|
});
|
|
36
38
|
await i18nTask();
|
|
37
39
|
});
|
|
38
40
|
}
|
|
39
|
-
//# sourceMappingURL=i18n.js.map
|
|
40
|
-
//# debugId=cc9ba649-3dd8-541f-b697-dbaabc4d678a
|
|
41
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","
|
|
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;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AAC,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"/","sources":["commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
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"}
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
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]="0234f3c4-20e5-57b1-95fc-8c874a072c67")}catch(e){}}();
|
|
3
|
-
import { logger } from '../logging/logger.js';
|
|
4
1
|
import { setupTask } from '../tasks/setup.js';
|
|
5
2
|
import { withTelemetry } from '../telemetry.js';
|
|
6
3
|
import { LocadexManager } from '../utils/locadexManager.js';
|
|
7
4
|
import { displayHeader } from '../logging/console.js';
|
|
8
|
-
import
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { validateConfig } from '../utils/config.js';
|
|
9
7
|
export async function setupCommand(options, command) {
|
|
10
8
|
const parentOptions = command.parent?.opts() || {};
|
|
11
9
|
const allOptions = { ...parentOptions, ...options };
|
|
12
10
|
const telemetryEnabled = !allOptions.noTelemetry;
|
|
13
11
|
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
14
|
-
|
|
15
|
-
const concurrency = Number(allOptions.concurrency) || 1;
|
|
16
|
-
if (concurrency < 1 || batchSize < 1) {
|
|
17
|
-
logger.error('Batch size and concurrency must be greater than 0');
|
|
18
|
-
await exit(1);
|
|
19
|
-
}
|
|
12
|
+
await validateConfig(allOptions);
|
|
20
13
|
displayHeader(telemetryEnabled);
|
|
21
14
|
LocadexManager.initialize({
|
|
15
|
+
rootDirectory: process.cwd(),
|
|
16
|
+
appDirectory: path.resolve(process.cwd(), allOptions.appDir),
|
|
22
17
|
mcpTransport: 'sse',
|
|
23
18
|
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
24
19
|
metadata: {},
|
|
@@ -29,12 +24,18 @@ export async function setupCommand(options, command) {
|
|
|
29
24
|
.split(',')
|
|
30
25
|
.map((file) => file.trim()),
|
|
31
26
|
}),
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
...(allOptions.concurrency && {
|
|
28
|
+
maxConcurrency: Number(allOptions.concurrency),
|
|
29
|
+
}),
|
|
30
|
+
...(allOptions.batchSize && {
|
|
31
|
+
batchSize: Number(allOptions.batchSize),
|
|
32
|
+
}),
|
|
33
|
+
...(allOptions.timeout && {
|
|
34
|
+
timeout: Number(allOptions.timeout),
|
|
35
|
+
}),
|
|
34
36
|
},
|
|
35
37
|
});
|
|
36
38
|
await setupTask(!!allOptions.bypassPrompts, allOptions.packageManager);
|
|
37
39
|
});
|
|
38
40
|
}
|
|
39
|
-
//# sourceMappingURL=setup.js.map
|
|
40
|
-
//# debugId=0234f3c4-20e5-57b1-95fc-8c874a072c67
|
|
41
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sources":["commands/setup.ts"],"
|
|
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,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AC,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"]}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
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]="2018e1ad-65d3-5c7a-aa89-fdda8e4aebd8")}catch(e){}}();
|
|
3
1
|
export {};
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
5
|
-
//# debugId=2018e1ad-65d3-5c7a-aa89-fdda8e4aebd8
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
package/dist/logging/console.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
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]="d7da7fb4-17ed-537e-bce1-3114e4d9feb3")}catch(e){}}();
|
|
3
1
|
import { log, spinner, intro, outro, text, select, confirm, isCancel, cancel, multiselect, taskLog, progress, } from '@clack/prompts';
|
|
4
2
|
import chalk from 'chalk';
|
|
5
3
|
import { getLocadexVersion } from '../utils/getPaths.js';
|
|
@@ -55,7 +53,7 @@ function displayInitializingText(telemetryEnabled) {
|
|
|
55
53
|
// eslint-disable-next-line no-console
|
|
56
54
|
console.log(`\n${chalk.bold.blue('General Translation, Inc.')}
|
|
57
55
|
${chalk.dim('https://generaltranslation.com/docs')}
|
|
58
|
-
${telemetryEnabled ? chalk.dim('\nLocadex
|
|
56
|
+
${telemetryEnabled ? chalk.dim('\nLocadex is configured to collect anonymous telemetry data. You can opt out by running with the --no-telemetry flag.') : ''}
|
|
59
57
|
`);
|
|
60
58
|
}
|
|
61
59
|
// Spinner functionality
|
|
@@ -133,5 +131,4 @@ export async function promptConfirm({ message, defaultValue = true, cancelMessag
|
|
|
133
131
|
export function createTaskLogger(message) {
|
|
134
132
|
return taskLog({ title: message });
|
|
135
133
|
}
|
|
136
|
-
//# sourceMappingURL=console.js.map
|
|
137
|
-
//# debugId=d7da7fb4-17ed-537e-bce1-3114e4d9feb3
|
|
134
|
+
//# sourceMappingURL=console.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.js","sources":["logging/console.ts"],"
|
|
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,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAe;IACnD,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,M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,UAAU,iBAAiB,CAAmB,EACxD,OAAO,EACP,OAAO,EACP,QAAQ,GAAG,IAAI,GAKhB;IACC,kDAAkD;IAClD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACzC,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,IAAI,EAAE,GAAG,CAAC,IAAI;KACf,CAAC,CAAC,CAAC;IAEJ,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC;QAC/B,OAAO;QACP,OAAO,EAAE,YAAmB;QAC5B,QAAQ;KACT,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC9B,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,MAAkB,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,OAAO,EACP,YAAY,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"]}
|
package/dist/logging/logger.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CliOptions } from '../types/cli.js';
|
|
2
1
|
declare class ProgressBar {
|
|
3
2
|
private progressBar;
|
|
4
3
|
constructor();
|
|
@@ -24,7 +23,10 @@ declare class Logger {
|
|
|
24
23
|
spinner: Spinner;
|
|
25
24
|
private constructor();
|
|
26
25
|
static getInstance(): Logger;
|
|
27
|
-
initialize(options:
|
|
26
|
+
initialize(options: {
|
|
27
|
+
verbose?: boolean;
|
|
28
|
+
debug?: boolean;
|
|
29
|
+
}, logFile?: string): void;
|
|
28
30
|
get verbose(): boolean;
|
|
29
31
|
get debug(): boolean;
|
|
30
32
|
reset(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"/","sources":["logging/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"/","sources":["logging/logger.ts"],"names":[],"mappings":"AAeA,cAAM,WAAW;IACf,OAAO,CAAC,WAAW,CAA6B;;IAGhD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMzB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAM7B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAM/C,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;CAU7B;AAED,cAAM,OAAO;IACX,OAAO,CAAC,OAAO,CAA4B;;IAG3C,IAAI,IAAI,IAAI;IAMZ,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAM7B,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAM9B,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;CAU7B;AAED,cAAM,MAAM;IACV,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,OAAO,CAAqB;IACpC,WAAW,EAAE,WAAW,CAAqB;IAC7C,OAAO,EAAE,OAAO,CAAiB;IACjC,OAAO;IAEP,MAAM,CAAC,WAAW,IAAI,MAAM;IAO5B,UAAU,CACR,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAC/C,OAAO,CAAC,EAAE,MAAM,GACf,IAAI;IAaP,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,KAAK,IAAI,IAAI;IAMb,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK9B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK5B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK9B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKxB,YAAY,CAAC,OAAO,EAAE,MAAM;IAMlC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAOrC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAOnC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAO1B,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW1C,iBAAiB,IAAI,IAAI;CAQ1B;AAED,eAAO,MAAM,MAAM,QAAuB,CAAC"}
|
package/dist/logging/logger.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
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]="7a3cc396-07e3-5f12-8dc5-282e78991f0d")}catch(e){}}();
|
|
3
1
|
import { logInfo, logWarning, logError, logSuccess, logStep, logMessage, logErrorAndExit, createProgressBar, createSpinner, } from './console.js';
|
|
4
2
|
import { appendFileSync } from 'node:fs';
|
|
5
3
|
class ProgressBar {
|
|
@@ -164,5 +162,4 @@ class Logger {
|
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
164
|
export const logger = Logger.getInstance();
|
|
167
|
-
//# sourceMappingURL=logger.js.map
|
|
168
|
-
//# debugId=7a3cc396-07e3-5f12-8dc5-282e78991f0d
|
|
165
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sources":["logging/logger.ts"],"
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"/","sources":["logging/logger.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,UAAU,EACV,QAAQ,EACR,UAAU,EACV,OAAO,EACP,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW;IACP,WAAW,CAA6B;IAChD,gBAAe,CAAC;IAEhB,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAgB;QACpB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,OAAgB;QACtC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAgB;QACnB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC;gBACH,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC/B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;YAC/B,CAAC;YAAC,OAAO,KAAK,EAAE,CA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CAAC;IACD,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { ProgressResult, SpinnerResult } from '@clack/prompts';\nimport { CliOptions } from '../types/cli.js';\nimport {\n logInfo,\n logWarning,\n logError,\n logSuccess,\n logStep,\n logMessage,\n logErrorAndExit,\n createProgressBar,\n createSpinner,\n} from './console.js';\nimport { appendFileSync } from 'node:fs';\n\nclass ProgressBar {\n private progressBar: ProgressResult | undefined;\n constructor() {}\n\n init(total: number): void {\n if (!this.progressBar) {\n this.progressBar = createProgressBar(total);\n }\n }\n\n start(message?: string): void {\n if (this.progressBar) {\n this.progressBar.start(message);\n }\n }\n\n advance(amount: number, message?: string): void {\n if (this.progressBar) {\n this.progressBar.advance(amount, message);\n }\n }\n\n stop(message?: string): void {\n if (this.progressBar) {\n try {\n this.progressBar.stop(message);\n this.progressBar = undefined;\n } catch (error) {\n this.progressBar = undefined;\n }\n }\n }\n}\n\nclass Spinner {\n private spinner: SpinnerResult | undefined;\n constructor() {}\n\n init(): void {\n if (!this.spinner) {\n this.spinner = createSpinner();\n }\n }\n\n start(message?: string): void {\n if (this.spinner) {\n this.spinner.start(message);\n }\n }\n\n update(message?: string): void {\n if (this.spinner) {\n this.spinner.message(message);\n }\n }\n\n stop(message?: string): void {\n if (this.spinner) {\n try {\n this.spinner.stop(message);\n this.spinner = undefined;\n } catch (error) {\n this.spinner = undefined;\n }\n }\n }\n}\n\nclass Logger {\n private static instance: Logger;\n private _verbose: boolean = false;\n private _debug: boolean = false;\n private logFile: string | undefined;\n progressBar: ProgressBar = new ProgressBar();\n spinner: Spinner = new Spinner();\n private constructor() {}\n\n static getInstance(): Logger {\n if (!Logger.instance) {\n Logger.instance = new Logger();\n }\n return Logger.instance;\n }\n\n initialize(\n options: { verbose?: boolean; debug?: boolean },\n logFile?: string\n ): void {\n if (options.debug) {\n this._debug = true;\n this._verbose = true;\n }\n if (options.verbose) {\n this._verbose = true;\n }\n if (logFile) {\n this.logFile = logFile;\n }\n }\n\n get verbose(): boolean {\n return this._verbose;\n }\n\n get debug(): boolean {\n return this._debug;\n }\n\n reset(): void {\n this._verbose = false;\n this._debug = false;\n }\n\n // Basic logging methods using existing console functions\n info(message: string): void {\n this.log(message);\n logInfo(message);\n }\n\n warning(message: string): void {\n this.log(message);\n logWarning(message);\n }\n\n error(message: string): void {\n this.log(message);\n logError(message);\n }\n\n success(message: string): void {\n this.log(message);\n logSuccess(message);\n }\n\n step(message: string): void {\n this.log(message);\n logStep(message);\n }\n\n message(message: string): void {\n this.log(message);\n logMessage(message);\n }\n\n async errorAndExit(message: string) {\n this.log(message);\n await logErrorAndExit(message);\n }\n\n // Conditional logging methods\n verboseMessage(message: string): void {\n this.log(message);\n if (this._verbose) {\n logMessage(message);\n }\n }\n\n debugMessage(message: string): void {\n this.log(message);\n if (this._debug) {\n logMessage(message);\n }\n }\n\n log(message: string): void {\n if (this.logFile) {\n const timestamp = new Date().toISOString();\n appendFileSync(this.logFile, `[${timestamp}] ${message}\\n`);\n }\n }\n\n initializeProgressBar(total: number): void {\n if (!this._verbose && !this._debug) {\n this.progressBar.init(total);\n }\n if (this.logFile) {\n appendFileSync(\n this.logFile,\n `Initializing progress bar with total: ${total}\\n`\n );\n }\n }\n initializeSpinner(): void {\n if (!this._verbose && !this._debug) {\n this.spinner.init();\n }\n if (this.logFile) {\n appendFileSync(this.logFile, `Initializing spinner\\n`);\n }\n }\n}\n\nexport const logger = Logger.getInstance();\n"]}
|
package/dist/mcp/getDocs.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
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]="ef6f15a9-182f-5863-911a-bbbe0faedbc4")}catch(e){}}();
|
|
3
1
|
export const GITHUB_URL = 'https://raw.githubusercontent.com/generaltranslation/gt/refs/heads/main/apps/docs/content/docs/en';
|
|
4
2
|
export const DOCS_URL = 'https://docs.generaltranslation.app';
|
|
5
3
|
export const getDocs = async (path) => {
|
|
@@ -51,5 +49,4 @@ export async function fetchDocContent(path) {
|
|
|
51
49
|
throw error;
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
|
-
//# sourceMappingURL=getDocs.js.map
|
|
55
|
-
//# debugId=ef6f15a9-182f-5863-911a-bbbe0faedbc4
|
|
52
|
+
//# sourceMappingURL=getDocs.js.map
|
package/dist/mcp/getDocs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDocs.js","sources":["mcp/getDocs.ts"],"
|
|
1
|
+
{"version":3,"file":"getDocs.js","sourceRoot":"/","sources":["mcp/getDocs.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GACrB,mGAAmG,CAAC;AAEtG,MAAM,CAAC,MAAM,QAAQ,GAAG,qCAAqC,CAAC;AAE9D,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,IAAY,EAAE,EAAE;IAC5C,MAAM,GAAG,GAAG,GAAG,UAAU,IAAI,IAAI,EAAE,CAAC;IAEpC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kBA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QACtD,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,sCAAsC,IAAI,EAAE,CAAC,CAAC;YAC5D,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;QAC7B,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["export const GITHUB_URL =\n 'https://raw.githubusercontent.com/generaltranslation/gt/refs/heads/main/apps/docs/content/docs/en';\n\nexport const DOCS_URL = 'https://docs.generaltranslation.app';\n\nexport const getDocs = async (path: string) => {\n const url = `${GITHUB_URL}/${path}`;\n\n try {\n const response = await fetch(url);\n return response.text();\n } catch (error) {\n console.error(`Error fetching ${path}:`, error);\n return null;\n }\n};\n\n// Cache for storing fetched docs with expiration\ninterface CacheEntry {\n content: string;\n timestamp: number;\n}\n\n// Cache with 5-minute expiration\nconst cache: Record<string, CacheEntry> = {};\nexport const CACHE_TTL = 5 * 60 * 1000; // 5 minutes in milliseconds\n\n/**\n * Fetches content from the docs URL with caching\n * Refreshes cache every 5 minutes\n */\nexport async function fetchDocContent(path: string): Promise<string> {\n const now = Date.now();\n\n // Check if we have a valid cached entry\n if (cache[path] && now - cache[path].timestamp < CACHE_TTL) {\n return cache[path].content;\n }\n\n const url = `${DOCS_URL}/${path}`;\n console.error(`Fetching document from: ${url}`);\n\n try {\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new Error(\n `Failed to fetch ${path}: ${response.status} ${response.statusText}`\n );\n }\n\n const content = await response.text();\n\n // Update cache\n cache[path] = {\n content,\n timestamp: now,\n };\n\n return content;\n } catch (error) {\n console.error(`Error fetching ${path}:`, error);\n\n // Return cached content if available, even if expired\n if (cache[path]) {\n console.error(`Returning stale cached content for ${path}`);\n return cache[path].content;\n }\n\n throw error;\n }\n}\n"]}
|
package/dist/mcp/getGuide.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
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]="19738121-3425-5eef-af1f-7d1a526b0be4")}catch(e){}}();
|
|
3
1
|
import { readFile } from 'node:fs/promises';
|
|
4
2
|
import { fromPackageRoot } from '../utils/getPaths.js';
|
|
5
3
|
export default async function getGuide(path) {
|
|
@@ -13,5 +11,4 @@ export default async function getGuide(path) {
|
|
|
13
11
|
return { error: error instanceof Error ? error.message : String(error) };
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
|
-
//# sourceMappingURL=getGuide.js.map
|
|
17
|
-
//# debugId=19738121-3425-5eef-af1f-7d1a526b0be4
|
|
14
|
+
//# sourceMappingURL=getGuide.js.map
|
package/dist/mcp/getGuide.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGuide.js","
|
|
1
|
+
{"version":3,"file":"getGuide.js","sourceRoot":"/","sources":["mcp/getGuide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,QAAQ,CACpC,IAAY;IAEZ,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC;QACrD,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAC3E,CAAC;AACH,CAAC","sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { fromPackageRoot } from '../utils/getPaths.js';\n\nexport default async function getGuide(\n path: string\n): Promise<{ content?: string; error?: string }> {\n try {\n const filePath = fromPackageRoot(path);\n const content = await readFile(filePath, 'utf-8');\n return { content };\n } catch (error) {\n console.error(`Error reading guide ${path}:`, error);\n return { error: error instanceof Error ? error.message : String(error) };\n }\n}\n"]}
|
package/dist/mcp/getPort.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
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]="31c29238-9e18-5aff-9956-b289204c95f6")}catch(e){}}();
|
|
3
1
|
import { createServer } from 'node:http';
|
|
4
2
|
export async function findAvailablePort(startPort) {
|
|
5
3
|
return new Promise((resolve, reject) => {
|
|
@@ -21,5 +19,4 @@ export async function findAvailablePort(startPort) {
|
|
|
21
19
|
});
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
|
-
//# sourceMappingURL=getPort.js.map
|
|
25
|
-
//# debugId=31c29238-9e18-5aff-9956-b289204c95f6
|
|
22
|
+
//# sourceMappingURL=getPort.js.map
|
package/dist/mcp/getPort.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPort.js","
|
|
1
|
+
{"version":3,"file":"getPort.js","sourceRoot":"/","sources":["mcp/getPort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,SAAiB;IACvD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAE9B,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE;YAC5B,MAAM,IAAI,GAAI,MAAM,CAAC,OAAO,EAAU,EAAE,IAAI,CAAC;YAC7C,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAQ,EAAE,EAAE;YAC9B,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gBAC9B,mCAAmC;gBACnC,iBAAiB,CAAC,SAAS,GAAG,CAAC,CAAC;qBAC7B,IAAI,CAAC,OAAO,CAAC;qBACb,KAAK,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { createServer } from 'node:http';\n\nexport async 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"]}
|
package/dist/mcp/tools/docs.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
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]="596bdbfc-3d82-5b86-85a5-9eb94bc8e24d")}catch(e){}}();
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import { fetchDocContent, getDocs } from '../getDocs.js';
|
|
5
3
|
import { logger } from '../../logging/logger.js';
|
|
@@ -89,5 +87,4 @@ export function addDocsTools(server) {
|
|
|
89
87
|
}
|
|
90
88
|
});
|
|
91
89
|
}
|
|
92
|
-
//# sourceMappingURL=docs.js.map
|
|
93
|
-
//# debugId=596bdbfc-3d82-5b86-85a5-9eb94bc8e24d
|
|
90
|
+
//# sourceMappingURL=docs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sources":["mcp/tools/docs.ts"],"
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"/","sources":["mcp/tools/docs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,YAAY,EACV,mEAAmE;IACrE,WAAW,EACT,wIAAwI;CAC3I,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,MAAiB;IAC5C,MAAM,CAAC,IAAI,CACT,YAAY,EACZ,SAAS,CAAC,YAAY,CAAC,EACvB;QACE,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,CACP,6FAA6F,CAC9F;KACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;YAEpC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAC;gBACpE,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,2CAA2C,IAAI,EAAE;yBACxD;qBACF;oBACD,O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ACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,GAAG,CACR,yDAAyD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAClH,CAAC;YACF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC/F;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { z } from 'zod';\nimport { fetchDocContent, getDocs } from '../getDocs.js';\nimport { logger } from '../../logging/logger.js';\n\nexport const docsTools: { [id: string]: string } = {\n 'fetch-docs':\n 'Fetches the content of a specific documentation file by its path.',\n 'list-docs':\n 'Lists available documentation files in the format of an llms.txt file. This is a list of all the documentation files available to you.',\n};\n\nexport function addDocsTools(server: McpServer) {\n server.tool(\n 'fetch-docs',\n docsTools['fetch-docs'],\n {\n path: z\n .string()\n .describe(\n 'The path to the documentation file (e.g., \"platform/index.mdx\" or \"react/introduction.mdx\")'\n ),\n },\n async ({ path }) => {\n try {\n const content = await getDocs(path);\n\n if (!content) {\n logger.log(`[locadex-mcp: fetch-docs] Document not found: ${path}`);\n return {\n content: [\n {\n type: 'text',\n text: `Failed to fetch documentation for path: ${path}`,\n },\n ],\n isError: true,\n };\n }\n logger.log(\n `[locadex-mcp: fetch-docs] Document fetched successfully: ${path}`\n );\n\n return {\n content: [\n {\n type: 'text',\n text: content,\n },\n ],\n };\n } catch (error) {\n logger.log(\n `[locadex-mcp: fetch-docs] Error fetching documentation: ${error instanceof Error ? error.message : String(error)}`\n );\n return {\n content: [\n {\n type: 'text',\n text: `Error fetching documentation: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n }\n );\n\n server.tool('list-docs', docsTools['list-docs'], {}, async () => {\n try {\n const content = await fetchDocContent('llms.txt');\n\n if (!content) {\n logger.log(\n `[locadex-mcp: list-docs] Failed to fetch documentation index`\n );\n return {\n content: [\n {\n type: 'text',\n text: `Failed to fetch documentation index`,\n },\n ],\n isError: true,\n };\n }\n\n logger.log(\n `[locadex-mcp: list-docs] Documentation index fetched successfully`\n );\n\n return {\n content: [\n {\n type: 'text',\n text: content,\n },\n ],\n };\n } catch (error) {\n logger.log(\n `[locadex-mcp: list-docs] Error listing documentation: ${error instanceof Error ? error.message : String(error)}`\n );\n return {\n content: [\n {\n type: 'text',\n text: `Error listing documentation: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n });\n}\n"]}
|
package/dist/mcp/tools/guides.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
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]="f1b44bfa-e246-56f1-affa-624eaaeb4b91")}catch(e){}}();
|
|
3
1
|
import getGuide from '../getGuide.js';
|
|
4
2
|
import { logger } from '../../logging/logger.js';
|
|
5
3
|
export const guides = [
|
|
@@ -117,5 +115,4 @@ export function addGuidesTools(server) {
|
|
|
117
115
|
});
|
|
118
116
|
});
|
|
119
117
|
}
|
|
120
|
-
//# sourceMappingURL=guides.js.map
|
|
121
|
-
//# debugId=f1b44bfa-e246-56f1-affa-624eaaeb4b91
|
|
118
|
+
//# sourceMappingURL=guides.js.map
|