@@ -212,6 +212,28 @@ export function renderToolResultInline(
212212 return;
213213 }
214214
215+ if (toolName === "webSearch") {
216+ const r = result as { results?: unknown[] };
217+ if (Array.isArray(r.results)) {
218+ const n = r.results.length;
219+ writeln(
220+ `${indent}${G.info} ${c.dim(n === 0 ? "no results" : `${n} result${n === 1 ? "" : "s"}`)}`,
221+ );
222+ return;
223+ }
224+ }
225+
226+ if (toolName === "webContent") {
227+ const r = result as { results?: unknown[] };
228+ if (Array.isArray(r.results)) {
229+ const n = r.results.length;
230+ writeln(
231+ `${indent}${G.info} ${c.dim(n === 0 ? "no pages" : `${n} page${n === 1 ? "" : "s"}`)}`,
232+ );
233+ return;
234+ }
235+ }
236+
215237 if (toolName.startsWith("mcp_")) {
216238 const content = Array.isArray(result) ? result : [result];
217239 const first = (content as Array<{ type?: string; text?: string }>)[0];
@@ -394,6 +416,68 @@ export function renderToolResult(
394416 return;
395417 }
396418
419+ if (toolName === "webSearch") {
420+ const r = result as {
421+ results?: Array<{ title?: string; url?: string; score?: number }>;
422+ };
423+ if (Array.isArray(r?.results)) {
424+ if (r.results.length === 0) {
425+ writeln(` ${G.info} ${c.dim("no results")}`);
426+ return;
427+ }
428+
429+ for (const item of r.results.slice(0, 5)) {
430+ const title = (item.title?.trim() || item.url || "(untitled)").replace(
431+ /\s+/g,
432+ " ",
433+ );
434+ const score =
435+ typeof item.score === "number"
436+ ? c.dim(` (${item.score.toFixed(2)})`)
437+ : "";
438+ writeln(` ${c.dim("•")} ${title}${score}`);
439+ if (item.url) writeln(` ${c.dim(item.url)}`);
440+ }
441+
442+ if (r.results.length > 5) {
443+ writeln(` ${c.dim(` +${r.results.length - 5} more`)}`);
444+ }
445+ return;
446+ }
447+ }
448+
449+ if (toolName === "webContent") {
450+ const r = result as {
451+ results?: Array<{ url?: string; title?: string; text?: string }>;
452+ };
453+ if (Array.isArray(r?.results)) {
454+ if (r.results.length === 0) {
455+ writeln(` ${G.info} ${c.dim("no pages")}`);
456+ return;
457+ }
458+
459+ for (const item of r.results.slice(0, 3)) {
460+ const title = (item.title?.trim() || item.url || "(untitled)").replace(
461+ /\s+/g,
462+ " ",
463+ );
464+ writeln(` ${c.dim("•")} ${title}`);
465+ if (item.url) writeln(` ${c.dim(item.url)}`);
466+ const preview = (item.text ?? "").replace(/\s+/g, " ").trim();
467+ if (preview) {
468+ const trimmed =
469+ preview.length > 220 ? `${preview.slice(0, 217)}…` : preview;
470+ writeln(` ${c.dim(trimmed)}`);
471+ }
472+ }
473+
474+ if (r.results.length > 3) {
475+ writeln(` ${c.dim(` +${r.results.length - 3} more`)}`);
476+ }
477+ return;
478+ }
479+ }
480+
397481 // MCP tools — show content blocks
398482 if (toolName.startsWith("mcp_")) {
399483 const content = Array.isArray(result) ? result : [result];