nolo-cli 0.30.0-alpha.1 → 0.30.0-alpha.2

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/index.js CHANGED
@@ -796,7 +796,7 @@ async function runScript(script, forwardedArgs, env) {
796
796
  return proc.exited;
797
797
  }
798
798
  async function launchTuiWorkspace(args2) {
799
- const { startTuiWorkspace } = await import("./readlineWorkspace-EY3BPXIU.js");
799
+ const { startTuiWorkspace } = await import("./readlineWorkspace-BGKPABK4.js");
800
800
  const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-4474IBTI.js");
801
801
  return startTuiWorkspace({
802
802
  ...args2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nolo-cli",
3
- "version": "0.30.0-alpha.1",
3
+ "version": "0.30.0-alpha.2",
4
4
  "type": "module",
5
5
  "description": "Agent-first terminal workspace for Nolo",
6
6
  "bin": {
@@ -3637,7 +3637,6 @@ var SLASH_COMMANDS = [
3637
3637
  "/ctx",
3638
3638
  "/runtime",
3639
3639
  "/tools",
3640
- "/thinking",
3641
3640
  "/switch",
3642
3641
  "/agent",
3643
3642
  "/agents",
@@ -4726,6 +4725,18 @@ function finalizeCurrentTurn(history) {
4726
4725
  }
4727
4726
  }
4728
4727
  }
4728
+ function appendLocalTurn(history, command, output) {
4729
+ finalizeCurrentTurn(history);
4730
+ history.turns.push({
4731
+ role: "local",
4732
+ command,
4733
+ content: output
4734
+ });
4735
+ if (history.turns.length > MAX_TUI_HISTORY_TURNS) {
4736
+ history.turns = history.turns.slice(history.turns.length - MAX_TUI_HISTORY_TURNS);
4737
+ }
4738
+ resetStreamingTurnCache();
4739
+ }
4729
4740
  function applyOutputChunkToCurrentTurn(history, chunk) {
4730
4741
  const next = applyTerminalOutputToText(history.currentContent, chunk);
4731
4742
  if (next === history.currentContent) return false;
@@ -4753,7 +4764,7 @@ function fillUserBubbleRow(row, surfaceSeq, contentWidth) {
4753
4764
  }
4754
4765
  return renderSurfaceLine({ text: row, surface: surfaceSeq, padTo: contentWidth });
4755
4766
  }
4756
- function renderTurnBlock(role, content, contentWidth, colorEnabled) {
4767
+ function renderTurnBlock(role, content, contentWidth, colorEnabled, command) {
4757
4768
  content = content.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
4758
4769
  const lines = [];
4759
4770
  if (role === "user") {
@@ -4772,6 +4783,21 @@ function renderTurnBlock(role, content, contentWidth, colorEnabled) {
4772
4783
  ...surfaceSeq ? rows.map((row) => fillUserBubbleRow(row, surfaceSeq, contentWidth)) : rows
4773
4784
  );
4774
4785
  }
4786
+ } else if (role === "local") {
4787
+ const dimSeq = colorEnabled ? "\x1B[2m" : "";
4788
+ const resetSeq = colorEnabled ? "\x1B[0m" : "";
4789
+ if (command) {
4790
+ lines.push(
4791
+ ...wrapTranscriptLine(`${dimSeq}\u203A ${command}${resetSeq}`, contentWidth)
4792
+ );
4793
+ }
4794
+ if (content) {
4795
+ for (const line of content.split("\n")) {
4796
+ lines.push(
4797
+ ...wrapTranscriptLine(`${dimSeq} ${line}${resetSeq}`, contentWidth)
4798
+ );
4799
+ }
4800
+ }
4775
4801
  } else {
4776
4802
  const styledEntry = styleAssistantTurn(content, colorEnabled);
4777
4803
  for (const logicalLine of styledEntry.split("\n")) {
@@ -4905,13 +4931,22 @@ function getAssistantPlainLines(content) {
4905
4931
  assistantPlainLinesCache.set(content, plainLines);
4906
4932
  return plainLines;
4907
4933
  }
4908
- function countTurnLines(role, content, contentWidth) {
4934
+ function countTurnLines(role, content, contentWidth, command) {
4909
4935
  content = content.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
4910
4936
  let count = 0;
4911
4937
  if (role === "user") {
4912
4938
  for (const line of content.split("\n")) {
4913
4939
  count += wrapTranscriptLine(`\u2503 ${line}`, contentWidth, "\u2503 ").length;
4914
4940
  }
4941
+ } else if (role === "local") {
4942
+ if (command) {
4943
+ count += wrapTranscriptLine(`\u203A ${command}`, contentWidth).length;
4944
+ }
4945
+ if (content) {
4946
+ for (const line of content.split("\n")) {
4947
+ count += wrapTranscriptLine(` ${line}`, contentWidth).length;
4948
+ }
4949
+ }
4915
4950
  } else {
4916
4951
  const plainLines = getAssistantPlainLines(content);
4917
4952
  for (let i = 0; i < plainLines.length; i++) {
@@ -4935,7 +4970,7 @@ function buildTurnOffsets(history, contentWidth) {
4935
4970
  if (cached && cached.width === contentWidth) {
4936
4971
  lineCount = cached.count;
4937
4972
  } else {
4938
- lineCount = countTurnLines(turn.role, turn.content, contentWidth);
4973
+ lineCount = countTurnLines(turn.role, turn.content, contentWidth, turn.command);
4939
4974
  turnLineCountCache.set(turn, { width: contentWidth, count: lineCount });
4940
4975
  }
4941
4976
  entries.push({ startRow: offset, lineCount, separatorAbove });
@@ -4955,7 +4990,14 @@ function buildCopyViewLines(history) {
4955
4990
  for (const [index, turn] of turns.entries()) {
4956
4991
  if (index > 0) lines.push("");
4957
4992
  const normalized = stripAnsi(turn.content).replace(/\r\n/g, "\n").replace(/\r/g, "\n");
4958
- lines.push(...normalized.split("\n"));
4993
+ if (turn.role === "local") {
4994
+ if (turn.command) {
4995
+ lines.push(`\u203A ${stripAnsi(turn.command)}`);
4996
+ }
4997
+ lines.push(...normalized.split("\n"));
4998
+ } else {
4999
+ lines.push(...normalized.split("\n"));
5000
+ }
4959
5001
  }
4960
5002
  return lines;
4961
5003
  }
@@ -5019,7 +5061,7 @@ function renderHistory(output, history, inputLines) {
5019
5061
  lines = cached.lines;
5020
5062
  } else {
5021
5063
  renderCacheMissCount += 1;
5022
- lines = renderTurnBlock(turn.role, turn.content, contentWidth, colorEnabled);
5064
+ lines = renderTurnBlock(turn.role, turn.content, contentWidth, colorEnabled, turn.command);
5023
5065
  turnLineCache.set(turn, {
5024
5066
  width: contentWidth,
5025
5067
  color: colorEnabled,
@@ -6485,7 +6527,7 @@ async function startTuiWorkspace(options) {
6485
6527
  activeTurnAbort.abort();
6486
6528
  }
6487
6529
  };
6488
- const emitCommandOutput = (text) => {
6530
+ const emitCommandOutput = (text, command = "") => {
6489
6531
  if (!text) return;
6490
6532
  if (!isInteractiveInput(input)) {
6491
6533
  output.write(`${text}
@@ -6493,9 +6535,7 @@ async function startTuiWorkspace(options) {
6493
6535
  return;
6494
6536
  }
6495
6537
  history.followBottom = true;
6496
- startTurn(history, "assistant");
6497
- appendToCurrentTurn(history, text);
6498
- finalizeCurrentTurn(history);
6538
+ appendLocalTurn(history, command, text);
6499
6539
  renderHistoryToOutput();
6500
6540
  if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
6501
6541
  };
@@ -6516,21 +6556,17 @@ async function startTuiWorkspace(options) {
6516
6556
  const previousAgentKey = state.agentKey;
6517
6557
  state = result.nextState;
6518
6558
  const interactive = isInteractiveInput(input);
6519
- if (interactive && result.action?.type !== "chat") {
6520
- history.followBottom = true;
6521
- startTurn(history, "user");
6522
- appendToCurrentTurn(history, line.trim());
6523
- finalizeCurrentTurn(history);
6524
- renderHistoryToOutput();
6525
- if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
6526
- }
6527
- if (result.output) {
6528
- emitCommandOutput(result.output);
6559
+ if (result.action?.type !== "chat" && result.action?.type !== "exit" && result.output) {
6560
+ emitCommandOutput(result.output, interactive ? line.trim() : "");
6529
6561
  }
6530
6562
  if (state.agentKey !== previousAgentKey) {
6531
6563
  persistExplicitAgentSwitch(previousAgentKey);
6532
6564
  }
6533
- if (result.action?.type === "exit") return true;
6565
+ if (result.action?.type === "exit") {
6566
+ if (result.output) output.write(`${result.output}
6567
+ `);
6568
+ return true;
6569
+ }
6534
6570
  if (result.action?.type === "clear") {
6535
6571
  if (result.action.dialogId) {
6536
6572
  const authToken = resolvePlatformAuthToken(options.env ?? {});
@@ -7363,6 +7399,7 @@ ${renderStatusLine(state)}
7363
7399
  }
7364
7400
  export {
7365
7401
  ANSI_ESCAPE_REGEX,
7402
+ appendLocalTurn,
7366
7403
  appendToCurrentTurn,
7367
7404
  applyOutputChunkToCurrentTurn,
7368
7405
  applyScrollAction,