@robinpath/cli 1.98.0 → 1.99.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 +12 -5
  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.98.0" : "1.98.0";
18601
+ var CLI_VERSION = true ? "1.99.0" : "1.99.0";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -24787,20 +24787,23 @@ Type / to see available commands.`;
24787
24787
  const activeProvider = this.resolveProvider(activeKey);
24788
24788
  for (let loop = 0; loop < 5; loop++) {
24789
24789
  let fullText = "";
24790
+ let lastUpdate = 0;
24790
24791
  const result = await fetchBrainStream(
24791
24792
  loop === 0 ? expanded : this.conversationMessages[this.conversationMessages.length - 1].content,
24792
24793
  {
24793
24794
  onToken: (delta) => {
24794
24795
  if (delta === "\x1B[RETRY]") {
24795
24796
  fullText = "";
24797
+ lastUpdate = 0;
24796
24798
  ui?.setStreaming("");
24797
24799
  return;
24798
24800
  }
24799
24801
  fullText += delta;
24802
+ const now = Date.now();
24803
+ if (now - lastUpdate < 100) return;
24804
+ lastUpdate = now;
24800
24805
  const clean = fullText.replace(/<memory>[\s\S]*?<\/memory>/g, "").replace(/<cmd>[\s\S]*?<\/cmd>/g, "").replace(/\n{3,}/g, "\n\n").trim();
24801
- const hasOpenCmd = fullText.includes("<cmd>") && !fullText.endsWith("</cmd>") && (fullText.match(/<cmd>/g) || []).length > (fullText.match(/<\/cmd>/g) || []).length;
24802
- const display = hasOpenCmd ? clean + "\n\nPreparing commands..." : clean;
24803
- ui?.setStreaming(display);
24806
+ ui?.setStreaming(clean);
24804
24807
  },
24805
24808
  conversationHistory: this.conversationMessages.slice(0, -1),
24806
24809
  provider: activeProvider,
@@ -24809,6 +24812,10 @@ Type / to see available commands.`;
24809
24812
  cliContext: this.cliContext
24810
24813
  }
24811
24814
  );
24815
+ if (fullText) {
24816
+ const finalClean = fullText.replace(/<memory>[\s\S]*?<\/memory>/g, "").replace(/<cmd>[\s\S]*?<\/cmd>/g, "").replace(/\n{3,}/g, "\n\n").trim();
24817
+ ui?.setStreaming(finalClean);
24818
+ }
24812
24819
  if (!result) {
24813
24820
  finalResponse = "\u26A0 No internet connection. Check your network and try again.";
24814
24821
  break;
@@ -24840,8 +24847,8 @@ Type / to see available commands.`;
24840
24847
  break;
24841
24848
  }
24842
24849
  ui?.setStreaming("");
24843
- await new Promise((r) => setTimeout(r, 50));
24844
24850
  if (cleaned) ui?.addMessage(cleaned);
24851
+ await new Promise((r) => setTimeout(r, 100));
24845
24852
  const cmdResults = [];
24846
24853
  for (const cmd of commands) {
24847
24854
  const preview = cmd.split("\n")[0].slice(0, 80);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinpath/cli",
3
- "version": "1.98.0",
3
+ "version": "1.99.0",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",