locadex 0.1.17 → 1.0.1
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 +13 -0
- package/LICENSE.md +3 -101
- package/dist/cli.d.ts +0 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +13 -52
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/logging/console.d.ts +1 -1
- package/dist/logging/console.d.ts.map +1 -1
- package/dist/logging/console.js +6 -9
- package/dist/logging/console.js.map +1 -1
- package/dist/logging/logger.js +1 -4
- package/dist/logging/logger.js.map +1 -1
- package/dist/utils/getPaths.js +1 -4
- package/dist/utils/getPaths.js.map +1 -1
- package/dist/utils/shutdown.js +1 -4
- package/dist/utils/shutdown.js.map +1 -1
- package/package.json +6 -20
- package/dist/commands/fixErrors.d.ts +0 -4
- package/dist/commands/fixErrors.d.ts.map +0 -1
- package/dist/commands/fixErrors.js +0 -42
- package/dist/commands/fixErrors.js.map +0 -1
- package/dist/commands/i18n.d.ts +0 -4
- package/dist/commands/i18n.d.ts.map +0 -1
- package/dist/commands/i18n.js +0 -42
- package/dist/commands/i18n.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -11
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -74
- package/dist/commands/setup.js.map +0 -1
- package/dist/mcp/getDocs.d.ts +0 -10
- package/dist/mcp/getDocs.d.ts.map +0 -1
- package/dist/mcp/getDocs.js +0 -55
- package/dist/mcp/getDocs.js.map +0 -1
- package/dist/mcp/getGuide.d.ts +0 -5
- package/dist/mcp/getGuide.d.ts.map +0 -1
- package/dist/mcp/getGuide.js +0 -18
- package/dist/mcp/getGuide.js.map +0 -1
- package/dist/mcp/getPort.d.ts +0 -2
- package/dist/mcp/getPort.d.ts.map +0 -1
- package/dist/mcp/getPort.js +0 -25
- package/dist/mcp/getPort.js.map +0 -1
- package/dist/mcp/tools/docs.d.ts +0 -6
- package/dist/mcp/tools/docs.d.ts.map +0 -1
- package/dist/mcp/tools/docs.js +0 -93
- package/dist/mcp/tools/docs.js.map +0 -1
- package/dist/mcp/tools/guides.d.ts +0 -11
- package/dist/mcp/tools/guides.d.ts.map +0 -1
- package/dist/mcp/tools/guides.js +0 -91
- package/dist/mcp/tools/guides.js.map +0 -1
- package/dist/mcp/tools/validate.d.ts +0 -3
- package/dist/mcp/tools/validate.d.ts.map +0 -1
- package/dist/mcp/tools/validate.js +0 -37
- package/dist/mcp/tools/validate.js.map +0 -1
- package/dist/mcp/validateEnv.d.ts +0 -9
- package/dist/mcp/validateEnv.d.ts.map +0 -1
- package/dist/mcp/validateEnv.js +0 -27
- package/dist/mcp/validateEnv.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 -79
- package/dist/mcp-sse.js.map +0 -1
- package/dist/mcp-stdio.d.ts +0 -3
- package/dist/mcp-stdio.d.ts.map +0 -1
- package/dist/mcp-stdio.js +0 -39
- package/dist/mcp-stdio.js.map +0 -1
- package/dist/prompts/system.d.ts +0 -5
- package/dist/prompts/system.d.ts.map +0 -1
- package/dist/prompts/system.js +0 -29
- package/dist/prompts/system.js.map +0 -1
- package/dist/resources/getResource.d.ts +0 -5
- package/dist/resources/getResource.d.ts.map +0 -1
- package/dist/resources/getResource.js +0 -19
- package/dist/resources/getResource.js.map +0 -1
- package/dist/tasks/concurrency.d.ts +0 -72
- package/dist/tasks/concurrency.d.ts.map +0 -1
- package/dist/tasks/concurrency.js +0 -130
- package/dist/tasks/concurrency.js.map +0 -1
- package/dist/tasks/fixErrors.d.ts +0 -2
- package/dist/tasks/fixErrors.d.ts.map +0 -1
- package/dist/tasks/fixErrors.js +0 -82
- package/dist/tasks/fixErrors.js.map +0 -1
- package/dist/tasks/i18n.d.ts +0 -7
- package/dist/tasks/i18n.d.ts.map +0 -1
- package/dist/tasks/i18n.js +0 -246
- package/dist/tasks/i18n.js.map +0 -1
- package/dist/tasks/setup.d.ts +0 -8
- package/dist/tasks/setup.d.ts.map +0 -1
- package/dist/tasks/setup.js +0 -272
- package/dist/tasks/setup.js.map +0 -1
- package/dist/telemetry.d.ts +0 -9
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/telemetry.js +0 -105
- package/dist/telemetry.js.map +0 -1
- package/dist/types/cli.d.ts +0 -20
- package/dist/types/cli.d.ts.map +0 -1
- package/dist/types/cli.js +0 -5
- package/dist/types/cli.js.map +0 -1
- package/dist/utils/claudeCode.d.ts +0 -49
- package/dist/utils/claudeCode.d.ts.map +0 -1
- package/dist/utils/claudeCode.js +0 -290
- package/dist/utils/claudeCode.js.map +0 -1
- package/dist/utils/config.d.ts +0 -11
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/config.js +0 -84
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/dag/createDag.d.ts +0 -24
- package/dist/utils/dag/createDag.d.ts.map +0 -1
- package/dist/utils/dag/createDag.js +0 -146
- package/dist/utils/dag/createDag.js.map +0 -1
- package/dist/utils/dag/extractFiles.d.ts +0 -7
- package/dist/utils/dag/extractFiles.d.ts.map +0 -1
- package/dist/utils/dag/extractFiles.js +0 -32
- package/dist/utils/dag/extractFiles.js.map +0 -1
- package/dist/utils/dag/getFiles.d.ts +0 -18
- package/dist/utils/dag/getFiles.d.ts.map +0 -1
- package/dist/utils/dag/getFiles.js +0 -116
- package/dist/utils/dag/getFiles.js.map +0 -1
- package/dist/utils/dag/matchFiles.d.ts +0 -3
- package/dist/utils/dag/matchFiles.d.ts.map +0 -1
- package/dist/utils/dag/matchFiles.js +0 -61
- package/dist/utils/dag/matchFiles.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -20
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -42
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/exec.d.ts +0 -6
- package/dist/utils/exec.d.ts.map +0 -1
- package/dist/utils/exec.js +0 -68
- package/dist/utils/exec.js.map +0 -1
- package/dist/utils/fs/findConfigs.d.ts +0 -11
- package/dist/utils/fs/findConfigs.d.ts.map +0 -1
- package/dist/utils/fs/findConfigs.js +0 -60
- package/dist/utils/fs/findConfigs.js.map +0 -1
- package/dist/utils/fs/formatFiles.d.ts +0 -3
- package/dist/utils/fs/formatFiles.d.ts.map +0 -1
- package/dist/utils/fs/formatFiles.js +0 -16
- package/dist/utils/fs/formatFiles.js.map +0 -1
- package/dist/utils/fs/getFiles.d.ts +0 -2
- package/dist/utils/fs/getFiles.d.ts.map +0 -1
- package/dist/utils/fs/getFiles.js +0 -8
- package/dist/utils/fs/getFiles.js.map +0 -1
- package/dist/utils/fs/git.d.ts +0 -7
- package/dist/utils/fs/git.d.ts.map +0 -1
- package/dist/utils/fs/git.js +0 -38
- package/dist/utils/fs/git.js.map +0 -1
- package/dist/utils/fs/writeFiles.d.ts +0 -2
- package/dist/utils/fs/writeFiles.d.ts.map +0 -1
- package/dist/utils/fs/writeFiles.js +0 -19
- package/dist/utils/fs/writeFiles.js.map +0 -1
- package/dist/utils/locadexManager.d.ts +0 -86
- package/dist/utils/locadexManager.d.ts.map +0 -1
- package/dist/utils/locadexManager.js +0 -305
- package/dist/utils/locadexManager.js.map +0 -1
- package/dist/utils/lockfile.d.ts +0 -16
- package/dist/utils/lockfile.d.ts.map +0 -1
- package/dist/utils/lockfile.js +0 -109
- package/dist/utils/lockfile.js.map +0 -1
- package/dist/utils/packages/installPackage.d.ts +0 -5
- package/dist/utils/packages/installPackage.d.ts.map +0 -1
- package/dist/utils/packages/installPackage.js +0 -60
- package/dist/utils/packages/installPackage.js.map +0 -1
- package/dist/utils/session.d.ts +0 -2
- package/dist/utils/session.d.ts.map +0 -1
- package/dist/utils/session.js +0 -12
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/shared.d.ts +0 -5
- package/dist/utils/shared.d.ts.map +0 -1
- package/dist/utils/shared.js +0 -54
- package/dist/utils/shared.js.map +0 -1
- package/dist/utils/stats.d.ts +0 -40
- package/dist/utils/stats.d.ts.map +0 -1
- package/dist/utils/stats.js +0 -97
- package/dist/utils/stats.js.map +0 -1
- package/guides/next/advanced/conditional-rendering.md +0 -275
- package/guides/next/advanced/external-strings.md +0 -346
- package/guides/next/advanced/interpolated-strings.md +0 -82
- package/guides/next/advanced/mapping-expressions.md +0 -208
- package/guides/next/basic/branches.md +0 -327
- package/guides/next/basic/jsx.md +0 -270
- package/guides/next/basic/strings.md +0 -162
- package/guides/next/basic/variables.md +0 -161
- package/guides/next/important/functions.md +0 -39
- package/guides/next/migration/migrating.md +0 -85
- package/resources/ghaYaml.yml +0 -24
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixErrors.js","sources":["commands/fixErrors.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from 'commander';\nimport { CliOptions } from '../types/cli.js';\nimport { withTelemetry } from '../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport path from 'node:path';\nimport { validateConfig } from '../utils/config.js';\nimport { fixErrorsTask } from '../tasks/fixErrors.js';\n\nexport async function fixErrorsCommand(options: CliOptions, command: Command) {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n const telemetryEnabled = !allOptions.noTelemetry;\n withTelemetry(\n { enabled: telemetryEnabled, options: allOptions },\n async () => {\n await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\n mcpTransport: 'stdio',\n apiKey: process.env.ANTHROPIC_API_KEY || '',\n metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles,\n }),\n ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allO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aAAa;iBACxC,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI;oBAC5B,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;iBAC/C,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,SAAS,IAAI;oBAC1B,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;iBACxC,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,OAAO,IAAI;oBACxB,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;iBACpC,CAAC;aACH;SACF,CAAC,CAAC;QACH,MAAM,aAAa,EAAE,CAAC;IACxB,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"8eb1ad14-1562-5e9c-bfaf-5450907faede"}
|
package/dist/commands/i18n.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,iBAmCtE"}
|
package/dist/commands/i18n.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
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]="00d0bcb6-c083-5c43-bf0f-8862d65c25b5")}catch(e){}}();
|
|
3
|
-
import { i18nTask } from '../tasks/i18n.js';
|
|
4
|
-
import { withTelemetry } from '../telemetry.js';
|
|
5
|
-
import { LocadexManager } from '../utils/locadexManager.js';
|
|
6
|
-
import { displayHeader } from '../logging/console.js';
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
import { validateConfig } from '../utils/config.js';
|
|
9
|
-
export async function i18nCommand(options, command) {
|
|
10
|
-
const parentOptions = command.parent?.opts() || {};
|
|
11
|
-
const allOptions = { ...parentOptions, ...options };
|
|
12
|
-
const telemetryEnabled = !allOptions.noTelemetry;
|
|
13
|
-
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
14
|
-
await validateConfig(allOptions);
|
|
15
|
-
displayHeader(telemetryEnabled);
|
|
16
|
-
LocadexManager.initialize({
|
|
17
|
-
rootDirectory: process.cwd(),
|
|
18
|
-
appDirectory: path.resolve(process.cwd(), allOptions.appDir),
|
|
19
|
-
mcpTransport: 'stdio',
|
|
20
|
-
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
21
|
-
metadata: {},
|
|
22
|
-
cliOptions: allOptions,
|
|
23
|
-
options: {
|
|
24
|
-
...(allOptions.matchingFiles && {
|
|
25
|
-
matchingFiles: allOptions.matchingFiles,
|
|
26
|
-
}),
|
|
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
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
await i18nTask(allOptions);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=i18n.js.map
|
|
42
|
-
//# debugId=00d0bcb6-c083-5c43-bf0f-8862d65c25b5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sources":["commands/i18n.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from 'commander';\nimport { i18nTask } from '../tasks/i18n.js';\nimport { CliOptions } from '../types/cli.js';\nimport { withTelemetry } from '../telemetry.js';\nimport { LocadexManager } from '../utils/locadexManager.js';\nimport { displayHeader } from '../logging/console.js';\nimport path from 'node:path';\nimport { validateConfig } from '../utils/config.js';\n\nexport async function i18nCommand(options: CliOptions, command: Command) {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n const telemetryEnabled = !allOptions.noTelemetry;\n withTelemetry(\n { enabled: telemetryEnabled, options: allOptions },\n async () => {\n await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\n mcpTransport: 'stdio',\n apiKey: process.env.ANTHROPIC_API_KEY || '',\n metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles,\n }),\n ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await i18nTask(allOptions);\n }\n );\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAmB,EAAE,OAAgB;IACrE,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnD,MAAM,UAAU,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpD,MAAM,gBAAgB,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC;IACjD,aAAa,CACX,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,EAClD,KAAK,IAAI,EAAE;QACT,MAAM,cAAc,CAAC,UAAU,CAAC,CAAC;QAEjC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAChC,cAAc,CAAC,UAAU,CAAC;YACxB,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE;YAC5B,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,MAAM,CAAC;YAC5D,YAAY,EAAE,OAAO;YACrB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE;YAC3C,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,UAAU;YACtB,OAAO,EAAE;gBACP,GAAG,CAAC,UAAU,CAAC,aAAa,IAAI;oBAC9B,aAAa,EAAE,UAAU,CAAC,aAAa;iBACxC,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI;oBAC5B,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;iBAC/C,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,SAAS,IAAI;oBAC1B,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;iBACxC,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,OAAO,IAAI;oBACxB,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;iBACpC,CAAC;aACH;SACF,CAAC,CAAC;QACH,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"00d0bcb6-c083-5c43-bf0f-8862d65c25b5"}
|
package/dist/commands/setup.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { CliOptions } from '../types/cli.js';
|
|
3
|
-
export declare function setupCommand(options: CliOptions & {
|
|
4
|
-
packageManager?: string;
|
|
5
|
-
bypassPrompts?: boolean;
|
|
6
|
-
}, command: Command): Promise<void>;
|
|
7
|
-
export declare function autoSetupCommand(options: CliOptions & {
|
|
8
|
-
packageManager?: string;
|
|
9
|
-
bypassPrompts?: boolean;
|
|
10
|
-
}, command: Command): Promise<void>;
|
|
11
|
-
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,iBAyCjB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,UAAU,GAAG;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,OAAO,EAAE,OAAO,iBAyCjB"}
|
package/dist/commands/setup.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
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]="36afaec7-c98c-53e1-86f3-ef52dcd0e926")}catch(e){}}();
|
|
3
|
-
import { setupTask } from '../tasks/setup.js';
|
|
4
|
-
import { withTelemetry } from '../telemetry.js';
|
|
5
|
-
import { LocadexManager } from '../utils/locadexManager.js';
|
|
6
|
-
import { displayHeader } from '../logging/console.js';
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
import { validateConfig } from '../utils/config.js';
|
|
9
|
-
export async function setupCommand(options, command) {
|
|
10
|
-
const parentOptions = command.parent?.opts() || {};
|
|
11
|
-
const allOptions = { ...parentOptions, ...options };
|
|
12
|
-
const telemetryEnabled = !allOptions.noTelemetry;
|
|
13
|
-
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
14
|
-
await validateConfig(allOptions);
|
|
15
|
-
displayHeader(telemetryEnabled);
|
|
16
|
-
LocadexManager.initialize({
|
|
17
|
-
rootDirectory: process.cwd(),
|
|
18
|
-
appDirectory: path.resolve(process.cwd(), allOptions.appDir),
|
|
19
|
-
mcpTransport: 'stdio',
|
|
20
|
-
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
21
|
-
metadata: {},
|
|
22
|
-
cliOptions: allOptions,
|
|
23
|
-
options: {
|
|
24
|
-
...(allOptions.matchingFiles && {
|
|
25
|
-
matchingFiles: allOptions.matchingFiles,
|
|
26
|
-
}),
|
|
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
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
await setupTask(allOptions, false, !!allOptions.bypassPrompts, allOptions.packageManager);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
export async function autoSetupCommand(options, command) {
|
|
42
|
-
const parentOptions = command.parent?.opts() || {};
|
|
43
|
-
const allOptions = { ...parentOptions, ...options };
|
|
44
|
-
const telemetryEnabled = !allOptions.noTelemetry;
|
|
45
|
-
withTelemetry({ enabled: telemetryEnabled, options: allOptions }, async () => {
|
|
46
|
-
await validateConfig(allOptions);
|
|
47
|
-
displayHeader(telemetryEnabled);
|
|
48
|
-
LocadexManager.initialize({
|
|
49
|
-
rootDirectory: process.cwd(),
|
|
50
|
-
appDirectory: path.resolve(process.cwd(), allOptions.appDir),
|
|
51
|
-
mcpTransport: 'stdio',
|
|
52
|
-
apiKey: process.env.ANTHROPIC_API_KEY || '',
|
|
53
|
-
metadata: {},
|
|
54
|
-
cliOptions: allOptions,
|
|
55
|
-
options: {
|
|
56
|
-
...(allOptions.matchingFiles && {
|
|
57
|
-
matchingFiles: allOptions.matchingFiles,
|
|
58
|
-
}),
|
|
59
|
-
...(allOptions.concurrency && {
|
|
60
|
-
maxConcurrency: Number(allOptions.concurrency),
|
|
61
|
-
}),
|
|
62
|
-
...(allOptions.batchSize && {
|
|
63
|
-
batchSize: Number(allOptions.batchSize),
|
|
64
|
-
}),
|
|
65
|
-
...(allOptions.timeout && {
|
|
66
|
-
timeout: Number(allOptions.timeout),
|
|
67
|
-
}),
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
await setupTask(allOptions, true, !!allOptions.bypassPrompts, allOptions.packageManager);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=setup.js.map
|
|
74
|
-
//# debugId=36afaec7-c98c-53e1-86f3-ef52dcd0e926
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sources":["commands/setup.ts"],"sourceRoot":"/","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: 'stdio',\n apiKey: process.env.ANTHROPIC_API_KEY || '',\n metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles,\n }),\n ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await setupTask(\n allOptions,\n false,\n !!allOptions.bypassPrompts,\n allOptions.packageManager\n );\n }\n );\n}\n\nexport async function autoSetupCommand(\n options: CliOptions & {\n packageManager?: string;\n bypassPrompts?: boolean;\n },\n command: Command\n) {\n const parentOptions = command.parent?.opts() || {};\n const allOptions = { ...parentOptions, ...options };\n const telemetryEnabled = !allOptions.noTelemetry;\n withTelemetry(\n { enabled: telemetryEnabled, options: allOptions },\n async () => {\n await validateConfig(allOptions);\n\n displayHeader(telemetryEnabled);\n LocadexManager.initialize({\n rootDirectory: process.cwd(),\n appDirectory: path.resolve(process.cwd(), allOptions.appDir),\n mcpTransport: 'stdio',\n apiKey: process.env.ANTHROPIC_API_KEY || '',\n metadata: {},\n cliOptions: allOptions,\n options: {\n ...(allOptions.matchingFiles && {\n matchingFiles: allOptions.matchingFiles,\n }),\n ...(allOptions.concurrency && {\n maxConcurrency: Number(allOptions.concurrency),\n }),\n ...(allOptions.batchSize && {\n batchSize: Number(allOptions.batchSize),\n }),\n ...(allOptions.timeout && {\n timeout: Number(allOptions.timeout),\n }),\n },\n });\n await setupTask(\n allOptions,\n true,\n !!allOptions.bypassPrompts,\n allOptions.packageManager\n );\n }\n );\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO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AAC;gBACF,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI;oBAC5B,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;iBAC/C,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,SAAS,IAAI;oBAC1B,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC;iBACxC,CAAC;gBACF,GAAG,CAAC,UAAU,CAAC,OAAO,IAAI;oBACxB,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;iBACpC,CAAC;aACH;SACF,CAAC,CAAC;QACH,MAAM,SAAS,CACb,UAAU,EACV,IAAI,EACJ,CAAC,CAAC,UAAU,CAAC,aAAa,EAC1B,UAAU,CAAC,cAAc,CAC1B,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"36afaec7-c98c-53e1-86f3-ef52dcd0e926"}
|
package/dist/mcp/getDocs.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const GITHUB_URL = "https://raw.githubusercontent.com/generaltranslation/gt/refs/heads/main/apps/docs/content/docs/en";
|
|
2
|
-
export declare const DOCS_URL = "https://docs.generaltranslation.app";
|
|
3
|
-
export declare const getDocs: (path: string) => Promise<string | null>;
|
|
4
|
-
export declare const CACHE_TTL: number;
|
|
5
|
-
/**
|
|
6
|
-
* Fetches content from the docs URL with caching
|
|
7
|
-
* Refreshes cache every 5 minutes
|
|
8
|
-
*/
|
|
9
|
-
export declare function fetchDocContent(path: string): Promise<string>;
|
|
10
|
-
//# sourceMappingURL=getDocs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDocs.d.ts","sourceRoot":"/","sources":["mcp/getDocs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,sGAC8E,CAAC;AAEtG,eAAO,MAAM,QAAQ,wCAAwC,CAAC;AAE9D,eAAO,MAAM,OAAO,GAAU,MAAM,MAAM,2BAUzC,CAAC;AAUF,eAAO,MAAM,SAAS,QAAgB,CAAC;AAEvC;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCnE"}
|
package/dist/mcp/getDocs.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
export const GITHUB_URL = 'https://raw.githubusercontent.com/generaltranslation/gt/refs/heads/main/apps/docs/content/docs/en';
|
|
4
|
-
export const DOCS_URL = 'https://docs.generaltranslation.app';
|
|
5
|
-
export const getDocs = async (path) => {
|
|
6
|
-
const url = `${GITHUB_URL}/${path}`;
|
|
7
|
-
try {
|
|
8
|
-
const response = await fetch(url);
|
|
9
|
-
return response.text();
|
|
10
|
-
}
|
|
11
|
-
catch (error) {
|
|
12
|
-
console.error(`Error fetching ${path}:`, error);
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
// Cache with 5-minute expiration
|
|
17
|
-
const cache = {};
|
|
18
|
-
export const CACHE_TTL = 5 * 60 * 1000; // 5 minutes in milliseconds
|
|
19
|
-
/**
|
|
20
|
-
* Fetches content from the docs URL with caching
|
|
21
|
-
* Refreshes cache every 5 minutes
|
|
22
|
-
*/
|
|
23
|
-
export async function fetchDocContent(path) {
|
|
24
|
-
const now = Date.now();
|
|
25
|
-
// Check if we have a valid cached entry
|
|
26
|
-
if (cache[path] && now - cache[path].timestamp < CACHE_TTL) {
|
|
27
|
-
return cache[path].content;
|
|
28
|
-
}
|
|
29
|
-
const url = `${DOCS_URL}/${path}`;
|
|
30
|
-
console.error(`Fetching document from: ${url}`);
|
|
31
|
-
try {
|
|
32
|
-
const response = await fetch(url);
|
|
33
|
-
if (!response.ok) {
|
|
34
|
-
throw new Error(`Failed to fetch ${path}: ${response.status} ${response.statusText}`);
|
|
35
|
-
}
|
|
36
|
-
const content = await response.text();
|
|
37
|
-
// Update cache
|
|
38
|
-
cache[path] = {
|
|
39
|
-
content,
|
|
40
|
-
timestamp: now,
|
|
41
|
-
};
|
|
42
|
-
return content;
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.error(`Error fetching ${path}:`, error);
|
|
46
|
-
// Return cached content if available, even if expired
|
|
47
|
-
if (cache[path]) {
|
|
48
|
-
console.error(`Returning stale cached content for ${path}`);
|
|
49
|
-
return cache[path].content;
|
|
50
|
-
}
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=getDocs.js.map
|
|
55
|
-
//# debugId=ef6f15a9-182f-5863-911a-bbbe0faedbc4
|
package/dist/mcp/getDocs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDocs.js","sources":["mcp/getDocs.ts"],"sourceRoot":"/","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"],"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,kBAAkB,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAQF,iCAAiC;AACjC,MAAM,KAAK,GAA+B,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,4BAA4B;AAEpE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEvB,wCAAwC;IACxC,IAAI,KAAK,CAAC,IAAI,CAAC,IAA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IA,wBAA8B,QAAQ,CACpC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAS/C"}
|
package/dist/mcp/getGuide.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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]="334ec386-5249-5eeb-b13f-b2e6ce046b60")}catch(e){}}();
|
|
3
|
-
import { readFile } from 'node:fs/promises';
|
|
4
|
-
import { fromPackageRoot } from '../utils/getPaths.js';
|
|
5
|
-
import { logger } from '../logging/logger.js';
|
|
6
|
-
export default async function getGuide(path) {
|
|
7
|
-
try {
|
|
8
|
-
const filePath = fromPackageRoot(path);
|
|
9
|
-
const content = await readFile(filePath, 'utf-8');
|
|
10
|
-
return { content };
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
logger.log(`Error reading guide ${path}: ${error}`);
|
|
14
|
-
return { error: error instanceof Error ? error.message : String(error) };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=getGuide.js.map
|
|
18
|
-
//# debugId=334ec386-5249-5eeb-b13f-b2e6ce046b60
|
package/dist/mcp/getGuide.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getGuide.js","sources":["mcp/getGuide.ts"],"sourceRoot":"/","sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { fromPackageRoot } from '../utils/getPaths.js';\nimport { logger } from '../logging/logger.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 logger.log(`Error reading guide ${path}: ${error}`);\n return { error: error instanceof Error ? error.message : String(error) };\n }\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,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,MAAM,CAAC,GAAG,CAAC,uBAAuB,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;QACpD,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","debug_id":"334ec386-5249-5eeb-b13f-b2e6ce046b60"}
|
package/dist/mcp/getPort.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPort.d.ts","sourceRoot":"/","sources":["mcp/getPort.ts"],"names":[],"mappings":"AAEA,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB1E"}
|
package/dist/mcp/getPort.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
import { createServer } from 'node:http';
|
|
4
|
-
export async function findAvailablePort(startPort) {
|
|
5
|
-
return new Promise((resolve, reject) => {
|
|
6
|
-
const server = createServer();
|
|
7
|
-
server.listen(startPort, () => {
|
|
8
|
-
const port = server.address()?.port;
|
|
9
|
-
server.close(() => resolve(port));
|
|
10
|
-
});
|
|
11
|
-
server.on('error', (err) => {
|
|
12
|
-
if (err.code === 'EADDRINUSE') {
|
|
13
|
-
// Port is in use, try the next one
|
|
14
|
-
findAvailablePort(startPort + 1)
|
|
15
|
-
.then(resolve)
|
|
16
|
-
.catch(reject);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
reject(err);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=getPort.js.map
|
|
25
|
-
//# debugId=31c29238-9e18-5aff-9956-b289204c95f6
|
package/dist/mcp/getPort.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPort.js","sources":["mcp/getPort.ts"],"sourceRoot":"/","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"],"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","debug_id":"31c29238-9e18-5aff-9956-b289204c95f6"}
|
package/dist/mcp/tools/docs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"/","sources":["mcp/tools/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,eAAO,MAAM,SAAS,EAAE;IAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAK7C,CAAC;AAEF,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,QAsG7C"}
|
package/dist/mcp/tools/docs.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
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
|
-
import { z } from 'zod';
|
|
4
|
-
import { fetchDocContent, getDocs } from '../getDocs.js';
|
|
5
|
-
import { logger } from '../../logging/logger.js';
|
|
6
|
-
export const docsTools = {
|
|
7
|
-
'fetch-docs': 'Fetches the content of a specific documentation file by its path.',
|
|
8
|
-
'list-docs': 'Lists available documentation files in the format of an llms.txt file. This is a list of all the documentation files available to you.',
|
|
9
|
-
};
|
|
10
|
-
export function addDocsTools(server) {
|
|
11
|
-
server.tool('fetch-docs', docsTools['fetch-docs'], {
|
|
12
|
-
path: z
|
|
13
|
-
.string()
|
|
14
|
-
.describe('The path to the documentation file (e.g., "platform/index.mdx" or "react/introduction.mdx")'),
|
|
15
|
-
}, async ({ path }) => {
|
|
16
|
-
try {
|
|
17
|
-
const content = await getDocs(path);
|
|
18
|
-
if (!content) {
|
|
19
|
-
logger.log(`[locadex-mcp: fetch-docs] Document not found: ${path}`);
|
|
20
|
-
return {
|
|
21
|
-
content: [
|
|
22
|
-
{
|
|
23
|
-
type: 'text',
|
|
24
|
-
text: `Failed to fetch documentation for path: ${path}`,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
isError: true,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
logger.log(`[locadex-mcp: fetch-docs] Document fetched successfully: ${path}`);
|
|
31
|
-
return {
|
|
32
|
-
content: [
|
|
33
|
-
{
|
|
34
|
-
type: 'text',
|
|
35
|
-
text: content,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
logger.log(`[locadex-mcp: fetch-docs] Error fetching documentation: ${error instanceof Error ? error.message : String(error)}`);
|
|
42
|
-
return {
|
|
43
|
-
content: [
|
|
44
|
-
{
|
|
45
|
-
type: 'text',
|
|
46
|
-
text: `Error fetching documentation: ${error instanceof Error ? error.message : String(error)}`,
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
isError: true,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
server.tool('list-docs', docsTools['list-docs'], {}, async () => {
|
|
54
|
-
try {
|
|
55
|
-
const content = await fetchDocContent('llms.txt');
|
|
56
|
-
if (!content) {
|
|
57
|
-
logger.log(`[locadex-mcp: list-docs] Failed to fetch documentation index`);
|
|
58
|
-
return {
|
|
59
|
-
content: [
|
|
60
|
-
{
|
|
61
|
-
type: 'text',
|
|
62
|
-
text: `Failed to fetch documentation index`,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
isError: true,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
logger.log(`[locadex-mcp: list-docs] Documentation index fetched successfully`);
|
|
69
|
-
return {
|
|
70
|
-
content: [
|
|
71
|
-
{
|
|
72
|
-
type: 'text',
|
|
73
|
-
text: content,
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
logger.log(`[locadex-mcp: list-docs] Error listing documentation: ${error instanceof Error ? error.message : String(error)}`);
|
|
80
|
-
return {
|
|
81
|
-
content: [
|
|
82
|
-
{
|
|
83
|
-
type: 'text',
|
|
84
|
-
text: `Error listing documentation: ${error instanceof Error ? error.message : String(error)}`,
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
isError: true,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=docs.js.map
|
|
93
|
-
//# debugId=596bdbfc-3d82-5b86-85a5-9eb94bc8e24d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sources":["mcp/tools/docs.ts"],"sourceRoot":"/","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"],"names":[],"mappings":";;AACA,OAAO,EAAE,CAAC,EAAE,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,CAAC,CAAC;AACL,CAAC","debug_id":"596bdbfc-3d82-5b86-85a5-9eb94bc8e24d"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
type Guide = {
|
|
3
|
-
id: string;
|
|
4
|
-
description: string;
|
|
5
|
-
path: string;
|
|
6
|
-
type: 'important' | 'basic' | 'advanced';
|
|
7
|
-
};
|
|
8
|
-
export declare const guides: Guide[];
|
|
9
|
-
export declare function addGuidesTools(server: McpServer): void;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=guides.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guides.d.ts","sourceRoot":"/","sources":["mcp/tools/guides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,EA+DzB,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,QA8B/C"}
|
package/dist/mcp/tools/guides.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
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]="e6aaf2bb-c78f-594b-bf73-d58ce4012f6a")}catch(e){}}();
|
|
3
|
-
import getGuide from '../getGuide.js';
|
|
4
|
-
import { logger } from '../../logging/logger.js';
|
|
5
|
-
export const guides = [
|
|
6
|
-
{
|
|
7
|
-
id: 'next_important_functions',
|
|
8
|
-
description: 'Important documentation outlining the imports available in `gt-next`.',
|
|
9
|
-
path: 'guides/next/important/functions.md',
|
|
10
|
-
type: 'important',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
id: 'next_basic_jsx',
|
|
14
|
-
description: 'Call this tool when you see content in JSX or HTML that needs to be internationalized.',
|
|
15
|
-
path: 'guides/next/basic/jsx.md',
|
|
16
|
-
type: 'basic',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
id: 'next_basic_strings',
|
|
20
|
-
description: `Call this tool when you see a string created by '', "", or \`\` that needs to be internationalized.`,
|
|
21
|
-
path: 'guides/next/basic/strings.md',
|
|
22
|
-
type: 'basic',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: 'next_basic_branches',
|
|
26
|
-
description: 'Call this tool when you see a conditional statement or a pluralization statement that needs to be internationalized.',
|
|
27
|
-
path: 'guides/next/basic/branches.md',
|
|
28
|
-
type: 'basic',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 'next_basic_variables',
|
|
32
|
-
description: 'Call this tool when you see variable content (Currency, DateTime, Numbers, and other dynamic content) that needs to be internationalized.',
|
|
33
|
-
path: 'guides/next/basic/variables.md',
|
|
34
|
-
type: 'basic',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: 'next_advanced_interpolated-strings',
|
|
38
|
-
description: 'Call this tool when you see a string with variables within/around it or interpolated string (template string literal with quasis) that needs to be internationalized.',
|
|
39
|
-
path: 'guides/next/advanced/interpolated-strings.md',
|
|
40
|
-
type: 'advanced',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'next_advanced_conditional-rendering',
|
|
44
|
-
description: 'Call this tool when you see a conditional statement or a pluralization statement that needs to be internationalized.',
|
|
45
|
-
path: 'guides/next/advanced/conditional-rendering.md',
|
|
46
|
-
type: 'advanced',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
id: 'next_advanced_external-strings',
|
|
50
|
-
description: 'Call this tool when you see a variable, constant, or function containing strings outside of a component scope that needs to be internationalized.',
|
|
51
|
-
path: 'guides/next/advanced/external-strings.md',
|
|
52
|
-
type: 'advanced',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: 'next_advanced_mapping-expressions',
|
|
56
|
-
description: 'Call this tool when you see a mapping expression for a nested data structure that contains content that needs to be internationalized.',
|
|
57
|
-
path: 'guides/next/advanced/mapping-expressions.md',
|
|
58
|
-
type: 'advanced',
|
|
59
|
-
},
|
|
60
|
-
];
|
|
61
|
-
export function addGuidesTools(server) {
|
|
62
|
-
guides.forEach((guide) => {
|
|
63
|
-
server.tool(guide.id, guide.description, {}, async () => {
|
|
64
|
-
const path = guide.path;
|
|
65
|
-
const { content, error } = await getGuide(path);
|
|
66
|
-
if (error) {
|
|
67
|
-
logger.log(`[locadex-mcp: ${guide.id}] Error fetching guide: ${guide.id} at path ${path}`);
|
|
68
|
-
return {
|
|
69
|
-
content: [
|
|
70
|
-
{
|
|
71
|
-
type: 'text',
|
|
72
|
-
text: `Error fetching guide: ${error}`,
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
isError: true,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
logger.log(`[locadex-mcp: ${guide.id}] Returning guide: ${guide.id}`);
|
|
79
|
-
return {
|
|
80
|
-
content: [
|
|
81
|
-
{
|
|
82
|
-
type: 'text',
|
|
83
|
-
text: content ?? '',
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=guides.js.map
|
|
91
|
-
//# debugId=e6aaf2bb-c78f-594b-bf73-d58ce4012f6a
|
|
@@ -1 +0,0 @@
|
|
|
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: 'next_important_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: 'next_basic_jsx',\n description:\n 'Call this tool when you see content in JSX or HTML that needs to be internationalized.',\n path: 'guides/next/basic/jsx.md',\n type: 'basic',\n },\n {\n id: 'next_basic_strings',\n description: `Call this tool when you see a string created by '', \"\", or \\`\\` that needs to be internationalized.`,\n path: 'guides/next/basic/strings.md',\n type: 'basic',\n },\n {\n id: 'next_basic_branches',\n description:\n 'Call this tool when you see a conditional statement or a pluralization statement that needs to be internationalized.',\n path: 'guides/next/basic/branches.md',\n type: 'basic',\n },\n {\n id: 'next_basic_variables',\n description:\n 'Call this tool when you see variable content (Currency, DateTime, Numbers, and other dynamic content) that needs to be internationalized.',\n path: 'guides/next/basic/variables.md',\n type: 'basic',\n },\n {\n id: 'next_advanced_interpolated-strings',\n description:\n 'Call this tool when 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: 'next_advanced_conditional-rendering',\n description:\n 'Call this tool when you see a conditional statement or a pluralization statement that needs to be internationalized.',\n path: 'guides/next/advanced/conditional-rendering.md',\n type: 'advanced',\n },\n {\n id: 'next_advanced_external-strings',\n description:\n 'Call this tool when you see a variable, constant, or function containing strings outside of a component scope that needs to be internationalized.',\n path: 'guides/next/advanced/external-strings.md',\n type: 'advanced',\n },\n {\n id: 'next_advanced_mapping-expressions',\n description:\n 'Call this tool when you see a mapping expression for a nested data structure that contains content that needs to be internationalized.',\n path: 'guides/next/advanced/mapping-expressions.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(\n `[locadex-mcp: ${guide.id}] Error fetching guide: ${guide.id} at path ${path}`\n );\n return {\n content: [\n {\n type: 'text',\n text: `Error fetching guide: ${error}`,\n },\n ],\n isError: true,\n };\n }\n logger.log(`[locadex-mcp: ${guide.id}] Returning guide: ${guide.id}`);\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,wFAAwF;QAC1F,IAAI,EAAE,0BAA0B;QAChC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,oBAAoB;QACxB,WAAW,EAAE,qGAAqG;QAClH,IAAI,EAAE,8BAA8B;QACpC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,WAAW,EACT,sHAAsH;QACxH,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,WAAW,EACT,2IAA2I;QAC7I,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,OAAO;KACd;IACD;QACE,EAAE,EAAE,oCAAoC;QACxC,WAAW,EACT,uKAAuK;QACzK,IAAI,EAAE,8CAA8C;QACpD,IAAI,EAAE,UAAU;KACjB;IACD;QACE,EAAE,EAAE,qCAAqC;QACzC,WAAW,EACT,sHAAsH;QACxH,IAAI,EAAE,+CAA+C;QACrD,IAAI,EAAE,UAAU;KACjB;IACD;QACE,EAAE,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":"validate.d.ts","sourceRoot":"/","sources":["mcp/tools/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,MAAM,QA8CrB"}
|
|
@@ -1,37 +0,0 @@
|
|
|
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]="7e6f1a90-3beb-58b3-974b-b40d26a25776")}catch(e){}}();
|
|
3
|
-
import { logger } from '../../logging/logger.js';
|
|
4
|
-
import { execFunction } from '../../utils/exec.js';
|
|
5
|
-
export function addValidateProjectTool(server, appDirectory) {
|
|
6
|
-
server.tool('validate-project', 'Validates a project for internationalization errors', {}, async () => {
|
|
7
|
-
try {
|
|
8
|
-
const { stdout, stderr, code } = await execFunction('locadex', ['validate'], false, appDirectory, undefined, 1 * 60 * 1000 // 1 minute
|
|
9
|
-
);
|
|
10
|
-
if (code === 0) {
|
|
11
|
-
logger.log(`[locadex-mcp: validate] Successfully validated project: ${stdout} ${stderr}`);
|
|
12
|
-
return {
|
|
13
|
-
content: [{ type: 'text', text: stdout + stderr }],
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
logger.log(`[locadex-mcp: validate] Error validating project: ${stdout} ${stderr} with code ${code}`);
|
|
18
|
-
return {
|
|
19
|
-
content: [{ type: 'text', text: stdout + stderr }],
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
logger.log(`[locadex-mcp: validate] Error validating project: ${error instanceof Error ? error.message : String(error)}`);
|
|
25
|
-
return {
|
|
26
|
-
content: [
|
|
27
|
-
{
|
|
28
|
-
type: 'text',
|
|
29
|
-
text: `Error validating project: ${error instanceof Error ? error.message : String(error)}`,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=validate.js.map
|
|
37
|
-
//# debugId=7e6f1a90-3beb-58b3-974b-b40d26a25776
|