@bolt-cli/cli 0.14.0 → 0.15.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.
package/lib/cli.js CHANGED
@@ -278,7 +278,7 @@ async function cmdSession(rest) {
278
278
  const s = id ? session.load(id) : null;
279
279
  if (!s) throw new Error("Usage: bolt session show <id>");
280
280
  for (const [i, t] of s.turns.entries()) {
281
- console.log(`\n--- turn ${i + 1} [${t.mode}] ${t.at} ---\nQ: ${t.prompt}\nA: ${t.response.slice(0, 2000)}`);
281
+ console.log(`\n--- turn ${i + 1} [${t.mode}] ${t.at} ---\n${ui.userTurn(t.prompt)}\nA: ${t.response.slice(0, 2000)}`);
282
282
  if (t.tools && t.tools.length) {
283
283
  console.log(`tools: ${t.tools.map((tool) => `${tool.tool}${tool.ok === false ? " (failed)" : ""}`).join(", ")}`);
284
284
  }
@@ -921,10 +921,10 @@ function handleToolEvent(event) {
921
921
  } else {
922
922
  toolStarted.set(toolTimingKey(event.call), Date.now());
923
923
  const elevated = event.call && event.call.tool === "bash" ? permissions.isElevatedCommand(event.call.command) : false;
924
- // reference terminals render tool traffic as dim text under the answer, not a
925
- // branded announcement; the elevated warning keeps its colour so the
926
- // one thing that must be seen, is.
927
- ui.status(`${ui.c.muted(`${ui.GLYPH.caret} ${tools.describeCall(event.call)}`)}${elevated ? ` ${ui.c.warning("[elevated]")}` : ""}`);
924
+ // Transcript-style tool row: a quiet mark plus the call, the way a
925
+ // full-screen agent renders activity. The elevated warning keeps its
926
+ // colour so the one thing that must be seen, is.
927
+ ui.status(`${ui.toolLine(tools.describeCall(event.call))}${elevated ? ` ${ui.c.warning("[elevated]")}` : ""}`);
928
928
  }
929
929
  return;
930
930
  }
@@ -934,9 +934,9 @@ function handleToolEvent(event) {
934
934
  if (event.call.tool === "(parse error)") {
935
935
  ui.warn(`tool request ignored: ${r.summary || "bad block"}`);
936
936
  } else {
937
- // Result rows stay dim like the call row; failure keeps a warning tone
938
- // so a scan down the transcript still catches it.
939
- ui.status(` ${r.ok ? ui.c.muted("ok") : ui.c.warning("FAILED")} ${ui.c.muted(r.summary || "")}${took}`);
937
+ // Result rows mirror the call row; failure keeps an error tone so a scan
938
+ // down the transcript still catches it.
939
+ ui.status(ui.toolLine(r.ok ? "ok" : "FAILED", r.summary || "", { ok: r.ok, duration: took || undefined }));
940
940
  }
941
941
  }
942
942
  }
@@ -966,8 +966,7 @@ function takeToolElapsed(call) {
966
966
  if (!key || !toolStarted.has(key)) return "";
967
967
  const ms = Date.now() - toolStarted.get(key);
968
968
  toolStarted.delete(key);
969
- const text = formatElapsed(ms);
970
- return text ? ` ${ui.c.muted(`· ${text}`)}` : "";
969
+ return formatElapsed(ms);
971
970
  }
972
971
 
973
972
  function copyToClipboard(text) {
@@ -1619,19 +1618,22 @@ function pickTip(n) {
1619
1618
  return TIPS[((Number(n) || 0) % TIPS.length + TIPS.length) % TIPS.length];
1620
1619
  }
1621
1620
 
1622
- // Welcome lines for the REPL: quiet, polished. One identity line
1623
- // (name, version, backend, working directory), one state line (session, the
1624
- // single verb that matters), one muted mechanics line. No logo wall, no box,
1625
- // no rotating tip. Pure (ui.c degrades to identity), tested.
1621
+ // REPL home surface: half-block wordmark, identity/session chrome, and one
1622
+ // mechanics line. The wordmark is the only decoration; everything else stays
1623
+ // muted so the prompt below remains the focus. Pure (ui.c degrades on a pipe),
1624
+ // tested for the hint phrases the docs promise.
1626
1625
  function replWelcomeLines({ sid, version, host, cwd, update }) {
1627
1626
  const identity = [version ? `v${version}` : "", host, cwd].filter(Boolean);
1628
1627
  const lines = [
1629
- `${ui.c.primary(ui.c.bold("bolt"))}${identity.length ? ` ${ui.c.muted(identity.join(` ${ui.GLYPH.dot} `))}` : ""}`,
1630
- ui.c.muted(`session ${sid.slice(0, 8)} ${ui.GLYPH.dot} type a task and press enter`),
1631
- ` ${ui.c.muted(`/ opens the command dropdown ${ui.GLYPH.dot} type to filter, up/down to pick, Tab fills and keeps your place ${ui.GLYPH.dot} @path attaches a file`)}`,
1628
+ ...ui.wordmark(" "),
1629
+ "",
1630
+ ` ${ui.c.muted(identity.join(` ${ui.GLYPH.dot} `))}`,
1631
+ ` ${ui.c.muted(`session ${sid.slice(0, 8)} ${ui.GLYPH.dot} type a task and press enter`)}`,
1632
+ "",
1633
+ ` ${ui.c.primary("/")} ${ui.c.muted("opens the command dropdown")} ${ui.c.muted(ui.GLYPH.dot)} ${ui.c.primary("Tab fills")} ${ui.c.muted("and keeps your place")} ${ui.c.muted(ui.GLYPH.dot)} ${ui.c.primary("@path")} ${ui.c.muted("attaches a file")}`,
1632
1634
  ];
1633
1635
  if (update) {
1634
- lines.push("", `${ui.c.warning("update")} ${update}`);
1636
+ lines.push("", ` ${ui.c.warning("update")} ${update}`);
1635
1637
  }
1636
1638
  return lines;
1637
1639
  }
package/lib/present.js CHANGED
@@ -79,7 +79,7 @@ function promptLine({ mode, target, agent, files, balance, tools }) {
79
79
  if (files) bits.push(ui.c.muted(`${files} file${files === 1 ? "" : "s"}`));
80
80
  if (tools !== undefined) bits.push(ui.c.muted(tools ? "tools" : "no-tools"));
81
81
  if (balance !== undefined && balance !== null) bits.push(ui.c.muted(`${balance} tok`));
82
- return `${ui.c.primary(ui.GLYPH.caret)} ${bits.join(ui.c.muted(` ${ui.GLYPH.dot} `))} ${ui.c.primary(ui.GLYPH.caret)} `;
82
+ return `${ui.c.primary(">")} ${bits.join(ui.c.muted(` ${ui.GLYPH.dot} `))} `;
83
83
  }
84
84
 
85
85
  // Palette rows for `select()`; label is what gets typed back into the prompt.
package/lib/ui.js CHANGED
@@ -168,21 +168,34 @@ function width() {
168
168
  return typeof columns === "number" && columns > 20 ? Math.min(columns, 100) : 78;
169
169
  }
170
170
 
171
- // Heavy block-letter wordmark: solid blocks where
172
- // the terminal proves modern, the plain word everywhere else so raster fonts
173
- // never show tofu. Rows pad to one width in code (no trailing whitespace in
174
- // the literals for linters to flag); every glyph is one cell, so length math
175
- // holds. Pure, tested.
171
+ // Half-block wordmark in the register used by full-screen agent terminals:
172
+ // solid upper blocks, a dim baseline, `_` holes and a `~` shadow. One cell per
173
+ // glyph so visible-length maths holds; `_` is a blank cell, never a literal
174
+ // underscore. Colour degrades to identity on a pipe. Pure, width-tested.
176
175
  const LOGO_RAW = [
177
- "██████╗ ██████╗ ██╗ █████████",
178
- "██╔══██╗ ██╔══██╗ ██║ █████████",
179
- "██████╔╝ ██║ ██║ ██║ █",
180
- "██╔══██╗ ██║ ██║ ██║ █",
181
- "██████╔╝ ██║ ██║ ██║ █",
182
- "╚═════╝ ╚════╝ ██║▄▄▄▄",
176
+ " ",
177
+ "█▀▀▄ █▀▀█ █___ █▀▀▀",
178
+ "█▄▄▀ █__█ █___ _█__",
179
+ "▀~~▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀",
183
180
  ];
184
- const LOGO_WIDTH = Math.max(...LOGO_RAW.map((row) => row.length));
185
- const LOGO = U ? LOGO_RAW.map((row) => row + " ".repeat(LOGO_WIDTH - row.length)) : ["bolt"];
181
+ function wordmark(pad = "") {
182
+ if (!U) return [`${pad}bolt`];
183
+ return LOGO_RAW.map((line, i) => {
184
+ const baseline = i === LOGO_RAW.length - 1;
185
+ return (
186
+ pad +
187
+ [...line]
188
+ .map((ch) => {
189
+ if (ch === "_" || ch === " ") return " ";
190
+ if (ch === "~") return c.border("▀");
191
+ if (ch === "▀" && baseline) return c.muted(ch);
192
+ return c.primary(ch);
193
+ })
194
+ .join("")
195
+ );
196
+ });
197
+ }
198
+ const LOGO = wordmark();
186
199
 
187
200
  // Relative timestamps for pickers and dashboards ("5m ago"). Pure, tested:
188
201
  // `now` injects the clock, unparseable input yields "".
@@ -270,6 +283,26 @@ function bullets(rows, { marker = GLYPH.dot } = {}) {
270
283
  return rows.map((r) => ` ${c.muted(marker)} ${r}`).join("\n");
271
284
  }
272
285
 
286
+ // Transcript shapes shared by the REPL and the tool-event renderer. A user
287
+ // turn gets a bright `>` marker and default-foreground text; tool activity gets
288
+ // a compact indented row with a semantic mark. Both are pure strings, so a
289
+ // piped log keeps the same readable shape without ANSI.
290
+ function userTurn(text) {
291
+ return String(text ?? "")
292
+ .split("\n")
293
+ .map((line, i) => (i === 0 ? `${c.primary(">")} ${c.bold(line)}` : ` ${line}`))
294
+ .join("\n");
295
+ }
296
+
297
+ function toolLine(name, detail, { ok: state, duration } = {}) {
298
+ const mark = state === undefined ? c.info(GLYPH.dot) : state ? c.success(GLYPH.tick) : c.error(GLYPH.cross);
299
+ const label = state === undefined ? c.primary(name) : state ? c.success(name) : c.error(name);
300
+ const bits = [label];
301
+ if (detail) bits.push(c.muted(String(detail)));
302
+ if (duration) bits.push(c.border(String(duration)));
303
+ return ` ${mark} ${bits.join(` ${c.muted(GLYPH.dot)} `)}`;
304
+ }
305
+
273
306
  // ---------------------------------------------------------------- status
274
307
 
275
308
  // Quiet progress line for tool activity: reference terminals render tool traffic as
@@ -748,6 +781,9 @@ module.exports = {
748
781
  ESC,
749
782
  GLYPH,
750
783
  LOGO,
784
+ wordmark,
785
+ userTurn,
786
+ toolLine,
751
787
  PALETTE,
752
788
  c,
753
789
  enabled: c.enabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolt-cli/cli",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Bolt terminal CLI — authorized testing and tool-building from your terminal or VS Code.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "commonjs",