@yoonion/mimi-seed-mcp 0.24.0 → 0.25.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.
Files changed (287) hide show
  1. package/dist/admob/cli.js +34 -5
  2. package/dist/admob/errors.js +39 -14
  3. package/dist/ai/client.js +35 -14
  4. package/dist/ai/notes.js +14 -3
  5. package/dist/ai/review.js +17 -4
  6. package/dist/android/keystore-store.js +28 -8
  7. package/dist/android/keystore.d.ts +17 -2
  8. package/dist/android/keystore.js +110 -21
  9. package/dist/android/messages.d.ts +13 -11
  10. package/dist/android/messages.js +166 -72
  11. package/dist/android/playstore-sa.js +6 -3
  12. package/dist/appstore/analytics.js +46 -14
  13. package/dist/appstore/app-info-policy.js +7 -1
  14. package/dist/appstore/app-info.js +13 -3
  15. package/dist/appstore/apps.js +7 -1
  16. package/dist/appstore/asset-library-write.js +119 -37
  17. package/dist/appstore/asset-library.js +19 -5
  18. package/dist/appstore/auth.d.ts +2 -0
  19. package/dist/appstore/auth.js +31 -5
  20. package/dist/appstore/client.js +27 -6
  21. package/dist/appstore/declarations.js +22 -6
  22. package/dist/appstore/errors.d.ts +1 -1
  23. package/dist/appstore/errors.js +60 -34
  24. package/dist/appstore/http.d.ts +6 -0
  25. package/dist/appstore/http.js +22 -5
  26. package/dist/appstore/messages.js +86 -28
  27. package/dist/appstore/previews.js +22 -6
  28. package/dist/appstore/product-localization.js +10 -2
  29. package/dist/appstore/product-review.js +29 -10
  30. package/dist/appstore/products.js +20 -6
  31. package/dist/appstore/read-response.js +13 -3
  32. package/dist/appstore/release-target.js +13 -3
  33. package/dist/appstore/release.js +59 -22
  34. package/dist/appstore/review-preview.js +17 -6
  35. package/dist/appstore/review-submission.js +86 -35
  36. package/dist/appstore/sales.js +96 -44
  37. package/dist/appstore/screenshots.js +19 -5
  38. package/dist/appstore/testflight.js +41 -18
  39. package/dist/appstore/upload-parts.js +12 -3
  40. package/dist/appstore/versions.js +22 -10
  41. package/dist/auth/bigquery-auth.js +44 -15
  42. package/dist/auth/bigquery-setup-cli.js +1 -1
  43. package/dist/auth/cli.js +4 -2
  44. package/dist/auth/constants.js +13 -3
  45. package/dist/auth/drive-auth.d.ts +3 -2
  46. package/dist/auth/drive-auth.js +47 -17
  47. package/dist/auth/drive-setup-cli.js +1 -0
  48. package/dist/auth/errors.d.ts +75 -0
  49. package/dist/auth/errors.js +190 -86
  50. package/dist/auth/google-auth.d.ts +3 -1
  51. package/dist/auth/google-auth.js +39 -27
  52. package/dist/auth/playstore-auth.d.ts +1 -0
  53. package/dist/auth/playstore-auth.js +35 -15
  54. package/dist/auth/scopes.d.ts +11 -29
  55. package/dist/auth/scopes.js +38 -11
  56. package/dist/auth/youtube-channel.d.ts +8 -0
  57. package/dist/auth/youtube-channel.js +11 -3
  58. package/dist/bigquery/ids.js +19 -5
  59. package/dist/bigquery/tools.js +24 -8
  60. package/dist/billing/tools.js +22 -6
  61. package/dist/checks/appstore-submission.d.ts +1 -1
  62. package/dist/checks/appstore-submission.js +29 -8
  63. package/dist/checks/plan.js +169 -62
  64. package/dist/checks/release-status.js +10 -2
  65. package/dist/checks/risks.js +230 -63
  66. package/dist/checks/screenshots.d.ts +4 -4
  67. package/dist/checks/screenshots.js +63 -22
  68. package/dist/ci/config.js +8 -5
  69. package/dist/ci/gitlab.js +3 -1
  70. package/dist/core/atomic-write.d.ts +5 -2
  71. package/dist/core/atomic-write.js +8 -4
  72. package/dist/core/catch-scan.d.ts +17 -0
  73. package/dist/core/catch-scan.js +111 -0
  74. package/dist/core/checks/billing.d.ts +5 -0
  75. package/dist/core/checks/billing.js +36 -5
  76. package/dist/core/checks/lockfile.js +2 -0
  77. package/dist/core/checks/release-doctor/fcm.js +1 -0
  78. package/dist/core/checks/release-doctor/files.d.ts +3 -1
  79. package/dist/core/checks/release-doctor/files.js +12 -1
  80. package/dist/core/checks/release-doctor/gradle-apply.js +1 -0
  81. package/dist/core/checks/release-doctor/ios-xcode.js +22 -3
  82. package/dist/core/checks/release-doctor/target-sdk.js +1 -1
  83. package/dist/core/checks/release-doctor/util.d.ts +5 -0
  84. package/dist/core/checks/release-doctor/util.js +56 -0
  85. package/dist/core/checks/release-doctor.js +59 -16
  86. package/dist/core/credential-envelope.d.ts +25 -0
  87. package/dist/core/credential-envelope.js +66 -0
  88. package/dist/core/credential-keystore.d.ts +51 -0
  89. package/dist/core/credential-keystore.js +331 -0
  90. package/dist/core/credential-read.d.ts +33 -0
  91. package/dist/core/credential-read.js +112 -0
  92. package/dist/core/credential-store.d.ts +61 -0
  93. package/dist/core/credential-store.js +240 -0
  94. package/dist/core/http-errors.js +1 -0
  95. package/dist/core/i18n-scan.d.ts +10 -0
  96. package/dist/core/i18n-scan.js +79 -0
  97. package/dist/core/json-file.d.ts +30 -0
  98. package/dist/core/json-file.js +53 -0
  99. package/dist/core/lang.d.ts +14 -0
  100. package/dist/core/lang.js +22 -2
  101. package/dist/core/project-manifest.d.ts +24 -1
  102. package/dist/core/project-manifest.js +27 -16
  103. package/dist/drive/tools.js +86 -34
  104. package/dist/facebook/api.js +3 -1
  105. package/dist/facebook/config.js +11 -3
  106. package/dist/facebook/setup.d.ts +2 -0
  107. package/dist/facebook/setup.js +32 -9
  108. package/dist/firebase/cli.js +39 -5
  109. package/dist/firebase/tools.js +36 -10
  110. package/dist/ga4/cli.js +48 -4
  111. package/dist/ga4/tools.js +4 -2
  112. package/dist/googleads/config.js +24 -8
  113. package/dist/googleads/tools.js +3 -1
  114. package/dist/gsc/tools.js +10 -2
  115. package/dist/helpers.d.ts +4 -2
  116. package/dist/helpers.js +66 -32
  117. package/dist/i18n/manifest-en.d.ts +6 -0
  118. package/dist/i18n/manifest-en.js +53 -0
  119. package/dist/i18n/tools-en/admob.d.ts +25 -0
  120. package/dist/i18n/tools-en/admob.js +24 -0
  121. package/dist/i18n/tools-en/ai.d.ts +14 -0
  122. package/dist/i18n/tools-en/ai.js +13 -0
  123. package/dist/i18n/tools-en/android.d.ts +14 -0
  124. package/dist/i18n/tools-en/android.js +13 -0
  125. package/dist/i18n/tools-en/appstore.d.ts +240 -0
  126. package/dist/i18n/tools-en/appstore.js +239 -0
  127. package/dist/i18n/tools-en/auth.d.ts +16 -0
  128. package/dist/i18n/tools-en/auth.js +15 -0
  129. package/dist/i18n/tools-en/bigquery.d.ts +16 -0
  130. package/dist/i18n/tools-en/bigquery.js +15 -0
  131. package/dist/i18n/tools-en/billing.d.ts +17 -0
  132. package/dist/i18n/tools-en/billing.js +16 -0
  133. package/dist/i18n/tools-en/checks.d.ts +23 -0
  134. package/dist/i18n/tools-en/checks.js +22 -0
  135. package/dist/i18n/tools-en/ci.d.ts +21 -0
  136. package/dist/i18n/tools-en/ci.js +20 -0
  137. package/dist/i18n/tools-en/drive.d.ts +33 -0
  138. package/dist/i18n/tools-en/drive.js +32 -0
  139. package/dist/i18n/tools-en/facebook.d.ts +14 -0
  140. package/dist/i18n/tools-en/facebook.js +13 -0
  141. package/dist/i18n/tools-en/firebase.d.ts +42 -0
  142. package/dist/i18n/tools-en/firebase.js +41 -0
  143. package/dist/i18n/tools-en/ga4.d.ts +35 -0
  144. package/dist/i18n/tools-en/ga4.js +34 -0
  145. package/dist/i18n/tools-en/googleads.d.ts +15 -0
  146. package/dist/i18n/tools-en/googleads.js +14 -0
  147. package/dist/i18n/tools-en/gsc.d.ts +27 -0
  148. package/dist/i18n/tools-en/gsc.js +26 -0
  149. package/dist/i18n/tools-en/iam.d.ts +15 -0
  150. package/dist/i18n/tools-en/iam.js +14 -0
  151. package/dist/i18n/tools-en/index.d.ts +7 -0
  152. package/dist/i18n/tools-en/index.js +58 -0
  153. package/dist/i18n/tools-en/instagram.d.ts +16 -0
  154. package/dist/i18n/tools-en/instagram.js +15 -0
  155. package/dist/i18n/tools-en/jenkins.d.ts +41 -0
  156. package/dist/i18n/tools-en/jenkins.js +40 -0
  157. package/dist/i18n/tools-en/naver.d.ts +10 -0
  158. package/dist/i18n/tools-en/naver.js +9 -0
  159. package/dist/i18n/tools-en/playstore.d.ts +148 -0
  160. package/dist/i18n/tools-en/playstore.js +147 -0
  161. package/dist/i18n/tools-en/registrar.d.ts +6 -0
  162. package/dist/i18n/tools-en/registrar.js +6 -0
  163. package/dist/i18n/tools-en/threads.d.ts +21 -0
  164. package/dist/i18n/tools-en/threads.js +20 -0
  165. package/dist/i18n/tools-en/tiktok.d.ts +21 -0
  166. package/dist/i18n/tools-en/tiktok.js +20 -0
  167. package/dist/i18n/tools-en/video.d.ts +59 -0
  168. package/dist/i18n/tools-en/video.js +58 -0
  169. package/dist/i18n/tools-en/youtube.d.ts +44 -0
  170. package/dist/i18n/tools-en/youtube.js +43 -0
  171. package/dist/iam/key-files.js +13 -3
  172. package/dist/instagram/api.js +19 -5
  173. package/dist/instagram/config.js +11 -3
  174. package/dist/instagram/setup.js +37 -11
  175. package/dist/jenkins/builds.d.ts +2 -2
  176. package/dist/jenkins/builds.js +70 -30
  177. package/dist/jenkins/config.d.ts +5 -0
  178. package/dist/jenkins/config.js +25 -6
  179. package/dist/jenkins/credentials.js +33 -13
  180. package/dist/jenkins/http.js +6 -3
  181. package/dist/jenkins/jobs.js +19 -5
  182. package/dist/jenkins/messages.js +93 -36
  183. package/dist/lib/cli-args.js +13 -7
  184. package/dist/lib/google-errors.js +31 -9
  185. package/dist/lib/http.js +10 -3
  186. package/dist/lib/json-file.d.ts +15 -0
  187. package/dist/lib/json-file.js +65 -0
  188. package/dist/lib/meta-auth.d.ts +1 -1
  189. package/dist/lib/meta-auth.js +26 -8
  190. package/dist/lib/package-name.js +15 -4
  191. package/dist/lib/package-root.js +1 -1
  192. package/dist/lib/paginate.js +10 -2
  193. package/dist/lib/path-containment.js +22 -6
  194. package/dist/lib/resource-id.js +10 -3
  195. package/dist/lib/store-create-result.js +54 -13
  196. package/dist/lib/text-validators.js +20 -5
  197. package/dist/lib/tool-registrar.d.ts +9 -0
  198. package/dist/lib/tool-registrar.js +33 -14
  199. package/dist/lib/tool-text.d.ts +31 -0
  200. package/dist/lib/tool-text.js +52 -0
  201. package/dist/lib/toolsets.js +13 -3
  202. package/dist/lib/url-path.js +3 -1
  203. package/dist/naver/tools.js +138 -46
  204. package/dist/playstore/data-safety.js +16 -4
  205. package/dist/playstore/errors.js +33 -8
  206. package/dist/playstore/financials.js +83 -35
  207. package/dist/playstore/listing.js +7 -1
  208. package/dist/playstore/messages.js +179 -57
  209. package/dist/playstore/products.js +10 -2
  210. package/dist/playstore/recovery.js +10 -2
  211. package/dist/playstore/releases.js +34 -14
  212. package/dist/playstore/reviews.js +14 -4
  213. package/dist/playstore/statistics.js +3 -1
  214. package/dist/prompts.js +160 -50
  215. package/dist/registers/admob.js +36 -11
  216. package/dist/registers/android.js +25 -9
  217. package/dist/registers/appstore/apps.js +22 -6
  218. package/dist/registers/appstore/customer-reviews.js +7 -1
  219. package/dist/registers/appstore/declarations.js +63 -19
  220. package/dist/registers/appstore/media.js +76 -24
  221. package/dist/registers/appstore/metadata.js +26 -8
  222. package/dist/registers/appstore/products.js +53 -19
  223. package/dist/registers/appstore/review-submission.js +31 -9
  224. package/dist/registers/appstore/testflight.js +82 -24
  225. package/dist/registers/appstore/versions.js +88 -30
  226. package/dist/registers/auth.js +343 -90
  227. package/dist/registers/bigquery.js +54 -14
  228. package/dist/registers/billing.js +18 -4
  229. package/dist/registers/checks.js +20 -5
  230. package/dist/registers/ci.js +60 -20
  231. package/dist/registers/drive.js +18 -7
  232. package/dist/registers/facebook.js +31 -9
  233. package/dist/registers/firebase.js +21 -7
  234. package/dist/registers/googleads.js +23 -6
  235. package/dist/registers/gsc.js +3 -1
  236. package/dist/registers/iam.js +44 -13
  237. package/dist/registers/instagram.js +19 -5
  238. package/dist/registers/jenkins.js +43 -14
  239. package/dist/registers/naver.js +13 -3
  240. package/dist/registers/playstore/financials.d.ts +6 -0
  241. package/dist/registers/playstore/financials.js +48 -0
  242. package/dist/registers/playstore/listing.d.ts +15 -0
  243. package/dist/registers/playstore/listing.js +138 -0
  244. package/dist/registers/playstore/media.d.ts +6 -0
  245. package/dist/registers/playstore/media.js +56 -0
  246. package/dist/registers/playstore/products.d.ts +21 -0
  247. package/dist/registers/playstore/products.js +238 -0
  248. package/dist/registers/playstore/recovery.d.ts +11 -0
  249. package/dist/registers/playstore/recovery.js +105 -0
  250. package/dist/registers/playstore/releases.d.ts +8 -0
  251. package/dist/registers/playstore/releases.js +157 -0
  252. package/dist/registers/playstore/reviews.d.ts +6 -0
  253. package/dist/registers/playstore/reviews.js +43 -0
  254. package/dist/registers/playstore/service-accounts.d.ts +13 -0
  255. package/dist/registers/playstore/service-accounts.js +127 -0
  256. package/dist/registers/playstore/shared.d.ts +12 -0
  257. package/dist/registers/playstore/shared.js +24 -0
  258. package/dist/registers/playstore.d.ts +8 -0
  259. package/dist/registers/playstore.js +28 -734
  260. package/dist/registers/threads.js +28 -8
  261. package/dist/registers/tiktok.js +4 -2
  262. package/dist/registers/video.js +3 -1
  263. package/dist/remote-sync.js +80 -28
  264. package/dist/resources.d.ts +0 -8
  265. package/dist/resources.js +73 -32
  266. package/dist/server.d.ts +2 -0
  267. package/dist/server.js +9 -1
  268. package/dist/social/profile-store.js +36 -12
  269. package/dist/social/setup-cli.js +1 -1
  270. package/dist/threads/api.js +23 -6
  271. package/dist/threads/setup.js +42 -14
  272. package/dist/tiktok-business/api.js +13 -3
  273. package/dist/tiktok-business/auth.js +10 -2
  274. package/dist/tiktok-business/config.js +8 -3
  275. package/dist/tiktok-business/posting.d.ts +6 -0
  276. package/dist/tiktok-business/posting.js +118 -36
  277. package/dist/tiktok-business/setup-cli.js +3 -1
  278. package/dist/tools-cli.js +4 -5
  279. package/dist/video/captions.js +3 -1
  280. package/dist/video/files.js +13 -3
  281. package/dist/video/project.js +65 -21
  282. package/dist/video/providers.js +52 -16
  283. package/dist/video/render.js +71 -22
  284. package/dist/video/research.js +10 -2
  285. package/dist/video/schemas.js +19 -5
  286. package/dist/video/youtube-publish.js +62 -32
  287. package/package.json +1 -1
@@ -7,6 +7,7 @@
7
7
  * 모든 detection 은 정규식 기반 단순 휴리스틱 — false positive 최소화를
8
8
  * 위해 실측으로 거부된 패턴만 포함한다.
9
9
  */
10
+ import { catalog } from "#core/lang.js";
10
11
  // ── 한계값 (스토어 정책 SSOT) ─────────────────────────────────────
11
12
  const MAX_APPSTORE_WHATSNEW = 4000;
12
13
  const MAX_PLAY_RELEASE_NOTES = 500;
@@ -16,6 +17,20 @@ const HTML_TAG_PATTERN = /<\/?[a-zA-Z][^>]*>/g;
16
17
  // Play Store 가 홍보 정책으로 거부한 실측 사례: 본문에 '\5000원' 같이
17
18
  // 역슬래시 + 숫자 + (선택적 통화 단위) 패턴 (memory: reference_appstore_whatsnew_blacklist).
18
19
  const BACKSLASH_PRICE_PATTERN = /\\\d[\d,]*(?:원|won|krw)?/gi;
20
+ // ── 메시지 (도구 거부 응답에 노출 — 사용자 언어를 따른다) ─────────────
21
+ const V = catalog({
22
+ htmlTag: (tag) => `HTML 태그 '${tag}' 가 포함됐어요 — App Store / Play 모두 마크업 거부`,
23
+ tooLong: (label, length, limit) => `${label} 길이 ${length}자 — ${limit}자 이하로 줄여주세요`,
24
+ backslashPrice: (match) => `'${match}' 처럼 역슬래시 + 숫자(가격) 표기는 Play Store 가 홍보 정책으로 거부할 수 있어요`,
25
+ passed: "검증 통과",
26
+ near: (excerpt) => ` — 근처: ${excerpt}`,
27
+ }, {
28
+ htmlTag: (tag) => `Contains the HTML tag '${tag}' — both App Store and Play reject markup`,
29
+ tooLong: (label, length, limit) => `${label} length ${length} characters — shorten it to ${limit} characters or fewer`,
30
+ backslashPrice: (match) => `A backslash + number (price) notation such as '${match}' can be rejected by Play Store under its promotional policy`,
31
+ passed: "Validation passed",
32
+ near: (excerpt) => ` — near: ${excerpt}`,
33
+ });
19
34
  // ── 헬퍼 ──────────────────────────────────────────────────────────
20
35
  function makeExcerpt(text, pos, radius = 10) {
21
36
  const start = Math.max(0, pos - radius);
@@ -31,7 +46,7 @@ function lintHtmlTags(text) {
31
46
  while ((m = HTML_TAG_PATTERN.exec(text)) !== null) {
32
47
  issues.push({
33
48
  code: "HTML_TAG",
34
- message: `HTML 태그 '${m[0]}' 가 포함됐어요 — App Store / Play 모두 마크업 거부`,
49
+ message: V().htmlTag(m[0]),
35
50
  position: m.index,
36
51
  excerpt: makeExcerpt(text, m.index),
37
52
  });
@@ -47,7 +62,7 @@ function lintLength(text, limit, label) {
47
62
  return [
48
63
  {
49
64
  code: "LENGTH_EXCEEDED",
50
- message: `${label} 길이 ${text.length}자 — ${limit}자 이하로 줄여주세요`,
65
+ message: V().tooLong(label, text.length, limit),
51
66
  },
52
67
  ];
53
68
  }
@@ -58,7 +73,7 @@ function lintBackslashPrice(text) {
58
73
  while ((m = BACKSLASH_PRICE_PATTERN.exec(text)) !== null) {
59
74
  issues.push({
60
75
  code: "BACKSLASH_PRICE",
61
- message: `'${m[0]}' 처럼 역슬래시 + 숫자(가격) 표기는 Play Store 가 홍보 정책으로 거부할 수 있어요`,
76
+ message: V().backslashPrice(m[0]),
62
77
  position: m.index,
63
78
  excerpt: makeExcerpt(text, m.index),
64
79
  });
@@ -88,11 +103,11 @@ export function validatePlayReleaseNotes(text) {
88
103
  /** 사용자 친화 메시지로 포맷. MCP 도구가 거부 응답에 그대로 노출. */
89
104
  export function formatIssuesForUser(issues) {
90
105
  if (issues.length === 0)
91
- return "검증 통과";
106
+ return V().passed;
92
107
  return issues
93
108
  .map((i) => {
94
109
  const loc = i.position !== undefined ? ` (pos ${i.position})` : "";
95
- const ex = i.excerpt ? ` — 근처: ${JSON.stringify(i.excerpt)}` : "";
110
+ const ex = i.excerpt ? V().near(JSON.stringify(i.excerpt)) : "";
96
111
  return `[${i.code}] ${i.message}${loc}${ex}`;
97
112
  })
98
113
  .join("\n");
@@ -52,6 +52,10 @@ export declare function annotationsFor(meta: ToolMeta): ToolAnnotations & {
52
52
  };
53
53
  export declare function previewValue(key: string, value: unknown): string;
54
54
  export declare function confirmPreview(name: string, args: Record<string, unknown>): CallToolResult;
55
+ /** 레지스트라 가드를 받는 파괴적 도구의 설명 끝에 붙는 문구. 영어 번역은 i18n/tools-en/registrar.ts. */
56
+ export declare const GUARD_DESCRIPTION = "\u26A0\uFE0F \uC548\uC804 \uAC00\uB4DC: confirm \uC0DD\uB7B5/false \uBA74 \uC544\uBB34\uAC83\uB3C4 \uBC14\uAFB8\uC9C0 \uC54A\uACE0 dry-run preview \uB9CC \uBC18\uD658\uD55C\uB2E4. \uC0AC\uC6A9\uC790 \uBA85\uC2DC \uC2B9\uC778 \uD6C4 confirm: true \uB85C \uC7AC\uD638\uCD9C.";
57
+ /** 레지스트라가 주입하는 `confirm` 파라미터 설명. 영어 번역은 i18n/tools-en/registrar.ts. */
58
+ export declare const CONFIRM_PARAM_DESCRIPTION = "true \uBA85\uC2DC \uC2DC\uC5D0\uB9CC \uC2E4\uC81C \uC2E4\uD589. \uC0DD\uB7B5/false \uBA74 dry-run preview \uB9CC \uBC18\uD658 (\uBE44\uAC00\uC5ED\u00B7\uACF5\uAC1C \uC0AC\uACE0 \uCC28\uB2E8).";
55
59
  export interface ToolRegistrar {
56
60
  /** `McpServer.tool(name, description, shape, handler)` 와 같은 모양 — register 파일 호출부는 그대로다. */
57
61
  tool<Args extends ZodRawShapeCompat>(name: string, description: string, shape: Args, handler: ToolCallback<Args>, outputSchema?: ZodRawShapeCompat): void;
@@ -62,4 +66,9 @@ export interface ToolRegistrar {
62
66
  export declare function createToolRegistrar(server: McpServer, options: {
63
67
  manifest: ToolManifest;
64
68
  toolsets: ToolsetSelection;
69
+ /**
70
+ * 도구 설명 번역 (lib/tool-text.ts). 가드 문구를 덧붙이기 **전에** 원문과 문구를 각각 바꾼다 — 덧붙인 뒤의 문자열은
71
+ * 번역표의 키와 맞지 않는다. 파라미터 설명은 buildServer 가 tools/list 응답에서 바꾼다. 생략하면 원문 그대로.
72
+ */
73
+ translate?: (text: string) => string;
65
74
  }): ToolRegistrar;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { catalog } from '#core/lang.js';
2
3
  /** 자체 확인 파라미터 이름 — manifest `ownGate` 도구는 이 중 하나를 스키마에 가져야 한다. */
3
4
  export const CONFIRM_KEYS = ['confirm', 'confirmPublish', 'confirmVisible'];
4
5
  /** 레지스트라가 주입한 가드의 preview 첫 줄. 테스트와 에이전트가 이 문자열로 dry-run 을 식별한다. */
@@ -92,34 +93,52 @@ function redactNested(value) {
92
93
  }
93
94
  return value;
94
95
  }
96
+ /** dry-run preview 문구 — LLM 이 사용자에게 그대로 보여주는 텍스트라 언어를 따른다. */
97
+ const P = catalog({
98
+ chars: (n) => `${n}자`,
99
+ notRun: (name) => `\`${name}\` 은(는) 되돌리기 어렵거나 외부에 공개되는 작업이라 아직 실행하지 않았다.`,
100
+ args: '실행 예정 인자:',
101
+ none: '(없음)',
102
+ next: '사용자에게 위 내용을 보여주고 명시 승인을 받은 뒤, 같은 인자에 `confirm: true` 를 추가해 다시 호출하세요.',
103
+ }, {
104
+ chars: (n) => `${n} chars`,
105
+ notRun: (name) => `\`${name}\` is hard to undo or publishes externally, so it has not run yet.`,
106
+ args: 'Arguments it would run with:',
107
+ none: '(none)',
108
+ next: 'Show the user the above, get their explicit approval, then call again with the same arguments plus `confirm: true`.',
109
+ });
95
110
  export function previewValue(key, value) {
96
111
  if (SECRET_KEY.test(key))
97
112
  return '(redacted)';
98
113
  const raw = typeof value === 'string' ? value : JSON.stringify(redactNested(value));
99
114
  if (raw === undefined)
100
115
  return 'undefined';
101
- return raw.length > 200 ? `${raw.slice(0, 200)}… (${raw.length}자)` : raw;
116
+ return raw.length > 200 ? `${raw.slice(0, 200)}… (${P().chars(raw.length)})` : raw;
102
117
  }
103
118
  export function confirmPreview(name, args) {
104
119
  const entries = Object.entries(args).filter(([k, v]) => k !== 'confirm' && v !== undefined);
105
120
  const lines = [
106
- `${CONFIRM_PREVIEW_MARKER} — \`${name}\` 은(는) 되돌리기 어렵거나 외부에 공개되는 작업이라 아직 실행하지 않았다.`,
121
+ `${CONFIRM_PREVIEW_MARKER} — ${P().notRun(name)}`,
107
122
  '',
108
- '실행 예정 인자:',
109
- ...(entries.length ? entries.map(([k, v]) => ` ${k}: ${previewValue(k, v)}`) : [' (없음)']),
123
+ P().args,
124
+ ...(entries.length ? entries.map(([k, v]) => ` ${k}: ${previewValue(k, v)}`) : [` ${P().none}`]),
110
125
  '',
111
- '사용자에게 위 내용을 보여주고 명시 승인을 받은 뒤, 같은 인자에 `confirm: true` 를 추가해 다시 호출하세요.',
126
+ P().next,
112
127
  ];
113
128
  return { content: [{ type: 'text', text: lines.join('\n') }] };
114
129
  }
115
- const GUARD_DESCRIPTION = '⚠️ 안전 가드: confirm 생략/false 면 아무것도 바꾸지 않고 dry-run preview 만 반환한다. 사용자 명시 승인 후 confirm: true 로 재호출.';
130
+ /** 레지스트라 가드를 받는 파괴적 도구의 설명 끝에 붙는 문구. 영어 번역은 i18n/tools-en/registrar.ts. */
131
+ export const GUARD_DESCRIPTION = '⚠️ 안전 가드: confirm 생략/false 면 아무것도 바꾸지 않고 dry-run preview 만 반환한다. 사용자 명시 승인 후 confirm: true 로 재호출.';
132
+ /** 레지스트라가 주입하는 `confirm` 파라미터 설명. 영어 번역은 i18n/tools-en/registrar.ts. */
133
+ export const CONFIRM_PARAM_DESCRIPTION = 'true 명시 시에만 실제 실행. 생략/false 면 dry-run preview 만 반환 (비가역·공개 사고 차단).';
116
134
  export function createToolRegistrar(server, options) {
117
135
  const { manifest, toolsets } = options;
136
+ const t = options.translate ?? ((text) => text);
118
137
  const index = buildToolIndex(manifest);
119
138
  const metaOf = (name) => {
120
139
  const meta = index.get(name);
121
140
  if (!meta) {
122
- throw new Error(`tool-manifest.json 에 없는 도구 "${name}" — 해당 도메인의 tools 에 추가하고 write/destructive 분류도 정하세요 (docs/domain/recipes.md §1).`);
141
+ throw new Error(`Tool "${name}" is not in tool-manifest.json — add it to its domain's tools and classify it as write/destructive (docs/domain/recipes.md §1).`);
123
142
  }
124
143
  return meta;
125
144
  };
@@ -134,21 +153,21 @@ export function createToolRegistrar(server, options) {
134
153
  tool(name, description, shape, handler, outputSchema) {
135
154
  const meta = metaOf(name);
136
155
  if (meta.deprecatedFor) {
137
- throw new Error(`"${name}" 은(는) ${meta.deprecatedFor} 의 폐기 예정 별칭이라 레지스트라가 자동 등록한다 — register 파일에서 직접 등록하지 마세요.`);
156
+ throw new Error(`"${name}" is a deprecated alias of ${meta.deprecatedFor}; the registrar registers it automatically — do not register it in a register file.`);
138
157
  }
139
158
  let finalShape = shape;
140
- let finalDescription = description;
159
+ let finalDescription = t(description);
141
160
  let finalHandler = handler;
142
161
  // 파괴적 도구는 (a) 레지스트라 가드를 주입받거나 (b) manifest ownGate 로 "자기 confirm 이 모든
143
162
  // 파괴적 경로를 막는다" 고 선언해야 한다. confirm 파라미터가 있다는 사실만으로 가드를 건너뛰면
144
163
  // 일부 경로만 막는 도구가 조용히 통과한다 (예: 공개 업로드만 막고 비공개 업로드는 그냥 실행).
145
164
  const hasConfirmParam = CONFIRM_KEYS.some((k) => k in shape);
146
165
  if (meta.kind === 'destructive' && meta.ownGate && !hasConfirmParam) {
147
- throw new Error(`"${name}" 은(는) manifest ownGate 인데 confirm 류 파라미터(${CONFIRM_KEYS.join('/')})가 없습니다.`);
166
+ throw new Error(`"${name}" is listed in manifest ownGate but has no confirm-style parameter (${CONFIRM_KEYS.join('/')}).`);
148
167
  }
149
168
  if (meta.kind === 'destructive' && !meta.ownGate && hasConfirmParam) {
150
- throw new Error(`"${name}" 은(는) 자체 confirm 파라미터가 있는 destructive 도구입니다 — 그 가드가 모든 파괴적 경로를 막으면 ` +
151
- `manifest ownGate 에 추가하고, 아니면 파라미터를 없애 레지스트라 가드를 받으세요.`);
169
+ throw new Error(`"${name}" is a destructive tool with its own confirm parameter — if that gate blocks every destructive path, ` +
170
+ `add it to manifest ownGate; otherwise remove the parameter to get the registrar guard.`);
152
171
  }
153
172
  if (meta.kind === 'destructive' && !meta.ownGate) {
154
173
  const run = finalHandler;
@@ -157,9 +176,9 @@ export function createToolRegistrar(server, options) {
157
176
  confirm: z
158
177
  .boolean()
159
178
  .optional()
160
- .describe('true 명시 시에만 실제 실행. 생략/false 면 dry-run preview 만 반환 (비가역·공개 사고 차단).'),
179
+ .describe(CONFIRM_PARAM_DESCRIPTION),
161
180
  };
162
- finalDescription = `${description} ${GUARD_DESCRIPTION}`;
181
+ finalDescription = `${t(description)} ${t(GUARD_DESCRIPTION)}`;
163
182
  finalHandler = async (args, extra) => {
164
183
  if (args.confirm !== true)
165
184
  return confirmPreview(name, args);
@@ -0,0 +1,31 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { Lang } from '#core/lang.js';
3
+ /**
4
+ * 도구 설명 언어 — `tools/list` 가 LLM 에게 보여주는 도구 · 파라미터 설명.
5
+ *
6
+ * 원문은 register 파일의 한국어다(그대로 둔다). 언어가 en 이면 `i18n/tools-en/*.ts` 의 번역표로 바꾼다.
7
+ * 번역표의 키는 **한국어 원문 그 자체**다 — 원문을 고치면 키가 어긋나 tool-text-en.test.ts 가 "번역 없음"으로
8
+ * 실패하므로, 낡은 영어가 조용히 남지 않는다. 여러 도구가 공유하는 문구(`googleProfile` 등)는 한 번만 번역한다.
9
+ *
10
+ * 두 경로로 적용한다:
11
+ * - 도구 설명: 레지스트라가 등록할 때, 가드 문구 등을 덧붙이기 **전에** 원문과 덧붙일 문구를 각각 바꾼다.
12
+ * - 파라미터 설명: zod 스키마는 건드리지 않고 `tools/list` 응답 JSON 의 description 만 바꾼다. 스키마 인스턴스는
13
+ * 도구끼리 공유되고 중첩(배열 항목 · 객체)도 있어, 복제 · 수정하면 검증 동작까지 흔들릴 수 있다. JSON 만 바꾸면
14
+ * 타입 · required · pattern · 검증은 그대로다.
15
+ */
16
+ export type TranslateText = (text: string) => string;
17
+ /** 언어별 번역 함수. 번역이 없는 문구는 원문 그대로 — 실행 중에는 한국어가 섞일 뿐 깨지지 않는다(누락은 테스트가 잡는다). */
18
+ export declare function toolTextTranslator(lang: Lang): TranslateText;
19
+ /** JSON 스키마 안의 모든 `description` 을 바꾼 사본 (원본은 건드리지 않는다). */
20
+ export declare function translateSchemaDescriptions<T>(schema: T, translate: TranslateText): T;
21
+ /**
22
+ * `tools/list` 응답의 파라미터 설명을 번역하도록 핸들러를 감싼다. 모든 도구를 등록한 **뒤에** 부른다.
23
+ *
24
+ * SDK 는 `tools/list` 응답을 매번 zod 에서 새로 만든다. 공개 API 로는 그 결과를 가공할 수 없어, Protocol 의
25
+ * 핸들러 표(`_requestHandlers`)에 있는 SDK 핸들러를 감싼다 — 목록 조립(enabled 필터 · annotations · outputSchema)은
26
+ * SDK 가 그대로 한다. SDK 가 내부 구조를 바꾸면 여기서 감싸지 못하고 경고만 남긴다(서버는 한국어 설명으로 계속 동작).
27
+ * tool-text-en.test.ts 가 영어 모드 tools/list 에 한글이 없음을 확인하므로 그런 변화는 CI 에서 드러난다.
28
+ *
29
+ * @returns 감쌌으면 true.
30
+ */
31
+ export declare function localizeToolList(server: McpServer, translate: TranslateText): boolean;
@@ -0,0 +1,52 @@
1
+ import { TOOL_TEXT_EN } from '../i18n/tools-en/index.js';
2
+ const identity = (text) => text;
3
+ /** 언어별 번역 함수. 번역이 없는 문구는 원문 그대로 — 실행 중에는 한국어가 섞일 뿐 깨지지 않는다(누락은 테스트가 잡는다). */
4
+ export function toolTextTranslator(lang) {
5
+ if (lang !== 'en')
6
+ return identity;
7
+ return (text) => TOOL_TEXT_EN[text] ?? text;
8
+ }
9
+ /** JSON 스키마 안의 모든 `description` 을 바꾼 사본 (원본은 건드리지 않는다). */
10
+ export function translateSchemaDescriptions(schema, translate) {
11
+ if (Array.isArray(schema))
12
+ return schema.map((item) => translateSchemaDescriptions(item, translate));
13
+ if (!schema || typeof schema !== 'object')
14
+ return schema;
15
+ const out = {};
16
+ for (const [key, value] of Object.entries(schema)) {
17
+ out[key] = key === 'description' && typeof value === 'string'
18
+ ? translate(value)
19
+ : translateSchemaDescriptions(value, translate);
20
+ }
21
+ return out;
22
+ }
23
+ /**
24
+ * `tools/list` 응답의 파라미터 설명을 번역하도록 핸들러를 감싼다. 모든 도구를 등록한 **뒤에** 부른다.
25
+ *
26
+ * SDK 는 `tools/list` 응답을 매번 zod 에서 새로 만든다. 공개 API 로는 그 결과를 가공할 수 없어, Protocol 의
27
+ * 핸들러 표(`_requestHandlers`)에 있는 SDK 핸들러를 감싼다 — 목록 조립(enabled 필터 · annotations · outputSchema)은
28
+ * SDK 가 그대로 한다. SDK 가 내부 구조를 바꾸면 여기서 감싸지 못하고 경고만 남긴다(서버는 한국어 설명으로 계속 동작).
29
+ * tool-text-en.test.ts 가 영어 모드 tools/list 에 한글이 없음을 확인하므로 그런 변화는 CI 에서 드러난다.
30
+ *
31
+ * @returns 감쌌으면 true.
32
+ */
33
+ export function localizeToolList(server, translate) {
34
+ const handlers = server.server._requestHandlers;
35
+ const original = handlers?.get('tools/list');
36
+ if (!handlers || !original) {
37
+ console.error('[mimi-seed] tools/list handler not found; tool descriptions will not be translated (MCP SDK internals changed?).');
38
+ return false;
39
+ }
40
+ handlers.set('tools/list', async (request, extra) => {
41
+ const result = (await original(request, extra));
42
+ return {
43
+ ...result,
44
+ tools: result.tools.map((tool) => ({
45
+ ...tool,
46
+ ...(tool.inputSchema ? { inputSchema: translateSchemaDescriptions(tool.inputSchema, translate) } : {}),
47
+ ...(tool.outputSchema ? { outputSchema: translateSchemaDescriptions(tool.outputSchema, translate) } : {}),
48
+ })),
49
+ };
50
+ });
51
+ return true;
52
+ }
@@ -1,3 +1,13 @@
1
+ import { catalog } from '#core/lang.js';
2
+ const M = catalog({
3
+ unknownKey: (envName, key, known) => `${envName}: 알 수 없는 toolset "${key}" — 무시함 (도메인 키 또는 그룹: ${known})`,
4
+ noValidKey: (envName) => `${envName}: 유효한 toolset 이 없어 전체 도메인을 켭니다.`,
5
+ limited: (on, include, exclude) => `${on} — ${include}/${exclude} 로 제한됨`,
6
+ }, {
7
+ unknownKey: (envName, key, known) => `${envName}: unknown toolset "${key}" — ignored (domain keys or groups: ${known})`,
8
+ noValidKey: (envName) => `${envName}: no valid toolset, so all domains are enabled.`,
9
+ limited: (on, include, exclude) => `${on} — limited by ${include}/${exclude}`,
10
+ });
1
11
  /**
2
12
  * MIMI_SEED_TOOLSETS — 노출할 도구 도메인을 고른다.
3
13
  *
@@ -50,7 +60,7 @@ export function resolveToolsets(env, manifest) {
50
60
  for (const key of keys) {
51
61
  const domains = expandKey(key, manifest);
52
62
  if (domains === null) {
53
- warnings.push(`${envName}: 알 수 없는 toolset "${key}" — 무시함 (도메인 키 또는 그룹: ${knownKeys(manifest).join(', ')})`);
63
+ warnings.push(M().unknownKey(envName, key, knownKeys(manifest).join(', ')));
54
64
  continue;
55
65
  }
56
66
  for (const d of domains)
@@ -60,7 +70,7 @@ export function resolveToolsets(env, manifest) {
60
70
  };
61
71
  let included = include.length > 0 ? expand(include, TOOLSETS_ENV) : new Set(allDomains);
62
72
  if (include.length > 0 && included.size === 0) {
63
- warnings.push(`${TOOLSETS_ENV}: 유효한 toolset 이 없어 전체 도메인을 켭니다.`);
73
+ warnings.push(M().noValidKey(TOOLSETS_ENV));
64
74
  included = new Set(allDomains);
65
75
  }
66
76
  const excluded = expand(exclude, TOOLSETS_EXCLUDE_ENV);
@@ -122,5 +132,5 @@ export function describeToolsets(selection, manifest) {
122
132
  if (selection.toolNames)
123
133
  return `${TOOL_NAMES_ENV} (${selection.toolNames.length} tools)`;
124
134
  const on = Object.keys(manifest.domains).filter((d) => selection.enabled.has(d));
125
- return `${on.join(', ')} — ${TOOLSETS_ENV}/${TOOLSETS_EXCLUDE_ENV} 로 제한됨`;
135
+ return M().limited(on.join(', '), TOOLSETS_ENV, TOOLSETS_EXCLUDE_ENV);
126
136
  }
@@ -1,3 +1,5 @@
1
+ import { catalog } from '#core/lang.js';
2
+ const M = catalog({ bad: (v) => `URL 경로 세그먼트로 쓸 수 없는 값입니다: ${v}` }, { bad: (v) => `Value cannot be used as a URL path segment: ${v}` });
1
3
  // URL 경로 세그먼트 인코딩 — 호출자 입력을 REST 경로에 끼워 넣을 때 쓴다.
2
4
  //
3
5
  // 왜 필요한가: App Store Connect·Graph API 클라이언트는 `/appScreenshots/${screenshotId}` 처럼
@@ -10,7 +12,7 @@
10
12
  export function encodePathSegment(value) {
11
13
  const raw = String(value);
12
14
  if (raw === '' || raw === '.' || raw === '..') {
13
- throw new Error(`URL 경로 세그먼트로 쓸 수 없는 값입니다: ${JSON.stringify(raw)}`);
15
+ throw new Error(M().bad(JSON.stringify(raw)));
14
16
  }
15
17
  return encodeURIComponent(raw);
16
18
  }