@dialexjs/mcp 0.3.0 → 0.5.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/server.ts","../src/index.ts"],"mappings":";;wBA2BgB,sBAAsB;EAAW;IAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBCdrD,aAAa,2BAA2B"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/server.ts","../src/index.ts"],"mappings":";;wBAgCgB,sBAAsB;EAAW;IAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBCjBrD,aAAa,2BAA2B"}
package/dist/index.mjs CHANGED
@@ -3,10 +3,12 @@ import fs from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
5
  import path from "node:path";
6
+ import { TODO_PREFIX, analyzeProject, copyLeaf, generateDictionaries, getString, hasPath, isStale, listLeaves, listLocales, loadDictionaryFile, loadStaticProject, readLock, readStaticConfig, saveDictionaryFile, scanReferences, setString } from "@dialexjs/cli/api";
6
7
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
7
8
  import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema } from "@modelcontextprotocol/sdk/types.js";
8
9
  import { z } from "zod";
9
- import { TODO_PREFIX, analyzeProject, copyLeaf, generateDictionaries, getString, hasPath, listLeaves, listLocales, loadDictionaryFile, loadStaticProject, readStaticConfig, saveDictionaryFile, scanReferences, setString } from "@dialexjs/cli/api";
10
+ //#region package.json
11
+ var version = "0.5.0";
10
12
  const DOC_TOPICS = {
11
13
  guide: `# Dialex Internationalization Guide
12
14
 
@@ -86,7 +88,7 @@ function createDialexMcpServer(options = {}) {
86
88
  const getRoot = () => path.resolve(options.root || process.cwd());
87
89
  const server = new Server({
88
90
  name: "dialex",
89
- version: "0.3.0"
91
+ version
90
92
  }, { capabilities: {
91
93
  tools: {},
92
94
  resources: {}
@@ -189,7 +191,7 @@ function createDialexMcpServer(options = {}) {
189
191
  },
190
192
  {
191
193
  name: "dialex_missing",
192
- description: "List all missing keys or keys marked with [TODO] placeholders across locales.",
194
+ description: "List missing keys, keys marked with [TODO] placeholders, and stale translations (the source text changed after they were translated, per dialex.lock.json) across locales.",
193
195
  inputSchema: {
194
196
  type: "object",
195
197
  properties: {
@@ -372,6 +374,7 @@ function createDialexMcpServer(options = {}) {
372
374
  const defaultLocale = project.config.defaultLocale || "en";
373
375
  const missingItems = [];
374
376
  const configuredLocales = new Set(project.config.locales || []);
377
+ const lock = readLock(root);
375
378
  for (const d of project.dictionaries) {
376
379
  const localesInDict = new Set(listLocales(d.df));
377
380
  const allLocales = /* @__PURE__ */ new Set([...localesInDict, ...configuredLocales]);
@@ -406,6 +409,32 @@ function createDialexMcpServer(options = {}) {
406
409
  });
407
410
  }
408
411
  }
412
+ if (lock?.sourceLocale) {
413
+ const sourceLeaves = new Map(listLeaves(d.df, lock.sourceLocale).map((l) => [l.path.join("."), l]));
414
+ for (const loc of allLocales) {
415
+ if (loc === lock.sourceLocale) continue;
416
+ if (parsed.locale && loc !== parsed.locale) continue;
417
+ for (const leaf of listLeaves(d.df, loc)) {
418
+ if (leaf.kind !== "string" || leaf.value === void 0) continue;
419
+ if (leaf.value.startsWith(TODO_PREFIX)) continue;
420
+ const pathKey = leaf.path.join(".");
421
+ const source = sourceLeaves.get(pathKey);
422
+ if (source?.kind !== "string" || source.value === void 0) continue;
423
+ const key = `${d.name}.${pathKey}`;
424
+ if (!isStale(lock, loc, key, source.value)) continue;
425
+ missingItems.push({
426
+ dictionary: d.name,
427
+ file: d.rel,
428
+ locale: loc,
429
+ path: leaf.path,
430
+ key,
431
+ status: "stale",
432
+ currentValue: leaf.value,
433
+ defaultValue: source.value
434
+ });
435
+ }
436
+ }
437
+ }
409
438
  }
410
439
  return { content: [{
411
440
  type: "text",
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/docs.ts","../src/server.ts","../src/index.ts"],"sourcesContent":["export const DIALEX_GUIDE_DOC = `# Dialex Internationalization Guide\n\nDialex is a high-performance, type-safe internationalization toolchain for JavaScript and TypeScript.\n\n## Key Features\n- **Zero Runtime Overhead**: Dictionaries are statically compiled.\n- **Strict Parity**: Compile-time checking verifies that every key in your default locale exists in all configured locales.\n- **ICU MessageFormat**: Native plural and select format support ({count, plural, one {# item} other {# items}}).\n- **Universal Framework Support**: Native integrations for React, Next.js, Express, Fastify, Hono, Koa, NestJS, SvelteKit, Astro, Vue, and Nuxt.\n\n## Content Dictionaries (\\`*.content.ts\\`)\nDefined with \\`defineDictionary\\`:\n\\`\\`\\`ts\nimport { defineDictionary } from \"dialexjs\";\n\nexport default defineDictionary(\"home\", {\n en: {\n title: \"Welcome\",\n greeting: (name: string) => \\`Hello, \\${name}!\\`,\n items: \"{count, plural, one {# item} other {# items}}\",\n },\n tr: {\n title: \"Hoş Geldiniz\",\n greeting: (name: string) => \\`Merhaba, \\${name}!\\`,\n items: \"{count, plural, other {# öğe}}\",\n },\n});\n\\`\\`\\`\n\n## CLI & Tooling\n- \\`dialex check\\`: Parity checker. Use \\`--fix\\` to insert \\`[TODO]\\` stubs. Use \\`--json\\` for structured output.\n- \\`dialex generate\\`: Generates \\`dialex.generated.ts\\` and \\`dialex-env.d.ts\\`.\n- \\`dialex export\\` / \\`dialex import\\`: JSON, CSV, XLIFF interchange.\n- \\`dialex translate\\`: Fill missing keys with AI providers (Claude, OpenAI, Gemini, DeepL).\n`;\n\nexport const DIALEX_TRANSLATE_DOC = `# Dialex Translation Workflow\n\n## Missing Keys & Workflow\n1. Run \\`dialex check --json\\` to detect missing keys or parity discrepancies.\n2. Run \\`dialex check --fix\\` (or \\`dialex_add_missing\\` via MCP) to automatically insert \\`[TODO]\\` stubs for missing keys.\n3. Replace \\`[TODO]\\` entries with real translations using \\`dialex_set_key\\` via MCP or \\`dialex translate\\` via CLI.\n4. Verify with \\`dialex check\\` that all keys are translated and ICU placeholders match.\n`;\n\nexport const DIALEX_ICU_DOC = `# Dialex ICU MessageFormat Reference\n\n## Plurals\n\\`\\`\\`icu\n{count, plural,\n =0 {No notifications}\n one {# notification}\n other {# notifications}\n}\n\\`\\`\\`\n\n## Select\n\\`\\`\\`icu\n{gender, select,\n male {He updated his profile}\n female {She updated her profile}\n other {They updated their profile}\n}\n\\`\\`\\`\n\nAll locales for a given key must declare the exact same variable placeholders.\n`;\n\nexport const DIALEX_ADAPTERS_DOC = `# Dialex Adapters Reference\n\n- **React**: \\`useDictionary(\"name\")\\`, \\`useT()\\` with \\`DialexProvider\\`.\n- **Next.js App Router**: \\`getDictionary(\"name\", locale)\\` in Server Components.\n- **Express / Hono / Fastify**: Middleware injecting \\`getDictionary\\` or context variable into requests.\n`;\n\nexport const DOC_TOPICS: Record<string, string> = {\n guide: DIALEX_GUIDE_DOC,\n translate: DIALEX_TRANSLATE_DOC,\n icu: DIALEX_ICU_DOC,\n adapters: DIALEX_ADAPTERS_DOC,\n};\n","import path from \"node:path\";\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n ListResourcesRequestSchema,\n ReadResourceRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport { z } from \"zod\";\nimport {\n analyzeProject,\n readStaticConfig,\n loadStaticProject,\n loadDictionaryFile,\n saveDictionaryFile,\n listLeaves,\n getString,\n setString,\n copyLeaf,\n scanReferences,\n generateDictionaries,\n TODO_PREFIX,\n hasPath,\n listLocales,\n} from \"@dialexjs/cli/api\";\nimport { DOC_TOPICS } from \"./docs.js\";\n\nexport function createDialexMcpServer(options: { root?: string } = {}) {\n const getRoot = () => path.resolve(options.root || process.cwd());\n\n const server = new Server(\n {\n name: \"dialex\",\n version: \"0.3.0\",\n },\n {\n capabilities: {\n tools: {},\n resources: {},\n },\n },\n );\n\n server.setRequestHandler(ListResourcesRequestSchema, async () => {\n return {\n resources: Object.keys(DOC_TOPICS).map((topic) => ({\n uri: `dialex://docs/${topic}`,\n name: `Dialex Documentation: ${topic}`,\n mimeType: \"text/markdown\",\n description: `Reference documentation for Dialex ${topic}`,\n })),\n };\n });\n\n server.setRequestHandler(ReadResourceRequestSchema, async (request) => {\n const uri = request.params.uri;\n const match = /^dialex:\\/\\/docs\\/([a-zA-Z0-9_-]+)$/.exec(uri);\n if (!match) {\n throw new Error(`Invalid resource URI: ${uri}`);\n }\n const topic = match[1];\n const content = DOC_TOPICS[topic];\n if (!content) {\n throw new Error(`Documentation topic not found: ${topic}`);\n }\n return {\n contents: [\n {\n uri,\n mimeType: \"text/markdown\",\n text: content,\n },\n ],\n };\n });\n\n server.setRequestHandler(ListToolsRequestSchema, async () => {\n return {\n tools: [\n {\n name: \"dialex_config\",\n description:\n \"Read static Dialex configuration (locales, defaultLocale, include pattern) from dialex.config.ts or i18n.config.ts without executing project code.\",\n inputSchema: {\n type: \"object\",\n properties: {\n config: {\n type: \"string\",\n description: \"Optional custom path to config file relative to project root.\",\n },\n },\n },\n },\n {\n name: \"dialex_list_dictionaries\",\n description:\n \"List all discovered content dictionaries, their files, and supported locales.\",\n inputSchema: {\n type: \"object\",\n properties: {\n config: {\n type: \"string\",\n description: \"Optional custom path to config file relative to project root.\",\n },\n },\n },\n },\n {\n name: \"dialex_get_dictionary\",\n description:\n \"Get leaf keys and values for a specific dictionary or all dictionaries, optionally filtered by locale.\",\n inputSchema: {\n type: \"object\",\n properties: {\n name: {\n type: \"string\",\n description:\n \"Dictionary name (e.g. 'home' or 'auth'). If omitted, returns all dictionaries.\",\n },\n locale: {\n type: \"string\",\n description:\n \"Locale to retrieve (e.g. 'en' or 'tr'). If omitted, returns all locales.\",\n },\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n {\n name: \"dialex_check\",\n description:\n \"Analyze project statically to verify dictionary key parity, ICU arguments, and source code references without executing project code.\",\n inputSchema: {\n type: \"object\",\n properties: {\n src: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional source file globs to scan for dictionary references.\",\n },\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n {\n name: \"dialex_find_usages\",\n description:\n \"Scan source files for dictionary usages (e.g. getDictionary('home') or t('home.title')).\",\n inputSchema: {\n type: \"object\",\n properties: {\n file: {\n type: \"string\",\n description: \"Relative or absolute file path to scan for references.\",\n },\n },\n required: [\"file\"],\n },\n },\n {\n name: \"dialex_missing\",\n description:\n \"List all missing keys or keys marked with [TODO] placeholders across locales.\",\n inputSchema: {\n type: \"object\",\n properties: {\n locale: {\n type: \"string\",\n description: \"Filter missing keys to a specific target locale.\",\n },\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n {\n name: \"dialex_set_key\",\n description:\n \"Safely set or update a translation string in a dictionary file using AST manipulation without executing project code or destroying comments/formatting. Refuses to overwrite non-[TODO] values unless overwrite is explicitly true.\",\n inputSchema: {\n type: \"object\",\n properties: {\n file: {\n type: \"string\",\n description: \"Dictionary file path (e.g. 'src/home.content.ts' or absolute path).\",\n },\n locale: {\n type: \"string\",\n description: \"Locale to update (e.g. 'tr').\",\n },\n path: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Key path segments (e.g. ['nav', 'about'] or ['title']).\",\n },\n value: {\n type: \"string\",\n description: \"The translated string value to set.\",\n },\n overwrite: {\n type: \"boolean\",\n description:\n \"Must be set to true to overwrite an existing translated value that is not marked [TODO]. Defaults to false.\",\n },\n },\n required: [\"file\", \"locale\", \"path\", \"value\"],\n },\n },\n {\n name: \"dialex_add_missing\",\n description:\n \"Automatically insert missing keys across all locales as [TODO] placeholders copied from default locale values (AST safe edits).\",\n inputSchema: {\n type: \"object\",\n properties: {\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n {\n name: \"dialex_generate\",\n description:\n \"Run code generation to build standalone dictionary registry and TypeScript declarations.\",\n inputSchema: {\n type: \"object\",\n properties: {\n output: {\n type: \"string\",\n description: \"Optional custom output path for dialex.generated.ts.\",\n },\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n ],\n };\n });\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const root = getRoot();\n const { name, arguments: args = {} } = request.params;\n\n try {\n switch (name) {\n case \"dialex_config\": {\n const schema = z.object({ config: z.string().optional() });\n const parsed = schema.parse(args);\n const staticConf = readStaticConfig(root, parsed.config);\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(staticConf, null, 2),\n },\n ],\n };\n }\n\n case \"dialex_list_dictionaries\": {\n const schema = z.object({ config: z.string().optional() });\n const parsed = schema.parse(args);\n const project = await loadStaticProject(root, parsed.config);\n const dicts = project.dictionaries.map((d) => ({\n name: d.name,\n file: d.rel,\n locales: listLocales(d.df),\n complete: d.df.complete,\n }));\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n dictionaries: dicts,\n unsupported: project.unsupported,\n notes: project.notes,\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_get_dictionary\": {\n const schema = z.object({\n name: z.string().optional(),\n locale: z.string().optional(),\n config: z.string().optional(),\n });\n const parsed = schema.parse(args);\n const project = await loadStaticProject(root, parsed.config);\n\n const result: Record<\n string,\n Record<string, Array<{ path: string[]; kind: string; value?: string }>>\n > = {};\n\n for (const d of project.dictionaries) {\n if (parsed.name && d.name !== parsed.name) continue;\n result[d.name] = {};\n const locales = listLocales(d.df);\n for (const loc of locales) {\n if (parsed.locale && loc !== parsed.locale) continue;\n result[d.name][loc] = listLeaves(d.df, loc);\n }\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(result, null, 2),\n },\n ],\n };\n }\n\n case \"dialex_check\": {\n const schema = z.object({\n src: z.array(z.string()).optional(),\n config: z.string().optional(),\n });\n const parsed = schema.parse(args);\n const staticConf = readStaticConfig(root, parsed.config);\n const analysis = await analyzeProject({\n root,\n config: staticConf.config,\n src: parsed.src,\n runtime: false,\n });\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n issues: analysis.issues.map((i) => ({\n ...i,\n file: path.relative(root, i.file),\n })),\n totalIssues: analysis.issues.filter((i) => i.level === \"error\").length,\n totalWarnings: analysis.issues.filter((i) => i.level === \"warning\").length,\n filesScanned: analysis.sourceFilesScanned,\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_find_usages\": {\n const schema = z.object({ file: z.string() });\n const parsed = schema.parse(args);\n const filePath = path.isAbsolute(parsed.file)\n ? parsed.file\n : path.resolve(root, parsed.file);\n const fs = await import(\"node:fs\");\n if (!fs.existsSync(filePath)) {\n throw new Error(`File not found: ${parsed.file}`);\n }\n const text = fs.readFileSync(filePath, \"utf-8\");\n const refs = scanReferences(text);\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n { file: path.relative(root, filePath), references: refs },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_missing\": {\n const schema = z.object({\n locale: z.string().optional(),\n config: z.string().optional(),\n });\n const parsed = schema.parse(args);\n const project = await loadStaticProject(root, parsed.config);\n const defaultLocale = project.config.defaultLocale || \"en\";\n\n const missingItems: Array<{\n dictionary: string;\n file: string;\n locale: string;\n path: string[];\n key: string;\n status: \"missing\" | \"todo\";\n currentValue?: string;\n defaultValue?: string;\n }> = [];\n\n const configuredLocales = new Set(project.config.locales || []);\n\n for (const d of project.dictionaries) {\n const localesInDict = new Set(listLocales(d.df));\n const allLocales = new Set([...localesInDict, ...configuredLocales]);\n const defaultLeaves = listLeaves(d.df, defaultLocale);\n const defaultMap = new Map(defaultLeaves.map((l) => [l.path.join(\".\"), l.value]));\n\n for (const loc of allLocales) {\n if (loc === defaultLocale) continue;\n if (parsed.locale && loc !== parsed.locale) continue;\n\n const leaves = listLeaves(d.df, loc);\n const leafMap = new Map(leaves.map((l) => [l.path.join(\".\"), l]));\n\n for (const defLeaf of defaultLeaves) {\n const pathKey = defLeaf.path.join(\".\");\n const curr = leafMap.get(pathKey);\n if (!curr) {\n missingItems.push({\n dictionary: d.name,\n file: d.rel,\n locale: loc,\n path: defLeaf.path,\n key: `${d.name}.${pathKey}`,\n status: \"missing\",\n defaultValue: defLeaf.value,\n });\n } else if (curr.kind === \"string\" && curr.value?.startsWith(TODO_PREFIX)) {\n missingItems.push({\n dictionary: d.name,\n file: d.rel,\n locale: loc,\n path: defLeaf.path,\n key: `${d.name}.${pathKey}`,\n status: \"todo\",\n currentValue: curr.value,\n defaultValue: defaultMap.get(pathKey),\n });\n }\n }\n }\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n { missingCount: missingItems.length, items: missingItems },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_set_key\": {\n const schema = z.object({\n file: z.string(),\n locale: z.string(),\n path: z.array(z.string()),\n value: z.string(),\n overwrite: z.boolean().optional(),\n });\n const parsed = schema.parse(args);\n const filePath = path.isAbsolute(parsed.file)\n ? parsed.file\n : path.resolve(root, parsed.file);\n\n const df = await loadDictionaryFile(filePath);\n if (!df) {\n throw new Error(\n `Cannot load dictionary file at ${parsed.file} (unsupported shape or syntax error)`,\n );\n }\n\n const existingVal = getString(df, parsed.locale, parsed.path);\n const isTodo = existingVal?.startsWith(TODO_PREFIX);\n\n if (existingVal !== undefined && !isTodo && !parsed.overwrite) {\n throw new Error(\n `Key \"${parsed.path.join(\".\")}\" in locale \"${parsed.locale}\" already has a translated value (${JSON.stringify(existingVal)}). Set overwrite: true to overwrite.`,\n );\n }\n\n const res = setString(df, parsed.locale, parsed.path, parsed.value);\n if (res === \"skipped\") {\n throw new Error(\n `Cannot set string at \"${parsed.path.join(\".\")}\" in \"${parsed.locale}\": target is a function or non-string node.`,\n );\n }\n\n await saveDictionaryFile(df);\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n success: true,\n action: res,\n file: path.relative(root, filePath),\n locale: parsed.locale,\n path: parsed.path,\n value: parsed.value,\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_add_missing\": {\n const schema = z.object({ config: z.string().optional() });\n const parsed = schema.parse(args);\n const project = await loadStaticProject(root, parsed.config);\n const defaultLocale = project.config.defaultLocale || \"en\";\n const configuredLocales = project.config.locales || [];\n\n let totalFixed = 0;\n\n for (const d of project.dictionaries) {\n if (!d.df.complete) continue;\n const present = listLocales(d.df);\n const targets = Array.from(new Set([...present, ...configuredLocales]));\n const sourceOrder = [\n defaultLocale,\n ...present.filter((l) => l !== defaultLocale),\n ].filter((l) => present.includes(l));\n\n const allPaths = new Map<string, string[]>();\n for (const locale of present) {\n for (const leaf of listLeaves(d.df, locale))\n allPaths.set(leaf.path.join(\"\\u0000\"), leaf.path);\n }\n\n let changed = false;\n for (const target of targets) {\n for (const leafPath of allPaths.values()) {\n if (hasPath(d.df, target, leafPath)) continue;\n const source = sourceOrder.find((l) => l !== target && hasPath(d.df, l, leafPath));\n if (\n source &&\n copyLeaf(d.df, source, target, leafPath, (v) => `${TODO_PREFIX}${v}`)\n ) {\n totalFixed++;\n changed = true;\n }\n }\n }\n\n if (changed) {\n await saveDictionaryFile(d.df);\n }\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify({ success: true, fixed: totalFixed }, null, 2),\n },\n ],\n };\n }\n\n case \"dialex_generate\": {\n const schema = z.object({\n output: z.string().optional(),\n config: z.string().optional(),\n });\n const parsed = schema.parse(args);\n const res = generateDictionaries(root, { output: parsed.output, config: parsed.config });\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n success: true,\n files: res.files.map((f) => path.relative(root, f)),\n outputPath: path.relative(root, res.outputPath),\n dtsPath: path.relative(root, res.dtsPath),\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n default:\n throw new Error(`Unknown tool: ${name}`);\n }\n } catch (err: any) {\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: `Error executing ${name}: ${err.message || String(err)}`,\n },\n ],\n };\n }\n });\n\n return server;\n}\n","#!/usr/bin/env node\n\nimport fs from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { createDialexMcpServer } from \"./server.js\";\n\nexport { createDialexMcpServer } from \"./server.js\";\n\n/**\n * True when this module is the script node was started with. `npx` and package managers start\n * bins through a symlink, so `argv[1]` must be resolved before comparing it with the module path.\n */\nexport function isEntrypoint(argv1: string | undefined, moduleUrl: string): boolean {\n if (!argv1) return false;\n try {\n return fs.realpathSync(argv1) === fs.realpathSync(fileURLToPath(moduleUrl));\n } catch {\n return false;\n }\n}\n\nasync function main() {\n const args = process.argv.slice(2);\n let root = process.cwd();\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] === \"--root\" && args[i + 1]) {\n root = args[i + 1];\n i++;\n } else if (args[i].startsWith(\"--root=\")) {\n root = args[i].slice(\"--root=\".length);\n }\n }\n\n const server = createDialexMcpServer({ root });\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n\nif (isEntrypoint(process.argv[1], import.meta.url)) {\n main().catch((err) => {\n console.error(\"Dialex MCP Server Error:\", err);\n process.exit(1);\n });\n}\n"],"mappings":";;;;;;;;;AA2EA,MAAa,aAAqC;CAChD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACP,WAAW;;;;;;;;CACX,KAAK;;;;;;;;;;;;;;;;;;;;;;CACL,UAAU;;;;;;AACZ;;;ACrDA,SAAgB,sBAAsB,UAA6B,CAAC,GAAG;CACrE,MAAM,gBAAgB,KAAK,QAAQ,QAAQ,QAAQ,QAAQ,IAAI,CAAC;CAEhE,MAAM,SAAS,IAAI,OACjB;EACE,MAAM;EACN,SAAS;CACX,GACA,EACE,cAAc;EACZ,OAAO,CAAC;EACR,WAAW,CAAC;CACd,EACF,CACF;CAEA,OAAO,kBAAk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T;AACF;AAEA,eAAe,OAAO;CACpB,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;CACjC,IAAI,OAAO,QAAQ,IAAI;CAEvB,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAC/B,IAAI,KAAK,OAAO,YAAY,KAAK,IAAI,IAAI;EACvC,OAAO,KAAK,IAAI;EAChB;CACF,OAAO,IAAI,KAAK,EAAE,CAAC,WAAW,SAAS,GACrC,OAAO,KAAK,EAAE,CAAC,MAAM,CAAgB;CAIzC,MAAM,SAAS,sBAAsB,EAAE,KAAK,CAAC;CAC7C,MAAM,YAAY,IAAI,qBAAqB;CAC3C,MAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,IAAI,aAAa,QAAQ,KAAK,IAAI,YAAY,GAAG,GAC/C,KAAK,CAAC,CAAC,OAAO,QAAQ;CACpB,QAAQ,MAAM,4BAA4B,GAAG;CAC7C,QAAQ,KAAK,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["pkg.version"],"sources":["../package.json","../src/docs.ts","../src/server.ts","../src/index.ts"],"sourcesContent":["","export const DIALEX_GUIDE_DOC = `# Dialex Internationalization Guide\n\nDialex is a high-performance, type-safe internationalization toolchain for JavaScript and TypeScript.\n\n## Key Features\n- **Zero Runtime Overhead**: Dictionaries are statically compiled.\n- **Strict Parity**: Compile-time checking verifies that every key in your default locale exists in all configured locales.\n- **ICU MessageFormat**: Native plural and select format support ({count, plural, one {# item} other {# items}}).\n- **Universal Framework Support**: Native integrations for React, Next.js, Express, Fastify, Hono, Koa, NestJS, SvelteKit, Astro, Vue, and Nuxt.\n\n## Content Dictionaries (\\`*.content.ts\\`)\nDefined with \\`defineDictionary\\`:\n\\`\\`\\`ts\nimport { defineDictionary } from \"dialexjs\";\n\nexport default defineDictionary(\"home\", {\n en: {\n title: \"Welcome\",\n greeting: (name: string) => \\`Hello, \\${name}!\\`,\n items: \"{count, plural, one {# item} other {# items}}\",\n },\n tr: {\n title: \"Hoş Geldiniz\",\n greeting: (name: string) => \\`Merhaba, \\${name}!\\`,\n items: \"{count, plural, other {# öğe}}\",\n },\n});\n\\`\\`\\`\n\n## CLI & Tooling\n- \\`dialex check\\`: Parity checker. Use \\`--fix\\` to insert \\`[TODO]\\` stubs. Use \\`--json\\` for structured output.\n- \\`dialex generate\\`: Generates \\`dialex.generated.ts\\` and \\`dialex-env.d.ts\\`.\n- \\`dialex export\\` / \\`dialex import\\`: JSON, CSV, XLIFF interchange.\n- \\`dialex translate\\`: Fill missing keys with AI providers (Claude, OpenAI, Gemini, DeepL).\n`;\n\nexport const DIALEX_TRANSLATE_DOC = `# Dialex Translation Workflow\n\n## Missing Keys & Workflow\n1. Run \\`dialex check --json\\` to detect missing keys or parity discrepancies.\n2. Run \\`dialex check --fix\\` (or \\`dialex_add_missing\\` via MCP) to automatically insert \\`[TODO]\\` stubs for missing keys.\n3. Replace \\`[TODO]\\` entries with real translations using \\`dialex_set_key\\` via MCP or \\`dialex translate\\` via CLI.\n4. Verify with \\`dialex check\\` that all keys are translated and ICU placeholders match.\n`;\n\nexport const DIALEX_ICU_DOC = `# Dialex ICU MessageFormat Reference\n\n## Plurals\n\\`\\`\\`icu\n{count, plural,\n =0 {No notifications}\n one {# notification}\n other {# notifications}\n}\n\\`\\`\\`\n\n## Select\n\\`\\`\\`icu\n{gender, select,\n male {He updated his profile}\n female {She updated her profile}\n other {They updated their profile}\n}\n\\`\\`\\`\n\nAll locales for a given key must declare the exact same variable placeholders.\n`;\n\nexport const DIALEX_ADAPTERS_DOC = `# Dialex Adapters Reference\n\n- **React**: \\`useDictionary(\"name\")\\`, \\`useT()\\` with \\`DialexProvider\\`.\n- **Next.js App Router**: \\`getDictionary(\"name\", locale)\\` in Server Components.\n- **Express / Hono / Fastify**: Middleware injecting \\`getDictionary\\` or context variable into requests.\n`;\n\nexport const DOC_TOPICS: Record<string, string> = {\n guide: DIALEX_GUIDE_DOC,\n translate: DIALEX_TRANSLATE_DOC,\n icu: DIALEX_ICU_DOC,\n adapters: DIALEX_ADAPTERS_DOC,\n};\n","import path from \"node:path\";\n\nimport {\n analyzeProject,\n readStaticConfig,\n loadStaticProject,\n loadDictionaryFile,\n saveDictionaryFile,\n listLeaves,\n getString,\n setString,\n copyLeaf,\n scanReferences,\n generateDictionaries,\n TODO_PREFIX,\n hasPath,\n isStale,\n listLocales,\n readLock,\n} from \"@dialexjs/cli/api\";\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n ListResourcesRequestSchema,\n ReadResourceRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport { z } from \"zod\";\n\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport { DOC_TOPICS } from \"./docs.js\";\n\nexport function createDialexMcpServer(options: { root?: string } = {}) {\n const getRoot = () => path.resolve(options.root || process.cwd());\n\n const server = new Server(\n {\n name: \"dialex\",\n version: pkg.version,\n },\n {\n capabilities: {\n tools: {},\n resources: {},\n },\n },\n );\n\n server.setRequestHandler(ListResourcesRequestSchema, async () => {\n return {\n resources: Object.keys(DOC_TOPICS).map((topic) => ({\n uri: `dialex://docs/${topic}`,\n name: `Dialex Documentation: ${topic}`,\n mimeType: \"text/markdown\",\n description: `Reference documentation for Dialex ${topic}`,\n })),\n };\n });\n\n server.setRequestHandler(ReadResourceRequestSchema, async (request) => {\n const uri = request.params.uri;\n const match = /^dialex:\\/\\/docs\\/([a-zA-Z0-9_-]+)$/.exec(uri);\n if (!match) {\n throw new Error(`Invalid resource URI: ${uri}`);\n }\n const topic = match[1];\n const content = DOC_TOPICS[topic];\n if (!content) {\n throw new Error(`Documentation topic not found: ${topic}`);\n }\n return {\n contents: [\n {\n uri,\n mimeType: \"text/markdown\",\n text: content,\n },\n ],\n };\n });\n\n server.setRequestHandler(ListToolsRequestSchema, async () => {\n return {\n tools: [\n {\n name: \"dialex_config\",\n description:\n \"Read static Dialex configuration (locales, defaultLocale, include pattern) from dialex.config.ts or i18n.config.ts without executing project code.\",\n inputSchema: {\n type: \"object\",\n properties: {\n config: {\n type: \"string\",\n description: \"Optional custom path to config file relative to project root.\",\n },\n },\n },\n },\n {\n name: \"dialex_list_dictionaries\",\n description:\n \"List all discovered content dictionaries, their files, and supported locales.\",\n inputSchema: {\n type: \"object\",\n properties: {\n config: {\n type: \"string\",\n description: \"Optional custom path to config file relative to project root.\",\n },\n },\n },\n },\n {\n name: \"dialex_get_dictionary\",\n description:\n \"Get leaf keys and values for a specific dictionary or all dictionaries, optionally filtered by locale.\",\n inputSchema: {\n type: \"object\",\n properties: {\n name: {\n type: \"string\",\n description:\n \"Dictionary name (e.g. 'home' or 'auth'). If omitted, returns all dictionaries.\",\n },\n locale: {\n type: \"string\",\n description:\n \"Locale to retrieve (e.g. 'en' or 'tr'). If omitted, returns all locales.\",\n },\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n {\n name: \"dialex_check\",\n description:\n \"Analyze project statically to verify dictionary key parity, ICU arguments, and source code references without executing project code.\",\n inputSchema: {\n type: \"object\",\n properties: {\n src: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional source file globs to scan for dictionary references.\",\n },\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n {\n name: \"dialex_find_usages\",\n description:\n \"Scan source files for dictionary usages (e.g. getDictionary('home') or t('home.title')).\",\n inputSchema: {\n type: \"object\",\n properties: {\n file: {\n type: \"string\",\n description: \"Relative or absolute file path to scan for references.\",\n },\n },\n required: [\"file\"],\n },\n },\n {\n name: \"dialex_missing\",\n description:\n \"List missing keys, keys marked with [TODO] placeholders, and stale translations (the source text changed after they were translated, per dialex.lock.json) across locales.\",\n inputSchema: {\n type: \"object\",\n properties: {\n locale: {\n type: \"string\",\n description: \"Filter missing keys to a specific target locale.\",\n },\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n {\n name: \"dialex_set_key\",\n description:\n \"Safely set or update a translation string in a dictionary file using AST manipulation without executing project code or destroying comments/formatting. Refuses to overwrite non-[TODO] values unless overwrite is explicitly true.\",\n inputSchema: {\n type: \"object\",\n properties: {\n file: {\n type: \"string\",\n description: \"Dictionary file path (e.g. 'src/home.content.ts' or absolute path).\",\n },\n locale: {\n type: \"string\",\n description: \"Locale to update (e.g. 'tr').\",\n },\n path: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Key path segments (e.g. ['nav', 'about'] or ['title']).\",\n },\n value: {\n type: \"string\",\n description: \"The translated string value to set.\",\n },\n overwrite: {\n type: \"boolean\",\n description:\n \"Must be set to true to overwrite an existing translated value that is not marked [TODO]. Defaults to false.\",\n },\n },\n required: [\"file\", \"locale\", \"path\", \"value\"],\n },\n },\n {\n name: \"dialex_add_missing\",\n description:\n \"Automatically insert missing keys across all locales as [TODO] placeholders copied from default locale values (AST safe edits).\",\n inputSchema: {\n type: \"object\",\n properties: {\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n {\n name: \"dialex_generate\",\n description:\n \"Run code generation to build standalone dictionary registry and TypeScript declarations.\",\n inputSchema: {\n type: \"object\",\n properties: {\n output: {\n type: \"string\",\n description: \"Optional custom output path for dialex.generated.ts.\",\n },\n config: {\n type: \"string\",\n description: \"Optional custom path to config file.\",\n },\n },\n },\n },\n ],\n };\n });\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const root = getRoot();\n const { name, arguments: args = {} } = request.params;\n\n try {\n switch (name) {\n case \"dialex_config\": {\n const schema = z.object({ config: z.string().optional() });\n const parsed = schema.parse(args);\n const staticConf = readStaticConfig(root, parsed.config);\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(staticConf, null, 2),\n },\n ],\n };\n }\n\n case \"dialex_list_dictionaries\": {\n const schema = z.object({ config: z.string().optional() });\n const parsed = schema.parse(args);\n const project = await loadStaticProject(root, parsed.config);\n const dicts = project.dictionaries.map((d) => ({\n name: d.name,\n file: d.rel,\n locales: listLocales(d.df),\n complete: d.df.complete,\n }));\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n dictionaries: dicts,\n unsupported: project.unsupported,\n notes: project.notes,\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_get_dictionary\": {\n const schema = z.object({\n name: z.string().optional(),\n locale: z.string().optional(),\n config: z.string().optional(),\n });\n const parsed = schema.parse(args);\n const project = await loadStaticProject(root, parsed.config);\n\n const result: Record<\n string,\n Record<string, Array<{ path: string[]; kind: string; value?: string }>>\n > = {};\n\n for (const d of project.dictionaries) {\n if (parsed.name && d.name !== parsed.name) continue;\n result[d.name] = {};\n const locales = listLocales(d.df);\n for (const loc of locales) {\n if (parsed.locale && loc !== parsed.locale) continue;\n result[d.name][loc] = listLeaves(d.df, loc);\n }\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(result, null, 2),\n },\n ],\n };\n }\n\n case \"dialex_check\": {\n const schema = z.object({\n src: z.array(z.string()).optional(),\n config: z.string().optional(),\n });\n const parsed = schema.parse(args);\n const staticConf = readStaticConfig(root, parsed.config);\n const analysis = await analyzeProject({\n root,\n config: staticConf.config,\n src: parsed.src,\n runtime: false,\n });\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n issues: analysis.issues.map((i) => ({\n ...i,\n file: path.relative(root, i.file),\n })),\n totalIssues: analysis.issues.filter((i) => i.level === \"error\").length,\n totalWarnings: analysis.issues.filter((i) => i.level === \"warning\").length,\n filesScanned: analysis.sourceFilesScanned,\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_find_usages\": {\n const schema = z.object({ file: z.string() });\n const parsed = schema.parse(args);\n const filePath = path.isAbsolute(parsed.file)\n ? parsed.file\n : path.resolve(root, parsed.file);\n const fs = await import(\"node:fs\");\n if (!fs.existsSync(filePath)) {\n throw new Error(`File not found: ${parsed.file}`);\n }\n const text = fs.readFileSync(filePath, \"utf-8\");\n const refs = scanReferences(text);\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n { file: path.relative(root, filePath), references: refs },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_missing\": {\n const schema = z.object({\n locale: z.string().optional(),\n config: z.string().optional(),\n });\n const parsed = schema.parse(args);\n const project = await loadStaticProject(root, parsed.config);\n const defaultLocale = project.config.defaultLocale || \"en\";\n\n const missingItems: Array<{\n dictionary: string;\n file: string;\n locale: string;\n path: string[];\n key: string;\n status: \"missing\" | \"todo\" | \"stale\";\n currentValue?: string;\n defaultValue?: string;\n }> = [];\n\n const configuredLocales = new Set(project.config.locales || []);\n const lock = readLock(root);\n\n for (const d of project.dictionaries) {\n const localesInDict = new Set(listLocales(d.df));\n const allLocales = new Set([...localesInDict, ...configuredLocales]);\n const defaultLeaves = listLeaves(d.df, defaultLocale);\n const defaultMap = new Map(defaultLeaves.map((l) => [l.path.join(\".\"), l.value]));\n\n for (const loc of allLocales) {\n if (loc === defaultLocale) continue;\n if (parsed.locale && loc !== parsed.locale) continue;\n\n const leaves = listLeaves(d.df, loc);\n const leafMap = new Map(leaves.map((l) => [l.path.join(\".\"), l]));\n\n for (const defLeaf of defaultLeaves) {\n const pathKey = defLeaf.path.join(\".\");\n const curr = leafMap.get(pathKey);\n if (!curr) {\n missingItems.push({\n dictionary: d.name,\n file: d.rel,\n locale: loc,\n path: defLeaf.path,\n key: `${d.name}.${pathKey}`,\n status: \"missing\",\n defaultValue: defLeaf.value,\n });\n } else if (curr.kind === \"string\" && curr.value?.startsWith(TODO_PREFIX)) {\n missingItems.push({\n dictionary: d.name,\n file: d.rel,\n locale: loc,\n path: defLeaf.path,\n key: `${d.name}.${pathKey}`,\n status: \"todo\",\n currentValue: curr.value,\n defaultValue: defaultMap.get(pathKey),\n });\n }\n }\n }\n\n // Translations whose source text changed since they were translated\n if (lock?.sourceLocale) {\n const sourceLeaves = new Map(\n listLeaves(d.df, lock.sourceLocale).map((l) => [l.path.join(\".\"), l]),\n );\n for (const loc of allLocales) {\n if (loc === lock.sourceLocale) continue;\n if (parsed.locale && loc !== parsed.locale) continue;\n for (const leaf of listLeaves(d.df, loc)) {\n if (leaf.kind !== \"string\" || leaf.value === undefined) continue;\n if (leaf.value.startsWith(TODO_PREFIX)) continue;\n const pathKey = leaf.path.join(\".\");\n const source = sourceLeaves.get(pathKey);\n if (source?.kind !== \"string\" || source.value === undefined) continue;\n const key = `${d.name}.${pathKey}`;\n if (!isStale(lock, loc, key, source.value)) continue;\n missingItems.push({\n dictionary: d.name,\n file: d.rel,\n locale: loc,\n path: leaf.path,\n key,\n status: \"stale\",\n currentValue: leaf.value,\n defaultValue: source.value,\n });\n }\n }\n }\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n { missingCount: missingItems.length, items: missingItems },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_set_key\": {\n const schema = z.object({\n file: z.string(),\n locale: z.string(),\n path: z.array(z.string()),\n value: z.string(),\n overwrite: z.boolean().optional(),\n });\n const parsed = schema.parse(args);\n const filePath = path.isAbsolute(parsed.file)\n ? parsed.file\n : path.resolve(root, parsed.file);\n\n const df = await loadDictionaryFile(filePath);\n if (!df) {\n throw new Error(\n `Cannot load dictionary file at ${parsed.file} (unsupported shape or syntax error)`,\n );\n }\n\n const existingVal = getString(df, parsed.locale, parsed.path);\n const isTodo = existingVal?.startsWith(TODO_PREFIX);\n\n if (existingVal !== undefined && !isTodo && !parsed.overwrite) {\n throw new Error(\n `Key \"${parsed.path.join(\".\")}\" in locale \"${parsed.locale}\" already has a translated value (${JSON.stringify(existingVal)}). Set overwrite: true to overwrite.`,\n );\n }\n\n const res = setString(df, parsed.locale, parsed.path, parsed.value);\n if (res === \"skipped\") {\n throw new Error(\n `Cannot set string at \"${parsed.path.join(\".\")}\" in \"${parsed.locale}\": target is a function or non-string node.`,\n );\n }\n\n await saveDictionaryFile(df);\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n success: true,\n action: res,\n file: path.relative(root, filePath),\n locale: parsed.locale,\n path: parsed.path,\n value: parsed.value,\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n case \"dialex_add_missing\": {\n const schema = z.object({ config: z.string().optional() });\n const parsed = schema.parse(args);\n const project = await loadStaticProject(root, parsed.config);\n const defaultLocale = project.config.defaultLocale || \"en\";\n const configuredLocales = project.config.locales || [];\n\n let totalFixed = 0;\n\n for (const d of project.dictionaries) {\n if (!d.df.complete) continue;\n const present = listLocales(d.df);\n const targets = Array.from(new Set([...present, ...configuredLocales]));\n const sourceOrder = [\n defaultLocale,\n ...present.filter((l) => l !== defaultLocale),\n ].filter((l) => present.includes(l));\n\n const allPaths = new Map<string, string[]>();\n for (const locale of present) {\n for (const leaf of listLeaves(d.df, locale))\n allPaths.set(leaf.path.join(\"\\u0000\"), leaf.path);\n }\n\n let changed = false;\n for (const target of targets) {\n for (const leafPath of allPaths.values()) {\n if (hasPath(d.df, target, leafPath)) continue;\n const source = sourceOrder.find((l) => l !== target && hasPath(d.df, l, leafPath));\n if (\n source &&\n copyLeaf(d.df, source, target, leafPath, (v) => `${TODO_PREFIX}${v}`)\n ) {\n totalFixed++;\n changed = true;\n }\n }\n }\n\n if (changed) {\n await saveDictionaryFile(d.df);\n }\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify({ success: true, fixed: totalFixed }, null, 2),\n },\n ],\n };\n }\n\n case \"dialex_generate\": {\n const schema = z.object({\n output: z.string().optional(),\n config: z.string().optional(),\n });\n const parsed = schema.parse(args);\n const res = generateDictionaries(root, { output: parsed.output, config: parsed.config });\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(\n {\n success: true,\n files: res.files.map((f) => path.relative(root, f)),\n outputPath: path.relative(root, res.outputPath),\n dtsPath: path.relative(root, res.dtsPath),\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n\n default:\n throw new Error(`Unknown tool: ${name}`);\n }\n } catch (err: any) {\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: `Error executing ${name}: ${err.message || String(err)}`,\n },\n ],\n };\n }\n });\n\n return server;\n}\n","#!/usr/bin/env node\n\nimport fs from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\n\nimport { createDialexMcpServer } from \"./server.js\";\n\nexport { createDialexMcpServer } from \"./server.js\";\n\n/**\n * True when this module is the script node was started with. `npx` and package managers start\n * bins through a symlink, so `argv[1]` must be resolved before comparing it with the module path.\n */\nexport function isEntrypoint(argv1: string | undefined, moduleUrl: string): boolean {\n if (!argv1) return false;\n try {\n return fs.realpathSync(argv1) === fs.realpathSync(fileURLToPath(moduleUrl));\n } catch {\n return false;\n }\n}\n\nasync function main() {\n const args = process.argv.slice(2);\n let root = process.cwd();\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] === \"--root\" && args[i + 1]) {\n root = args[i + 1];\n i++;\n } else if (args[i].startsWith(\"--root=\")) {\n root = args[i].slice(\"--root=\".length);\n }\n }\n\n const server = createDialexMcpServer({ root });\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n\nif (isEntrypoint(process.argv[1], import.meta.url)) {\n main().catch((err) => {\n console.error(\"Dialex MCP Server Error:\", err);\n process.exit(1);\n });\n}\n"],"mappings":";;;;;;;;;;;AC2EA,MAAa,aAAqC;CAChD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACP,WAAW;;;;;;;;CACX,KAAK;;;;;;;;;;;;;;;;;;;;;;CACL,UAAU;;;;;;AACZ;;;AChDA,SAAgB,sBAAsB,UAA6B,CAAC,GAAG;CACrE,MAAM,gBAAgB,KAAK,QAAQ,QAAQ,QAAQ,QAAQ,IAAI,CAAC;CAEhE,MAAM,SAAS,IAAI,OACjB;EACE,MAAM;EACGA;CACX,GACA,EACE,cAAc;EACZ,OAAO,CAAC;EACR,WAAW,CAAC;CACd,EACF,CACF;CAEA,OAAO,kBAAkB,4BAA4B,YA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BAAqB;CAC3C,MAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,IAAI,aAAa,QAAQ,KAAK,IAAI,YAAY,GAAG,GAC/C,KAAK,CAAC,CAAC,OAAO,QAAQ;CACpB,QAAQ,MAAM,4BAA4B,GAAG;CAC7C,QAAQ,KAAK,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialexjs/mcp",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Model Context Protocol (MCP) server for Dialex internationalization",
5
5
  "homepage": "https://github.com/awaiden/dialex#readme",
6
6
  "bugs": {
@@ -33,7 +33,7 @@
33
33
  "check": "vp check"
34
34
  },
35
35
  "dependencies": {
36
- "@dialexjs/cli": "0.3.0",
36
+ "@dialexjs/cli": "0.5.0",
37
37
  "@modelcontextprotocol/sdk": "^1.6.1",
38
38
  "zod": "^3.24.2"
39
39
  },