claude-discover 1.10.13 → 1.10.14

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.
package/README.md CHANGED
@@ -38,7 +38,8 @@ claude-discover
38
38
 
39
39
  - **Session preview**
40
40
  - **Conversation view**\
41
- The full transcript rendered like a chat: your prompts, Claude's replies, and every tool call expanded. Everything the terminal scrolled past, now readable at human pace.
41
+ The full transcript rendered like a chat: your prompts, Claude's replies, and every tool call expanded. Everything the terminal scrolled past, now readable at human pace.\
42
+ The MCP servers each turn had, how many tools each offered, the calls to them (time and errors), and which failed (and why), needed a login or were still connecting - and for sessions run with `--debug`, which ones it started (stdio), connected to (http) or ran in-process (Agent SDK), how long each took, and a failed one's stderr.
42
43
 
43
44
  - **Raw logs**\
44
45
  The same session exactly as Claude Code stores it on disk, one JSON line at a time. For when you don't want the story, you want the evidence.
package/out/main/main.js CHANGED
@@ -453,6 +453,7 @@ var CLAUDE_DIR = local.claudeDir || process.env.CLAUDE_CONFIG_DIR || join(homedi
453
453
  var RECENT_CLAUDE_DIRS = local.recents || [CLAUDE_DIR];
454
454
  var CLAUDE_PROJECTS_DIR = join(CLAUDE_DIR, "projects");
455
455
  var CLAUDE_SETTINGS = join(CLAUDE_DIR, "settings.json");
456
+ var CLAUDE_DEBUG_DIR = join(CLAUDE_DIR, "debug");
456
457
  var STATUSLINE_PATH = join(import.meta.dirname, "../../bin/claude/statusline.mjs");
457
458
  var PROXY_PATH = join(import.meta.dirname, "../../bin/proxy.mjs");
458
459
  var LAUNCH_MODE = launchMode(import.meta.dirname, { dev: false });
@@ -1346,7 +1347,8 @@ var RequestParser = class {
1346
1347
  }));
1347
1348
  return this.deferredRoster = {
1348
1349
  ...toStrip(rec, "message", "Deferred Tools", label, fence(names)),
1349
- items
1350
+ items,
1351
+ count: names.length
1350
1352
  };
1351
1353
  }
1352
1354
  systemTools(rec) {
@@ -1366,7 +1368,8 @@ var RequestParser = class {
1366
1368
  const content = list.map((t) => [`## ${t.name}`, t.content].filter(Boolean).join("\n\n")).join("\n\n");
1367
1369
  return {
1368
1370
  ...toStrip(rec, "tools", file_path, plural(list.length, "tool"), content),
1369
- items: list
1371
+ items: list,
1372
+ count: list.length
1370
1373
  };
1371
1374
  };
1372
1375
  return [strip("System Tools", (n) => !isMcp(n)), strip("MCP Tools", isMcp)].filter(Boolean);
@@ -1493,6 +1496,297 @@ var TranscriptInstructions = class {
1493
1496
  }));
1494
1497
  }
1495
1498
  };
1499
+ // src/main/sessions/McpTools.js
1500
+ var server = (name) => /^mcp__(.+?)__/.exec(name)?.[1] ?? null;
1501
+ var toolOf = (key, name) => name.slice(`mcp__${key}__`.length);
1502
+ var toolPrefix = (name) => name.replace(/[^\w-]/g, "_");
1503
+ var connected = (s) => s.status === "connected";
1504
+ var serverRow = (fields) => ({
1505
+ transport: null,
1506
+ version: null,
1507
+ cached: false,
1508
+ ms: null,
1509
+ readyWithin: null,
1510
+ error: null,
1511
+ stderr: [],
1512
+ toolCount: null,
1513
+ groups: [],
1514
+ tools: [],
1515
+ ...fields
1516
+ });
1517
+ var mounted = (key, names) => {
1518
+ const groups = Object.entries(Object.groupBy(names, (n) => toolOf(key, n).split("_")[0])).map(([name, list]) => ({
1519
+ name,
1520
+ toolCount: list.length
1521
+ }));
1522
+ return groups.length >= 2 && groups.length ** 2 <= names.length ? groups.sort((a, b) => a.name.localeCompare(b.name)) : [];
1523
+ };
1524
+ var McpTools = class {
1525
+ #shapes = /* @__PURE__ */ new Map();
1526
+ #deferred = /* @__PURE__ */ new Set();
1527
+ #status = [];
1528
+ #names = /* @__PURE__ */ new Map();
1529
+ #requests = [];
1530
+ #calls = /* @__PURE__ */ new Map();
1531
+ feed(obj) {
1532
+ const att = obj.type === "attachment" ? obj.attachment : null;
1533
+ const content = Array.isArray(obj.message?.content) ? obj.message.content : [];
1534
+ if (obj.type === "api-request-shape") this.#shapes.set(obj.shapeHash, (obj.shape?.tools ?? []).map((t) => t.name).filter(server));
1535
+ else if (att?.type === "deferred_tools_delta") {
1536
+ for (const name of att.addedNames ?? []) if (server(name)) this.#deferred.add(name);
1537
+ for (const name of att.removedNames ?? []) this.#deferred.delete(name);
1538
+ this.#status = [
1539
+ ...(att.failedMcpServers ?? []).map((f) => this.#named(f.name, "failed", f.errorCode ? `${f.errorCode}: ${f.error}` : f.error ?? null)),
1540
+ ...(att.needsAuthMcpServers ?? []).map((name) => this.#named(name, "needs-auth")),
1541
+ ...(att.pendingMcpServers ?? []).map((name) => this.#named(name, "pending"))
1542
+ ];
1543
+ } else if (att?.type === "mcp_instructions_delta") for (const name of att.addedNames ?? []) this.#names.set(toolPrefix(name), name);
1544
+ else if (obj.type === "api-request") {
1545
+ const tools = Object.groupBy(/* @__PURE__ */ new Set([...this.#shapes.get(obj.shapeHash) ?? [], ...this.#deferred]), server);
1546
+ const servers = [...Object.entries(tools).map(([key, names]) => ({
1547
+ key,
1548
+ status: "connected",
1549
+ error: null,
1550
+ names
1551
+ })), ...this.#status.filter((s) => !tools[s.key])];
1552
+ this.#requests.push({
1553
+ ts: Date.parse(obj.timestamp),
1554
+ servers: servers.sort((a, b) => a.key.localeCompare(b.key)),
1555
+ fresh: !obj.base
1556
+ });
1557
+ } else if (obj.type === "assistant") for (const c of content) {
1558
+ const key = c.type === "tool_use" && server(c.name);
1559
+ if (key) this.#calls.set(c.id, {
1560
+ key,
1561
+ name: toolOf(key, c.name),
1562
+ ts: Date.parse(obj.timestamp),
1563
+ ms: null,
1564
+ error: null
1565
+ });
1566
+ }
1567
+ else if (obj.type === "user") for (const c of content) {
1568
+ const call = c.type === "tool_result" && this.#calls.get(c.tool_use_id);
1569
+ if (call) Object.assign(call, {
1570
+ ms: Date.parse(obj.timestamp) - call.ts,
1571
+ error: c.is_error ? texts(c.content).join("\n") || "failed" : null
1572
+ });
1573
+ }
1574
+ }
1575
+ #named(name, status, error = null) {
1576
+ this.#names.set(toolPrefix(name), name);
1577
+ return {
1578
+ key: toolPrefix(name),
1579
+ status,
1580
+ error
1581
+ };
1582
+ }
1583
+ processStarts() {
1584
+ return this.#requests.filter((r) => r.fresh).map((r) => r.ts);
1585
+ }
1586
+ turns(range = null) {
1587
+ const turns = [];
1588
+ const pending = /* @__PURE__ */ new Map();
1589
+ let last = [];
1590
+ for (const r of this.#requests) {
1591
+ if (!r.servers.length || !inRange(new Date(r.ts).toISOString(), range)) continue;
1592
+ if (r.fresh) {
1593
+ last = [];
1594
+ pending.clear();
1595
+ }
1596
+ if (last.some(connected) && !r.servers.some(connected)) continue;
1597
+ const before = new Map(last.map((s) => [s.key, s]));
1598
+ const changed = r.servers.filter((s) => before.get(s.key)?.status !== s.status || before.get(s.key).error !== s.error);
1599
+ const removed = last.filter((s) => !r.servers.some((n) => n.key === s.key));
1600
+ if (!changed.length && !removed.length) continue;
1601
+ const row = (s) => {
1602
+ const readyWithin = connected(s) && pending.has(s.key) ? r.ts - pending.get(s.key) : null;
1603
+ if (s.status === "pending") pending.set(s.key, r.ts);
1604
+ else pending.delete(s.key);
1605
+ return serverRow({
1606
+ name: this.#names.get(s.key) ?? s.key,
1607
+ status: s.status,
1608
+ readyWithin,
1609
+ error: s.error,
1610
+ toolCount: s.names?.length ?? null,
1611
+ groups: s.names ? mounted(s.key, s.names) : []
1612
+ });
1613
+ };
1614
+ turns.push({
1615
+ startedAt: new Date(r.ts).toISOString(),
1616
+ debug: false,
1617
+ change: last.length > 0,
1618
+ servers: [...changed.map(row), ...removed.map((s) => row({
1619
+ ...s,
1620
+ status: "removed",
1621
+ error: null,
1622
+ names: null
1623
+ }))]
1624
+ });
1625
+ last = r.servers;
1626
+ }
1627
+ for (const call of this.#calls.values()) {
1628
+ if (!inRange(new Date(call.ts).toISOString(), range)) continue;
1629
+ const owner = (s) => toolPrefix(s.name) === call.key && connected(s);
1630
+ turns.findLast((t) => Date.parse(t.startedAt) <= call.ts && t.servers.some(owner))?.servers.find(owner).tools.push({
1631
+ name: call.name,
1632
+ ms: call.ms,
1633
+ error: call.error
1634
+ });
1635
+ }
1636
+ return turns;
1637
+ }
1638
+ };
1639
+ // src/main/sessions/McpDebugLog.js
1640
+ var LINE = /^(\S+) \[\w+\] (.*)$/;
1641
+ var SERVER = /^MCP server "([^"]+)":? ([\s\S]*)$/;
1642
+ var PROCESS = /^mcp runtime arm\b/;
1643
+ var TIMESTAMP = /^\d{4}-\d\d-\d\dT/;
1644
+ var unquote = (text) => {
1645
+ if (!text.startsWith("\"")) return text;
1646
+ try {
1647
+ return JSON.parse(text);
1648
+ } catch {
1649
+ return text;
1650
+ }
1651
+ };
1652
+ var McpDebugLog = class {
1653
+ constructor(sessionId, { dir = CLAUDE_DEBUG_DIR } = {}) {
1654
+ this.filePath = join(dir, `${sessionId}.txt`);
1655
+ }
1656
+ exists() {
1657
+ return fsp.access(this.filePath).then(() => true, () => false);
1658
+ }
1659
+ async fillIn(turns, processStarts) {
1660
+ const text = await fsp.readFile(this.filePath, "utf8").catch(() => null);
1661
+ if (text === null) return null;
1662
+ fillTurns(turns, parseMcpLog(text), processStarts);
1663
+ return this.filePath;
1664
+ }
1665
+ };
1666
+ function fillTurns(turns, processes, starts) {
1667
+ const processOf = (turn) => starts.findLast((ts) => ts <= Date.parse(turn.startedAt));
1668
+ processes.forEach((p, i) => {
1669
+ const end = processes[i + 1] ? Date.parse(processes[i + 1].startedAt) : Infinity;
1670
+ const first = starts.find((ts) => ts >= Date.parse(p.startedAt) && ts < end);
1671
+ const own = first === void 0 ? [] : turns.filter((t) => processOf(t) === first);
1672
+ if (own.length) fillProcess(own, p.servers);
1673
+ });
1674
+ }
1675
+ function fillProcess(turns, logged) {
1676
+ const rows = turns.flatMap((t) => t.servers);
1677
+ for (const t of turns) t.debug = true;
1678
+ for (const log of logged) {
1679
+ const own = rows.filter((s) => toolPrefix(s.name) === toolPrefix(log.name));
1680
+ if (!own.length) {
1681
+ if (!turns[0].change) turns[0].servers.push(log);
1682
+ continue;
1683
+ }
1684
+ for (const row of own) {
1685
+ Object.assign(row, {
1686
+ name: log.name,
1687
+ transport: log.transport,
1688
+ version: log.version,
1689
+ cached: log.cached
1690
+ });
1691
+ if (row.status === log.status) Object.assign(row, {
1692
+ ms: log.ms,
1693
+ readyWithin: null,
1694
+ error: row.error ?? log.error,
1695
+ stderr: log.stderr
1696
+ });
1697
+ }
1698
+ const calls = own.flatMap((row) => row.tools);
1699
+ for (const call of log.tools) {
1700
+ const i = calls.findIndex((c) => c.name === call.name);
1701
+ if (i === -1) own.find((row) => row.status === "connected")?.tools.push({ ...call });
1702
+ else {
1703
+ const matched = calls.splice(i, 1)[0];
1704
+ Object.assign(matched, {
1705
+ ms: call.ms ?? matched.ms,
1706
+ error: call.error ?? matched.error
1707
+ });
1708
+ }
1709
+ }
1710
+ }
1711
+ for (const row of rows) if (row.status === "connected" && row.transport === null) row.transport = "sdk";
1712
+ }
1713
+ function parseMcpLog(text) {
1714
+ const processes = [];
1715
+ const open = (startedAt) => processes.push({
1716
+ startedAt,
1717
+ servers: []
1718
+ });
1719
+ const latest = /* @__PURE__ */ new Map();
1720
+ const transports = /* @__PURE__ */ new Map();
1721
+ let stderr = null;
1722
+ for (const line of text.split(/\r?\n/)) {
1723
+ if (stderr && line && !TIMESTAMP.test(line)) {
1724
+ stderr.push(line);
1725
+ continue;
1726
+ }
1727
+ stderr = null;
1728
+ const l = LINE.exec(line);
1729
+ if (!l) continue;
1730
+ const [, timestamp, text] = l;
1731
+ if (PROCESS.test(text)) {
1732
+ open(timestamp);
1733
+ continue;
1734
+ }
1735
+ const m = SERVER.exec(unquote(text));
1736
+ if (!m) continue;
1737
+ const [, name, msg] = m;
1738
+ let r;
1739
+ if (msg.startsWith("Starting connection")) {
1740
+ if (!processes.length || processes.at(-1).servers.some((s) => s.name === name)) open(timestamp);
1741
+ const conn = serverRow({
1742
+ name,
1743
+ transport: transports.get(name) ?? null,
1744
+ status: "connecting"
1745
+ });
1746
+ transports.delete(name);
1747
+ processes.at(-1).servers.push(conn);
1748
+ latest.set(name, conn);
1749
+ continue;
1750
+ }
1751
+ if (r = /^Initializing (\w+) transport/.exec(msg)) {
1752
+ transports.set(name, r[1].toLowerCase());
1753
+ continue;
1754
+ }
1755
+ const conn = latest.get(name);
1756
+ if (!conn) continue;
1757
+ if (r = /^Successfully connected \(transport: ([\w-]+)\) in (\d+)ms/.exec(msg)) Object.assign(conn, {
1758
+ status: "connected",
1759
+ transport: r[1],
1760
+ ms: +r[2]
1761
+ });
1762
+ else if (r = /^Connection established with capabilities: .*"serverVersion":\{.*?"version":"([^"]*?)(\+cached)?"/.exec(msg)) Object.assign(conn, {
1763
+ version: r[1],
1764
+ cached: !!r[2]
1765
+ });
1766
+ else if (r = /^Connection failed after (\d+)ms[^(:]*(?:\(([^)]+)\))?:?\s*(.*)/.exec(msg)) Object.assign(conn, {
1767
+ status: "failed",
1768
+ ms: +r[1],
1769
+ error: [r[2], r[3]].filter(Boolean).join(": ")
1770
+ });
1771
+ else if (r = /^Server stderr: (.*)/.exec(msg)) {
1772
+ conn.transport ??= "stdio";
1773
+ conn.stderr.push(r[1]);
1774
+ stderr = conn.stderr;
1775
+ } else if (r = /^Calling MCP tool: (.+)/.exec(msg)) conn.tools.push({
1776
+ name: r[1],
1777
+ ms: null,
1778
+ error: null
1779
+ });
1780
+ else if (r = /^Tool '(.+)' (?:completed successfully in|failed after) ([\d.]+)(ms|s)(?:: ([\s\S]*))?/.exec(msg)) {
1781
+ const call = conn.tools.find((t) => t.name === r[1] && t.ms === null);
1782
+ if (call) Object.assign(call, {
1783
+ ms: r[3] === "s" ? Math.round(r[2] * 1e3) : +r[2],
1784
+ error: msg.includes(" failed ") ? r[4] ?? "failed" : null
1785
+ });
1786
+ }
1787
+ }
1788
+ return processes;
1789
+ }
1496
1790
  // src/main/sessions/SessionParser.js
1497
1791
  var ACTIVITY_GAP_MS = 3e5;
1498
1792
  var TOKEN_FIELDS = [
@@ -2512,6 +2806,8 @@ function intersectsDay(meta, day) {
2512
2806
  function stripInternal({ seenMessageIds, ...meta }) {
2513
2807
  return meta;
2514
2808
  }
2809
+ var isSafeId = (id) => /^[\w-]+$/.test(id);
2810
+ var debugLogOf = (reader) => reader.parentSessionId || !isSafeId(reader.sessionId) ? null : new McpDebugLog(reader.sessionId);
2515
2811
  var SessionsService = class extends EventEmitter {
2516
2812
  #branch = null;
2517
2813
  constructor({ root, throttleMs = 100, scanner = null } = {}) {
@@ -2545,9 +2841,11 @@ var SessionsService = class extends EventEmitter {
2545
2841
  const source = await this.#branchSource(meta);
2546
2842
  const items = [];
2547
2843
  const transcript = new TranscriptInstructions();
2844
+ const mcpTools = new McpTools();
2548
2845
  const loop = [];
2549
2846
  let start = null;
2550
2847
  const feed = (obj, shown) => {
2848
+ mcpTools.feed(obj);
2551
2849
  const strips = transcript.feed(obj);
2552
2850
  if (obj.type === "api-request") start ??= strips;
2553
2851
  if (shown) loop.push(...strips);
@@ -2568,14 +2866,18 @@ var SessionsService = class extends EventEmitter {
2568
2866
  delete o._ts;
2569
2867
  if (o.type === "attachment" && TranscriptInstructions.listed(o, keys)) o._listed = true;
2570
2868
  }
2869
+ const mcp = mcpTools.turns(range);
2870
+ const debugLog = await debugLogOf(reader)?.fillIn(mcp, mcpTools.processStarts()) ?? null;
2571
2871
  return {
2572
2872
  items,
2573
2873
  instructions: {
2574
2874
  loop,
2575
2875
  side,
2576
- compacts
2876
+ compacts,
2877
+ mcp
2577
2878
  },
2578
- requestLog: await requests.exists() ? requests.filePath : null
2879
+ requestLog: await requests.exists() ? requests.filePath : null,
2880
+ debugLog
2579
2881
  };
2580
2882
  }
2581
2883
  #branchSource({ filePath, forkedFrom, forkedAt }) {
@@ -2607,7 +2909,7 @@ var SessionsService = class extends EventEmitter {
2607
2909
  }
2608
2910
  async readRequests(filePath, date = null, granularity = "day") {
2609
2911
  const meta = this.metaCache.get(filePath);
2610
- if (!meta || !/^[\w-]+$/.test(meta.sessionId)) return [];
2912
+ if (!meta || !isSafeId(meta.sessionId)) return [];
2611
2913
  const range = date ? periodBounds(date, granularity) : null;
2612
2914
  const own = await this.#requestFile(meta.sessionId, meta.parentSessionId).read(range);
2613
2915
  const span = {
@@ -2698,14 +3000,18 @@ var SessionsService = class extends EventEmitter {
2698
3000
  });
2699
3001
  await reader.stream((obj) => parser.feed(obj));
2700
3002
  const meta = parser.finalize(stat.mtimeMs);
2701
- const [project, avatar, agent] = await Promise.all([
3003
+ const [project, avatar, agent, debug = false] = await Promise.all([
2702
3004
  this.projects.resolve(meta.project),
2703
3005
  this.projects.avatar(meta.project),
2704
- reader.agentMeta()
3006
+ reader.agentMeta(),
3007
+ debugLogOf(reader)?.exists()
2705
3008
  ]);
2706
3009
  meta.agentName ??= agent?.name ?? agent?.agentType ?? null;
2707
3010
  meta.agentDescription = agent?.description ?? null;
2708
- return Object.assign(meta, project, { avatar });
3011
+ return Object.assign(meta, project, {
3012
+ avatar,
3013
+ debug
3014
+ });
2709
3015
  }
2710
3016
  async _dedupSessions(metas, range) {
2711
3017
  const sorted = [...metas].sort((a, b) => a.startedAt - b.startedAt);
@@ -13777,7 +14083,7 @@ var MainWindow = class {
13777
14083
  // src/main/updater.js
13778
14084
  var updater = new NpmUpdater({
13779
14085
  name: "claude-discover",
13780
- version: "1.10.13",
14086
+ version: "1.10.14",
13781
14087
  bin: { "claude-discover": "bin/claude-discover.mjs" }
13782
14088
  }, { dev: false });
13783
14089
  // src/main/Application.js
@@ -880,6 +880,13 @@
880
880
  & > span { background: none; } /* `span` outranks the global .warn-badge/.danger-badge, which load later */
881
881
  }
882
882
 
883
+ /* the MCP blocks' color: the debug log fills them in */
884
+ .debug-badge {
885
+ display: inline-flex; align-items: center; justify-content: center;
886
+ width: 18px; height: 18px;
887
+ color: var(--mcp);
888
+ }
889
+
883
890
  /* 18px line height keeps it on the label's line */
884
891
  .session-row-time {
885
892
  grid-area: time;
@@ -1009,33 +1016,6 @@
1009
1016
  text-overflow: ellipsis;
1010
1017
  white-space: nowrap;
1011
1018
  }
1012
- .divider {
1013
- display: flex;
1014
- align-items: center;
1015
- gap: 12px;
1016
- width: 100%;
1017
- padding: 0;
1018
- border: 0;
1019
- background: none;
1020
- color: var(--text-faint);
1021
- font: inherit;
1022
- white-space: nowrap;
1023
-
1024
- /* Wavy rules (~~~ label ~~~): a repeating sine stroke masked over the text color */
1025
- &::before, &::after {
1026
- content: '';
1027
- flex: 1;
1028
- height: 8px;
1029
- background: currentColor;
1030
- opacity: 0.6;
1031
- mask: url("./wave-D-wH63sc.svg") repeat-x center / 20px 8px;
1032
- }
1033
- }
1034
-
1035
- button.divider {
1036
- cursor: pointer;
1037
- &:hover { color: var(--text-dim); }
1038
- }
1039
1019
  .markdown { white-space: normal; max-height: 500px; overflow: auto; }
1040
1020
  .markdown > *:first-child { margin-top: 0; }
1041
1021
  .markdown > *:last-child { margin-bottom: 0; }
@@ -1094,6 +1074,100 @@ button.divider {
1094
1074
  }
1095
1075
  .markdown th { background: var(--bg-elev-2); }
1096
1076
  .markdown hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
1077
+ .mcp-block { margin-bottom: 6px; }
1078
+ .mcp-block > .aux-toggle { display: flex; width: 100%; }
1079
+ .mcp-block .aux-toggle { color: #b9b9b9; }
1080
+ .mcp-block > .aux-body { border-left-color: var(--mcp); padding-right: 0; } /* the tokens column ends level with the rows' right edge */
1081
+ .mcp-title { color: var(--mcp); }
1082
+
1083
+ .mcp-servers {
1084
+ width: 100%;
1085
+ border-collapse: separate; /* collapsed cells can't round the hover's corners */
1086
+ border-spacing: 0;
1087
+ font-size: calc(11px * var(--font-scale, 1));
1088
+ font-variant-numeric: tabular-nums;
1089
+ color: #b9b9b9;
1090
+
1091
+ & .aux-body { color: var(--text); }
1092
+
1093
+ /* its own rows only: a server's instructions can hold markdown tables */
1094
+ & > tbody > tr > td {
1095
+ padding: 0 0 0 20px;
1096
+ text-align: left;
1097
+ white-space: nowrap;
1098
+ }
1099
+ & > tbody > tr > td:first-child { padding-left: 0; }
1100
+
1101
+ & .mcp-col-transport { width: 9.5em; } /* fits claudeai-proxy */
1102
+ & .mcp-col-time { width: 6em; }
1103
+ & .mcp-col-status { width: 8em; } /* fits needs auth */
1104
+ & .mcp-col-tokens { width: 6em; }
1105
+ & .mcp-tokens { text-align: right; }
1106
+ & .mcp-foldable { cursor: pointer; }
1107
+ & .mcp-foldable:hover > td {
1108
+ background: var(--bg-elev-2);
1109
+ &:first-child { border-radius: 3px 0 0 3px; }
1110
+ &:last-child { border-radius: 0 3px 3px 0; }
1111
+ }
1112
+ & .mcp-chevron { padding: 0; margin-right: 4px; border: none; background: none; color: inherit; font: inherit; cursor: inherit; &.none { visibility: hidden; } }
1113
+
1114
+ & > tbody > tr > td.mcp-tool { padding-left: 14px; white-space: normal; overflow-wrap: anywhere; } /* a long tool error wraps, not widens the table */
1115
+ & .mcp-version { margin-left: 8px; color: var(--text-dim); }
1116
+ & .mcp-cached { margin-right: 4px; color: var(--text-dim); & svg { width: 1em; height: 1em; vertical-align: -0.1em; } }
1117
+ & .mcp-ms { text-align: right; }
1118
+ & .mcp-dim { color: var(--text-dim); }
1119
+ & .mcp-tool-error { color: var(--danger); }
1120
+
1121
+ & .mcp-status {
1122
+ &.connecting, &.pending, &.removed { color: var(--text-dim); }
1123
+ &.needs-auth { color: var(--warn); }
1124
+ &.failed { color: var(--danger); font-weight: bold; }
1125
+ }
1126
+ }
1127
+
1128
+ .mcp-error {
1129
+ --tone: var(--danger);
1130
+ margin: 2px 0 6px 14px;
1131
+ padding: 6px 10px;
1132
+ max-height: 160px;
1133
+ overflow: auto;
1134
+ white-space: pre-wrap;
1135
+ word-break: break-all;
1136
+ background: color-mix(in srgb, var(--tone) 8%, transparent);
1137
+ border-left: 2px solid var(--tone);
1138
+ color: var(--tone);
1139
+ font-size: calc(10.5px * var(--font-scale, 1));
1140
+ }
1141
+
1142
+ /* a stdio server's stderr is where it logs anything, so only a failed one's reads as an error */
1143
+ .mcp-error:not(.failed) { --tone: var(--text-dim); }
1144
+ .divider {
1145
+ display: flex;
1146
+ align-items: center;
1147
+ gap: 12px;
1148
+ width: 100%;
1149
+ padding: 0;
1150
+ border: 0;
1151
+ background: none;
1152
+ color: var(--text-faint);
1153
+ font: inherit;
1154
+ white-space: nowrap;
1155
+
1156
+ /* Wavy rules (~~~ label ~~~): a repeating sine stroke masked over the text color */
1157
+ &::before, &::after {
1158
+ content: '';
1159
+ flex: 1;
1160
+ height: 8px;
1161
+ background: currentColor;
1162
+ opacity: 0.6;
1163
+ mask: url("./wave-D-wH63sc.svg") repeat-x center / 20px 8px;
1164
+ }
1165
+ }
1166
+
1167
+ button.divider {
1168
+ cursor: pointer;
1169
+ &:hover { color: var(--text-dim); }
1170
+ }
1097
1171
  .conversation {
1098
1172
  display: flex;
1099
1173
  flex-direction: column;
@@ -1323,7 +1397,7 @@ button.msg-summary:hover { color: var(--text); background: var(--bg-elev-2); bor
1323
1397
 
1324
1398
  .turn-system {
1325
1399
  & .turn-blocks > .aux { align-self: flex-start; }
1326
- & .turn-blocks > :is(.instruction-file, .instruction-total, .aux:has(> .aux-toggle > .instruction-tokens)) { align-self: stretch; } /* full width, so its token count lines up right */
1400
+ & .turn-blocks > :is(.instruction-file, .instruction-total, .mcp-block, .aux:has(> .aux-toggle > .instruction-tokens)) { align-self: stretch; } /* full width, so its token count lines up right */
1327
1401
  & .turn-blocks > .block-text {
1328
1402
  border: 1px dashed var(--border);
1329
1403
  border-radius: 6px;
@@ -1493,17 +1567,22 @@ button.msg-summary:hover { color: var(--text); background: var(--bg-elev-2); bor
1493
1567
  }
1494
1568
  /* The loop's own system prompt and tools sit in a System row, among its directives */
1495
1569
  .instruction-file.directive { border-left: none; padding-left: 0; margin-left: 0; }
1496
- .instruction-file.directive .aux-toggle, .instruction-file.directive pre, .listed .aux-toggle { color: #b9b9b9 }
1570
+ .instruction-file.directive :is(.aux-toggle, .aux-label), .instruction-file.directive pre, .listed .aux-toggle { color: #b9b9b9 }
1497
1571
  /* Context listed above the prompt: the user's @-files and a command's skill body */
1498
1572
  .listed { margin-bottom: 6px; }
1499
- .msg-context > .listed { margin-bottom: 0; }
1573
+ .msg-context > :is(.listed, .mcp-block) { margin-bottom: 0; }
1574
+ /* A group's rows line up with its count */
1575
+ :is(.system-group, .mcp-block) > .aux-body { padding-top: 0; }
1576
+ .system-group > .aux-body > .aux { margin-right: -8px; }
1577
+ /* A row's count sums the rows inside it, so it gives way to theirs once open */
1578
+ .aux:has(> .aux-body > :is(.aux, .mcp-servers)) > .aux-toggle > .instruction-tokens { display: none; }
1579
+ /* The group's bar is the only coloured one: what opens inside it gets a thin gray line */
1580
+ :is(.system-group, .mcp-block) > .aux-body .aux-body { border-left: 1px solid var(--border); }
1500
1581
 
1501
1582
  /* Full-width toggle so the estimated token count can sit right-aligned, like msg-header-right. */
1502
1583
  /* Nested tool rows cancel the aux-body's right padding so their counts line up with the strips'. */
1503
1584
  .instruction-file .instruction-file { border-left: none; padding-left: 0; margin-left: 0; margin-right: -8px; }
1504
- /* A rule under the strip's count marks it as the sum of the tool counts below. */
1505
1585
  .aux-body:has(> .instruction-file:first-child) { padding-top: 0; }
1506
- .aux-body > .instruction-file:first-child > .aux-toggle .instruction-tokens { border-top: 1px solid var(--border); }
1507
1586
  .instruction-file .aux-toggle, .aux-toggle:has(> .instruction-tokens, > .aux-duration) { display: flex; width: 100%; align-items: center; }
1508
1587
  .instruction-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1509
1588
  .instruction-tokens { margin-left: auto; color: var(--text-faint); white-space: nowrap; }
@@ -2707,6 +2786,7 @@ button.msg-summary:hover { color: var(--text); background: var(--bg-elev-2); bor
2707
2786
  --text-dim: #69717d;
2708
2787
  --text-faint: #6b7280;
2709
2788
  --accent: #60a5fa;
2789
+ --mcp: #4fb3a1;
2710
2790
  --selected: #1e2a3d;
2711
2791
  --ok: #69717d;
2712
2792
  --warn: #fbbf24;