@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.
- package/dist/admob/cli.js +34 -5
- package/dist/admob/errors.js +39 -14
- package/dist/ai/client.js +35 -14
- package/dist/ai/notes.js +14 -3
- package/dist/ai/review.js +17 -4
- package/dist/android/keystore-store.js +28 -8
- package/dist/android/keystore.d.ts +17 -2
- package/dist/android/keystore.js +110 -21
- package/dist/android/messages.d.ts +13 -11
- package/dist/android/messages.js +166 -72
- package/dist/android/playstore-sa.js +6 -3
- package/dist/appstore/analytics.js +46 -14
- package/dist/appstore/app-info-policy.js +7 -1
- package/dist/appstore/app-info.js +13 -3
- package/dist/appstore/apps.js +7 -1
- package/dist/appstore/asset-library-write.js +119 -37
- package/dist/appstore/asset-library.js +19 -5
- package/dist/appstore/auth.d.ts +2 -0
- package/dist/appstore/auth.js +31 -5
- package/dist/appstore/client.js +27 -6
- package/dist/appstore/declarations.js +22 -6
- package/dist/appstore/errors.d.ts +1 -1
- package/dist/appstore/errors.js +60 -34
- package/dist/appstore/http.d.ts +6 -0
- package/dist/appstore/http.js +22 -5
- package/dist/appstore/messages.js +86 -28
- package/dist/appstore/previews.js +22 -6
- package/dist/appstore/product-localization.js +10 -2
- package/dist/appstore/product-review.js +29 -10
- package/dist/appstore/products.js +20 -6
- package/dist/appstore/read-response.js +13 -3
- package/dist/appstore/release-target.js +13 -3
- package/dist/appstore/release.js +59 -22
- package/dist/appstore/review-preview.js +17 -6
- package/dist/appstore/review-submission.js +86 -35
- package/dist/appstore/sales.js +96 -44
- package/dist/appstore/screenshots.js +19 -5
- package/dist/appstore/testflight.js +41 -18
- package/dist/appstore/upload-parts.js +12 -3
- package/dist/appstore/versions.js +22 -10
- package/dist/auth/bigquery-auth.js +44 -15
- package/dist/auth/bigquery-setup-cli.js +1 -1
- package/dist/auth/cli.js +4 -2
- package/dist/auth/constants.js +13 -3
- package/dist/auth/drive-auth.d.ts +3 -2
- package/dist/auth/drive-auth.js +47 -17
- package/dist/auth/drive-setup-cli.js +1 -0
- package/dist/auth/errors.d.ts +75 -0
- package/dist/auth/errors.js +190 -86
- package/dist/auth/google-auth.d.ts +3 -1
- package/dist/auth/google-auth.js +39 -27
- package/dist/auth/playstore-auth.d.ts +1 -0
- package/dist/auth/playstore-auth.js +35 -15
- package/dist/auth/scopes.d.ts +11 -29
- package/dist/auth/scopes.js +38 -11
- package/dist/auth/youtube-channel.d.ts +8 -0
- package/dist/auth/youtube-channel.js +11 -3
- package/dist/bigquery/ids.js +19 -5
- package/dist/bigquery/tools.js +24 -8
- package/dist/billing/tools.js +22 -6
- package/dist/checks/appstore-submission.d.ts +1 -1
- package/dist/checks/appstore-submission.js +29 -8
- package/dist/checks/plan.js +169 -62
- package/dist/checks/release-status.js +10 -2
- package/dist/checks/risks.js +230 -63
- package/dist/checks/screenshots.d.ts +4 -4
- package/dist/checks/screenshots.js +63 -22
- package/dist/ci/config.js +8 -5
- package/dist/ci/gitlab.js +3 -1
- package/dist/core/atomic-write.d.ts +5 -2
- package/dist/core/atomic-write.js +8 -4
- package/dist/core/catch-scan.d.ts +17 -0
- package/dist/core/catch-scan.js +111 -0
- package/dist/core/checks/billing.d.ts +5 -0
- package/dist/core/checks/billing.js +36 -5
- package/dist/core/checks/lockfile.js +2 -0
- package/dist/core/checks/release-doctor/fcm.js +1 -0
- package/dist/core/checks/release-doctor/files.d.ts +3 -1
- package/dist/core/checks/release-doctor/files.js +12 -1
- package/dist/core/checks/release-doctor/gradle-apply.js +1 -0
- package/dist/core/checks/release-doctor/ios-xcode.js +22 -3
- package/dist/core/checks/release-doctor/target-sdk.js +1 -1
- package/dist/core/checks/release-doctor/util.d.ts +5 -0
- package/dist/core/checks/release-doctor/util.js +56 -0
- package/dist/core/checks/release-doctor.js +59 -16
- package/dist/core/credential-envelope.d.ts +25 -0
- package/dist/core/credential-envelope.js +66 -0
- package/dist/core/credential-keystore.d.ts +37 -0
- package/dist/core/credential-keystore.js +275 -0
- package/dist/core/credential-read.d.ts +33 -0
- package/dist/core/credential-read.js +112 -0
- package/dist/core/credential-store.d.ts +61 -0
- package/dist/core/credential-store.js +240 -0
- package/dist/core/http-errors.js +1 -0
- package/dist/core/i18n-scan.d.ts +10 -0
- package/dist/core/i18n-scan.js +79 -0
- package/dist/core/json-file.d.ts +30 -0
- package/dist/core/json-file.js +53 -0
- package/dist/core/lang.d.ts +14 -0
- package/dist/core/lang.js +22 -2
- package/dist/core/project-manifest.d.ts +24 -1
- package/dist/core/project-manifest.js +27 -16
- package/dist/drive/tools.js +86 -34
- package/dist/facebook/api.js +3 -1
- package/dist/facebook/config.js +11 -3
- package/dist/facebook/setup.d.ts +2 -0
- package/dist/facebook/setup.js +32 -9
- package/dist/firebase/cli.js +39 -5
- package/dist/firebase/tools.js +36 -10
- package/dist/ga4/cli.js +48 -4
- package/dist/ga4/tools.js +4 -2
- package/dist/googleads/config.js +24 -8
- package/dist/googleads/tools.js +3 -1
- package/dist/gsc/tools.js +10 -2
- package/dist/helpers.d.ts +4 -2
- package/dist/helpers.js +66 -32
- package/dist/i18n/manifest-en.d.ts +6 -0
- package/dist/i18n/manifest-en.js +53 -0
- package/dist/i18n/tools-en/admob.d.ts +25 -0
- package/dist/i18n/tools-en/admob.js +24 -0
- package/dist/i18n/tools-en/ai.d.ts +14 -0
- package/dist/i18n/tools-en/ai.js +13 -0
- package/dist/i18n/tools-en/android.d.ts +14 -0
- package/dist/i18n/tools-en/android.js +13 -0
- package/dist/i18n/tools-en/appstore.d.ts +240 -0
- package/dist/i18n/tools-en/appstore.js +239 -0
- package/dist/i18n/tools-en/auth.d.ts +16 -0
- package/dist/i18n/tools-en/auth.js +15 -0
- package/dist/i18n/tools-en/bigquery.d.ts +16 -0
- package/dist/i18n/tools-en/bigquery.js +15 -0
- package/dist/i18n/tools-en/billing.d.ts +17 -0
- package/dist/i18n/tools-en/billing.js +16 -0
- package/dist/i18n/tools-en/checks.d.ts +23 -0
- package/dist/i18n/tools-en/checks.js +22 -0
- package/dist/i18n/tools-en/ci.d.ts +21 -0
- package/dist/i18n/tools-en/ci.js +20 -0
- package/dist/i18n/tools-en/drive.d.ts +33 -0
- package/dist/i18n/tools-en/drive.js +32 -0
- package/dist/i18n/tools-en/facebook.d.ts +14 -0
- package/dist/i18n/tools-en/facebook.js +13 -0
- package/dist/i18n/tools-en/firebase.d.ts +42 -0
- package/dist/i18n/tools-en/firebase.js +41 -0
- package/dist/i18n/tools-en/ga4.d.ts +35 -0
- package/dist/i18n/tools-en/ga4.js +34 -0
- package/dist/i18n/tools-en/googleads.d.ts +15 -0
- package/dist/i18n/tools-en/googleads.js +14 -0
- package/dist/i18n/tools-en/gsc.d.ts +27 -0
- package/dist/i18n/tools-en/gsc.js +26 -0
- package/dist/i18n/tools-en/iam.d.ts +15 -0
- package/dist/i18n/tools-en/iam.js +14 -0
- package/dist/i18n/tools-en/index.d.ts +7 -0
- package/dist/i18n/tools-en/index.js +58 -0
- package/dist/i18n/tools-en/instagram.d.ts +16 -0
- package/dist/i18n/tools-en/instagram.js +15 -0
- package/dist/i18n/tools-en/jenkins.d.ts +41 -0
- package/dist/i18n/tools-en/jenkins.js +40 -0
- package/dist/i18n/tools-en/naver.d.ts +10 -0
- package/dist/i18n/tools-en/naver.js +9 -0
- package/dist/i18n/tools-en/playstore.d.ts +148 -0
- package/dist/i18n/tools-en/playstore.js +147 -0
- package/dist/i18n/tools-en/registrar.d.ts +6 -0
- package/dist/i18n/tools-en/registrar.js +6 -0
- package/dist/i18n/tools-en/threads.d.ts +21 -0
- package/dist/i18n/tools-en/threads.js +20 -0
- package/dist/i18n/tools-en/tiktok.d.ts +21 -0
- package/dist/i18n/tools-en/tiktok.js +20 -0
- package/dist/i18n/tools-en/video.d.ts +59 -0
- package/dist/i18n/tools-en/video.js +58 -0
- package/dist/i18n/tools-en/youtube.d.ts +44 -0
- package/dist/i18n/tools-en/youtube.js +43 -0
- package/dist/iam/key-files.js +13 -3
- package/dist/instagram/api.js +19 -5
- package/dist/instagram/config.js +11 -3
- package/dist/instagram/setup.js +37 -11
- package/dist/jenkins/builds.d.ts +2 -2
- package/dist/jenkins/builds.js +70 -30
- package/dist/jenkins/config.d.ts +5 -0
- package/dist/jenkins/config.js +25 -6
- package/dist/jenkins/credentials.js +33 -13
- package/dist/jenkins/http.js +6 -3
- package/dist/jenkins/jobs.js +19 -5
- package/dist/jenkins/messages.js +93 -36
- package/dist/lib/cli-args.js +13 -7
- package/dist/lib/google-errors.js +31 -9
- package/dist/lib/http.js +10 -3
- package/dist/lib/json-file.d.ts +15 -0
- package/dist/lib/json-file.js +65 -0
- package/dist/lib/meta-auth.d.ts +1 -1
- package/dist/lib/meta-auth.js +26 -8
- package/dist/lib/package-name.js +15 -4
- package/dist/lib/package-root.js +1 -1
- package/dist/lib/paginate.js +10 -2
- package/dist/lib/path-containment.js +22 -6
- package/dist/lib/resource-id.js +10 -3
- package/dist/lib/store-create-result.js +54 -13
- package/dist/lib/text-validators.js +20 -5
- package/dist/lib/tool-registrar.d.ts +9 -0
- package/dist/lib/tool-registrar.js +33 -14
- package/dist/lib/tool-text.d.ts +31 -0
- package/dist/lib/tool-text.js +52 -0
- package/dist/lib/toolsets.js +13 -3
- package/dist/lib/url-path.js +3 -1
- package/dist/naver/tools.js +138 -46
- package/dist/playstore/data-safety.js +16 -4
- package/dist/playstore/errors.js +33 -8
- package/dist/playstore/financials.js +83 -35
- package/dist/playstore/listing.js +7 -1
- package/dist/playstore/messages.js +179 -57
- package/dist/playstore/products.js +10 -2
- package/dist/playstore/recovery.js +10 -2
- package/dist/playstore/releases.js +34 -14
- package/dist/playstore/reviews.js +14 -4
- package/dist/playstore/statistics.js +3 -1
- package/dist/prompts.js +160 -50
- package/dist/registers/admob.js +36 -11
- package/dist/registers/android.js +25 -9
- package/dist/registers/appstore/apps.js +22 -6
- package/dist/registers/appstore/customer-reviews.js +7 -1
- package/dist/registers/appstore/declarations.js +63 -19
- package/dist/registers/appstore/media.js +76 -24
- package/dist/registers/appstore/metadata.js +26 -8
- package/dist/registers/appstore/products.js +53 -19
- package/dist/registers/appstore/review-submission.js +31 -9
- package/dist/registers/appstore/testflight.js +82 -24
- package/dist/registers/appstore/versions.js +88 -30
- package/dist/registers/auth.js +343 -90
- package/dist/registers/bigquery.js +54 -14
- package/dist/registers/billing.js +18 -4
- package/dist/registers/checks.js +20 -5
- package/dist/registers/ci.js +60 -20
- package/dist/registers/drive.js +18 -7
- package/dist/registers/facebook.js +31 -9
- package/dist/registers/firebase.js +21 -7
- package/dist/registers/googleads.js +23 -6
- package/dist/registers/gsc.js +3 -1
- package/dist/registers/iam.js +44 -13
- package/dist/registers/instagram.js +19 -5
- package/dist/registers/jenkins.js +43 -14
- package/dist/registers/naver.js +13 -3
- package/dist/registers/playstore/financials.d.ts +6 -0
- package/dist/registers/playstore/financials.js +48 -0
- package/dist/registers/playstore/listing.d.ts +15 -0
- package/dist/registers/playstore/listing.js +138 -0
- package/dist/registers/playstore/media.d.ts +6 -0
- package/dist/registers/playstore/media.js +56 -0
- package/dist/registers/playstore/products.d.ts +21 -0
- package/dist/registers/playstore/products.js +238 -0
- package/dist/registers/playstore/recovery.d.ts +11 -0
- package/dist/registers/playstore/recovery.js +105 -0
- package/dist/registers/playstore/releases.d.ts +8 -0
- package/dist/registers/playstore/releases.js +157 -0
- package/dist/registers/playstore/reviews.d.ts +6 -0
- package/dist/registers/playstore/reviews.js +43 -0
- package/dist/registers/playstore/service-accounts.d.ts +13 -0
- package/dist/registers/playstore/service-accounts.js +127 -0
- package/dist/registers/playstore/shared.d.ts +12 -0
- package/dist/registers/playstore/shared.js +24 -0
- package/dist/registers/playstore.d.ts +8 -0
- package/dist/registers/playstore.js +28 -734
- package/dist/registers/threads.js +28 -8
- package/dist/registers/tiktok.js +4 -2
- package/dist/registers/video.js +3 -1
- package/dist/remote-sync.js +80 -28
- package/dist/resources.d.ts +0 -8
- package/dist/resources.js +73 -32
- package/dist/server.d.ts +2 -0
- package/dist/server.js +9 -1
- package/dist/social/profile-store.js +36 -12
- package/dist/social/setup-cli.js +1 -1
- package/dist/threads/api.js +23 -6
- package/dist/threads/setup.js +42 -14
- package/dist/tiktok-business/api.js +13 -3
- package/dist/tiktok-business/auth.js +10 -2
- package/dist/tiktok-business/config.js +8 -3
- package/dist/tiktok-business/posting.d.ts +6 -0
- package/dist/tiktok-business/posting.js +118 -36
- package/dist/tiktok-business/setup-cli.js +3 -1
- package/dist/tools-cli.js +4 -5
- package/dist/video/captions.js +3 -1
- package/dist/video/files.js +13 -3
- package/dist/video/project.js +65 -21
- package/dist/video/providers.js +52 -16
- package/dist/video/render.js +71 -22
- package/dist/video/research.js +10 -2
- package/dist/video/schemas.js +19 -5
- package/dist/video/youtube-publish.js +62 -32
- package/package.json +1 -1
|
@@ -6,6 +6,26 @@ import { metaExpiryMessage } from '../lib/meta-auth.js';
|
|
|
6
6
|
import { resolveSocialConfigTarget, socialTargetLabel } from '../social/profile-store.js';
|
|
7
7
|
import { SOCIAL_PROFILE_ID_PATTERN } from '#core/project-manifest.js';
|
|
8
8
|
import { textResult } from '../lib/mcp-response.js';
|
|
9
|
+
import { catalog } from '#core/lang.js';
|
|
10
|
+
const M = catalog({
|
|
11
|
+
bio: (b) => ` 소개: ${b}`,
|
|
12
|
+
posted: '✅ 게시 완료',
|
|
13
|
+
carousel: (n) => `✅ 캐러셀 ${n}장 게시 완료`,
|
|
14
|
+
videoPosted: '✅ 영상 게시 완료',
|
|
15
|
+
notSet: (t) => `❌ Threads ${t} 미설정 → threads_save_config 또는 mimi-seed auth threads`,
|
|
16
|
+
connected: '✅ Threads 연결됨',
|
|
17
|
+
target: (t) => ` 대상: ${t}`,
|
|
18
|
+
noUsername: '(username 미저장)',
|
|
19
|
+
}, {
|
|
20
|
+
bio: (b) => ` Bio: ${b}`,
|
|
21
|
+
posted: '✅ Posted',
|
|
22
|
+
carousel: (n) => `✅ Posted a ${n}-image carousel`,
|
|
23
|
+
videoPosted: '✅ Video posted',
|
|
24
|
+
notSet: (t) => `❌ Threads ${t} not set up → threads_save_config or mimi-seed auth threads`,
|
|
25
|
+
connected: '✅ Threads connected',
|
|
26
|
+
target: (t) => ` Target: ${t}`,
|
|
27
|
+
noUsername: '(username not saved)',
|
|
28
|
+
});
|
|
9
29
|
export function registerThreadsTools(server) {
|
|
10
30
|
const profileSchema = z.string().regex(SOCIAL_PROFILE_ID_PATTERN).optional().describe('저장/사용할 소셜 프로필 ID. 생략 시 .mimi-seed.json의 socialProfiles.threads, 없으면 기존 기본 설정');
|
|
11
31
|
server.tool('threads_save_config', [
|
|
@@ -40,7 +60,7 @@ export function registerThreadsTools(server) {
|
|
|
40
60
|
return textResult([
|
|
41
61
|
`@${account.username}${account.name ? ` (${account.name})` : ''}`,
|
|
42
62
|
` ID: ${account.id}`,
|
|
43
|
-
account.threads_biography ?
|
|
63
|
+
account.threads_biography ? M().bio(account.threads_biography) : '',
|
|
44
64
|
` ${metaExpiryMessage(cfg.expiresAt, 'mimi-seed auth threads')}`,
|
|
45
65
|
].filter(Boolean));
|
|
46
66
|
});
|
|
@@ -57,7 +77,7 @@ export function registerThreadsTools(server) {
|
|
|
57
77
|
const cfg = requireThreadsConfig({ profile });
|
|
58
78
|
const result = await api.postText(cfg, text, imageUrl);
|
|
59
79
|
return textResult([
|
|
60
|
-
|
|
80
|
+
M().posted,
|
|
61
81
|
` media_id: ${result.id}`,
|
|
62
82
|
result.permalink ? ` URL: ${result.permalink}` : '',
|
|
63
83
|
].filter(Boolean));
|
|
@@ -74,7 +94,7 @@ export function registerThreadsTools(server) {
|
|
|
74
94
|
const cfg = requireThreadsConfig({ profile });
|
|
75
95
|
const result = await api.postCarousel(cfg, imageUrls, text);
|
|
76
96
|
return textResult([
|
|
77
|
-
|
|
97
|
+
M().carousel(imageUrls.length),
|
|
78
98
|
` media_id: ${result.id}`,
|
|
79
99
|
result.permalink ? ` URL: ${result.permalink}` : '',
|
|
80
100
|
].filter(Boolean));
|
|
@@ -93,7 +113,7 @@ export function registerThreadsTools(server) {
|
|
|
93
113
|
const cfg = requireThreadsConfig({ profile });
|
|
94
114
|
const result = await api.postVideo(cfg, videoUrl, text, altText);
|
|
95
115
|
return textResult([
|
|
96
|
-
|
|
116
|
+
M().videoPosted,
|
|
97
117
|
` media_id: ${result.id}`,
|
|
98
118
|
result.permalink ? ` URL: ${result.permalink}` : '',
|
|
99
119
|
].filter(Boolean));
|
|
@@ -104,12 +124,12 @@ export function registerThreadsTools(server) {
|
|
|
104
124
|
const target = resolveSocialConfigTarget('threads', options);
|
|
105
125
|
const cfg = loadThreadsConfig(options);
|
|
106
126
|
if (!cfg) {
|
|
107
|
-
return textResult(
|
|
127
|
+
return textResult(M().notSet(socialTargetLabel(target)));
|
|
108
128
|
}
|
|
109
129
|
return textResult([
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
` @${cfg.username ??
|
|
130
|
+
M().connected,
|
|
131
|
+
M().target(socialTargetLabel(target)),
|
|
132
|
+
` @${cfg.username ?? M().noUsername}`,
|
|
113
133
|
` userId: ${cfg.userId}`,
|
|
114
134
|
` ${metaExpiryMessage(cfg.expiresAt, 'mimi-seed auth threads')}`,
|
|
115
135
|
].filter(Boolean));
|
package/dist/registers/tiktok.js
CHANGED
|
@@ -4,11 +4,13 @@ import { ensureFreshTikTokConfig, ensureTikTokPublishConfig, safeTokenInspection
|
|
|
4
4
|
import { safeTikTokBusinessConfig } from '../tiktok-business/config.js';
|
|
5
5
|
import { checkPublishStatus, listPublishAudits, planVideoPost, publishPlannedVideo, } from '../tiktok-business/posting.js';
|
|
6
6
|
import { jsonResult } from '../lib/mcp-response.js';
|
|
7
|
+
import { catalog } from '#core/lang.js';
|
|
8
|
+
const M = catalog({ absoluteOnly: '절대경로만 허용합니다.', httpsOnly: 'HTTPS URL만 허용합니다.' }, { absoluteOnly: 'Only absolute paths are allowed.', httpsOnly: 'Only HTTPS URLs are allowed.' });
|
|
7
9
|
const absolutePath = z.string().min(1).refine((value) => value.startsWith('/') || /^[A-Za-z]:[\\/]/.test(value), {
|
|
8
|
-
|
|
10
|
+
error: () => M().absoluteOnly,
|
|
9
11
|
});
|
|
10
12
|
const httpsUrl = z.string().url().refine((value) => new URL(value).protocol === 'https:', {
|
|
11
|
-
|
|
13
|
+
error: () => M().httpsOnly,
|
|
12
14
|
});
|
|
13
15
|
export function registerTikTokBusinessTools(server) {
|
|
14
16
|
server.tool('tiktok_business_auth_status', [
|
package/dist/registers/video.js
CHANGED
|
@@ -8,11 +8,13 @@ import { synthesizeResearch } from '../video/research.js';
|
|
|
8
8
|
import { requireAuth } from '../helpers.js';
|
|
9
9
|
import { YOUTUBE_SCOPE, getYouTubeVideoStatus, updateYouTubeVideoPrivacy, uploadYouTubeVideo, } from '../video/youtube-publish.js';
|
|
10
10
|
import { jsonResult } from '../lib/mcp-response.js';
|
|
11
|
+
import { catalog } from '#core/lang.js';
|
|
12
|
+
const M = catalog({ httpOnly: 'HTTP(S) URL만 허용합니다.' }, { httpOnly: 'Only HTTP(S) URLs are allowed.' });
|
|
11
13
|
const absolutePath = z.string().min(1).describe('절대경로. 상대경로는 허용하지 않습니다.');
|
|
12
14
|
const httpUrl = z.string().url().refine((value) => {
|
|
13
15
|
const protocol = new URL(value).protocol;
|
|
14
16
|
return protocol === 'https:' || protocol === 'http:';
|
|
15
|
-
},
|
|
17
|
+
}, { error: () => M().httpOnly });
|
|
16
18
|
export function registerVideoTools(server) {
|
|
17
19
|
server.tool('youtube_upload_video', [
|
|
18
20
|
'로컬 영상 파일을 선택한 Google 로그인 프로필의 채널에 업로드합니다. expectedChannelId를 실제 인증 채널과 대조한 후 전송합니다.',
|
package/dist/remote-sync.js
CHANGED
|
@@ -1,10 +1,63 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
1
|
import os from 'node:os';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { getAppStoreCredentials } from './appstore/auth.js';
|
|
5
4
|
import { fetchWithTimeout } from './lib/http.js';
|
|
6
5
|
import { getServiceAccountJson, listRegisteredServiceAccounts, } from './auth/playstore-auth.js';
|
|
7
6
|
import { isValidAndroidPackageName } from './lib/package-name.js';
|
|
7
|
+
import { catalog } from '#core/lang.js';
|
|
8
|
+
import { readCredentialFileSync } from '#core/credential-read.js';
|
|
9
|
+
/** 동기화 미리보기·결과 문구 — 호출 시점에 언어를 읽는다. */
|
|
10
|
+
const R = catalog({
|
|
11
|
+
networkFailed: '원격 MCP 네트워크 연결 실패',
|
|
12
|
+
unreadable: '원격 MCP 응답을 읽지 못했습니다.',
|
|
13
|
+
remoteError: '원격 MCP 오류',
|
|
14
|
+
badFormat: '원격 MCP 응답 형식이 올바르지 않습니다.',
|
|
15
|
+
http: (status) => `원격 MCP HTTP ${status}`,
|
|
16
|
+
notUrl: 'URL 형식이 아닙니다',
|
|
17
|
+
userInfo: 'URL 에 사용자 정보가 들어 있습니다',
|
|
18
|
+
localHttp: (host) => `${host} (로컬 http)`,
|
|
19
|
+
notHttps: (target) => `https 가 아닙니다 (${target})`,
|
|
20
|
+
title: 'Mimi Seed 로컬 → 원격 자격증명 동기화',
|
|
21
|
+
target: (value) => `- 전송 대상: ${value}`,
|
|
22
|
+
noRemote: '원격 연결 정보 없음',
|
|
23
|
+
rejectedEndpoint: (reason) => `거부됨 — ${reason}`,
|
|
24
|
+
appStore: (state) => `- App Store Connect: ${state === 'one' ? '대상 1개' : state === 'noKey' ? '로컬 키 없음' : '제외'}`,
|
|
25
|
+
play: (count, missing) => `- Google Play: ${count}개 패키지${missing > 0 ? ` (자격증명 없는 대상 ${missing}개)` : ''}`,
|
|
26
|
+
skippedHeader: (n) => `- 건너뜀: 등록되지 않은 패키지 ${n}개 (playstore_list_service_accounts 로 등록 목록 확인):`,
|
|
27
|
+
oauthNotCopied: '- Google OAuth: 복사하지 않음 (원격 웹에서 별도 동의 필요)',
|
|
28
|
+
previewOnly: '미리보기만 수행했습니다. 원격 저장은 confirm=true일 때만 실행됩니다.',
|
|
29
|
+
noConfig: '원격 연결 정보가 없습니다. 먼저 `mimi-seed init`을 실행하세요.',
|
|
30
|
+
untrusted: (reason) => `원격 엔드포인트를 신뢰할 수 없어 전송하지 않았습니다: ${reason}`,
|
|
31
|
+
failed: '실패',
|
|
32
|
+
skippedResult: (name) => `- Play ${name}: 건너뜀 (등록되지 않은 패키지)`,
|
|
33
|
+
nothingToSync: '- 동기화할 로컬 자격증명이 없습니다.',
|
|
34
|
+
googleConsent: (webBase) => `Google 사용자 권한(Firebase/AdMob/vitals): ${webBase}/apps 에서 "Google 플랫폼 연결" 동의 필요`,
|
|
35
|
+
}, {
|
|
36
|
+
networkFailed: 'Remote MCP network connection failed',
|
|
37
|
+
unreadable: 'Could not read the remote MCP response.',
|
|
38
|
+
remoteError: 'Remote MCP error',
|
|
39
|
+
badFormat: 'The remote MCP response format is invalid.',
|
|
40
|
+
http: (status) => `Remote MCP HTTP ${status}`,
|
|
41
|
+
notUrl: 'Not a URL',
|
|
42
|
+
userInfo: 'The URL contains user credentials',
|
|
43
|
+
localHttp: (host) => `${host} (local http)`,
|
|
44
|
+
notHttps: (target) => `Not https (${target})`,
|
|
45
|
+
title: 'Mimi Seed local → remote credential sync',
|
|
46
|
+
target: (value) => `- Destination: ${value}`,
|
|
47
|
+
noRemote: 'no remote connection info',
|
|
48
|
+
rejectedEndpoint: (reason) => `rejected — ${reason}`,
|
|
49
|
+
appStore: (state) => `- App Store Connect: ${state === 'one' ? '1 target' : state === 'noKey' ? 'no local key' : 'excluded'}`,
|
|
50
|
+
play: (count, missing) => `- Google Play: ${count} package(s)${missing > 0 ? ` (${missing} target(s) without credentials)` : ''}`,
|
|
51
|
+
skippedHeader: (n) => `- Skipped: ${n} unregistered package(s) (check the registered list with playstore_list_service_accounts):`,
|
|
52
|
+
oauthNotCopied: '- Google OAuth: not copied (requires separate consent on the remote web)',
|
|
53
|
+
previewOnly: 'Preview only. Remote storage runs only with confirm=true.',
|
|
54
|
+
noConfig: 'No remote connection info. Run `mimi-seed init` first.',
|
|
55
|
+
untrusted: (reason) => `The remote endpoint is not trusted, so nothing was sent: ${reason}`,
|
|
56
|
+
failed: 'failed',
|
|
57
|
+
skippedResult: (name) => `- Play ${name}: skipped (unregistered package)`,
|
|
58
|
+
nothingToSync: '- No local credentials to sync.',
|
|
59
|
+
googleConsent: (webBase) => `Google user permissions (Firebase/AdMob/vitals): requires "Google platform connection" consent at ${webBase}/apps`,
|
|
60
|
+
});
|
|
8
61
|
function getRemoteConfig() {
|
|
9
62
|
const envToken = process.env.MIMI_SEED_TOKEN;
|
|
10
63
|
if (envToken) {
|
|
@@ -13,13 +66,14 @@ function getRemoteConfig() {
|
|
|
13
66
|
}
|
|
14
67
|
try {
|
|
15
68
|
const configPath = path.join(os.homedir(), '.mimi-seed', 'config.json');
|
|
16
|
-
const parsed = JSON.parse(
|
|
69
|
+
const parsed = JSON.parse(readCredentialFileSync(configPath));
|
|
17
70
|
if (!parsed.token || !parsed.endpoint)
|
|
18
71
|
return null;
|
|
19
72
|
const webBase = parsed.webBase ?? parsed.endpoint.replace(/\/api\/mcp\/?$/, '');
|
|
20
73
|
return { token: parsed.token, endpoint: parsed.endpoint, webBase };
|
|
21
74
|
}
|
|
22
75
|
catch {
|
|
76
|
+
// config.json 을 못 읽으면 '원격 연결 없음' — 복구(mimi-seed init)가 같고, 깨진 파일은 mimi_seed_status 가 json-file 로 보고한다
|
|
23
77
|
return null;
|
|
24
78
|
}
|
|
25
79
|
}
|
|
@@ -42,10 +96,10 @@ async function callRemote(config, tool, args) {
|
|
|
42
96
|
}, 30_000);
|
|
43
97
|
}
|
|
44
98
|
catch {
|
|
45
|
-
return { text:
|
|
99
|
+
return { text: R().networkFailed, isError: true };
|
|
46
100
|
}
|
|
47
101
|
if (!response.ok) {
|
|
48
|
-
return { text:
|
|
102
|
+
return { text: R().http(response.status), isError: true };
|
|
49
103
|
}
|
|
50
104
|
const raw = await response.text();
|
|
51
105
|
let payloadRaw = raw;
|
|
@@ -55,13 +109,13 @@ async function callRemote(config, tool, args) {
|
|
|
55
109
|
.map((line) => line.trim())
|
|
56
110
|
.find((line) => line.startsWith('data:'));
|
|
57
111
|
if (!data)
|
|
58
|
-
return { text:
|
|
112
|
+
return { text: R().unreadable, isError: true };
|
|
59
113
|
payloadRaw = data.slice(5).trim();
|
|
60
114
|
}
|
|
61
115
|
try {
|
|
62
116
|
const payload = JSON.parse(payloadRaw);
|
|
63
117
|
if (payload.error)
|
|
64
|
-
return { text: payload.error.message ??
|
|
118
|
+
return { text: payload.error.message ?? R().remoteError, isError: true };
|
|
65
119
|
return {
|
|
66
120
|
text: (payload.result?.content ?? [])
|
|
67
121
|
.filter((item) => item.type === 'text')
|
|
@@ -71,7 +125,7 @@ async function callRemote(config, tool, args) {
|
|
|
71
125
|
};
|
|
72
126
|
}
|
|
73
127
|
catch {
|
|
74
|
-
return { text:
|
|
128
|
+
return { text: R().badFormat, isError: true };
|
|
75
129
|
}
|
|
76
130
|
}
|
|
77
131
|
const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]']);
|
|
@@ -86,17 +140,17 @@ export function checkRemoteEndpoint(endpoint) {
|
|
|
86
140
|
url = new URL(endpoint);
|
|
87
141
|
}
|
|
88
142
|
catch {
|
|
89
|
-
return { ok: false, reason:
|
|
143
|
+
return { ok: false, reason: R().notUrl };
|
|
90
144
|
}
|
|
91
145
|
if (url.username || url.password) {
|
|
92
|
-
return { ok: false, reason:
|
|
146
|
+
return { ok: false, reason: R().userInfo };
|
|
93
147
|
}
|
|
94
148
|
if (url.protocol === 'https:')
|
|
95
149
|
return { ok: true, host: url.host };
|
|
96
150
|
if (url.protocol === 'http:' && LOOPBACK_HOSTS.has(url.hostname)) {
|
|
97
|
-
return { ok: true, host:
|
|
151
|
+
return { ok: true, host: R().localHttp(url.host) };
|
|
98
152
|
}
|
|
99
|
-
return { ok: false, reason:
|
|
153
|
+
return { ok: false, reason: R().notHttps(`${url.protocol}//${url.host}`) };
|
|
100
154
|
}
|
|
101
155
|
const defaultDependencies = {
|
|
102
156
|
getConfig: getRemoteConfig,
|
|
@@ -127,28 +181,26 @@ export async function syncRemoteCredentials(options, dependencies = defaultDepen
|
|
|
127
181
|
.filter((entry) => Boolean(entry.json));
|
|
128
182
|
const config = dependencies.getConfig();
|
|
129
183
|
const endpoint = config ? checkRemoteEndpoint(config.endpoint) : null;
|
|
184
|
+
const m = R();
|
|
130
185
|
const lines = [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
186
|
+
m.title,
|
|
187
|
+
m.target(!config ? m.noRemote : endpoint?.ok ? endpoint.host : m.rejectedEndpoint(endpoint?.reason)),
|
|
188
|
+
m.appStore(appStore ? 'one' : includeAppStore ? 'noKey' : 'excluded'),
|
|
189
|
+
m.play(playCredentials.length, packageNames.length - playCredentials.length),
|
|
135
190
|
...playCredentials.map((entry) => ` - ${entry.packageName}`),
|
|
136
191
|
...(rejected.length
|
|
137
|
-
? [
|
|
138
|
-
`- 건너뜀: 등록되지 않은 패키지 ${rejected.length}개 (playstore_list_service_accounts 로 등록 목록 확인):`,
|
|
139
|
-
...rejected.map((name) => ` - ${JSON.stringify(name.slice(0, 80))}`),
|
|
140
|
-
]
|
|
192
|
+
? [m.skippedHeader(rejected.length), ...rejected.map((name) => ` - ${JSON.stringify(name.slice(0, 80))}`)]
|
|
141
193
|
: []),
|
|
142
|
-
|
|
194
|
+
m.oauthNotCopied,
|
|
143
195
|
];
|
|
144
196
|
if (!options.confirm) {
|
|
145
|
-
return [...lines, '',
|
|
197
|
+
return [...lines, '', m.previewOnly].join('\n');
|
|
146
198
|
}
|
|
147
199
|
if (!config) {
|
|
148
|
-
return [...lines, '',
|
|
200
|
+
return [...lines, '', m.noConfig].join('\n');
|
|
149
201
|
}
|
|
150
202
|
if (!endpoint?.ok) {
|
|
151
|
-
return [...lines, '',
|
|
203
|
+
return [...lines, '', m.untrusted(endpoint?.reason)].join('\n');
|
|
152
204
|
}
|
|
153
205
|
// 미등록 이름은 **건너뛰고** 나머지(App Store, 등록된 패키지)는 보낸다. 위험(임의 파일 전송)은
|
|
154
206
|
// 허용 목록이 이미 막았으므로, 오타 하나로 App Store 동기화까지 멈출 이유가 없다. 대신 미리보기와
|
|
@@ -161,7 +213,7 @@ export async function syncRemoteCredentials(options, dependencies = defaultDepen
|
|
|
161
213
|
private_key: appStore.privateKey,
|
|
162
214
|
confirm: true,
|
|
163
215
|
});
|
|
164
|
-
results.push(`- App Store: ${result.isError ?
|
|
216
|
+
results.push(`- App Store: ${result.isError ? m.failed : result.text}`);
|
|
165
217
|
}
|
|
166
218
|
for (const entry of playCredentials) {
|
|
167
219
|
const result = await dependencies.callRemote(config, 'import_playstore_service_account', {
|
|
@@ -169,17 +221,17 @@ export async function syncRemoteCredentials(options, dependencies = defaultDepen
|
|
|
169
221
|
service_account_json: entry.json,
|
|
170
222
|
confirm: true,
|
|
171
223
|
});
|
|
172
|
-
results.push(`- Play ${entry.packageName}: ${result.isError ?
|
|
224
|
+
results.push(`- Play ${entry.packageName}: ${result.isError ? m.failed : result.text}`);
|
|
173
225
|
}
|
|
174
226
|
for (const name of rejected)
|
|
175
|
-
results.push(
|
|
227
|
+
results.push(m.skippedResult(JSON.stringify(name.slice(0, 80))));
|
|
176
228
|
if (results.length === 0)
|
|
177
|
-
results.push(
|
|
229
|
+
results.push(m.nothingToSync);
|
|
178
230
|
return [
|
|
179
231
|
...lines,
|
|
180
232
|
'',
|
|
181
233
|
...results,
|
|
182
234
|
'',
|
|
183
|
-
|
|
235
|
+
m.googleConsent(config.webBase),
|
|
184
236
|
].join('\n');
|
|
185
237
|
}
|
package/dist/resources.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { type ToolManifest } from './lib/package-root.js';
|
|
3
3
|
import { type ToolsetSelection } from './lib/toolsets.js';
|
|
4
|
-
/**
|
|
5
|
-
* `mimi-seed://tools/catalog` 페이로드 — **이 서버에 실제로 등록된 도구만** 담는다.
|
|
6
|
-
*
|
|
7
|
-
* MIMI_SEED_TOOLSETS 로 도메인을 줄였으면 카탈로그도 같이 줄어야 한다 (안 그러면 에이전트가 등록되지 않은
|
|
8
|
-
* 도구를 부르려 한다). 판정은 레지스트라와 같은 `selection.isToolEnabled` 를 쓴다. 폐기 예정 별칭은
|
|
9
|
-
* `tools` 가 아니라 `deprecated`(별칭 → 정식)에, 쓰기/파괴 분류는 `write` / `destructive` 에 싣는다.
|
|
10
|
-
* `total` 은 등록된 도구 수(별칭 포함) = tools/list 길이다.
|
|
11
|
-
*/
|
|
12
4
|
export declare function buildToolCatalog(manifest: ToolManifest, selection: ToolsetSelection): {
|
|
13
5
|
total: number;
|
|
14
6
|
manifestTotal: number;
|
package/dist/resources.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { resolveLang } from '#core/lang.js';
|
|
2
|
+
import { catalog, resolveLang } from '#core/lang.js';
|
|
3
|
+
import { MANIFEST_TEXT_EN } from './i18n/manifest-en.js';
|
|
3
4
|
import { ensureFreshAccessToken } from './auth/google-auth.js';
|
|
4
5
|
import { readPackageRootText, readToolManifest } from './lib/package-root.js';
|
|
5
6
|
import { buildToolIndex } from './lib/tool-registrar.js';
|
|
@@ -9,16 +10,59 @@ import { buildToolMenu, formatToolMenu, selectToolMenu, TOOL_MENU_URI, TOOL_SELE
|
|
|
9
10
|
// 갱신은 `npm run plugin:sync`, 드리프트는 prompts-resources.test.ts 가 잡는다.
|
|
10
11
|
// 읽기 실패는 정상 설치에서 불가능하다(files 화이트리스트에 포함) — 그래서 폴백은 가이드
|
|
11
12
|
// 요약본이 아니라 "깨진 설치" 신호 + 원본 포인터만 담는다. 요약본을 하나 더 관리하지 않는다.
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
const M = catalog({
|
|
14
|
+
agentGuideFallback: [
|
|
15
|
+
'# Mimi Seed agent guide — 자산 누락 (degraded)',
|
|
16
|
+
'',
|
|
17
|
+
'⚠️ 이 설치본에서 assets/agent-guide.md 를 읽지 못했습니다 — 패키지가 손상됐습니다.',
|
|
18
|
+
'`npx -y @yoonion/mimi-seed-mcp` 재설치(필요 시 npx 캐시 정리) 후 새 세션을 여세요.',
|
|
19
|
+
'',
|
|
20
|
+
'가이드 전문: https://github.com/jeonghwanko/mimi-seed-sdk/blob/main/docs/agent-guide.md',
|
|
21
|
+
'최소 안전수칙: 스토어 제출·승격·삭제·공개 게시는 사용자 명시 동의 없이 실행하지 않는다.',
|
|
22
|
+
].join('\n'),
|
|
23
|
+
deferredHint: 'Claude Code 에서는 도구 schema 가 lazy 로드됩니다 — 호출 전 ToolSearch(query="select:<tool,...>") 로 선로드하세요. 상세: mimi-seed://agent/guide',
|
|
24
|
+
noteAll: `모든 도메인이 켜져 있습니다. ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} / ${TOOL_NAMES_ENV} 로 줄일 수 있습니다.`,
|
|
25
|
+
noteSelected: (total) => `선택된 도구를 보여줍니다 (전체 ${total}개). ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} / ${TOOL_NAMES_ENV} 설정을 반영합니다.`,
|
|
26
|
+
legend: {
|
|
27
|
+
total: '이 서버에 등록된 도구 수 (폐기 예정 별칭 포함) = tools/list 길이. manifestTotal 은 toolset 제한 없는 전체.',
|
|
28
|
+
tools: '도메인의 정식 도구 (별칭 제외). write / destructive 어디에도 없으면 읽기 전용.',
|
|
29
|
+
write: '원격/로컬 상태를 바꾸지만 파괴적이지 않은 도구.',
|
|
30
|
+
destructive: '비가역·외부 공개·삭제·덮어쓰기 — confirm: true (일부 도구는 자체 confirmPublish / confirmVisible) 없이 부르면 실행하지 않는다.',
|
|
31
|
+
deprecated: '폐기 예정 별칭 → 정식 도구. 정식 이름으로 부를 것 (다음 minor 에서 제거).',
|
|
32
|
+
},
|
|
33
|
+
manifestUnreadable: 'tool-manifest.json 을 읽지 못했습니다 — 패키지가 손상됐습니다. `npx -y @yoonion/mimi-seed-mcp` 재설치 후 새 세션을 여세요.',
|
|
34
|
+
menuDescription: '사용할 서비스 다중 선택용 텍스트 목록',
|
|
35
|
+
selectionDescription: '쉼표로 구분한 서비스 ID의 정식 도구 이름',
|
|
36
|
+
authDescription: 'Google OAuth 인증 상태 — fresh / refreshed / expired / unauthenticated',
|
|
37
|
+
guideDescription: 'Mimi Seed 에이전트 운영 규약 전문 (docs/agent-guide.md) — deferred 도구 로딩·ToolSearch select: 배치·호출 순서·비가역 액션 안전수칙',
|
|
38
|
+
catalogDescription: '이 서버에 등록된 도구 카탈로그 (MIMI_SEED_TOOLSETS 반영) — 도메인별 도구 목록·쓰기/파괴 분류·폐기 예정 별칭·필요 자격증명·한줄 요약. "mimi-seed 로 뭘 할 수 있어?" 에는 이 리소스를 읽고 답하세요.',
|
|
39
|
+
}, {
|
|
40
|
+
agentGuideFallback: [
|
|
41
|
+
'# Mimi Seed agent guide — asset missing (degraded)',
|
|
42
|
+
'',
|
|
43
|
+
'⚠️ This installation could not read assets/agent-guide.md — the package is corrupted.',
|
|
44
|
+
'Reinstall with `npx -y @yoonion/mimi-seed-mcp` (clear the npx cache if needed), then open a new session.',
|
|
45
|
+
'',
|
|
46
|
+
'Full guide: https://github.com/jeonghwanko/mimi-seed-sdk/blob/main/docs/agent-guide.md',
|
|
47
|
+
'Minimum safety rule: never run a store submission, promotion, deletion, or public post without the user\'s explicit consent.',
|
|
48
|
+
].join('\n'),
|
|
49
|
+
deferredHint: 'In Claude Code, tool schemas are loaded lazily — preload them with ToolSearch(query="select:<tool,...>") before calling. Details: mimi-seed://agent/guide',
|
|
50
|
+
noteAll: `All domains are enabled. Narrow them with ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} / ${TOOL_NAMES_ENV}.`,
|
|
51
|
+
noteSelected: (total) => `Showing the selected tools (${total} in total). Reflects the ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} / ${TOOL_NAMES_ENV} settings.`,
|
|
52
|
+
legend: {
|
|
53
|
+
total: 'Number of tools registered on this server (including deprecated aliases) = tools/list length. manifestTotal is the full count without toolset limits.',
|
|
54
|
+
tools: 'The domain\'s canonical tools (aliases excluded). A tool in neither write nor destructive is read-only.',
|
|
55
|
+
write: 'Tools that change remote/local state but are not destructive.',
|
|
56
|
+
destructive: 'Irreversible, publicly visible, deleting, or overwriting — does not run when called without confirm: true (some tools use their own confirmPublish / confirmVisible).',
|
|
57
|
+
deprecated: 'Deprecated alias → canonical tool. Call the canonical name (removed in the next minor).',
|
|
58
|
+
},
|
|
59
|
+
manifestUnreadable: 'Could not read tool-manifest.json — the package is corrupted. Reinstall with `npx -y @yoonion/mimi-seed-mcp`, then open a new session.',
|
|
60
|
+
menuDescription: 'Text list for choosing one or more services to use',
|
|
61
|
+
selectionDescription: 'Canonical tool names for comma-separated service IDs',
|
|
62
|
+
authDescription: 'Google OAuth authentication status — fresh / refreshed / expired / unauthenticated',
|
|
63
|
+
guideDescription: 'Full Mimi Seed agent operating contract (docs/agent-guide.md) — deferred tool loading, ToolSearch select: batches, call order, safety rules for irreversible actions',
|
|
64
|
+
catalogDescription: 'Catalog of the tools registered on this server (reflects MIMI_SEED_TOOLSETS) — per-domain tool lists, write/destructive classification, deprecated aliases, required credentials, one-line summaries. To answer "What can mimi-seed do?", read this resource.',
|
|
65
|
+
});
|
|
22
66
|
/**
|
|
23
67
|
* `mimi-seed://tools/catalog` 페이로드 — **이 서버에 실제로 등록된 도구만** 담는다.
|
|
24
68
|
*
|
|
@@ -27,7 +71,10 @@ const DEFERRED_HINT = 'Claude Code 에서는 도구 schema 가 lazy 로드됩니
|
|
|
27
71
|
* `tools` 가 아니라 `deprecated`(별칭 → 정식)에, 쓰기/파괴 분류는 `write` / `destructive` 에 싣는다.
|
|
28
72
|
* `total` 은 등록된 도구 수(별칭 포함) = tools/list 길이다.
|
|
29
73
|
*/
|
|
74
|
+
/** manifest 도메인 문구 — 영어 모드면 i18n/manifest-en.ts 번역, 없으면 원문 (누락은 output-i18n.test.ts 가 잡는다). */
|
|
75
|
+
const manifestText = (text) => (resolveLang() === 'en' ? MANIFEST_TEXT_EN[text] ?? text : text);
|
|
30
76
|
export function buildToolCatalog(manifest, selection) {
|
|
77
|
+
const m = M();
|
|
31
78
|
const index = buildToolIndex(manifest);
|
|
32
79
|
const deprecated = {};
|
|
33
80
|
let total = 0;
|
|
@@ -44,9 +91,9 @@ export function buildToolCatalog(manifest, selection) {
|
|
|
44
91
|
}
|
|
45
92
|
return [{
|
|
46
93
|
id,
|
|
47
|
-
label: d.label,
|
|
48
|
-
credential: d.credential,
|
|
49
|
-
summary: d.summary,
|
|
94
|
+
label: manifestText(d.label),
|
|
95
|
+
credential: manifestText(d.credential),
|
|
96
|
+
summary: manifestText(d.summary),
|
|
50
97
|
toolCount: tools.length,
|
|
51
98
|
tools,
|
|
52
99
|
write: tools.filter((name) => index.get(name)?.kind === 'write'),
|
|
@@ -61,40 +108,34 @@ export function buildToolCatalog(manifest, selection) {
|
|
|
61
108
|
enabled: Object.keys(manifest.domains).filter((d) => selection.enabled.has(d)),
|
|
62
109
|
include: selection.include,
|
|
63
110
|
exclude: selection.exclude,
|
|
64
|
-
note: selection.all
|
|
65
|
-
? `모든 도메인이 켜져 있습니다. ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} / ${TOOL_NAMES_ENV} 로 줄일 수 있습니다.`
|
|
66
|
-
: `선택된 도구를 보여줍니다 (전체 ${manifest.total}개). ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} / ${TOOL_NAMES_ENV} 설정을 반영합니다.`,
|
|
111
|
+
note: selection.all ? m.noteAll : m.noteSelected(manifest.total),
|
|
67
112
|
},
|
|
68
|
-
legend:
|
|
69
|
-
|
|
70
|
-
tools: '도메인의 정식 도구 (별칭 제외). write / destructive 어디에도 없으면 읽기 전용.',
|
|
71
|
-
write: '원격/로컬 상태를 바꾸지만 파괴적이지 않은 도구.',
|
|
72
|
-
destructive: '비가역·외부 공개·삭제·덮어쓰기 — confirm: true (일부 도구는 자체 confirmPublish / confirmVisible) 없이 부르면 실행하지 않는다.',
|
|
73
|
-
deprecated: '폐기 예정 별칭 → 정식 도구. 정식 이름으로 부를 것 (다음 minor 에서 제거).',
|
|
74
|
-
},
|
|
75
|
-
deferredHint: DEFERRED_HINT,
|
|
113
|
+
legend: m.legend,
|
|
114
|
+
deferredHint: m.deferredHint,
|
|
76
115
|
deprecated,
|
|
77
116
|
domains,
|
|
78
117
|
};
|
|
79
118
|
}
|
|
80
119
|
export function registerResources(server, options = {}) {
|
|
120
|
+
// 리소스 설명은 등록 시점의 언어로 고정된다. 본문은 읽을 때마다 M() 을 다시 부른다.
|
|
121
|
+
const m = M();
|
|
81
122
|
const getToolMenu = (lang) => {
|
|
82
123
|
const manifest = options.manifest ?? readToolManifest();
|
|
83
124
|
const selection = options.toolsets ?? resolveToolsets(process.env, manifest);
|
|
84
125
|
return buildToolMenu(manifest, selection, lang);
|
|
85
126
|
};
|
|
86
|
-
server.resource('tools-menu', TOOL_MENU_URI, { description:
|
|
127
|
+
server.resource('tools-menu', TOOL_MENU_URI, { description: m.menuDescription, mimeType: 'text/plain' }, async () => {
|
|
87
128
|
const lang = resolveLang();
|
|
88
129
|
return { contents: [{ uri: TOOL_MENU_URI, mimeType: 'text/plain', text: formatToolMenu(getToolMenu(lang), lang) }] };
|
|
89
130
|
});
|
|
90
|
-
server.resource('tools-menu-selection', new ResourceTemplate(TOOL_SELECTION_URI, { list: undefined }), { description:
|
|
131
|
+
server.resource('tools-menu-selection', new ResourceTemplate(TOOL_SELECTION_URI, { list: undefined }), { description: m.selectionDescription, mimeType: 'application/json' }, async (uri, { areas }) => {
|
|
91
132
|
const input = Array.isArray(areas) ? areas.join(',') : (areas ?? '');
|
|
92
133
|
const selected = selectToolMenu(getToolMenu(resolveLang()), decodeURIComponent(input));
|
|
93
134
|
if (!selected)
|
|
94
135
|
throw new Error('Unknown service selection. Read mimi-seed://tools/menu for available services.');
|
|
95
136
|
return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(selected) }] };
|
|
96
137
|
});
|
|
97
|
-
server.resource('auth-status', 'mimi-seed://auth/status', { description:
|
|
138
|
+
server.resource('auth-status', 'mimi-seed://auth/status', { description: m.authDescription, mimeType: 'application/json' }, async () => {
|
|
98
139
|
const r = await ensureFreshAccessToken();
|
|
99
140
|
const ok = r.status === 'fresh' || r.status === 'refreshed';
|
|
100
141
|
return {
|
|
@@ -112,7 +153,7 @@ export function registerResources(server, options = {}) {
|
|
|
112
153
|
};
|
|
113
154
|
});
|
|
114
155
|
server.resource('agent-guide', 'mimi-seed://agent/guide', {
|
|
115
|
-
description:
|
|
156
|
+
description: m.guideDescription,
|
|
116
157
|
mimeType: 'text/markdown',
|
|
117
158
|
}, async () => {
|
|
118
159
|
let text;
|
|
@@ -120,7 +161,7 @@ export function registerResources(server, options = {}) {
|
|
|
120
161
|
text = readPackageRootText('assets/agent-guide.md');
|
|
121
162
|
}
|
|
122
163
|
catch {
|
|
123
|
-
text =
|
|
164
|
+
text = M().agentGuideFallback;
|
|
124
165
|
}
|
|
125
166
|
return {
|
|
126
167
|
contents: [{
|
|
@@ -131,7 +172,7 @@ export function registerResources(server, options = {}) {
|
|
|
131
172
|
};
|
|
132
173
|
});
|
|
133
174
|
server.resource('tools-catalog', 'mimi-seed://tools/catalog', {
|
|
134
|
-
description:
|
|
175
|
+
description: m.catalogDescription,
|
|
135
176
|
mimeType: 'application/json',
|
|
136
177
|
}, async () => {
|
|
137
178
|
// LLM 이 읽는 페이로드라 compact 로 직렬화한다 (pretty 들여쓰기는 ~40% 바이트 낭비).
|
|
@@ -146,7 +187,7 @@ export function registerResources(server, options = {}) {
|
|
|
146
187
|
catch (e) {
|
|
147
188
|
// 가짜 성공(빈 카탈로그)을 서빙하지 않는다 — 깨진 설치임을 명시적으로 알린다.
|
|
148
189
|
payload = JSON.stringify({
|
|
149
|
-
error:
|
|
190
|
+
error: M().manifestUnreadable,
|
|
150
191
|
detail: e instanceof Error ? e.message : String(e),
|
|
151
192
|
total: null,
|
|
152
193
|
domains: [],
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { type Lang } from '#core/lang.js';
|
|
2
3
|
/**
|
|
3
4
|
* 서버 조립 단일 지점 — stdio 엔트리(index.ts)와 tool-manifest 스모크 테스트
|
|
4
5
|
* (src/__tests__/tool-manifest.test.ts)가 공유한다. 새 register 모듈은 반드시
|
|
@@ -6,4 +7,5 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare function buildServer(version: string, options?: {
|
|
8
9
|
env?: NodeJS.ProcessEnv;
|
|
10
|
+
lang?: Lang;
|
|
9
11
|
}): McpServer;
|
package/dist/server.js
CHANGED
|
@@ -28,6 +28,8 @@ import { registerResources } from './resources.js';
|
|
|
28
28
|
import { readToolManifest } from './lib/package-root.js';
|
|
29
29
|
import { resolveToolsets } from './lib/toolsets.js';
|
|
30
30
|
import { createToolRegistrar } from './lib/tool-registrar.js';
|
|
31
|
+
import { localizeToolList, toolTextTranslator } from './lib/tool-text.js';
|
|
32
|
+
import { resolveLang } from '#core/lang.js';
|
|
31
33
|
/**
|
|
32
34
|
* 서버 조립 단일 지점 — stdio 엔트리(index.ts)와 tool-manifest 스모크 테스트
|
|
33
35
|
* (src/__tests__/tool-manifest.test.ts)가 공유한다. 새 register 모듈은 반드시
|
|
@@ -55,7 +57,11 @@ export function buildServer(version, options = {}) {
|
|
|
55
57
|
const toolsets = resolveToolsets(options.env ?? process.env, manifest);
|
|
56
58
|
for (const warning of toolsets.warnings)
|
|
57
59
|
console.error(`[mimi-seed] ${warning}`);
|
|
58
|
-
|
|
60
|
+
// 도구 · 파라미터 설명의 언어 — 도구 메뉴 리소스 · 인증 에러와 같은 규칙(MIMI_SEED_LANG > settings.json > 로캘).
|
|
61
|
+
// 원문은 한국어이고 en 이면 i18n/tools-en 번역표로 바꾼다 (lib/tool-text.ts). 서버 수명 동안 고정이다.
|
|
62
|
+
const toolLang = options.lang ?? resolveLang();
|
|
63
|
+
const translate = toolTextTranslator(toolLang);
|
|
64
|
+
const registrar = createToolRegistrar(server, { manifest, toolsets, translate });
|
|
59
65
|
registerFirebaseTools(registrar);
|
|
60
66
|
registerAdmobTools(registrar);
|
|
61
67
|
registerPlaystoreTools(registrar);
|
|
@@ -80,6 +86,8 @@ export function buildServer(version, options = {}) {
|
|
|
80
86
|
registerYouTubeTools(registrar);
|
|
81
87
|
registerTikTokBusinessTools(registrar);
|
|
82
88
|
registerDriveTools(registrar);
|
|
89
|
+
if (toolLang === 'en')
|
|
90
|
+
localizeToolList(server, translate);
|
|
83
91
|
registerPrompts(server, toolsets, manifest);
|
|
84
92
|
registerResources(server, { manifest, toolsets });
|
|
85
93
|
return server;
|