@yoonion/mimi-seed-mcp 0.3.34 → 0.3.35

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/LICENSE CHANGED
@@ -1,75 +1,75 @@
1
- # PolyForm Noncommercial License 1.0.0
2
-
3
- <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
-
5
- Required Notice: Copyright 2026 Pryzm GG (https://mimi-seed.pryzm.gg)
6
-
7
- ## Acceptance
8
-
9
- In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
10
-
11
- ## Copyright License
12
-
13
- The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
14
-
15
- ## Distribution License
16
-
17
- The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
18
-
19
- ## Notices
20
-
21
- You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
22
-
23
- > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
24
-
25
- ## Changes and New Works License
26
-
27
- The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
28
-
29
- ## Patent License
30
-
31
- The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
32
-
33
- ## Noncommercial Purposes
34
-
35
- Any noncommercial purpose is a permitted purpose.
36
-
37
- ## Personal Uses
38
-
39
- Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
40
-
41
- ## Noncommercial Organizations
42
-
43
- Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
44
-
45
- ## Fair Use
46
-
47
- You may have "fair use" rights for the software under the law. These terms do not limit them.
48
-
49
- ## No Other Rights
50
-
51
- These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
52
-
53
- ## Patent Defense
54
-
55
- If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
56
-
57
- ## Violations
58
-
59
- The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
60
-
61
- ## No Liability
62
-
63
- ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
64
-
65
- ## Definitions
66
-
67
- The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
68
-
69
- **You** refers to the individual or entity agreeing to these terms.
70
-
71
- **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
72
-
73
- **Your licenses** are all the licenses granted to you for the software under these terms.
74
-
75
- **Use** means anything you do with the software requiring one of your licenses.
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ Required Notice: Copyright 2026 Pryzm GG (https://mimi-seed.pryzm.gg)
6
+
7
+ ## Acceptance
8
+
9
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
14
+
15
+ ## Distribution License
16
+
17
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
18
+
19
+ ## Notices
20
+
21
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
22
+
23
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
24
+
25
+ ## Changes and New Works License
26
+
27
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
28
+
29
+ ## Patent License
30
+
31
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
32
+
33
+ ## Noncommercial Purposes
34
+
35
+ Any noncommercial purpose is a permitted purpose.
36
+
37
+ ## Personal Uses
38
+
39
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
40
+
41
+ ## Noncommercial Organizations
42
+
43
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
44
+
45
+ ## Fair Use
46
+
47
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
48
+
49
+ ## No Other Rights
50
+
51
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
52
+
53
+ ## Patent Defense
54
+
55
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
56
+
57
+ ## Violations
58
+
59
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
60
+
61
+ ## No Liability
62
+
63
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
64
+
65
+ ## Definitions
66
+
67
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
68
+
69
+ **You** refers to the individual or entity agreeing to these terms.
70
+
71
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
72
+
73
+ **Your licenses** are all the licenses granted to you for the software under these terms.
74
+
75
+ **Use** means anything you do with the software requiring one of your licenses.
@@ -212,13 +212,13 @@ export function startAuth(clientId, clientSecret, options = {}) {
212
212
  };
213
213
  saveTokens(stored);
214
214
  res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
215
- res.end(`
216
- <html><body style="font-family:system-ui;display:flex;justify-content:center;align-items:center;height:100vh;margin:0">
217
- <div style="text-align:center">
218
- <h1>✅ Mimi Seed 인증 완료!</h1>
219
- <p>이 창을 닫고 Claude Code 또는 Codex로 돌아가세요.</p>
220
- </div>
221
- </body></html>
215
+ res.end(`
216
+ <html><body style="font-family:system-ui;display:flex;justify-content:center;align-items:center;height:100vh;margin:0">
217
+ <div style="text-align:center">
218
+ <h1>✅ Mimi Seed 인증 완료!</h1>
219
+ <p>이 창을 닫고 Claude Code 또는 Codex로 돌아가세요.</p>
220
+ </div>
221
+ </body></html>
222
222
  `);
223
223
  server.close();
224
224
  activeAuthServer = null;
@@ -84,20 +84,20 @@ export async function listAccessibleCustomers(auth, cfg) {
84
84
  }
85
85
  // ─── 캠페인 목록 ─────────────────────────────────────────────
86
86
  export async function listCampaigns(auth, cfg) {
87
- const query = `
88
- SELECT
89
- campaign.id,
90
- campaign.name,
91
- campaign.status,
92
- campaign.advertising_channel_type,
93
- campaign.advertising_channel_sub_type,
94
- campaign.start_date,
95
- campaign.end_date,
96
- campaign_budget.amount_micros
97
- FROM campaign
98
- WHERE campaign.status != 'REMOVED'
99
- ORDER BY campaign.name ASC
100
- LIMIT 200
87
+ const query = `
88
+ SELECT
89
+ campaign.id,
90
+ campaign.name,
91
+ campaign.status,
92
+ campaign.advertising_channel_type,
93
+ campaign.advertising_channel_sub_type,
94
+ campaign.start_date,
95
+ campaign.end_date,
96
+ campaign_budget.amount_micros
97
+ FROM campaign
98
+ WHERE campaign.status != 'REMOVED'
99
+ ORDER BY campaign.name ASC
100
+ LIMIT 200
101
101
  `;
102
102
  const rows = await search(auth, cfg, query);
103
103
  return rows.map((r) => ({
@@ -113,26 +113,26 @@ export async function listCampaigns(auth, cfg) {
113
113
  }
114
114
  // ─── 캠페인 성과 리포트 ────────────────────────────────────────
115
115
  export async function getCampaignReport(auth, cfg, range) {
116
- const query = `
117
- SELECT
118
- campaign.id,
119
- campaign.name,
120
- campaign.status,
121
- campaign.advertising_channel_type,
122
- campaign.advertising_channel_sub_type,
123
- metrics.clicks,
124
- metrics.impressions,
125
- metrics.cost_micros,
126
- metrics.conversions,
127
- metrics.conversions_value,
128
- metrics.cost_per_conversion,
129
- metrics.ctr,
130
- metrics.average_cpc
131
- FROM campaign
132
- WHERE campaign.status != 'REMOVED'
133
- AND segments.date BETWEEN '${range.startDate}' AND '${range.endDate}'
134
- ORDER BY metrics.cost_micros DESC
135
- LIMIT 500
116
+ const query = `
117
+ SELECT
118
+ campaign.id,
119
+ campaign.name,
120
+ campaign.status,
121
+ campaign.advertising_channel_type,
122
+ campaign.advertising_channel_sub_type,
123
+ metrics.clicks,
124
+ metrics.impressions,
125
+ metrics.cost_micros,
126
+ metrics.conversions,
127
+ metrics.conversions_value,
128
+ metrics.cost_per_conversion,
129
+ metrics.ctr,
130
+ metrics.average_cpc
131
+ FROM campaign
132
+ WHERE campaign.status != 'REMOVED'
133
+ AND segments.date BETWEEN '${range.startDate}' AND '${range.endDate}'
134
+ ORDER BY metrics.cost_micros DESC
135
+ LIMIT 500
136
136
  `;
137
137
  const rows = await search(auth, cfg, query);
138
138
  return rows.map((r) => ({
@@ -153,26 +153,26 @@ export async function getCampaignReport(auth, cfg, range) {
153
153
  }
154
154
  // ─── UAC(앱 캠페인) 리포트 ─────────────────────────────────────
155
155
  export async function getUacReport(auth, cfg, range) {
156
- const query = `
157
- SELECT
158
- campaign.id,
159
- campaign.name,
160
- campaign.status,
161
- campaign.advertising_channel_sub_type,
162
- metrics.clicks,
163
- metrics.impressions,
164
- metrics.cost_micros,
165
- metrics.conversions,
166
- metrics.conversions_value,
167
- metrics.cost_per_conversion,
168
- metrics.ctr,
169
- segments.date
170
- FROM campaign
171
- WHERE campaign.advertising_channel_type = 'MULTI_CHANNEL'
172
- AND campaign.advertising_channel_sub_type IN ('APP_CAMPAIGN', 'APP_CAMPAIGN_FOR_ENGAGEMENT', 'APP_CAMPAIGN_FOR_PRE_REGISTRATION')
173
- AND segments.date BETWEEN '${range.startDate}' AND '${range.endDate}'
174
- ORDER BY segments.date DESC, metrics.cost_micros DESC
175
- LIMIT 500
156
+ const query = `
157
+ SELECT
158
+ campaign.id,
159
+ campaign.name,
160
+ campaign.status,
161
+ campaign.advertising_channel_sub_type,
162
+ metrics.clicks,
163
+ metrics.impressions,
164
+ metrics.cost_micros,
165
+ metrics.conversions,
166
+ metrics.conversions_value,
167
+ metrics.cost_per_conversion,
168
+ metrics.ctr,
169
+ segments.date
170
+ FROM campaign
171
+ WHERE campaign.advertising_channel_type = 'MULTI_CHANNEL'
172
+ AND campaign.advertising_channel_sub_type IN ('APP_CAMPAIGN', 'APP_CAMPAIGN_FOR_ENGAGEMENT', 'APP_CAMPAIGN_FOR_PRE_REGISTRATION')
173
+ AND segments.date BETWEEN '${range.startDate}' AND '${range.endDate}'
174
+ ORDER BY segments.date DESC, metrics.cost_micros DESC
175
+ LIMIT 500
176
176
  `;
177
177
  const rows = await search(auth, cfg, query);
178
178
  const byId = new Map();
@@ -59,6 +59,14 @@ export async function withEdit(auth, packageName, fn, commit = false) {
59
59
  }
60
60
  }
61
61
  // ─── Play Developer Reporting API / Android vitals ───
62
+ //
63
+ // ⚠️ DRIFT 주의 — getStatistics 의 요청 빌드 규칙(타임존 HOURLY=UTC, errorCount→reportType,
64
+ // userCohort 게이팅, default 차원/metric)은 웹 콘솔 리포의 복제본과 동일해야 합니다:
65
+ // web: src/lib/mcp/tools/play-vitals.ts (buildPlayVitalsRequest)
66
+ // 양쪽 모두 contract 테스트로 잠겨 있음:
67
+ // sdk: src/__tests__/playstore-statistics.test.ts
68
+ // web: src/__tests__/play-vitals.test.ts
69
+ // 규칙 변경 시 양쪽 코드 + 양쪽 테스트를 함께 수정하세요.
62
70
  export async function getStatistics(auth, packageName, query) {
63
71
  const metricSet = query.metricSet ?? 'anrRate';
64
72
  const resource = METRIC_SET_RESOURCE[metricSet];
@@ -3,7 +3,8 @@ import * as playstoreRaw from '../playstore/tools.js';
3
3
  import { friendlyPlayError } from '../playstore/errors.js';
4
4
  import { saveServiceAccountJsonForPackage, listRegisteredServiceAccounts, deleteServiceAccountJsonForPackage, } from '../auth/playstore-auth.js';
5
5
  import { createGoogleOneTimePurchase, createGoogleSubscription, updateGoogleProduct, deleteGoogleProduct, listGoogleProducts, } from '@onesub/providers';
6
- import { requirePlayStoreAuth, requireServiceAccountJson } from '../helpers.js';
6
+ import { requirePlayStoreAuth, requireServiceAccountJson, requireAuth } from '../helpers.js';
7
+ import * as iam from '../iam/tools.js';
7
8
  import { buildPlayStoreReleasePlan } from '../checks/plan.js';
8
9
  import { validatePlayReleaseNotes, formatIssuesForUser } from '../lib/text-validators.js';
9
10
  // 모든 playstore tools 호출을 친절 에러로 감싸는 프록시 — 403(권한)/404/edit 충돌/
@@ -607,4 +608,61 @@ export function registerPlaystoreTools(server) {
607
608
  }
608
609
  return { content: [{ type: 'text', text: `✓ ${productId} 삭제 완료` }] };
609
610
  });
611
+ server.tool('setup_playstore_connection', [
612
+ 'Play Store 서비스 계정을 한 번에 설정합니다 (SA 생성 → JSON 키 발급 → 로컬 등록).',
613
+ 'iam_create_service_account → iam_create_key → playstore_register_service_account 를 순서대로 자동 실행.',
614
+ '완료 후 Play Console에서 서비스 계정 이메일을 초대하는 안내(수동 1단계)가 포함됩니다.',
615
+ '이미 같은 accountId의 SA가 존재하면 키만 새로 발급하고 등록합니다.',
616
+ ].join(' '), {
617
+ packageName: z.string().describe('Android 패키지명 (예: gg.pryzm.speakmoney)'),
618
+ projectId: z.string().describe('Google Cloud 프로젝트 ID (예: my-project-123). Firebase 콘솔 → 프로젝트 설정에서 확인.'),
619
+ accountId: z
620
+ .string()
621
+ .regex(/^[a-z][a-z0-9-]{4,28}[a-z0-9]$/, 'lowercase, digits, hyphens; 6-30 chars')
622
+ .default('mimi-play-publisher')
623
+ .describe('서비스 계정 ID (기본: mimi-play-publisher)'),
624
+ }, async ({ packageName, projectId, accountId }) => {
625
+ const auth = await requireAuth();
626
+ const displayName = `Mimi Seed Play Publisher (${packageName})`;
627
+ // 1. 서비스 계정 생성 (이미 존재하면 409 → 이메일만 재구성)
628
+ let saEmail;
629
+ try {
630
+ const account = await iam.createServiceAccount(auth, projectId, accountId, displayName);
631
+ saEmail = account.email;
632
+ }
633
+ catch (err) {
634
+ const msg = err instanceof Error ? err.message : String(err);
635
+ if (msg.includes('409') || msg.toLowerCase().includes('already exists')) {
636
+ saEmail = `${accountId}@${projectId}.iam.gserviceaccount.com`;
637
+ }
638
+ else {
639
+ throw err;
640
+ }
641
+ }
642
+ // 2. JSON 키 발급
643
+ const key = await iam.createServiceAccountKey(auth, saEmail);
644
+ // 3. 로컬 등록 (검증은 Play Console 초대 전이라 skip)
645
+ saveServiceAccountJsonForPackage(packageName, key.json);
646
+ return {
647
+ content: [{
648
+ type: 'text',
649
+ text: [
650
+ `✅ Play Store 서비스 계정 설정 완료`,
651
+ '',
652
+ `**패키지**: \`${packageName}\``,
653
+ `**SA 이메일**: \`${saEmail}\``,
654
+ `**저장 경로**: \`~/.mimi-seed/play-service-accounts/${packageName}.json\``,
655
+ '',
656
+ '## 필수 수동 단계 — Play Console 초대',
657
+ '1. https://play.google.com/console/developers 접속',
658
+ '2. **설정 → 사용자 및 권한 → 새 사용자 초대**',
659
+ `3. 이메일 입력: \`${saEmail}\``,
660
+ '4. 권한: **앱 출시** 또는 **릴리스 관리자** 선택 → 초대 전송',
661
+ '5. 권한 적용까지 약 5분 소요',
662
+ '',
663
+ '초대 완료 후 `playstore_verify_service_account` 로 연결 확인 가능합니다.',
664
+ ].join('\n'),
665
+ }],
666
+ };
667
+ });
610
668
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoonion/mimi-seed-mcp",
3
- "version": "0.3.34",
3
+ "version": "0.3.35",
4
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
  "bin": {