@yoonion/mimi-seed-mcp 0.24.0 → 0.25.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.
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 +37 -0
  89. package/dist/core/credential-keystore.js +275 -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
@@ -1,7 +1,7 @@
1
1
  // Release Doctor iOS Xcode/SDK pin check against the App Store Connect upload minimums.
2
2
  // Internal to Release Doctor — import the public API (scanReleaseDoctor, report types) from ../release-doctor.js.
3
3
  import path from 'node:path';
4
- import { isXcodeCloudScript, isXcodePinFile, stripComments } from './util.js';
4
+ import { isXcodeCloudScript, isXcodePinFile, parseJsonWithComments, stripComments } from './util.js';
5
5
  // Apple's App Store Connect upload minimums. Each row cites the Apple Developer news post that announced it.
6
6
  // Apple announces the next minimum each spring, so the table is treated as stale from April 1 of the year after
7
7
  // the newest row — add the new row before then instead of letting Release Doctor guess.
@@ -39,10 +39,12 @@ function xcodeEvidence(file, raw, version) {
39
39
  function easXcodeEvidence(file) {
40
40
  let json;
41
41
  try {
42
- json = JSON.parse(file.text);
42
+ // EAS CLI accepts comments and trailing commas, so a valid eas.json is not always strict JSON.
43
+ json = parseJsonWithComments(file.text);
43
44
  }
44
45
  catch {
45
- return [];
46
+ // 그래도 못 읽으면 그 안의 ios.image 고정값을 모른다 — 근거 행으로 남겨 IOS_XCODE_OK 를 막는다(파서 메시지는 싣지 않는다)
47
+ return [{ file: file.relative, raw: 'could not be parsed; its ios.image pins were not read', beta: false, unparsed: true }];
46
48
  }
47
49
  const build = json?.build;
48
50
  if (!build || typeof build !== 'object')
@@ -283,6 +285,23 @@ export function iosXcodeFindings(files, now) {
283
285
  },
284
286
  }];
285
287
  }
288
+ const unparsed = evidence.filter((row) => row.unparsed);
289
+ if (unparsed.length > 0) {
290
+ return [{
291
+ code: 'IOS_XCODE_UNRESOLVED',
292
+ severity: 'info',
293
+ title: 'The Xcode version used for iOS release builds could not be fully resolved',
294
+ detail: `The pinned Xcode found meets the minimum (Xcode ${minimumXcode}, ${sdk} SDK), but ${describePins(unparsed)}, and a pin there may be older.`,
295
+ action: `Fix the file so it parses, or confirm the release build uses Xcode ${minimumXcode} or later (run \`xcodebuild -version\` on the build machine).`,
296
+ file: unparsed[0].file,
297
+ sourceUrl,
298
+ ko: {
299
+ title: 'iOS 릴리스 빌드의 Xcode 버전을 모두 확정하지 못함',
300
+ detail: `감지된 Xcode 고정값은 최소 기준(Xcode ${minimumXcode}, ${sdk} SDK)을 충족하지만, ${unparsed.map((row) => row.file).join(', ')} 파일을 해석하지 못해 그 안의 고정값은 확인하지 못했습니다. 더 낮은 버전일 수 있습니다.`,
301
+ action: `파일을 해석 가능하게 고치거나, 릴리스 빌드가 Xcode ${minimumXcode} 이상을 쓰는지 빌드 머신에서 \`xcodebuild -version\`으로 확인하세요.`,
302
+ },
303
+ }];
304
+ }
286
305
  const beta = resolved.some((row) => row.beta);
287
306
  return [{
288
307
  code: 'IOS_XCODE_OK',
@@ -756,7 +756,7 @@ unreadConventionRoots = []) {
756
756
  for (const file of used.values())
757
757
  if (!netScripts.has(file.absolute))
758
758
  netScripts.set(file.absolute, { file });
759
- const netIssues = unreadConventionRoots.map((dir) => `${dir} (a convention build too large to read completely)`);
759
+ const netIssues = unreadConventionRoots.map((dir) => `${dir} (a convention build that could not be read completely)`);
760
760
  for (const { file: script, excluded: scriptExcluded, inherited } of netScripts.values()) {
761
761
  const masked = maskStrings(script.text);
762
762
  for (const token of tokensOf(script)) {
@@ -24,3 +24,8 @@ export declare function statementEnd(masked: string, from: number): number;
24
24
  export declare function isWithin(scope: string, target: string): boolean;
25
25
  /** The package folder a node_modules/ path belongs to (`…/node_modules/@scope/name`). */
26
26
  export declare function packageDir(file: string): string | undefined;
27
+ /**
28
+ * JSON with `//` and `/* *\/` comments and trailing commas (what EAS CLI accepts in eas.json). Comments and commas
29
+ * inside strings are kept. Throws like JSON.parse when the text is still not JSON.
30
+ */
31
+ export declare function parseJsonWithComments(text: string): unknown;
@@ -93,3 +93,59 @@ export function packageDir(file) {
93
93
  const match = file.replace(/\\/g, '/').match(/^(.*\/node_modules\/(?:@[^/]+\/)?[^/]+)/);
94
94
  return match?.[1];
95
95
  }
96
+ /**
97
+ * JSON with `//` and `/* *\/` comments and trailing commas (what EAS CLI accepts in eas.json). Comments and commas
98
+ * inside strings are kept. Throws like JSON.parse when the text is still not JSON.
99
+ */
100
+ export function parseJsonWithComments(text) {
101
+ let out = '';
102
+ let i = 0;
103
+ while (i < text.length) {
104
+ const ch = text[i];
105
+ if (ch === '"') {
106
+ let j = i + 1;
107
+ while (j < text.length && text[j] !== '"')
108
+ j += text[j] === '\\' ? 2 : 1;
109
+ out += text.slice(i, j + 1);
110
+ i = j + 1;
111
+ }
112
+ else if (ch === '/' && text[i + 1] === '/') {
113
+ while (i < text.length && text[i] !== '\n')
114
+ i++;
115
+ }
116
+ else if (ch === '/' && text[i + 1] === '*') {
117
+ const end = text.indexOf('*/', i + 2);
118
+ if (end < 0)
119
+ throw new SyntaxError('Unterminated comment');
120
+ out += ' ';
121
+ i = end + 2;
122
+ }
123
+ else {
124
+ out += ch;
125
+ i++;
126
+ }
127
+ }
128
+ // Trailing commas: a comma followed only by whitespace before `}` or `]` (strings were copied verbatim above, so
129
+ // re-scan to skip them here too).
130
+ let result = '';
131
+ for (let k = 0; k < out.length; k++) {
132
+ const ch = out[k];
133
+ if (ch === '"') {
134
+ let j = k + 1;
135
+ while (j < out.length && out[j] !== '"')
136
+ j += out[j] === '\\' ? 2 : 1;
137
+ result += out.slice(k, j + 1);
138
+ k = j;
139
+ continue;
140
+ }
141
+ if (ch === ',') {
142
+ let j = k + 1;
143
+ while (j < out.length && /\s/.test(out[j]))
144
+ j++;
145
+ if (out[j] === '}' || out[j] === ']')
146
+ continue;
147
+ }
148
+ result += ch;
149
+ }
150
+ return JSON.parse(result);
151
+ }
@@ -10,6 +10,9 @@ import { iosXcodeFindings } from './release-doctor/ios-xcode.js';
10
10
  import { REACT_NATIVE_CATALOG, appliesOnlyAndroidLibraryPlugin, detectProject, isOneAppWithExtensions, specializedAndroidModules } from './release-doctor/project.js';
11
11
  import { TARGET_SDK_SOURCE, everyProjectBlocks, targetPolicy, targetSdkFindings } from './release-doctor/target-sdk.js';
12
12
  import { isWithin, moduleDir, unique } from './release-doctor/util.js';
13
+ function unreadList(paths) {
14
+ return paths.length > 3 ? `${paths.slice(0, 3).join(', ')}, +${paths.length - 3}` : paths.join(', ');
15
+ }
13
16
  /** Evidence rows with the ones below the submission minimum first (they are what a blocker is about). */
14
17
  function billingEvidenceRows(billing) {
15
18
  const minimum = billing.policy.minimumSupportedMajor;
@@ -32,6 +35,8 @@ function billingFinding(billing) {
32
35
  const minimum = billing.policy.minimumSupportedMajor;
33
36
  const schedule = (major) => billing.policy.knownSchedule.find((row) => row.major === major);
34
37
  const status = billing.status;
38
+ const unreadOnly = status === 'unresolved' && billing.unreadPaths.length > 0
39
+ && (billing.evidence.length === 0 || (billing.policy.scheduleCurrent && billing.evidence.every((row) => Number.isFinite(Number.parseInt(row.version ?? '', 10)))));
35
40
  const iapTarget = minimum === null ? undefined : reactNativeIapUpgradeTarget(minimum);
36
41
  const iapBelow = minimum !== null && billing.evidence.some((row) => row.wrapper?.name === 'react-native-iap'
37
42
  && row.version !== undefined && Number.parseInt(row.version, 10) < minimum);
@@ -68,37 +73,71 @@ function billingFinding(billing) {
68
73
  : `Billing Library ${major}: 마감일이 내장된 공식 표보다 이르므로 유효한 연장이 있다고 가정하지 마세요.`),
69
74
  ].filter(Boolean).join(' '),
70
75
  },
71
- unresolved: billing.policy.scheduleCurrent
76
+ // Nothing found, or every version resolved: the result is unresolved only because part of the tree was not read.
77
+ unresolved: unreadOnly
72
78
  ? {
73
- title: 'Google Play Billing version could not be resolved locally',
74
- koTitle: 'Google Play Billing 버전을 로컬에서 확정하지 못함',
75
- koDetail: 'Billing 의존성은 찾았지만 버전을 정적으로 확정하지 못했습니다.',
79
+ title: 'Google Play Billing could not be checked in every folder',
80
+ koTitle: '일부 폴더의 Google Play Billing 의존성을 확인하지 못함',
81
+ koDetail: billing.detectedVersions.length > 0
82
+ ? `감지된 Billing Library ${versions}은 현재 제출 기준을 충족하지만, 읽지 못한 경로가 있어 전체를 확인하지 못했습니다.`
83
+ : '읽지 못한 경로가 있어 Billing 의존성 전체를 확인하지 못했습니다.',
76
84
  action: billing.actions.join(' '),
77
- koAction: '보고된 Gradle/version catalog 표현식을 확인하거나 선언된 IAP 패키지를 설치한 뒤 다시 검사하세요.',
85
+ koAction: '읽지 못한 경로의 권한을 고치거나(또는 프로젝트 경로를 앱으로 좁혀) 다시 검사하세요.',
78
86
  }
79
- : {
80
- title: 'Google Play Billing policy table needs a refresh',
81
- koTitle: 'Google Play Billing 정책표 갱신 필요',
82
- koDetail: `내장된 공식 일정은 Billing Library ${billing.policy.latestKnownMajor}에서 끝나므로 현재 정책을 출처에서 다시 확인해야 합니다.`,
83
- action: billing.actions.join(' '),
84
- koAction: '공식 Billing 지원 중단 표를 확인하고, 이 결과를 믿기 전에 Mimi Seed를 업데이트하세요.',
85
- },
87
+ : !billing.policy.scheduleCurrent
88
+ ? {
89
+ title: 'Google Play Billing policy table needs a refresh',
90
+ koTitle: 'Google Play Billing 정책표 갱신 필요',
91
+ koDetail: `내장된 공식 일정은 Billing Library ${billing.policy.latestKnownMajor}에서 끝나므로 현재 정책을 출처에서 다시 확인해야 합니다.`,
92
+ action: billing.actions.join(' '),
93
+ koAction: '공식 Billing 지원 중단 표를 확인하고, 이 결과를 믿기 전에 Mimi Seed를 업데이트하세요.',
94
+ }
95
+ : {
96
+ title: 'Google Play Billing version could not be resolved locally',
97
+ koTitle: 'Google Play Billing 버전을 로컬에서 확정하지 못함',
98
+ koDetail: 'Billing 의존성은 찾았지만 버전을 정적으로 확정하지 못했습니다.',
99
+ action: billing.actions.join(' '),
100
+ koAction: '보고된 Gradle/version catalog 표현식을 확인하거나 선언된 IAP 패키지를 설치한 뒤 다시 검사하세요.',
101
+ },
86
102
  }[status];
103
+ const unreadKo = billing.unreadPaths.length === 0 ? ''
104
+ : unreadOnly ? ` 읽지 못한 경로: ${unreadList(billing.unreadPaths)}.`
105
+ : ` 읽지 못한 경로가 있어 그 안의 Billing 의존성은 확인하지 못했습니다: ${unreadList(billing.unreadPaths)}.`;
87
106
  return {
88
107
  code: `BILLING_${status.toUpperCase()}`,
89
108
  severity: status === 'blocker' ? 'blocker' : status === 'pass' ? 'info' : 'warning',
90
109
  title: copy.title,
91
- detail: `${billing.summary} Evidence: ${evidence}.`,
110
+ detail: evidence ? `${billing.summary} Evidence: ${evidence}.` : billing.summary,
92
111
  action: copy.action,
93
112
  file: billingEvidenceRows(billing)[0]?.file,
94
113
  sourceUrl: billing.policy.sourceUrl,
95
114
  ko: {
96
115
  title: copy.koTitle,
97
- detail: `${copy.koDetail} 근거: ${evidence}.`,
116
+ detail: `${copy.koDetail}${unreadKo}${evidence ? ` 근거: ${evidence}.` : ''}`,
98
117
  action: copy.koAction,
99
118
  },
100
119
  };
101
120
  }
121
+ /**
122
+ * Folders or files the project walk could not read (permissions, another user's volume). App modules, Billing
123
+ * dependencies, and Xcode pins inside them are missing from every verdict, so the report must not read as clear.
124
+ */
125
+ function unreadFinding(unread) {
126
+ const listed = unreadList(unread);
127
+ return {
128
+ code: 'SCAN_PATHS_NOT_READ',
129
+ severity: 'warning',
130
+ title: 'Some folders or files in the project could not be read',
131
+ detail: `Release Doctor could not read: ${listed}. App modules, Billing dependencies, and Xcode pins inside them are not part of any verdict above.`,
132
+ action: 'Fix the permissions and re-run, or scan the app on its own with --path if those paths do not belong to it.',
133
+ file: unread[0],
134
+ ko: {
135
+ title: '프로젝트의 일부 폴더나 파일을 읽지 못함',
136
+ detail: `Release Doctor가 다음을 읽지 못했습니다: ${listed}. 그 안의 앱 모듈, Billing 의존성, Xcode 고정값은 위 판정에 들어가지 않았습니다.`,
137
+ action: '권한을 고친 뒤 다시 실행하거나, 그 경로가 앱과 무관하면 --path로 앱만 따로 검사하세요.',
138
+ },
139
+ };
140
+ }
102
141
  export async function scanReleaseDoctor(projectPath, now = new Date(), options = {}) {
103
142
  const maxSourceFiles = options.maxSourceFiles ?? MAX_SOURCE_FILES;
104
143
  const root = path.resolve(projectPath);
@@ -111,7 +150,7 @@ export async function scanReleaseDoctor(projectPath, now = new Date(), options =
111
150
  }
112
151
  if (!stat.isDirectory())
113
152
  throw new Error(`Project path is not a directory: ${root}`);
114
- const { files, fcmSources, sourceScanTruncated, conventionTruncated } = await walk(root, maxSourceFiles);
153
+ const { files, fcmSources, sourceScanTruncated, conventionTruncated, unread } = await walk(root, maxSourceFiles);
115
154
  const reactNativeCatalog = path.join(root, 'node_modules', 'react-native', 'gradle', 'libs.versions.toml');
116
155
  try {
117
156
  files.push({
@@ -369,7 +408,9 @@ export async function scanReleaseDoctor(projectPath, now = new Date(), options =
369
408
  });
370
409
  }
371
410
  const billing = await checkBillingCompliance(root, now);
372
- if (billing.status !== 'not_used')
411
+ // With nothing found, an unresolved Billing result only repeats SCAN_PATHS_NOT_READ (same tree, same reason).
412
+ const onlyUnread = billing.evidence.length === 0 && unread.length > 0;
413
+ if (billing.status !== 'not_used' && !onlyUnread)
373
414
  findings.push(billingFinding(billing));
374
415
  }
375
416
  if (detected.ios) {
@@ -425,6 +466,8 @@ export async function scanReleaseDoctor(projectPath, now = new Date(), options =
425
466
  findings.push(...iosXcodeFindings(detected.hasIosAppOutsideDemo ? files.filter((file) => !file.demo) : files, now));
426
467
  }
427
468
  findings.push(...await fcmFindings(files, detected.hasAppOutsideDemo ? fcmSources.filter((file) => !file.demo) : fcmSources, root, now));
469
+ if (unread.length > 0)
470
+ findings.push(unreadFinding(unread));
428
471
  const counts = findings.reduce((result, finding) => ({ ...result, [finding.severity]: result[finding.severity] + 1 }), { blocker: 0, warning: 0, info: 0 });
429
472
  return {
430
473
  projectPath: root,
@@ -0,0 +1,25 @@
1
+ export declare const ENVELOPE_VERSION = 1;
2
+ export declare const ENVELOPE_ALG = "A256GCM";
3
+ export declare const DATA_KEY_BYTES = 32;
4
+ export interface CredentialEnvelope {
5
+ mimiSeedEncrypted: number;
6
+ alg: string;
7
+ kid: string;
8
+ iv: string;
9
+ tag: string;
10
+ data: string;
11
+ }
12
+ /** 키 식별자 — SHA-256(key) 앞 8바이트(hex). 비밀이 아니다: 아무것도 풀지 못하고, "어느 키로 잠갔나"만 말한다. */
13
+ export declare function keyId(key: Buffer): string;
14
+ /** 봉투 표식이 있는 객체인지. 형식이 맞는지는 parseEnvelope 가 본다 — 표식만 있고 깨진 봉투는 '깨짐'이지 '평문'이 아니다. */
15
+ export declare function looksLikeEnvelope(value: unknown): value is Record<string, unknown>;
16
+ export type EnvelopeProblem = 'unsupported' | 'malformed';
17
+ /** 봉투 필드를 검증한다. 다른 버전·알고리즘이면 'unsupported'(더 새 SDK 가 쓴 파일), 필드가 틀리면 'malformed'. */
18
+ export declare function parseEnvelope(value: Record<string, unknown>): CredentialEnvelope | EnvelopeProblem;
19
+ /** 평문을 봉투로 감싼다. 쓰기마다 새 무작위 IV. `aad` 는 자격증명 루트 기준 상대 경로('/' 구분). */
20
+ export declare function sealCredential(plaintext: string, key: Buffer, aad: string): CredentialEnvelope;
21
+ /**
22
+ * 봉투를 연다. 태그·AAD 가 맞지 않으면(파일 변조·다른 경로에서 복사됨) null — 호출자는 '깨짐'으로 보고한다.
23
+ * 키 불일치(kid)는 호출자가 먼저 걸러 '잠김'으로 보고한다.
24
+ */
25
+ export declare function openCredential(envelope: CredentialEnvelope, key: Buffer, aad: string): string | null;
@@ -0,0 +1,66 @@
1
+ // 자격증명 파일의 암호화 봉투(envelope) — docs/design/credential-encryption.md §4.1.
2
+ //
3
+ // 파일은 같은 경로의 JSON 으로 남고, 내용만 AES-256-GCM 으로 감싼다. AAD 는 자격증명 루트(~/.mimi-seed)
4
+ // 기준 상대 경로 — 파일을 다른 자리로 복사해 덮으면(패키지 A 의 SA 를 B 자리에) 인증 태그가 맞지 않는다.
5
+ // 이 모듈은 순수 함수만 갖는다: 키를 어디서 얻는지는 credential-keystore.ts, 파일 읽기는 credential-read.ts.
6
+ import { createCipheriv, createDecipheriv, createHash, randomBytes } from 'node:crypto';
7
+ export const ENVELOPE_VERSION = 1;
8
+ export const ENVELOPE_ALG = 'A256GCM';
9
+ export const DATA_KEY_BYTES = 32;
10
+ /** 키 식별자 — SHA-256(key) 앞 8바이트(hex). 비밀이 아니다: 아무것도 풀지 못하고, "어느 키로 잠갔나"만 말한다. */
11
+ export function keyId(key) {
12
+ return createHash('sha256').update(key).digest().subarray(0, 8).toString('hex');
13
+ }
14
+ /** 봉투 표식이 있는 객체인지. 형식이 맞는지는 parseEnvelope 가 본다 — 표식만 있고 깨진 봉투는 '깨짐'이지 '평문'이 아니다. */
15
+ export function looksLikeEnvelope(value) {
16
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
17
+ && Object.prototype.hasOwnProperty.call(value, 'mimiSeedEncrypted');
18
+ }
19
+ /** 봉투 필드를 검증한다. 다른 버전·알고리즘이면 'unsupported'(더 새 SDK 가 쓴 파일), 필드가 틀리면 'malformed'. */
20
+ export function parseEnvelope(value) {
21
+ if (value.mimiSeedEncrypted !== ENVELOPE_VERSION || value.alg !== ENVELOPE_ALG)
22
+ return 'unsupported';
23
+ const { kid, iv, tag, data } = value;
24
+ if (typeof kid !== 'string' || !/^[0-9a-f]{16}$/.test(kid))
25
+ return 'malformed';
26
+ if (typeof iv !== 'string' || Buffer.from(iv, 'base64').length !== 12)
27
+ return 'malformed';
28
+ if (typeof tag !== 'string' || Buffer.from(tag, 'base64').length !== 16)
29
+ return 'malformed';
30
+ if (typeof data !== 'string')
31
+ return 'malformed';
32
+ return { mimiSeedEncrypted: ENVELOPE_VERSION, alg: ENVELOPE_ALG, kid, iv, tag, data };
33
+ }
34
+ /** 평문을 봉투로 감싼다. 쓰기마다 새 무작위 IV. `aad` 는 자격증명 루트 기준 상대 경로('/' 구분). */
35
+ export function sealCredential(plaintext, key, aad) {
36
+ if (key.length !== DATA_KEY_BYTES)
37
+ throw new Error(`data key must be ${DATA_KEY_BYTES} bytes`);
38
+ const iv = randomBytes(12);
39
+ const cipher = createCipheriv('aes-256-gcm', key, iv);
40
+ cipher.setAAD(Buffer.from(aad, 'utf8'));
41
+ const data = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
42
+ return {
43
+ mimiSeedEncrypted: ENVELOPE_VERSION,
44
+ alg: ENVELOPE_ALG,
45
+ kid: keyId(key),
46
+ iv: iv.toString('base64'),
47
+ tag: cipher.getAuthTag().toString('base64'),
48
+ data: data.toString('base64'),
49
+ };
50
+ }
51
+ /**
52
+ * 봉투를 연다. 태그·AAD 가 맞지 않으면(파일 변조·다른 경로에서 복사됨) null — 호출자는 '깨짐'으로 보고한다.
53
+ * 키 불일치(kid)는 호출자가 먼저 걸러 '잠김'으로 보고한다.
54
+ */
55
+ export function openCredential(envelope, key, aad) {
56
+ try {
57
+ const decipher = createDecipheriv('aes-256-gcm', key, Buffer.from(envelope.iv, 'base64'));
58
+ decipher.setAAD(Buffer.from(aad, 'utf8'));
59
+ decipher.setAuthTag(Buffer.from(envelope.tag, 'base64'));
60
+ return Buffer.concat([decipher.update(Buffer.from(envelope.data, 'base64')), decipher.final()]).toString('utf8');
61
+ }
62
+ catch {
63
+ // GCM 인증 실패 — 원인(변조·경로 불일치)을 가릴 수 없고, 어느 쪽이든 호출자가 '깨짐'으로 알린다
64
+ return null;
65
+ }
66
+ }
@@ -0,0 +1,37 @@
1
+ export declare const KEYCHAIN_SERVICE = "mimi-seed";
2
+ export declare const KEYCHAIN_ACCOUNT = "data-key";
3
+ /** Windows: DPAPI(CurrentUser)로 보호한 데이터 키 파일. ~/.mimi-seed 기준. */
4
+ export declare const DPAPI_KEY_FILE = ".data-key.dpapi";
5
+ /** 키 조회 결과. absent = 저장소는 응답했고 키가 없다. unavailable = 저장소에 닿지 못했다(잠김·미설치·정책). */
6
+ export type DataKeyLookup = {
7
+ state: 'ok';
8
+ key: Buffer;
9
+ backend: string;
10
+ } | {
11
+ state: 'absent';
12
+ backend: string;
13
+ } | {
14
+ state: 'unavailable';
15
+ backend: string;
16
+ reason: string;
17
+ };
18
+ export type DataKeySource = () => DataKeyLookup;
19
+ /** 키가 없을 때 새로 만들고, 최종적으로 저장소에 남은 키(경쟁에서 이긴 쪽)를 돌려준다. */
20
+ export type DataKeyCreator = () => DataKeyLookup;
21
+ /** 이 OS 의 저장소에 키를 만든다(이미 있으면 그 키). 쓰기 경로만 부른다. */
22
+ export declare function osCreateDataKey(home?: string, platform?: NodeJS.Platform): DataKeyLookup;
23
+ export declare function osDataKeySource(home?: string, platform?: NodeJS.Platform): DataKeyLookup;
24
+ /**
25
+ * 실패한 조회를 기억하는 시간. 잠긴 파일이 여럿이면(mimi_seed_status 스캔, doctor) 파일마다 키 저장소를 다시
26
+ * 부르게 되고, Windows 에선 PowerShell 이 한 번에 1초 안팎이다. 짧게만 기억해, 키체인을 잠금 해제하면 곧 다시 읽힌다.
27
+ */
28
+ export declare const FAILED_LOOKUP_TTL_MS = 10000;
29
+ /** 프로세스의 데이터 키. 성공은 프로세스가 끝날 때까지, 실패는 FAILED_LOOKUP_TTL_MS 동안 캐시한다. */
30
+ export declare function lookupDataKey(now?: number): DataKeyLookup;
31
+ /**
32
+ * 키를 얻되, 저장소가 응답했는데 키가 없으면(absent) 만든다. 잠김·미설치(unavailable)는 만들지 않는다 — 그건
33
+ * "키가 없다"가 아니라 "지금 못 닿는다"이고, 거기서 새 키를 만들면 기존 파일들이 영영 잠긴다.
34
+ */
35
+ export declare function obtainDataKey(): DataKeyLookup;
36
+ /** 테스트용 — 키 출처(와 생성기)를 바꾸고 캐시를 비운다. 인자 없이 부르면 OS 저장소로 되돌린다. 제품 코드는 부르지 않는다(가드 테스트). */
37
+ export declare function setDataKeySourceForTests(next?: DataKeySource, create?: DataKeyCreator): void;