@vm0/cli 9.7.0 → 9.7.1

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/index.js +63 -19
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -4626,15 +4626,15 @@ function formatToolHeader(data) {
4626
4626
  return [headline];
4627
4627
  }
4628
4628
  var toolHeadlineFormatters = {
4629
- Read: (input) => `Read(${chalk4.dim(String(input.file_path || ""))})`,
4630
- Edit: (input) => `Edit(${chalk4.dim(String(input.file_path || ""))})`,
4631
- Write: (input) => `Write(${chalk4.dim(String(input.file_path || ""))})`,
4632
- Bash: (input) => `Bash(${chalk4.dim(truncate(String(input.command || ""), 60))})`,
4633
- Glob: (input) => `Glob(${chalk4.dim(String(input.pattern || ""))})`,
4634
- Grep: (input) => `Grep(${chalk4.dim(String(input.pattern || ""))})`,
4635
- Task: (input) => `Task(${chalk4.dim(truncate(String(input.description || ""), 60))})`,
4636
- WebFetch: (input) => `WebFetch(${chalk4.dim(truncate(String(input.url || ""), 60))})`,
4637
- WebSearch: (input) => `WebSearch(${chalk4.dim(truncate(String(input.query || ""), 60))})`,
4629
+ Read: (input) => `Read${chalk4.dim(`(${String(input.file_path || "")})`)}`,
4630
+ Edit: (input) => `Edit${chalk4.dim(`(${String(input.file_path || "")})`)}`,
4631
+ Write: (input) => `Write${chalk4.dim(`(${String(input.file_path || "")})`)}`,
4632
+ Bash: (input) => `Bash${chalk4.dim(`(${truncate(String(input.command || ""), 60)})`)}`,
4633
+ Glob: (input) => `Glob${chalk4.dim(`(${String(input.pattern || "")})`)}`,
4634
+ Grep: (input) => `Grep${chalk4.dim(`(${String(input.pattern || "")})`)}`,
4635
+ Task: (input) => `Task${chalk4.dim(`(${truncate(String(input.description || ""), 60)})`)}`,
4636
+ WebFetch: (input) => `WebFetch${chalk4.dim(`(${truncate(String(input.url || ""), 60)})`)}`,
4637
+ WebSearch: (input) => `WebSearch${chalk4.dim(`(${truncate(String(input.query || ""), 60)})`)}`,
4638
4638
  TodoWrite: () => "TodoWrite"
4639
4639
  };
4640
4640
  function getToolHeadline(tool, input) {
@@ -4645,6 +4645,11 @@ function formatToolResult(toolUse, result, verbose) {
4645
4645
  const { tool, input } = toolUse;
4646
4646
  const { result: resultText, isError } = result;
4647
4647
  const lines = [];
4648
+ if (tool === "Read" && !isError && resultText) {
4649
+ const readLines = formatReadContent(resultText, verbose);
4650
+ lines.push(...readLines);
4651
+ return lines;
4652
+ }
4648
4653
  if (tool === "TodoWrite" && !isError) {
4649
4654
  const todoLines = formatTodoList(input);
4650
4655
  lines.push(...todoLines);
@@ -4690,6 +4695,43 @@ function formatToolResult(toolUse, result, verbose) {
4690
4695
  }
4691
4696
  return lines;
4692
4697
  }
4698
+ function formatReadContent(resultText, verbose) {
4699
+ const lines = [];
4700
+ const rawLines = resultText.split("\n");
4701
+ const contentLines = [];
4702
+ const lineNumberPattern = /^\s*\d+→(.*)$/;
4703
+ for (const line of rawLines) {
4704
+ const match = line.match(lineNumberPattern);
4705
+ if (match) {
4706
+ contentLines.push(match[1] ?? "");
4707
+ }
4708
+ }
4709
+ const displayLines = contentLines.length > 0 ? contentLines : rawLines.filter((line) => line.trim().length > 0);
4710
+ const totalLines = displayLines.length;
4711
+ if (totalLines === 0) {
4712
+ lines.push(`\u2514 \u2713 ${chalk4.dim("(empty)")}`);
4713
+ return lines;
4714
+ }
4715
+ if (verbose) {
4716
+ for (let i = 0; i < displayLines.length; i++) {
4717
+ const prefix = i === 0 ? "\u2514 " : " ";
4718
+ lines.push(`${prefix}${chalk4.dim(displayLines[i] ?? "")}`);
4719
+ }
4720
+ } else {
4721
+ const previewCount = Math.min(3, totalLines);
4722
+ for (let i = 0; i < previewCount; i++) {
4723
+ const prefix = i === 0 ? "\u2514 " : " ";
4724
+ lines.push(`${prefix}${chalk4.dim(displayLines[i] ?? "")}`);
4725
+ }
4726
+ const remaining = totalLines - previewCount;
4727
+ if (remaining > 0) {
4728
+ lines.push(
4729
+ ` ${chalk4.dim(`\u2026 +${remaining} ${pluralize(remaining, "line", "lines")} (vm0 logs <runId> to see all)`)}`
4730
+ );
4731
+ }
4732
+ }
4733
+ return lines;
4734
+ }
4693
4735
  function formatWritePreview(input, verbose) {
4694
4736
  const lines = [];
4695
4737
  const content = String(input.content || "");
@@ -4727,31 +4769,31 @@ function formatEditDiff(input, verbose) {
4727
4769
  lines.push(`\u23BF ${chalk4.dim(summary)}`);
4728
4770
  if (verbose) {
4729
4771
  for (const line of oldLines) {
4730
- lines.push(` ${chalk4.dim(`- ${line}`)}`);
4772
+ lines.push(` - ${chalk4.dim(line)}`);
4731
4773
  }
4732
4774
  for (const line of newLines) {
4733
- lines.push(` ${chalk4.dim(`+ ${line}`)}`);
4775
+ lines.push(` + ${chalk4.dim(line)}`);
4734
4776
  }
4735
4777
  } else {
4736
4778
  const previewLimit = 3;
4737
4779
  const showOld = Math.min(previewLimit, oldLines.length);
4738
4780
  const showNew = Math.min(previewLimit, newLines.length);
4739
4781
  for (let i = 0; i < showOld; i++) {
4740
- lines.push(` ${chalk4.dim(`- ${truncate(oldLines[i] ?? "", 60)}`)}`);
4782
+ lines.push(` - ${chalk4.dim(truncate(oldLines[i] ?? "", 60))}`);
4741
4783
  }
4742
4784
  const remainingOld = oldLines.length - previewLimit;
4743
4785
  if (remainingOld > 0) {
4744
4786
  lines.push(
4745
- ` ${chalk4.dim(` \u2026 +${remainingOld} ${pluralize(remainingOld, "line", "lines")} (vm0 logs <runId> to see all)`)}`
4787
+ ` ${chalk4.dim(`\u2026 +${remainingOld} ${pluralize(remainingOld, "line", "lines")} (vm0 logs <runId> to see all)`)}`
4746
4788
  );
4747
4789
  }
4748
4790
  for (let i = 0; i < showNew; i++) {
4749
- lines.push(` ${chalk4.dim(`+ ${truncate(newLines[i] ?? "", 60)}`)}`);
4791
+ lines.push(` + ${chalk4.dim(truncate(newLines[i] ?? "", 60))}`);
4750
4792
  }
4751
4793
  const remainingNew = newLines.length - previewLimit;
4752
4794
  if (remainingNew > 0) {
4753
4795
  lines.push(
4754
- ` ${chalk4.dim(` \u2026 +${remainingNew} ${pluralize(remainingNew, "line", "lines")} (vm0 logs <runId> to see all)`)}`
4796
+ ` ${chalk4.dim(`\u2026 +${remainingNew} ${pluralize(remainingNew, "line", "lines")} (vm0 logs <runId> to see all)`)}`
4755
4797
  );
4756
4798
  }
4757
4799
  }
@@ -4764,12 +4806,14 @@ function formatTodoList(input) {
4764
4806
  lines.push("\u2514 \u2713 Done");
4765
4807
  return lines;
4766
4808
  }
4767
- for (const todo of todos) {
4809
+ for (let i = 0; i < todos.length; i++) {
4810
+ const todo = todos[i];
4768
4811
  const content = todo.content || "Unknown task";
4769
4812
  const status = todo.status || "pending";
4770
4813
  const icon = getTodoStatusIcon(status);
4771
4814
  const styledContent = formatTodoContent(content, status);
4772
- lines.push(` ${icon} ${styledContent}`);
4815
+ const prefix = i === 0 ? "\u2514 " : " ";
4816
+ lines.push(`${prefix}${icon} ${styledContent}`);
4773
4817
  }
4774
4818
  return lines;
4775
4819
  }
@@ -8419,7 +8463,7 @@ var cookAction = new Command27().name("cook").description("Quick start: prepare,
8419
8463
  ).option("-y, --yes", "Skip confirmation prompts").option("-v, --verbose", "Show full tool inputs and outputs").addOption(new Option4("--debug-no-mock-claude").hideHelp()).addOption(new Option4("--no-auto-update").hideHelp()).action(
8420
8464
  async (prompt, options) => {
8421
8465
  if (!options.noAutoUpdate) {
8422
- const shouldExit = await checkAndUpgrade("9.7.0", prompt);
8466
+ const shouldExit = await checkAndUpgrade("9.7.1", prompt);
8423
8467
  if (shouldExit) {
8424
8468
  process.exit(0);
8425
8469
  }
@@ -11575,7 +11619,7 @@ var setupClaudeCommand = new Command57().name("setup-claude").description("Insta
11575
11619
 
11576
11620
  // src/index.ts
11577
11621
  var program = new Command58();
11578
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.7.0");
11622
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.7.1");
11579
11623
  program.addCommand(authCommand);
11580
11624
  program.addCommand(infoCommand);
11581
11625
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.7.0",
3
+ "version": "9.7.1",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",