@verbaly/mcp 0.37.0 → 0.38.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/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, formatCheckWarnings, formatStatusResult, loadCatalogs, loadConfig, loadDrafts, markDrafts, pruneCatalogs, resolveProvider, saveDrafts, status, syncCatalogs, translateCatalogs, writeCatalog, writeDts } from "@verbaly/compiler";
6
+ import { check, collectOrigins, counted, 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");
@@ -86,7 +86,7 @@ function createVerbalyMcp(options = {}) {
86
86
  for (const locale of cfg.locales) writeCatalog(cfg, locale, catalogs[locale] ?? {});
87
87
  if (cfg.dts !== false) writeDts(cfg, catalogs[cfg.sourceLocale] ?? {}, cfg.dts);
88
88
  }
89
- lines.unshift(`${registry.messages().size} messages · locales: ${cfg.locales.join(", ")}${dryRun ? " (dry run, nothing written)" : ""}`);
89
+ lines.unshift(`${counted(registry.messages().size, "message")} · locales: ${cfg.locales.join(", ")}${dryRun ? " (dry run, nothing written)" : ""}`);
90
90
  for (const [locale, keys] of Object.entries(added)) lines.push(`${locale}: ${dryRun ? `would add ${keys.length}` : `+${keys.length} added`}`);
91
91
  return text(lines.join("\n"));
92
92
  }));
@@ -101,7 +101,8 @@ function createVerbalyMcp(options = {}) {
101
101
  }, guarded(async ({ root, locales, dryRun }) => {
102
102
  const cfg = await config(root);
103
103
  const catalogs = loadCatalogs(cfg);
104
- const result = await translateCatalogs(cfg, catalogs, await resolveProvider(cfg), {
104
+ const provider = await resolveProvider(cfg);
105
+ const result = await translateCatalogs(cfg, catalogs, provider, {
105
106
  locales,
106
107
  batchSize: cfg.translate.batchSize,
107
108
  dryRun,
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 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,WACA,QACJ,OAAO,SAAqC;EAC1C,IAA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AAM;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"}
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 counted,\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 `${counted(registry.messages().size, 'message')} · 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":";;;;;;;;AA4BA,MAAM,EAAE,YAAY,cAAc,YAAY,GAAG,CAAC,CAAC,iBAAi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AAY,KAAK,KAAK,IAAI,GAAG,CAAC,CAChF,KAAK,IAAI,CACd;EACF;EAEA,MAAM,QAAkB,CAAC;EACzB,MAAM,SAAS,WAAW,GAAG;EAC7B,KAAK,MAAM,UAAU,OAAO,KAAK,OAAO,UAAU,GAAG;GACnD,aAAa,KAAK,QAAQ,SAAS,WAAW,CAAC,CAAC;GAChD,WAAW,QAAQ,QAAQ,OAAO,WAAW,OAAQ;GACrD,MAAM,KAAK,GAAG,OAAO,KAAK,OAAO,WAAW,OAAO,CAAE,OAAO,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,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;;;ACnNA,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, formatCheckWarnings, formatStatusResult, loadCatalogs, loadConfig, loadDrafts, markDrafts, pruneCatalogs, resolveProvider, saveDrafts, status, syncCatalogs, translateCatalogs, writeCatalog, writeDts } from "@verbaly/compiler";
3
+ import { check, collectOrigins, counted, 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");
@@ -83,7 +83,7 @@ function createVerbalyMcp(options = {}) {
83
83
  for (const locale of cfg.locales) writeCatalog(cfg, locale, catalogs[locale] ?? {});
84
84
  if (cfg.dts !== false) writeDts(cfg, catalogs[cfg.sourceLocale] ?? {}, cfg.dts);
85
85
  }
86
- lines.unshift(`${registry.messages().size} messages · locales: ${cfg.locales.join(", ")}${dryRun ? " (dry run, nothing written)" : ""}`);
86
+ lines.unshift(`${counted(registry.messages().size, "message")} · locales: ${cfg.locales.join(", ")}${dryRun ? " (dry run, nothing written)" : ""}`);
87
87
  for (const [locale, keys] of Object.entries(added)) lines.push(`${locale}: ${dryRun ? `would add ${keys.length}` : `+${keys.length} added`}`);
88
88
  return text(lines.join("\n"));
89
89
  }));
@@ -98,7 +98,8 @@ function createVerbalyMcp(options = {}) {
98
98
  }, guarded(async ({ root, locales, dryRun }) => {
99
99
  const cfg = await config(root);
100
100
  const catalogs = loadCatalogs(cfg);
101
- const result = await translateCatalogs(cfg, catalogs, await resolveProvider(cfg), {
101
+ const provider = await resolveProvider(cfg);
102
+ const result = await translateCatalogs(cfg, catalogs, provider, {
102
103
  locales,
103
104
  batchSize: cfg.translate.batchSize,
104
105
  dryRun,
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 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,OAAO,aACL,kBACA;EACE,OAAO;EACP,aACE;EACF,aAAa,EAAE,MAAM,UAAU;EAC/B,aAAa,EAAE,cAAc,KAAK;CACpC,GACA,QAAQ,OAAO,EAAE,WAAW;EAC1B,MAAM,MAAM,MAAM,OAAO,IAAI;EAC7B,MAAM,WAAW,MAAM,eAAe,GAAG;EACzC,MAAM,SAAS,OAAO,KAAK,aAAa,GAAG,GAAG,UAAU,WAAW,GAAG,CAAC;EACvE,OAAO,KAAK,mBAAmB,MAAM,CAAC;CACxC,CAAC,CACH;CAEA,OAAO,aACL,mBACA;EACE,OAAO;EACP,aACE;EACF,aAAa;GACX,MAAM;GACN,QAAQ,EACL,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,SAAS,sDAAsD;EACpE;EACA,aAAa,EAAE,cAAc,KAAK;CACpC,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AQ,WAAW,GAAG,OAAO,KAAK,sBAAsB;GAC5D,OAAO,KACL,QACG,KAAK,CAAC,QAAQ,UAAU,GAAG,OAAO,IAAI,KAAK,OAAO,YAAY,KAAK,KAAK,IAAI,GAAG,CAAC,CAChF,KAAK,IAAI,CACd;EACF;EAEA,MAAM,QAAkB,CAAC;EACzB,MAAM,SAAS,WAAW,GAAG;EAC7B,KAAK,MAAM,UAAU,OAAO,KAAK,OAAO,UAAU,GAAG;GACnD,aAAa,KAAK,QAAQ,SAAS,WAAW,CAAC,CAAC;GAChD,WAAW,QAAQ,QAAQ,OAAO,WAAW,OAAQ;GACrD,MAAM,KAAK,GAAG,OAAO,KAAK,OAAO,WAAW,OAAO,CAAE,OAAO,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,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"}
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 counted,\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 `${counted(registry.messages().size, 'message')} · 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":";;;;;AA4BA,MAAM,EAAE,YAAY,cAAc,YAAY,GAAG,CAAC,CAAC,iBAAiB;AAMpE,MAAM,QAAQ,UAAkC,EAAE,SAAS,CAAC;CAAE,MAAM;CAAQ,MAAM;AAAK,CAAC,EAAE;AAE1F,MAAM,YAAY,EACf,OAAO,CAAC,CAC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,MAAM,UAAU,OAAO,KAAK,OAAO,UAAU,GAAG;GACnD,aAAa,KAAK,QAAQ,SAAS,WAAW,CAAC,CAAC;GAChD,WAAW,QAAQ,QAAQ,OAAO,WAAW,OAAQ;GACrD,MAAM,KAAK,GAAG,OAAO,KAAK,OAAO,WAAW,OAAO,CAAE,OAAO,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,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verbaly/mcp",
3
- "version": "0.37.0",
3
+ "version": "0.38.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.37.0"
48
+ "@verbaly/compiler": "^0.38.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@types/node": "^26.1.2"
51
+ "@types/node": "^26.2.0"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsdown",