lingo.dev 0.76.0 → 0.77.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/build/cli.cjs CHANGED
@@ -3517,10 +3517,63 @@ function displaySummary(results) {
3517
3517
  });
3518
3518
  }
3519
3519
 
3520
+ // src/cli/cmd/mcp.ts
3521
+
3522
+ var _stdiojs = require('@modelcontextprotocol/sdk/server/stdio.js');
3523
+ var _mcpjs = require('@modelcontextprotocol/sdk/server/mcp.js');
3524
+
3525
+
3526
+ var mcp_default = new (0, _interactivecommander.Command)().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (_21, program) => {
3527
+ const apiKey = program.args[0];
3528
+ const settings = getSettings(apiKey);
3529
+ if (!settings.auth.apiKey) {
3530
+ console.error("No API key provided");
3531
+ return;
3532
+ }
3533
+ const authenticator = createAuthenticator({
3534
+ apiUrl: settings.auth.apiUrl,
3535
+ apiKey: settings.auth.apiKey
3536
+ });
3537
+ const auth = await authenticator.whoami();
3538
+ if (!auth) {
3539
+ console.error("Not authenticated");
3540
+ return;
3541
+ } else {
3542
+ console.log(`Authenticated as ${auth.email}`);
3543
+ }
3544
+ const replexicaEngine = new (0, __sdk.ReplexicaEngine)({
3545
+ apiKey: settings.auth.apiKey,
3546
+ apiUrl: settings.auth.apiUrl
3547
+ });
3548
+ const server = new (0, _mcpjs.McpServer)({
3549
+ name: "Lingo.dev",
3550
+ version: "1.0.0"
3551
+ });
3552
+ server.tool(
3553
+ "translate",
3554
+ "Detect language and translate text with Lingo.dev.",
3555
+ {
3556
+ text: _zod2.default.string(),
3557
+ targetLocale: _zod2.default.string().regex(/^[a-z]{2}(-[A-Z]{2})?$/)
3558
+ },
3559
+ async ({ text, targetLocale }) => {
3560
+ const sourceLocale = await replexicaEngine.recognizeLocale(text);
3561
+ const data = await replexicaEngine.localizeText(text, {
3562
+ sourceLocale,
3563
+ targetLocale
3564
+ });
3565
+ return { content: [{ type: "text", text: data }] };
3566
+ }
3567
+ );
3568
+ const transport = new (0, _stdiojs.StdioServerTransport)();
3569
+ await server.connect(transport);
3570
+ console.log("Lingo.dev MCP Server running on stdio");
3571
+ });
3572
+
3520
3573
  // package.json
3521
3574
  var package_default = {
3522
3575
  name: "lingo.dev",
3523
- version: "0.76.0",
3576
+ version: "0.77.0",
3524
3577
  description: "Lingo.dev CLI",
3525
3578
  private: false,
3526
3579
  publishConfig: {
@@ -3568,6 +3621,7 @@ var package_default = {
3568
3621
  "@inquirer/prompts": "^7.2.3",
3569
3622
  "@lingo.dev/_sdk": "workspace:*",
3570
3623
  "@lingo.dev/_spec": "workspace:*",
3624
+ "@modelcontextprotocol/sdk": "^1.5.0",
3571
3625
  "@paralleldrive/cuid2": "^2.2.2",
3572
3626
  chalk: "^5.4.1",
3573
3627
  cors: "^2.8.5",
@@ -3657,7 +3711,7 @@ ${_gradientstring.vice.call(void 0,
3657
3711
 
3658
3712
  Website: https://lingo.dev
3659
3713
  `
3660
- ).version(`v${package_default.version}`, "-v, --version", "Show version").addCommand(init_default).interactive("-y, --no-interactive", "Disable interactive mode").addCommand(i18n_default).addCommand(auth_default).addCommand(show_default).addCommand(lockfile_default).addCommand(cleanup_default).exitOverride((err) => {
3714
+ ).version(`v${package_default.version}`, "-v, --version", "Show version").addCommand(init_default).interactive("-y, --no-interactive", "Disable interactive mode").addCommand(i18n_default).addCommand(auth_default).addCommand(show_default).addCommand(lockfile_default).addCommand(cleanup_default).addCommand(mcp_default).exitOverride((err) => {
3661
3715
  if (err.code === "commander.helpDisplayed" || err.code === "commander.version" || err.code === "commander.help") {
3662
3716
  process.exit(0);
3663
3717
  }