@robinpath/cli 2.7.0 → 2.8.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 +10 -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 ? "2.7.0" : "2.7.0";
18601
+ var CLI_VERSION = true ? "2.8.0" : "2.8.0";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -24599,7 +24599,7 @@ function ChatApp({ engine }) {
24599
24599
  /* @__PURE__ */ jsx2(Text2, { bold: true, children: msg.text.slice(1) })
24600
24600
  ] }) : msg.text.includes("\u23BF") && msg.text.includes("Write") ? /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
24601
24601
  /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: msg.text.split("\n")[0] }),
24602
- msg.text.includes("+ ") ? /* @__PURE__ */ jsx2(Text2, { backgroundColor: "green", color: "white", children: msg.text.split("\n").slice(1).join("\n") }) : null
24602
+ msg.text.split("\n").slice(1).map((line, li) => /* @__PURE__ */ jsx2(Text2, { backgroundColor: line.includes("+") ? "green" : void 0, color: line.includes("+") ? "white" : void 0, dimColor: !line.includes("+"), children: line }, li))
24603
24603
  ] }) : msg.text.includes("\u23BF") && msg.text.includes("\u2717") ? /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
24604
24604
  /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: msg.text.split("\n")[0] }),
24605
24605
  /* @__PURE__ */ jsx2(Text2, { backgroundColor: "red", color: "white", children: msg.text.split("\n").slice(1).join("\n") })
@@ -24867,8 +24867,15 @@ Type / to see available commands.`;
24867
24867
  if (isWrite && lineCount > 0) {
24868
24868
  const fileMatch = firstLine.match(/["']([^"']+\.\w+)["']/);
24869
24869
  const fileName = fileMatch ? fileMatch[1] : firstLine.slice(0, 30);
24870
+ const contentLines = cmdLines.slice(1).filter((l) => l.trim() && !l.match(/^(RPEOF|EOF|'@)$/));
24871
+ const preview = contentLines.slice(0, 8).map(
24872
+ (l, i) => ` ${String(i + 1).padStart(3)} + ${l}`
24873
+ ).join("\n");
24874
+ const extra = contentLines.length > 8 ? `
24875
+ \u2026 ${contentLines.length - 8} more lines` : "";
24870
24876
  ui?.addMessage(` \u23BF Write(${fileName})
24871
- + ${lineCount} lines`, true);
24877
+ + Added ${contentLines.length} lines
24878
+ ${preview}${extra}`, true);
24872
24879
  } else if (r.stdout?.trim()) {
24873
24880
  const lines = r.stdout.trim().split("\n");
24874
24881
  const preview = lines.length <= 4 ? lines.map((l) => ` ${l}`).join("\n") : lines.slice(0, 3).map((l) => ` ${l}`).join("\n") + `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinpath/cli",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",