@yoonion/mimi-seed-mcp 0.3.34 → 0.3.36
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 +75 -75
- package/dist/auth/google-auth.js +7 -7
- package/dist/googleads/tools.js +54 -54
- package/dist/index.js +2 -0
- package/dist/jenkins/config.d.ts +8 -0
- package/dist/jenkins/config.js +29 -0
- package/dist/jenkins/credentials.d.ts +10 -0
- package/dist/jenkins/credentials.js +95 -0
- package/dist/playstore/tools.js +8 -0
- package/dist/registers/jenkins.d.ts +2 -0
- package/dist/registers/jenkins.js +91 -0
- package/dist/registers/playstore.js +59 -1
- package/package.json +1 -1
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.
|
package/dist/auth/google-auth.js
CHANGED
|
@@ -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;
|
package/dist/googleads/tools.js
CHANGED
|
@@ -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();
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import { registerInstagramTools } from './registers/instagram.js';
|
|
|
16
16
|
import { registerFacebookTools } from './registers/facebook.js';
|
|
17
17
|
import { registerGoogleAdsTools } from './registers/googleads.js';
|
|
18
18
|
import { registerGscTools } from './registers/gsc.js';
|
|
19
|
+
import { registerJenkinsTools } from './registers/jenkins.js';
|
|
19
20
|
import { registerPrompts } from './prompts.js';
|
|
20
21
|
import { registerResources } from './resources.js';
|
|
21
22
|
// dist/index.js 기준 ../package.json — npm 패키지 루트의 버전을 단일 출처로 사용.
|
|
@@ -39,6 +40,7 @@ registerInstagramTools(server);
|
|
|
39
40
|
registerFacebookTools(server);
|
|
40
41
|
registerGoogleAdsTools(server);
|
|
41
42
|
registerGscTools(server);
|
|
43
|
+
registerJenkinsTools(server);
|
|
42
44
|
registerPrompts(server);
|
|
43
45
|
registerResources(server);
|
|
44
46
|
// `npx -y @yoonion/mimi-seed-mcp <subcommand>` 처리.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface JenkinsConfig {
|
|
2
|
+
url: string;
|
|
3
|
+
username: string;
|
|
4
|
+
token: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function loadJenkinsConfig(): JenkinsConfig | null;
|
|
7
|
+
export declare function saveJenkinsConfig(config: JenkinsConfig): void;
|
|
8
|
+
export declare function requireJenkinsConfig(): JenkinsConfig;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
const CONFIG_DIR = path.join(os.homedir(), '.mimi-seed');
|
|
5
|
+
const JENKINS_CONFIG_PATH = path.join(CONFIG_DIR, 'jenkins.json');
|
|
6
|
+
export function loadJenkinsConfig() {
|
|
7
|
+
try {
|
|
8
|
+
return JSON.parse(fs.readFileSync(JENKINS_CONFIG_PATH, 'utf-8'));
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function saveJenkinsConfig(config) {
|
|
15
|
+
if (!fs.existsSync(CONFIG_DIR)) {
|
|
16
|
+
fs.mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });
|
|
17
|
+
}
|
|
18
|
+
fs.writeFileSync(JENKINS_CONFIG_PATH, JSON.stringify(config, null, 2), { mode: 0o600 });
|
|
19
|
+
}
|
|
20
|
+
export function requireJenkinsConfig() {
|
|
21
|
+
const cfg = loadJenkinsConfig();
|
|
22
|
+
if (!cfg) {
|
|
23
|
+
throw new Error('Jenkins 설정이 없습니다.\n' +
|
|
24
|
+
'jenkins_save_config 도구로 먼저 설정해주세요.\n' +
|
|
25
|
+
'예시:\n' +
|
|
26
|
+
' jenkins_save_config(url="https://jenkins.example.com", username="admin", token="11abc...")');
|
|
27
|
+
}
|
|
28
|
+
return cfg;
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JenkinsConfig } from './config.js';
|
|
2
|
+
export interface JenkinsCredentialSummary {
|
|
3
|
+
id: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
typeName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function listCredentials(cfg: JenkinsConfig): Promise<JenkinsCredentialSummary[]>;
|
|
8
|
+
export declare function upsertSecretText(cfg: JenkinsConfig, id: string, secret: string, description?: string): Promise<'created' | 'updated'>;
|
|
9
|
+
export declare function upsertSecretFile(cfg: JenkinsConfig, id: string, fileBase64: string, fileName: string, description?: string): Promise<'created' | 'updated'>;
|
|
10
|
+
export declare function deleteCredential(cfg: JenkinsConfig, id: string): Promise<void>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function basicAuth(username, token) {
|
|
2
|
+
return 'Basic ' + Buffer.from(`${username}:${token}`).toString('base64');
|
|
3
|
+
}
|
|
4
|
+
function credentialsBase(url) {
|
|
5
|
+
return `${url.replace(/\/$/, '')}/credentials/store/system/domain/_`;
|
|
6
|
+
}
|
|
7
|
+
async function credentialExists(cfg, id) {
|
|
8
|
+
const res = await fetch(`${credentialsBase(cfg.url)}/${encodeURIComponent(id)}/api/json`, {
|
|
9
|
+
headers: { Authorization: basicAuth(cfg.username, cfg.token) },
|
|
10
|
+
});
|
|
11
|
+
return res.ok;
|
|
12
|
+
}
|
|
13
|
+
export async function listCredentials(cfg) {
|
|
14
|
+
const res = await fetch(`${credentialsBase(cfg.url)}/api/json?depth=1`, {
|
|
15
|
+
headers: { Authorization: basicAuth(cfg.username, cfg.token) },
|
|
16
|
+
});
|
|
17
|
+
if (!res.ok)
|
|
18
|
+
throw new Error(`Jenkins credentials 조회 실패 (${res.status})`);
|
|
19
|
+
const data = (await res.json());
|
|
20
|
+
return (data.credentials ?? []).map((c) => ({
|
|
21
|
+
id: c.id,
|
|
22
|
+
displayName: c.displayName,
|
|
23
|
+
typeName: c.typeName,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
export async function upsertSecretText(cfg, id, secret, description = '') {
|
|
27
|
+
const payload = JSON.stringify({
|
|
28
|
+
'': '0',
|
|
29
|
+
credentials: {
|
|
30
|
+
scope: 'GLOBAL',
|
|
31
|
+
id,
|
|
32
|
+
description,
|
|
33
|
+
secret,
|
|
34
|
+
'stapler-class': 'org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl',
|
|
35
|
+
'$class': 'org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const base = credentialsBase(cfg.url);
|
|
39
|
+
const exists = await credentialExists(cfg, id);
|
|
40
|
+
const endpoint = exists
|
|
41
|
+
? `${base}/${encodeURIComponent(id)}/updateSubmit`
|
|
42
|
+
: `${base}/createCredentials`;
|
|
43
|
+
const res = await fetch(endpoint, {
|
|
44
|
+
method: 'POST',
|
|
45
|
+
headers: {
|
|
46
|
+
Authorization: basicAuth(cfg.username, cfg.token),
|
|
47
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
48
|
+
},
|
|
49
|
+
body: new URLSearchParams({ json: payload }).toString(),
|
|
50
|
+
});
|
|
51
|
+
if (!res.ok && res.status !== 302) {
|
|
52
|
+
throw new Error(`Jenkins credential ${exists ? 'update' : 'create'} 실패 (${res.status})`);
|
|
53
|
+
}
|
|
54
|
+
return exists ? 'updated' : 'created';
|
|
55
|
+
}
|
|
56
|
+
export async function upsertSecretFile(cfg, id, fileBase64, fileName, description = '') {
|
|
57
|
+
const payload = JSON.stringify({
|
|
58
|
+
'': '0',
|
|
59
|
+
credentials: {
|
|
60
|
+
scope: 'GLOBAL',
|
|
61
|
+
id,
|
|
62
|
+
description,
|
|
63
|
+
fileName,
|
|
64
|
+
secretBytes: fileBase64,
|
|
65
|
+
'stapler-class': 'org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl',
|
|
66
|
+
'$class': 'org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
const base = credentialsBase(cfg.url);
|
|
70
|
+
const exists = await credentialExists(cfg, id);
|
|
71
|
+
const endpoint = exists
|
|
72
|
+
? `${base}/${encodeURIComponent(id)}/updateSubmit`
|
|
73
|
+
: `${base}/createCredentials`;
|
|
74
|
+
const res = await fetch(endpoint, {
|
|
75
|
+
method: 'POST',
|
|
76
|
+
headers: {
|
|
77
|
+
Authorization: basicAuth(cfg.username, cfg.token),
|
|
78
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
79
|
+
},
|
|
80
|
+
body: new URLSearchParams({ json: payload }).toString(),
|
|
81
|
+
});
|
|
82
|
+
if (!res.ok && res.status !== 302) {
|
|
83
|
+
throw new Error(`Jenkins secret file credential ${exists ? 'update' : 'create'} 실패 (${res.status})`);
|
|
84
|
+
}
|
|
85
|
+
return exists ? 'updated' : 'created';
|
|
86
|
+
}
|
|
87
|
+
export async function deleteCredential(cfg, id) {
|
|
88
|
+
const res = await fetch(`${credentialsBase(cfg.url)}/${encodeURIComponent(id)}/doDelete`, {
|
|
89
|
+
method: 'POST',
|
|
90
|
+
headers: { Authorization: basicAuth(cfg.username, cfg.token) },
|
|
91
|
+
});
|
|
92
|
+
if (!res.ok && res.status !== 302) {
|
|
93
|
+
throw new Error(`Jenkins credential 삭제 실패 (${res.status})`);
|
|
94
|
+
}
|
|
95
|
+
}
|
package/dist/playstore/tools.js
CHANGED
|
@@ -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];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { requireJenkinsConfig, saveJenkinsConfig } from '../jenkins/config.js';
|
|
3
|
+
import * as creds from '../jenkins/credentials.js';
|
|
4
|
+
export function registerJenkinsTools(server) {
|
|
5
|
+
server.tool('jenkins_save_config', [
|
|
6
|
+
'Jenkins 서버 연결 설정을 저장합니다.',
|
|
7
|
+
'저장 위치: ~/.mimi-seed/jenkins.json (mode 0600).',
|
|
8
|
+
'API Token은 Jenkins 대시보드 → 사용자 → 설정 → API Token에서 발급할 수 있습니다.',
|
|
9
|
+
].join(' '), {
|
|
10
|
+
url: z.string().url().describe('Jenkins 기본 URL (예: https://jenkins.example.com)'),
|
|
11
|
+
username: z.string().describe('Jenkins 사용자 ID'),
|
|
12
|
+
token: z.string().describe('Jenkins API Token'),
|
|
13
|
+
}, async ({ url, username, token }) => {
|
|
14
|
+
saveJenkinsConfig({ url, username, token });
|
|
15
|
+
return {
|
|
16
|
+
content: [{
|
|
17
|
+
type: 'text',
|
|
18
|
+
text: [
|
|
19
|
+
'✅ Jenkins 설정 저장 완료',
|
|
20
|
+
` URL: ${url}`,
|
|
21
|
+
` 사용자: ${username}`,
|
|
22
|
+
'',
|
|
23
|
+
'jenkins_list_credentials 로 등록된 credential 목록을 확인하세요.',
|
|
24
|
+
].join('\n'),
|
|
25
|
+
}],
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
server.tool('jenkins_list_credentials', 'Jenkins에 등록된 credential 목록을 조회합니다 (id / displayName / type).', {}, async () => {
|
|
29
|
+
const cfg = requireJenkinsConfig();
|
|
30
|
+
const list = await creds.listCredentials(cfg);
|
|
31
|
+
if (list.length === 0) {
|
|
32
|
+
return { content: [{ type: 'text', text: '등록된 Jenkins credential 없음.' }] };
|
|
33
|
+
}
|
|
34
|
+
const lines = list.map((c) => `• ${c.id} [${c.typeName}] ${c.displayName}`);
|
|
35
|
+
return {
|
|
36
|
+
content: [{
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: `Jenkins credentials (${list.length}개):\n\n${lines.join('\n')}`,
|
|
39
|
+
}],
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
server.tool('jenkins_create_credential', [
|
|
43
|
+
'Jenkins에 Secret Text credential을 생성하거나 업데이트합니다.',
|
|
44
|
+
'비밀번호, API 키, 앱 시크릿 등 문자열 값에 사용하세요.',
|
|
45
|
+
'같은 id가 이미 존재하면 자동으로 업데이트합니다.',
|
|
46
|
+
].join(' '), {
|
|
47
|
+
id: z.string().describe('Credential ID (예: speakmoney-android-key-password)'),
|
|
48
|
+
secret: z.string().describe('저장할 비밀값'),
|
|
49
|
+
description: z.string().optional().describe('설명 (선택)'),
|
|
50
|
+
}, async ({ id, secret, description }) => {
|
|
51
|
+
const cfg = requireJenkinsConfig();
|
|
52
|
+
const result = await creds.upsertSecretText(cfg, id, secret, description ?? '');
|
|
53
|
+
return {
|
|
54
|
+
content: [{
|
|
55
|
+
type: 'text',
|
|
56
|
+
text: `✅ Jenkins credential ${result}: \`${id}\``,
|
|
57
|
+
}],
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
server.tool('jenkins_upload_keystore', [
|
|
61
|
+
'Jenkins에 Android keystore 파일을 Secret File credential로 업로드합니다.',
|
|
62
|
+
'keystore_base64에 .jks/.p12 파일을 base64로 인코딩한 값을 전달하세요.',
|
|
63
|
+
'같은 id가 이미 존재하면 자동으로 교체합니다.',
|
|
64
|
+
].join(' '), {
|
|
65
|
+
id: z.string().describe('Credential ID (예: speakmoney-android-keystore)'),
|
|
66
|
+
keystore_base64: z.string().describe('keystore 파일 내용을 base64로 인코딩한 값'),
|
|
67
|
+
file_name: z.string().default('keystore.jks').describe('파일명 (기본: keystore.jks)'),
|
|
68
|
+
description: z.string().optional().describe('설명 (선택)'),
|
|
69
|
+
}, async ({ id, keystore_base64, file_name, description }) => {
|
|
70
|
+
const cfg = requireJenkinsConfig();
|
|
71
|
+
const result = await creds.upsertSecretFile(cfg, id, keystore_base64, file_name, description ?? '');
|
|
72
|
+
return {
|
|
73
|
+
content: [{
|
|
74
|
+
type: 'text',
|
|
75
|
+
text: `✅ Jenkins keystore credential ${result}: \`${id}\` (${file_name})`,
|
|
76
|
+
}],
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
server.tool('jenkins_delete_credential', 'Jenkins credential을 삭제합니다. 비가역 작업입니다.', {
|
|
80
|
+
id: z.string().describe('삭제할 Credential ID'),
|
|
81
|
+
}, async ({ id }) => {
|
|
82
|
+
const cfg = requireJenkinsConfig();
|
|
83
|
+
await creds.deleteCredential(cfg, id);
|
|
84
|
+
return {
|
|
85
|
+
content: [{
|
|
86
|
+
type: 'text',
|
|
87
|
+
text: `🗑 Jenkins credential 삭제 완료: \`${id}\``,
|
|
88
|
+
}],
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
}
|
|
@@ -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