mimi-seed 0.2.3 → 0.2.5
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 -0
- package/dist/chunk-Q5YGYAFK.js +39 -0
- package/dist/index.js +172 -70
- package/dist/{mcp-client-U3CS5OZN.js → mcp-client-26VCPY4L.js} +1 -1
- package/package.json +4 -2
- package/dist/chunk-FW4DVFZD.js +0 -57
package/LICENSE
ADDED
|
@@ -0,0 +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.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/mcp-client.ts
|
|
4
|
+
async function mcpCall(endpoint, token, name, args) {
|
|
5
|
+
const res = await fetch(endpoint, {
|
|
6
|
+
method: "POST",
|
|
7
|
+
headers: {
|
|
8
|
+
"Content-Type": "application/json",
|
|
9
|
+
Accept: "application/json, text/event-stream",
|
|
10
|
+
Authorization: `Bearer ${token}`
|
|
11
|
+
},
|
|
12
|
+
body: JSON.stringify({
|
|
13
|
+
jsonrpc: "2.0",
|
|
14
|
+
id: 1,
|
|
15
|
+
method: "tools/call",
|
|
16
|
+
params: { name, arguments: args }
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
20
|
+
let payload;
|
|
21
|
+
if (contentType.includes("text/event-stream")) {
|
|
22
|
+
const text2 = await res.text();
|
|
23
|
+
const line = text2.split("\n").map((l) => l.trim()).find((l) => l.startsWith("data:"));
|
|
24
|
+
if (!line) throw new Error("MCP SSE \uC751\uB2F5\uC5D0 data \uC5C6\uC74C");
|
|
25
|
+
payload = JSON.parse(line.slice(5).trim());
|
|
26
|
+
} else {
|
|
27
|
+
payload = await res.json();
|
|
28
|
+
}
|
|
29
|
+
if (payload.error) {
|
|
30
|
+
return { text: payload.error.message, isError: true };
|
|
31
|
+
}
|
|
32
|
+
const content = payload.result?.content ?? [];
|
|
33
|
+
const text = content.filter((c) => c.type === "text").map((c) => c.text ?? "").join("\n");
|
|
34
|
+
return { text, isError: payload.result?.isError ?? false };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
mcpCall
|
|
39
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
mcpCall
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q5YGYAFK.js";
|
|
5
5
|
|
|
6
6
|
// src/index.ts
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import os3 from "os";
|
|
8
|
+
import kleur8 from "kleur";
|
|
9
9
|
import open from "open";
|
|
10
10
|
|
|
11
11
|
// src/detect.ts
|
|
@@ -979,7 +979,7 @@ async function promptJenkinsSetup() {
|
|
|
979
979
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
980
980
|
const ask = (q) => new Promise((resolve) => rl.question(q, (a) => resolve(a.trim())));
|
|
981
981
|
log2(kleur6.bold("Jenkins \uC124\uC815"));
|
|
982
|
-
const url = await ask(" Jenkins URL (\uC608: http://
|
|
982
|
+
const url = await ask(" Jenkins URL (\uC608: http://your-jenkins.example.com:8080): ");
|
|
983
983
|
const user = await ask(" Jenkins \uC0AC\uC6A9\uC790\uBA85 (\uC608: admin): ");
|
|
984
984
|
const token = await ask(" Jenkins API Token: ");
|
|
985
985
|
const jobAndroid = await ask(" Android Job \uC774\uB984 (\uC608: my-app-android): ");
|
|
@@ -1058,7 +1058,7 @@ async function cmdDeploy(argv) {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
let appId = args.appId;
|
|
1060
1060
|
if (!appId) {
|
|
1061
|
-
const { mcpCall: mcpCall2 } = await import("./mcp-client-
|
|
1061
|
+
const { mcpCall: mcpCall2 } = await import("./mcp-client-26VCPY4L.js");
|
|
1062
1062
|
const r = await mcpCall2(cfg.endpoint, cfg.token, "list_apps", {});
|
|
1063
1063
|
if (!r.isError) {
|
|
1064
1064
|
try {
|
|
@@ -1094,62 +1094,160 @@ async function cmdDeploy(argv) {
|
|
|
1094
1094
|
log2(kleur6.dim(" https://play.google.com/console/developers"));
|
|
1095
1095
|
}
|
|
1096
1096
|
|
|
1097
|
+
// src/mcp-restart.ts
|
|
1098
|
+
import { execSync as execSync2 } from "child_process";
|
|
1099
|
+
import fs3 from "fs";
|
|
1100
|
+
import os2 from "os";
|
|
1101
|
+
import path3 from "path";
|
|
1102
|
+
import kleur7 from "kleur";
|
|
1103
|
+
function log3(msg) {
|
|
1104
|
+
process.stdout.write(msg + "\n");
|
|
1105
|
+
}
|
|
1106
|
+
function readClaudeJson() {
|
|
1107
|
+
const p = path3.join(os2.homedir(), ".claude.json");
|
|
1108
|
+
try {
|
|
1109
|
+
return JSON.parse(fs3.readFileSync(p, "utf8"));
|
|
1110
|
+
} catch {
|
|
1111
|
+
return {};
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
function findProcessMarker(cfg) {
|
|
1115
|
+
const args = cfg.args;
|
|
1116
|
+
if (!args) return null;
|
|
1117
|
+
const fileArg = args.find((a) => a.endsWith(".ts") || a.endsWith(".js"));
|
|
1118
|
+
if (fileArg) return fileArg;
|
|
1119
|
+
const pkgArg = args.find((a) => (a.includes("@") || a.includes("-")) && !a.startsWith("-") && a !== "-y");
|
|
1120
|
+
if (pkgArg) return pkgArg;
|
|
1121
|
+
const meaningful = args.filter((a) => !a.startsWith("-") && a !== "/c" && a !== "npx" && a !== "cmd");
|
|
1122
|
+
return meaningful.at(-1) ?? null;
|
|
1123
|
+
}
|
|
1124
|
+
function killByMarker(marker) {
|
|
1125
|
+
const isWin = os2.platform() === "win32";
|
|
1126
|
+
if (isWin) {
|
|
1127
|
+
const escaped = marker.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
|
1128
|
+
let pids = [];
|
|
1129
|
+
try {
|
|
1130
|
+
const out = execSync2(
|
|
1131
|
+
`powershell -NoProfile -Command "Get-WmiObject Win32_Process | Where-Object { $_.CommandLine -like '*${escaped}*' } | Select-Object -ExpandProperty ProcessId"`,
|
|
1132
|
+
{ encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }
|
|
1133
|
+
).trim();
|
|
1134
|
+
pids = out.split(/\r?\n/).map((s) => s.trim()).filter(Boolean);
|
|
1135
|
+
} catch {
|
|
1136
|
+
return { killed: 0 };
|
|
1137
|
+
}
|
|
1138
|
+
let killed = 0;
|
|
1139
|
+
for (const pid of pids) {
|
|
1140
|
+
try {
|
|
1141
|
+
execSync2(`taskkill /F /PID ${pid}`, { stdio: "pipe" });
|
|
1142
|
+
log3(kleur7.dim(` PID ${pid} \uC885\uB8CC`));
|
|
1143
|
+
killed++;
|
|
1144
|
+
} catch {
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return { killed };
|
|
1148
|
+
} else {
|
|
1149
|
+
try {
|
|
1150
|
+
execSync2(`pkill -f "${marker}"`, { stdio: "pipe" });
|
|
1151
|
+
return { killed: 1 };
|
|
1152
|
+
} catch {
|
|
1153
|
+
return { killed: 0 };
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
async function cmdRestart(args) {
|
|
1158
|
+
const serverName = args[0] ?? "mimi-seed";
|
|
1159
|
+
log3(kleur7.bold(`MCP \uC11C\uBC84 \uC7AC\uC2DC\uC791: ${serverName}`));
|
|
1160
|
+
log3("");
|
|
1161
|
+
const d = readClaudeJson();
|
|
1162
|
+
const servers = d.mcpServers;
|
|
1163
|
+
const cfg = servers?.[serverName];
|
|
1164
|
+
if (!cfg) {
|
|
1165
|
+
const available = servers ? Object.keys(servers).join(", ") : "(\uC5C6\uC74C)";
|
|
1166
|
+
log3(kleur7.red(`'${serverName}' \uC11C\uBC84\uB97C ~/.claude/.claude.json\uC5D0\uC11C \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.`));
|
|
1167
|
+
log3(kleur7.dim(` \uB4F1\uB85D\uB41C \uC11C\uBC84: ${available}`));
|
|
1168
|
+
process.exit(1);
|
|
1169
|
+
}
|
|
1170
|
+
if (cfg.type === "http" || cfg.type === "sse") {
|
|
1171
|
+
log3(kleur7.yellow(`'${serverName}'\uB294 HTTP/SSE \uC11C\uBC84\uC785\uB2C8\uB2E4. \uD504\uB85C\uC138\uC2A4 \uC7AC\uC2DC\uC791\uC774 \uD544\uC694\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.`));
|
|
1172
|
+
log3(kleur7.dim(" Claude Code\uC5D0\uC11C /mcp \uB97C \uC2E4\uD589\uD574 \uC5F0\uACB0 \uC0C1\uD0DC\uB97C \uD655\uC778\uD558\uC138\uC694."));
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
const marker = findProcessMarker(cfg);
|
|
1176
|
+
if (!marker) {
|
|
1177
|
+
log3(kleur7.yellow("\uD504\uB85C\uC138\uC2A4 \uC2DD\uBCC4\uC790(\uC2A4\uD06C\uB9BD\uD2B8 \uACBD\uB85C)\uB97C \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."));
|
|
1178
|
+
log3(kleur7.dim(` \uC124\uC815: ${JSON.stringify(cfg)}`));
|
|
1179
|
+
process.exit(1);
|
|
1180
|
+
}
|
|
1181
|
+
log3(kleur7.dim(` \uC2DD\uBCC4\uC790: ${marker}`));
|
|
1182
|
+
const { killed } = killByMarker(marker);
|
|
1183
|
+
if (killed === 0) {
|
|
1184
|
+
log3(kleur7.yellow("\u26A0 \uC2E4\uD589 \uC911\uC778 \uD504\uB85C\uC138\uC2A4\uB97C \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."));
|
|
1185
|
+
log3(kleur7.dim(" \uC774\uBBF8 \uC885\uB8CC\uB410\uAC70\uB098, Claude Code\uAC00 \uC544\uC9C1 \uC11C\uBC84\uB97C \uC2DC\uC791\uD558\uC9C0 \uC54A\uC740 \uC0C1\uD0DC\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4."));
|
|
1186
|
+
} else {
|
|
1187
|
+
log3("");
|
|
1188
|
+
log3(kleur7.green(`\u2713 ${serverName} \uC885\uB8CC\uB428 (${killed}\uAC1C \uD504\uB85C\uC138\uC2A4)`));
|
|
1189
|
+
log3(kleur7.dim(" Claude Code\uAC00 \uB2E4\uC74C \uB3C4\uAD6C \uD638\uCD9C \uC2DC \uC790\uB3D9\uC73C\uB85C \uC7AC\uC5F0\uACB0\uD569\uB2C8\uB2E4."));
|
|
1190
|
+
}
|
|
1191
|
+
log3("");
|
|
1192
|
+
log3(kleur7.cyan(" \uC5F0\uACB0 \uD655\uC778: Claude Code\uC5D0\uC11C /mcp \uC2E4\uD589"));
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1097
1195
|
// src/index.ts
|
|
1098
1196
|
var DEFAULT_WEB_BASE = process.env.MIMI_SEED_WEB_BASE ?? "https://mimi-seed.pryzm.gg";
|
|
1099
1197
|
var DEFAULT_MCP_ENDPOINT = `${DEFAULT_WEB_BASE}/api/mcp`;
|
|
1100
|
-
function
|
|
1198
|
+
function log4(msg) {
|
|
1101
1199
|
process.stdout.write(msg + "\n");
|
|
1102
1200
|
}
|
|
1103
1201
|
async function cmdInit() {
|
|
1104
1202
|
const cwd = process.cwd();
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1203
|
+
log4(kleur8.bold("Mimi Seed CLI \u2014 init"));
|
|
1204
|
+
log4(kleur8.dim(cwd));
|
|
1205
|
+
log4("");
|
|
1108
1206
|
if (!await hasAnyProjectSignal(cwd)) {
|
|
1109
|
-
|
|
1207
|
+
log4(kleur8.yellow("\u26A0 package.json / app.json / android / ios \uB97C \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uADF8\uB798\uB3C4 \uC9C4\uD589\uD569\uB2C8\uB2E4."));
|
|
1110
1208
|
}
|
|
1111
|
-
|
|
1209
|
+
log4("\u{1F50D} \uC571 \uAC10\uC9C0 \uC911...");
|
|
1112
1210
|
const hints = await detectHints(cwd);
|
|
1113
1211
|
if (hints.length === 0) {
|
|
1114
|
-
|
|
1212
|
+
log4(kleur8.yellow("\uAC10\uC9C0\uB41C \uC571 \uC5C6\uC74C. \uC6F9\uC5D0\uC11C \uC218\uB3D9 \uB4F1\uB85D \uAC00\uB2A5."));
|
|
1115
1213
|
} else {
|
|
1116
1214
|
for (const h of hints) {
|
|
1117
1215
|
const tag = [h.packageName && `android:${h.packageName}`, h.bundleId && `ios:${h.bundleId}`].filter(Boolean).join(" ");
|
|
1118
|
-
|
|
1216
|
+
log4(` \u2022 ${h.name ?? "(\uC774\uB984 \uBBF8\uC0C1)"} ${kleur8.dim(tag)}`);
|
|
1119
1217
|
}
|
|
1120
1218
|
}
|
|
1121
|
-
|
|
1219
|
+
log4("");
|
|
1122
1220
|
if (process.env.MIMI_SEED_TOKEN) {
|
|
1123
1221
|
const cfg2 = await getEffectiveConfig();
|
|
1124
1222
|
if (cfg2 && hints.length > 0) {
|
|
1125
|
-
|
|
1223
|
+
log4(kleur8.dim("CI \uBAA8\uB4DC: MIMI_SEED_TOKEN \uC0AC\uC6A9"));
|
|
1126
1224
|
const payload = hints.map((h) => ({ name: h.name, packageName: h.packageName, bundleId: h.bundleId }));
|
|
1127
1225
|
const result = await mcpCall(cfg2.endpoint, cfg2.token, "sync_apps", { hints: payload });
|
|
1128
1226
|
if (result.isError) {
|
|
1129
|
-
|
|
1227
|
+
log4(kleur8.red("\uB4F1\uB85D \uC2E4\uD328: " + result.text));
|
|
1130
1228
|
} else {
|
|
1131
|
-
for (const line of result.text.split("\n"))
|
|
1229
|
+
for (const line of result.text.split("\n")) log4(" " + line);
|
|
1132
1230
|
}
|
|
1133
1231
|
}
|
|
1134
|
-
|
|
1232
|
+
log4(kleur8.bold("\u2713 \uC644\uB8CC (CI \uBAA8\uB4DC)"));
|
|
1135
1233
|
return;
|
|
1136
1234
|
}
|
|
1137
|
-
|
|
1138
|
-
const hostName =
|
|
1235
|
+
log4("\u{1F510} \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C \uB85C\uADF8\uC778 \uB300\uAE30...");
|
|
1236
|
+
const hostName = os3.hostname().slice(0, 32);
|
|
1139
1237
|
const name = `cli-${hostName}`;
|
|
1140
1238
|
const { port, promise } = await awaitHandshake(5 * 60 * 1e3);
|
|
1141
1239
|
const callback = `http://127.0.0.1:${port}/cb`;
|
|
1142
1240
|
const connectUrl = `${DEFAULT_WEB_BASE}/cli/connect?callback=${encodeURIComponent(callback)}&name=${encodeURIComponent(name)}`;
|
|
1143
|
-
|
|
1241
|
+
log4(kleur8.dim(` ${connectUrl}`));
|
|
1144
1242
|
await open(connectUrl);
|
|
1145
1243
|
let handshake;
|
|
1146
1244
|
try {
|
|
1147
1245
|
handshake = await promise;
|
|
1148
1246
|
} catch (e) {
|
|
1149
|
-
|
|
1247
|
+
log4(kleur8.red("\uC5F0\uACB0 \uC2E4\uD328: " + e.message));
|
|
1150
1248
|
process.exit(1);
|
|
1151
1249
|
}
|
|
1152
|
-
|
|
1250
|
+
log4(kleur8.green("\u2713 \uD1A0\uD070 \uC218\uC2E0"));
|
|
1153
1251
|
const cfg = {
|
|
1154
1252
|
token: handshake.token,
|
|
1155
1253
|
prefix: handshake.prefix,
|
|
@@ -1158,30 +1256,30 @@ async function cmdInit() {
|
|
|
1158
1256
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1159
1257
|
};
|
|
1160
1258
|
await writeConfig(cfg);
|
|
1161
|
-
|
|
1162
|
-
|
|
1259
|
+
log4(kleur8.dim(` \uC800\uC7A5\uB428: ${CONFIG_LOCATION}`));
|
|
1260
|
+
log4("");
|
|
1163
1261
|
if (hints.length > 0) {
|
|
1164
|
-
|
|
1262
|
+
log4("\u{1F504} \uC571 \uB4F1\uB85D \uC911...");
|
|
1165
1263
|
const payload = hints.map((h) => ({ name: h.name, packageName: h.packageName, bundleId: h.bundleId }));
|
|
1166
1264
|
const result = await mcpCall(cfg.endpoint, cfg.token, "sync_apps", { hints: payload });
|
|
1167
1265
|
if (result.isError) {
|
|
1168
|
-
|
|
1266
|
+
log4(kleur8.red("\uB4F1\uB85D \uC2E4\uD328: " + result.text));
|
|
1169
1267
|
} else {
|
|
1170
|
-
for (const line of result.text.split("\n"))
|
|
1268
|
+
for (const line of result.text.split("\n")) log4(" " + line);
|
|
1171
1269
|
}
|
|
1172
|
-
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1270
|
+
log4("");
|
|
1271
|
+
}
|
|
1272
|
+
log4(kleur8.bold("\u2713 \uC900\uBE44 \uC644\uB8CC."));
|
|
1273
|
+
log4("");
|
|
1274
|
+
log4("Claude Code\uC5D0\uC11C \uC774\uB807\uAC8C \uBB3C\uC5B4\uBCF4\uC138\uC694:");
|
|
1275
|
+
log4(kleur8.cyan(' "\uB0B4 \uC571 \uCD9C\uC2DC \uC900\uBE44\uB410\uC5B4?"'));
|
|
1276
|
+
log4(kleur8.cyan(' "\uB9B4\uB9AC\uC988 \uB178\uD2B8 \uC368\uC918"'));
|
|
1277
|
+
log4(kleur8.cyan(' "\uB4F1\uB85D\uB41C \uC571 \uBAA9\uB85D \uBCF4\uC5EC\uC918"'));
|
|
1278
|
+
log4("");
|
|
1279
|
+
log4(`\uB300\uC2DC\uBCF4\uB4DC: ${kleur8.underline(DEFAULT_WEB_BASE + "/apps")}`);
|
|
1280
|
+
log4("");
|
|
1281
|
+
log4(
|
|
1282
|
+
kleur8.dim(
|
|
1185
1283
|
`Claude Code MCP \uB4F1\uB85D:
|
|
1186
1284
|
claude mcp add --transport http mimi-seed ${DEFAULT_MCP_ENDPOINT} \\
|
|
1187
1285
|
--header "Authorization: Bearer ${cfg.prefix}..."`
|
|
@@ -1191,41 +1289,42 @@ async function cmdInit() {
|
|
|
1191
1289
|
async function cmdStatus() {
|
|
1192
1290
|
const cfg = await getEffectiveConfig();
|
|
1193
1291
|
if (!cfg) {
|
|
1194
|
-
|
|
1292
|
+
log4(kleur8.yellow("\uC5F0\uACB0\uB41C Mimi Seed \uACC4\uC815\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. `mimi-seed init` \uC2E4\uD589."));
|
|
1195
1293
|
process.exit(1);
|
|
1196
1294
|
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1295
|
+
log4(kleur8.bold("Mimi Seed \uC5F0\uACB0 \uC0C1\uD0DC"));
|
|
1296
|
+
log4(` \uD1A0\uD070: ${cfg.prefix}\u2026 (${cfg.createdAt.slice(0, 10)})`);
|
|
1297
|
+
log4(` \uC5D4\uB4DC\uD3EC\uC778\uD2B8: ${cfg.endpoint}`);
|
|
1298
|
+
log4("");
|
|
1299
|
+
log4("\u{1F4CB} \uC571 \uBAA9\uB85D:");
|
|
1202
1300
|
const r = await mcpCall(cfg.endpoint, cfg.token, "list_apps", {});
|
|
1203
1301
|
if (r.isError) {
|
|
1204
|
-
|
|
1302
|
+
log4(kleur8.red("\uC870\uD68C \uC2E4\uD328: " + r.text));
|
|
1205
1303
|
process.exit(1);
|
|
1206
1304
|
}
|
|
1207
|
-
for (const line of r.text.split("\n"))
|
|
1305
|
+
for (const line of r.text.split("\n")) log4(" " + line);
|
|
1208
1306
|
}
|
|
1209
1307
|
async function cmdLogout() {
|
|
1210
1308
|
await deleteConfig();
|
|
1211
|
-
|
|
1212
|
-
|
|
1309
|
+
log4(kleur8.green("\u2713 \uB85C\uCEEC \uC124\uC815 \uC0AD\uC81C \uC644\uB8CC."));
|
|
1310
|
+
log4(kleur8.dim("\uC6F9\uC5D0\uC11C \uD1A0\uD070 \uD574\uC9C0: /workspace/api-tokens"));
|
|
1213
1311
|
}
|
|
1214
1312
|
function printHelp() {
|
|
1215
|
-
|
|
1313
|
+
log4(`${kleur8.bold("mimi-seed")} \u2014 Claude Code\uC5D0\uC11C \uC571 \uCD9C\uC2DC \uC6B4\uC601
|
|
1216
1314
|
|
|
1217
|
-
${
|
|
1218
|
-
${
|
|
1219
|
-
${
|
|
1220
|
-
${
|
|
1221
|
-
${
|
|
1222
|
-
${
|
|
1223
|
-
${
|
|
1224
|
-
${
|
|
1225
|
-
${
|
|
1226
|
-
${
|
|
1315
|
+
${kleur8.bold("\uBA85\uB839\uC5B4:")}
|
|
1316
|
+
${kleur8.cyan("mimi-seed init")} \uD604\uC7AC \uD504\uB85C\uC81D\uD2B8\uB97C Mimi Seed\uC5D0 \uC5F0\uACB0
|
|
1317
|
+
${kleur8.cyan("mimi-seed status")} \uC5F0\uACB0 \uC0C1\uD0DC + \uB4F1\uB85D \uC571 \uBAA9\uB85D
|
|
1318
|
+
${kleur8.cyan("mimi-seed auth")} Google OAuth \uC778\uC99D (Firebase/AdMob/Play). 'mimi-seed auth --help'
|
|
1319
|
+
${kleur8.cyan("mimi-seed doctor")} \uD658\uACBD \uC9C4\uB2E8 (\uD1A0\uD070\xB7Git\xB7\uD504\uB85C\uC81D\uD2B8\xB7CI \uCCB4\uD06C)
|
|
1320
|
+
${kleur8.cyan("mimi-seed check")} \uCD9C\uC2DC \uC804 Readiness \uC810\uAC80
|
|
1321
|
+
${kleur8.cyan("mimi-seed notes")} \uB9B4\uB9AC\uC988 \uB178\uD2B8 \uC0DD\uC131 (git log \u2192 AI \u2192 \uB9C8\uCF13 \uC801\uC6A9)
|
|
1322
|
+
${kleur8.cyan("mimi-seed review")} \uB9AC\uBDF0 \uB2F5\uBCC0 AI \uCD08\uC548 \uC0DD\uC131 \uBC0F Play Store \uAC8C\uC2DC
|
|
1323
|
+
${kleur8.cyan("mimi-seed deploy")} \uC571 \uC790\uB3D9 \uBC30\uD3EC (Jenkins \u2192 Play Store/App Store)
|
|
1324
|
+
${kleur8.cyan("mimi-seed restart")} MCP \uC11C\uBC84 \uD504\uB85C\uC138\uC2A4 \uC7AC\uC2DC\uC791 (\uAE30\uBCF8: mimi-seed)
|
|
1325
|
+
${kleur8.cyan("mimi-seed logout")} \uB85C\uCEEC \uC124\uC815 \uC0AD\uC81C
|
|
1227
1326
|
|
|
1228
|
-
${
|
|
1327
|
+
${kleur8.bold("mimi-seed notes \uC635\uC158:")}
|
|
1229
1328
|
--from <ref> \uC2DC\uC791 \uCEE4\uBC0B/\uD0DC\uADF8 (\uAE30\uBCF8: \uCD5C\uC2E0 \uD0DC\uADF8)
|
|
1230
1329
|
--to <ref> \uB05D \uCEE4\uBC0B (\uAE30\uBCF8: HEAD)
|
|
1231
1330
|
--locale ko,en-US \uB300\uC0C1 \uB85C\uCF00\uC77C (\uC27C\uD45C \uAD6C\uBD84)
|
|
@@ -1233,11 +1332,11 @@ ${kleur7.bold("mimi-seed notes \uC635\uC158:")}
|
|
|
1233
1332
|
--no-interactive CI \uBAA8\uB4DC (\uD504\uB86C\uD504\uD2B8 \uC5C6\uC74C)
|
|
1234
1333
|
--limit <n> \uCD5C\uB300 \uCEE4\uBC0B \uC218 (\uAE30\uBCF8: 30)
|
|
1235
1334
|
|
|
1236
|
-
${
|
|
1335
|
+
${kleur8.bold("mimi-seed check \uC635\uC158:")}
|
|
1237
1336
|
--app <id> \uC571 ID \uC9C0\uC815
|
|
1238
1337
|
--fail-on-blocker \uBE14\uB85C\uCEE4 \uC788\uC73C\uBA74 exit 1 (CI\uC6A9)
|
|
1239
1338
|
|
|
1240
|
-
${
|
|
1339
|
+
${kleur8.bold("mimi-seed review \uC635\uC158:")}
|
|
1241
1340
|
--text <\uB0B4\uC6A9> \uB9AC\uBDF0 \uC6D0\uBB38 (\uBBF8\uC785\uB825 \uC2DC \uB300\uD654\uD615 \uD504\uB86C\uD504\uD2B8)
|
|
1242
1341
|
--rating <1-5> \uBCC4\uC810
|
|
1243
1342
|
--tone <tone> friendly / professional / empathetic / brief (\uAE30\uBCF8: friendly)
|
|
@@ -1248,7 +1347,7 @@ ${kleur7.bold("mimi-seed review \uC635\uC158:")}
|
|
|
1248
1347
|
--package-name <p> \uD328\uD0A4\uC9C0\uBA85 (--apply \uC2DC \uD544\uC694)
|
|
1249
1348
|
--no-interactive CI \uBAA8\uB4DC
|
|
1250
1349
|
|
|
1251
|
-
${
|
|
1350
|
+
${kleur8.bold("mimi-seed deploy \uC635\uC158:")}
|
|
1252
1351
|
--platform android|ios \uBC30\uD3EC \uD50C\uB7AB\uD3FC (\uAE30\uBCF8: android)
|
|
1253
1352
|
--app <id> \uC571 ID \uC9C0\uC815
|
|
1254
1353
|
--version-code <n> \uBE4C\uB4DC \uBC88\uD638 \uC9C1\uC811 \uC9C0\uC815 (--skip-build \uC640 \uD568\uAED8)
|
|
@@ -1259,7 +1358,7 @@ ${kleur7.bold("mimi-seed deploy \uC635\uC158:")}
|
|
|
1259
1358
|
--skip-build Jenkins \uBE4C\uB4DC \uAC74\uB108\uB700 (--version-code \uD544\uC218)
|
|
1260
1359
|
setup-jenkins Jenkins \uC124\uC815 \uB300\uD654\uD615 \uB4F1\uB85D
|
|
1261
1360
|
|
|
1262
|
-
${
|
|
1361
|
+
${kleur8.bold("\uD658\uACBD\uBCC0\uC218:")}
|
|
1263
1362
|
MIMI_SEED_TOKEN PAT \uD1A0\uD070 (CI/CD \uBB34\uC778\uC99D \uBAA8\uB4DC)
|
|
1264
1363
|
MIMI_SEED_WEB_BASE \uC11C\uBC84 \uC8FC\uC18C (\uAE30\uBCF8: https://mimi-seed.pryzm.gg)
|
|
1265
1364
|
ANTHROPIC_API_KEY AI \uB178\uD2B8 \uC0DD\uC131 \uD65C\uC131\uD654 (\uC120\uD0DD)
|
|
@@ -1294,6 +1393,9 @@ async function main() {
|
|
|
1294
1393
|
case "deploy":
|
|
1295
1394
|
await cmdDeploy(restArgs);
|
|
1296
1395
|
break;
|
|
1396
|
+
case "restart":
|
|
1397
|
+
await cmdRestart(restArgs);
|
|
1398
|
+
break;
|
|
1297
1399
|
case "logout":
|
|
1298
1400
|
await cmdLogout();
|
|
1299
1401
|
break;
|
|
@@ -1303,13 +1405,13 @@ async function main() {
|
|
|
1303
1405
|
printHelp();
|
|
1304
1406
|
break;
|
|
1305
1407
|
default:
|
|
1306
|
-
|
|
1408
|
+
log4(kleur8.red(`\uC54C \uC218 \uC5C6\uB294 \uBA85\uB839: ${cmd}`));
|
|
1307
1409
|
printHelp();
|
|
1308
1410
|
process.exit(1);
|
|
1309
1411
|
}
|
|
1310
1412
|
} catch (e) {
|
|
1311
|
-
|
|
1312
|
-
if (process.env.DEBUG)
|
|
1413
|
+
log4(kleur8.red(`\uC624\uB958: ${e.message}`));
|
|
1414
|
+
if (process.env.DEBUG) log4(e.stack ?? "");
|
|
1313
1415
|
process.exit(1);
|
|
1314
1416
|
}
|
|
1315
1417
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mimi-seed",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Mimi Seed CLI — Claude Code에서 앱 출시 운영을 관리합니다.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mimi-seed": "dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
9
10
|
"files": [
|
|
10
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"LICENSE"
|
|
11
13
|
],
|
|
12
14
|
"scripts": {
|
|
13
15
|
"build": "tsup",
|
package/dist/chunk-FW4DVFZD.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/mcp-client.ts
|
|
4
|
-
async function postMcp(endpoint, token, body, sessionId) {
|
|
5
|
-
const headers = {
|
|
6
|
-
"Content-Type": "application/json",
|
|
7
|
-
Accept: "application/json, text/event-stream",
|
|
8
|
-
Authorization: `Bearer ${token}`
|
|
9
|
-
};
|
|
10
|
-
if (sessionId) headers["Mcp-Session-Id"] = sessionId;
|
|
11
|
-
const res = await fetch(endpoint, { method: "POST", headers, body: JSON.stringify(body) });
|
|
12
|
-
const newSession = res.headers.get("Mcp-Session-Id") ?? sessionId ?? null;
|
|
13
|
-
const contentType = res.headers.get("content-type") ?? "";
|
|
14
|
-
let payload;
|
|
15
|
-
if (contentType.includes("text/event-stream")) {
|
|
16
|
-
const text = await res.text();
|
|
17
|
-
const line = text.split("\n").map((l) => l.trim()).find((l) => l.startsWith("data:"));
|
|
18
|
-
if (!line) throw new Error("MCP SSE \uC751\uB2F5\uC5D0 data \uC5C6\uC74C");
|
|
19
|
-
payload = JSON.parse(line.slice(5).trim());
|
|
20
|
-
} else {
|
|
21
|
-
payload = await res.json();
|
|
22
|
-
}
|
|
23
|
-
return { payload, sessionId: newSession };
|
|
24
|
-
}
|
|
25
|
-
async function mcpCall(endpoint, token, name, args) {
|
|
26
|
-
const { payload: initPayload, sessionId } = await postMcp(endpoint, token, {
|
|
27
|
-
jsonrpc: "2.0",
|
|
28
|
-
id: 1,
|
|
29
|
-
method: "initialize",
|
|
30
|
-
params: {
|
|
31
|
-
protocolVersion: "2024-11-05",
|
|
32
|
-
capabilities: {},
|
|
33
|
-
clientInfo: { name: "mimi-seed-cli", version: "1.0.0" }
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
if (initPayload.error) throw new Error(`MCP init \uC2E4\uD328: ${initPayload.error.message}`);
|
|
37
|
-
await postMcp(endpoint, token, {
|
|
38
|
-
jsonrpc: "2.0",
|
|
39
|
-
method: "notifications/initialized"
|
|
40
|
-
}, sessionId ?? void 0).catch(() => null);
|
|
41
|
-
const { payload } = await postMcp(endpoint, token, {
|
|
42
|
-
jsonrpc: "2.0",
|
|
43
|
-
id: 2,
|
|
44
|
-
method: "tools/call",
|
|
45
|
-
params: { name, arguments: args }
|
|
46
|
-
}, sessionId ?? void 0);
|
|
47
|
-
if (payload.error) {
|
|
48
|
-
return { text: payload.error.message, isError: true };
|
|
49
|
-
}
|
|
50
|
-
const content = payload.result?.content ?? [];
|
|
51
|
-
const text = content.filter((c) => c.type === "text").map((c) => c.text ?? "").join("\n");
|
|
52
|
-
return { text, isError: payload.result?.isError ?? false };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
mcpCall
|
|
57
|
-
};
|