@mushi-mushi/cli 0.27.0 → 0.27.1
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 +1 -1
- package/dist/chunk-DBAEB56N.js +10 -0
- package/dist/{chunk-TZL3F3GT.js → chunk-M7CDSRZM.js} +1 -1
- package/dist/{chunk-7JZUKNN5.js → chunk-NNB2NONG.js} +1 -1
- package/dist/chunk-XLGHUOKY.js +8 -0
- package/dist/{connect-FAXWVFG2.js → connect-5EQA7G3U.js} +2 -2
- package/dist/{connect-QHVFH77E.js → connect-TWO2ZNFB.js} +2 -2
- package/dist/index.js +110 -28
- package/dist/init.js +3 -3
- package/dist/{version-F3ZOPM5F.js → version-AYMUW3UQ.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-LFZ5ZIBI.js +0 -8
- package/dist/chunk-MXD5UNMP.js +0 -10
package/README.md
CHANGED
|
@@ -440,4 +440,4 @@ The CLI is also importable for tooling (used by `create-mushi-mushi`):
|
|
|
440
440
|
MIT
|
|
441
441
|
|
|
442
442
|
<!-- mushi-readme-stats-footer -->
|
|
443
|
-
<sub>Monorepo scale (July 2026): 55 edge functions ·
|
|
443
|
+
<sub>Monorepo scale (July 2026): 55 edge functions · 331 SQL migrations · 13 outbound plugins · 11 inbound adapters · 19 pipeline agents. Canonical counts: <a href="https://github.com/kensaurus/mushi-mushi/blob/master/docs/stats.md">docs/stats.md</a> · <code>pnpm docs-stats</code></sub>
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
requireUuid,
|
|
5
5
|
saveConfig,
|
|
6
6
|
waitForIngestReady
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-M7CDSRZM.js";
|
|
8
8
|
import {
|
|
9
9
|
MUSHI_MCP_PIN_SPEC
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XLGHUOKY.js";
|
|
11
11
|
import {
|
|
12
12
|
detectFramework,
|
|
13
13
|
envVarsToWrite,
|
package/dist/index.js
CHANGED
|
@@ -45,11 +45,11 @@ import {
|
|
|
45
45
|
setGlobalOutputFormat,
|
|
46
46
|
trySaveKeyToKeychain,
|
|
47
47
|
writeMcpServerEntry
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-NNB2NONG.js";
|
|
49
49
|
import {
|
|
50
50
|
MUSHI_CLI_VERSION,
|
|
51
51
|
MUSHI_MCP_PIN_SPEC
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-DBAEB56N.js";
|
|
53
53
|
import {
|
|
54
54
|
TEST_REPORT_FETCH_TIMEOUT_MS,
|
|
55
55
|
assertEndpoint,
|
|
@@ -1203,7 +1203,7 @@ async function checkOnboardingStatus(config, _consoleBase, cwd, doFetch = global
|
|
|
1203
1203
|
}
|
|
1204
1204
|
async function checkVersionDrift(cwd, doFetch) {
|
|
1205
1205
|
const checks = [];
|
|
1206
|
-
const { MUSHI_CLI_VERSION: MUSHI_CLI_VERSION2 } = await import("./version-
|
|
1206
|
+
const { MUSHI_CLI_VERSION: MUSHI_CLI_VERSION2 } = await import("./version-AYMUW3UQ.js");
|
|
1207
1207
|
if (MUSHI_CLI_VERSION2 === "0.0.0-dev") return checks;
|
|
1208
1208
|
const parse2 = (v) => {
|
|
1209
1209
|
const m = v.replace(/^[~^]/, "").match(/^(\d+)\.(\d+)\.(\d+)/);
|
|
@@ -1969,7 +1969,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
|
|
|
1969
1969
|
if (p.isCancel(answer) || !answer) return;
|
|
1970
1970
|
const endpoint = resolveCloudEndpoint(options.endpoint);
|
|
1971
1971
|
try {
|
|
1972
|
-
const { runConnect: runConnect2 } = await import("./connect-
|
|
1972
|
+
const { runConnect: runConnect2 } = await import("./connect-TWO2ZNFB.js");
|
|
1973
1973
|
await runConnect2({
|
|
1974
1974
|
apiKey: credentials.apiKey,
|
|
1975
1975
|
projectId: credentials.projectId,
|
|
@@ -4844,10 +4844,7 @@ function registerKeysCommands(program2) {
|
|
|
4844
4844
|
console.error("Run `mushi login` first");
|
|
4845
4845
|
process.exit(1);
|
|
4846
4846
|
}
|
|
4847
|
-
const res = await apiCall(
|
|
4848
|
-
`/v1/admin/byok/keys?project_id=${encodeURIComponent(config.projectId)}`,
|
|
4849
|
-
config
|
|
4850
|
-
);
|
|
4847
|
+
const res = await apiCall(`/v1/admin/byok/keys?project_id=${encodeURIComponent(config.projectId)}`, config);
|
|
4851
4848
|
if (!res.ok) {
|
|
4852
4849
|
console.error(`Error: ${res.error.message}`);
|
|
4853
4850
|
process.exit(1);
|
|
@@ -4855,13 +4852,31 @@ function registerKeysCommands(program2) {
|
|
|
4855
4852
|
printResult(res.data, {
|
|
4856
4853
|
json: opts.json,
|
|
4857
4854
|
render(d) {
|
|
4858
|
-
|
|
4855
|
+
const legacyKeys = d.legacyKeys ?? [];
|
|
4856
|
+
if (d.keys.length === 0 && legacyKeys.length === 0) {
|
|
4859
4857
|
console.log("No keys configured.");
|
|
4860
4858
|
return;
|
|
4861
4859
|
}
|
|
4862
4860
|
for (const k of d.keys) {
|
|
4863
4861
|
const cooldown = k.cooldown_until && new Date(k.cooldown_until) > /* @__PURE__ */ new Date() ? ` [cooldown until ${new Date(k.cooldown_until).toLocaleTimeString()}]` : "";
|
|
4864
|
-
|
|
4862
|
+
const validation = k.test_status ? ` test=${k.test_status}` : " test=required";
|
|
4863
|
+
const lastTested = k.last_tested_at ? ` tested=${new Date(k.last_tested_at).toISOString()}` : "";
|
|
4864
|
+
const lastUsed = k.last_used_at ? ` used=${new Date(k.last_used_at).toISOString()}` : "";
|
|
4865
|
+
const baseUrl = k.base_url ? ` base=${k.base_url}` : "";
|
|
4866
|
+
const hint = k.key_hint ? ` hint=${k.key_hint}` : "";
|
|
4867
|
+
console.log(
|
|
4868
|
+
`${k.provider_slug.padEnd(14)} [${k.status}]${validation} p=${k.priority} ${k.label ?? "(no label)"}${hint}${baseUrl}${cooldown}${lastTested}${lastUsed} created=${new Date(k.created_at).toISOString()} \u2014 ${k.id}`
|
|
4869
|
+
);
|
|
4870
|
+
}
|
|
4871
|
+
for (const k of legacyKeys) {
|
|
4872
|
+
const validation = k.test_status ? ` test=${k.test_status}` : " test=required";
|
|
4873
|
+
const lastTested = k.last_tested_at ? ` tested=${new Date(k.last_tested_at).toISOString()}` : "";
|
|
4874
|
+
const lastUsed = k.last_used_at ? ` used=${new Date(k.last_used_at).toISOString()}` : "";
|
|
4875
|
+
const created = k.created_at ? ` created=${new Date(k.created_at).toISOString()}` : "";
|
|
4876
|
+
const hint = k.key_hint ? ` hint=${k.key_hint}` : "";
|
|
4877
|
+
console.log(
|
|
4878
|
+
`${k.provider_slug.padEnd(14)} [${k.status}]${validation} legacy${hint}${lastTested}${lastUsed}${created} \u2014 manage in the console`
|
|
4879
|
+
);
|
|
4865
4880
|
}
|
|
4866
4881
|
}
|
|
4867
4882
|
});
|
|
@@ -4912,41 +4927,108 @@ function registerKeysCommands(program2) {
|
|
|
4912
4927
|
).catch(() => null);
|
|
4913
4928
|
serverRevoked = revokeResult?.revoked === 1;
|
|
4914
4929
|
}
|
|
4915
|
-
printResult(
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
console.log(`
|
|
4923
|
-
|
|
4924
|
-
|
|
4930
|
+
printResult(
|
|
4931
|
+
{ newPrefix: newKey.slice(0, 12), oldPrefix, serverRevoked },
|
|
4932
|
+
{
|
|
4933
|
+
json: opts.json,
|
|
4934
|
+
render(d) {
|
|
4935
|
+
console.log(`\u2713 Key rotated.`);
|
|
4936
|
+
console.log(` Old prefix: ${d.oldPrefix}\u2026 \u2192 New prefix: ${d.newPrefix}\u2026`);
|
|
4937
|
+
console.log(` New key saved to local config.`);
|
|
4938
|
+
if (d.serverRevoked) {
|
|
4939
|
+
console.log(` \u2713 Old key revoked on the server.`);
|
|
4940
|
+
} else {
|
|
4941
|
+
console.log(
|
|
4942
|
+
` \u2139 Old key may still be active \u2014 revoke it at: ${config.consoleUrl ?? "your Mushi console"} \u2192 Settings \u2192 API Keys`
|
|
4943
|
+
);
|
|
4944
|
+
}
|
|
4925
4945
|
}
|
|
4926
4946
|
}
|
|
4927
|
-
|
|
4947
|
+
);
|
|
4928
4948
|
});
|
|
4929
|
-
keys.command("add").description("Add a new API key to the pool").requiredOption("--provider <p>", "Provider: anthropic, openai, firecrawl, browserbase, cursor").option(
|
|
4949
|
+
keys.command("add").description("Add a new API key to the pool").requiredOption("--provider <p>", "Provider: anthropic, openai, firecrawl, browserbase, cursor").option(
|
|
4950
|
+
"--key <k>",
|
|
4951
|
+
"The API key value (prefer the MUSHI_BYOK_KEY env var to keep it out of shell history)"
|
|
4952
|
+
).option("--label <l>", "Human-readable label").option("--priority <n>", "Priority (lower = higher priority)", "100").option("--base-url <url>", "Allow-listed OpenAI-compatible HTTPS base URL").action(
|
|
4953
|
+
async (opts) => {
|
|
4954
|
+
const config = loadConfig();
|
|
4955
|
+
if (!config.apiKey || !config.projectId) {
|
|
4956
|
+
console.error("Run `mushi login` first");
|
|
4957
|
+
process.exit(1);
|
|
4958
|
+
}
|
|
4959
|
+
const key = process.env.MUSHI_BYOK_KEY ?? opts.key;
|
|
4960
|
+
if (!key) {
|
|
4961
|
+
console.error(
|
|
4962
|
+
"Provide the key via the MUSHI_BYOK_KEY env var (recommended) or --key <value>."
|
|
4963
|
+
);
|
|
4964
|
+
process.exit(1);
|
|
4965
|
+
}
|
|
4966
|
+
const priority = Number(opts.priority);
|
|
4967
|
+
if (!Number.isInteger(priority) || priority < 0 || priority > 1e4) {
|
|
4968
|
+
console.error("Priority must be an integer between 0 and 10000.");
|
|
4969
|
+
process.exit(1);
|
|
4970
|
+
}
|
|
4971
|
+
const res = await apiCall("/v1/admin/byok/keys", config, {
|
|
4972
|
+
method: "POST",
|
|
4973
|
+
body: JSON.stringify({
|
|
4974
|
+
project_id: config.projectId,
|
|
4975
|
+
provider_slug: opts.provider,
|
|
4976
|
+
key,
|
|
4977
|
+
label: opts.label,
|
|
4978
|
+
priority,
|
|
4979
|
+
base_url: opts.baseUrl
|
|
4980
|
+
})
|
|
4981
|
+
});
|
|
4982
|
+
if (!res.ok) {
|
|
4983
|
+
console.error(`Error: ${res.error.message}`);
|
|
4984
|
+
process.exit(1);
|
|
4985
|
+
}
|
|
4986
|
+
if (res.data.validation.status === "ok") {
|
|
4987
|
+
console.log(`\u2713 Key validated and active \u2014 id: ${res.data.id}`);
|
|
4988
|
+
return;
|
|
4989
|
+
}
|
|
4990
|
+
console.log(
|
|
4991
|
+
`! Key saved but quarantined (${res.data.validation.status}) \u2014 id: ${res.data.id}`
|
|
4992
|
+
);
|
|
4993
|
+
console.log(` ${res.data.validation.detail}`);
|
|
4994
|
+
}
|
|
4995
|
+
);
|
|
4996
|
+
keys.command("test <key-id>").description("Re-test one pooled key and activate it only if validation passes").action(async (keyId) => {
|
|
4930
4997
|
const config = loadConfig();
|
|
4931
4998
|
if (!config.apiKey || !config.projectId) {
|
|
4932
4999
|
console.error("Run `mushi login` first");
|
|
4933
5000
|
process.exit(1);
|
|
4934
5001
|
}
|
|
4935
|
-
const
|
|
4936
|
-
if (!
|
|
4937
|
-
console.error(
|
|
5002
|
+
const res = await apiCall(`/v1/admin/byok/keys/${encodeURIComponent(keyId)}/test`, config, { method: "POST" });
|
|
5003
|
+
if (!res.ok) {
|
|
5004
|
+
console.error(`Error: ${res.error.message}`);
|
|
5005
|
+
process.exit(1);
|
|
5006
|
+
}
|
|
5007
|
+
if (res.data.validation.status === "ok") {
|
|
5008
|
+
console.log(`\u2713 Key validated and active \u2014 id: ${res.data.key.id}`);
|
|
5009
|
+
return;
|
|
5010
|
+
}
|
|
5011
|
+
console.log(
|
|
5012
|
+
`! Key remains quarantined (${res.data.validation.status}) \u2014 id: ${res.data.key.id}`
|
|
5013
|
+
);
|
|
5014
|
+
console.log(` ${res.data.validation.detail}`);
|
|
5015
|
+
});
|
|
5016
|
+
keys.command("remove <key-id>").description("Permanently remove one pooled key and its Vault secret").action(async (keyId) => {
|
|
5017
|
+
const config = loadConfig();
|
|
5018
|
+
if (!config.apiKey || !config.projectId) {
|
|
5019
|
+
console.error("Run `mushi login` first");
|
|
4938
5020
|
process.exit(1);
|
|
4939
5021
|
}
|
|
4940
5022
|
const res = await apiCall(
|
|
4941
|
-
|
|
5023
|
+
`/v1/admin/byok/keys/${encodeURIComponent(keyId)}`,
|
|
4942
5024
|
config,
|
|
4943
|
-
{ method: "
|
|
5025
|
+
{ method: "DELETE" }
|
|
4944
5026
|
);
|
|
4945
5027
|
if (!res.ok) {
|
|
4946
5028
|
console.error(`Error: ${res.error.message}`);
|
|
4947
5029
|
process.exit(1);
|
|
4948
5030
|
}
|
|
4949
|
-
console.log(`\u2713 Key
|
|
5031
|
+
console.log(`\u2713 Key removed \u2014 id: ${res.data.keyId}`);
|
|
4950
5032
|
});
|
|
4951
5033
|
}
|
|
4952
5034
|
|
package/dist/init.js
CHANGED
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
sanitizeCliCredentials,
|
|
20
20
|
sanitizeEndpoint,
|
|
21
21
|
saveConfig
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-M7CDSRZM.js";
|
|
23
23
|
import {
|
|
24
24
|
MUSHI_CLI_VERSION
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-XLGHUOKY.js";
|
|
26
26
|
import {
|
|
27
27
|
FRAMEWORKS,
|
|
28
28
|
detectFramework,
|
|
@@ -1803,7 +1803,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
|
|
|
1803
1803
|
if (p.isCancel(answer) || !answer) return;
|
|
1804
1804
|
const endpoint = resolveCloudEndpoint(options.endpoint);
|
|
1805
1805
|
try {
|
|
1806
|
-
const { runConnect } = await import("./connect-
|
|
1806
|
+
const { runConnect } = await import("./connect-5EQA7G3U.js");
|
|
1807
1807
|
await runConnect({
|
|
1808
1808
|
apiKey: credentials.apiKey,
|
|
1809
1809
|
projectId: credentials.projectId,
|
package/dist/version.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ declare const MUSHI_CLI_VERSION: string;
|
|
|
14
14
|
* setup refreshes the pin. Synced to packages/mcp/package.json by
|
|
15
15
|
* `scripts/sync-mcp-pin.mjs` — never hand-edit the version.
|
|
16
16
|
*/
|
|
17
|
-
declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.20.
|
|
17
|
+
declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.20.1";
|
|
18
18
|
|
|
19
19
|
export { MUSHI_CLI_VERSION, MUSHI_MCP_PIN_SPEC };
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/dist/chunk-LFZ5ZIBI.js
DELETED