@tiny-fish/cli 0.28.2-next.236 → 0.29.0
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/dist/commands/connect.js +7 -7
- package/package.json +1 -1
package/dist/commands/connect.js
CHANGED
|
@@ -12,11 +12,11 @@ import { detectHumanInitiated } from "../lib/harness.js";
|
|
|
12
12
|
import { TINYFISH_API_KEY_VAR } from "../lib/constants.js";
|
|
13
13
|
import { emitNotice } from "../lib/notice.js";
|
|
14
14
|
import { SIGN_IN_PROBES } from "../lib/registration-detect.js";
|
|
15
|
-
import { errLine } from "../lib/output.js";
|
|
15
|
+
import { errLine, warnLine } from "../lib/output.js";
|
|
16
16
|
import { z } from "zod";
|
|
17
17
|
import { verifyMcpAuth } from "../lib/verify.js";
|
|
18
18
|
export const DEFAULT_MCP_URL = "https://agent.tinyfish.ai/mcp";
|
|
19
|
-
function removeExistingRegistration(client, removal) {
|
|
19
|
+
function removeExistingRegistration(client, removal, verbose) {
|
|
20
20
|
const result = spawn.sync(client.command, removal.args, {
|
|
21
21
|
encoding: "utf8",
|
|
22
22
|
timeout: NON_INTERACTIVE_TIMEOUT_MS,
|
|
@@ -24,11 +24,11 @@ function removeExistingRegistration(client, removal) {
|
|
|
24
24
|
if (result.status === 0)
|
|
25
25
|
return;
|
|
26
26
|
throwIfInterrupted(result);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (/No MCP server named ['"]tinyfish['"]/i.test(details))
|
|
27
|
+
// Best-effort: a stale entry makes `mcp add` error or upsert, with a truer message.
|
|
28
|
+
if (!verbose)
|
|
30
29
|
return;
|
|
31
|
-
|
|
30
|
+
const details = result.stderr?.trim() || result.error?.message || "unknown error";
|
|
31
|
+
warnLine(`Could not remove existing ${removal.label}: ${details}`);
|
|
32
32
|
}
|
|
33
33
|
/** false: fall back to OAuth — a config naming an unset variable authenticates nothing. */
|
|
34
34
|
function exportApiKey(apiKey, displayName, deferOutro) {
|
|
@@ -90,7 +90,7 @@ async function connectNativeMcpClient(client, options) {
|
|
|
90
90
|
telemetry.track("checkpoint", { phase: "prerequisite_ok" });
|
|
91
91
|
state.stage = "registration_cleanup";
|
|
92
92
|
for (const removal of client.removals)
|
|
93
|
-
removeExistingRegistration(client, removal);
|
|
93
|
+
removeExistingRegistration(client, removal, options.verbose ?? false);
|
|
94
94
|
const mcpUrl = new URL(options.mcpUrl);
|
|
95
95
|
mcpUrl.searchParams.set("source", CONNECT_SOURCE);
|
|
96
96
|
mcpUrl.searchParams.set("client", client.connectClient);
|