@robinpath/cli 2.7.0 → 2.9.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 +18 -9
  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.9.0" : "2.9.0";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -24134,7 +24134,7 @@ ${resultSummary}`
24134
24134
 
24135
24135
  // src/ink-repl.tsx
24136
24136
  import { useState, useCallback, useEffect, useMemo } from "react";
24137
- import { render, Box as Box2, Text as Text2, Static, useInput, useApp } from "ink";
24137
+ import { render, Box as Box2, Text as Text2, useInput, useApp } from "ink";
24138
24138
  import InkSpinner from "ink-spinner";
24139
24139
 
24140
24140
  // src/ui/Markdown.tsx
@@ -24509,7 +24509,8 @@ function ChatApp({ engine }) {
24509
24509
  setLoading,
24510
24510
  setStatus,
24511
24511
  setShowModelPicker,
24512
- addMessage: (text, dim) => setMessages((p) => [...p, { id: ++nextId, text, dim }])
24512
+ addMessage: (text, dim) => setMessages((p) => [...p, { id: ++nextId, text, dim }]),
24513
+ clearMessages: () => setMessages([])
24513
24514
  };
24514
24515
  engine.updateStatus();
24515
24516
  }, []);
@@ -24520,7 +24521,7 @@ function ChatApp({ engine }) {
24520
24521
  }
24521
24522
  if (text.startsWith("/")) {
24522
24523
  const result = await engine.handleSlashCommand(text);
24523
- if (result) setMessages((p) => [...p, { id: ++nextId, text: result, dim: true }]);
24524
+ if (result && result.trim()) setMessages((p) => [...p, { id: ++nextId, text: result, dim: true }]);
24524
24525
  engine.updateStatus();
24525
24526
  return;
24526
24527
  }
@@ -24594,16 +24595,16 @@ function ChatApp({ engine }) {
24594
24595
  ] })
24595
24596
  ] })
24596
24597
  ] }) : null,
24597
- /* @__PURE__ */ jsx2(Static, { items: messages, children: (msg) => /* @__PURE__ */ jsx2(Box2, { paddingX: 1, marginBottom: msg.text.startsWith("\u276F") ? 0 : 1, flexDirection: "column", children: msg.text.startsWith("\u276F") ? /* @__PURE__ */ jsxs2(Text2, { children: [
24598
+ messages.map((msg) => /* @__PURE__ */ jsx2(Box2, { paddingX: 1, marginBottom: msg.text.startsWith("\u276F") ? 0 : 1, flexDirection: "column", children: msg.text.startsWith("\u276F") ? /* @__PURE__ */ jsxs2(Text2, { children: [
24598
24599
  /* @__PURE__ */ jsx2(Text2, { color: "cyan", bold: true, children: "\u276F" }),
24599
24600
  /* @__PURE__ */ jsx2(Text2, { bold: true, children: msg.text.slice(1) })
24600
24601
  ] }) : msg.text.includes("\u23BF") && msg.text.includes("Write") ? /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
24601
24602
  /* @__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
24603
+ 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
24604
  ] }) : msg.text.includes("\u23BF") && msg.text.includes("\u2717") ? /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
24604
24605
  /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: msg.text.split("\n")[0] }),
24605
24606
  /* @__PURE__ */ jsx2(Text2, { backgroundColor: "red", color: "white", children: msg.text.split("\n").slice(1).join("\n") })
24606
- ] }) : msg.text.includes("\u23BF") ? /* @__PURE__ */ jsx2(Text2, { dimColor: true, wrap: "wrap", children: msg.text }) : msg.dim ? /* @__PURE__ */ jsx2(Text2, { dimColor: true, wrap: "wrap", children: msg.text }) : /* @__PURE__ */ jsx2(Markdown, { children: msg.text }) }, msg.id) }),
24607
+ ] }) : msg.text.includes("\u23BF") ? /* @__PURE__ */ jsx2(Text2, { dimColor: true, wrap: "wrap", children: msg.text }) : msg.dim ? /* @__PURE__ */ jsx2(Text2, { dimColor: true, wrap: "wrap", children: msg.text }) : /* @__PURE__ */ jsx2(Markdown, { children: msg.text }) }, msg.id)),
24607
24608
  showModelPicker ? /* @__PURE__ */ jsx2(
24608
24609
  ModelSelector,
24609
24610
  {
@@ -24700,7 +24701,8 @@ var ReplEngine = class {
24700
24701
  }
24701
24702
  if (text === "/clear") {
24702
24703
  this.conversationMessages.length = 0;
24703
- return "\u2713 Conversation cleared.";
24704
+ this.ui?.clearMessages();
24705
+ return "";
24704
24706
  }
24705
24707
  if (text === "/compact") {
24706
24708
  if (this.conversationMessages.length > 12) {
@@ -24867,8 +24869,15 @@ Type / to see available commands.`;
24867
24869
  if (isWrite && lineCount > 0) {
24868
24870
  const fileMatch = firstLine.match(/["']([^"']+\.\w+)["']/);
24869
24871
  const fileName = fileMatch ? fileMatch[1] : firstLine.slice(0, 30);
24872
+ const contentLines = cmdLines.slice(1).filter((l) => l.trim() && !l.match(/^(RPEOF|EOF|'@)$/));
24873
+ const preview = contentLines.slice(0, 8).map(
24874
+ (l, i) => ` ${String(i + 1).padStart(3)} + ${l}`
24875
+ ).join("\n");
24876
+ const extra = contentLines.length > 8 ? `
24877
+ \u2026 ${contentLines.length - 8} more lines` : "";
24870
24878
  ui?.addMessage(` \u23BF Write(${fileName})
24871
- + ${lineCount} lines`, true);
24879
+ + Added ${contentLines.length} lines
24880
+ ${preview}${extra}`, true);
24872
24881
  } else if (r.stdout?.trim()) {
24873
24882
  const lines = r.stdout.trim().split("\n");
24874
24883
  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.9.0",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",