mimi-seed 0.25.3 → 0.25.4
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.
|
@@ -6,19 +6,38 @@ import * as readline2 from "readline";
|
|
|
6
6
|
import os10 from "os";
|
|
7
7
|
|
|
8
8
|
// ../core/src/console-url.ts
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var RETIRED_HOSTS = /* @__PURE__ */ new Set(["mimi-seed.pryzm.gg", "mimi-seed.oddbout.com"]);
|
|
10
|
+
var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
11
|
+
function inspect(value) {
|
|
12
|
+
let url;
|
|
11
13
|
try {
|
|
12
|
-
|
|
13
|
-
const host = url.hostname.replace(/\.$/, "");
|
|
14
|
-
if (host === "mimi-seed.pryzm.gg" || host === "mimi-seed.oddbout.com") return null;
|
|
15
|
-
const local = ["localhost", "127.0.0.1", "[::1]"].includes(host);
|
|
16
|
-
if (url.protocol !== "https:" && !(local && url.protocol === "http:")) return null;
|
|
17
|
-
if (url.username || url.password || url.search || url.hash) return null;
|
|
18
|
-
return url.href.replace(/\/+$/, "");
|
|
14
|
+
url = new URL(value);
|
|
19
15
|
} catch {
|
|
20
16
|
return null;
|
|
21
17
|
}
|
|
18
|
+
const host = url.hostname.replace(/\.$/, "");
|
|
19
|
+
if (RETIRED_HOSTS.has(host)) return { url, problem: "retired" };
|
|
20
|
+
if (url.protocol !== "https:" && !(LOOPBACK_HOSTS.has(host) && url.protocol === "http:")) return { url, problem: "not-https" };
|
|
21
|
+
if (url.username || url.password) return { url, problem: "credentials" };
|
|
22
|
+
if (url.search || url.hash || /[?#]/.test(value)) return { url, problem: "query" };
|
|
23
|
+
return { url, problem: null };
|
|
24
|
+
}
|
|
25
|
+
function consoleUrl(value) {
|
|
26
|
+
if (!value) return null;
|
|
27
|
+
const inspected = inspect(value);
|
|
28
|
+
if (!inspected || inspected.problem) return null;
|
|
29
|
+
return inspected.url.href.replace(/\/+$/, "");
|
|
30
|
+
}
|
|
31
|
+
function consoleBaseProblem(value) {
|
|
32
|
+
if (!value) return null;
|
|
33
|
+
const inspected = inspect(value);
|
|
34
|
+
if (!inspected) return "invalid";
|
|
35
|
+
if (inspected.problem) return inspected.problem;
|
|
36
|
+
return inspected.url.pathname === "/" ? null : "path";
|
|
37
|
+
}
|
|
38
|
+
function consoleBase(value) {
|
|
39
|
+
if (consoleBaseProblem(value) !== null || !value) return null;
|
|
40
|
+
return new URL(value).origin;
|
|
22
41
|
}
|
|
23
42
|
|
|
24
43
|
// src/credentials.ts
|
|
@@ -801,6 +820,29 @@ function readJson(home, name) {
|
|
|
801
820
|
return null;
|
|
802
821
|
}
|
|
803
822
|
}
|
|
823
|
+
var YOUTUBE_UPLOAD_SCOPE = "https://www.googleapis.com/auth/youtube.force-ssl";
|
|
824
|
+
var YOUTUBE_PROFILE = "youtube";
|
|
825
|
+
var GOOGLE_PROFILE_FILE = /^[a-z0-9][a-z0-9_-]{0,63}\.json$/;
|
|
826
|
+
function hasYouTubeUpload(tokens) {
|
|
827
|
+
return typeof tokens?.scope === "string" && tokens.scope.split(/\s+/).includes(YOUTUBE_UPLOAD_SCOPE);
|
|
828
|
+
}
|
|
829
|
+
function detectYouTubeGrant(home) {
|
|
830
|
+
const found = [];
|
|
831
|
+
if (hasYouTubeUpload(readJson(home, "tokens.json"))) found.push("default");
|
|
832
|
+
let files = [];
|
|
833
|
+
try {
|
|
834
|
+
files = fs5.readdirSync(path5.join(credDir(home), "google-profiles")).filter((f) => GOOGLE_PROFILE_FILE.test(f)).sort();
|
|
835
|
+
} catch {
|
|
836
|
+
}
|
|
837
|
+
for (const file of files) {
|
|
838
|
+
const doc = readJson(home, path5.join("google-profiles", file));
|
|
839
|
+
if (!hasYouTubeUpload(doc?.tokens)) continue;
|
|
840
|
+
const raw = doc?.tokens?.youtubeChannel?.title;
|
|
841
|
+
const title = typeof raw === "string" ? raw.replace(new RegExp("\\p{Cc}", "gu"), "").slice(0, 60) : "";
|
|
842
|
+
found.push(`profile ${file.slice(0, -5)}${title ? ` (${title})` : ""}`);
|
|
843
|
+
}
|
|
844
|
+
return found.length > 0 ? { present: true, detail: found.join(", ") } : { present: false };
|
|
845
|
+
}
|
|
804
846
|
var EXPIRING_SOON_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
805
847
|
function detectSocialToken(home, file, idKey, tokenKey, nestedPlatform) {
|
|
806
848
|
const root = readJson(home, file);
|
|
@@ -898,10 +940,10 @@ var CREDENTIALS = [
|
|
|
898
940
|
docsAnchor: "cloud-pat",
|
|
899
941
|
detect: (home) => {
|
|
900
942
|
if (process.env.MIMI_SEED_TOKEN) {
|
|
901
|
-
return
|
|
943
|
+
return consoleBase(process.env.MIMI_SEED_WEB_BASE) ? { present: true, detail: "MIMI_SEED_TOKEN (env)" } : { present: false };
|
|
902
944
|
}
|
|
903
945
|
const cfg = readJson(home, "config.json");
|
|
904
|
-
return cfg?.prefix &&
|
|
946
|
+
return cfg?.prefix && consoleBase(cfg.webBase) && consoleUrl(cfg.endpoint) ? { present: true, detail: `${cfg.prefix}\u2026` } : { present: false };
|
|
905
947
|
}
|
|
906
948
|
},
|
|
907
949
|
{
|
|
@@ -1206,6 +1248,36 @@ var CREDENTIALS = [
|
|
|
1206
1248
|
return typeof cfg?.developerToken === "string" && cfg.developerToken && isId(cfg.customerId) && loginOk ? { present: true, detail: String(cfg.customerId) } : { present: false };
|
|
1207
1249
|
}
|
|
1208
1250
|
},
|
|
1251
|
+
{
|
|
1252
|
+
id: "youtube",
|
|
1253
|
+
label: {
|
|
1254
|
+
ko: "YouTube \uC5C5\uB85C\uB4DC",
|
|
1255
|
+
en: "YouTube upload"
|
|
1256
|
+
},
|
|
1257
|
+
requirement: "optional",
|
|
1258
|
+
group: "marketing",
|
|
1259
|
+
file: "~/.mimi-seed/tokens.json",
|
|
1260
|
+
// 기본 로그인(tokens.json)이 아니라 별도 Google 프로필에 연결한다. 채널 계정이 Play·Firebase 계정과 다르면
|
|
1261
|
+
// 기본 로그인에 YouTube 를 붙이는 순간 그 계정으로 tokens.json 이 교체돼 기존 연결이 끊긴다.
|
|
1262
|
+
fix: `mimi-seed auth login --profile ${YOUTUBE_PROFILE} --domains youtube`,
|
|
1263
|
+
setup: { kind: "mcp-bin", bin: "mimi-seed-auth", args: ["--profile", YOUTUBE_PROFILE, "--domains", "youtube"] },
|
|
1264
|
+
obtain: {
|
|
1265
|
+
ko: [
|
|
1266
|
+
"\uB530\uB85C \uBC1C\uAE09\uBC1B\uC744 \uD1A0\uD070\uC774 \uC5C6\uB2E4 \u2014 \uCC44\uB110\uC744 \uAC00\uC9C4 Google \uACC4\uC815\uC73C\uB85C \uB85C\uADF8\uC778\uD574 YouTube \uAD8C\uD55C\uC5D0 \uB3D9\uC758\uD55C\uB2E4.",
|
|
1267
|
+
`\uAE30\uBCF8 Google \uB85C\uADF8\uC778\uACFC \uBD84\uB9AC\uB41C '${YOUTUBE_PROFILE}' \uD504\uB85C\uD544\uC5D0 \uC800\uC7A5\uB418\uBBC0\uB85C Play\xB7Firebase \uB85C\uADF8\uC778\uC740 \uADF8\uB300\uB85C\uB2E4.`,
|
|
1268
|
+
"\uAE30\uBCF8 \uB85C\uADF8\uC778\uC5D0 \uC4F4 OAuth \uD074\uB77C\uC774\uC5B8\uD2B8\uB97C \uC7AC\uC0AC\uC6A9\uD55C\uB2E4. \uC800\uC7A5\uB41C \uCC44\uB110\uC740 \uB85C\uADF8\uC778 \uB54C \uD655\uC778\uD574 \uD568\uAED8 \uAE30\uB85D\uD55C\uB2E4.",
|
|
1269
|
+
`youtube_* \uB3C4\uAD6C\uC5D0\uB294 profile="${YOUTUBE_PROFILE}" \uB97C \uB118\uAE34\uB2E4 (\uC5C5\uB85C\uB4DC\uB294 expectedChannelId \uB85C \uCC44\uB110\uC744 \uB2E4\uC2DC \uD655\uC778\uD55C\uB2E4).`
|
|
1270
|
+
],
|
|
1271
|
+
en: [
|
|
1272
|
+
"Nothing to obtain separately \u2014 sign in with the Google account that owns the channel and approve YouTube.",
|
|
1273
|
+
`It is saved to a separate '${YOUTUBE_PROFILE}' profile, so your default Google login (Play, Firebase) is untouched.`,
|
|
1274
|
+
"The OAuth client from your default login is reused. The channel is looked up at sign-in and recorded.",
|
|
1275
|
+
`Pass profile="${YOUTUBE_PROFILE}" to youtube_* tools (uploads re-check the channel with expectedChannelId).`
|
|
1276
|
+
]
|
|
1277
|
+
},
|
|
1278
|
+
docsAnchor: "google-oauth",
|
|
1279
|
+
detect: (home) => detectYouTubeGrant(home)
|
|
1280
|
+
},
|
|
1209
1281
|
{
|
|
1210
1282
|
id: "facebook",
|
|
1211
1283
|
label: {
|
|
@@ -1247,13 +1319,15 @@ var CREDENTIALS = [
|
|
|
1247
1319
|
setup: { kind: "mcp-bin", bin: "mimi-seed-social-auth", args: ["instagram"] },
|
|
1248
1320
|
obtain: {
|
|
1249
1321
|
ko: [
|
|
1250
|
-
"
|
|
1322
|
+
"`mimi-seed auth instagram`\uC740 \uB0B4 Meta \uC571(Instagram \uC571 ID\xB7\uC2DC\uD06C\uB9BF\xB7\uB9AC\uB514\uB809\uC158 URI)\uC73C\uB85C \uBE0C\uB77C\uC6B0\uC800 \uB85C\uADF8\uC778\uD55C\uB2E4. \uC11C\uBC84\uAC00 \uD544\uC694 \uC5C6\uB2E4.",
|
|
1323
|
+
"\uD1A0\uD070\uC744 \uC9C1\uC811 \uB123\uC744 \uB54C(--manual-token)\uB294 long-lived \uD1A0\uD070 \uB450 \uD615\uC2DD \uBAA8\uB450 \uC9C0\uC6D0\uD55C\uB2E4 (\uC790\uB3D9 \uAC10\uC9C0):",
|
|
1251
1324
|
" \u2022 IGAA\u2026 \u2014 Instagram Login (Meta \uC2E0\uADDC \uBC29\uC2DD, Facebook \uD398\uC774\uC9C0 \uBD88\uD544\uC694)",
|
|
1252
1325
|
" \u2022 EAA\u2026 \u2014 Facebook Login (IG **\uBE44\uC988\uB2C8\uC2A4** \uACC4\uC815\uC774 FB \uD398\uC774\uC9C0\uC5D0 \uC5F0\uACB0\uB3FC \uC788\uC5B4\uC57C \uD568)",
|
|
1253
1326
|
"\uD1A0\uD070 \uC218\uBA85\uC740 \uC57D 60\uC77C\uC774\uB2E4."
|
|
1254
1327
|
],
|
|
1255
1328
|
en: [
|
|
1256
|
-
"
|
|
1329
|
+
"`mimi-seed auth instagram` signs in through the browser with your own Meta app (Instagram app ID, secret, redirect URI). No server is needed.",
|
|
1330
|
+
"When pasting a token (--manual-token), both long-lived token shapes are supported (auto-detected):",
|
|
1257
1331
|
" \u2022 IGAA\u2026 \u2014 Instagram Login (Meta's newer path, no Facebook Page required)",
|
|
1258
1332
|
" \u2022 EAA\u2026 \u2014 Facebook Login (needs an Instagram **Business** account linked to a FB Page)",
|
|
1259
1333
|
"Tokens last about 60 days."
|
|
@@ -1276,15 +1350,15 @@ var CREDENTIALS = [
|
|
|
1276
1350
|
obtain: {
|
|
1277
1351
|
ko: [
|
|
1278
1352
|
"Instagram \uACFC **\uBCC4\uAC1C \uACC4\uC815\xB7\uBCC4\uAC1C \uD1A0\uD070**\uC774\uB2E4 (Threads Graph API).",
|
|
1279
|
-
"`mimi-seed auth threads`\
|
|
1280
|
-
"\uBE0C\uB85C\uCEE4 \
|
|
1353
|
+
"`mimi-seed auth threads`\uB294 \uB0B4 Meta \uC571(Threads \uC571 ID\xB7\uC2DC\uD06C\uB9BF\xB7\uB9AC\uB514\uB809\uC158 URI)\uC73C\uB85C \uBE0C\uB77C\uC6B0\uC800 \uB85C\uADF8\uC778\uD55C\uB2E4. \uC11C\uBC84\uAC00 \uD544\uC694 \uC5C6\uB2E4.",
|
|
1354
|
+
"MIMI_SEED_WEB_BASE\uC5D0 \uD300 \uBE0C\uB85C\uCEE4\uAC00 \uC124\uC815\uB3FC \uC788\uC73C\uBA74 \uBE0C\uB85C\uCEE4\uB97C \uB300\uC2E0 \uC4F4\uB2E4 (SDK\uAC00 \uBE0C\uB85C\uCEE4\uB97C \uBC30\uD3EC\uD558\uC9C0\uB294 \uC54A\uB294\uB2E4).",
|
|
1281
1355
|
"\uD1A0\uD070\uC744 \uC9C1\uC811 \uBD99\uC5EC \uB123\uB294 `--manual-token`\uC740 \uACE0\uAE09/\uD5E4\uB4DC\uB9AC\uC2A4 \uD750\uB984\uC774\uB2E4. \uC800\uC7A5 \uC804\uC5D0 Threads \uACC4\uC815\uC744 \uAC80\uC99D\uD55C\uB2E4.",
|
|
1282
1356
|
"`--profile <id>`\uB85C \uC774\uB984 \uC788\uB294 \uACC4\uC815\uC744 \uC800\uC7A5\uD560 \uC218 \uC788\uC73C\uBA70, OAuth \uC751\uB2F5\uC758 \uC2E4\uC81C \uB9CC\uB8CC \uC2DC\uAC01\uC744 \uB85C\uCEEC \uD504\uB85C\uD544\uC5D0 \uAE30\uB85D\uD55C\uB2E4."
|
|
1283
1357
|
],
|
|
1284
1358
|
en: [
|
|
1285
1359
|
"A **separate account and token** from Instagram (Threads Graph API).",
|
|
1286
|
-
"
|
|
1287
|
-
"
|
|
1360
|
+
"`mimi-seed auth threads` signs in through the browser with your own Meta app (Threads app ID, secret, redirect URI). No server is needed.",
|
|
1361
|
+
"If MIMI_SEED_WEB_BASE points to a team broker, that broker is used instead (the SDK does not deploy it).",
|
|
1288
1362
|
"Pasting a token with `--manual-token` is the advanced/headless path; the Threads account is verified before saving.",
|
|
1289
1363
|
"Use `--profile <id>` for a named account; the actual expiry returned by OAuth is saved in the local profile."
|
|
1290
1364
|
]
|
|
@@ -1398,7 +1472,7 @@ function isSatisfied(spec, detected) {
|
|
|
1398
1472
|
}
|
|
1399
1473
|
function missingRequired(detected, platforms) {
|
|
1400
1474
|
return CREDENTIALS.filter((spec) => {
|
|
1401
|
-
if (spec.id === "mimiseed") return !!
|
|
1475
|
+
if (spec.id === "mimiseed") return !!consoleBase(process.env.MIMI_SEED_WEB_BASE) && !isSatisfied(spec, detected);
|
|
1402
1476
|
if (spec.requirement === "optional") return false;
|
|
1403
1477
|
if (spec.requirement === "platform" && !platforms.includes(spec.platform)) return false;
|
|
1404
1478
|
return !isSatisfied(spec, detected);
|
|
@@ -1412,7 +1486,7 @@ function planSetup(detected, opts = {}) {
|
|
|
1412
1486
|
const platforms = opts.platforms ?? [];
|
|
1413
1487
|
return CREDENTIALS.filter((spec) => {
|
|
1414
1488
|
if (only && !only.has(spec.id)) return false;
|
|
1415
|
-
if (spec.id === "mimiseed" && !only && !reconnect.has(spec.id) && !
|
|
1489
|
+
if (spec.id === "mimiseed" && !only && !reconnect.has(spec.id) && !consoleBase(process.env.MIMI_SEED_WEB_BASE)) return false;
|
|
1416
1490
|
if (reconnect.has(spec.id)) return true;
|
|
1417
1491
|
const found = detected.get(spec.id);
|
|
1418
1492
|
if (found?.freshness === "expired" || found?.freshness === "expiring") return true;
|
|
@@ -1433,7 +1507,7 @@ import path7 from "path";
|
|
|
1433
1507
|
import { fileURLToPath } from "url";
|
|
1434
1508
|
|
|
1435
1509
|
// package.json
|
|
1436
|
-
var version = "0.25.
|
|
1510
|
+
var version = "0.25.4";
|
|
1437
1511
|
|
|
1438
1512
|
// src/lib/windows-path.ts
|
|
1439
1513
|
import path6 from "path";
|
|
@@ -1625,7 +1699,9 @@ var IN_SCOPE_FILES = /* @__PURE__ */ new Set([
|
|
|
1625
1699
|
"google-ads.json",
|
|
1626
1700
|
"jenkins.json",
|
|
1627
1701
|
"ci.json",
|
|
1628
|
-
"config.json"
|
|
1702
|
+
"config.json",
|
|
1703
|
+
// 사용자 본인의 Meta 앱 시크릿 — 만료되지 않고, 그 앱을 쓰는 모든 계정의 토큰을 만들 수 있다.
|
|
1704
|
+
"meta-apps.json"
|
|
1629
1705
|
]);
|
|
1630
1706
|
var IN_SCOPE_DIRS = /* @__PURE__ */ new Set(["google-profiles", "play-service-accounts", "social-profiles"]);
|
|
1631
1707
|
function isEncryptableCredential(aad) {
|
|
@@ -2093,7 +2169,7 @@ var CONFIG_LOCATION = CONFIG_PATH;
|
|
|
2093
2169
|
async function getEffectiveConfig() {
|
|
2094
2170
|
const envToken = process.env.MIMI_SEED_TOKEN;
|
|
2095
2171
|
if (envToken) {
|
|
2096
|
-
const webBase =
|
|
2172
|
+
const webBase = consoleBase(process.env.MIMI_SEED_WEB_BASE);
|
|
2097
2173
|
if (!webBase) return null;
|
|
2098
2174
|
return {
|
|
2099
2175
|
token: envToken,
|
|
@@ -2104,7 +2180,7 @@ async function getEffectiveConfig() {
|
|
|
2104
2180
|
};
|
|
2105
2181
|
}
|
|
2106
2182
|
const saved = await readConfig();
|
|
2107
|
-
return saved?.token &&
|
|
2183
|
+
return saved?.token && consoleBase(saved.webBase) && consoleUrl(saved.endpoint) ? saved : null;
|
|
2108
2184
|
}
|
|
2109
2185
|
|
|
2110
2186
|
// src/deploy-stream.ts
|
|
@@ -3332,13 +3408,15 @@ var M9 = catalog(
|
|
|
3332
3408
|
notice: "\uC120\uD0DD\uC801 \uC0AC\uC6A9\uB7C9 \uCE21\uC815\uC740 \uAEBC\uC838 \uC788\uC2B5\uB2C8\uB2E4. \uC548\uB0B4: mimi-seed telemetry --help\n",
|
|
3333
3409
|
enabled: "\uC0AC\uC6A9\uB7C9 \uCE21\uC815 \uCF1C\uC9D0. \uC784\uC758 \uC124\uCE58 ID\xB7\uD504\uB85C\uC81D\uD2B8 \uD574\uC2DC\xB7\uBC84\uC804\xB7OS\xB7\uACB0\uACFC \uCF54\uB4DC\xB7\uC2E4\uD589\uC2DC\uAC04\uC744 \uC804\uC1A1\uD569\uB2C8\uB2E4. \uB044\uAE30: mimi-seed telemetry off\n",
|
|
3334
3410
|
disabled: "\uC0AC\uC6A9\uB7C9 \uCE21\uC815 \uAEBC\uC9D0. MIMI_SEED_TELEMETRY=0\uC73C\uB85C\uB3C4 \uB04C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n",
|
|
3335
|
-
invalid: "\uC0AC\uC6A9\uBC95: mimi-seed telemetry on|off|status\n"
|
|
3411
|
+
invalid: "\uC0AC\uC6A9\uBC95: mimi-seed telemetry on|off|status\n",
|
|
3412
|
+
noConsole: "\uC0AC\uC6A9\uB7C9 \uCE21\uC815\uC740 \uD300 \uCF58\uC194\uB85C\uB9CC \uBCF4\uB0C5\uB2C8\uB2E4 \u2014 \uCF1C\uB824\uBA74 \uBA3C\uC800 MIMI_SEED_WEB_BASE \uC5D0 \uD300 \uCF58\uC194 \uC8FC\uC18C\uB97C \uC9C0\uC815\uD558\uC138\uC694. \uC544\uBB34\uAC83\uB3C4 \uBC14\uAFB8\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.\n"
|
|
3336
3413
|
},
|
|
3337
3414
|
{
|
|
3338
3415
|
notice: "Optional usage measurement is off. Learn more: mimi-seed telemetry --help\n",
|
|
3339
3416
|
enabled: "Usage measurement enabled: random installation ID, project hash, version, OS, result codes and duration. Disable: mimi-seed telemetry off\n",
|
|
3340
3417
|
disabled: "Usage measurement disabled. MIMI_SEED_TELEMETRY=0 also disables it.\n",
|
|
3341
|
-
invalid: "Usage: mimi-seed telemetry on|off|status\n"
|
|
3418
|
+
invalid: "Usage: mimi-seed telemetry on|off|status\n",
|
|
3419
|
+
noConsole: "Usage measurement is sent only to a team console \u2014 set MIMI_SEED_WEB_BASE to your team console first. Nothing was changed.\n"
|
|
3342
3420
|
}
|
|
3343
3421
|
);
|
|
3344
3422
|
var location = () => path16.join(os9.homedir(), ".mimi-seed", "telemetry.json");
|
|
@@ -3354,12 +3432,13 @@ function writeConsent(value) {
|
|
|
3354
3432
|
writeCredentialJson(location(), value);
|
|
3355
3433
|
}
|
|
3356
3434
|
function telemetryEnabled() {
|
|
3357
|
-
const webBase =
|
|
3435
|
+
const webBase = consoleBase(process.env.MIMI_SEED_WEB_BASE);
|
|
3358
3436
|
if (!webBase) return false;
|
|
3359
3437
|
if (process.env.MIMI_SEED_TELEMETRY !== void 0) return process.env.MIMI_SEED_TELEMETRY === "1";
|
|
3360
3438
|
return readConsent(webBase).enabled === true;
|
|
3361
3439
|
}
|
|
3362
3440
|
function telemetryNotice() {
|
|
3441
|
+
if (!consoleBase(process.env.MIMI_SEED_WEB_BASE)) return "";
|
|
3363
3442
|
return telemetryEnabled() ? "" : M9().notice;
|
|
3364
3443
|
}
|
|
3365
3444
|
function cmdTelemetry(argv) {
|
|
@@ -3369,7 +3448,12 @@ function cmdTelemetry(argv) {
|
|
|
3369
3448
|
process.exitCode = 2;
|
|
3370
3449
|
return;
|
|
3371
3450
|
}
|
|
3372
|
-
const webBase =
|
|
3451
|
+
const webBase = consoleBase(process.env.MIMI_SEED_WEB_BASE);
|
|
3452
|
+
if (action === "on" && !webBase) {
|
|
3453
|
+
process.stderr.write(M9().noConsole);
|
|
3454
|
+
process.exitCode = 1;
|
|
3455
|
+
return;
|
|
3456
|
+
}
|
|
3373
3457
|
if (action === "on" && webBase) {
|
|
3374
3458
|
const consent = readConsent(webBase);
|
|
3375
3459
|
writeConsent({ webBase, enabled: true, installationId: consent.installationId ?? randomUUID5(), salt: consent.salt ?? randomUUID5() });
|
|
@@ -3389,14 +3473,16 @@ function frameworkAt(root) {
|
|
|
3389
3473
|
return "native-or-unknown";
|
|
3390
3474
|
}
|
|
3391
3475
|
function usageRun(command, projectPath) {
|
|
3392
|
-
const baseUrl =
|
|
3476
|
+
const baseUrl = consoleBase(process.env.MIMI_SEED_WEB_BASE);
|
|
3393
3477
|
if (!baseUrl || !telemetryEnabled()) return async () => {
|
|
3394
3478
|
};
|
|
3395
3479
|
try {
|
|
3396
3480
|
const consent = readConsent(baseUrl);
|
|
3397
3481
|
const installationId = consent.installationId ?? randomUUID5();
|
|
3398
3482
|
const salt = consent.salt ?? randomUUID5();
|
|
3399
|
-
if (!consent.installationId || !consent.salt)
|
|
3483
|
+
if (consent.enabled && (!consent.installationId || !consent.salt)) {
|
|
3484
|
+
writeConsent({ webBase: baseUrl, enabled: true, installationId, salt });
|
|
3485
|
+
}
|
|
3400
3486
|
let normalized = path16.resolve(projectPath);
|
|
3401
3487
|
try {
|
|
3402
3488
|
normalized = fs13.realpathSync(normalized);
|
|
@@ -3416,7 +3502,7 @@ function usageRun(command, projectPath) {
|
|
|
3416
3502
|
};
|
|
3417
3503
|
const started = Date.now();
|
|
3418
3504
|
return async (outcome, report) => {
|
|
3419
|
-
if (!telemetryEnabled() ||
|
|
3505
|
+
if (!telemetryEnabled() || consoleBase(process.env.MIMI_SEED_WEB_BASE) !== baseUrl) return;
|
|
3420
3506
|
const payload = {
|
|
3421
3507
|
...base2,
|
|
3422
3508
|
outcome,
|
|
@@ -3680,7 +3766,8 @@ async function cmdSetup(argv) {
|
|
|
3680
3766
|
}
|
|
3681
3767
|
|
|
3682
3768
|
export {
|
|
3683
|
-
|
|
3769
|
+
consoleBaseProblem,
|
|
3770
|
+
consoleBase,
|
|
3684
3771
|
isLang,
|
|
3685
3772
|
resolveLang,
|
|
3686
3773
|
catalog,
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
cmdDeploy,
|
|
11
11
|
cmdSetup,
|
|
12
12
|
cmdTelemetry,
|
|
13
|
-
|
|
13
|
+
consoleBase,
|
|
14
|
+
consoleBaseProblem,
|
|
14
15
|
credLabel,
|
|
15
16
|
credNote,
|
|
16
17
|
credentialFileProblemMessage,
|
|
@@ -46,7 +47,7 @@ import {
|
|
|
46
47
|
writeConfig,
|
|
47
48
|
writeCredentialFile,
|
|
48
49
|
writeSettings
|
|
49
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-TKIQC6RE.js";
|
|
50
51
|
|
|
51
52
|
// src/index.ts
|
|
52
53
|
import kleur12 from "kleur";
|
|
@@ -337,8 +338,8 @@ var M4 = catalog(
|
|
|
337
338
|
dashboard: (url) => `\uB300\uC2DC\uBCF4\uB4DC: ${url}`,
|
|
338
339
|
nextSetup: " 1) mimi-seed setup \uACC4\uC815 \uC5F0\uACB0 (\uC548\uB0B4\uD615 \u2014 \uAC01 \uB2E8\uACC4\uC5D0\uC11C ? \uB97C \uB204\uB974\uBA74 \uBC1C\uAE09\uCC98 \uC548\uB0B4)",
|
|
339
340
|
nextDoctor: " 2) mimi-seed doctor \uC804\uCCB4 \uC810\uAC80 + \uB204\uB77D \uD56D\uBAA9\uBCC4 \uBCF5\uAD6C \uBA85\uB839",
|
|
340
|
-
localStep1: "Google \uB85C\uADF8\uC778 (Firebase / AdMob / Play / Ads):",
|
|
341
|
-
localStep2: "\uB85C\uCEEC MCP \uC11C\uBC84 \uB4F1\uB85D
|
|
341
|
+
localStep1: "Google \uB85C\uADF8\uC778 (Firebase / AdMob / Play / Ads) \u2014 \uCC98\uC74C\uC774\uBA74 \uB0B4 Google Cloud \uC758 \uB370\uC2A4\uD06C\uD1B1 OAuth \uD074\uB77C\uC774\uC5B8\uD2B8\uB97C MIMI_SEED_GOOGLE_CLIENT_ID / _SECRET \uB85C \uC9C0\uC815 (docs/credentials.md#google-oauth):",
|
|
342
|
+
localStep2: "\uB85C\uCEEC MCP \uC11C\uBC84 \uB4F1\uB85D:",
|
|
342
343
|
localCodexHint: ' Codex: ~/.codex/config.toml \uC5D0 [mcp_servers.mimi-seed-local] command="npx", args=["-y","@yoonion/mimi-seed-mcp@latest"]'
|
|
343
344
|
},
|
|
344
345
|
{
|
|
@@ -365,8 +366,8 @@ var M4 = catalog(
|
|
|
365
366
|
dashboard: (url) => `Dashboard: ${url}`,
|
|
366
367
|
nextSetup: " 1) mimi-seed setup connect your accounts (guided \u2014 press ? for where each token comes from)",
|
|
367
368
|
nextDoctor: " 2) mimi-seed doctor verify everything + the exact fix for anything missing",
|
|
368
|
-
localStep1: "Sign in with Google (Firebase / AdMob / Play / Ads):",
|
|
369
|
-
localStep2: "Register the local MCP server
|
|
369
|
+
localStep1: "Sign in with Google (Firebase / AdMob / Play / Ads) \u2014 the first time, set MIMI_SEED_GOOGLE_CLIENT_ID / _SECRET to a Desktop OAuth client in your Google Cloud project (docs/credentials.md#google-oauth):",
|
|
370
|
+
localStep2: "Register the local MCP server:",
|
|
370
371
|
localCodexHint: ' Codex: add [mcp_servers.mimi-seed-local] command="npx", args=["-y","@yoonion/mimi-seed-mcp@latest"] to ~/.codex/config.toml'
|
|
371
372
|
}
|
|
372
373
|
);
|
|
@@ -374,7 +375,7 @@ function log(msg) {
|
|
|
374
375
|
process.stdout.write(msg + "\n");
|
|
375
376
|
}
|
|
376
377
|
async function cmdInit(args) {
|
|
377
|
-
const webBase = args.includes("--local") ? null :
|
|
378
|
+
const webBase = args.includes("--local") ? null : consoleBase(process.env.MIMI_SEED_WEB_BASE);
|
|
378
379
|
const cwd = process.cwd();
|
|
379
380
|
log(kleur2.bold("Mimi Seed CLI \u2014 init"));
|
|
380
381
|
log(kleur2.dim(cwd));
|
|
@@ -673,9 +674,9 @@ function platformsFromHints(hints) {
|
|
|
673
674
|
return platforms;
|
|
674
675
|
}
|
|
675
676
|
async function remoteConfigured(cwd, env = process.env) {
|
|
676
|
-
if (
|
|
677
|
+
if (consoleBase(env.MIMI_SEED_WEB_BASE)) return true;
|
|
677
678
|
try {
|
|
678
|
-
return !!
|
|
679
|
+
return !!consoleBase((await findProjectLink(cwd))?.webBase);
|
|
679
680
|
} catch {
|
|
680
681
|
return true;
|
|
681
682
|
}
|
|
@@ -5377,15 +5378,16 @@ ${kleur7.bold("\uD50C\uB7AB\uD3FC\uBCC4 \uC790\uACA9\uC99D\uBA85:")}
|
|
|
5377
5378
|
${kleur7.cyan("mimi-seed auth drive")} Google Drive \uC11C\uBE44\uC2A4 \uACC4\uC815 (\uACF5\uC720 \uD3F4\uB354\xB7\uACF5\uC720 \uB4DC\uB77C\uC774\uBE0C \uC5C5\uB85C\uB4DC)
|
|
5378
5379
|
|
|
5379
5380
|
${kleur7.bold("\uBE4C\uB4DC / \uB9C8\uCF00\uD305:")}
|
|
5381
|
+
${kleur7.cyan("mimi-seed auth social")} YouTube \xB7 Facebook \xB7 Instagram \xB7 Threads \xB7 TikTok \uD55C \uBC88\uC5D0 (\uC5F0\uACB0\uB41C \uAC74 \uAC74\uB108\uB700)
|
|
5380
5382
|
${kleur7.cyan("mimi-seed auth meta")} Facebook \xB7 Instagram \xB7 Threads \uD55C \uBC88\uC5D0
|
|
5381
5383
|
${kleur7.cyan("mimi-seed auth jenkins")} Jenkins \uC5F0\uACB0 (jenkins.json)
|
|
5382
5384
|
${kleur7.cyan("mimi-seed auth ci")} GitHub Actions / GitLab CI (ci.json)
|
|
5383
5385
|
${kleur7.cyan("mimi-seed auth googleads")} Google Ads (google-ads.json)
|
|
5384
5386
|
${kleur7.cyan("mimi-seed auth facebook")} Facebook \uD398\uC774\uC9C0
|
|
5385
5387
|
${kleur7.cyan("mimi-seed auth instagram")} Instagram
|
|
5386
|
-
${kleur7.cyan("mimi-seed auth threads")} Threads \
|
|
5388
|
+
${kleur7.cyan("mimi-seed auth threads")} Threads (\uB0B4 Meta \uC571 \uBE0C\uB77C\uC6B0\uC800 \uB85C\uADF8\uC778 \xB7 \uD300 \uBE0C\uB85C\uCEE4 \xB7 \uD1A0\uD070)
|
|
5387
5389
|
${kleur7.cyan("mimi-seed auth tiktok")} TikTok Business Organic API
|
|
5388
|
-
${kleur7.dim(" Instagram/Threads: --profile <id>\uB85C \uD2B9\uC815 \uC18C\uC15C \uD504\uB85C\uD544 \uC800\uC7A5/\uAC31\uC2E0. Instagram/Threads \uC218\uB3D9 \uD1A0\uD070 \uC785\uB825\uC740 --manual-token")}
|
|
5390
|
+
${kleur7.dim(" Instagram/Threads: --profile <id>\uB85C \uD2B9\uC815 \uC18C\uC15C \uD504\uB85C\uD544 \uC800\uC7A5/\uAC31\uC2E0. Instagram/Threads \uC218\uB3D9 \uD1A0\uD070 \uC785\uB825\uC740 --manual-token, \uC800\uC7A5\uB41C Meta \uC571 \uBCC0\uACBD\uC740 --reset-app")}
|
|
5389
5391
|
|
|
5390
5392
|
${kleur7.bold("\uC804\uCCB4 \uC0C1\uD0DC:")}
|
|
5391
5393
|
${kleur7.cyan("mimi-seed auth status --all")} \uBAA8\uB4E0 \uC790\uACA9\uC99D\uBA85 \uBCF4\uC720 \uC5EC\uBD80 \uD55C\uB208\uC5D0
|
|
@@ -5418,15 +5420,16 @@ ${kleur7.bold("Per-platform credentials:")}
|
|
|
5418
5420
|
${kleur7.cyan("mimi-seed auth drive")} Google Drive service account (uploads to shared folders / drives)
|
|
5419
5421
|
|
|
5420
5422
|
${kleur7.bold("Build / marketing:")}
|
|
5423
|
+
${kleur7.cyan("mimi-seed auth social")} YouTube \xB7 Facebook \xB7 Instagram \xB7 Threads \xB7 TikTok in one flow (skips connected ones)
|
|
5421
5424
|
${kleur7.cyan("mimi-seed auth meta")} Facebook \xB7 Instagram \xB7 Threads in one flow
|
|
5422
5425
|
${kleur7.cyan("mimi-seed auth jenkins")} Jenkins connection (jenkins.json)
|
|
5423
5426
|
${kleur7.cyan("mimi-seed auth ci")} GitHub Actions / GitLab CI (ci.json)
|
|
5424
5427
|
${kleur7.cyan("mimi-seed auth googleads")} Google Ads (google-ads.json)
|
|
5425
5428
|
${kleur7.cyan("mimi-seed auth facebook")} Facebook Page
|
|
5426
5429
|
${kleur7.cyan("mimi-seed auth instagram")} Instagram
|
|
5427
|
-
${kleur7.cyan("mimi-seed auth threads")} Threads (team broker
|
|
5430
|
+
${kleur7.cyan("mimi-seed auth threads")} Threads (own Meta app browser login \xB7 team broker \xB7 token)
|
|
5428
5431
|
${kleur7.cyan("mimi-seed auth tiktok")} TikTok Business Organic API
|
|
5429
|
-
${kleur7.dim(" Instagram/Threads: use --profile <id> to save or refresh a named social profile. Instagram/Threads manual tokens: --manual-token")}
|
|
5432
|
+
${kleur7.dim(" Instagram/Threads: use --profile <id> to save or refresh a named social profile. Instagram/Threads manual tokens: --manual-token; change the saved Meta app: --reset-app")}
|
|
5430
5433
|
|
|
5431
5434
|
${kleur7.bold("Everything at a glance:")}
|
|
5432
5435
|
${kleur7.cyan("mimi-seed auth status --all")} which credentials you have
|
|
@@ -5444,6 +5447,7 @@ ${kleur7.dim(`Under the hood this calls the mimi-seed-*-auth CLIs from ${MCP_PKG
|
|
|
5444
5447
|
connectAll: "\n Connect everything at once: mimi-seed setup"
|
|
5445
5448
|
}
|
|
5446
5449
|
);
|
|
5450
|
+
var SOCIAL_CREDENTIALS = ["youtube", "facebook", "instagram", "threads", "tiktok"];
|
|
5447
5451
|
function printAuthHelp() {
|
|
5448
5452
|
log2(M8().help);
|
|
5449
5453
|
}
|
|
@@ -5480,8 +5484,13 @@ async function cmdAuth(args) {
|
|
|
5480
5484
|
if (sub === "instagram") return void exitWith(await runMcpBin("mimi-seed-social-auth", ["instagram", ...rest]));
|
|
5481
5485
|
if (sub === "threads") return void exitWith(await runMcpBin("mimi-seed-social-auth", ["threads", ...rest]));
|
|
5482
5486
|
if (sub === "tiktok") return void exitWith(await runMcpBin("mimi-seed-tiktok-business-auth", rest));
|
|
5487
|
+
if (sub === "social") {
|
|
5488
|
+
const { cmdSetup: cmdSetup2 } = await import("./setup-QETGLQDD.js");
|
|
5489
|
+
await cmdSetup2(["--only", SOCIAL_CREDENTIALS.join(","), ...rest]);
|
|
5490
|
+
return;
|
|
5491
|
+
}
|
|
5483
5492
|
if (sub === "ci") {
|
|
5484
|
-
const { cmdSetup: cmdSetup2 } = await import("./setup-
|
|
5493
|
+
const { cmdSetup: cmdSetup2 } = await import("./setup-QETGLQDD.js");
|
|
5485
5494
|
await cmdSetup2(["--only", "github,gitlab", "--reconnect", "github,gitlab"]);
|
|
5486
5495
|
return;
|
|
5487
5496
|
}
|
|
@@ -6692,7 +6701,15 @@ var M12 = catalog(
|
|
|
6692
6701
|
codexAuto: "\uC790\uB3D9 \uB4F1\uB85D:",
|
|
6693
6702
|
codexManual: "\uC218\uB3D9 \uB4F1\uB85D \uC608\uC2DC (~/.codex/config.toml) \u2014 \uD1A0\uD070\uC740 MIMI_SEED_TOKEN \uD658\uACBD\uBCC0\uC218\uB85C:",
|
|
6694
6703
|
claudeTitle: "Claude Code MCP \uB4F1\uB85D \u2014 \uC544\uB798 \uD55C \uC904\uC744 \uADF8\uB300\uB85C \uC2E4\uD589\uD558\uC138\uC694:",
|
|
6695
|
-
claudeWarn: " \u26A0 \uC2E4\uC81C \uD1A0\uD070\uC774 \uD3EC\uD568\uB41C \uBA85\uB839\uC785\uB2C8\uB2E4 (\uC178 \uD788\uC2A4\uD1A0\uB9AC\uC5D0 \uB0A8\uC74C). \uD1A0\uD070\uC740 ~/.mimi-seed/config.json \uC5D0\uB3C4 \uC800\uC7A5\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."
|
|
6704
|
+
claudeWarn: " \u26A0 \uC2E4\uC81C \uD1A0\uD070\uC774 \uD3EC\uD568\uB41C \uBA85\uB839\uC785\uB2C8\uB2E4 (\uC178 \uD788\uC2A4\uD1A0\uB9AC\uC5D0 \uB0A8\uC74C). \uD1A0\uD070\uC740 ~/.mimi-seed/config.json \uC5D0\uB3C4 \uC800\uC7A5\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
6705
|
+
webBaseIgnored: (problem) => `\u26A0 MIMI_SEED_WEB_BASE \uB97C \uBB34\uC2DC\uD569\uB2C8\uB2E4: ${{
|
|
6706
|
+
invalid: "URL \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4",
|
|
6707
|
+
retired: "\uC885\uB8CC\uB41C \uACF5\uAC1C \uCF58\uC194 \uC8FC\uC18C\uC785\uB2C8\uB2E4",
|
|
6708
|
+
"not-https": "https \uAC00 \uC544\uB2D9\uB2C8\uB2E4 (http \uB294 localhost \uAC1C\uBC1C \uC11C\uBC84\uB9CC)",
|
|
6709
|
+
credentials: "URL \uC5D0 \uC0AC\uC6A9\uC790 \uC815\uBCF4\uAC00 \uB4E4\uC5B4 \uC788\uC2B5\uB2C8\uB2E4",
|
|
6710
|
+
query: "? \uB098 # \uB97C \uD3EC\uD568\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
6711
|
+
path: "\uD300 \uCF58\uC194\uC758 \uB8E8\uD2B8 \uC8FC\uC18C\uB9CC \uBC1B\uC2B5\uB2C8\uB2E4 (\uC608: https://console.example.com \u2014 \uACBD\uB85C \uC5C6\uC774)"
|
|
6712
|
+
}[problem]}. \uC6D0\uACA9 \uAE30\uB2A5\uC740 \uC5F0\uACB0\uB418\uC9C0 \uC54A\uC740 \uAC83\uC73C\uB85C \uB3D9\uC791\uD569\uB2C8\uB2E4.`
|
|
6696
6713
|
},
|
|
6697
6714
|
{
|
|
6698
6715
|
notConnected: "For remote commands, set MIMI_SEED_WEB_BASE to your team console and run mimi-seed init.",
|
|
@@ -6710,7 +6727,15 @@ var M12 = catalog(
|
|
|
6710
6727
|
codexAuto: "Automatic:",
|
|
6711
6728
|
codexManual: "Manual example (~/.codex/config.toml) \u2014 token via the MIMI_SEED_TOKEN env var:",
|
|
6712
6729
|
claudeTitle: "Claude Code MCP registration \u2014 run this one line as-is:",
|
|
6713
|
-
claudeWarn: " \u26A0 This command contains the real token (it stays in your shell history). The token is also stored in ~/.mimi-seed/config.json."
|
|
6730
|
+
claudeWarn: " \u26A0 This command contains the real token (it stays in your shell history). The token is also stored in ~/.mimi-seed/config.json.",
|
|
6731
|
+
webBaseIgnored: (problem) => `\u26A0 Ignoring MIMI_SEED_WEB_BASE: ${{
|
|
6732
|
+
invalid: "it is not a URL",
|
|
6733
|
+
retired: "it is the retired public console",
|
|
6734
|
+
"not-https": "it is not https (http only for a localhost dev server)",
|
|
6735
|
+
credentials: "it contains user credentials",
|
|
6736
|
+
query: "it cannot contain ? or #",
|
|
6737
|
+
path: "only the team console's root address is accepted (e.g. https://console.example.com, no path)"
|
|
6738
|
+
}[problem]}. Remote features behave as not connected.`
|
|
6714
6739
|
}
|
|
6715
6740
|
);
|
|
6716
6741
|
function log6(msg) {
|
|
@@ -6783,6 +6808,9 @@ async function main() {
|
|
|
6783
6808
|
log6(version);
|
|
6784
6809
|
return;
|
|
6785
6810
|
}
|
|
6811
|
+
const webBaseProblem = consoleBaseProblem(process.env.MIMI_SEED_WEB_BASE);
|
|
6812
|
+
if (webBaseProblem) process.stderr.write(`${M12().webBaseIgnored(webBaseProblem)}
|
|
6813
|
+
`);
|
|
6786
6814
|
if (cmd && cmd !== "auth" && (restArgs.includes("--help") || restArgs.includes("-h"))) {
|
|
6787
6815
|
if (printCommandHelp(cmd)) return;
|
|
6788
6816
|
}
|
package/package.json
CHANGED