@botbotgo/agent-harness 0.0.320 → 0.0.321

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.
@@ -1,9 +1,10 @@
1
+ import { markdownToConsole } from "../projections/presentation.js";
1
2
  import { renderChatRuntimeFailure } from "./chat-workspace.js";
2
3
  export function countRenderedLines(text) {
3
4
  return text.replace(/\n$/, "").split("\n").length;
4
5
  }
5
6
  export function renderChatTextChunk(text, modelInfo) {
6
- return renderChatRuntimeFailure(text, modelInfo);
7
+ return markdownToConsole(renderChatRuntimeFailure(text, modelInfo));
7
8
  }
8
9
  export function renderChatRequestRunning(input) {
9
10
  const parts = [
@@ -1 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.319";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.320";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.319";
1
+ export const AGENT_HARNESS_VERSION = "0.0.320";
@@ -94,7 +94,7 @@ export function markdownToHtml(markdown) {
94
94
  }
95
95
  export function markdownToConsole(markdown) {
96
96
  if (!markdown.includes("\n")) {
97
- return renderInlineConsoleMarkdown(markdown);
97
+ return renderInlineConsoleMarkdown(markdown.trim());
98
98
  }
99
99
  const normalized = markdown.replace(/\r\n/g, "\n");
100
100
  const blocks = normalized.split(/\n\n+/);
@@ -114,11 +114,12 @@ export function markdownToConsole(markdown) {
114
114
  const language = lines[0]?.slice(3).trim();
115
115
  const code = lines.slice(1, -1);
116
116
  const label = language ? ` ${language} ` : " code ";
117
+ const borderWidth = Math.max(label.length, 6);
117
118
  rendered.push([
118
- `\u001b[2m┌${"─".repeat(Math.max(label.length, 6))}\u001b[0m`,
119
+ `\u001b[2m┌${"─".repeat(borderWidth)}\u001b[0m`,
119
120
  `\u001b[2m│\u001b[0m${label}`,
120
121
  ...code.map((line) => ` ${line}`),
121
- "\u001b[2m└──────\u001b[0m",
122
+ `\u001b[2m└${"─".repeat(borderWidth)}\u001b[0m`,
122
123
  ].join("\n"));
123
124
  continue;
124
125
  }
@@ -130,25 +131,30 @@ export function markdownToConsole(markdown) {
130
131
  rendered.push(`\u001b[1m${title}\u001b[0m\n\u001b[2m${underline.repeat(Math.max(3, title.replace(/\u001b\[[0-9;]*m/g, "").length))}\u001b[0m`);
131
132
  continue;
132
133
  }
133
- if (trimmed.split("\n").every((line) => /^[-*]\s+/.test(line))) {
134
+ if (trimmed.split("\n").every((line) => /^\s*[-*]\s+/.test(line))) {
134
135
  rendered.push(trimmed
135
136
  .split("\n")
136
- .map((line) => line.replace(/^[-*]\s+/, "• "))
137
+ .map((line) => {
138
+ const match = line.match(/^(\s*)[-*]\s+(.*)$/);
139
+ const indent = match?.[1] ?? "";
140
+ const content = match?.[2] ?? line;
141
+ return `${indent}• ${content}`;
142
+ })
137
143
  .map((line) => renderInlineConsoleMarkdown(line))
138
144
  .join("\n"));
139
145
  continue;
140
146
  }
141
- if (trimmed.split("\n").every((line) => /^\d+\.\s+/.test(line))) {
147
+ if (trimmed.split("\n").every((line) => /^\s*\d+\.\s+/.test(line))) {
142
148
  rendered.push(trimmed
143
149
  .split("\n")
144
150
  .map((line) => renderInlineConsoleMarkdown(line))
145
151
  .join("\n"));
146
152
  continue;
147
153
  }
148
- if (trimmed.split("\n").every((line) => /^>\s?/.test(line))) {
154
+ if (trimmed.split("\n").every((line) => /^\s*>\s?/.test(line))) {
149
155
  rendered.push(trimmed
150
156
  .split("\n")
151
- .map((line) => line.replace(/^>\s?/, ""))
157
+ .map((line) => line.replace(/^\s*>\s?/, ""))
152
158
  .map((line) => `\u001b[2m│\u001b[0m ${renderInlineConsoleMarkdown(line)}`)
153
159
  .join("\n"));
154
160
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.320",
3
+ "version": "0.0.321",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",