mimi-seed 0.10.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.js +32 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -310,6 +310,9 @@ Codex는 자동 쓰기 명령을 사용할 수 있습니다.
|
|
|
310
310
|
mimi-seed mcp codex --write
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
+
이 명령은 `mimi-seed-remote` HTTP 항목과 `bearer_token_env_var = "MIMI_SEED_TOKEN"`을 기록하며 PAT 자체는
|
|
314
|
+
`config.toml`에 쓰지 않습니다. Codex를 실행하는 환경에 `MIMI_SEED_TOKEN`을 설정하고 Codex를 다시 시작하세요.
|
|
315
|
+
|
|
313
316
|
등록 후 Claude Code 또는 Codex에서 대화로 제어:
|
|
314
317
|
|
|
315
318
|
```
|
package/dist/index.js
CHANGED
|
@@ -1304,18 +1304,22 @@ import path3 from "path";
|
|
|
1304
1304
|
import os2 from "os";
|
|
1305
1305
|
import kleur8 from "kleur";
|
|
1306
1306
|
var SERVER_NAME = "mimi-seed";
|
|
1307
|
+
var CODEX_REMOTE_NAME = "mimi-seed-remote";
|
|
1308
|
+
var CODEX_TOKEN_ENV = "MIMI_SEED_TOKEN";
|
|
1307
1309
|
var M7 = catalog(
|
|
1308
1310
|
{
|
|
1309
1311
|
claudeTitle: "Claude Code MCP \uB4F1\uB85D \u2014 \uC544\uB798 \uD55C \uC904\uC744 \uADF8\uB300\uB85C \uC2E4\uD589\uD558\uC138\uC694:",
|
|
1310
1312
|
tokenWarning: (loc) => ` \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 ${loc} \uC5D0\uB3C4 \uC800\uC7A5\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.`,
|
|
1311
1313
|
codexTitle: "Codex MCP \uB4F1\uB85D:",
|
|
1312
|
-
|
|
1314
|
+
codexEnvNote: ` # ${CODEX_TOKEN_ENV} \uD658\uACBD\uBCC0\uC218\uC5D0 PAT \uB97C \uB123\uC5B4\uC57C \uC6D0\uACA9 \uC778\uC99D\uC774 \uB429\uB2C8\uB2E4 (config \uC5D0 \uD1A0\uD070\uC744 \uD3C9\uBB38 \uC800\uC7A5\uD558\uC9C0 \uC54A\uC74C).`,
|
|
1315
|
+
codexManual: ` # \uB610\uB294 \uC218\uB3D9\uC73C\uB85C: codex mcp add ${CODEX_REMOTE_NAME} --url <endpoint> --bearer-token-env-var ${CODEX_TOKEN_ENV}`
|
|
1313
1316
|
},
|
|
1314
1317
|
{
|
|
1315
1318
|
claudeTitle: "Register the MCP server with Claude Code \u2014 run this single line as-is:",
|
|
1316
1319
|
tokenWarning: (loc) => ` \u26A0 This command contains your real token (it lands in your shell history). The token is also stored in ${loc}.`,
|
|
1317
1320
|
codexTitle: "Register with Codex:",
|
|
1318
|
-
|
|
1321
|
+
codexEnvNote: ` # Set the ${CODEX_TOKEN_ENV} env var to your PAT so the remote authenticates (the token is not written to the config in plaintext).`,
|
|
1322
|
+
codexManual: ` # or by hand: codex mcp add ${CODEX_REMOTE_NAME} --url <endpoint> --bearer-token-env-var ${CODEX_TOKEN_ENV}`
|
|
1319
1323
|
}
|
|
1320
1324
|
);
|
|
1321
1325
|
function tomlString(value) {
|
|
@@ -1323,10 +1327,10 @@ function tomlString(value) {
|
|
|
1323
1327
|
}
|
|
1324
1328
|
function codexBlock(cfg) {
|
|
1325
1329
|
return [
|
|
1326
|
-
`[mcp_servers.${
|
|
1330
|
+
`[mcp_servers.${CODEX_REMOTE_NAME}]`,
|
|
1327
1331
|
`url = ${tomlString(cfg.endpoint)}`,
|
|
1332
|
+
`bearer_token_env_var = ${tomlString(CODEX_TOKEN_ENV)}`,
|
|
1328
1333
|
`enabled = true`,
|
|
1329
|
-
`http_headers = { Authorization = ${tomlString(`Bearer ${cfg.token}`)} }`,
|
|
1330
1334
|
""
|
|
1331
1335
|
].join("\n");
|
|
1332
1336
|
}
|
|
@@ -1354,10 +1358,19 @@ function printMcpSetup(cfg) {
|
|
|
1354
1358
|
"",
|
|
1355
1359
|
kleur8.dim(M7().codexTitle),
|
|
1356
1360
|
kleur8.dim(" mimi-seed mcp codex --write"),
|
|
1361
|
+
kleur8.dim(M7().codexEnvNote),
|
|
1357
1362
|
kleur8.dim(M7().codexManual)
|
|
1358
1363
|
].join("\n") + "\n"
|
|
1359
1364
|
);
|
|
1360
1365
|
}
|
|
1366
|
+
function removeTomlBlock(input, tableName) {
|
|
1367
|
+
const header = `[${tableName}]`;
|
|
1368
|
+
const start = input.indexOf(header);
|
|
1369
|
+
if (start < 0) return input;
|
|
1370
|
+
const next = input.slice(start + header.length).search(/\n\[[^\]]+\]/);
|
|
1371
|
+
const end = next < 0 ? input.length : start + header.length + next + 1;
|
|
1372
|
+
return `${input.slice(0, start)}${input.slice(end).replace(/^\n+/, "\n")}`;
|
|
1373
|
+
}
|
|
1361
1374
|
async function writeCodexMcpConfig(cfg) {
|
|
1362
1375
|
const configDir = path3.join(os2.homedir(), ".codex");
|
|
1363
1376
|
const configPath = path3.join(configDir, "config.toml");
|
|
@@ -1368,7 +1381,12 @@ async function writeCodexMcpConfig(cfg) {
|
|
|
1368
1381
|
} catch {
|
|
1369
1382
|
current = "";
|
|
1370
1383
|
}
|
|
1371
|
-
const
|
|
1384
|
+
const legacy = current.match(/\[mcp_servers\.mimi-seed\]\s*\n(?:(?!\[)[\s\S])*/);
|
|
1385
|
+
if (legacy && /^\s*url\s*=/m.test(legacy[0])) {
|
|
1386
|
+
current = removeTomlBlock(current, "mcp_servers.mimi-seed");
|
|
1387
|
+
current = removeTomlBlock(current, "mcp_servers.mimi-seed.http_headers");
|
|
1388
|
+
}
|
|
1389
|
+
const next = replaceTomlBlock(current, `mcp_servers.${CODEX_REMOTE_NAME}`, codexBlock(cfg));
|
|
1372
1390
|
await fs3.writeFile(configPath, next);
|
|
1373
1391
|
return configPath;
|
|
1374
1392
|
}
|
|
@@ -1457,12 +1475,12 @@ var M8 = catalog(
|
|
|
1457
1475
|
listFailed: (text) => "\uC870\uD68C \uC2E4\uD328: " + text,
|
|
1458
1476
|
logoutDone: "\u2713 \uB85C\uCEEC \uC124\uC815 \uC0AD\uC81C \uC644\uB8CC.",
|
|
1459
1477
|
logoutRevoke: "\uC6F9\uC5D0\uC11C \uD1A0\uD070 \uD574\uC9C0: /workspace/api-tokens",
|
|
1460
|
-
codexWritten: "\u2713 Codex MCP \uC124\uC815 \uC644\uB8CC",
|
|
1461
|
-
codexWriteWarn: " \u26A0
|
|
1478
|
+
codexWritten: "\u2713 Codex MCP \uC124\uC815 \uC644\uB8CC (mimi-seed-remote, HTTP)",
|
|
1479
|
+
codexWriteWarn: " \u26A0 \uD1A0\uD070\uC740 config \uC5D0 \uD3C9\uBB38 \uC800\uC7A5\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 MIMI_SEED_TOKEN \uD658\uACBD\uBCC0\uC218\uC5D0 PAT \uB97C \uB123\uC5B4\uC57C \uC778\uC99D\uB429\uB2C8\uB2E4.",
|
|
1462
1480
|
codexVerify: "Codex\uB97C \uC0C8\uB85C \uC5F4\uACE0 `/mcp` \uB610\uB294 `codex mcp list`\uB85C \uD655\uC778\uD558\uC138\uC694.",
|
|
1463
1481
|
codexTitle: "Codex MCP \uB4F1\uB85D",
|
|
1464
1482
|
codexAuto: "\uC790\uB3D9 \uB4F1\uB85D:",
|
|
1465
|
-
codexManual: "\uC218\uB3D9 \uB4F1\uB85D \uC608\uC2DC (~/.codex/config.toml) \u2014 \
|
|
1483
|
+
codexManual: "\uC218\uB3D9 \uB4F1\uB85D \uC608\uC2DC (~/.codex/config.toml) \u2014 \uD1A0\uD070\uC740 MIMI_SEED_TOKEN \uD658\uACBD\uBCC0\uC218\uB85C:",
|
|
1466
1484
|
claudeTitle: "Claude Code MCP \uB4F1\uB85D \u2014 \uC544\uB798 \uD55C \uC904\uC744 \uADF8\uB300\uB85C \uC2E4\uD589\uD558\uC138\uC694:",
|
|
1467
1485
|
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.",
|
|
1468
1486
|
// 명령별 상세 사용법 (SSOT). `mimi-seed <command> --help` 와 overview 가 공유.
|
|
@@ -1621,12 +1639,12 @@ ${kleur9.bold("\uD658\uACBD\uBCC0\uC218:")}
|
|
|
1621
1639
|
listFailed: (text) => "Lookup failed: " + text,
|
|
1622
1640
|
logoutDone: "\u2713 Local config deleted.",
|
|
1623
1641
|
logoutRevoke: "Revoke the token on the web: /workspace/api-tokens",
|
|
1624
|
-
codexWritten: "\u2713 Codex MCP configured",
|
|
1625
|
-
codexWriteWarn: " \u26A0 The
|
|
1642
|
+
codexWritten: "\u2713 Codex MCP configured (mimi-seed-remote, HTTP)",
|
|
1643
|
+
codexWriteWarn: " \u26A0 The token is NOT written to the config \u2014 set MIMI_SEED_TOKEN to your PAT so the remote authenticates.",
|
|
1626
1644
|
codexVerify: "Reopen Codex and verify with `/mcp` or `codex mcp list`.",
|
|
1627
1645
|
codexTitle: "Codex MCP registration",
|
|
1628
1646
|
codexAuto: "Automatic:",
|
|
1629
|
-
codexManual: "Manual example (~/.codex/config.toml) \u2014
|
|
1647
|
+
codexManual: "Manual example (~/.codex/config.toml) \u2014 token via the MIMI_SEED_TOKEN env var:",
|
|
1630
1648
|
claudeTitle: "Claude Code MCP registration \u2014 run this one line as-is:",
|
|
1631
1649
|
claudeWarn: " \u26A0 This command contains the real token (it stays in your shell history). The token is also stored in ~/.mimi-seed/config.json.",
|
|
1632
1650
|
usage: {
|
|
@@ -1954,10 +1972,10 @@ async function cmdMcp(args) {
|
|
|
1954
1972
|
log4(kleur9.cyan(" mimi-seed mcp codex --write"));
|
|
1955
1973
|
log4("");
|
|
1956
1974
|
log4(M8().codexManual);
|
|
1957
|
-
log4(`[mcp_servers.mimi-seed]
|
|
1975
|
+
log4(`[mcp_servers.mimi-seed-remote]
|
|
1958
1976
|
url = "${cfg.endpoint}"
|
|
1959
|
-
|
|
1960
|
-
|
|
1977
|
+
bearer_token_env_var = "MIMI_SEED_TOKEN"
|
|
1978
|
+
enabled = true`);
|
|
1961
1979
|
return;
|
|
1962
1980
|
}
|
|
1963
1981
|
if (target === "claude") {
|