@robinpath/cli 1.95.0 → 1.96.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 +9 -4
  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.95.0" : "1.95.0";
18601
+ var CLI_VERSION = true ? "1.96.0" : "1.96.0";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -21896,11 +21896,13 @@ async function fetchBrainStream(prompt, { onToken, conversationHistory, provider
21896
21896
  if (conversationHistory && conversationHistory.length > 0) {
21897
21897
  body.conversationHistory = conversationHistory;
21898
21898
  }
21899
+ const controller = new AbortController();
21900
+ const timeout = setTimeout(() => controller.abort(), 3e4);
21899
21901
  const response = await fetch(`${AI_BRAIN_URL}/docs/generate`, {
21900
21902
  method: "POST",
21901
21903
  headers: { "Content-Type": "application/json" },
21902
21904
  body: JSON.stringify(body),
21903
- signal: AbortSignal.timeout(6e4)
21905
+ signal: controller.signal
21904
21906
  });
21905
21907
  if (!response.ok) {
21906
21908
  logVerbose("Brain stream returned", response.status);
@@ -21913,7 +21915,7 @@ async function fetchBrainStream(prompt, { onToken, conversationHistory, provider
21913
21915
  const reader = response.body.getReader();
21914
21916
  const decoder = new TextDecoder();
21915
21917
  let buffer = "";
21916
- const READ_TIMEOUT = 3e4;
21918
+ const READ_TIMEOUT = 1e4;
21917
21919
  while (true) {
21918
21920
  const readPromise = reader.read();
21919
21921
  const timeoutPromise = new Promise(
@@ -21956,7 +21958,9 @@ async function fetchBrainStream(prompt, { onToken, conversationHistory, provider
21956
21958
  }
21957
21959
  } else if (eventType === "done") {
21958
21960
  doneData = parsed;
21961
+ clearTimeout(timeout);
21959
21962
  } else if (eventType === "error") {
21963
+ clearTimeout(timeout);
21960
21964
  logVerbose("Brain stream error:", parsed.message);
21961
21965
  return {
21962
21966
  code: fullText,
@@ -21971,6 +21975,7 @@ async function fetchBrainStream(prompt, { onToken, conversationHistory, provider
21971
21975
  }
21972
21976
  }
21973
21977
  }
21978
+ clearTimeout(timeout);
21974
21979
  return {
21975
21980
  code: fullText,
21976
21981
  sources: metadata?.sources || [],
@@ -24764,7 +24769,7 @@ Type / to see available commands.`;
24764
24769
  const activeModel = readAiConfig().model || this.model;
24765
24770
  const activeKey = readAiConfig().apiKey || this.apiKey;
24766
24771
  const activeProvider = this.resolveProvider(activeKey);
24767
- for (let loop = 0; loop < 15; loop++) {
24772
+ for (let loop = 0; loop < 5; loop++) {
24768
24773
  let fullText = "";
24769
24774
  const result = await fetchBrainStream(
24770
24775
  loop === 0 ? expanded : this.conversationMessages[this.conversationMessages.length - 1].content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinpath/cli",
3
- "version": "1.95.0",
3
+ "version": "1.96.0",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",