@syntholoc/mcp 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build-server.js
CHANGED
|
@@ -105,30 +105,35 @@ function registerPrompts(server) {
|
|
|
105
105
|
" default to the likeliest) and record the file\u2192locale mapping in the config `translation` pattern.",
|
|
106
106
|
" (Target locales must exist before a Git pull so their translation files import.)",
|
|
107
107
|
"3. RECOMMENDED \u2014 connect the repo and sync, instead of pushing strings one by one:",
|
|
108
|
-
" a. `list_repositories`. If one is already connected, skip to (
|
|
109
|
-
" b.
|
|
108
|
+
" a. `list_repositories`. If one is already connected, skip to (e).",
|
|
109
|
+
" b. Write `.syntholoc/config.json` FIRST and commit it to the source branch \u2014 the server reads it",
|
|
110
|
+
" from the repo as the SOURCE OF TRUTH for mappings on every sync/pull/write-back (Crowdin-style),",
|
|
111
|
+
" so it must land in the branch before the first sync. Schema (https://syntholoc.com/schemas/config.json):",
|
|
112
|
+
" the `projectId`, `sourceLocale`, and a Crowdin-style `files` array of `{ source, translation }`",
|
|
113
|
+
' patterns, e.g. { "source": "messages/en/*.json", "translation": "messages/{locale}/%original_file_name%" }.',
|
|
114
|
+
" - Placeholders: `{locale}` (or %locale% / %two_letters_code% / %original_file_name% / %original_path%).",
|
|
115
|
+
` - If a locale's ON-DISK code differs from its BCP-47 code (e.g. "zh-CN" stored as "cn", "pt-BR" as "pt"),`,
|
|
116
|
+
' add `languagesMapping`, e.g. { "two_letters_code": { "zh-CN": "cn", "pt-BR": "pt" } }.',
|
|
117
|
+
' - Do NOT invent fields like `i18nDir`, `format: "nested-dirs"`, or `localeMapping` \u2014 they are not read.',
|
|
118
|
+
" c. Connect it with `connect_repository`. Ask the user which method they prefer:",
|
|
110
119
|
" - GitHub App (no token, recommended): `get_github_app_install_url` \u2192 give the URL to the user",
|
|
111
120
|
" to open and authorize (you cannot click it for them; you may offer to open it via the shell).",
|
|
112
121
|
" Once they confirm, `list_github_installations` \u2192 `list_github_installation_repos` to pick the",
|
|
113
122
|
" repo, then `connect_repository` with that `installationId`.",
|
|
114
123
|
" - Token (any host): ask the user to paste a personal access token (repo read + PR scope), then",
|
|
115
124
|
" `connect_repository` with `token`. Treat the token as a secret \u2014 do not echo it back.",
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
"
|
|
125
|
+
" d. `files`/`paths` on `connect_repository` are an OPTIONAL fallback used only when the repo has no",
|
|
126
|
+
" committed `.syntholoc/config.json`. If you committed the config in (b) you may pass the same `files`",
|
|
127
|
+
" for redundancy, but the in-repo config wins. Same Crowdin placeholders as the config file.",
|
|
128
|
+
" e. `sync_repository` \u2014 imports ALL source strings from the repo at once and opens the translation PR.",
|
|
120
129
|
" Then `pull_translations` to import any translation files already in the repo (choose `conflict`",
|
|
121
130
|
" KEEP_APPROVED to preserve in-app edits).",
|
|
122
|
-
"
|
|
131
|
+
" f. `wait_for_job` on the returned job id, then report keys imported and the PR url.",
|
|
123
132
|
"4. FALLBACK \u2014 file-based import when the user does NOT want Git integration:",
|
|
124
133
|
" - Single file \u2192 `import_source_strings` once.",
|
|
125
134
|
" - Namespaced \u2192 `import_source_strings` once PER FILE with `keyPrefix` set to the namespace",
|
|
126
135
|
" (filename without extension). Keys become e.g. `home.title`, `common.title`.",
|
|
127
|
-
"5.
|
|
128
|
-
" a Crowdin-style `files` array of `{ source, translation }` patterns with a `{locale}` placeholder,",
|
|
129
|
-
' e.g. { "source": "messages/en/home.json", "translation": "messages/{locale}/home.json", "namespace": "home" }.',
|
|
130
|
-
' Do NOT invent fields like `i18nDir`, `format: "nested-dirs"`, or `localeMapping` \u2014 they are not read.',
|
|
131
|
-
"6. Offer to run the localize_changed flow next."
|
|
136
|
+
"5. Offer to run the localize_changed flow next."
|
|
132
137
|
].join("\n")
|
|
133
138
|
)
|
|
134
139
|
);
|
|
@@ -376,6 +381,9 @@ var fileMapping = z3.object({
|
|
|
376
381
|
source: z3.string().describe('Source file path or glob, e.g. "messages/en.json" or "locales/en/*.json".'),
|
|
377
382
|
translation: z3.string().describe(
|
|
378
383
|
'Translation pattern with Crowdin placeholders, e.g. "messages/%two_letters_code%/%original_file_name%" or "locales/%locale%/%original_file_name%".'
|
|
384
|
+
),
|
|
385
|
+
languagesMapping: z3.record(z3.string(), z3.record(z3.string(), z3.string())).optional().describe(
|
|
386
|
+
'Crowdin `languages_mapping`: per-placeholder, per-locale path overrides. Keyed by placeholder name without % (e.g. "two_letters_code", "locale"), then by locale code, to the on-disk replacement. E.g. { "two_letters_code": { "zh-CN": "cn" } } writes Chinese under "cn" instead of "zh".'
|
|
379
387
|
)
|
|
380
388
|
});
|
|
381
389
|
function registerGitTools(server, gql) {
|
|
@@ -426,14 +434,14 @@ function registerGitTools(server, gql) {
|
|
|
426
434
|
"connect_repository",
|
|
427
435
|
{
|
|
428
436
|
title: "Connect repository",
|
|
429
|
-
description: "Connects a git repository to the project so syncs can pull source strings and push translation PRs. Provide EITHER `installationId` (GitHub App mode \u2014 after the browser authorize flow: `get_github_app_install_url` \u2192 `list_github_installations` \u2192 `list_github_installation_repos`) OR `token` (PAT mode \u2014 a personal access token with repo read + pull-request scope; works for GitHub, GitLab and Bitbucket, no browser needed).
|
|
437
|
+
description: "Connects a git repository to the project so syncs can pull source strings and push translation PRs. Provide EITHER `installationId` (GitHub App mode \u2014 after the browser authorize flow: `get_github_app_install_url` \u2192 `list_github_installations` \u2192 `list_github_installation_repos`) OR `token` (PAT mode \u2014 a personal access token with repo read + pull-request scope; works for GitHub, GitLab and Bitbucket, no browser needed). Mappings come from the repo's `.syntholoc/config.json` when present (the source of truth); `files`/`paths` here are an optional fallback used only when that file is absent. After connecting, call `sync_repository` to import all source strings at once.",
|
|
430
438
|
inputSchema: {
|
|
431
439
|
projectId: z3.string(),
|
|
432
440
|
provider: z3.enum(["GITHUB", "GITLAB", "BITBUCKET"]).default("GITHUB"),
|
|
433
441
|
fullName: z3.string().describe('owner/repo, e.g. "acme/webapp".'),
|
|
434
442
|
branch: z3.string().optional().describe('Source branch (default "main").'),
|
|
435
|
-
files: z3.array(fileMapping).optional().describe("Crowdin-style source\u2192translation mappings."),
|
|
436
|
-
paths: z3.array(z3.string()).optional().describe("Simple mode: source file paths/globs to track (use instead of `files`)."),
|
|
443
|
+
files: z3.array(fileMapping).optional().describe("Crowdin-style source\u2192translation mappings. Fallback only \u2014 an in-repo `.syntholoc/config.json` wins."),
|
|
444
|
+
paths: z3.array(z3.string()).optional().describe("Simple mode: source file paths/globs to track (use instead of `files`). Fallback for in-repo config."),
|
|
437
445
|
installationId: z3.number().int().optional().describe("GitHub App installation id. Mutually exclusive with `token`."),
|
|
438
446
|
token: z3.string().optional().describe("Access token (PAT mode), stored encrypted. Mutually exclusive with `installationId`."),
|
|
439
447
|
translationBranch: z3.string().optional().describe("Branch translations are committed to (default l10n_<branch>)."),
|
|
@@ -448,7 +456,7 @@ function registerGitTools(server, gql) {
|
|
|
448
456
|
"update_repository",
|
|
449
457
|
{
|
|
450
458
|
title: "Update repository",
|
|
451
|
-
description: "Updates
|
|
459
|
+
description: "Updates an already-connected repository in place \u2014 no disconnect/reconnect, stored credentials and webhooks are preserved. Use it for integration settings (source `branch`, translation/PR branches, `pushSources`, auto-sync), and for `files`/`paths` only as the DB fallback. IMPORTANT: to change file MAPPINGS, prefer editing the repo's `.syntholoc/config.json` and opening a PR \u2014 that file is the source of truth and, when present, overrides `files`/`paths` here (they are ignored). So do NOT use this tool to change mappings of a config-managed repo; edit the file, open a PR, and after it merges call `sync_repository`. Only the fields you pass are changed.",
|
|
452
460
|
inputSchema: {
|
|
453
461
|
projectId: z3.string(),
|
|
454
462
|
repositoryId: z3.string(),
|
|
@@ -1399,7 +1407,7 @@ function registerAllTools(server, gql, opts = {}) {
|
|
|
1399
1407
|
}
|
|
1400
1408
|
|
|
1401
1409
|
// package.json
|
|
1402
|
-
var version = "0.3.
|
|
1410
|
+
var version = "0.3.1";
|
|
1403
1411
|
|
|
1404
1412
|
// src/build-server.ts
|
|
1405
1413
|
function buildMcpServer(gql, opts = {}) {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntholoc/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Syntholoc MCP server — manage AI localization and translation from Codex, Claude Code, and other MCP clients.",
|
|
5
5
|
"homepage": "https://syntholoc.com",
|
|
6
6
|
"keywords": [
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@modelcontextprotocol/sdk": "1.22.0",
|
|
50
|
-
"@syntholoc/sdk": "0.
|
|
50
|
+
"@syntholoc/sdk": "0.3.0",
|
|
51
51
|
"zod": "3.25.76"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|