@tiny-fish/cli 0.52.2-next.423 → 0.52.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.
@@ -108,7 +108,7 @@ function signInStepError(message, result, bounded) {
108
108
  : error;
109
109
  }
110
110
  /** Resolved before the removals, so a refusal strands no registration. */
111
- async function prepareInstallAuth(client, options, keyAuthSupported) {
111
+ async function prepareInstallAuth(client, options, keyAuthSupported, matchedVariant) {
112
112
  // Prod MCP accepts X-API-Key, so a stored key replaces the browser OAuth hop.
113
113
  const storedKey = validatedApiKey(options.apiKey);
114
114
  const keyedAdd = resolveKeyedAdd(client, storedKey, keyAuthSupported, options.keyAuthOnly === true, options.deferOutro);
@@ -135,7 +135,15 @@ async function prepareInstallAuth(client, options, keyAuthSupported) {
135
135
  if (keyedAdd?.spec.seedKey) {
136
136
  await verifyKeyBeforeSeeding(keyedAdd.key, client.displayName, options.mcpUrl);
137
137
  }
138
- return { keyedAdd, keyless, buildAddArgs, directInstall };
138
+ return {
139
+ keyedAdd,
140
+ keyless,
141
+ buildAddArgs: withVariant(buildAddArgs, matchedVariant),
142
+ directInstall,
143
+ };
144
+ }
145
+ function withVariant(build, variant) {
146
+ return build && variant ? (mcpUrl) => [...build(mcpUrl), variant] : build;
139
147
  }
140
148
  /** Inherit for an inline-OAuth add; capture otherwise, piping prompts when seeded. */
141
149
  function addSpawnOptions(options, interactiveAdd, seeded) {
@@ -264,10 +272,10 @@ export async function connectNativeMcpClient(client, options) {
264
272
  const support = await requireSupportOrRescue(client, client.connectClient, state, telemetry, options);
265
273
  if (!support)
266
274
  return;
267
- const { optionalSupported, keyAuthSupported, harnessVersion } = support;
275
+ const { optionalSupported, keyAuthSupported, matchedVariant, harnessVersion } = support;
268
276
  telemetry.setHarnessVersion(harnessVersion);
269
277
  state.harnessDegraded = !!client.loginArgs && !optionalSupported;
270
- const plan = await prepareInstallAuth(client, options, keyAuthSupported);
278
+ const plan = await prepareInstallAuth(client, options, keyAuthSupported, matchedVariant);
271
279
  const useKeyAuth = !!plan.keyedAdd;
272
280
  const useKeyless = plan.keyless;
273
281
  if (useKeyless)
@@ -295,6 +295,7 @@ export declare const HARNESS_SPECS: {
295
295
  args: string[];
296
296
  patterns: RegExp[];
297
297
  keyAuthPattern: RegExp;
298
+ variants: string[];
298
299
  timeoutMs: number;
299
300
  unavailableMessage: string;
300
301
  };
@@ -224,6 +224,8 @@ export const HARNESS_SPECS = {
224
224
  args: ['mcp', 'add', '--help'],
225
225
  patterns: [/--url(?:\s|$)/m],
226
226
  keyAuthPattern: HEADER_FLAG,
227
+ // 2.x writes ./opencode.json without it, leaking the key (PF-6613).
228
+ variants: ['--global'],
227
229
  // Native binary; a win32 first launch outlasted 10s in CI.
228
230
  timeoutMs: 30_000,
229
231
  unavailableMessage: OPENCODE_MCP_ADD_UNAVAILABLE_MESSAGE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiny-fish/cli",
3
- "version": "0.52.2-next.423",
3
+ "version": "0.52.2",
4
4
  "description": "TinyFish CLI — run web automations from your terminal",
5
5
  "type": "module",
6
6
  "bin": {