diff --git a/src/status-formatter.js b/src/status-formatter.js index 21c0706..c8dce8f 100644 --- a/src/status-formatter.js +++ b/src/status-formatter.js @@ -42,12 +42,12 @@ function format(sessionState, opts = {}) { const elapsed = formatElapsed(Date.now() - sessionState.startTime); const agentId = sessionState.agentId || extractAgentId(sessionState.sessionKey); const statusPrefix = statusIcon(sessionState.status); - lines.push(`${indent}${statusPrefix} ${agentId} | ${elapsed}`); + lines.push(`${indent}**${statusPrefix}** \`${agentId}\` | ${elapsed}`); // Status lines (trimmed to maxLines, most recent) const statusLines = (sessionState.lines || []).slice(-maxLines); for (const line of statusLines) { - lines.push(`${indent} ${truncateLine(line)}`); + lines.push(`${indent}${formatStatusLine(truncateLine(line))}`); } // Child sessions (sub-agents) @@ -63,13 +63,14 @@ function format(sessionState, opts = {}) { const tokenStr = sessionState.tokenCount ? ` | ${formatTokens(sessionState.tokenCount)} tokens` : ''; - lines.push(`${indent} [${sessionState.status.toUpperCase()}] ${elapsed}${tokenStr}`); + lines.push(`${indent}**[${sessionState.status.toUpperCase()}]** ${elapsed}${tokenStr}`); } - // Wrap in code block at top level so it looks distinct from normal messages + // Wrap in blockquote at top level — visually distinct (left border), + // never collapses like code blocks do, supports inline markdown var body = lines.join('\n'); if (depth === 0) { - body = '```\n' + body + '\n```'; + body = body.split('\n').map(function (l) { return '> ' + l; }).join('\n'); } return body; } @@ -120,6 +121,24 @@ function statusIcon(status) { } } +/** + * Format a status line with inline markdown. + * Tool calls get inline code formatting; thinking text stays plain. + * @param {string} line + * @returns {string} + */ +function formatStatusLine(line) { + // Tool call lines: "toolName: arguments [OK]" or "toolName: label" + var match = line.match(/^(\S+?): (.+?)( \[OK\]| \[ERR\])?$/); + if (match) { + var marker = match[3] || ''; + return '`' + match[1] + ':` ' + match[2] + marker; + } + // Thinking text — use a unicode marker to distinguish from tool calls + // Avoid markdown italic (*) since it breaks with special characters + return '\u2502 ' + line; +} + /** * Truncate a line to MAX_LINE_CHARS. * @param {string} line