@verbaly/mcp 0.29.0 → 0.30.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/README.md +4 -4
- package/dist/cli.js +5 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -35,10 +35,10 @@ The server reads the project from its working directory; pass `--root <path>` (o
|
|
|
35
35
|
|
|
36
36
|
| Tool | What it does |
|
|
37
37
|
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
38
|
-
| `verbaly_status` | Coverage per locale: total messages, translated counts, drafts awaiting review. Read-only.
|
|
39
|
-
| `verbaly_missing` | Missing translations and unknown keys (the same gate `verbaly check` runs in CI). Read-only.
|
|
40
|
-
| `verbaly_extract` | Scan sources, add new messages to the catalogs, refresh the generated types. `dryRun` previews; `prune` drops dead keys.
|
|
41
|
-
| `verbaly_translate` | Fill missing entries with the configured provider (default: Claude). Output is saved as drafts awaiting human review.
|
|
38
|
+
| `verbaly_status` | Coverage per locale: total messages, translated counts, drafts awaiting review. Read-only. |
|
|
39
|
+
| `verbaly_missing` | Missing translations and unknown keys (the same gate `verbaly check` runs in CI). Read-only. |
|
|
40
|
+
| `verbaly_extract` | Scan sources, add new messages to the catalogs, refresh the generated types. `dryRun` previews; `prune` drops dead keys. |
|
|
41
|
+
| `verbaly_translate` | Fill missing entries with the configured provider (default: Claude). Output is saved as drafts awaiting human review. |
|
|
42
42
|
|
|
43
43
|
Machine translations stay drafts until a human accepts them (`verbaly review --approve`), so an agent can fill gaps without silently shipping unreviewed text.
|
|
44
44
|
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
-
import { check, collectOrigins, effectiveDrafts, extractProject, formatCheckResult, formatStatusResult, loadCatalogs, loadConfig, loadDrafts, markDrafts, pruneCatalogs, resolveProvider, saveDrafts, status, syncCatalogs, translateCatalogs, writeCatalog, writeDts } from "@verbaly/compiler";
|
|
6
|
+
import { check, collectOrigins, effectiveDrafts, extractProject, formatCheckResult, formatCheckWarnings, formatStatusResult, loadCatalogs, loadConfig, loadDrafts, markDrafts, pruneCatalogs, resolveProvider, saveDrafts, status, syncCatalogs, translateCatalogs, writeCatalog, writeDts } from "@verbaly/compiler";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/server.ts
|
|
9
9
|
const { version } = createRequire(import.meta.url)("../package.json");
|
|
@@ -43,8 +43,8 @@ function createVerbalyMcp(options = {}) {
|
|
|
43
43
|
return text(formatStatusResult(result));
|
|
44
44
|
}));
|
|
45
45
|
server.registerTool("verbaly_missing", {
|
|
46
|
-
title: "Missing translations",
|
|
47
|
-
description: "List missing translations and
|
|
46
|
+
title: "Missing and broken translations",
|
|
47
|
+
description: "List missing translations, unknown keys and translations that exist but cannot render what the source renders (a dropped {param}, a lost rich tag, a flattened plural block), the same gate `verbaly check` runs in CI. Warnings such as an incomplete plural set for the locale are listed too and do not fail the gate. Optionally also lists machine translations awaiting review. Read-only.",
|
|
48
48
|
inputSchema: {
|
|
49
49
|
root: rootInput,
|
|
50
50
|
drafts: z.boolean().optional().describe("Also list machine translations awaiting human review")
|
|
@@ -58,6 +58,8 @@ function createVerbalyMcp(options = {}) {
|
|
|
58
58
|
const unreviewed = drafts ? Object.entries(effectiveDrafts(loadDrafts(cfg), catalogs)) : [];
|
|
59
59
|
const lines = [];
|
|
60
60
|
if (!result.ok) lines.push(formatCheckResult(result));
|
|
61
|
+
const warnings = formatCheckWarnings(result);
|
|
62
|
+
if (warnings) lines.push(`warnings (the gate still passes):\n${warnings}`);
|
|
61
63
|
for (const [locale, keys] of unreviewed) if (keys.length) lines.push(`[${locale}] ${keys.length} unreviewed: ${keys.join(", ")}`);
|
|
62
64
|
if (lines.length === 0) return text("all translations complete");
|
|
63
65
|
return text(lines.join("\n"));
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../src/server.ts","../src/cli.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport {\n check,\n collectOrigins,\n effectiveDrafts,\n extractProject,\n formatCheckResult,\n formatStatusResult,\n loadCatalogs,\n loadConfig,\n loadDrafts,\n markDrafts,\n pruneCatalogs,\n resolveProvider,\n saveDrafts,\n status,\n syncCatalogs,\n translateCatalogs,\n writeCatalog,\n writeDts,\n type ResolvedConfig,\n} from '@verbaly/compiler';\nimport { createRequire } from 'node:module';\nimport { z } from 'zod';\n\nconst { version } = createRequire(import.meta.url)('../package.json') as { version: string };\n\nexport interface VerbalyMcpOptions {\n root?: string;\n}\n\nconst text = (body: string): CallToolResult => ({ content: [{ type: 'text', text: body }] });\n\nconst rootInput = z\n .string()\n .optional()\n .describe('Project root holding verbaly.config (defaults to the server working directory)');\n\nexport function createVerbalyMcp(options: VerbalyMcpOptions = {}): McpServer {\n const server = new McpServer({ name: 'verbaly', version });\n\n const config = (root?: string): Promise<ResolvedConfig> =>\n loadConfig(root ?? options.root ?? process.cwd());\n\n // agents act on messages, not stack traces: every failure comes back as actionable text\n const guarded =\n <A>(run: (args: A) => Promise<CallToolResult>) =>\n async (args: A): Promise<CallToolResult> => {\n try {\n return await run(args);\n } catch (error) {\n return {\n content: [\n { type: 'text', text: error instanceof Error ? error.message : String(error) },\n ],\n isError: true,\n };\n }\n };\n\n server.registerTool(\n 'verbaly_status',\n {\n title: 'Translation coverage',\n description:\n 'Translation coverage of the Verbaly project: total messages, translated count per locale and machine translations awaiting review (drafts). Read-only.',\n inputSchema: { root: rootInput },\n annotations: { readOnlyHint: true },\n },\n guarded(async ({ root }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const result = status(cfg, loadCatalogs(cfg), registry, loadDrafts(cfg));\n return text(formatStatusResult(result));\n }),\n );\n\n server.registerTool(\n 'verbaly_missing',\n {\n title: 'Missing translations',\n description:\n 'List missing translations and unknown keys, the same gate `verbaly check` runs in CI. Optionally also lists machine translations awaiting review. Read-only.',\n inputSchema: {\n root: rootInput,\n drafts: z\n .boolean()\n .optional()\n .describe('Also list machine translations awaiting human review'),\n },\n annotations: { readOnlyHint: true },\n },\n guarded(async ({ root, drafts }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const catalogs = loadCatalogs(cfg);\n const result = check(cfg, catalogs, registry);\n const unreviewed = drafts ? Object.entries(effectiveDrafts(loadDrafts(cfg), catalogs)) : [];\n\n const lines: string[] = [];\n if (!result.ok) lines.push(formatCheckResult(result));\n for (const [locale, keys] of unreviewed) {\n if (keys.length) lines.push(`[${locale}] ${keys.length} unreviewed: ${keys.join(', ')}`);\n }\n if (lines.length === 0) return text('all translations complete');\n return text(lines.join('\\n'));\n }),\n );\n\n server.registerTool(\n 'verbaly_extract',\n {\n title: 'Extract messages',\n description:\n 'Scan the source files, add new messages to the locale catalogs and refresh the generated types (what `verbaly extract` does). Writes catalog files unless dryRun is set. prune drops keys no longer referenced in the code, translations included.',\n inputSchema: {\n root: rootInput,\n prune: z\n .boolean()\n .optional()\n .describe('Drop keys no longer referenced (deletes their translations)'),\n dryRun: z.boolean().optional().describe('Report what would change, write nothing'),\n },\n },\n guarded(async ({ root, prune, dryRun }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const catalogs = loadCatalogs(cfg);\n\n const lines: string[] = [];\n if (prune) {\n const removed = pruneCatalogs(cfg, catalogs, registry);\n for (const [locale, keys] of Object.entries(removed)) {\n lines.push(\n dryRun\n ? `${locale}: would prune ${keys.length}: ${keys.join(', ')}`\n : `${locale}: ${keys.length} pruned`,\n );\n }\n }\n const { added } = syncCatalogs(cfg, catalogs, registry);\n if (!dryRun) {\n for (const locale of cfg.locales) {\n writeCatalog(cfg, locale, catalogs[locale] ?? {});\n }\n if (cfg.dts !== false) writeDts(cfg, catalogs[cfg.sourceLocale] ?? {}, cfg.dts);\n }\n lines.unshift(\n `${registry.messages().size} messages · locales: ${cfg.locales.join(', ')}${dryRun ? ' (dry run, nothing written)' : ''}`,\n );\n for (const [locale, keys] of Object.entries(added)) {\n lines.push(`${locale}: ${dryRun ? `would add ${keys.length}` : `+${keys.length} added`}`);\n }\n return text(lines.join('\\n'));\n }),\n );\n\n server.registerTool(\n 'verbaly_translate',\n {\n title: 'Machine-translate missing entries',\n description:\n 'Fill missing translations with the configured provider (default: Claude, needs @anthropic-ai/sdk and ANTHROPIC_API_KEY). New translations are saved as drafts awaiting human review (`verbaly review`). dryRun lists what would be translated without calling the provider.',\n inputSchema: {\n root: rootInput,\n locales: z.array(z.string()).optional().describe('Target locales (default: all)'),\n dryRun: z\n .boolean()\n .optional()\n .describe('List missing entries per locale, call no provider'),\n },\n },\n guarded(async ({ root, locales, dryRun }) => {\n const cfg = await config(root);\n const catalogs = loadCatalogs(cfg);\n const provider = await resolveProvider(cfg);\n const result = await translateCatalogs(cfg, catalogs, provider, {\n locales,\n batchSize: cfg.translate.batchSize,\n dryRun,\n origins: dryRun ? undefined : await collectOrigins(cfg),\n });\n\n if (dryRun) {\n const entries = Object.entries(result.pending);\n if (entries.length === 0) return text('nothing to translate');\n return text(\n entries\n .map(([locale, keys]) => `${locale}: ${keys.length} missing: ${keys.join(', ')}`)\n .join('\\n'),\n );\n }\n\n const lines: string[] = [];\n const drafts = loadDrafts(cfg);\n for (const locale of Object.keys(result.translated)) {\n writeCatalog(cfg, locale, catalogs[locale] ?? {});\n markDrafts(drafts, locale, result.translated[locale]!);\n lines.push(`${locale}: +${result.translated[locale]!.length} translated (draft)`);\n }\n if (Object.keys(result.translated).length > 0) saveDrafts(cfg, drafts);\n for (const [locale, keys] of Object.entries(result.invalid)) {\n lines.push(`${locale}: ${keys.length} rejected (params/tags not preserved): ${keys.join(', ')}`);\n }\n if (lines.length === 0) return text('nothing to translate');\n lines.push('drafts await human review: verbaly review (--approve accepts them)');\n return text(lines.join('\\n'));\n }),\n );\n\n return server;\n}\n","#!/usr/bin/env node\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport { createVerbalyMcp } from './server';\n\nconst { values } = parseArgs({ options: { root: { type: 'string' } } });\n\ntry {\n await createVerbalyMcp({ root: values.root }).connect(new StdioServerTransport());\n // stdout carries the protocol: any human-facing note goes to stderr\n console.error('[verbaly-mcp] ready (stdio)');\n} catch (error) {\n console.error('[verbaly-mcp]', error instanceof Error ? error.message : error);\n process.exitCode = 1;\n}\n"],"mappings":";;;;;;;;AA0BA,MAAM,EAAE,YAAY,cAAc,OAAO,KAAK,GAAG,CAAC,CAAC,iBAAiB;AAMpE,MAAM,QAAQ,UAAkC,EAAE,SAAS,CAAC;CAAE,MAAM;CAAQ,MAAM;AAAK,CAAC,EAAE;AAE1F,MAAM,YAAY,EACf,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SAAS,gFAAgF;AAE5F,SAAgB,iBAAiB,UAA6B,CAAC,GAAc;CAC3E,MAAM,SAAS,IAAI,UAAU;EAAE,MAAM;EAAW;CAAQ,CAAC;CAEzD,MAAM,UAAU,SACd,WAAW,QAAQ,QAAQ,QAAQ,QAAQ,IAAI,CAAC;CAGlD,MAAM,WACA,QACJ,OAAO,SAAqC;EAC1C,IAAI;GACF,OAAO,MAAM,IAAI,IAAI;EACvB,SAAS,OAAO;GACd,OAAO;IACL,SAAS,CACP;KAAE,MAAM;KAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAAE,CAC/E;IACA,SAAS;GACX;EACF;CACF;CAEF,OAAO,aACL,kBACA;EACE,OAAO;EACP,aACE;EACF,aAAa,EAAE,MAAM,UAAU;EAC/B,aAAa,EAAE,cAAc,K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MAAM,EAAE,MAAM,SAAS,EAAE,EAAE,CAAC;AAEtE,IAAI;CACF,MAAM,iBAAiB,EAAE,MAAM,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,qBAAqB,CAAC;CAEhF,QAAQ,MAAM,6BAA6B;AAC7C,SAAS,OAAO;CACd,QAAQ,MAAM,iBAAiB,iBAAiB,QAAQ,MAAM,UAAU,KAAK;CAC7E,QAAQ,WAAW;AACrB"}
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../src/server.ts","../src/cli.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport {\n check,\n collectOrigins,\n effectiveDrafts,\n extractProject,\n formatCheckResult,\n formatCheckWarnings,\n formatStatusResult,\n loadCatalogs,\n loadConfig,\n loadDrafts,\n markDrafts,\n pruneCatalogs,\n resolveProvider,\n saveDrafts,\n status,\n syncCatalogs,\n translateCatalogs,\n writeCatalog,\n writeDts,\n type ResolvedConfig,\n} from '@verbaly/compiler';\nimport { createRequire } from 'node:module';\nimport { z } from 'zod';\n\nconst { version } = createRequire(import.meta.url)('../package.json') as { version: string };\n\nexport interface VerbalyMcpOptions {\n root?: string;\n}\n\nconst text = (body: string): CallToolResult => ({ content: [{ type: 'text', text: body }] });\n\nconst rootInput = z\n .string()\n .optional()\n .describe('Project root holding verbaly.config (defaults to the server working directory)');\n\nexport function createVerbalyMcp(options: VerbalyMcpOptions = {}): McpServer {\n const server = new McpServer({ name: 'verbaly', version });\n\n const config = (root?: string): Promise<ResolvedConfig> =>\n loadConfig(root ?? options.root ?? process.cwd());\n\n // agents act on messages, not stack traces: every failure comes back as actionable text\n const guarded =\n <A>(run: (args: A) => Promise<CallToolResult>) =>\n async (args: A): Promise<CallToolResult> => {\n try {\n return await run(args);\n } catch (error) {\n return {\n content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }],\n isError: true,\n };\n }\n };\n\n server.registerTool(\n 'verbaly_status',\n {\n title: 'Translation coverage',\n description:\n 'Translation coverage of the Verbaly project: total messages, translated count per locale and machine translations awaiting review (drafts). Read-only.',\n inputSchema: { root: rootInput },\n annotations: { readOnlyHint: true },\n },\n guarded(async ({ root }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const result = status(cfg, loadCatalogs(cfg), registry, loadDrafts(cfg));\n return text(formatStatusResult(result));\n }),\n );\n\n server.registerTool(\n 'verbaly_missing',\n {\n title: 'Missing and broken translations',\n description:\n 'List missing translations, unknown keys and translations that exist but cannot render what the source renders (a dropped {param}, a lost rich tag, a flattened plural block), the same gate `verbaly check` runs in CI. Warnings such as an incomplete plural set for the locale are listed too and do not fail the gate. Optionally also lists machine translations awaiting review. Read-only.',\n inputSchema: {\n root: rootInput,\n drafts: z\n .boolean()\n .optional()\n .describe('Also list machine translations awaiting human review'),\n },\n annotations: { readOnlyHint: true },\n },\n guarded(async ({ root, drafts }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const catalogs = loadCatalogs(cfg);\n const result = check(cfg, catalogs, registry);\n const unreviewed = drafts ? Object.entries(effectiveDrafts(loadDrafts(cfg), catalogs)) : [];\n\n const lines: string[] = [];\n if (!result.ok) lines.push(formatCheckResult(result));\n const warnings = formatCheckWarnings(result);\n if (warnings) lines.push(`warnings (the gate still passes):\\n${warnings}`);\n for (const [locale, keys] of unreviewed) {\n if (keys.length) lines.push(`[${locale}] ${keys.length} unreviewed: ${keys.join(', ')}`);\n }\n if (lines.length === 0) return text('all translations complete');\n return text(lines.join('\\n'));\n }),\n );\n\n server.registerTool(\n 'verbaly_extract',\n {\n title: 'Extract messages',\n description:\n 'Scan the source files, add new messages to the locale catalogs and refresh the generated types (what `verbaly extract` does). Writes catalog files unless dryRun is set. prune drops keys no longer referenced in the code, translations included.',\n inputSchema: {\n root: rootInput,\n prune: z\n .boolean()\n .optional()\n .describe('Drop keys no longer referenced (deletes their translations)'),\n dryRun: z.boolean().optional().describe('Report what would change, write nothing'),\n },\n },\n guarded(async ({ root, prune, dryRun }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const catalogs = loadCatalogs(cfg);\n\n const lines: string[] = [];\n if (prune) {\n const removed = pruneCatalogs(cfg, catalogs, registry);\n for (const [locale, keys] of Object.entries(removed)) {\n lines.push(\n dryRun\n ? `${locale}: would prune ${keys.length}: ${keys.join(', ')}`\n : `${locale}: ${keys.length} pruned`,\n );\n }\n }\n const { added } = syncCatalogs(cfg, catalogs, registry);\n if (!dryRun) {\n for (const locale of cfg.locales) {\n writeCatalog(cfg, locale, catalogs[locale] ?? {});\n }\n if (cfg.dts !== false) writeDts(cfg, catalogs[cfg.sourceLocale] ?? {}, cfg.dts);\n }\n lines.unshift(\n `${registry.messages().size} messages · locales: ${cfg.locales.join(', ')}${dryRun ? ' (dry run, nothing written)' : ''}`,\n );\n for (const [locale, keys] of Object.entries(added)) {\n lines.push(`${locale}: ${dryRun ? `would add ${keys.length}` : `+${keys.length} added`}`);\n }\n return text(lines.join('\\n'));\n }),\n );\n\n server.registerTool(\n 'verbaly_translate',\n {\n title: 'Machine-translate missing entries',\n description:\n 'Fill missing translations with the configured provider (default: Claude, needs @anthropic-ai/sdk and ANTHROPIC_API_KEY). New translations are saved as drafts awaiting human review (`verbaly review`). dryRun lists what would be translated without calling the provider.',\n inputSchema: {\n root: rootInput,\n locales: z.array(z.string()).optional().describe('Target locales (default: all)'),\n dryRun: z\n .boolean()\n .optional()\n .describe('List missing entries per locale, call no provider'),\n },\n },\n guarded(async ({ root, locales, dryRun }) => {\n const cfg = await config(root);\n const catalogs = loadCatalogs(cfg);\n const provider = await resolveProvider(cfg);\n const result = await translateCatalogs(cfg, catalogs, provider, {\n locales,\n batchSize: cfg.translate.batchSize,\n dryRun,\n origins: dryRun ? undefined : await collectOrigins(cfg),\n });\n\n if (dryRun) {\n const entries = Object.entries(result.pending);\n if (entries.length === 0) return text('nothing to translate');\n return text(\n entries\n .map(([locale, keys]) => `${locale}: ${keys.length} missing: ${keys.join(', ')}`)\n .join('\\n'),\n );\n }\n\n const lines: string[] = [];\n const drafts = loadDrafts(cfg);\n for (const locale of Object.keys(result.translated)) {\n writeCatalog(cfg, locale, catalogs[locale] ?? {});\n markDrafts(drafts, locale, result.translated[locale]!);\n lines.push(`${locale}: +${result.translated[locale]!.length} translated (draft)`);\n }\n if (Object.keys(result.translated).length > 0) saveDrafts(cfg, drafts);\n for (const [locale, keys] of Object.entries(result.invalid)) {\n lines.push(\n `${locale}: ${keys.length} rejected (params/tags not preserved): ${keys.join(', ')}`,\n );\n }\n if (lines.length === 0) return text('nothing to translate');\n lines.push('drafts await human review: verbaly review (--approve accepts them)');\n return text(lines.join('\\n'));\n }),\n );\n\n return server;\n}\n","#!/usr/bin/env node\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport { createVerbalyMcp } from './server';\n\nconst { values } = parseArgs({ options: { root: { type: 'string' } } });\n\ntry {\n await createVerbalyMcp({ root: values.root }).connect(new StdioServerTransport());\n // stdout carries the protocol: any human-facing note goes to stderr\n console.error('[verbaly-mcp] ready (stdio)');\n} catch (error) {\n console.error('[verbaly-mcp]', error instanceof Error ? error.message : error);\n process.exitCode = 1;\n}\n"],"mappings":";;;;;;;;AA2BA,MAAM,EAAE,YAAY,cAAc,OAAO,KAAK,GAAG,CAAC,CAAC,iBAAiB;AAMpE,MAAM,QAAQ,UAAkC,EAAE,SAAS,CAAC;CAAE,MAAM;CAAQ,MAAM;AAAK,CAAC,EAAE;AAE1F,MAAM,YAAY,EACf,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SAAS,gFAAgF;AAE5F,SAAgB,iBAAiB,UAA6B,CAAC,GAAc;CAC3E,MAAM,SAAS,IAAI,UAAU;EAAE,MAAM;EAAW;CAAQ,CAAC;CAEzD,MAAM,UAAU,SACd,WAAW,QAAQ,QAAQ,QAAQ,QAAQ,IAAI,CAAC;CAGlD,MAAM,WAC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,CAAC,SAAS,GAAG,WAAW,KAAK,MAAM;EACrE,KAAK,MAAM,CAAC,QAAQ,SAAS,OAAO,QAAQ,OAAO,OAAO,GACxD,MAAM,KACJ,GAAG,OAAO,IAAI,KAAK,OAAO,yCAAyC,KAAK,KAAK,IAAI,GACnF;EAEF,IAAI,MAAM,WAAW,GAAG,OAAO,KAAK,sBAAsB;EAC1D,MAAM,KAAK,oEAAoE;EAC/E,OAAO,KAAK,MAAM,KAAK,IAAI,CAAC;CAC9B,CAAC,CACH;CAEA,OAAO;AACT;;;AClNA,MAAM,EAAE,WAAW,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,SAAS,EAAE,EAAE,CAAC;AAEtE,IAAI;CACF,MAAM,iBAAiB,EAAE,MAAM,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,qBAAqB,CAAC;CAEhF,QAAQ,MAAM,6BAA6B;AAC7C,SAAS,OAAO;CACd,QAAQ,MAAM,iBAAiB,iBAAiB,QAAQ,MAAM,UAAU,KAAK;CAC7E,QAAQ,WAAW;AACrB"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
-
import { check, collectOrigins, effectiveDrafts, extractProject, formatCheckResult, formatStatusResult, loadCatalogs, loadConfig, loadDrafts, markDrafts, pruneCatalogs, resolveProvider, saveDrafts, status, syncCatalogs, translateCatalogs, writeCatalog, writeDts } from "@verbaly/compiler";
|
|
3
|
+
import { check, collectOrigins, effectiveDrafts, extractProject, formatCheckResult, formatCheckWarnings, formatStatusResult, loadCatalogs, loadConfig, loadDrafts, markDrafts, pruneCatalogs, resolveProvider, saveDrafts, status, syncCatalogs, translateCatalogs, writeCatalog, writeDts } from "@verbaly/compiler";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/server.ts
|
|
6
6
|
const { version } = createRequire(import.meta.url)("../package.json");
|
|
@@ -40,8 +40,8 @@ function createVerbalyMcp(options = {}) {
|
|
|
40
40
|
return text(formatStatusResult(result));
|
|
41
41
|
}));
|
|
42
42
|
server.registerTool("verbaly_missing", {
|
|
43
|
-
title: "Missing translations",
|
|
44
|
-
description: "List missing translations and
|
|
43
|
+
title: "Missing and broken translations",
|
|
44
|
+
description: "List missing translations, unknown keys and translations that exist but cannot render what the source renders (a dropped {param}, a lost rich tag, a flattened plural block), the same gate `verbaly check` runs in CI. Warnings such as an incomplete plural set for the locale are listed too and do not fail the gate. Optionally also lists machine translations awaiting review. Read-only.",
|
|
45
45
|
inputSchema: {
|
|
46
46
|
root: rootInput,
|
|
47
47
|
drafts: z.boolean().optional().describe("Also list machine translations awaiting human review")
|
|
@@ -55,6 +55,8 @@ function createVerbalyMcp(options = {}) {
|
|
|
55
55
|
const unreviewed = drafts ? Object.entries(effectiveDrafts(loadDrafts(cfg), catalogs)) : [];
|
|
56
56
|
const lines = [];
|
|
57
57
|
if (!result.ok) lines.push(formatCheckResult(result));
|
|
58
|
+
const warnings = formatCheckWarnings(result);
|
|
59
|
+
if (warnings) lines.push(`warnings (the gate still passes):\n${warnings}`);
|
|
58
60
|
for (const [locale, keys] of unreviewed) if (keys.length) lines.push(`[${locale}] ${keys.length} unreviewed: ${keys.join(", ")}`);
|
|
59
61
|
if (lines.length === 0) return text("all translations complete");
|
|
60
62
|
return text(lines.join("\n"));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/server.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport {\n check,\n collectOrigins,\n effectiveDrafts,\n extractProject,\n formatCheckResult,\n formatStatusResult,\n loadCatalogs,\n loadConfig,\n loadDrafts,\n markDrafts,\n pruneCatalogs,\n resolveProvider,\n saveDrafts,\n status,\n syncCatalogs,\n translateCatalogs,\n writeCatalog,\n writeDts,\n type ResolvedConfig,\n} from '@verbaly/compiler';\nimport { createRequire } from 'node:module';\nimport { z } from 'zod';\n\nconst { version } = createRequire(import.meta.url)('../package.json') as { version: string };\n\nexport interface VerbalyMcpOptions {\n root?: string;\n}\n\nconst text = (body: string): CallToolResult => ({ content: [{ type: 'text', text: body }] });\n\nconst rootInput = z\n .string()\n .optional()\n .describe('Project root holding verbaly.config (defaults to the server working directory)');\n\nexport function createVerbalyMcp(options: VerbalyMcpOptions = {}): McpServer {\n const server = new McpServer({ name: 'verbaly', version });\n\n const config = (root?: string): Promise<ResolvedConfig> =>\n loadConfig(root ?? options.root ?? process.cwd());\n\n // agents act on messages, not stack traces: every failure comes back as actionable text\n const guarded =\n <A>(run: (args: A) => Promise<CallToolResult>) =>\n async (args: A): Promise<CallToolResult> => {\n try {\n return await run(args);\n } catch (error) {\n return {\n content: [\n { type: 'text', text: error instanceof Error ? error.message : String(error) },\n ],\n isError: true,\n };\n }\n };\n\n server.registerTool(\n 'verbaly_status',\n {\n title: 'Translation coverage',\n description:\n 'Translation coverage of the Verbaly project: total messages, translated count per locale and machine translations awaiting review (drafts). Read-only.',\n inputSchema: { root: rootInput },\n annotations: { readOnlyHint: true },\n },\n guarded(async ({ root }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const result = status(cfg, loadCatalogs(cfg), registry, loadDrafts(cfg));\n return text(formatStatusResult(result));\n }),\n );\n\n server.registerTool(\n 'verbaly_missing',\n {\n title: 'Missing translations',\n description:\n 'List missing translations and unknown keys, the same gate `verbaly check` runs in CI. Optionally also lists machine translations awaiting review. Read-only.',\n inputSchema: {\n root: rootInput,\n drafts: z\n .boolean()\n .optional()\n .describe('Also list machine translations awaiting human review'),\n },\n annotations: { readOnlyHint: true },\n },\n guarded(async ({ root, drafts }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const catalogs = loadCatalogs(cfg);\n const result = check(cfg, catalogs, registry);\n const unreviewed = drafts ? Object.entries(effectiveDrafts(loadDrafts(cfg), catalogs)) : [];\n\n const lines: string[] = [];\n if (!result.ok) lines.push(formatCheckResult(result));\n for (const [locale, keys] of unreviewed) {\n if (keys.length) lines.push(`[${locale}] ${keys.length} unreviewed: ${keys.join(', ')}`);\n }\n if (lines.length === 0) return text('all translations complete');\n return text(lines.join('\\n'));\n }),\n );\n\n server.registerTool(\n 'verbaly_extract',\n {\n title: 'Extract messages',\n description:\n 'Scan the source files, add new messages to the locale catalogs and refresh the generated types (what `verbaly extract` does). Writes catalog files unless dryRun is set. prune drops keys no longer referenced in the code, translations included.',\n inputSchema: {\n root: rootInput,\n prune: z\n .boolean()\n .optional()\n .describe('Drop keys no longer referenced (deletes their translations)'),\n dryRun: z.boolean().optional().describe('Report what would change, write nothing'),\n },\n },\n guarded(async ({ root, prune, dryRun }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const catalogs = loadCatalogs(cfg);\n\n const lines: string[] = [];\n if (prune) {\n const removed = pruneCatalogs(cfg, catalogs, registry);\n for (const [locale, keys] of Object.entries(removed)) {\n lines.push(\n dryRun\n ? `${locale}: would prune ${keys.length}: ${keys.join(', ')}`\n : `${locale}: ${keys.length} pruned`,\n );\n }\n }\n const { added } = syncCatalogs(cfg, catalogs, registry);\n if (!dryRun) {\n for (const locale of cfg.locales) {\n writeCatalog(cfg, locale, catalogs[locale] ?? {});\n }\n if (cfg.dts !== false) writeDts(cfg, catalogs[cfg.sourceLocale] ?? {}, cfg.dts);\n }\n lines.unshift(\n `${registry.messages().size} messages · locales: ${cfg.locales.join(', ')}${dryRun ? ' (dry run, nothing written)' : ''}`,\n );\n for (const [locale, keys] of Object.entries(added)) {\n lines.push(`${locale}: ${dryRun ? `would add ${keys.length}` : `+${keys.length} added`}`);\n }\n return text(lines.join('\\n'));\n }),\n );\n\n server.registerTool(\n 'verbaly_translate',\n {\n title: 'Machine-translate missing entries',\n description:\n 'Fill missing translations with the configured provider (default: Claude, needs @anthropic-ai/sdk and ANTHROPIC_API_KEY). New translations are saved as drafts awaiting human review (`verbaly review`). dryRun lists what would be translated without calling the provider.',\n inputSchema: {\n root: rootInput,\n locales: z.array(z.string()).optional().describe('Target locales (default: all)'),\n dryRun: z\n .boolean()\n .optional()\n .describe('List missing entries per locale, call no provider'),\n },\n },\n guarded(async ({ root, locales, dryRun }) => {\n const cfg = await config(root);\n const catalogs = loadCatalogs(cfg);\n const provider = await resolveProvider(cfg);\n const result = await translateCatalogs(cfg, catalogs, provider, {\n locales,\n batchSize: cfg.translate.batchSize,\n dryRun,\n origins: dryRun ? undefined : await collectOrigins(cfg),\n });\n\n if (dryRun) {\n const entries = Object.entries(result.pending);\n if (entries.length === 0) return text('nothing to translate');\n return text(\n entries\n .map(([locale, keys]) => `${locale}: ${keys.length} missing: ${keys.join(', ')}`)\n .join('\\n'),\n );\n }\n\n const lines: string[] = [];\n const drafts = loadDrafts(cfg);\n for (const locale of Object.keys(result.translated)) {\n writeCatalog(cfg, locale, catalogs[locale] ?? {});\n markDrafts(drafts, locale, result.translated[locale]!);\n lines.push(`${locale}: +${result.translated[locale]!.length} translated (draft)`);\n }\n if (Object.keys(result.translated).length > 0) saveDrafts(cfg, drafts);\n for (const [locale, keys] of Object.entries(result.invalid)) {\n lines.push(`${locale}: ${keys.length} rejected (params/tags not preserved): ${keys.join(', ')}`);\n }\n if (lines.length === 0) return text('nothing to translate');\n lines.push('drafts await human review: verbaly review (--approve accepts them)');\n return text(lines.join('\\n'));\n }),\n );\n\n return server;\n}\n"],"mappings":";;;;;AA0BA,MAAM,EAAE,YAAY,cAAc,OAAO,KAAK,GAAG,CAAC,CAAC,iBAAiB;AAMpE,MAAM,QAAQ,UAAkC,EAAE,SAAS,CAAC;CAAE,MAAM;CAAQ,MAAM;AAAK,CAAC,EAAE;AAE1F,MAAM,YAAY,EACf,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SAAS,gFAAgF;AAE5F,SAAgB,iBAAiB,UAA6B,CAAC,GAAc;CAC3E,MAAM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AO,oBAAoB;EAClF;EACA,IAAI,OAAO,KAAK,OAAO,UAAU,CAAC,CAAC,SAAS,GAAG,WAAW,KAAK,MAAM;EACrE,KAAK,MAAM,CAAC,QAAQ,SAAS,OAAO,QAAQ,OAAO,OAAO,GACxD,MAAM,KAAK,GAAG,OAAO,IAAI,KAAK,OAAO,yCAAyC,KAAK,KAAK,IAAI,GAAG;EAEjG,IAAI,MAAM,WAAW,GAAG,OAAO,KAAK,sBAAsB;EAC1D,MAAM,KAAK,oEAAoE;EAC/E,OAAO,KAAK,MAAM,KAAK,IAAI,CAAC;CAC9B,CAAC,CACH;CAEA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/server.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport {\n check,\n collectOrigins,\n effectiveDrafts,\n extractProject,\n formatCheckResult,\n formatCheckWarnings,\n formatStatusResult,\n loadCatalogs,\n loadConfig,\n loadDrafts,\n markDrafts,\n pruneCatalogs,\n resolveProvider,\n saveDrafts,\n status,\n syncCatalogs,\n translateCatalogs,\n writeCatalog,\n writeDts,\n type ResolvedConfig,\n} from '@verbaly/compiler';\nimport { createRequire } from 'node:module';\nimport { z } from 'zod';\n\nconst { version } = createRequire(import.meta.url)('../package.json') as { version: string };\n\nexport interface VerbalyMcpOptions {\n root?: string;\n}\n\nconst text = (body: string): CallToolResult => ({ content: [{ type: 'text', text: body }] });\n\nconst rootInput = z\n .string()\n .optional()\n .describe('Project root holding verbaly.config (defaults to the server working directory)');\n\nexport function createVerbalyMcp(options: VerbalyMcpOptions = {}): McpServer {\n const server = new McpServer({ name: 'verbaly', version });\n\n const config = (root?: string): Promise<ResolvedConfig> =>\n loadConfig(root ?? options.root ?? process.cwd());\n\n // agents act on messages, not stack traces: every failure comes back as actionable text\n const guarded =\n <A>(run: (args: A) => Promise<CallToolResult>) =>\n async (args: A): Promise<CallToolResult> => {\n try {\n return await run(args);\n } catch (error) {\n return {\n content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }],\n isError: true,\n };\n }\n };\n\n server.registerTool(\n 'verbaly_status',\n {\n title: 'Translation coverage',\n description:\n 'Translation coverage of the Verbaly project: total messages, translated count per locale and machine translations awaiting review (drafts). Read-only.',\n inputSchema: { root: rootInput },\n annotations: { readOnlyHint: true },\n },\n guarded(async ({ root }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const result = status(cfg, loadCatalogs(cfg), registry, loadDrafts(cfg));\n return text(formatStatusResult(result));\n }),\n );\n\n server.registerTool(\n 'verbaly_missing',\n {\n title: 'Missing and broken translations',\n description:\n 'List missing translations, unknown keys and translations that exist but cannot render what the source renders (a dropped {param}, a lost rich tag, a flattened plural block), the same gate `verbaly check` runs in CI. Warnings such as an incomplete plural set for the locale are listed too and do not fail the gate. Optionally also lists machine translations awaiting review. Read-only.',\n inputSchema: {\n root: rootInput,\n drafts: z\n .boolean()\n .optional()\n .describe('Also list machine translations awaiting human review'),\n },\n annotations: { readOnlyHint: true },\n },\n guarded(async ({ root, drafts }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const catalogs = loadCatalogs(cfg);\n const result = check(cfg, catalogs, registry);\n const unreviewed = drafts ? Object.entries(effectiveDrafts(loadDrafts(cfg), catalogs)) : [];\n\n const lines: string[] = [];\n if (!result.ok) lines.push(formatCheckResult(result));\n const warnings = formatCheckWarnings(result);\n if (warnings) lines.push(`warnings (the gate still passes):\\n${warnings}`);\n for (const [locale, keys] of unreviewed) {\n if (keys.length) lines.push(`[${locale}] ${keys.length} unreviewed: ${keys.join(', ')}`);\n }\n if (lines.length === 0) return text('all translations complete');\n return text(lines.join('\\n'));\n }),\n );\n\n server.registerTool(\n 'verbaly_extract',\n {\n title: 'Extract messages',\n description:\n 'Scan the source files, add new messages to the locale catalogs and refresh the generated types (what `verbaly extract` does). Writes catalog files unless dryRun is set. prune drops keys no longer referenced in the code, translations included.',\n inputSchema: {\n root: rootInput,\n prune: z\n .boolean()\n .optional()\n .describe('Drop keys no longer referenced (deletes their translations)'),\n dryRun: z.boolean().optional().describe('Report what would change, write nothing'),\n },\n },\n guarded(async ({ root, prune, dryRun }) => {\n const cfg = await config(root);\n const registry = await extractProject(cfg);\n const catalogs = loadCatalogs(cfg);\n\n const lines: string[] = [];\n if (prune) {\n const removed = pruneCatalogs(cfg, catalogs, registry);\n for (const [locale, keys] of Object.entries(removed)) {\n lines.push(\n dryRun\n ? `${locale}: would prune ${keys.length}: ${keys.join(', ')}`\n : `${locale}: ${keys.length} pruned`,\n );\n }\n }\n const { added } = syncCatalogs(cfg, catalogs, registry);\n if (!dryRun) {\n for (const locale of cfg.locales) {\n writeCatalog(cfg, locale, catalogs[locale] ?? {});\n }\n if (cfg.dts !== false) writeDts(cfg, catalogs[cfg.sourceLocale] ?? {}, cfg.dts);\n }\n lines.unshift(\n `${registry.messages().size} messages · locales: ${cfg.locales.join(', ')}${dryRun ? ' (dry run, nothing written)' : ''}`,\n );\n for (const [locale, keys] of Object.entries(added)) {\n lines.push(`${locale}: ${dryRun ? `would add ${keys.length}` : `+${keys.length} added`}`);\n }\n return text(lines.join('\\n'));\n }),\n );\n\n server.registerTool(\n 'verbaly_translate',\n {\n title: 'Machine-translate missing entries',\n description:\n 'Fill missing translations with the configured provider (default: Claude, needs @anthropic-ai/sdk and ANTHROPIC_API_KEY). New translations are saved as drafts awaiting human review (`verbaly review`). dryRun lists what would be translated without calling the provider.',\n inputSchema: {\n root: rootInput,\n locales: z.array(z.string()).optional().describe('Target locales (default: all)'),\n dryRun: z\n .boolean()\n .optional()\n .describe('List missing entries per locale, call no provider'),\n },\n },\n guarded(async ({ root, locales, dryRun }) => {\n const cfg = await config(root);\n const catalogs = loadCatalogs(cfg);\n const provider = await resolveProvider(cfg);\n const result = await translateCatalogs(cfg, catalogs, provider, {\n locales,\n batchSize: cfg.translate.batchSize,\n dryRun,\n origins: dryRun ? undefined : await collectOrigins(cfg),\n });\n\n if (dryRun) {\n const entries = Object.entries(result.pending);\n if (entries.length === 0) return text('nothing to translate');\n return text(\n entries\n .map(([locale, keys]) => `${locale}: ${keys.length} missing: ${keys.join(', ')}`)\n .join('\\n'),\n );\n }\n\n const lines: string[] = [];\n const drafts = loadDrafts(cfg);\n for (const locale of Object.keys(result.translated)) {\n writeCatalog(cfg, locale, catalogs[locale] ?? {});\n markDrafts(drafts, locale, result.translated[locale]!);\n lines.push(`${locale}: +${result.translated[locale]!.length} translated (draft)`);\n }\n if (Object.keys(result.translated).length > 0) saveDrafts(cfg, drafts);\n for (const [locale, keys] of Object.entries(result.invalid)) {\n lines.push(\n `${locale}: ${keys.length} rejected (params/tags not preserved): ${keys.join(', ')}`,\n );\n }\n if (lines.length === 0) return text('nothing to translate');\n lines.push('drafts await human review: verbaly review (--approve accepts them)');\n return text(lines.join('\\n'));\n }),\n );\n\n return server;\n}\n"],"mappings":";;;;;AA2BA,MAAM,EAAE,YAAY,cAAc,OAAO,KAAK,GAAG,CAAC,CAAC,iBAAiB;AAMpE,MAAM,QAAQ,UAAkC,EAAE,SAAS,CAAC;CAAE,MAAM;CAAQ,MAAM;AAAK,CAAC,EAAE;AAE1F,MAAM,YAAY,EACf,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SAAS,gFAAgF;AAE5F,SAAgB,iBAAiB,UAA6B,CAAC,GAAc;CAC3E,MAAM,SAAS,IAAI,UAAU;EAAE,MAAM;EAAW;CAAQ,CAAC;CAEzD,MAAM,UAAU,SACd,WAAW,QAAQ,QAAQ,QAAQ,QAAQ,IAAI,CAAC;CAGlD,MAAM,WACA,QACJ,OAAO,SAAqC;EAC1C,IAAI;GACF,OAAO,MAAM,IAAI,IAAI;EACvB,SAAS,OAAO;GACd,OAAO;IACL,SAAS,CAAC;KAAE,MAAM;KAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAAE,CAAC;IACxF,SAAS;GACX;EACF;CACF;CAEF,OA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,sBAAsB;EAC1D,MAAM,KAAK,oEAAoE;EAC/E,OAAO,KAAK,MAAM,KAAK,IAAI,CAAC;CAC9B,CAAC,CACH;CAEA,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verbaly/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "MCP server for Verbaly: translation status, missing keys, extraction and machine translation as tools for coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@verbaly/compiler": "^0.
|
|
48
|
+
"@verbaly/compiler": "^0.30.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/node": "^26.1.
|
|
51
|
+
"@types/node": "^26.1.2"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsdown",
|