@tiny-fish/cli 0.19.1-next.181 → 0.20.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.
@@ -93,7 +93,7 @@ function checkCredential() {
93
93
  id: "cli-credential",
94
94
  title: "CLI credential",
95
95
  status: "key" in resolved ? "pass" : "fail",
96
- detail: "key" in resolved ? `valid key from ${resolved.source}` : resolved.error,
96
+ detail: "key" in resolved ? `key present from ${resolved.source}` : resolved.error,
97
97
  harness: null,
98
98
  };
99
99
  return "key" in resolved ? { check, key: resolved.key } : { check };
@@ -210,46 +210,53 @@ function computeExitCode(results) {
210
210
  }
211
211
  export async function runConnectAll(opts) {
212
212
  const isTTY = detectHumanInitiated();
213
- const rl = isTTY
214
- ? readline.createInterface({ input: process.stdin, output: process.stderr })
215
- : undefined;
216
- let prompt;
217
- if (rl) {
218
- // Without a close-linked signal, question() never settles on Ctrl+D.
219
- const closed = new AbortController();
220
- rl.on("close", () => closed.abort());
221
- prompt = (question) => rl.question(question, { signal: closed.signal });
222
- }
223
- const detections = detectInstalledHarnesses();
224
- const results = [];
225
- try {
226
- for (const [index, detection] of detections.entries()) {
227
- const { harness } = detection;
228
- errLine(`step ${index + 1} of ${detections.length} — ${DISPLAY_NAMES[harness]}`);
229
- let result;
213
+ let stdinClosed = false;
214
+ // Open interface holds stdin raw; hermes' input() then wedges.
215
+ const prompt = isTTY
216
+ ? async (question) => {
217
+ if (stdinClosed)
218
+ throw new Error("stdin is closed");
219
+ const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
220
+ // Without a close-linked signal, question() never settles on Ctrl+D.
221
+ const closed = new AbortController();
222
+ rl.on("close", () => closed.abort());
230
223
  try {
231
- result = await processHarness(detection, opts, prompt);
224
+ return await rl.question(question, { signal: closed.signal });
232
225
  }
233
226
  catch (e) {
234
- // Isolation: one harness throwing never stops the others.
235
- result = {
236
- harness,
237
- detected: detection.detected,
238
- configPath: detection.configPath,
239
- installed: false,
240
- outcome: "failed",
241
- errorMessage: e instanceof Error ? e.message : String(e),
242
- fixCommand: `tinyfish connect ${harness}`,
243
- };
227
+ stdinClosed = true;
228
+ throw e;
229
+ }
230
+ finally {
231
+ rl.close();
244
232
  }
245
- results.push(result);
246
- // Ctrl+C means stop, not continue to the next harness.
247
- if (result.outcome === "interrupted")
248
- break;
249
233
  }
250
- }
251
- finally {
252
- rl?.close();
234
+ : undefined;
235
+ const detections = detectInstalledHarnesses();
236
+ const results = [];
237
+ for (const [index, detection] of detections.entries()) {
238
+ const { harness } = detection;
239
+ errLine(`step ${index + 1} of ${detections.length} — ${DISPLAY_NAMES[harness]}`);
240
+ let result;
241
+ try {
242
+ result = await processHarness(detection, opts, prompt);
243
+ }
244
+ catch (e) {
245
+ // Isolation: one harness throwing never stops the others.
246
+ result = {
247
+ harness,
248
+ detected: detection.detected,
249
+ configPath: detection.configPath,
250
+ installed: false,
251
+ outcome: "failed",
252
+ errorMessage: e instanceof Error ? e.message : String(e),
253
+ fixCommand: `tinyfish connect ${harness}`,
254
+ };
255
+ }
256
+ results.push(result);
257
+ // Ctrl+C means stop, not continue to the next harness.
258
+ if (result.outcome === "interrupted")
259
+ break;
253
260
  }
254
261
  // The interrupt break truncates `results`; pad so the 5-entry telemetry schema still parses.
255
262
  for (const detection of detections) {
@@ -6,8 +6,8 @@ import { loadConfig } from "./auth.js";
6
6
  import { errLine } from "./output.js";
7
7
  import { readCursorTinyfishEntry } from "./cursor-config.js";
8
8
  import { detectInstalledHarnesses, harnessConfigPath, harnessDisplayPath, } from "./harness-detect.js";
9
- // 2s tripped on a cold `hermes mcp list` (0.3s warm), reporting `unknown` on a healthy install.
10
- const PROBE_TIMEOUT_MS = 6_000;
9
+ // 6s tripped on a cold `hermes mcp list`, measured at 6.34s.
10
+ const PROBE_TIMEOUT_MS = 15_000;
11
11
  // A list, verified against codex 0.146. A name-keyed map was accepted here too, but every
12
12
  // field is optional, so that arm parsed *any* object-of-objects: a wrapper like
13
13
  // `{"servers": {...}}` decoded as one entry named `servers` and reported TinyFish absent.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiny-fish/cli",
3
- "version": "0.19.1-next.181",
3
+ "version": "0.20.1",
4
4
  "description": "TinyFish CLI — run web automations from your terminal",
5
5
  "type": "module",
6
6
  "bin": {