@yoonion/mimi-seed-mcp 0.25.6 → 0.26.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/README.md +2 -1
- package/assets/agent-guide.md +13 -4
- package/dist/auth/google-auth.js +1 -1
- package/dist/auth/onestore-auth.d.ts +23 -0
- package/dist/auth/onestore-auth.js +162 -0
- package/dist/auth/onestore-setup-cli.d.ts +2 -0
- package/dist/auth/onestore-setup-cli.js +244 -0
- package/dist/auth/scopes.d.ts +5 -0
- package/dist/auth/scopes.js +9 -1
- package/dist/core/console-url.d.ts +2 -2
- package/dist/core/console-url.js +4 -3
- package/dist/core/credential-store.js +2 -2
- package/dist/core/onestore-credentials.d.ts +12 -0
- package/dist/core/onestore-credentials.js +18 -0
- package/dist/core/project-manifest.d.ts +2 -1
- package/dist/i18n/manifest-en.js +4 -1
- package/dist/i18n/tools-en/auth.d.ts +1 -1
- package/dist/i18n/tools-en/auth.js +1 -1
- package/dist/i18n/tools-en/index.js +2 -0
- package/dist/i18n/tools-en/onestore.d.ts +32 -0
- package/dist/i18n/tools-en/onestore.js +31 -0
- package/dist/i18n/tools-en/youtube.d.ts +1 -1
- package/dist/i18n/tools-en/youtube.js +1 -1
- package/dist/index.js +1 -0
- package/dist/lib/human-approval.d.ts +12 -2
- package/dist/lib/human-approval.js +102 -12
- package/dist/lib/tool-menu.js +2 -1
- package/dist/onestore/client.d.ts +28 -0
- package/dist/onestore/client.js +124 -0
- package/dist/onestore/errors.d.ts +5 -0
- package/dist/onestore/errors.js +40 -0
- package/dist/onestore/tools.d.ts +79 -0
- package/dist/onestore/tools.js +163 -0
- package/dist/registers/auth.js +41 -4
- package/dist/registers/onestore.d.ts +2 -0
- package/dist/registers/onestore.js +113 -0
- package/dist/registers/youtube.js +2 -2
- package/dist/server.js +2 -0
- package/npm-shrinkwrap.json +3 -2
- package/package.json +3 -2
- package/tool-manifest.json +33 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { catalog } from '#core/lang.js';
|
|
2
|
+
const M = catalog({
|
|
3
|
+
http: (status) => `원스토어 API 오류 (HTTP ${status})`,
|
|
4
|
+
token: '원스토어 액세스 토큰을 발급받지 못했습니다.',
|
|
5
|
+
transport: '원스토어 응답을 받지 못했습니다.',
|
|
6
|
+
unknownWrite: ' 다시 요청하기 전에 구매 상태를 확인하세요.',
|
|
7
|
+
version: '원스토어 앱 버전 조회 응답 형식이 올바르지 않습니다.',
|
|
8
|
+
}, {
|
|
9
|
+
http: (status) => `ONE store API error (HTTP ${status})`,
|
|
10
|
+
token: 'Failed to issue a ONE store access token.',
|
|
11
|
+
transport: 'No response received from ONE store.',
|
|
12
|
+
unknownWrite: ' Check the purchase state before retrying.',
|
|
13
|
+
version: 'Invalid ONE store app version response.',
|
|
14
|
+
});
|
|
15
|
+
export function formatOnestoreError(status, text) {
|
|
16
|
+
const code = errorCodeOf(text);
|
|
17
|
+
return code ? `${M().http(status)}: ${code}` : M().http(status);
|
|
18
|
+
}
|
|
19
|
+
export function formatTokenError(detail) {
|
|
20
|
+
return detail ? `${M().token} ${detail}` : M().token;
|
|
21
|
+
}
|
|
22
|
+
export function formatTransportError(write) {
|
|
23
|
+
return M().transport + (write ? M().unknownWrite : '');
|
|
24
|
+
}
|
|
25
|
+
export function formatVersionError(status, code, description) {
|
|
26
|
+
if (!code || !/^\d{3}$/.test(code))
|
|
27
|
+
return M().version;
|
|
28
|
+
return [M().http(status), code, description?.slice(0, 300)].filter(Boolean).join(': ');
|
|
29
|
+
}
|
|
30
|
+
export function errorCodeOf(text) {
|
|
31
|
+
try {
|
|
32
|
+
const parsed = JSON.parse(text);
|
|
33
|
+
const code = parsed?.error?.code ?? parsed?.result?.code;
|
|
34
|
+
return typeof code === 'string' && /^[A-Za-z0-9_]{1,64}$/.test(code) ? code : undefined;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// 본문이 JSON이 아니면 error code 를 추출할 수 없다
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type OnestoreCredentials } from '../auth/onestore-auth.js';
|
|
2
|
+
export interface ClientOpts {
|
|
3
|
+
clientId?: string;
|
|
4
|
+
marketCode?: OnestoreCredentials['marketCode'];
|
|
5
|
+
}
|
|
6
|
+
export declare function verifyCredentials(opts?: ClientOpts): Promise<{
|
|
7
|
+
ok: boolean;
|
|
8
|
+
clientId: string;
|
|
9
|
+
packageName: string | undefined;
|
|
10
|
+
environment: import("./client.js").OnestoreEnvironment;
|
|
11
|
+
marketCode: import("./client.js").OnestoreMarketCode;
|
|
12
|
+
host: string;
|
|
13
|
+
expiresIn: number;
|
|
14
|
+
scope: string | undefined;
|
|
15
|
+
tokenType: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function getAppVersion(input: {
|
|
18
|
+
packageName?: string;
|
|
19
|
+
deviceModelCd?: string;
|
|
20
|
+
osVer?: string;
|
|
21
|
+
sdkVersion?: string;
|
|
22
|
+
clientId?: string;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
result?: {
|
|
25
|
+
code?: string;
|
|
26
|
+
desc?: string;
|
|
27
|
+
};
|
|
28
|
+
} | null>;
|
|
29
|
+
export declare function getPurchase(opts: ClientOpts & {
|
|
30
|
+
productId: string;
|
|
31
|
+
purchaseToken: string;
|
|
32
|
+
}): Promise<unknown>;
|
|
33
|
+
export declare function getRecurringPurchase(opts: ClientOpts & {
|
|
34
|
+
productId: string;
|
|
35
|
+
purchaseToken: string;
|
|
36
|
+
}): Promise<unknown>;
|
|
37
|
+
export declare function getSubscription(opts: ClientOpts & {
|
|
38
|
+
productId: string;
|
|
39
|
+
purchaseToken: string;
|
|
40
|
+
}): Promise<unknown>;
|
|
41
|
+
export interface ListQuery {
|
|
42
|
+
continuationKey?: string;
|
|
43
|
+
startTime?: string | number;
|
|
44
|
+
endTime?: string | number;
|
|
45
|
+
maxResults?: number;
|
|
46
|
+
}
|
|
47
|
+
export declare function listVoidedPurchases(opts?: ClientOpts & ListQuery): Promise<unknown>;
|
|
48
|
+
export declare function listUnconfirmedPurchases(opts?: ClientOpts & ListQuery): Promise<unknown>;
|
|
49
|
+
export declare function acknowledgePurchase(opts: ClientOpts & {
|
|
50
|
+
productId: string;
|
|
51
|
+
purchaseToken: string;
|
|
52
|
+
developerPayload?: string;
|
|
53
|
+
}): Promise<unknown>;
|
|
54
|
+
export declare function consumePurchase(opts: ClientOpts & {
|
|
55
|
+
productId: string;
|
|
56
|
+
purchaseToken: string;
|
|
57
|
+
developerPayload?: string;
|
|
58
|
+
}): Promise<unknown>;
|
|
59
|
+
export declare function cancelRecurring(opts: ClientOpts & {
|
|
60
|
+
productId: string;
|
|
61
|
+
purchaseToken: string;
|
|
62
|
+
}): Promise<unknown>;
|
|
63
|
+
export declare function reactivateRecurring(opts: ClientOpts & {
|
|
64
|
+
productId: string;
|
|
65
|
+
purchaseToken: string;
|
|
66
|
+
}): Promise<unknown>;
|
|
67
|
+
export declare function cancelSubscription(opts: ClientOpts & {
|
|
68
|
+
productId: string;
|
|
69
|
+
purchaseToken: string;
|
|
70
|
+
}): Promise<unknown>;
|
|
71
|
+
export declare function reactivateSubscription(opts: ClientOpts & {
|
|
72
|
+
productId: string;
|
|
73
|
+
purchaseToken: string;
|
|
74
|
+
}): Promise<unknown>;
|
|
75
|
+
export declare function deferSubscription(opts: ClientOpts & {
|
|
76
|
+
productId: string;
|
|
77
|
+
purchaseToken: string;
|
|
78
|
+
deferPeriod: number;
|
|
79
|
+
}): Promise<unknown>;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { requireOnestoreCredentials } from '../auth/onestore-auth.js';
|
|
2
|
+
import { APP_VERSION_URL, getAccessToken, iapHost, iapRequest } from './client.js';
|
|
3
|
+
import { formatOnestoreError, formatVersionError } from './errors.js';
|
|
4
|
+
import { fetchWithTimeout } from '../lib/http.js';
|
|
5
|
+
import { encodePathSegment } from '../lib/url-path.js';
|
|
6
|
+
import { catalog } from '#core/lang.js';
|
|
7
|
+
const M = catalog({
|
|
8
|
+
needPackage: 'packageName 이 필요합니다. 인자로 넘기거나 mimi-seed auth onestore 에서 패키지 네임을 저장하세요.',
|
|
9
|
+
needOsVer: 'deviceModelCd 를 쓰면 osVer 도 함께 넣어야 합니다 (원스토어 API 규격).',
|
|
10
|
+
}, {
|
|
11
|
+
needPackage: 'packageName is required. Pass it as an argument or save it with mimi-seed auth onestore.',
|
|
12
|
+
needOsVer: 'When deviceModelCd is set, osVer is also required (ONE store API rule).',
|
|
13
|
+
});
|
|
14
|
+
function creds(opts = {}) {
|
|
15
|
+
const c = requireOnestoreCredentials(opts.clientId);
|
|
16
|
+
return opts.marketCode ? { ...c, marketCode: opts.marketCode } : c;
|
|
17
|
+
}
|
|
18
|
+
export async function verifyCredentials(opts = {}) {
|
|
19
|
+
const c = creds(opts);
|
|
20
|
+
const token = await getAccessToken(c, { force: true });
|
|
21
|
+
return {
|
|
22
|
+
ok: true,
|
|
23
|
+
clientId: token.clientId,
|
|
24
|
+
packageName: c.packageName,
|
|
25
|
+
environment: c.environment,
|
|
26
|
+
marketCode: c.marketCode,
|
|
27
|
+
host: iapHost(c),
|
|
28
|
+
expiresIn: token.expiresIn,
|
|
29
|
+
scope: token.scope,
|
|
30
|
+
tokenType: token.tokenType,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export async function getAppVersion(input) {
|
|
34
|
+
const pkg = input.packageName?.trim() || requireOnestoreCredentials(input.clientId).packageName;
|
|
35
|
+
if (!pkg) {
|
|
36
|
+
throw new Error(M().needPackage);
|
|
37
|
+
}
|
|
38
|
+
if (input.deviceModelCd && !input.osVer) {
|
|
39
|
+
throw new Error(M().needOsVer);
|
|
40
|
+
}
|
|
41
|
+
const url = new URL(APP_VERSION_URL);
|
|
42
|
+
url.searchParams.set('pkgNm', pkg);
|
|
43
|
+
if (input.deviceModelCd)
|
|
44
|
+
url.searchParams.set('deviceModelCd', input.deviceModelCd);
|
|
45
|
+
if (input.osVer)
|
|
46
|
+
url.searchParams.set('osVer', input.osVer);
|
|
47
|
+
if (input.sdkVersion)
|
|
48
|
+
url.searchParams.set('sdkVersion', input.sdkVersion);
|
|
49
|
+
const res = await fetchWithTimeout(url);
|
|
50
|
+
const text = await res.text();
|
|
51
|
+
if (!res.ok)
|
|
52
|
+
throw new Error(formatOnestoreError(res.status, text));
|
|
53
|
+
let response;
|
|
54
|
+
try {
|
|
55
|
+
response = JSON.parse(text);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
throw new Error(formatVersionError(res.status));
|
|
59
|
+
}
|
|
60
|
+
const result = response?.result;
|
|
61
|
+
if (result?.code !== '000') {
|
|
62
|
+
throw new Error(formatVersionError(res.status, result?.code, typeof result?.desc === 'string' ? result.desc : undefined));
|
|
63
|
+
}
|
|
64
|
+
return response;
|
|
65
|
+
}
|
|
66
|
+
function purchasePath(kind, clientId, productId, token, suffix = '') {
|
|
67
|
+
return `/v7/apps/${encodePathSegment(clientId)}/purchases/${kind}/products/${encodePathSegment(productId)}/${encodePathSegment(token)}${suffix}`;
|
|
68
|
+
}
|
|
69
|
+
export async function getPurchase(opts) {
|
|
70
|
+
const c = creds(opts);
|
|
71
|
+
return iapRequest({ creds: c, path: purchasePath('inapp', c.clientId, opts.productId, opts.purchaseToken) });
|
|
72
|
+
}
|
|
73
|
+
export async function getRecurringPurchase(opts) {
|
|
74
|
+
const c = creds(opts);
|
|
75
|
+
return iapRequest({ creds: c, path: purchasePath('auto', c.clientId, opts.productId, opts.purchaseToken) });
|
|
76
|
+
}
|
|
77
|
+
export async function getSubscription(opts) {
|
|
78
|
+
const c = creds(opts);
|
|
79
|
+
return iapRequest({ creds: c, path: purchasePath('subscription', c.clientId, opts.productId, opts.purchaseToken) });
|
|
80
|
+
}
|
|
81
|
+
function listQuery(q) {
|
|
82
|
+
return {
|
|
83
|
+
continuationKey: q.continuationKey,
|
|
84
|
+
startTime: q.startTime,
|
|
85
|
+
endTime: q.endTime,
|
|
86
|
+
maxResults: q.maxResults,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export async function listVoidedPurchases(opts = {}) {
|
|
90
|
+
const c = creds(opts);
|
|
91
|
+
return iapRequest({
|
|
92
|
+
creds: c,
|
|
93
|
+
path: `/v7/apps/${encodePathSegment(c.clientId)}/voided-purchases`,
|
|
94
|
+
query: listQuery(opts),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
export async function listUnconfirmedPurchases(opts = {}) {
|
|
98
|
+
const c = creds(opts);
|
|
99
|
+
return iapRequest({
|
|
100
|
+
creds: c,
|
|
101
|
+
path: `/v7/apps/${encodePathSegment(c.clientId)}/unconfirmed-purchases`,
|
|
102
|
+
query: listQuery(opts),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export async function acknowledgePurchase(opts) {
|
|
106
|
+
const c = creds(opts);
|
|
107
|
+
return iapRequest({
|
|
108
|
+
creds: c,
|
|
109
|
+
method: 'POST',
|
|
110
|
+
path: purchasePath('all', c.clientId, opts.productId, opts.purchaseToken, '/acknowledge'),
|
|
111
|
+
jsonBody: opts.developerPayload !== undefined ? { developerPayload: opts.developerPayload } : undefined,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
export async function consumePurchase(opts) {
|
|
115
|
+
const c = creds(opts);
|
|
116
|
+
return iapRequest({
|
|
117
|
+
creds: c,
|
|
118
|
+
method: 'POST',
|
|
119
|
+
path: purchasePath('inapp', c.clientId, opts.productId, opts.purchaseToken, '/consume'),
|
|
120
|
+
jsonBody: opts.developerPayload !== undefined ? { developerPayload: opts.developerPayload } : undefined,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
export async function cancelRecurring(opts) {
|
|
124
|
+
const c = creds(opts);
|
|
125
|
+
return iapRequest({
|
|
126
|
+
creds: c,
|
|
127
|
+
method: 'POST',
|
|
128
|
+
path: purchasePath('auto', c.clientId, opts.productId, opts.purchaseToken, '/cancel'),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
export async function reactivateRecurring(opts) {
|
|
132
|
+
const c = creds(opts);
|
|
133
|
+
return iapRequest({
|
|
134
|
+
creds: c,
|
|
135
|
+
method: 'POST',
|
|
136
|
+
path: purchasePath('auto', c.clientId, opts.productId, opts.purchaseToken, '/reactivate'),
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
export async function cancelSubscription(opts) {
|
|
140
|
+
const c = creds(opts);
|
|
141
|
+
return iapRequest({
|
|
142
|
+
creds: c,
|
|
143
|
+
method: 'POST',
|
|
144
|
+
path: purchasePath('subscription', c.clientId, opts.productId, opts.purchaseToken, '/cancel'),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
export async function reactivateSubscription(opts) {
|
|
148
|
+
const c = creds(opts);
|
|
149
|
+
return iapRequest({
|
|
150
|
+
creds: c,
|
|
151
|
+
method: 'POST',
|
|
152
|
+
path: purchasePath('subscription', c.clientId, opts.productId, opts.purchaseToken, '/reactivate'),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
export async function deferSubscription(opts) {
|
|
156
|
+
const c = creds(opts);
|
|
157
|
+
return iapRequest({
|
|
158
|
+
creds: c,
|
|
159
|
+
method: 'POST',
|
|
160
|
+
path: purchasePath('subscription', c.clientId, opts.productId, opts.purchaseToken, '/defer'),
|
|
161
|
+
jsonBody: { deferPeriod: opts.deferPeriod },
|
|
162
|
+
});
|
|
163
|
+
}
|
package/dist/registers/auth.js
CHANGED
|
@@ -9,6 +9,7 @@ import { classifyError } from '../auth/errors.js';
|
|
|
9
9
|
import { startAuth, ensureFreshAccessToken, getTokensLastRefreshMs, getStoredTokens, resolveAccountEmail, } from '../auth/google-auth.js';
|
|
10
10
|
import { AUTH_DOMAINS, DOMAIN_IDS, summarizeGrantedDomains } from '../auth/scopes.js';
|
|
11
11
|
import { listRegisteredServiceAccounts } from '../auth/playstore-auth.js';
|
|
12
|
+
import { listOnestoreCredentialFiles } from '../auth/onestore-auth.js';
|
|
12
13
|
import { getAppStoreCredentials } from '../appstore/auth.js';
|
|
13
14
|
import { loadJenkinsConfig } from '../jenkins/config.js';
|
|
14
15
|
import { loadCiConfig } from '../ci/config.js';
|
|
@@ -53,6 +54,9 @@ const A = catalog({
|
|
|
53
54
|
playstore: (svc) => svc.packageName
|
|
54
55
|
? `setup_playstore_connection(packageName="${svc.packageName}")`
|
|
55
56
|
: 'setup_playstore_connection(packageName=...)',
|
|
57
|
+
onestore: (svc) => svc.clientId
|
|
58
|
+
? `mimi-seed auth onestore --client-id ${svc.clientId}`
|
|
59
|
+
: 'mimi-seed auth onestore',
|
|
56
60
|
appstore: () => 'npx -y @yoonion/mimi-seed-mcp mimi-seed-appstore-auth',
|
|
57
61
|
jenkins: () => 'claude mcp add <your-jenkins-mcp> -s user (개인 자격증명 — .mcp.json 금지)',
|
|
58
62
|
},
|
|
@@ -68,12 +72,15 @@ const A = catalog({
|
|
|
68
72
|
oauthOk: (account, min, label) => `✅ Google OAuth — 연결됨 (${account}, ${min}분 남음, ${label})`,
|
|
69
73
|
oauthMissing: '❌ Google OAuth — 미연결 → mimi_seed_auth_start',
|
|
70
74
|
youtubeUpload: '✅ YouTube — 업로드·상태 관리 권한 연결됨',
|
|
71
|
-
youtubeRead: '✅ YouTube —
|
|
75
|
+
youtubeRead: '✅ YouTube — 채널·영상 읽기 권한 연결됨',
|
|
72
76
|
youtubeMissing: '❌ YouTube — 미연결 → mimi_seed_auth_start(profile="youtube", domains=["youtube"]) (선택)',
|
|
73
77
|
youtubeProfiles: (list, first) => `✅ YouTube — 업로드 권한 연결됨 (프로필 ${list}) — youtube_* 도구에 profile="${first}" 를 넘기세요`,
|
|
74
78
|
playOk: (count, detail) => `✅ Play Store SA — ${count}개 등록 (${detail})`,
|
|
75
79
|
playBroken: (broken, total, names) => `⚠️ Play Store SA — ${total}개 중 ${broken}개를 읽을 수 없음 (${names}) — 그 패키지는 SA 로 동작하지 않는다. setup_playstore_connection 으로 다시 등록`,
|
|
76
80
|
playMissing: '⚠️ Play Store SA — 미설정 (선택 — 로컬은 OAuth 로 가능, CI/헤드리스는 필수) → setup_playstore_connection',
|
|
81
|
+
onestoreOk: (detail) => `✅ ONE store — 연결됨 (${detail})`,
|
|
82
|
+
onestoreBroken: (broken, total, names) => `⚠️ ONE store — ${total}개 중 ${broken}개를 읽을 수 없음 (${names}) — mimi-seed auth onestore 로 다시 등록`,
|
|
83
|
+
onestoreMissing: '⚠️ ONE store — 미설정 (선택 — 원스토어 IAP) → mimi-seed auth onestore',
|
|
77
84
|
ascOk: (keyId) => `✅ App Store Connect — 연결됨 (keyId: ${keyId})`,
|
|
78
85
|
ascMissing: '❌ App Store Connect — 미설정 → npx -y @yoonion/mimi-seed-mcp mimi-seed-appstore-auth',
|
|
79
86
|
jenkinsOk: (url) => `✅ Jenkins — 연결됨 (${url})`,
|
|
@@ -153,6 +160,9 @@ const A = catalog({
|
|
|
153
160
|
playstore: (svc) => svc.packageName
|
|
154
161
|
? `setup_playstore_connection(packageName="${svc.packageName}")`
|
|
155
162
|
: 'setup_playstore_connection(packageName=...)',
|
|
163
|
+
onestore: (svc) => svc.clientId
|
|
164
|
+
? `mimi-seed auth onestore --client-id ${svc.clientId}`
|
|
165
|
+
: 'mimi-seed auth onestore',
|
|
156
166
|
appstore: () => 'npx -y @yoonion/mimi-seed-mcp mimi-seed-appstore-auth',
|
|
157
167
|
jenkins: () => 'claude mcp add <your-jenkins-mcp> -s user (personal credentials — never in .mcp.json)',
|
|
158
168
|
},
|
|
@@ -167,12 +177,15 @@ const A = catalog({
|
|
|
167
177
|
oauthOk: (account, min, label) => `✅ Google OAuth — connected (${account}, ${min} min left, ${label})`,
|
|
168
178
|
oauthMissing: '❌ Google OAuth — not connected → mimi_seed_auth_start',
|
|
169
179
|
youtubeUpload: '✅ YouTube — upload and status management permission connected',
|
|
170
|
-
youtubeRead: '✅ YouTube — channel
|
|
180
|
+
youtubeRead: '✅ YouTube — channel and video read permission connected',
|
|
171
181
|
youtubeMissing: '❌ YouTube — not connected → mimi_seed_auth_start(profile="youtube", domains=["youtube"]) (optional)',
|
|
172
182
|
youtubeProfiles: (list, first) => `✅ YouTube — upload permission connected (profile ${list}) — pass profile="${first}" to youtube_* tools`,
|
|
173
183
|
playOk: (count, detail) => `✅ Play Store SA — ${count} registered (${detail})`,
|
|
174
184
|
playBroken: (broken, total, names) => `⚠️ Play Store SA — ${broken} of ${total} cannot be read (${names}) — those packages won't work with an SA. Re-register with setup_playstore_connection`,
|
|
175
185
|
playMissing: '⚠️ Play Store SA — not set up (optional — OAuth works locally; required for CI/headless) → setup_playstore_connection',
|
|
186
|
+
onestoreOk: (detail) => `✅ ONE store — connected (${detail})`,
|
|
187
|
+
onestoreBroken: (broken, total, names) => `⚠️ ONE store — ${broken} of ${total} cannot be read (${names}) — re-register with mimi-seed auth onestore`,
|
|
188
|
+
onestoreMissing: '⚠️ ONE store — not set up (optional — ONE store IAP) → mimi-seed auth onestore',
|
|
176
189
|
ascOk: (keyId) => `✅ App Store Connect — connected (keyId: ${keyId})`,
|
|
177
190
|
ascMissing: '❌ App Store Connect — not set up → npx -y @yoonion/mimi-seed-mcp mimi-seed-appstore-auth',
|
|
178
191
|
jenkinsOk: (url) => `✅ Jenkins — connected (${url})`,
|
|
@@ -289,6 +302,12 @@ function manifestServiceDetail(id, svc) {
|
|
|
289
302
|
if (svc.packageName)
|
|
290
303
|
parts.push(svc.packageName);
|
|
291
304
|
}
|
|
305
|
+
else if (id === 'onestore') {
|
|
306
|
+
if (svc.clientId)
|
|
307
|
+
parts.push(svc.clientId);
|
|
308
|
+
if (svc.packageName)
|
|
309
|
+
parts.push(svc.packageName);
|
|
310
|
+
}
|
|
292
311
|
else if (id === 'appstore') {
|
|
293
312
|
if (svc.keyId)
|
|
294
313
|
parts.push(`keyId ${svc.keyId}`);
|
|
@@ -354,7 +373,7 @@ export function registerAuthTools(server) {
|
|
|
354
373
|
lines.push(m.oauthMissing);
|
|
355
374
|
}
|
|
356
375
|
const grantedDomains = summarizeGrantedDomains(getStoredTokens()?.scope).granted;
|
|
357
|
-
const youtubeGranted = grantedDomains.includes('youtube') || grantedDomains.includes('
|
|
376
|
+
const youtubeGranted = grantedDomains.includes('youtube') || grantedDomains.includes('youtube_readonly');
|
|
358
377
|
if (youtubeGranted && (oauthResult.status === 'fresh' || oauthResult.status === 'refreshed')) {
|
|
359
378
|
lines.push(grantedDomains.includes('youtube')
|
|
360
379
|
? m.youtubeUpload
|
|
@@ -389,6 +408,18 @@ export function registerAuthTools(server) {
|
|
|
389
408
|
// (helpers.ts requirePlayStoreAuth 가 SA → OAuth 로 폴백한다.) "필수"로 표기하면 안 된다.
|
|
390
409
|
lines.push(m.playMissing);
|
|
391
410
|
}
|
|
411
|
+
// 2b. ONE store IAP
|
|
412
|
+
const oneCreds = listOnestoreCredentialFiles();
|
|
413
|
+
const unreadableOne = oneCreds.filter((c) => !c.readable);
|
|
414
|
+
if (unreadableOne.length > 0) {
|
|
415
|
+
lines.push(m.onestoreBroken(unreadableOne.length, oneCreds.length, unreadableOne.map((c) => c.clientId).join(', ')));
|
|
416
|
+
}
|
|
417
|
+
else if (oneCreds.length > 0) {
|
|
418
|
+
lines.push(m.onestoreOk(oneCreds.map((c) => c.clientId).join(', ')));
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
lines.push(m.onestoreMissing);
|
|
422
|
+
}
|
|
392
423
|
// 3. App Store Connect
|
|
393
424
|
const asc = getAppStoreCredentials();
|
|
394
425
|
if (asc) {
|
|
@@ -525,10 +556,14 @@ export function registerAuthTools(server) {
|
|
|
525
556
|
const oauthOk = oauthResult.status === 'fresh' || oauthResult.status === 'refreshed';
|
|
526
557
|
const playstoreCovers = (pkg) => saCount > 0 &&
|
|
527
558
|
(!pkg || !!saInfo.default || saInfo.perPackage.some((p) => p.packageName === pkg));
|
|
559
|
+
const onestoreFiles = listOnestoreCredentialFiles().filter((c) => c.readable);
|
|
560
|
+
const onestoreCovers = (clientId) => onestoreFiles.length > 0 &&
|
|
561
|
+
(!clientId || onestoreFiles.some((c) => c.clientId === clientId));
|
|
528
562
|
const state = {
|
|
529
563
|
oauth: oauthOk,
|
|
530
564
|
bigquery: !!bqAuth,
|
|
531
565
|
playstore: playstoreCovers(),
|
|
566
|
+
onestore: onestoreCovers(),
|
|
532
567
|
appstore: !!asc,
|
|
533
568
|
jenkins: !!jenkins,
|
|
534
569
|
};
|
|
@@ -537,7 +572,9 @@ export function registerAuthTools(server) {
|
|
|
537
572
|
let anyMissing = false;
|
|
538
573
|
for (const [id, svc] of manifestServiceEntries(loaded.manifest)) {
|
|
539
574
|
const required = svc.required !== false;
|
|
540
|
-
const connected = id === 'playstore' ? playstoreCovers(svc.packageName)
|
|
575
|
+
const connected = id === 'playstore' ? playstoreCovers(svc.packageName)
|
|
576
|
+
: id === 'onestore' ? onestoreCovers(svc.clientId)
|
|
577
|
+
: state[id];
|
|
541
578
|
reqLines.push(renderManifestLine(id, svc, connected, required));
|
|
542
579
|
if (required && !connected)
|
|
543
580
|
anyMissing = true;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { androidPackageName } from '../lib/package-name.js';
|
|
3
|
+
import { jsonResult } from '../lib/mcp-response.js';
|
|
4
|
+
import * as tools from '../onestore/tools.js';
|
|
5
|
+
const clientId = z
|
|
6
|
+
.string()
|
|
7
|
+
.optional()
|
|
8
|
+
.describe('저장된 자격증명 중 고를 앱의 client_id (PID 또는 2025-03-20 이전 앱의 패키지명). 생략하면 ~/.mimi-seed/onestore.json');
|
|
9
|
+
const marketCode = z
|
|
10
|
+
.enum(['MKT_ONE', 'MKT_GLB'])
|
|
11
|
+
.optional()
|
|
12
|
+
.describe('마켓 구분 코드. 생략하면 저장된 값(기본 MKT_ONE)');
|
|
13
|
+
const productId = z.string().describe('인앱 상품 ID');
|
|
14
|
+
const purchaseToken = z.string().describe('원스토어 구매 토큰');
|
|
15
|
+
const developerPayload = z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('구매 요청 때 전달한 developerPayload. 값이 다르면 DeveloperPayloadNotMatch');
|
|
19
|
+
const continuationKey = z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('이전 응답의 continuationKey. 있으면 다음 페이지를 요청한다');
|
|
23
|
+
const startTime = z.string().optional().describe('검색 시작 시각 (밀리초). 현재 기준 과거 1개월까지');
|
|
24
|
+
const endTime = z.string().optional().describe('검색 종료 시각 (밀리초). 현재 시각보다 클 수 없다');
|
|
25
|
+
const maxResults = z.number().int().optional().describe('최대 조회 건수 (기본 100, 1–100)');
|
|
26
|
+
const productTokenShape = { productId, purchaseToken, clientId, marketCode };
|
|
27
|
+
export function registerOnestoreTools(r) {
|
|
28
|
+
r.tool('onestore_verify_credentials', '원스토어 OAuth client_credentials 로 액세스 토큰을 발급해 자격증명을 확인한다. 시크릿은 반환하지 않는다. client_id·client_secret 은 ONEconsole 라이선스 관리에서 받는다.', { clientId, marketCode }, async (args) => jsonResult(await tools.verifyCredentials({
|
|
29
|
+
clientId: args.clientId,
|
|
30
|
+
marketCode: args.marketCode,
|
|
31
|
+
})));
|
|
32
|
+
r.tool('onestore_get_app_version', '이미 출시된 앱의 패키지 네임으로 PID, 버전명, 버전코드, 상품명을 조회한다. 인증이 필요 없는 공개 API. 패키지 네임을 생략하면 저장된 packageName 을 쓴다.', {
|
|
33
|
+
packageName: androidPackageName.optional().describe('조회할 앱의 패키지 네임. 생략하면 저장된 packageName'),
|
|
34
|
+
deviceModelCd: z.string().optional().describe('단말 모델명 (선택). 넣으면 osVer 도 필수'),
|
|
35
|
+
osVer: z.string().optional().describe('단말 OS 버전 (deviceModelCd 와 함께)'),
|
|
36
|
+
sdkVersion: z.string().optional().describe('단말 SDK 버전 (선택)'),
|
|
37
|
+
clientId,
|
|
38
|
+
}, async (args) => jsonResult(await tools.getAppVersion({
|
|
39
|
+
packageName: args.packageName,
|
|
40
|
+
deviceModelCd: args.deviceModelCd,
|
|
41
|
+
osVer: args.osVer,
|
|
42
|
+
sdkVersion: args.sdkVersion,
|
|
43
|
+
clientId: args.clientId,
|
|
44
|
+
})));
|
|
45
|
+
r.tool('onestore_get_purchase', '관리형 인앱 상품의 구매 상세를 조회한다 (getPurchaseDetails). 월정액 토큰으로 호출하면 NoSuchData.', productTokenShape, async (args) => jsonResult(await tools.getPurchase({
|
|
46
|
+
productId: args.productId,
|
|
47
|
+
purchaseToken: args.purchaseToken,
|
|
48
|
+
clientId: args.clientId,
|
|
49
|
+
marketCode: args.marketCode,
|
|
50
|
+
})));
|
|
51
|
+
r.tool('onestore_get_recurring_purchase', '월정액(auto) 상품의 구매 상세를 조회한다 (getRecurringPurchaseDetails). 구독형 토큰으로 호출하면 NoSuchData.', productTokenShape, async (args) => jsonResult(await tools.getRecurringPurchase({
|
|
52
|
+
productId: args.productId,
|
|
53
|
+
purchaseToken: args.purchaseToken,
|
|
54
|
+
clientId: args.clientId,
|
|
55
|
+
marketCode: args.marketCode,
|
|
56
|
+
})));
|
|
57
|
+
r.tool('onestore_get_subscription', '구독형 상품의 구독 상세를 조회한다 (getSubscriptionDetail).', productTokenShape, async (args) => jsonResult(await tools.getSubscription({
|
|
58
|
+
productId: args.productId,
|
|
59
|
+
purchaseToken: args.purchaseToken,
|
|
60
|
+
clientId: args.clientId,
|
|
61
|
+
marketCode: args.marketCode,
|
|
62
|
+
})));
|
|
63
|
+
r.tool('onestore_list_voided_purchases', '구매 취소 내역을 조회한다 (getVoidedPurchases). startTime·endTime 은 밀리초. 현재 시각 기준 과거 1개월 제한.', { clientId, marketCode, continuationKey, startTime, endTime, maxResults }, async (args) => jsonResult(await tools.listVoidedPurchases(args)));
|
|
64
|
+
r.tool('onestore_list_unconfirmed_purchases', '구매확인(acknowledge 또는 consume)이 아직 안 된 구매 목록을 조회한다 (getUnconfirmedPurchases).', { clientId, marketCode, continuationKey, startTime, endTime, maxResults }, async (args) => jsonResult(await tools.listUnconfirmedPurchases(args)));
|
|
65
|
+
r.tool('onestore_acknowledge_purchase', '관리형 또는 월정액 구매를 구매확인 한다 (acknowledgePurchase). 3일 안에 확인하지 않으면 원스토어가 자동 취소한다. consume 된 건은 이미 확인으로 본다. confirm: true 필요.', { ...productTokenShape, developerPayload }, async (args) => jsonResult(await tools.acknowledgePurchase({
|
|
66
|
+
productId: args.productId,
|
|
67
|
+
purchaseToken: args.purchaseToken,
|
|
68
|
+
clientId: args.clientId,
|
|
69
|
+
marketCode: args.marketCode,
|
|
70
|
+
developerPayload: args.developerPayload,
|
|
71
|
+
})));
|
|
72
|
+
r.tool('onestore_consume_purchase', '관리형 인앱 상품을 소비 처리한다 (consumePurchase). 재구매를 열려면 소비가 필요하다. confirm: true 필요.', { ...productTokenShape, developerPayload }, async (args) => jsonResult(await tools.consumePurchase({
|
|
73
|
+
productId: args.productId,
|
|
74
|
+
purchaseToken: args.purchaseToken,
|
|
75
|
+
clientId: args.clientId,
|
|
76
|
+
marketCode: args.marketCode,
|
|
77
|
+
developerPayload: args.developerPayload,
|
|
78
|
+
})));
|
|
79
|
+
r.tool('onestore_cancel_recurring', '월정액 상품의 자동결제를 해지 요청한다 (cancelRecurringPurchase). 구독형 토큰이면 NoSuchData. confirm: true 필요.', productTokenShape, async (args) => jsonResult(await tools.cancelRecurring({
|
|
80
|
+
productId: args.productId,
|
|
81
|
+
purchaseToken: args.purchaseToken,
|
|
82
|
+
clientId: args.clientId,
|
|
83
|
+
marketCode: args.marketCode,
|
|
84
|
+
})));
|
|
85
|
+
r.tool('onestore_reactivate_recurring', '월정액 상품의 자동결제 해지 요청을 취소한다 (reactiveRecurringPurchase). 구독형 토큰이면 NoSuchData. confirm: true 필요.', productTokenShape, async (args) => jsonResult(await tools.reactivateRecurring({
|
|
86
|
+
productId: args.productId,
|
|
87
|
+
purchaseToken: args.purchaseToken,
|
|
88
|
+
clientId: args.clientId,
|
|
89
|
+
marketCode: args.marketCode,
|
|
90
|
+
})));
|
|
91
|
+
r.tool('onestore_cancel_subscription', '구독형 상품의 자동결제를 해지 요청한다 (cancelSubscription). confirm: true 필요.', productTokenShape, async (args) => jsonResult(await tools.cancelSubscription({
|
|
92
|
+
productId: args.productId,
|
|
93
|
+
purchaseToken: args.purchaseToken,
|
|
94
|
+
clientId: args.clientId,
|
|
95
|
+
marketCode: args.marketCode,
|
|
96
|
+
})));
|
|
97
|
+
r.tool('onestore_reactivate_subscription', '구독형 상품의 해지 요청을 취소한다 (reactivateSubscription). 이미 즉시 해지된 건은 되돌릴 수 없다. confirm: true 필요.', productTokenShape, async (args) => jsonResult(await tools.reactivateSubscription({
|
|
98
|
+
productId: args.productId,
|
|
99
|
+
purchaseToken: args.purchaseToken,
|
|
100
|
+
clientId: args.clientId,
|
|
101
|
+
marketCode: args.marketCode,
|
|
102
|
+
})));
|
|
103
|
+
r.tool('onestore_defer_subscription', '구독형 상품의 다음 결제일을 연기한다 (deferSubscription). deferPeriod 는 상용에서 일(1–365), 샌드박스에서 분. confirm: true 필요.', {
|
|
104
|
+
...productTokenShape,
|
|
105
|
+
deferPeriod: z.number().int().describe('연기 기간. 상용: 일(1–365). 샌드박스: 분'),
|
|
106
|
+
}, async (args) => jsonResult(await tools.deferSubscription({
|
|
107
|
+
productId: args.productId,
|
|
108
|
+
purchaseToken: args.purchaseToken,
|
|
109
|
+
deferPeriod: args.deferPeriod,
|
|
110
|
+
clientId: args.clientId,
|
|
111
|
+
marketCode: args.marketCode,
|
|
112
|
+
})));
|
|
113
|
+
}
|
|
@@ -10,7 +10,7 @@ import { listYouTubeComments, listYouTubeCommentReplies, replyToYouTubeComment }
|
|
|
10
10
|
import { getYouTubeContentInsights } from '../youtube/insights.js';
|
|
11
11
|
const profile = z.string().regex(GOOGLE_PROFILE_ID).optional().describe('Google 로그인 프로필. 지정하면 이 프로필만 사용합니다.');
|
|
12
12
|
const expectedChannelId = z.string().regex(YOUTUBE_CHANNEL_ID).optional().describe('조회 대상 채널 ID. 인증된 채널과 일치해야 합니다.');
|
|
13
|
-
const readScope = AUTH_DOMAINS.
|
|
13
|
+
const readScope = AUTH_DOMAINS.youtube_readonly.scopes[0];
|
|
14
14
|
const analyticsScope = AUTH_DOMAINS.youtube_analytics.scopes[1];
|
|
15
15
|
const writeChannelId = z.string().regex(YOUTUBE_CHANNEL_ID).describe('필수: 수정할 영상의 소유 채널 ID. 인증된 채널과 일치해야 합니다.');
|
|
16
16
|
const videoId = z.string().min(1).max(64).describe('수정할 YouTube video ID');
|
|
@@ -19,7 +19,7 @@ async function requireYouTubeReadAuth(selectedProfile) {
|
|
|
19
19
|
return requireAuth(granted.includes(YOUTUBE_SCOPE) ? YOUTUBE_SCOPE : readScope, selectedProfile);
|
|
20
20
|
}
|
|
21
21
|
export function registerYouTubeTools(server) {
|
|
22
|
-
server.tool('youtube_get_channel', '인증된 YouTube 채널의 기본 정보·통계·업로드 플레이리스트를 조회합니다.
|
|
22
|
+
server.tool('youtube_get_channel', '인증된 YouTube 채널의 기본 정보·통계·업로드 플레이리스트를 조회합니다. youtube_readonly, youtube_analytics 또는 youtube 권한이 필요합니다.', { profile, expectedChannelId }, async ({ profile, expectedChannelId }) => jsonResult(await getYouTubeChannel(await requireYouTubeReadAuth(profile), expectedChannelId)));
|
|
23
23
|
server.tool('youtube_list_videos', '인증된 채널의 업로드 플레이리스트에서 영상을 한 페이지 조회합니다. 다음 페이지는 반환된 nextPageToken을 사용하세요.', {
|
|
24
24
|
profile, expectedChannelId,
|
|
25
25
|
maxResults: z.number().int().min(1).max(50).default(25).describe('한 페이지 영상 수 (1–50)'),
|
package/dist/server.js
CHANGED
|
@@ -2,6 +2,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import { registerFirebaseTools } from './registers/firebase.js';
|
|
3
3
|
import { registerAdmobTools } from './registers/admob.js';
|
|
4
4
|
import { registerPlaystoreTools } from './registers/playstore.js';
|
|
5
|
+
import { registerOnestoreTools } from './registers/onestore.js';
|
|
5
6
|
import { registerIamTools } from './registers/iam.js';
|
|
6
7
|
import { registerBillingTools } from './registers/billing.js';
|
|
7
8
|
import { registerAppstoreTools } from './registers/appstore.js';
|
|
@@ -67,6 +68,7 @@ export function buildServer(version, options = {}) {
|
|
|
67
68
|
registerFirebaseTools(registrar);
|
|
68
69
|
registerAdmobTools(registrar);
|
|
69
70
|
registerPlaystoreTools(registrar);
|
|
71
|
+
registerOnestoreTools(registrar);
|
|
70
72
|
registerIamTools(registrar);
|
|
71
73
|
registerBillingTools(registrar);
|
|
72
74
|
registerAppstoreTools(registrar);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoonion/mimi-seed-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@yoonion/mimi-seed-mcp",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.26.0",
|
|
10
10
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@googleapis/admob": "^11.0.1",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"mimi-seed-googleads-auth": "dist/googleads/setup-cli.js",
|
|
44
44
|
"mimi-seed-jenkins-auth": "dist/jenkins/setup-cli.js",
|
|
45
45
|
"mimi-seed-mcp": "dist/index.js",
|
|
46
|
+
"mimi-seed-onestore-auth": "dist/auth/onestore-setup-cli.js",
|
|
46
47
|
"mimi-seed-playstore-auth": "dist/auth/playstore-setup-cli.js",
|
|
47
48
|
"mimi-seed-release-doctor": "dist/checks/release-doctor-cli.js",
|
|
48
49
|
"mimi-seed-social-auth": "dist/social/setup-cli.js",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoonion/mimi-seed-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Mimi Seed MCP server
|
|
3
|
+
"version": "0.26.0",
|
|
4
|
+
"description": "Mimi Seed MCP server — Firebase + AdMob + Google Play + App Store management for Claude Code / Codex / Cursor / any MCP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
7
7
|
"#core/*": "./dist/core/*"
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"mimi-seed-auth": "dist/auth/cli.js",
|
|
12
12
|
"mimi-seed-appstore-auth": "dist/appstore/setup-cli.js",
|
|
13
13
|
"mimi-seed-playstore-auth": "dist/auth/playstore-setup-cli.js",
|
|
14
|
+
"mimi-seed-onestore-auth": "dist/auth/onestore-setup-cli.js",
|
|
14
15
|
"mimi-seed-bigquery-auth": "dist/auth/bigquery-setup-cli.js",
|
|
15
16
|
"mimi-seed-drive-auth": "dist/auth/drive-setup-cli.js",
|
|
16
17
|
"mimi-seed-jenkins-auth": "dist/jenkins/setup-cli.js",
|