@rind-ai/cli 0.6.0 → 0.6.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.
@@ -7,7 +7,7 @@ export function createCompactContextState() {
7
7
  awaitingPostCompactContext = false;
8
8
  return true;
9
9
  }
10
- if (decisions.auto_compact_token_limit_reached || decisions.compact_required) {
10
+ if (decisions.auto_compact_token_limit_reached) {
11
11
  awaitingPostCompactContext = true;
12
12
  }
13
13
  return false;
@@ -471,15 +471,15 @@ function composeFrame(width = process.stdout.columns || 80) {
471
471
  if (!session) {
472
472
  return null;
473
473
  }
474
- const choiceMenu = ["model", "theme", "sessions", "team-blueprints"].includes(session.mode);
474
+ const choiceMenu = ["model", "theme", "sessions", "team-blueprints"].includes(session.mode);
475
475
  if (session.mode === "prompt" && session.menuState) {
476
476
  session.menuState.setInput(session.editor.input());
477
477
  }
478
478
  const slashMenuOpen = session.mode === "prompt"
479
479
  && session.menuState
480
480
  && session.menuState.matches().length > 0;
481
- const showCaret = (!displayState.activeCompact && !choiceMenu && !slashMenuOpen)
482
- || (session.mode === "question" && session.questionState.isEditing());
481
+ const showCaret = (!displayState.activeCompact && !choiceMenu && !slashMenuOpen)
482
+ || (session.mode === "question" && session.questionState.isEditing());
483
483
  if (session.mode === "model") {
484
484
  return {
485
485
  showCaret,
package/lib/rendering.js CHANGED
@@ -462,18 +462,18 @@ function notice(label, ...details) {
462
462
  return lines.join("\n");
463
463
  }
464
464
 
465
- export function toolRequestedLine(event) {
465
+ export function toolRequestedLine(event) {
466
466
  const name = event.tool_name || "unknown";
467
467
  const detail = toolDetail(name, parseJsonObject(event.args_preview));
468
468
  const label = toolLabel(name);
469
469
  const line = `${accent("◌")} ${bold("Tool")} ${dim("·")} ${toolActiveVerb(name)} ${label}`;
470
- return detail ? `${line}\n${dim(toolDetailLine(name, detail))}` : line;
471
- }
470
+ return indentToolText(detail ? `${line}\n${dim(toolDetailLine(name, detail))}` : line);
471
+ }
472
472
 
473
- export function toolStartedLine(event) {
474
- const name = event.tool_name || "tool";
475
- return `${accent("◌")} ${bold("Tool")} ${dim("·")} ${toolActiveVerb(name)} ${toolLabel(name)}`;
476
- }
473
+ export function toolStartedLine(event) {
474
+ const name = event.tool_name || "tool";
475
+ return indentToolText(`${accent("◌")} ${bold("Tool")} ${dim("·")} ${toolActiveVerb(name)} ${toolLabel(name)}`);
476
+ }
477
477
 
478
478
  export function toolResultLine(event, fileChange) {
479
479
  const name = event.tool_name || "unknown";
@@ -483,7 +483,7 @@ export function toolResultLine(event, fileChange) {
483
483
  const suffix = event.error_type ? ` (${event.error_type})` : "";
484
484
  const detail = toolErrorDetail(event.result);
485
485
  const line = `${red("⊘")} ${bold("Tool")} ${dim("·")} ${label} failed in ${duration}${suffix}`;
486
- return detail ? `${line}\n${dim(detailLine(detail))}` : line;
486
+ return indentToolText(detail ? `${line}\n${dim(detailLine(detail))}` : line);
487
487
  }
488
488
  const result = toolResultSummary(event.result);
489
489
  if (result.status === "running" && (name === "bash" || name === "bash_output")) {
@@ -492,32 +492,39 @@ export function toolResultLine(event, fileChange) {
492
492
  : "command running in background";
493
493
  const line = `${accent("◌")} ${bold("Tool")} ${dim("·")} ${runningText} in ${duration}`;
494
494
  const output = result.output;
495
- return [line, output ? dim(detailLine(output)) : "", fileChangeLine(fileChange)]
496
- .filter(Boolean)
497
- .join("\n");
495
+ return indentToolText([line, output ? dim(detailLine(output)) : "", fileChangeLine(fileChange)]
496
+ .filter(Boolean)
497
+ .join("\n"));
498
498
  }
499
499
  const line = result.exitCode
500
500
  ? `${red("⊘")} ${bold("Tool")} ${dim("·")} ${label} exited ${result.exitCode} in ${duration}`
501
501
  : `${green("◉")} ${bold("Tool")} ${dim("·")} ${completedToolText(name, label)} in ${duration}`;
502
502
  const output = result.output;
503
- return [line, output ? dim(detailLine(output)) : "", fileChangeLine(fileChange)]
504
- .filter(Boolean)
505
- .join("\n");
506
- }
507
-
508
- export function planUpdatedLine(plan) {
509
- const items = Array.isArray(plan) ? plan : [];
510
- if (!items.length) {
511
- return `${green("◉")} ${bold("Plan cleared")}`;
512
- }
513
-
514
- const lines = [`${green("◉")} ${bold("Plan updated")}`];
515
- for (const item of items) {
516
- const step = clipSingleLine(item?.step, detailTextWidth());
517
- if (step) {
518
- lines.push(` ${planStatusIcon(item?.status)} ${step}`);
519
- }
520
- }
503
+ return indentToolText([line, output ? dim(detailLine(output)) : "", fileChangeLine(fileChange)]
504
+ .filter(Boolean)
505
+ .join("\n"));
506
+ }
507
+
508
+ function indentToolText(value) {
509
+ return String(value || "")
510
+ .split("\n")
511
+ .map((line) => ` ${line}`)
512
+ .join("\n");
513
+ }
514
+
515
+ export function planUpdatedLine(plan) {
516
+ const items = Array.isArray(plan) ? plan : [];
517
+ if (!items.length) {
518
+ return ` ${green("◉")} ${bold("Plan cleared")}`;
519
+ }
520
+
521
+ const lines = [` ${green("◉")} ${bold("Plan updated")}`];
522
+ for (const item of items) {
523
+ const step = clipSingleLine(item?.step, detailTextWidth());
524
+ if (step) {
525
+ lines.push(` ${planStatusIcon(item?.status)} ${step}`);
526
+ }
527
+ }
521
528
  return lines.join("\n");
522
529
  }
523
530
 
@@ -525,11 +532,13 @@ export function goalContinuedLine(round) {
525
532
  return `${accent("◌")} ${bold("Goal continued")} ${dim(`· round ${Number(round) || 0}`)}`;
526
533
  }
527
534
 
528
- export function toolProgressLine(event) {
529
- const name = event.tool_name || "tool";
530
- const message = progressMessage(event.payload);
531
- return message ? `${accent("◌")} ${bold("Tool")} ${dim("·")} ${toolLabel(name)}\n${dim(` ↳ ${message}`)}` : "";
532
- }
535
+ export function toolProgressLine(event) {
536
+ const name = event.tool_name || "tool";
537
+ const message = progressMessage(event.payload);
538
+ return message
539
+ ? indentToolText(`${accent("◌")} ${bold("Tool")} ${dim("·")} ${toolLabel(name)}\n${dim(` ↳ ${message}`)}`)
540
+ : "";
541
+ }
533
542
 
534
543
  export function errorLine(error) {
535
544
  const detail = clipSingleLine(error, 120);
@@ -1,16 +1,16 @@
1
- export function parseGoalCommand(value) {
2
- const text = String(value || "").trim();
3
- const match = text.match(/^\/goal(?:\s+([\s\S]*))?$/i);
4
- if (!match) {
5
- return null;
6
- }
7
- const argument = String(match[1] || "").trim();
8
- const action = argument.toLowerCase();
9
- if (!argument) {
10
- return { action: "get" };
11
- }
12
- if (["pause", "resume", "clear"].includes(action)) {
13
- return { action };
14
- }
15
- return { action: "set", objective: argument };
16
- }
1
+ export function parseGoalCommand(value) {
2
+ const text = String(value || "").trim();
3
+ const match = text.match(/^\/goal(?:\s+([\s\S]*))?$/i);
4
+ if (!match) {
5
+ return null;
6
+ }
7
+ const argument = String(match[1] || "").trim();
8
+ const action = argument.toLowerCase();
9
+ if (!argument) {
10
+ return { action: "get" };
11
+ }
12
+ if (["pause", "resume", "clear"].includes(action)) {
13
+ return { action };
14
+ }
15
+ return { action: "set", objective: argument };
16
+ }
@@ -133,7 +133,7 @@ function resultDataFromRaw(result) {
133
133
  };
134
134
  }
135
135
 
136
- export function renderToolRunning(context, width) {
136
+ export function renderToolRunning(context, width) {
137
137
  const renderer = TOOL_RENDERERS[context.name] || GENERIC_RENDERER;
138
138
  const elapsedSeconds = Math.floor((context.elapsedMs || 0) / 1000);
139
139
  const elapsed = ELAPSED_TITLE_TOOLS.has(context.name) ? dim(` · ${elapsedSeconds}s`) : "";
@@ -143,8 +143,8 @@ export function renderToolRunning(context, width) {
143
143
  if (context.progressMessage) {
144
144
  lines.push(dim(` ↳ ${clipText(context.progressMessage, width, 8)}`));
145
145
  }
146
- return lines;
147
- }
146
+ return indentToolLines(lines, width);
147
+ }
148
148
 
149
149
  export function renderToolFinished(context, width) {
150
150
  const renderer = TOOL_RENDERERS[context.name] || GENERIC_RENDERER;
@@ -152,10 +152,10 @@ export function renderToolFinished(context, width) {
152
152
  const lines = [clipCells(renderer.finished(context, width, state), Math.max(1, width))];
153
153
  if (state.kind === "error") {
154
154
  const detail = errorDetail(context.event, width);
155
- if (detail) {
156
- lines.push(detail);
157
- }
158
- return lines;
155
+ if (detail) {
156
+ lines.push(detail);
157
+ }
158
+ return indentToolLines(lines, width);
159
159
  }
160
160
  const bodyLimit = context.expanded ? EXPANDED_HARD_CAPS[context.name] ?? 200 : COLLAPSED_BODY_CAPS[context.name] ?? 0;
161
161
  const produced = renderer.body ? renderer.body(context, width, bodyLimit) : [];
@@ -164,15 +164,20 @@ export function renderToolFinished(context, width) {
164
164
  if (normalized.total > 0) {
165
165
  lines.push(bodyFooter(normalized.total, context.expanded));
166
166
  }
167
- return lines;
167
+ return indentToolLines(lines, width);
168
168
  }
169
169
  lines.push(...normalized.lines);
170
170
  const hidden = Math.max(0, normalized.total - normalized.lines.length);
171
171
  if (hidden > 0) {
172
172
  lines.push(bodyFooter(hidden, context.expanded));
173
173
  }
174
- return lines;
175
- }
174
+ return indentToolLines(lines, width);
175
+ }
176
+
177
+ function indentToolLines(lines, width) {
178
+ const limit = Math.max(1, Number(width) || 1);
179
+ return lines.map((line) => clipCells(` ${line}`, limit));
180
+ }
176
181
 
177
182
  function normalizeBody(produced) {
178
183
  if (Array.isArray(produced)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rind-ai/cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Rind command-line client",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/Azzurroooo/rind.git",
@@ -16,10 +16,10 @@
16
16
  "node": ">=18"
17
17
  },
18
18
  "optionalDependencies": {
19
- "@rind-ai/runtime-win32-x64": "0.6.0",
20
- "@rind-ai/runtime-linux-x64": "0.6.0",
21
- "@rind-ai/runtime-darwin-x64": "0.6.0",
22
- "@rind-ai/runtime-darwin-arm64": "0.6.0"
19
+ "@rind-ai/runtime-win32-x64": "0.6.2",
20
+ "@rind-ai/runtime-linux-x64": "0.6.2",
21
+ "@rind-ai/runtime-darwin-x64": "0.6.2",
22
+ "@rind-ai/runtime-darwin-arm64": "0.6.2"
23
23
  },
24
24
  "publishConfig": {
25
25
  "access": "public",