@robinpath/cli 1.93.0 → 1.95.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +22 -3
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -18598,7 +18598,7 @@ function getNativeModules() {
18598
18598
  import { join as join3, basename as basename2 } from "node:path";
18599
18599
  import { homedir as homedir2, platform as platform2 } from "node:os";
18600
18600
  import { existsSync as existsSync2 } from "node:fs";
18601
- var CLI_VERSION = true ? "1.93.0" : "1.93.0";
18601
+ var CLI_VERSION = true ? "1.95.0" : "1.95.0";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -21913,9 +21913,20 @@ async function fetchBrainStream(prompt, { onToken, conversationHistory, provider
21913
21913
  const reader = response.body.getReader();
21914
21914
  const decoder = new TextDecoder();
21915
21915
  let buffer = "";
21916
+ const READ_TIMEOUT = 3e4;
21916
21917
  while (true) {
21917
- const { done, value } = await reader.read();
21918
- if (done) break;
21918
+ const readPromise = reader.read();
21919
+ const timeoutPromise = new Promise(
21920
+ (resolve13) => setTimeout(() => resolve13({ done: true, value: void 0 }), READ_TIMEOUT)
21921
+ );
21922
+ const { done, value } = await Promise.race([readPromise, timeoutPromise]);
21923
+ if (done) {
21924
+ try {
21925
+ reader.cancel();
21926
+ } catch {
21927
+ }
21928
+ break;
21929
+ }
21919
21930
  buffer += decoder.decode(value, { stream: true });
21920
21931
  const events = buffer.split("\n\n");
21921
21932
  buffer = events.pop() || "";
@@ -21947,6 +21958,14 @@ async function fetchBrainStream(prompt, { onToken, conversationHistory, provider
21947
21958
  doneData = parsed;
21948
21959
  } else if (eventType === "error") {
21949
21960
  logVerbose("Brain stream error:", parsed.message);
21961
+ return {
21962
+ code: fullText,
21963
+ sources: metadata?.sources || [],
21964
+ context: metadata?.context || {},
21965
+ validation: null,
21966
+ usage: doneData?.usage || null,
21967
+ error: parsed.message || "AI model error"
21968
+ };
21950
21969
  }
21951
21970
  } catch {
21952
21971
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinpath/cli",
3
- "version": "1.93.0",
3
+ "version": "1.95.0",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",