@tutti-os/agent-gui 0.0.102 → 0.0.104

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 (52) hide show
  1. package/dist/{AgentGUI-BJ3As1gI.d.ts → AgentGUI-DQ9gVoXh.d.ts} +2 -3
  2. package/dist/agent-conversation/index.d.ts +3 -3
  3. package/dist/agent-conversation/index.js +7 -7
  4. package/dist/agent-gui.d.ts +3 -3
  5. package/dist/agent-gui.js +14 -14
  6. package/dist/agent-message-center/index.d.ts +2 -2
  7. package/dist/agent-message-center/index.js +7 -6
  8. package/dist/agent-message-center/index.js.map +1 -1
  9. package/dist/{agentConversationVM-BzHZhwFP.d.ts → agentConversationVM-CkcYM5Wg.d.ts} +3 -1
  10. package/dist/{agentGuiNodeTypes-BH3lz6gn.d.ts → agentGuiNodeTypes-B9vcvjmR.d.ts} +2 -2
  11. package/dist/app/renderer/agentactivity.css +11 -0
  12. package/dist/{chunk-YYE35EZ5.js → chunk-747L443E.js} +6 -6
  13. package/dist/chunk-747L443E.js.map +1 -0
  14. package/dist/{chunk-LHKBR77G.js → chunk-7N524ZK7.js} +903 -542
  15. package/dist/chunk-7N524ZK7.js.map +1 -0
  16. package/dist/{chunk-KAV2WHTG.js → chunk-AKKDP2LI.js} +2 -2
  17. package/dist/{chunk-E5AD46HP.js → chunk-F5LFPORI.js} +2 -2
  18. package/dist/{chunk-TDVYZEUI.js → chunk-FJ4W2VC5.js} +126 -30
  19. package/dist/chunk-FJ4W2VC5.js.map +1 -0
  20. package/dist/{chunk-ZPKPIHMZ.js → chunk-HLVC4NNL.js} +497 -980
  21. package/dist/chunk-HLVC4NNL.js.map +1 -0
  22. package/dist/{chunk-DWUVRWXD.js → chunk-MUPZPISC.js} +2 -2
  23. package/dist/{chunk-GCW57WYQ.js → chunk-NOXQOGT5.js} +3 -3
  24. package/dist/{chunk-UESYITH6.js → chunk-OFSDOID4.js} +2 -2
  25. package/dist/{chunk-D7HMQLBO.js → chunk-QI3JAO4J.js} +2 -2
  26. package/dist/{chunk-4E3QCW6L.js → chunk-SKCLZXSW.js} +3 -5
  27. package/dist/chunk-SKCLZXSW.js.map +1 -0
  28. package/dist/{chunk-MJOQP2ED.js → chunk-TPV2SV6L.js} +3 -3
  29. package/dist/{chunk-W4RYNKWO.js → chunk-VAB7EIL5.js} +11 -7
  30. package/dist/{chunk-W4RYNKWO.js.map → chunk-VAB7EIL5.js.map} +1 -1
  31. package/dist/context-mention-palette/index.js +8 -8
  32. package/dist/i18n/index.d.ts +2 -4
  33. package/dist/i18n/index.js +2 -2
  34. package/dist/index.d.ts +5 -5
  35. package/dist/index.js +14 -14
  36. package/dist/mention-search.js +6 -6
  37. package/dist/workbench/contribution.js +3 -3
  38. package/dist/workbench/index.js +3 -3
  39. package/dist/workbench/sessionTitle.js +2 -2
  40. package/package.json +12 -12
  41. package/dist/chunk-4E3QCW6L.js.map +0 -1
  42. package/dist/chunk-LHKBR77G.js.map +0 -1
  43. package/dist/chunk-TDVYZEUI.js.map +0 -1
  44. package/dist/chunk-YYE35EZ5.js.map +0 -1
  45. package/dist/chunk-ZPKPIHMZ.js.map +0 -1
  46. /package/dist/{chunk-KAV2WHTG.js.map → chunk-AKKDP2LI.js.map} +0 -0
  47. /package/dist/{chunk-E5AD46HP.js.map → chunk-F5LFPORI.js.map} +0 -0
  48. /package/dist/{chunk-DWUVRWXD.js.map → chunk-MUPZPISC.js.map} +0 -0
  49. /package/dist/{chunk-GCW57WYQ.js.map → chunk-NOXQOGT5.js.map} +0 -0
  50. /package/dist/{chunk-UESYITH6.js.map → chunk-OFSDOID4.js.map} +0 -0
  51. /package/dist/{chunk-D7HMQLBO.js.map → chunk-QI3JAO4J.js.map} +0 -0
  52. /package/dist/{chunk-MJOQP2ED.js.map → chunk-TPV2SV6L.js.map} +0 -0
@@ -16,12 +16,7 @@ import {
16
16
  isWorkspaceAgentSyntheticControlMessage,
17
17
  mentionItemToAttrs,
18
18
  parseAgentMentionMarkdown
19
- } from "./chunk-GCW57WYQ.js";
20
- import {
21
- fileChangeCountFromChanges,
22
- fileChangeEntriesFromChanges,
23
- fileChangeTypeValue
24
- } from "./chunk-F5UR6EJG.js";
19
+ } from "./chunk-NOXQOGT5.js";
25
20
  import {
26
21
  AgentGUIConversation_styles_default,
27
22
  AgentMessageMarkdown,
@@ -39,19 +34,24 @@ import {
39
34
  resolveWorkspaceFilePathCandidate,
40
35
  resolveWorkspaceLinkAction,
41
36
  useAgentTargetPresentations
42
- } from "./chunk-MJOQP2ED.js";
37
+ } from "./chunk-TPV2SV6L.js";
43
38
  import {
44
39
  useOptionalAgentActivityRuntime,
45
40
  useOptionalAgentHostApi,
46
41
  workspaceAgentProviderLabel
47
- } from "./chunk-UESYITH6.js";
42
+ } from "./chunk-OFSDOID4.js";
43
+ import {
44
+ fileChangeCountFromChanges,
45
+ fileChangeEntriesFromChanges,
46
+ fileChangeTypeValue
47
+ } from "./chunk-F5UR6EJG.js";
48
48
  import {
49
49
  normalizeAgentTitleText
50
50
  } from "./chunk-MIJXEELH.js";
51
51
  import {
52
52
  getActiveUiLanguage,
53
53
  translate
54
- } from "./chunk-E5AD46HP.js";
54
+ } from "./chunk-F5LFPORI.js";
55
55
 
56
56
  // shared/imageGenerationTool.ts
57
57
  var KNOWN_IMAGE_GENERATION_TOOL_NAMES = /* @__PURE__ */ new Set([
@@ -1500,511 +1500,6 @@ function normalizeStatusToken(value) {
1500
1500
  return (value ?? "").trim().toLowerCase().replace(/[\s-]+/g, "_");
1501
1501
  }
1502
1502
 
1503
- // shared/agentConversation/projection/subAgentTimelinePartition.ts
1504
- function timelineItemOwnerThreadId(item) {
1505
- return trimmedPayloadString(item.payload?.ownerThreadId);
1506
- }
1507
- function timelineItemOwnerCallId(item) {
1508
- return trimmedPayloadString(item.payload?.ownerCallId);
1509
- }
1510
- function trimmedPayloadString(value) {
1511
- if (typeof value !== "string") {
1512
- return null;
1513
- }
1514
- const trimmed = value.trim();
1515
- return trimmed.length > 0 ? trimmed : null;
1516
- }
1517
- function partitionSubAgentTimelineItems(timelineItems) {
1518
- const subAgentItemsByOwner = /* @__PURE__ */ new Map();
1519
- let mainTimelineItems = null;
1520
- for (let index = 0; index < timelineItems.length; index += 1) {
1521
- const item = timelineItems[index];
1522
- if (!item) {
1523
- continue;
1524
- }
1525
- const ownerThreadId = timelineItemOwnerThreadId(item);
1526
- if (!ownerThreadId) {
1527
- mainTimelineItems?.push(item);
1528
- continue;
1529
- }
1530
- if (!mainTimelineItems) {
1531
- mainTimelineItems = timelineItems.slice(0, index);
1532
- }
1533
- const ownerItems = subAgentItemsByOwner.get(ownerThreadId) ?? [];
1534
- ownerItems.push(item);
1535
- subAgentItemsByOwner.set(ownerThreadId, ownerItems);
1536
- }
1537
- return {
1538
- mainTimelineItems: mainTimelineItems ?? timelineItems,
1539
- subAgentItemsByOwner
1540
- };
1541
- }
1542
- function buildSubAgentLanesByCallId(partition) {
1543
- const lanesByCallId = /* @__PURE__ */ new Map();
1544
- const cards = collectCollabCards(partition.mainTimelineItems);
1545
- if (cards.length === 0) {
1546
- return lanesByCallId;
1547
- }
1548
- const cardsByCallId = new Map(cards.map((card) => [card.callId, card]));
1549
- const lanedOwners = /* @__PURE__ */ new Set();
1550
- for (const [ownerThreadId, items] of partition.subAgentItemsByOwner) {
1551
- const sortedItems = [...items].sort(compareTimelineItemsAscending);
1552
- const ownerCallId = firstOwnerCallId(sortedItems);
1553
- if (!ownerCallId) {
1554
- continue;
1555
- }
1556
- const card = cardsByCallId.get(ownerCallId);
1557
- if (!card || isControlAgentToken(card.agentName)) {
1558
- continue;
1559
- }
1560
- lanedOwners.add(ownerThreadId);
1561
- const lanes = lanesByCallId.get(card.callId) ?? [];
1562
- lanes.push(subAgentLane(ownerThreadId, sortedItems, card));
1563
- lanesByCallId.set(card.callId, lanes);
1564
- }
1565
- for (const card of cards) {
1566
- if (!isSpawnAgentToken(card.agentName)) {
1567
- continue;
1568
- }
1569
- for (const receiverThreadId of card.receiverThreadIds) {
1570
- if (lanedOwners.has(receiverThreadId)) {
1571
- continue;
1572
- }
1573
- lanedOwners.add(receiverThreadId);
1574
- const lanes = lanesByCallId.get(card.callId) ?? [];
1575
- lanes.push(subAgentLane(receiverThreadId, [], card));
1576
- lanesByCallId.set(card.callId, lanes);
1577
- }
1578
- if (!lanesByCallId.has(card.callId)) {
1579
- lanesByCallId.set(card.callId, [
1580
- {
1581
- ...subAgentLane(`spawn-pending:${card.callId}`, [], card),
1582
- status: card.callStatus,
1583
- // No child thread exists yet: codex caps concurrent sub-agents
1584
- // (4/session by default) and queues further spawns.
1585
- queued: card.callStatus === "running"
1586
- }
1587
- ]);
1588
- }
1589
- }
1590
- for (const lanes of lanesByCallId.values()) {
1591
- lanes.sort(
1592
- (left, right) => (left.startedAtUnixMs ?? 0) - (right.startedAtUnixMs ?? 0) || left.ownerThreadId.localeCompare(right.ownerThreadId)
1593
- );
1594
- for (let index = 0; index < lanes.length; index += 1) {
1595
- const lane = lanes[index];
1596
- if (!lane) {
1597
- continue;
1598
- }
1599
- lanes[index] = {
1600
- ...lane,
1601
- laneIndex: index + 1,
1602
- laneCount: lanes.length
1603
- };
1604
- }
1605
- }
1606
- return lanesByCallId;
1607
- }
1608
- function attachSubAgentLanesToConversationVM(conversation, lanesByCallId) {
1609
- if (!conversation || lanesByCallId.size === 0) {
1610
- return conversation;
1611
- }
1612
- let changed = false;
1613
- const rows = conversation.rows.map((row) => {
1614
- if (row.kind !== "tool-group") {
1615
- return row;
1616
- }
1617
- const nextRow = toolGroupRowWithSubAgents(row, lanesByCallId);
1618
- if (nextRow !== row) {
1619
- changed = true;
1620
- }
1621
- return nextRow;
1622
- });
1623
- return changed ? { ...conversation, rows } : conversation;
1624
- }
1625
- function toolGroupRowWithSubAgents(row, lanesByCallId) {
1626
- let changed = false;
1627
- const callsById = /* @__PURE__ */ new Map();
1628
- const calls = row.calls.map((call) => {
1629
- const lanes = call.task ? lanesByCallId.get(toolCallRawId(call.id)) : null;
1630
- if (!lanes || lanes.length === 0 || !call.task) {
1631
- return call;
1632
- }
1633
- changed = true;
1634
- const nextCall = {
1635
- ...call,
1636
- task: { ...call.task, subAgents: lanes }
1637
- };
1638
- callsById.set(nextCall.id, nextCall);
1639
- return nextCall;
1640
- });
1641
- if (!changed) {
1642
- return row;
1643
- }
1644
- const entries = row.entries.map((entry) => {
1645
- if (entry.kind !== "tool-call") {
1646
- return entry;
1647
- }
1648
- const nextCall = callsById.get(entry.call.id);
1649
- return nextCall ? { ...entry, call: nextCall } : entry;
1650
- });
1651
- return { ...row, calls, entries };
1652
- }
1653
- function toolCallRawId(id) {
1654
- return id.startsWith("call:") ? id.slice("call:".length) : id;
1655
- }
1656
- var SUB_AGENT_ACTIVITY_LOG_CAP = 20;
1657
- function subAgentLane(ownerThreadId, sortedItems, card) {
1658
- const activity = subAgentActivityLog(sortedItems);
1659
- const latest = activity.entries[activity.entries.length - 1] ?? null;
1660
- const terminal = latestTerminalMarker(sortedItems);
1661
- const lastItem = sortedItems[sortedItems.length - 1];
1662
- const status = terminal?.status ?? card.childStatuses.get(ownerThreadId) ?? "running";
1663
- const terminalAtUnixMs = terminal?.occurredAtUnixMs ?? null;
1664
- return {
1665
- ownerThreadId,
1666
- status,
1667
- // Identity precedence: the child thread's own name (subAgentName marker,
1668
- // rare in practice) > a short name derived from the task's opening
1669
- // self-address ("你是 X。…" / "You are X. …") > the view's localized
1670
- // numbered fallback. Never the collab tool name.
1671
- name: latestNameMarker(sortedItems) ?? deriveSubAgentNameFromTask(card.task),
1672
- task: card.task,
1673
- laneIndex: 1,
1674
- laneCount: 1,
1675
- latestActivity: latest?.text ?? null,
1676
- latestActivityKind: latest?.kind ?? null,
1677
- activityLog: activity.entries,
1678
- activityOmittedCount: activity.omittedCount,
1679
- failureDetail: terminal?.detail ?? null,
1680
- startedAtUnixMs: timelineItemTime(sortedItems[0]) || card.startedAtUnixMs || null,
1681
- latestActivityAtUnixMs: terminalAtUnixMs ?? (lastItem ? timelineItemTime(lastItem) : card.startedAtUnixMs) ?? null,
1682
- terminalAtUnixMs
1683
- };
1684
- }
1685
- var SUB_AGENT_DERIVED_NAME_MAX = 36;
1686
- function deriveSubAgentNameFromTask(task) {
1687
- if (!task) {
1688
- return null;
1689
- }
1690
- const firstSentence = task.trim().split(/[。..!?!?,,\n]/, 1)[0]?.trim();
1691
- if (!firstSentence) {
1692
- return null;
1693
- }
1694
- const selfAddress = /^(你现在是|你現在是|你是|you are|act as)\s*/i;
1695
- if (!selfAddress.test(firstSentence)) {
1696
- return null;
1697
- }
1698
- const stripped = firstSentence.replace(selfAddress, "").replace(/\s+/g, " ").trim();
1699
- if (stripped.length < 2 || stripped.length > SUB_AGENT_DERIVED_NAME_MAX) {
1700
- return null;
1701
- }
1702
- if (/^(spawnagent|agent)$/i.test(stripped)) {
1703
- return null;
1704
- }
1705
- return stripped;
1706
- }
1707
- function isSpawnAgentToken(agentName) {
1708
- const token = normalizeToolToken4(agentName);
1709
- return token === "spawnagent" || token === "spawn";
1710
- }
1711
- function latestNameMarker(sortedItems) {
1712
- for (let index = sortedItems.length - 1; index >= 0; index -= 1) {
1713
- const payload = sortedItems[index]?.payload;
1714
- if (payload?.messageKind !== "subAgentName") {
1715
- continue;
1716
- }
1717
- const name = stringValue2(payload.subAgentName);
1718
- if (name) {
1719
- return name;
1720
- }
1721
- }
1722
- return null;
1723
- }
1724
- function isSubAgentMarkerItem(item) {
1725
- const kind = item.payload?.messageKind;
1726
- return kind === "subAgentLifecycle" || kind === "subAgentName";
1727
- }
1728
- function subAgentActivityLog(sortedItems) {
1729
- const all = [];
1730
- for (const item of sortedItems) {
1731
- if (!item || isSubAgentMarkerItem(item)) {
1732
- continue;
1733
- }
1734
- const entry = displayableActivityEntry(item);
1735
- if (entry) {
1736
- all.push(entry);
1737
- }
1738
- }
1739
- const omittedCount = Math.max(0, all.length - SUB_AGENT_ACTIVITY_LOG_CAP);
1740
- return { entries: all.slice(omittedCount), omittedCount };
1741
- }
1742
- function displayableActivityEntry(item) {
1743
- const atUnixMs = timelineItemTime(item) || null;
1744
- if (isWorkspaceAgentToolCallItem(item)) {
1745
- const name = firstString2(item.name, stringValue2(item.payload?.name)) ?? null;
1746
- return name ? { kind: "tool", text: name, atUnixMs } : null;
1747
- }
1748
- const text = snippet(timelineItemText(item));
1749
- if (!text) {
1750
- return null;
1751
- }
1752
- const itemType = item.itemType?.trim().toLowerCase() ?? "";
1753
- const role = item.role?.trim().toLowerCase() ?? "";
1754
- if (itemType === "message.assistant_thinking" || role === "assistant_thinking") {
1755
- return { kind: "reasoning", text, atUnixMs };
1756
- }
1757
- return { kind: "message", text, atUnixMs };
1758
- }
1759
- function latestTerminalMarker(sortedItems) {
1760
- for (let index = sortedItems.length - 1; index >= 0; index -= 1) {
1761
- const item = sortedItems[index];
1762
- const payload = item?.payload;
1763
- if (!payload || payload.messageKind !== "subAgentLifecycle") {
1764
- continue;
1765
- }
1766
- return {
1767
- status: subAgentStatusFromLifecycle(payload.subAgentLifecycleStatus),
1768
- detail: stringValue2(payload.detail) ?? null,
1769
- occurredAtUnixMs: timelineItemTime(item) || null
1770
- };
1771
- }
1772
- return null;
1773
- }
1774
- var SUB_AGENT_ACTIVITY_SNIPPET_LENGTH = 140;
1775
- function snippet(text) {
1776
- if (text.length <= SUB_AGENT_ACTIVITY_SNIPPET_LENGTH) {
1777
- return text;
1778
- }
1779
- return `\u2026${text.slice(-SUB_AGENT_ACTIVITY_SNIPPET_LENGTH)}`;
1780
- }
1781
- function timelineItemText(item) {
1782
- const text = stringValue2(item.payload?.text) ?? stringValue2(item.payload?.content) ?? stringValue2(item.content) ?? "";
1783
- return text.replace(/\s+/g, " ").trim();
1784
- }
1785
- var COLLAB_CARD_TOOL_NAMES = /* @__PURE__ */ new Set([
1786
- "task",
1787
- "subagent",
1788
- "delegatetask",
1789
- "delegateagent",
1790
- "agent"
1791
- ]);
1792
- function collectCollabCards(mainTimelineItems) {
1793
- const cardsByCallId = /* @__PURE__ */ new Map();
1794
- for (const item of mainTimelineItems) {
1795
- if (!isWorkspaceAgentToolCallItem(item) || !isCollabCardItem(item)) {
1796
- continue;
1797
- }
1798
- const callId = firstString2(item.callId, stringValue2(item.payload?.callId));
1799
- if (!callId) {
1800
- continue;
1801
- }
1802
- const time = timelineItemTime(item);
1803
- const input = recordValue4(item.payload?.input);
1804
- const output = recordValue4(item.payload?.output);
1805
- const existing = cardsByCallId.get(callId);
1806
- if (!existing) {
1807
- cardsByCallId.set(callId, {
1808
- callId,
1809
- startedAtUnixMs: time,
1810
- latestAtUnixMs: time,
1811
- latestCallStatus: firstString2(
1812
- item.status,
1813
- stringValue2(item.payload?.status)
1814
- ),
1815
- receiverThreadIds: collectReceiverThreadIds(input),
1816
- childStatuses: collectChildStatuses(output)
1817
- });
1818
- continue;
1819
- }
1820
- existing.startedAtUnixMs = Math.min(existing.startedAtUnixMs, time);
1821
- if (time >= existing.latestAtUnixMs) {
1822
- existing.latestAtUnixMs = time;
1823
- existing.latestCallStatus = firstString2(item.status, stringValue2(item.payload?.status)) ?? existing.latestCallStatus;
1824
- }
1825
- for (const value of collectReceiverThreadIds(input)) {
1826
- existing.receiverThreadIds.add(value);
1827
- }
1828
- for (const [threadId, childStatus] of collectChildStatuses(output)) {
1829
- existing.childStatuses.set(threadId, childStatus);
1830
- }
1831
- }
1832
- return [...cardsByCallId.values()].map((card) => {
1833
- const input = recordValue4(
1834
- partitionCardInput(mainTimelineItems, card.callId)?.payload?.input
1835
- );
1836
- return {
1837
- callId: card.callId,
1838
- startedAtUnixMs: card.startedAtUnixMs,
1839
- task: stringValue2(input?.task),
1840
- agentName: stringValue2(input?.agentName),
1841
- callStatus: subAgentStatusFromCallStatus(card.latestCallStatus),
1842
- receiverThreadIds: card.receiverThreadIds,
1843
- childStatuses: card.childStatuses
1844
- };
1845
- }).sort((left, right) => left.startedAtUnixMs - right.startedAtUnixMs);
1846
- }
1847
- function partitionCardInput(mainTimelineItems, callId) {
1848
- for (const item of mainTimelineItems) {
1849
- if (!isWorkspaceAgentToolCallItem(item) || !isCollabCardItem(item)) {
1850
- continue;
1851
- }
1852
- if (firstString2(item.callId, stringValue2(item.payload?.callId)) === callId) {
1853
- return item;
1854
- }
1855
- }
1856
- return null;
1857
- }
1858
- function isCollabCardItem(item) {
1859
- const toolName = normalizeToolToken4(resolveWorkspaceAgentToolName(item));
1860
- return COLLAB_CARD_TOOL_NAMES.has(toolName);
1861
- }
1862
- function firstOwnerCallId(sortedItems) {
1863
- for (const item of sortedItems) {
1864
- const ownerCallId = timelineItemOwnerCallId(item);
1865
- if (ownerCallId) {
1866
- return ownerCallId;
1867
- }
1868
- }
1869
- return null;
1870
- }
1871
- function isControlAgentToken(agentName) {
1872
- switch (normalizeToolToken4(agentName)) {
1873
- case "wait":
1874
- case "waitagent":
1875
- case "close":
1876
- case "closeagent":
1877
- return true;
1878
- default:
1879
- return false;
1880
- }
1881
- }
1882
- function subAgentStatusFromCallStatus(status) {
1883
- switch ((status ?? "").trim().toLowerCase()) {
1884
- case "completed":
1885
- case "done":
1886
- case "success":
1887
- case "succeeded":
1888
- return "completed";
1889
- case "failed":
1890
- case "error":
1891
- case "errored":
1892
- return "failed";
1893
- case "canceled":
1894
- case "cancelled":
1895
- return "canceled";
1896
- default:
1897
- return "running";
1898
- }
1899
- }
1900
- function subAgentStatusFromLifecycle(status) {
1901
- switch (typeof status === "string" ? status.trim().toLowerCase() : "") {
1902
- case "completed":
1903
- case "done":
1904
- case "success":
1905
- case "succeeded":
1906
- return "completed";
1907
- case "failed":
1908
- case "error":
1909
- case "errored":
1910
- return "failed";
1911
- case "canceled":
1912
- case "cancelled":
1913
- case "interrupted":
1914
- case "stopped":
1915
- return "canceled";
1916
- default:
1917
- return "running";
1918
- }
1919
- }
1920
- function collectReceiverThreadIds(input) {
1921
- const out = /* @__PURE__ */ new Set();
1922
- if (input == null || typeof input !== "object" || Array.isArray(input)) {
1923
- return out;
1924
- }
1925
- const raw = input.receiverThreadIds;
1926
- if (!Array.isArray(raw)) {
1927
- return out;
1928
- }
1929
- for (const entry of raw) {
1930
- const id = stringValue2(entry);
1931
- if (id) {
1932
- out.add(id);
1933
- }
1934
- }
1935
- return out;
1936
- }
1937
- function collectChildStatuses(value) {
1938
- const out = /* @__PURE__ */ new Map();
1939
- collectChildStatusesInto(value, out, 0);
1940
- return out;
1941
- }
1942
- function collectChildStatusesInto(value, out, depth) {
1943
- if (depth > 6 || value == null) {
1944
- return;
1945
- }
1946
- if (Array.isArray(value)) {
1947
- for (const entry of value) {
1948
- collectChildStatusesInto(entry, out, depth + 1);
1949
- }
1950
- return;
1951
- }
1952
- if (typeof value !== "object") {
1953
- return;
1954
- }
1955
- const record = value;
1956
- const status = subAgentStatusFromLifecycle(record.status ?? record.state);
1957
- const id = firstString2(
1958
- stringValue2(record.threadId),
1959
- stringValue2(record.threadID),
1960
- stringValue2(record.agentId),
1961
- stringValue2(record.agent_id),
1962
- stringValue2(record.id)
1963
- );
1964
- if (id && status !== "running") {
1965
- out.set(id, status);
1966
- }
1967
- for (const [key, entry] of Object.entries(record)) {
1968
- if (key === "agentsStates" || key === "statuses") {
1969
- collectChildStatusesInto(entry, out, depth + 1);
1970
- continue;
1971
- }
1972
- if (typeof entry === "object" && entry != null) {
1973
- const nestedStatus = subAgentStatusFromLifecycle(
1974
- entry.status ?? entry.state
1975
- );
1976
- if (nestedStatus !== "running" && key.trim()) {
1977
- out.set(key, nestedStatus);
1978
- }
1979
- }
1980
- collectChildStatusesInto(entry, out, depth + 1);
1981
- }
1982
- }
1983
- function timelineItemTime(item) {
1984
- return item?.occurredAtUnixMs ?? item?.createdAtUnixMs ?? 0;
1985
- }
1986
- function compareTimelineItemsAscending(left, right) {
1987
- return timelineItemTime(left) - timelineItemTime(right) || (left.seq ?? 0) - (right.seq ?? 0) || left.id - right.id;
1988
- }
1989
- function normalizeToolToken4(value) {
1990
- return (value ?? "").replace(/[\s_-]+/g, "").trim().toLowerCase();
1991
- }
1992
- function stringValue2(value) {
1993
- return typeof value === "string" && value.trim() ? value.trim() : null;
1994
- }
1995
- function recordValue4(value) {
1996
- return value && typeof value === "object" && !Array.isArray(value) ? value : null;
1997
- }
1998
- function firstString2(...values) {
1999
- for (const value of values) {
2000
- const resolved = stringValue2(value);
2001
- if (resolved) {
2002
- return resolved;
2003
- }
2004
- }
2005
- return null;
2006
- }
2007
-
2008
1503
  // shared/workspaceAgentTimelineProjectionHelpers.ts
2009
1504
  function delegatedToolStepFromCall(call) {
2010
1505
  const payload = normalizedPayload(call.payload ?? void 0);
@@ -2108,7 +1603,7 @@ function mergeSourceTimelineItems(previous, next) {
2108
1603
  if (merged.length === 0) return void 0;
2109
1604
  const byKey = /* @__PURE__ */ new Map();
2110
1605
  for (const item of merged) byKey.set(sourceTimelineItemKey(item), item);
2111
- return [...byKey.values()].sort(compareTimelineItemsAscending2);
1606
+ return [...byKey.values()].sort(compareTimelineItemsAscending);
2112
1607
  }
2113
1608
  function normalizedPayload(payload) {
2114
1609
  return payload && typeof payload === "object" ? payload : null;
@@ -2189,7 +1684,7 @@ function sourceTimelineItemKey(item) {
2189
1684
  const seq = item.seq ?? 0;
2190
1685
  return seq > 0 ? `seq:${seq}` : `local:${item.itemType}:${item.occurredAtUnixMs ?? 0}`;
2191
1686
  }
2192
- function compareTimelineItemsAscending2(left, right) {
1687
+ function compareTimelineItemsAscending(left, right) {
2193
1688
  return (left.seq ?? 0) - (right.seq ?? 0) || (left.occurredAtUnixMs ?? left.createdAtUnixMs ?? 0) - (right.occurredAtUnixMs ?? right.createdAtUnixMs ?? 0) || left.id - right.id;
2194
1689
  }
2195
1690
  function booleanRecordValue(record, key) {
@@ -2229,13 +1724,10 @@ function buildCanonicalWorkspaceAgentDetailView({
2229
1724
  const seenThinkingMessages = /* @__PURE__ */ new Set();
2230
1725
  let activeSequenceTurnId = null;
2231
1726
  const sortedTimelineItems = [...timelineItems].sort(
2232
- compareTimelineItemsAscending3
1727
+ compareTimelineItemsAscending2
2233
1728
  );
2234
1729
  const suppressedToolCallIds = suppressedUnavailableAskUserQuestionCallIds(sortedTimelineItems);
2235
1730
  for (const item of sortedTimelineItems) {
2236
- if (timelineItemOwnerThreadId(item)) {
2237
- continue;
2238
- }
2239
1731
  const role = messageRole(item);
2240
1732
  const body = messageBody(item);
2241
1733
  const explicitTurnId = item.turnId?.trim();
@@ -2386,7 +1878,7 @@ function getTurn(turns, id) {
2386
1878
  turns.set(id, turn);
2387
1879
  return turn;
2388
1880
  }
2389
- function compareTimelineItemsAscending3(left, right) {
1881
+ function compareTimelineItemsAscending2(left, right) {
2390
1882
  const leftSeq = left.seq ?? 0;
2391
1883
  const rightSeq = right.seq ?? 0;
2392
1884
  if (leftSeq > 0 && rightSeq > 0 && leftSeq !== rightSeq) {
@@ -3061,13 +2553,13 @@ function normalizeToolName3(value) {
3061
2553
  }
3062
2554
  function hasMcpMetadata(metadata) {
3063
2555
  return Boolean(
3064
- stringValue3(metadata?.server) ?? stringValue3(metadata?.serverName) ?? stringValue3(metadata?.mcpServer)
2556
+ stringValue2(metadata?.server) ?? stringValue2(metadata?.serverName) ?? stringValue2(metadata?.mcpServer)
3065
2557
  );
3066
2558
  }
3067
2559
  function normalizeCallType(value) {
3068
2560
  return (value ?? "").trim().toLowerCase();
3069
2561
  }
3070
- function stringValue3(value) {
2562
+ function stringValue2(value) {
3071
2563
  return typeof value === "string" && value.trim() ? value.trim() : null;
3072
2564
  }
3073
2565
 
@@ -3078,7 +2570,7 @@ function projectAgentApprovalItem(call, input, output) {
3078
2570
  if (callType !== "approval" && toolName !== "approval") {
3079
2571
  return null;
3080
2572
  }
3081
- const requestId = stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? stringValue4(output?.requestId);
2573
+ const requestId = stringValue3(input?.requestId) ?? stringValue3(call.payload?.requestId) ?? stringValue3(output?.requestId);
3082
2574
  if (!requestId) {
3083
2575
  return null;
3084
2576
  }
@@ -3102,7 +2594,7 @@ function projectAgentApprovalItem(call, input, output) {
3102
2594
  callId: call.id.replace(/^call:/, ""),
3103
2595
  title: mcpTarget?.displayName ?? (call.summary.trim() || call.name),
3104
2596
  toolName: call.toolName,
3105
- status: stringValue4(call.payload?.status) ?? call.status,
2597
+ status: stringValue3(call.payload?.status) ?? call.status,
3106
2598
  input,
3107
2599
  options,
3108
2600
  output,
@@ -3112,17 +2604,17 @@ function projectAgentApprovalItem(call, input, output) {
3112
2604
  function normalizeApprovalOptions(values) {
3113
2605
  return values.flatMap((value) => {
3114
2606
  const option = objectValue(value);
3115
- const id = stringValue4(option?.optionId) ?? stringValue4(option?.id);
2607
+ const id = stringValue3(option?.optionId) ?? stringValue3(option?.id);
3116
2608
  if (!id) {
3117
2609
  return [];
3118
2610
  }
3119
- const label = stringValue4(option?.name) ?? stringValue4(option?.label) ?? stringValue4(option?.title) ?? stringValue4(option?.kind) ?? id;
2611
+ const label = stringValue3(option?.name) ?? stringValue3(option?.label) ?? stringValue3(option?.title) ?? stringValue3(option?.kind) ?? id;
3120
2612
  return [
3121
2613
  {
3122
2614
  id,
3123
2615
  label,
3124
- kind: stringValue4(option?.kind) ?? "",
3125
- ...stringValue4(option?.description) ? { description: stringValue4(option?.description) } : {}
2616
+ kind: stringValue3(option?.kind) ?? "",
2617
+ ...stringValue3(option?.description) ? { description: stringValue3(option?.description) } : {}
3126
2618
  }
3127
2619
  ];
3128
2620
  });
@@ -3130,7 +2622,7 @@ function normalizeApprovalOptions(values) {
3130
2622
  function normalizeToken(value) {
3131
2623
  return (value ?? "").trim().toLowerCase();
3132
2624
  }
3133
- function stringValue4(value) {
2625
+ function stringValue3(value) {
3134
2626
  return typeof value === "string" && value.trim() ? value.trim() : null;
3135
2627
  }
3136
2628
  function objectValue(value) {
@@ -3154,7 +2646,7 @@ function projectAgentAskUserQuestionItem(call, input, output) {
3154
2646
  kind: "ask-user",
3155
2647
  id: call.id,
3156
2648
  turnId: call.turnId ?? "turn:unknown",
3157
- requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
2649
+ requestId: stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3158
2650
  title: call.name,
3159
2651
  status: call.status,
3160
2652
  questions: questions.map((question) => ({
@@ -3170,12 +2662,12 @@ function projectAgentPlanModeItem(call, input) {
3170
2662
  itemKind: "plan-mode",
3171
2663
  id: call.id,
3172
2664
  turnId: call.turnId ?? "turn:unknown",
3173
- requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
2665
+ requestId: stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3174
2666
  kind: "exit",
3175
- title: stringValue5(objectValue2(input?.toolCall)?.title) ?? call.name,
2667
+ title: stringValue4(objectValue2(input?.toolCall)?.title) ?? call.name,
3176
2668
  status: call.status,
3177
- plan: stringValue5(input?.plan) ?? stringValue5(call.payload?.plan) ?? (call.summary.trim() || null),
3178
- filePath: stringValue5(input?.filePath) ?? stringValue5(call.payload?.filePath),
2669
+ plan: stringValue4(input?.plan) ?? stringValue4(call.payload?.plan) ?? (call.summary.trim() || null),
2670
+ filePath: stringValue4(input?.filePath) ?? stringValue4(call.payload?.filePath),
3179
2671
  options: extractExitPlanModeOptions(input),
3180
2672
  ...keepPlanningOption(extractExitPlanKeepPlanningOptionId(input)),
3181
2673
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
@@ -3190,8 +2682,8 @@ function projectAgentPlanModeItem(call, input) {
3190
2682
  kind: "enter",
3191
2683
  title: call.name,
3192
2684
  status: call.status,
3193
- plan: stringValue5(input?.content) ?? (call.summary.trim() || null),
3194
- filePath: stringValue5(input?.filePath),
2685
+ plan: stringValue4(input?.content) ?? (call.summary.trim() || null),
2686
+ filePath: stringValue4(input?.filePath),
3195
2687
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
3196
2688
  };
3197
2689
  }
@@ -3202,17 +2694,19 @@ function projectAgentPlanModeItem(call, input) {
3202
2694
  itemKind: "plan-mode",
3203
2695
  id: call.id,
3204
2696
  turnId: call.turnId ?? "turn:unknown",
3205
- requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
2697
+ requestId: stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
3206
2698
  kind: "exit",
3207
2699
  title: call.name,
3208
2700
  status: call.status,
3209
- plan: stringValue5(input?.plan) ?? stringValue5(call.payload?.plan) ?? (call.summary.trim() || null),
3210
- filePath: stringValue5(input?.filePath) ?? stringValue5(call.payload?.filePath),
2701
+ plan: stringValue4(input?.plan) ?? stringValue4(call.payload?.plan) ?? (call.summary.trim() || null),
2702
+ filePath: stringValue4(input?.filePath) ?? stringValue4(call.payload?.filePath),
3211
2703
  occurredAtUnixMs: call.occurredAtUnixMs ?? null
3212
2704
  };
3213
2705
  }
3214
2706
  function answerForQuestion(questionId, answersByQuestionId, output) {
3215
- const value = answersByQuestionId[questionId];
2707
+ const responsePayload = objectValue2(output?.payload);
2708
+ const responseAnswersByQuestionId = objectValue2(responsePayload?.answersByQuestionId) ?? {};
2709
+ const value = answersByQuestionId[questionId] ?? responseAnswersByQuestionId[questionId];
3216
2710
  if (Array.isArray(value)) {
3217
2711
  return value.flatMap(
3218
2712
  (item) => typeof item === "string" && item.trim() ? [item.trim()] : []
@@ -3221,7 +2715,7 @@ function answerForQuestion(questionId, answersByQuestionId, output) {
3221
2715
  if (typeof value === "string" && value.trim()) {
3222
2716
  return value.trim();
3223
2717
  }
3224
- const answers = arrayValue2(output?.answers);
2718
+ const answers = arrayValue2(output?.answers) ?? arrayValue2(responsePayload?.answers);
3225
2719
  return answers && answers.length > 0 ? answers.filter(
3226
2720
  (item) => typeof item === "string" && item.trim().length > 0
3227
2721
  ) : null;
@@ -3232,7 +2726,7 @@ function keepPlanningOption(optionId) {
3232
2726
  function normalizeToolName4(value) {
3233
2727
  return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
3234
2728
  }
3235
- function stringValue5(value) {
2729
+ function stringValue4(value) {
3236
2730
  return typeof value === "string" && value.trim() ? value.trim() : null;
3237
2731
  }
3238
2732
  function objectValue2(value) {
@@ -3260,9 +2754,9 @@ function projectAgentTaskItem(call, input, output, metadata) {
3260
2754
  id: call.id,
3261
2755
  turnId: call.turnId ?? "turn:unknown",
3262
2756
  title: call.summary.trim() || call.name,
3263
- status: stringValue6(metadata?.taskStatus) ?? stringValue6(metadata?.subagentStatus) ?? call.status,
3264
- prompt: stringValue6(input?.prompt) ?? stringValue6(input?.description) ?? stringValue6(call.payload?.description) ?? stringValue6(claudeToolResponse?.prompt),
3265
- delegateSessionId: stringValue6(metadata?.childSessionID) ?? stringValue6(metadata?.child_session_id) ?? stringValue6(metadata?.subagentSessionID) ?? stringValue6(metadata?.subagent_session_id) ?? stringValue6(metadata?.subagentAgentId) ?? stringValue6(metadata?.agentId) ?? stringValue6(claudeToolResponse?.agentId),
2757
+ status: stringValue5(metadata?.taskStatus) ?? stringValue5(metadata?.subagentStatus) ?? call.status,
2758
+ prompt: stringValue5(input?.prompt) ?? stringValue5(input?.description) ?? stringValue5(call.payload?.description) ?? stringValue5(claudeToolResponse?.prompt),
2759
+ delegateSessionId: stringValue5(metadata?.childSessionID) ?? stringValue5(metadata?.child_session_id) ?? stringValue5(metadata?.subagentSessionID) ?? stringValue5(metadata?.subagent_session_id) ?? stringValue5(metadata?.subagentAgentId) ?? stringValue5(metadata?.agentId) ?? stringValue5(claudeToolResponse?.agentId),
3266
2760
  steps,
3267
2761
  result: firstNonEmptyText(output),
3268
2762
  resultMarkdown: firstNonEmptyText(output),
@@ -3276,8 +2770,8 @@ function normalizeTaskSteps(values, turnId) {
3276
2770
  if (!step) {
3277
2771
  return [];
3278
2772
  }
3279
- const toolName = stringValue6(step.toolName) ?? stringValue6(step.tool_name) ?? stringValue6(step.name);
3280
- const callType = stringValue6(step.callType) ?? stringValue6(step.call_type);
2773
+ const toolName = stringValue5(step.toolName) ?? stringValue5(step.tool_name) ?? stringValue5(step.name);
2774
+ const callType = stringValue5(step.callType) ?? stringValue5(step.call_type);
3281
2775
  if (isApprovalToolCall({ toolName, callType })) {
3282
2776
  return [];
3283
2777
  }
@@ -3290,11 +2784,11 @@ function normalizeTaskSteps(values, turnId) {
3290
2784
  const locations = arrayValue3(step.locations);
3291
2785
  return [
3292
2786
  {
3293
- id: stringValue6(step.toolUseId) ?? stringValue6(step.id) ?? `step-${index + 1}`,
2787
+ id: stringValue5(step.toolUseId) ?? stringValue5(step.id) ?? `step-${index + 1}`,
3294
2788
  turnId,
3295
2789
  name: toolName ? humanizeToolLabel(toolName) : `Step ${index + 1}`,
3296
2790
  toolName: toolName ?? null,
3297
- status: stringValue6(step.status) ?? stringValue6(objectValue3(step.toolResult)?.status) ?? stringValue6(objectValue3(step.tool_result)?.status),
2791
+ status: stringValue5(step.status) ?? stringValue5(objectValue3(step.toolResult)?.status) ?? stringValue5(objectValue3(step.tool_result)?.status),
3298
2792
  summary: firstNonEmptyText(outputPayload, inputPayload) ?? "",
3299
2793
  payload: {
3300
2794
  input: inputPayload,
@@ -3302,12 +2796,12 @@ function normalizeTaskSteps(values, turnId) {
3302
2796
  error: errorPayload
3303
2797
  },
3304
2798
  tool: projectAgentTaskStepTool({
3305
- id: stringValue6(step.toolUseId) ?? stringValue6(step.id) ?? `step-${index + 1}`,
2799
+ id: stringValue5(step.toolUseId) ?? stringValue5(step.id) ?? `step-${index + 1}`,
3306
2800
  turnId,
3307
2801
  toolName,
3308
- name: stringValue6(step.name),
2802
+ name: stringValue5(step.name),
3309
2803
  callType,
3310
- status: stringValue6(step.status) ?? stringValue6(outputPayload?.status),
2804
+ status: stringValue5(step.status) ?? stringValue5(outputPayload?.status),
3311
2805
  summary: firstNonEmptyText(outputPayload, inputPayload) ?? "",
3312
2806
  payload,
3313
2807
  metadata,
@@ -3389,7 +2883,7 @@ function projectAgentTaskStepTool(step) {
3389
2883
  function humanizeToolLabel(value) {
3390
2884
  return value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/^\w/, (match) => match.toUpperCase());
3391
2885
  }
3392
- function stringValue6(value) {
2886
+ function stringValue5(value) {
3393
2887
  return typeof value === "string" && value.trim() ? value.trim() : null;
3394
2888
  }
3395
2889
  function numberValue(value) {
@@ -4093,7 +3587,7 @@ function userPromptContentBlocks(message, fallbackWorkspaceId) {
4093
3587
  );
4094
3588
  const content = Array.isArray(item?.payload?.content) ? item.payload.content : null;
4095
3589
  if (!content) return [];
4096
- const displayPrompt = firstString3(
3590
+ const displayPrompt = firstString2(
4097
3591
  message.sourceTimelineItems?.map(
4098
3592
  (candidate) => typeof candidate.payload?.displayPrompt === "string" ? candidate.payload.displayPrompt : ""
4099
3593
  ) ?? []
@@ -4126,7 +3620,7 @@ function userPromptContentBlocks(message, fallbackWorkspaceId) {
4126
3620
  function optionalString(value) {
4127
3621
  return typeof value === "string" && value.trim() ? value.trim() : null;
4128
3622
  }
4129
- function firstString3(values) {
3623
+ function firstString2(values) {
4130
3624
  for (const value of values) {
4131
3625
  const trimmed = value.trim();
4132
3626
  if (trimmed) return trimmed;
@@ -4503,11 +3997,11 @@ function collectContentDiffFiles(messageId, toolName, occurredAtUnixMs, contentI
4503
3997
  if (!item) {
4504
3998
  return [];
4505
3999
  }
4506
- const type = stringValue7(item.type);
4000
+ const type = stringValue6(item.type);
4507
4001
  if (type && type !== "diff") {
4508
4002
  return [];
4509
4003
  }
4510
- const path = normalizedFilePath(stringValue7(item.path), options);
4004
+ const path = normalizedFilePath(stringValue6(item.path), options);
4511
4005
  if (!path) {
4512
4006
  return [];
4513
4007
  }
@@ -4516,10 +4010,10 @@ function collectContentDiffFiles(messageId, toolName, occurredAtUnixMs, contentI
4516
4010
  relatedChange ? fileChangeTypeValue(relatedChange) : null
4517
4011
  );
4518
4012
  const unifiedDiff = firstNonEmptyString(
4519
- stringValue7(item.diff),
4520
- stringValue7(item.patch),
4521
- stringValue7(relatedChange?.unified_diff),
4522
- stringValue7(relatedChange?.unifiedDiff)
4013
+ stringValue6(item.diff),
4014
+ stringValue6(item.patch),
4015
+ stringValue6(relatedChange?.unified_diff),
4016
+ stringValue6(relatedChange?.unifiedDiff)
4523
4017
  );
4524
4018
  let oldString = firstPresentString6(
4525
4019
  literalStringValue(item.oldText),
@@ -4806,9 +4300,9 @@ function nestedTaskStepsFromPayload(payload, output) {
4806
4300
  }
4807
4301
  function nestedTaskStepStatusKind(step, fallback) {
4808
4302
  return firstNonEmptyString(
4809
- stringValue7(step.statusKind),
4810
- stringValue7(step.status),
4811
- stringValue7(step.toolStatus)
4303
+ stringValue6(step.statusKind),
4304
+ stringValue6(step.status),
4305
+ stringValue6(step.toolStatus)
4812
4306
  ) ?? fallback ?? null;
4813
4307
  }
4814
4308
  function firstLocationPath(value) {
@@ -4817,7 +4311,7 @@ function firstLocationPath(value) {
4817
4311
  }
4818
4312
  for (const item of value) {
4819
4313
  const record = objectValue5(item);
4820
- const path = stringValue7(record?.path);
4314
+ const path = stringValue6(record?.path);
4821
4315
  if (path) {
4822
4316
  return path;
4823
4317
  }
@@ -4829,14 +4323,14 @@ function firstPathValue(value) {
4829
4323
  return null;
4830
4324
  }
4831
4325
  for (const item of value) {
4832
- const path = stringValue7(item);
4326
+ const path = stringValue6(item);
4833
4327
  if (path) {
4834
4328
  return path;
4835
4329
  }
4836
4330
  }
4837
4331
  return null;
4838
4332
  }
4839
- function stringValue7(value) {
4333
+ function stringValue6(value) {
4840
4334
  return typeof value === "string" && value.trim() ? value.trim() : null;
4841
4335
  }
4842
4336
  function literalStringValue(value) {
@@ -4991,8 +4485,8 @@ function filesFromCall(call, options) {
4991
4485
  return [];
4992
4486
  }
4993
4487
  return extractFileChanges({
4994
- id: stringValue7(step.toolUseId) ?? stringValue7(step.id) ?? `${call.id}:step:${index + 1}`,
4995
- toolName: stringValue7(step.toolName) ?? stringValue7(step.tool_name) ?? stringValue7(step.name) ?? null,
4488
+ id: stringValue6(step.toolUseId) ?? stringValue6(step.id) ?? `${call.id}:step:${index + 1}`,
4489
+ toolName: stringValue6(step.toolName) ?? stringValue6(step.tool_name) ?? stringValue6(step.name) ?? null,
4996
4490
  statusKind: nestedTaskStepStatusKind(step, call.statusKind ?? null),
4997
4491
  occurredAtUnixMs: numberValue2(step.occurredAtUnixMs) ?? numberValue2(step.occurred_at_unix_ms) ?? call.occurredAtUnixMs ?? null,
4998
4492
  payload: objectValue5(step.payload),
@@ -5029,7 +4523,7 @@ function patchBatchesFromCall(call, options) {
5029
4523
  return [];
5030
4524
  }
5031
4525
  return patchBatchFromPayload({
5032
- id: stringValue7(step.toolUseId) ?? stringValue7(step.id) ?? `${call.id}:step:${index + 1}`,
4526
+ id: stringValue6(step.toolUseId) ?? stringValue6(step.id) ?? `${call.id}:step:${index + 1}`,
5033
4527
  payload: objectValue5(step.payload),
5034
4528
  toolInput: objectValue5(step.toolInput) ?? objectValue5(step.tool_input),
5035
4529
  toolOutput: objectValue5(step.toolResult) ?? objectValue5(step.tool_result),
@@ -5058,11 +4552,11 @@ function patchBatchFromPayload(input) {
5058
4552
  return [
5059
4553
  {
5060
4554
  cwd: firstNonEmptyString(
5061
- stringValue7(input.payload?.cwd),
5062
- stringValue7(payloadInput?.cwd),
5063
- stringValue7(rawInput?.cwd),
5064
- stringValue7(payloadOutput?.cwd),
5065
- stringValue7(metadata?.cwd),
4555
+ stringValue6(input.payload?.cwd),
4556
+ stringValue6(payloadInput?.cwd),
4557
+ stringValue6(rawInput?.cwd),
4558
+ stringValue6(payloadOutput?.cwd),
4559
+ stringValue6(metadata?.cwd),
5066
4560
  input.options.defaultCwd ?? null
5067
4561
  ) ?? null,
5068
4562
  toolCallId: input.id,
@@ -5079,10 +4573,10 @@ function patchChangesFromChangeMap(changes) {
5079
4573
  }
5080
4574
  const normalizedType = normalizeChangeType(fileChangeTypeValue(change));
5081
4575
  const unifiedDiff = firstNonEmptyString(
5082
- stringValue7(change.unified_diff),
5083
- stringValue7(change.unifiedDiff),
5084
- stringValue7(change.diff),
5085
- stringValue7(change.patch)
4576
+ stringValue6(change.unified_diff),
4577
+ stringValue6(change.unifiedDiff),
4578
+ stringValue6(change.diff),
4579
+ stringValue6(change.patch)
5086
4580
  ) ?? null;
5087
4581
  let oldString = firstPresentString6(
5088
4582
  literalStringValue(change.old_string),
@@ -5158,10 +4652,10 @@ function extractFileChanges(input) {
5158
4652
  input.occurredAtUnixMs,
5159
4653
  arrayValue5(objectValue5(payload?.fileChanges)?.files),
5160
4654
  firstNonEmptyString(
5161
- stringValue7(input.input?.patch),
5162
- stringValue7(input.output?.patch),
5163
- stringValue7(payload?.patch),
5164
- stringValue7(metadata?.patch)
4655
+ stringValue6(input.input?.patch),
4656
+ stringValue6(input.output?.patch),
4657
+ stringValue6(payload?.patch),
4658
+ stringValue6(metadata?.patch)
5165
4659
  ),
5166
4660
  firstPresentString6(
5167
4661
  literalStringValue(input.output?.oldString),
@@ -5205,24 +4699,24 @@ function extractFileChanges(input) {
5205
4699
  if (filesFromContentDiff.length > 0) {
5206
4700
  return filesFromContentDiff;
5207
4701
  }
5208
- const summaryFallbackPath = input.input?.summaryPathFallback === true ? stringValue7(input.input?.path) : null;
5209
- const explicitInputPath = summaryFallbackPath ? null : stringValue7(input.input?.path);
4702
+ const summaryFallbackPath = input.input?.summaryPathFallback === true ? stringValue6(input.input?.path) : null;
4703
+ const explicitInputPath = summaryFallbackPath ? null : stringValue6(input.input?.path);
5210
4704
  const filePath = firstNonEmptyString(
5211
4705
  firstPathValue(payloadPaths),
5212
- stringValue7(input.input?.file_path),
5213
- stringValue7(input.input?.filePath),
4706
+ stringValue6(input.input?.file_path),
4707
+ stringValue6(input.input?.filePath),
5214
4708
  explicitInputPath,
5215
- stringValue7(input.input?.notebook_path),
5216
- stringValue7(input.output?.file_path),
5217
- stringValue7(input.output?.filePath),
5218
- stringValue7(input.output?.path),
5219
- stringValue7(input.output?.notebook_path),
4709
+ stringValue6(input.input?.notebook_path),
4710
+ stringValue6(input.output?.file_path),
4711
+ stringValue6(input.output?.filePath),
4712
+ stringValue6(input.output?.path),
4713
+ stringValue6(input.output?.notebook_path),
5220
4714
  firstLocationPath(inputLocations),
5221
4715
  firstLocationPath(payloadLocations)
5222
4716
  ) ?? extractAgentPatchPath(
5223
4717
  firstNonEmptyString(
5224
- stringValue7(input.input?.patch),
5225
- stringValue7(input.output?.patch)
4718
+ stringValue6(input.input?.patch),
4719
+ stringValue6(input.output?.patch)
5226
4720
  )
5227
4721
  ) ?? summaryFallbackPath;
5228
4722
  const normalizedFilePathValue = normalizedFilePath(filePath, input.options);
@@ -5230,11 +4724,11 @@ function extractFileChanges(input) {
5230
4724
  return [];
5231
4725
  }
5232
4726
  const patch = firstNonEmptyString(
5233
- stringValue7(input.input?.patch),
5234
- stringValue7(input.output?.patch),
5235
- stringValue7(payload?.patch),
5236
- stringValue7(metadata?.patch),
5237
- stringValue7(input.output?.content)
4727
+ stringValue6(input.input?.patch),
4728
+ stringValue6(input.output?.patch),
4729
+ stringValue6(payload?.patch),
4730
+ stringValue6(metadata?.patch),
4731
+ stringValue6(input.output?.content)
5238
4732
  ) ?? null;
5239
4733
  const oldString = firstPresentString6(
5240
4734
  literalStringValue(input.output?.oldString),
@@ -5257,10 +4751,10 @@ function extractFileChanges(input) {
5257
4751
  );
5258
4752
  const explicitChangeType = normalizeChangeType(
5259
4753
  firstNonEmptyString(
5260
- stringValue7(payload?.fileChangeKind),
5261
- stringValue7(metadata?.fileChangeKind),
5262
- stringValue7(input.input?.fileChangeKind),
5263
- stringValue7(input.output?.fileChangeKind)
4754
+ stringValue6(payload?.fileChangeKind),
4755
+ stringValue6(metadata?.fileChangeKind),
4756
+ stringValue6(input.input?.fileChangeKind),
4757
+ stringValue6(input.output?.fileChangeKind)
5264
4758
  )
5265
4759
  ) ?? null;
5266
4760
  const changeType = explicitChangeType ?? (normalizedToolName === "write" || normalizedToolName === "writefile" ? "created" : normalizedToolName === "notebookedit" ? "created" : inferAgentPatchChangeType(patch));
@@ -5300,16 +4794,16 @@ function isStructuredWriteTool(normalizedToolName, payload, metadata) {
5300
4794
  return false;
5301
4795
  }
5302
4796
  const activityKind = firstNonEmptyString(
5303
- stringValue7(payload?.activityKind),
5304
- stringValue7(metadata?.activityKind)
4797
+ stringValue6(payload?.activityKind),
4798
+ stringValue6(metadata?.activityKind)
5305
4799
  );
5306
4800
  if (activityKind === "write_file" || activityKind === "edit_file" || activityKind === "delete_file") {
5307
4801
  return true;
5308
4802
  }
5309
4803
  return normalizeChangeType(
5310
4804
  firstNonEmptyString(
5311
- stringValue7(payload?.fileChangeKind),
5312
- stringValue7(metadata?.fileChangeKind)
4805
+ stringValue6(payload?.fileChangeKind),
4806
+ stringValue6(metadata?.fileChangeKind)
5313
4807
  )
5314
4808
  ) !== null;
5315
4809
  }
@@ -5319,15 +4813,15 @@ function collectMetadataFiles(messageId, toolName, occurredAtUnixMs, files, patc
5319
4813
  }
5320
4814
  return files.flatMap((value, index) => {
5321
4815
  const file = objectValue5(value);
5322
- const path = normalizedFilePath(stringValue7(file?.path), options);
4816
+ const path = normalizedFilePath(stringValue6(file?.path), options);
5323
4817
  if (!path) {
5324
4818
  return [];
5325
4819
  }
5326
4820
  const fileUnifiedDiff = firstNonEmptyString(
5327
- stringValue7(file?.diff),
5328
- stringValue7(file?.patch),
5329
- stringValue7(file?.unifiedDiff),
5330
- stringValue7(file?.unified_diff)
4821
+ stringValue6(file?.diff),
4822
+ stringValue6(file?.patch),
4823
+ stringValue6(file?.unifiedDiff),
4824
+ stringValue6(file?.unified_diff)
5331
4825
  ) ?? patch;
5332
4826
  const fileOldString = firstPresentString6(
5333
4827
  literalStringValue(file?.oldString),
@@ -5338,7 +4832,7 @@ function collectMetadataFiles(messageId, toolName, occurredAtUnixMs, files, patc
5338
4832
  literalStringValue(file?.new_string)
5339
4833
  ) ?? newString;
5340
4834
  const fileContent = firstPresentString6(literalStringValue(file?.content)) ?? content;
5341
- const change = normalizeChangeType(stringValue7(file?.change));
4835
+ const change = normalizeChangeType(stringValue6(file?.change));
5342
4836
  return [
5343
4837
  buildFileChange({
5344
4838
  id: `${messageId}:${index + 1}`,
@@ -5363,10 +4857,10 @@ function collectChangeMapFiles(messageId, toolName, occurredAtUnixMs, changes, o
5363
4857
  }
5364
4858
  const normalizedType = normalizeChangeType(fileChangeTypeValue(change));
5365
4859
  const unifiedDiff = firstNonEmptyString(
5366
- stringValue7(change.unified_diff),
5367
- stringValue7(change.unifiedDiff),
5368
- stringValue7(change.diff),
5369
- stringValue7(change.patch)
4860
+ stringValue6(change.unified_diff),
4861
+ stringValue6(change.unifiedDiff),
4862
+ stringValue6(change.diff),
4863
+ stringValue6(change.patch)
5370
4864
  );
5371
4865
  let oldString = firstPresentString6(
5372
4866
  literalStringValue(change.old_string),
@@ -8997,9 +8491,9 @@ function WriteLinedIcon(props) {
8997
8491
 
8998
8492
  // shared/agentConversation/components/tool-renderers/render-data/agentToolFileChangeRenderData.ts
8999
8493
  function getFileChangeRenderData(call) {
9000
- const payloadInput = recordValue5(call.payload?.input);
9001
- const payloadOutput = recordValue5(call.payload?.output);
9002
- const rawInput = recordValue5(call.input?.rawInput) ?? recordValue5(payloadInput?.rawInput);
8494
+ const payloadInput = recordValue4(call.payload?.input);
8495
+ const payloadOutput = recordValue4(call.payload?.output);
8496
+ const rawInput = recordValue4(call.input?.rawInput) ?? recordValue4(payloadInput?.rawInput);
9003
8497
  const inputLocations = arrayValue6(call.locations) ?? arrayValue6(call.input?.locations) ?? arrayValue6(payloadInput?.locations);
9004
8498
  const fromStructuredPatch = structuredPatchFiles(
9005
8499
  call.output?.structuredPatch ?? payloadOutput?.structuredPatch ?? call.payload?.structuredPatch ?? call.output?.files ?? payloadOutput?.files
@@ -9033,44 +8527,44 @@ function getFileChangeRenderData(call) {
9033
8527
  if (fromContentDiff.length > 0) {
9034
8528
  return fromContentDiff;
9035
8529
  }
9036
- const inputPath = firstString4(
9037
- stringValue8(call.input?.file_path),
9038
- stringValue8(call.input?.filePath),
9039
- stringValue8(call.input?.path),
9040
- stringValue8(payloadInput?.file_path),
9041
- stringValue8(payloadInput?.filePath),
9042
- stringValue8(payloadInput?.path),
8530
+ const inputPath = firstString3(
8531
+ stringValue7(call.input?.file_path),
8532
+ stringValue7(call.input?.filePath),
8533
+ stringValue7(call.input?.path),
8534
+ stringValue7(payloadInput?.file_path),
8535
+ stringValue7(payloadInput?.filePath),
8536
+ stringValue7(payloadInput?.path),
9043
8537
  firstLocationPath2(inputLocations)
9044
8538
  );
9045
- const unifiedDiff = firstString4(
9046
- stringValue8(call.output?.patch),
9047
- stringValue8(payloadOutput?.patch),
9048
- stringValue8(call.output?.diff),
9049
- stringValue8(payloadOutput?.diff)
8539
+ const unifiedDiff = firstString3(
8540
+ stringValue7(call.output?.patch),
8541
+ stringValue7(payloadOutput?.patch),
8542
+ stringValue7(call.output?.diff),
8543
+ stringValue7(payloadOutput?.diff)
9050
8544
  );
9051
- const path = firstString4(
8545
+ const path = firstString3(
9052
8546
  inputPath,
9053
8547
  unifiedDiff ? extractAgentPatchPath(unifiedDiff) : null
9054
8548
  );
9055
8549
  if (!path) {
9056
8550
  return [];
9057
8551
  }
9058
- const content = firstString4(
9059
- stringValue8(call.input?.content),
9060
- stringValue8(payloadInput?.content),
9061
- stringValue8(rawInput?.content)
8552
+ const content = firstString3(
8553
+ stringValue7(call.input?.content),
8554
+ stringValue7(payloadInput?.content),
8555
+ stringValue7(rawInput?.content)
9062
8556
  );
9063
- const oldString = firstString4(
9064
- stringValue8(call.input?.old_string),
9065
- stringValue8(payloadInput?.old_string),
9066
- stringValue8(call.output?.oldString),
9067
- stringValue8(payloadOutput?.oldString)
8557
+ const oldString = firstString3(
8558
+ stringValue7(call.input?.old_string),
8559
+ stringValue7(payloadInput?.old_string),
8560
+ stringValue7(call.output?.oldString),
8561
+ stringValue7(payloadOutput?.oldString)
9068
8562
  );
9069
- const newString = firstString4(
9070
- stringValue8(call.input?.new_string),
9071
- stringValue8(payloadInput?.new_string),
9072
- stringValue8(call.output?.newString),
9073
- stringValue8(payloadOutput?.newString)
8563
+ const newString = firstString3(
8564
+ stringValue7(call.input?.new_string),
8565
+ stringValue7(payloadInput?.new_string),
8566
+ stringValue7(call.output?.newString),
8567
+ stringValue7(payloadOutput?.newString)
9074
8568
  );
9075
8569
  const changeType = inferFileChangeType(
9076
8570
  call.toolName,
@@ -9107,33 +8601,33 @@ function structuredPatchFiles(value) {
9107
8601
  return [];
9108
8602
  }
9109
8603
  return patches.flatMap((item) => {
9110
- const patch = recordValue5(item);
9111
- const path = firstString4(
9112
- stringValue8(patch?.filePath),
9113
- stringValue8(patch?.path)
8604
+ const patch = recordValue4(item);
8605
+ const path = firstString3(
8606
+ stringValue7(patch?.filePath),
8607
+ stringValue7(patch?.path)
9114
8608
  );
9115
- const diff = firstString4(
9116
- stringValue8(patch?.diff),
9117
- stringValue8(patch?.patch)
8609
+ const diff = firstString3(
8610
+ stringValue7(patch?.diff),
8611
+ stringValue7(patch?.patch)
9118
8612
  );
9119
8613
  if (!path) {
9120
8614
  return [];
9121
8615
  }
9122
- const oldString = firstString4(
9123
- stringValue8(patch?.oldString),
9124
- stringValue8(patch?.old_string)
8616
+ const oldString = firstString3(
8617
+ stringValue7(patch?.oldString),
8618
+ stringValue7(patch?.old_string)
9125
8619
  );
9126
- const newString = firstString4(
9127
- stringValue8(patch?.newString),
9128
- stringValue8(patch?.new_string)
8620
+ const newString = firstString3(
8621
+ stringValue7(patch?.newString),
8622
+ stringValue7(patch?.new_string)
9129
8623
  );
9130
- const content = firstString4(stringValue8(patch?.content), newString);
8624
+ const content = firstString3(stringValue7(patch?.content), newString);
9131
8625
  if (!diff && !oldString && !newString && !content) {
9132
8626
  return [];
9133
8627
  }
9134
8628
  const changeType = firstKnownChangeType(
9135
- normalizeChangeType2(stringValue8(patch?.kind)),
9136
- normalizeChangeType2(stringValue8(patch?.change)),
8629
+ normalizeChangeType2(stringValue7(patch?.kind)),
8630
+ normalizeChangeType2(stringValue7(patch?.change)),
9137
8631
  inferFileChangeType(null, diff, content, oldString, newString)
9138
8632
  );
9139
8633
  const stats = fileChangeStats(
@@ -9159,7 +8653,7 @@ function structuredPatchFiles(value) {
9159
8653
  });
9160
8654
  }
9161
8655
  function detailedDiffFiles(value) {
9162
- const diff = stringValue8(value);
8656
+ const diff = stringValue7(value);
9163
8657
  if (!diff) {
9164
8658
  return [];
9165
8659
  }
@@ -9184,35 +8678,35 @@ function detailedDiffFiles(value) {
9184
8678
  ];
9185
8679
  }
9186
8680
  function fileChangesFiles(value) {
9187
- const record = recordValue5(value);
8681
+ const record = recordValue4(value);
9188
8682
  const files = arrayValue6(record?.files);
9189
8683
  if (!files) {
9190
8684
  return [];
9191
8685
  }
9192
8686
  return files.flatMap((item) => {
9193
- const file = recordValue5(item);
9194
- const path = stringValue8(file?.path);
8687
+ const file = recordValue4(item);
8688
+ const path = stringValue7(file?.path);
9195
8689
  if (!path) {
9196
8690
  return [];
9197
8691
  }
9198
- const unifiedDiff = firstString4(
9199
- stringValue8(file?.diff),
9200
- stringValue8(file?.patch),
9201
- stringValue8(file?.unifiedDiff),
9202
- stringValue8(file?.unified_diff)
8692
+ const unifiedDiff = firstString3(
8693
+ stringValue7(file?.diff),
8694
+ stringValue7(file?.patch),
8695
+ stringValue7(file?.unifiedDiff),
8696
+ stringValue7(file?.unified_diff)
9203
8697
  );
9204
- const oldString = firstString4(
9205
- stringValue8(file?.oldString),
9206
- stringValue8(file?.old_string)
8698
+ const oldString = firstString3(
8699
+ stringValue7(file?.oldString),
8700
+ stringValue7(file?.old_string)
9207
8701
  );
9208
- const newString = firstString4(
9209
- stringValue8(file?.newString),
9210
- stringValue8(file?.new_string)
8702
+ const newString = firstString3(
8703
+ stringValue7(file?.newString),
8704
+ stringValue7(file?.new_string)
9211
8705
  );
9212
- const content = firstString4(stringValue8(file?.content), newString);
8706
+ const content = firstString3(stringValue7(file?.content), newString);
9213
8707
  const changeType = firstKnownChangeType(
9214
- normalizeChangeType2(stringValue8(file?.change)),
9215
- normalizeChangeType2(stringValue8(file?.kind)),
8708
+ normalizeChangeType2(stringValue7(file?.change)),
8709
+ normalizeChangeType2(stringValue7(file?.kind)),
9216
8710
  inferFileChangeType(null, unifiedDiff, content, oldString, newString)
9217
8711
  );
9218
8712
  const stats = fileChangeStats(
@@ -9244,21 +8738,21 @@ function changeMapFiles(value) {
9244
8738
  if (!normalizedPath) {
9245
8739
  return [];
9246
8740
  }
9247
- const unifiedDiff = firstString4(
9248
- stringValue8(change.unified_diff),
9249
- stringValue8(change.unifiedDiff),
9250
- stringValue8(change.diff),
9251
- stringValue8(change.patch)
8741
+ const unifiedDiff = firstString3(
8742
+ stringValue7(change.unified_diff),
8743
+ stringValue7(change.unifiedDiff),
8744
+ stringValue7(change.diff),
8745
+ stringValue7(change.patch)
9252
8746
  );
9253
- const explicitContent = stringValue8(change.content);
8747
+ const explicitContent = stringValue7(change.content);
9254
8748
  const normalizedType = normalizeChangeType2(fileChangeTypeValue(change));
9255
- let oldString = firstString4(
9256
- stringValue8(change.old_string),
9257
- stringValue8(change.oldString)
8749
+ let oldString = firstString3(
8750
+ stringValue7(change.old_string),
8751
+ stringValue7(change.oldString)
9258
8752
  );
9259
- let newString = firstString4(
9260
- stringValue8(change.new_string),
9261
- stringValue8(change.newString),
8753
+ let newString = firstString3(
8754
+ stringValue7(change.new_string),
8755
+ stringValue7(change.newString),
9262
8756
  explicitContent
9263
8757
  );
9264
8758
  if (normalizedType === "created" && oldString === null && newString !== null) {
@@ -9271,7 +8765,7 @@ function changeMapFiles(value) {
9271
8765
  if (normalizedType === "deleted" && newString === null && oldString !== null) {
9272
8766
  newString = "";
9273
8767
  }
9274
- const content = firstString4(
8768
+ const content = firstString3(
9275
8769
  normalizedType === "deleted" ? null : explicitContent,
9276
8770
  normalizedType === "created" ? newString : null
9277
8771
  );
@@ -9317,40 +8811,40 @@ function contentDiffFiles(value, changesValue, toolName) {
9317
8811
  ])
9318
8812
  );
9319
8813
  return items.flatMap((item) => {
9320
- const record = recordValue5(item);
8814
+ const record = recordValue4(item);
9321
8815
  if (!record) {
9322
8816
  return [];
9323
8817
  }
9324
- const type = stringValue8(record.type);
8818
+ const type = stringValue7(record.type);
9325
8819
  if (type && type !== "diff") {
9326
8820
  return [];
9327
8821
  }
9328
- const path = stringValue8(record.path);
8822
+ const path = stringValue7(record.path);
9329
8823
  if (!path) {
9330
8824
  return [];
9331
8825
  }
9332
8826
  const relatedChange = changesByPath.get(path) ?? null;
9333
- const unifiedDiff = firstString4(
9334
- stringValue8(record.diff),
9335
- stringValue8(record.patch),
9336
- stringValue8(relatedChange?.unified_diff),
9337
- stringValue8(relatedChange?.unifiedDiff)
8827
+ const unifiedDiff = firstString3(
8828
+ stringValue7(record.diff),
8829
+ stringValue7(record.patch),
8830
+ stringValue7(relatedChange?.unified_diff),
8831
+ stringValue7(relatedChange?.unifiedDiff)
9338
8832
  );
9339
8833
  const normalizedType = normalizeChangeType2(
9340
8834
  relatedChange ? fileChangeTypeValue(relatedChange) : null
9341
8835
  );
9342
- let oldString = firstString4(
9343
- stringValue8(record.oldText),
9344
- stringValue8(record.oldString),
9345
- stringValue8(relatedChange?.old_string),
9346
- stringValue8(relatedChange?.oldString)
8836
+ let oldString = firstString3(
8837
+ stringValue7(record.oldText),
8838
+ stringValue7(record.oldString),
8839
+ stringValue7(relatedChange?.old_string),
8840
+ stringValue7(relatedChange?.oldString)
9347
8841
  );
9348
- let newString = firstString4(
9349
- stringValue8(record.newText),
9350
- stringValue8(record.newString),
9351
- stringValue8(relatedChange?.new_string),
9352
- stringValue8(relatedChange?.newString),
9353
- stringValue8(relatedChange?.content)
8842
+ let newString = firstString3(
8843
+ stringValue7(record.newText),
8844
+ stringValue7(record.newString),
8845
+ stringValue7(relatedChange?.new_string),
8846
+ stringValue7(relatedChange?.newString),
8847
+ stringValue7(relatedChange?.content)
9354
8848
  );
9355
8849
  if (normalizedType === "created" && oldString === null && newString !== null) {
9356
8850
  oldString = "";
@@ -9362,9 +8856,9 @@ function contentDiffFiles(value, changesValue, toolName) {
9362
8856
  if (normalizedType === "deleted" && newString === null && oldString !== null) {
9363
8857
  newString = "";
9364
8858
  }
9365
- const explicitContent = firstString4(
9366
- stringValue8(record.content),
9367
- stringValue8(relatedChange?.content)
8859
+ const explicitContent = firstString3(
8860
+ stringValue7(record.content),
8861
+ stringValue7(relatedChange?.content)
9368
8862
  );
9369
8863
  const changeType = firstKnownChangeType(
9370
8864
  normalizedType,
@@ -9379,7 +8873,7 @@ function contentDiffFiles(value, changesValue, toolName) {
9379
8873
  if (changeType === "created" && oldString === null && newString !== null) {
9380
8874
  oldString = "";
9381
8875
  }
9382
- const content = firstString4(
8876
+ const content = firstString3(
9383
8877
  changeType === "deleted" ? null : explicitContent,
9384
8878
  changeType === "created" ? newString : null
9385
8879
  );
@@ -9559,7 +9053,7 @@ function languageForPath(path) {
9559
9053
  function normalizeToolName7(value) {
9560
9054
  return (value ?? "").trim().replace(/[_\s-]+/g, "").toLowerCase();
9561
9055
  }
9562
- function firstString4(...values) {
9056
+ function firstString3(...values) {
9563
9057
  for (const value of values) {
9564
9058
  if (typeof value === "string" && value.trim()) {
9565
9059
  return value.trim();
@@ -9567,7 +9061,7 @@ function firstString4(...values) {
9567
9061
  }
9568
9062
  return null;
9569
9063
  }
9570
- function recordValue5(value) {
9064
+ function recordValue4(value) {
9571
9065
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
9572
9066
  }
9573
9067
  function arrayValue6(value) {
@@ -9578,42 +9072,42 @@ function firstLocationPath2(value) {
9578
9072
  return null;
9579
9073
  }
9580
9074
  for (const item of value) {
9581
- const record = recordValue5(item);
9582
- const path = stringValue8(record?.path);
9075
+ const record = recordValue4(item);
9076
+ const path = stringValue7(record?.path);
9583
9077
  if (path) {
9584
9078
  return path;
9585
9079
  }
9586
9080
  }
9587
9081
  return null;
9588
9082
  }
9589
- function stringValue8(value) {
9083
+ function stringValue7(value) {
9590
9084
  return typeof value === "string" && value.trim() ? value.trim() : null;
9591
9085
  }
9592
9086
 
9593
9087
  // shared/agentConversation/components/tool-renderers/render-data/agentToolRenderData.ts
9594
9088
  function getCommandRenderData(call) {
9595
- const inputRawInput = recordValue6(call.input?.rawInput);
9596
- const payloadInput = recordValue6(call.payload?.input);
9597
- const payloadInputRawInput = recordValue6(payloadInput?.rawInput);
9598
- const outputRawOutput = recordValue6(call.output?.rawOutput);
9599
- const errorRawOutput = recordValue6(call.error?.rawOutput);
9089
+ const inputRawInput = recordValue5(call.input?.rawInput);
9090
+ const payloadInput = recordValue5(call.payload?.input);
9091
+ const payloadInputRawInput = recordValue5(payloadInput?.rawInput);
9092
+ const outputRawOutput = recordValue5(call.output?.rawOutput);
9093
+ const errorRawOutput = recordValue5(call.error?.rawOutput);
9600
9094
  return {
9601
- command: firstString5(
9602
- stringValue9(call.input?.command),
9603
- stringValue9(call.input?.cmd),
9095
+ command: firstString4(
9096
+ stringValue8(call.input?.command),
9097
+ stringValue8(call.input?.cmd),
9604
9098
  commandArrayToString(call.input?.command),
9605
- stringValue9(inputRawInput?.command),
9606
- stringValue9(inputRawInput?.cmd),
9607
- stringValue9(call.payload?.command),
9608
- stringValue9(payloadInput?.command),
9609
- stringValue9(payloadInputRawInput?.command),
9610
- stringValue9(payloadInputRawInput?.cmd)
9099
+ stringValue8(inputRawInput?.command),
9100
+ stringValue8(inputRawInput?.cmd),
9101
+ stringValue8(call.payload?.command),
9102
+ stringValue8(payloadInput?.command),
9103
+ stringValue8(payloadInputRawInput?.command),
9104
+ stringValue8(payloadInputRawInput?.cmd)
9611
9105
  ),
9612
- cwd: firstString5(
9613
- stringValue9(call.input?.cwd),
9614
- stringValue9(inputRawInput?.cwd),
9615
- stringValue9(payloadInput?.cwd),
9616
- stringValue9(payloadInputRawInput?.cwd)
9106
+ cwd: firstString4(
9107
+ stringValue8(call.input?.cwd),
9108
+ stringValue8(inputRawInput?.cwd),
9109
+ stringValue8(payloadInput?.cwd),
9110
+ stringValue8(payloadInputRawInput?.cwd)
9617
9111
  ),
9618
9112
  stdout: firstRawString(
9619
9113
  rawStringValue(call.output?.stdout),
@@ -9648,42 +9142,42 @@ function getCommandRenderData(call) {
9648
9142
  function getSearchRenderData(call) {
9649
9143
  const canonicalContent = contentText(call.content);
9650
9144
  const canonicalFiles = locationPaths(call.locations);
9651
- const output = firstString5(
9145
+ const output = firstString4(
9652
9146
  canonicalContent,
9653
9147
  contentText(call.output?.content),
9654
- stringValue9(call.output?.content),
9655
- stringValue9(call.output?.output),
9656
- stringValue9(call.output?.aggregated_output),
9657
- stringValue9(call.output?.formatted_output),
9658
- stringValue9(call.output?.stdout),
9659
- stringValue9(call.summary),
9148
+ stringValue8(call.output?.content),
9149
+ stringValue8(call.output?.output),
9150
+ stringValue8(call.output?.aggregated_output),
9151
+ stringValue8(call.output?.formatted_output),
9152
+ stringValue8(call.output?.stdout),
9153
+ stringValue8(call.summary),
9660
9154
  ""
9661
9155
  ) ?? "";
9662
9156
  const outputLines = output.split("\n").filter(Boolean);
9663
9157
  const mode = canonicalFiles.length > 0 && !output ? "list_files" : searchMode(call.output, output);
9664
9158
  const filenames = canonicalFiles.length > 0 ? canonicalFiles : stringArray(call.output?.filenames);
9665
9159
  return {
9666
- query: firstString5(
9667
- stringValue9(call.input?.pattern),
9668
- stringValue9(call.input?.query),
9669
- stringValue9(call.input?.search_query),
9670
- stringValue9(call.input?.searchQuery),
9671
- stringValue9(call.input?.glob)
9160
+ query: firstString4(
9161
+ stringValue8(call.input?.pattern),
9162
+ stringValue8(call.input?.query),
9163
+ stringValue8(call.input?.search_query),
9164
+ stringValue8(call.input?.searchQuery),
9165
+ stringValue8(call.input?.glob)
9672
9166
  ),
9673
- scope: firstString5(
9674
- stringValue9(call.input?.path),
9675
- stringValue9(call.input?.file_path),
9676
- stringValue9(call.input?.glob)
9167
+ scope: firstString4(
9168
+ stringValue8(call.input?.path),
9169
+ stringValue8(call.input?.file_path),
9170
+ stringValue8(call.input?.glob)
9677
9171
  ),
9678
9172
  mode,
9679
9173
  files: filenames.length > 0 ? filenames : mode === "list_files" ? outputLines : [],
9680
9174
  lines: outputLines,
9681
9175
  output,
9682
- error: firstString5(
9683
- stringValue9(call.error?.aggregated_output),
9684
- stringValue9(call.error?.stdout),
9685
- stringValue9(call.error?.formatted_output),
9686
- stringValue9(call.error?.message)
9176
+ error: firstString4(
9177
+ stringValue8(call.error?.aggregated_output),
9178
+ stringValue8(call.error?.stdout),
9179
+ stringValue8(call.error?.formatted_output),
9180
+ stringValue8(call.error?.message)
9687
9181
  ) ?? ""
9688
9182
  };
9689
9183
  }
@@ -9691,45 +9185,45 @@ function getWebSearchRenderData(call) {
9691
9185
  const queries = normalizedQueries(
9692
9186
  call.input?.search_query,
9693
9187
  call.input?.searchQuery,
9694
- recordValue6(call.input?.action)?.search_query,
9695
- recordValue6(call.input?.action)?.searchQuery
9188
+ recordValue5(call.input?.action)?.search_query,
9189
+ recordValue5(call.input?.action)?.searchQuery
9696
9190
  );
9697
9191
  return {
9698
- query: firstString5(
9699
- stringValue9(call.input?.query),
9700
- stringValue9(recordValue6(call.input?.action)?.query),
9192
+ query: firstString4(
9193
+ stringValue8(call.input?.query),
9194
+ stringValue8(recordValue5(call.input?.action)?.query),
9701
9195
  queries[0] ?? null
9702
9196
  ),
9703
9197
  queries,
9704
- url: firstString5(
9705
- stringValue9(call.input?.url),
9706
- stringValue9(recordValue6(call.input?.action)?.url)
9198
+ url: firstString4(
9199
+ stringValue8(call.input?.url),
9200
+ stringValue8(recordValue5(call.input?.action)?.url)
9707
9201
  ),
9708
- output: firstString5(
9709
- stringValue9(call.output?.text),
9202
+ output: firstString4(
9203
+ stringValue8(call.output?.text),
9710
9204
  contentText(call.content),
9711
9205
  contentText(call.output?.content),
9712
- stringValue9(call.output?.stdout),
9713
- stringValue9(call.output?.output),
9714
- stringValue9(call.output?.content)
9206
+ stringValue8(call.output?.stdout),
9207
+ stringValue8(call.output?.output),
9208
+ stringValue8(call.output?.content)
9715
9209
  ) ?? "",
9716
- error: firstString5(
9717
- stringValue9(call.error?.message),
9718
- stringValue9(call.error?.stdout)
9210
+ error: firstString4(
9211
+ stringValue8(call.error?.message),
9212
+ stringValue8(call.error?.stdout)
9719
9213
  ) ?? ""
9720
9214
  };
9721
9215
  }
9722
9216
  function getWebFetchRenderData(call, maxContentLength = 3e3) {
9723
- const url = firstString5(
9724
- stringValue9(call.input?.url),
9725
- stringValue9(recordValue6(call.input?.action)?.url)
9217
+ const url = firstString4(
9218
+ stringValue8(call.input?.url),
9219
+ stringValue8(recordValue5(call.input?.action)?.url)
9726
9220
  );
9727
- const content = firstString5(
9221
+ const content = firstString4(
9728
9222
  contentText(call.content),
9729
9223
  contentText(call.output?.content),
9730
- stringValue9(call.output?.output),
9731
- stringValue9(call.output?.content),
9732
- stringValue9(call.output?.stdout)
9224
+ stringValue8(call.output?.output),
9225
+ stringValue8(call.output?.content),
9226
+ stringValue8(call.output?.stdout)
9733
9227
  );
9734
9228
  return {
9735
9229
  url,
@@ -9745,21 +9239,21 @@ function getTodoRenderData(call) {
9745
9239
  return [];
9746
9240
  }
9747
9241
  return todos.flatMap((todo) => {
9748
- const record = recordValue6(todo);
9749
- const content = firstString5(
9750
- stringValue9(record?.content),
9751
- stringValue9(record?.text)
9242
+ const record = recordValue5(todo);
9243
+ const content = firstString4(
9244
+ stringValue8(record?.content),
9245
+ stringValue8(record?.text)
9752
9246
  );
9753
9247
  if (!content) {
9754
9248
  return [];
9755
9249
  }
9756
- return [{ content, status: stringValue9(record?.status) }];
9250
+ return [{ content, status: stringValue8(record?.status) }];
9757
9251
  });
9758
9252
  }
9759
9253
  function getToolSearchRenderData(call) {
9760
- const query = stringValue9(call.input?.query);
9761
- const matches = arrayValue7(call.output?.matches)?.map(stringValue9).filter((value) => value !== null) ?? [];
9762
- const totalDeferredTools = numberValue3(call.output?.total_deferred_tools) ?? numberValue3(call.output?.totalDeferredTools) ?? numberValue3(recordValue6(call.payload?.output)?.total_deferred_tools);
9254
+ const query = stringValue8(call.input?.query);
9255
+ const matches = arrayValue7(call.output?.matches)?.map(stringValue8).filter((value) => value !== null) ?? [];
9256
+ const totalDeferredTools = numberValue3(call.output?.total_deferred_tools) ?? numberValue3(call.output?.totalDeferredTools) ?? numberValue3(recordValue5(call.payload?.output)?.total_deferred_tools);
9763
9257
  const mode = query?.startsWith("select:") ? "direct" : "search";
9764
9258
  const displayQuery = query?.startsWith("select:") ? query.slice("select:".length) : query?.startsWith("+") ? query.slice(1) : query;
9765
9259
  return {
@@ -9771,22 +9265,22 @@ function getToolSearchRenderData(call) {
9771
9265
  };
9772
9266
  }
9773
9267
  function getPlanModeRenderData(call) {
9774
- const enterText = call.rendererKind === "plan-enter" ? firstString5(
9775
- stringValue9(call.planMode?.plan),
9776
- stringValue9(call.output?.text),
9777
- stringValue9(call.input?.content),
9268
+ const enterText = call.rendererKind === "plan-enter" ? firstString4(
9269
+ stringValue8(call.planMode?.plan),
9270
+ stringValue8(call.output?.text),
9271
+ stringValue8(call.input?.content),
9778
9272
  nonEmpty(call.summary),
9779
9273
  "Exploring codebase and designing implementation approach."
9780
9274
  ) : null;
9781
- const filePath = firstString5(
9782
- stringValue9(call.input?.filePath),
9783
- stringValue9(call.input?.file_path)
9275
+ const filePath = firstString4(
9276
+ stringValue8(call.input?.filePath),
9277
+ stringValue8(call.input?.file_path)
9784
9278
  );
9785
9279
  return {
9786
9280
  enterText,
9787
- plan: call.rendererKind === "plan-enter" ? null : firstString5(
9788
- stringValue9(call.input?.plan),
9789
- stringValue9(call.payload?.plan),
9281
+ plan: call.rendererKind === "plan-enter" ? null : firstString4(
9282
+ stringValue8(call.input?.plan),
9283
+ stringValue8(call.payload?.plan),
9790
9284
  nonEmpty(call.summary)
9791
9285
  ),
9792
9286
  filePath,
@@ -9796,51 +9290,51 @@ function getPlanModeRenderData(call) {
9796
9290
  function getTaskRenderData(call) {
9797
9291
  const task = call.task;
9798
9292
  const steps = task?.steps ?? normalizeTaskStepsFromCall(call);
9799
- const outputRawOutput = recordValue6(call.output?.rawOutput);
9800
- const errorRawOutput = recordValue6(call.error?.rawOutput);
9293
+ const outputRawOutput = recordValue5(call.output?.rawOutput);
9294
+ const errorRawOutput = recordValue5(call.error?.rawOutput);
9801
9295
  return {
9802
9296
  title: task?.title ?? call.name,
9803
- status: task?.status ?? stringValue9(call.metadata?.taskStatus) ?? stringValue9(call.metadata?.subagentStatus),
9297
+ status: task?.status ?? stringValue8(call.metadata?.taskStatus) ?? stringValue8(call.metadata?.subagentStatus),
9804
9298
  durationText: typeof task?.durationMs === "number" && Number.isFinite(task.durationMs) ? formatDuration(task.durationMs) : null,
9805
9299
  latestStepSummary: task?.status === "running" ? steps.at(-1)?.summary ?? null : null,
9806
- prompt: firstString5(
9807
- stringValue9(task?.prompt),
9808
- stringValue9(call.input?.prompt),
9809
- stringValue9(call.input?.description),
9810
- stringValue9(call.payload?.description)
9300
+ prompt: firstString4(
9301
+ stringValue8(task?.prompt),
9302
+ stringValue8(call.input?.prompt),
9303
+ stringValue8(call.input?.description),
9304
+ stringValue8(call.payload?.description)
9811
9305
  ),
9812
- childSessionId: firstString5(
9813
- stringValue9(task?.delegateSessionId),
9814
- stringValue9(call.metadata?.childSessionID),
9815
- stringValue9(call.metadata?.child_session_id),
9816
- stringValue9(call.metadata?.subagentSessionID),
9817
- stringValue9(call.metadata?.subagent_session_id),
9818
- stringValue9(call.metadata?.subagentAgentId),
9819
- stringValue9(call.metadata?.agentId)
9306
+ childSessionId: firstString4(
9307
+ stringValue8(task?.delegateSessionId),
9308
+ stringValue8(call.metadata?.childSessionID),
9309
+ stringValue8(call.metadata?.child_session_id),
9310
+ stringValue8(call.metadata?.subagentSessionID),
9311
+ stringValue8(call.metadata?.subagent_session_id),
9312
+ stringValue8(call.metadata?.subagentAgentId),
9313
+ stringValue8(call.metadata?.agentId)
9820
9314
  ),
9821
9315
  steps,
9822
- resultMarkdown: firstString5(
9823
- stringValue9(task?.resultMarkdown),
9316
+ resultMarkdown: firstString4(
9317
+ stringValue8(task?.resultMarkdown),
9824
9318
  firstNonEmptyStructuredText(call.output, outputRawOutput)
9825
9319
  ),
9826
9320
  errorMarkdown: firstNonEmptyStructuredText(call.error, errorRawOutput)
9827
9321
  };
9828
9322
  }
9829
9323
  function getSkillRenderData(call) {
9830
- const inputRawInput = recordValue6(call.input?.rawInput);
9324
+ const inputRawInput = recordValue5(call.input?.rawInput);
9831
9325
  const outputRawOutput = call.output?.rawOutput;
9832
- const success = booleanValue(call.output?.success) ?? legacySkillSuccess(outputRawOutput) ?? booleanValue(recordValue6(outputRawOutput)?.success);
9326
+ const success = booleanValue(call.output?.success) ?? legacySkillSuccess(outputRawOutput) ?? booleanValue(recordValue5(outputRawOutput)?.success);
9833
9327
  return {
9834
- skill: firstString5(
9835
- stringValue9(call.input?.skill),
9836
- stringValue9(inputRawInput?.skill),
9837
- stringValue9(call.output?.commandName),
9838
- stringValue9(recordValue6(outputRawOutput)?.commandName),
9328
+ skill: firstString4(
9329
+ stringValue8(call.input?.skill),
9330
+ stringValue8(inputRawInput?.skill),
9331
+ stringValue8(call.output?.commandName),
9332
+ stringValue8(recordValue5(outputRawOutput)?.commandName),
9839
9333
  nonEmpty(call.summary)
9840
9334
  ),
9841
- args: firstString5(
9842
- stringValue9(call.input?.args),
9843
- stringValue9(inputRawInput?.args)
9335
+ args: firstString4(
9336
+ stringValue8(call.input?.args),
9337
+ stringValue8(inputRawInput?.args)
9844
9338
  ),
9845
9339
  success,
9846
9340
  statusText: success === null ? null : success ? "Skill loaded" : "Failed to load skill"
@@ -9853,7 +9347,7 @@ function getImageGenerationRenderData(call) {
9853
9347
  content: call.content,
9854
9348
  outputContent: call.output?.content,
9855
9349
  inputPrompt: call.input?.prompt,
9856
- payloadInputPrompt: recordValue6(call.payload?.input)?.prompt
9350
+ payloadInputPrompt: recordValue5(call.payload?.input)?.prompt
9857
9351
  });
9858
9352
  return {
9859
9353
  prompt: preview.prompt,
@@ -9885,31 +9379,31 @@ function getToolFallbackText(call) {
9885
9379
  function normalizeTaskStepsFromCall(call) {
9886
9380
  const steps = arrayValue7(call.metadata?.steps) ?? arrayValue7(call.output?.steps) ?? arrayValue7(call.payload?.steps) ?? [];
9887
9381
  return steps.flatMap((value, index) => {
9888
- const step = recordValue6(value);
9382
+ const step = recordValue5(value);
9889
9383
  if (!step) {
9890
9384
  return [];
9891
9385
  }
9892
- const toolName = stringValue9(step.toolName) ?? stringValue9(step.tool_name) ?? stringValue9(step.name) ?? null;
9386
+ const toolName = stringValue8(step.toolName) ?? stringValue8(step.tool_name) ?? stringValue8(step.name) ?? null;
9893
9387
  const name = toolName ? humanizeToolName2(toolName) : `Step ${index + 1}`;
9894
- const status = stringValue9(step.status) ?? stringValue9(recordValue6(step.toolResult)?.status) ?? stringValue9(recordValue6(step.tool_result)?.status) ?? null;
9388
+ const status = stringValue8(step.status) ?? stringValue8(recordValue5(step.toolResult)?.status) ?? stringValue8(recordValue5(step.tool_result)?.status) ?? null;
9895
9389
  const summary = firstNonEmptyStructuredText(
9896
- recordValue6(step.toolResult),
9897
- recordValue6(step.tool_result),
9898
- recordValue6(step.toolInput),
9899
- recordValue6(step.tool_input)
9390
+ recordValue5(step.toolResult),
9391
+ recordValue5(step.tool_result),
9392
+ recordValue5(step.toolInput),
9393
+ recordValue5(step.tool_input)
9900
9394
  ) ?? "";
9901
9395
  return [
9902
9396
  {
9903
- id: stringValue9(step.toolUseId) ?? stringValue9(step.id) ?? `step-${index + 1}`,
9397
+ id: stringValue8(step.toolUseId) ?? stringValue8(step.id) ?? `step-${index + 1}`,
9904
9398
  turnId: call.turnId,
9905
9399
  name,
9906
9400
  toolName,
9907
9401
  status,
9908
9402
  summary,
9909
9403
  payload: {
9910
- input: recordValue6(step.toolInput) ?? recordValue6(step.tool_input),
9911
- output: recordValue6(step.toolResult) ?? recordValue6(step.tool_result),
9912
- error: recordValue6(step.toolError) ?? recordValue6(step.tool_error)
9404
+ input: recordValue5(step.toolInput) ?? recordValue5(step.tool_input),
9405
+ output: recordValue5(step.toolResult) ?? recordValue5(step.tool_result),
9406
+ error: recordValue5(step.toolError) ?? recordValue5(step.tool_error)
9913
9407
  },
9914
9408
  tool: null,
9915
9409
  occurredAtUnixMs: null
@@ -9973,7 +9467,7 @@ function normalizeCommandStatus(value) {
9973
9467
  }
9974
9468
  }
9975
9469
  function searchMode(output, outputText) {
9976
- const mode = stringValue9(output?.mode);
9470
+ const mode = stringValue8(output?.mode);
9977
9471
  if (mode === "files_with_matches" || mode === "content" || mode === "count" || mode === "list_files") {
9978
9472
  return mode;
9979
9473
  }
@@ -9996,7 +9490,7 @@ function commandArrayToString(value) {
9996
9490
  return parts.length > 0 ? parts.join(" ") : null;
9997
9491
  }
9998
9492
  function durationToMs(value) {
9999
- const record = recordValue6(value);
9493
+ const record = recordValue5(value);
10000
9494
  if (!record) {
10001
9495
  return null;
10002
9496
  }
@@ -10013,15 +9507,15 @@ function contentText(value) {
10013
9507
  return null;
10014
9508
  }
10015
9509
  const text = items.flatMap((item) => {
10016
- const record = recordValue6(item);
9510
+ const record = recordValue5(item);
10017
9511
  if (!record) {
10018
9512
  return [];
10019
9513
  }
10020
9514
  return [
10021
- firstString5(
10022
- stringValue9(record.text),
10023
- stringValue9(record.content),
10024
- stringValue9(recordValue6(record.content)?.text)
9515
+ firstString4(
9516
+ stringValue8(record.text),
9517
+ stringValue8(record.content),
9518
+ stringValue8(recordValue5(record.content)?.text)
10025
9519
  )
10026
9520
  ].filter(Boolean);
10027
9521
  }).join("\n").trim();
@@ -10034,38 +9528,38 @@ function structuredText(value) {
10034
9528
  if (typeof value === "number" || typeof value === "boolean") {
10035
9529
  return String(value);
10036
9530
  }
10037
- const record = recordValue6(value);
9531
+ const record = recordValue5(value);
10038
9532
  if (!record) {
10039
9533
  return null;
10040
9534
  }
10041
- const preferred = firstString5(
10042
- stringValue9(record.plan),
10043
- stringValue9(record.text),
10044
- stringValue9(record.output),
10045
- stringValue9(record.content),
9535
+ const preferred = firstString4(
9536
+ stringValue8(record.plan),
9537
+ stringValue8(record.text),
9538
+ stringValue8(record.output),
9539
+ stringValue8(record.content),
10046
9540
  contentText(record.content),
10047
- stringValue9(record.summary),
10048
- stringValue9(record.result),
10049
- stringValue9(record.message),
10050
- stringValue9(record.aggregated_output),
10051
- stringValue9(record.formatted_output),
10052
- stringValue9(record.stdout),
10053
- stringValue9(record.stderr),
10054
- stringValue9(record.query),
10055
- stringValue9(record.path),
10056
- stringValue9(record.file),
10057
- stringValue9(record.filePath),
10058
- stringValue9(record.file_path),
10059
- stringValue9(record.url),
10060
- stringValue9(record.cmd),
10061
- stringValue9(record.command)
9541
+ stringValue8(record.summary),
9542
+ stringValue8(record.result),
9543
+ stringValue8(record.message),
9544
+ stringValue8(record.aggregated_output),
9545
+ stringValue8(record.formatted_output),
9546
+ stringValue8(record.stdout),
9547
+ stringValue8(record.stderr),
9548
+ stringValue8(record.query),
9549
+ stringValue8(record.path),
9550
+ stringValue8(record.file),
9551
+ stringValue8(record.filePath),
9552
+ stringValue8(record.file_path),
9553
+ stringValue8(record.url),
9554
+ stringValue8(record.cmd),
9555
+ stringValue8(record.command)
10062
9556
  );
10063
9557
  if (preferred) {
10064
9558
  return preferred;
10065
9559
  }
10066
9560
  return null;
10067
9561
  }
10068
- function firstString5(...values) {
9562
+ function firstString4(...values) {
10069
9563
  for (const value of values) {
10070
9564
  if (typeof value === "string" && value.trim()) {
10071
9565
  return value.trim();
@@ -10084,13 +9578,13 @@ function firstRawString(...values) {
10084
9578
  function nonEmpty(value) {
10085
9579
  return typeof value === "string" && value.trim() ? value.trim() : null;
10086
9580
  }
10087
- function recordValue6(value) {
9581
+ function recordValue5(value) {
10088
9582
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
10089
9583
  }
10090
9584
  function arrayValue7(value) {
10091
9585
  return Array.isArray(value) ? value : null;
10092
9586
  }
10093
- function stringValue9(value) {
9587
+ function stringValue8(value) {
10094
9588
  return typeof value === "string" && value.trim() ? value.trim() : null;
10095
9589
  }
10096
9590
  function rawStringValue(value) {
@@ -10130,15 +9624,15 @@ function locationPaths(value) {
10130
9624
  return [];
10131
9625
  }
10132
9626
  const paths = locations.flatMap((location) => {
10133
- const record = recordValue6(location);
9627
+ const record = recordValue5(location);
10134
9628
  if (!record) {
10135
9629
  return [];
10136
9630
  }
10137
9631
  return [
10138
- firstString5(
10139
- stringValue9(record.path),
10140
- stringValue9(record.filePath),
10141
- stringValue9(record.file_path)
9632
+ firstString4(
9633
+ stringValue8(record.path),
9634
+ stringValue8(record.filePath),
9635
+ stringValue8(record.file_path)
10142
9636
  )
10143
9637
  ].filter((path) => path !== null);
10144
9638
  });
@@ -11116,9 +10610,9 @@ function AgentReadContent({
11116
10610
  call
11117
10611
  }) {
11118
10612
  "use memo";
11119
- const path = stringValue10(call.input?.path) ?? stringValue10(call.input?.file_path) ?? stringValue10(call.input?.filePath) ?? stringValue10(call.input?.file) ?? null;
10613
+ const path = stringValue9(call.input?.path) ?? stringValue9(call.input?.file_path) ?? stringValue9(call.input?.filePath) ?? stringValue9(call.input?.file) ?? null;
11120
10614
  const file = objectValue6(call.output?.file);
11121
- const outputText = stringValue10(call.output?.text) ?? stringValue10(call.output?.output) ?? contentText2(call.output?.content) ?? stringValue10(call.output?.aggregated_output) ?? stringValue10(call.output?.formatted_output) ?? stringValue10(call.output?.stdout) ?? (!file ? call.summary.trim() || null : null);
10615
+ const outputText = stringValue9(call.output?.text) ?? stringValue9(call.output?.output) ?? contentText2(call.output?.content) ?? stringValue9(call.output?.aggregated_output) ?? stringValue9(call.output?.formatted_output) ?? stringValue9(call.output?.stdout) ?? (!file ? call.summary.trim() || null : null);
11122
10616
  const fileLineRange = fileRange(file);
11123
10617
  const fileTotalLines = numericValue(file?.totalLines);
11124
10618
  return /* @__PURE__ */ jsx29("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--plain", children: outputText ? /* @__PURE__ */ jsx29(
@@ -11163,9 +10657,9 @@ function contentText2(value) {
11163
10657
  const record = item;
11164
10658
  const nestedContent = record.content && typeof record.content === "object" && !Array.isArray(record.content) ? record.content : null;
11165
10659
  return [
11166
- stringValue10(record.text),
11167
- stringValue10(record.content),
11168
- stringValue10(nestedContent?.text)
10660
+ stringValue9(record.text),
10661
+ stringValue9(record.content),
10662
+ stringValue9(nestedContent?.text)
11169
10663
  ].filter((entry) => Boolean(entry));
11170
10664
  }).join("\n").trim();
11171
10665
  return text || null;
@@ -11369,13 +10863,13 @@ function hasWebSearchContent(call) {
11369
10863
  function hasReadContent(call) {
11370
10864
  const file = objectValue6(call.output?.file);
11371
10865
  return Boolean(
11372
- stringValue10(call.output?.text) || stringValue10(call.output?.output) || readContentText(call.output?.content) || stringValue10(call.output?.aggregated_output) || stringValue10(call.output?.formatted_output) || stringValue10(call.output?.stdout) || !file && call.summary.trim() || stringValue10(call.input?.path) || stringValue10(call.input?.file_path) || stringValue10(call.input?.filePath) || stringValue10(call.input?.file) || fileRange(file) || numericValue2(file?.totalLines) !== null
10866
+ stringValue9(call.output?.text) || stringValue9(call.output?.output) || readContentText(call.output?.content) || stringValue9(call.output?.aggregated_output) || stringValue9(call.output?.formatted_output) || stringValue9(call.output?.stdout) || !file && call.summary.trim() || stringValue9(call.input?.path) || stringValue9(call.input?.file_path) || stringValue9(call.input?.filePath) || stringValue9(call.input?.file) || fileRange(file) || numericValue2(file?.totalLines) !== null
11373
10867
  );
11374
10868
  }
11375
10869
  function hasWriteContent(call) {
11376
10870
  const files = getFileChangeRenderData(call);
11377
10871
  return Boolean(
11378
- files.some((file) => file.content || file.unifiedDiff) || files.length === 0 && (call.summary.trim() || stringValue10(call.input?.path) || stringValue10(call.input?.file_path) || stringValue10(call.input?.filePath))
10872
+ files.some((file) => file.content || file.unifiedDiff) || files.length === 0 && (call.summary.trim() || stringValue9(call.input?.path) || stringValue9(call.input?.file_path) || stringValue9(call.input?.filePath))
11379
10873
  );
11380
10874
  }
11381
10875
  function hasEditContent(call) {
@@ -11383,7 +10877,7 @@ function hasEditContent(call) {
11383
10877
  return Boolean(
11384
10878
  files.some(
11385
10879
  (file) => file.unifiedDiff || file.oldString !== null && file.newString !== null || file.content
11386
- ) || files.length === 0 && (stringValue10(call.input?.path) || stringValue10(call.input?.file_path) || stringValue10(call.input?.filePath))
10880
+ ) || files.length === 0 && (stringValue9(call.input?.path) || stringValue9(call.input?.file_path) || stringValue9(call.input?.filePath))
11387
10881
  );
11388
10882
  }
11389
10883
  function readContentText(value) {
@@ -11397,9 +10891,9 @@ function readContentText(value) {
11397
10891
  const record = item;
11398
10892
  const nestedContent = record.content && typeof record.content === "object" && !Array.isArray(record.content) ? record.content : null;
11399
10893
  return [
11400
- stringValue10(record.text),
11401
- stringValue10(record.content),
11402
- stringValue10(nestedContent?.text)
10894
+ stringValue9(record.text),
10895
+ stringValue9(record.content),
10896
+ stringValue9(nestedContent?.text)
11403
10897
  ].filter((entry) => Boolean(entry));
11404
10898
  }).join("\n").trim();
11405
10899
  return text || null;
@@ -11413,7 +10907,7 @@ function objectValue6(value) {
11413
10907
  function arrayValue8(value) {
11414
10908
  return Array.isArray(value) ? value : null;
11415
10909
  }
11416
- function stringValue10(value) {
10910
+ function stringValue9(value) {
11417
10911
  return typeof value === "string" && value.trim() ? value.trim() : null;
11418
10912
  }
11419
10913
  function numericValue2(value) {
@@ -11521,7 +11015,7 @@ function AgentEditContent({
11521
11015
  "use memo";
11522
11016
  const files = getFileChangeRenderData(call);
11523
11017
  const [file] = files;
11524
- const path = file?.path ?? stringValue10(call.input?.path) ?? stringValue10(call.input?.file_path) ?? stringValue10(call.input?.filePath) ?? null;
11018
+ const path = file?.path ?? stringValue9(call.input?.path) ?? stringValue9(call.input?.file_path) ?? stringValue9(call.input?.filePath) ?? null;
11525
11019
  const patchFiles = files.filter((candidate) => candidate.unifiedDiff);
11526
11020
  const diffFiles = files.filter(
11527
11021
  (candidate) => !candidate.unifiedDiff && candidate.oldString !== null && candidate.newString !== null
@@ -11694,13 +11188,13 @@ function normalizeLinks(value, output) {
11694
11188
  const explicitLinks = arrayValue8(value)?.map(optionRecord).filter(
11695
11189
  (candidate) => candidate !== null
11696
11190
  ).flatMap((link) => {
11697
- const url = stringValue10(link.url);
11191
+ const url = stringValue9(link.url);
11698
11192
  if (!url) {
11699
11193
  return [];
11700
11194
  }
11701
11195
  return [
11702
11196
  {
11703
- title: stringValue10(link.title) ?? url,
11197
+ title: stringValue9(link.title) ?? url,
11704
11198
  url,
11705
11199
  domain: domainForUrl2(url)
11706
11200
  }
@@ -11721,13 +11215,13 @@ function normalizeLinks(value, output) {
11721
11215
  const parsed = JSON.parse(linksJson);
11722
11216
  return parsed.flatMap((entry) => {
11723
11217
  const link = optionRecord(entry);
11724
- const url = stringValue10(link?.url);
11218
+ const url = stringValue9(link?.url);
11725
11219
  if (!url) {
11726
11220
  return [];
11727
11221
  }
11728
11222
  return [
11729
11223
  {
11730
- title: stringValue10(link?.title) ?? url,
11224
+ title: stringValue9(link?.title) ?? url,
11731
11225
  url,
11732
11226
  domain: domainForUrl2(url)
11733
11227
  }
@@ -11812,7 +11306,7 @@ function approvalPreviewCall(call) {
11812
11306
  return null;
11813
11307
  }
11814
11308
  const normalizedKind = normalizeToolKind(
11815
- stringValue10(toolCall.kind) ?? stringValue10(toolCall.title) ?? stringValue10(toolCall.toolName)
11309
+ stringValue9(toolCall.kind) ?? stringValue9(toolCall.title) ?? stringValue9(toolCall.toolName)
11816
11310
  );
11817
11311
  const preview = approvalPreviewKindFor(normalizedKind);
11818
11312
  if (!preview) {
@@ -11825,10 +11319,10 @@ function approvalPreviewCall(call) {
11825
11319
  kind: "tool-call",
11826
11320
  id: `${call.id}:approval-preview`,
11827
11321
  turnId: call.turnId,
11828
- name: stringValue10(toolCall.title) ?? call.name,
11322
+ name: stringValue9(toolCall.title) ?? call.name,
11829
11323
  toolName: preview.toolName,
11830
11324
  callType: "tool",
11831
- status: stringValue10(toolCall.status) ?? call.status,
11325
+ status: stringValue9(toolCall.status) ?? call.status,
11832
11326
  statusKind: call.statusKind,
11833
11327
  summary: "",
11834
11328
  compactSummary: null,
@@ -11859,53 +11353,65 @@ function normalizeToolKind(value) {
11859
11353
  // shared/agentConversation/components/tool-renderers/AgentAskUserQuestionContent.tsx
11860
11354
  import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
11861
11355
  function AgentAskUserQuestionContent({
11862
- call
11356
+ call,
11357
+ onLinkClick
11863
11358
  }) {
11864
11359
  "use memo";
11865
11360
  const questions = call.askUserQuestion?.questions ?? [];
11361
+ const outputText = stringValue10(call.output?.text);
11866
11362
  if (questions.length === 0) {
11867
11363
  return null;
11868
11364
  }
11869
- return /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-body", children: /* @__PURE__ */ jsx35(ToolSection, { title: translate("agentHost.agentTool.details.questions"), children: /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: questions.map((question) => {
11870
- const body = question.question || question.header || translate("agentHost.agentTool.details.questionFallback");
11871
- const answer = formatAnswer(question.answer);
11872
- const questionKey = question.id.trim() || `${question.header}:${question.question}:${question.options.map((option) => option.label).join("|")}`;
11873
- return /* @__PURE__ */ jsxs25(
11874
- "div",
11875
- {
11876
- className: "workspace-agents-status-panel__detail-tool-stack-item",
11877
- children: [
11878
- /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-question", children: body }),
11879
- question.options.length > 0 ? /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: question.options.map((option) => /* @__PURE__ */ jsxs25(
11880
- "div",
11881
- {
11882
- className: "workspace-agents-status-panel__detail-tool-stack-item",
11883
- children: [
11884
- /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: option.label }),
11885
- option.description ? /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted", children: option.description }) : null
11886
- ]
11887
- },
11888
- `${questionKey}-option-${option.label}:${option.description}`
11889
- )) }) : null,
11890
- answer ? /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-answer", children: translate("agentHost.agentTool.details.answerPrefix", {
11891
- answer
11892
- }) }) : /* @__PURE__ */ jsxs25("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted inline-flex items-center gap-1.5", children: [
11893
- /* @__PURE__ */ jsx35(
11894
- MessageSquareMoreIcon,
11365
+ return /* @__PURE__ */ jsxs25("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
11366
+ /* @__PURE__ */ jsx35(ToolSection, { title: translate("agentHost.agentTool.details.questions"), children: /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: questions.map((question) => {
11367
+ const body = question.question || question.header || translate("agentHost.agentTool.details.questionFallback");
11368
+ const answer = formatAnswer(question.answer);
11369
+ const questionKey = question.id.trim() || `${question.header}:${question.question}:${question.options.map((option) => option.label).join("|")}`;
11370
+ return /* @__PURE__ */ jsxs25(
11371
+ "div",
11372
+ {
11373
+ className: "workspace-agents-status-panel__detail-tool-stack-item",
11374
+ children: [
11375
+ /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-question", children: body }),
11376
+ question.options.length > 0 ? /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-stack", children: question.options.map((option) => /* @__PURE__ */ jsxs25(
11377
+ "div",
11895
11378
  {
11896
- size: 14,
11897
- active: true,
11898
- "aria-hidden": "true",
11899
- className: "shrink-0"
11900
- }
11901
- ),
11902
- translate("agentHost.agentTool.details.waitingForAnswer")
11903
- ] })
11904
- ]
11905
- },
11906
- questionKey
11907
- );
11908
- }) }) }) });
11379
+ className: "workspace-agents-status-panel__detail-tool-stack-item",
11380
+ children: [
11381
+ /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-summary", children: option.label }),
11382
+ option.description ? /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted", children: option.description }) : null
11383
+ ]
11384
+ },
11385
+ `${questionKey}-option-${option.label}:${option.description}`
11386
+ )) }) : null,
11387
+ answer ? /* @__PURE__ */ jsx35("div", { className: "workspace-agents-status-panel__detail-tool-answer", children: translate("agentHost.agentTool.details.answerPrefix", {
11388
+ answer
11389
+ }) }) : /* @__PURE__ */ jsxs25("div", { className: "workspace-agents-status-panel__detail-tool-answer workspace-agents-status-panel__detail-tool-answer--muted inline-flex items-center gap-1.5", children: [
11390
+ /* @__PURE__ */ jsx35(
11391
+ MessageSquareMoreIcon,
11392
+ {
11393
+ size: 14,
11394
+ active: true,
11395
+ "aria-hidden": "true",
11396
+ className: "shrink-0"
11397
+ }
11398
+ ),
11399
+ translate("agentHost.agentTool.details.waitingForAnswer")
11400
+ ] })
11401
+ ]
11402
+ },
11403
+ questionKey
11404
+ );
11405
+ }) }) }),
11406
+ outputText ? /* @__PURE__ */ jsx35(ToolSection, { title: translate("agentHost.agentTool.details.output"), children: /* @__PURE__ */ jsx35(
11407
+ ToolMarkdownBlock,
11408
+ {
11409
+ content: outputText,
11410
+ onLinkClick,
11411
+ collapsible: true
11412
+ }
11413
+ ) }) : null
11414
+ ] });
11909
11415
  }
11910
11416
  function formatAnswer(answer) {
11911
11417
  if (Array.isArray(answer)) {
@@ -11913,6 +11419,9 @@ function formatAnswer(answer) {
11913
11419
  }
11914
11420
  return typeof answer === "string" && answer.trim() ? answer.trim() : null;
11915
11421
  }
11422
+ function stringValue10(value) {
11423
+ return typeof value === "string" && value.trim() ? value.trim() : null;
11424
+ }
11916
11425
 
11917
11426
  // shared/agentConversation/components/tool-renderers/terminal/AgentTerminalBlock.tsx
11918
11427
  import { useMemo as useMemo4, useState as useState11 } from "react";
@@ -11987,7 +11496,7 @@ function AgentBashContent({
11987
11496
  }) {
11988
11497
  "use memo";
11989
11498
  const commandData = getCommandRenderData(call);
11990
- const fallbackErrorText = commandData.status === "failed" && !commandData.stdout && !commandData.stderr ? stringValue10(call.error?.message) : null;
11499
+ const fallbackErrorText = commandData.status === "failed" && !commandData.stdout && !commandData.stderr ? stringValue9(call.error?.message) : null;
11991
11500
  return /* @__PURE__ */ jsx37("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--plain", children: /* @__PURE__ */ jsx37(
11992
11501
  AgentTerminalBlock,
11993
11502
  {
@@ -12115,8 +11624,8 @@ function normalizeMcpPayload(call) {
12115
11624
  toolName: call.toolName,
12116
11625
  name: call.name
12117
11626
  });
12118
- const server = target?.server ?? stringValue10(call.metadata?.server) ?? stringValue10(call.metadata?.serverName) ?? stringValue10(call.metadata?.mcpServer) ?? null;
12119
- const tool = target?.tool ?? stringValue10(call.metadata?.tool) ?? stringValue10(call.metadata?.toolName) ?? call.toolName;
11627
+ const server = target?.server ?? stringValue9(call.metadata?.server) ?? stringValue9(call.metadata?.serverName) ?? stringValue9(call.metadata?.mcpServer) ?? null;
11628
+ const tool = target?.tool ?? stringValue9(call.metadata?.tool) ?? stringValue9(call.metadata?.toolName) ?? call.toolName;
12120
11629
  const structured = firstStructuredValue(
12121
11630
  call.output?.structuredContent,
12122
11631
  parseJsonString(call.output?.content),
@@ -12126,19 +11635,19 @@ function normalizeMcpPayload(call) {
12126
11635
  return {
12127
11636
  server,
12128
11637
  tool,
12129
- inputSummary: firstString6(
12130
- stringValue10(call.input?.query),
12131
- stringValue10(call.input?.url),
12132
- stringValue10(call.input?.path),
12133
- stringValue10(call.input?.prompt),
12134
- stringValue10(call.input?.command)
11638
+ inputSummary: firstString5(
11639
+ stringValue9(call.input?.query),
11640
+ stringValue9(call.input?.url),
11641
+ stringValue9(call.input?.path),
11642
+ stringValue9(call.input?.prompt),
11643
+ stringValue9(call.input?.command)
12135
11644
  ),
12136
11645
  structured,
12137
- text: firstString6(
11646
+ text: firstString5(
12138
11647
  contentArrayText(call.output?.content),
12139
- stringValue10(call.output?.content),
12140
- stringValue10(call.output?.output),
12141
- stringValue10(call.output?.stdout)
11648
+ stringValue9(call.output?.content),
11649
+ stringValue9(call.output?.output),
11650
+ stringValue9(call.output?.stdout)
12142
11651
  )
12143
11652
  };
12144
11653
  }
@@ -12173,21 +11682,21 @@ function parsedItems(value) {
12173
11682
  return [];
12174
11683
  }
12175
11684
  function itemPrimaryText(item) {
12176
- return firstString6(
12177
- stringValue10(item.key),
12178
- stringValue10(item.title),
12179
- stringValue10(item.name),
12180
- stringValue10(item.path),
12181
- stringValue10(item.url),
12182
- stringValue10(item.id)
11685
+ return firstString5(
11686
+ stringValue9(item.key),
11687
+ stringValue9(item.title),
11688
+ stringValue9(item.name),
11689
+ stringValue9(item.path),
11690
+ stringValue9(item.url),
11691
+ stringValue9(item.id)
12183
11692
  );
12184
11693
  }
12185
11694
  function itemSecondaryText(item) {
12186
- return firstString6(
12187
- stringValue10(item.summary),
12188
- stringValue10(item.description),
12189
- stringValue10(item.status),
12190
- stringValue10(item.type)
11695
+ return firstString5(
11696
+ stringValue9(item.summary),
11697
+ stringValue9(item.description),
11698
+ stringValue9(item.status),
11699
+ stringValue9(item.type)
12191
11700
  );
12192
11701
  }
12193
11702
  function firstStructuredValue(...values) {
@@ -12222,16 +11731,16 @@ function contentArrayText(value) {
12222
11731
  return [];
12223
11732
  }
12224
11733
  return [
12225
- firstString6(
12226
- stringValue10(record.text),
12227
- stringValue10(record.content),
12228
- stringValue10(objectValue6(record.content)?.text)
11734
+ firstString5(
11735
+ stringValue9(record.text),
11736
+ stringValue9(record.content),
11737
+ stringValue9(objectValue6(record.content)?.text)
12229
11738
  )
12230
11739
  ].filter((candidate) => Boolean(candidate));
12231
11740
  }).join("\n").trim();
12232
11741
  return text || null;
12233
11742
  }
12234
- function firstString6(...values) {
11743
+ function firstString5(...values) {
12235
11744
  for (const value of values) {
12236
11745
  if (value) {
12237
11746
  return value;
@@ -12697,7 +12206,7 @@ function AgentWriteContent({
12697
12206
  "use memo";
12698
12207
  const files = getFileChangeRenderData(call);
12699
12208
  const [file] = files;
12700
- const path = file?.path ?? stringValue10(call.input?.path) ?? stringValue10(call.input?.file_path) ?? stringValue10(call.input?.filePath) ?? null;
12209
+ const path = file?.path ?? stringValue9(call.input?.path) ?? stringValue9(call.input?.file_path) ?? stringValue9(call.input?.filePath) ?? null;
12701
12210
  const contentFiles = files.filter((candidate) => candidate.content);
12702
12211
  const contentPaths = new Set(contentFiles.map((candidate) => candidate.path));
12703
12212
  const patchFiles = files.filter(
@@ -13004,7 +12513,7 @@ function AgentSubAgentCards({
13004
12513
  subAgent,
13005
12514
  onLinkClick
13006
12515
  },
13007
- subAgent.ownerThreadId
12516
+ subAgent.childSessionId
13008
12517
  )) });
13009
12518
  }
13010
12519
  var AgentSubAgentCard = memo(
@@ -13012,7 +12521,7 @@ var AgentSubAgentCard = memo(
13012
12521
  (prev, next) => prev.onLinkClick === next.onLinkClick && subAgentVMEquals(prev.subAgent, next.subAgent)
13013
12522
  );
13014
12523
  function subAgentVMEquals(left, right) {
13015
- return left.ownerThreadId === right.ownerThreadId && left.status === right.status && left.name === right.name && left.task === right.task && left.laneIndex === right.laneIndex && left.laneCount === right.laneCount && left.latestActivity === right.latestActivity && left.failureDetail === right.failureDetail && left.queued === right.queued && left.startedAtUnixMs === right.startedAtUnixMs && left.latestActivityAtUnixMs === right.latestActivityAtUnixMs && left.terminalAtUnixMs === right.terminalAtUnixMs;
12524
+ return left.childSessionId === right.childSessionId && left.parentToolCallId === right.parentToolCallId && left.status === right.status && left.name === right.name && left.task === right.task && left.laneIndex === right.laneIndex && left.laneCount === right.laneCount && left.latestActivity === right.latestActivity && left.failureDetail === right.failureDetail && left.queued === right.queued && left.startedAtUnixMs === right.startedAtUnixMs && left.latestActivityAtUnixMs === right.latestActivityAtUnixMs && left.terminalAtUnixMs === right.terminalAtUnixMs && left.childSessions === right.childSessions;
13016
12525
  }
13017
12526
  function AgentSubAgentCardImpl({
13018
12527
  subAgent,
@@ -13092,12 +12601,21 @@ function SubAgentHeader({
13092
12601
  );
13093
12602
  }
13094
12603
  function SubAgentBody({
13095
- subAgent
12604
+ subAgent,
12605
+ onLinkClick
13096
12606
  }) {
13097
12607
  "use memo";
13098
12608
  return /* @__PURE__ */ jsx56("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--plain", children: /* @__PURE__ */ jsxs42("div", { className: "workspace-agents-status-panel__detail-subagent-terminal", children: [
13099
12609
  subAgent.task ? /* @__PURE__ */ jsx56("div", { className: "workspace-agents-status-panel__detail-subagent-task-strip", children: subAgent.task }) : null,
13100
- /* @__PURE__ */ jsx56(SubAgentProgress, { subAgent })
12610
+ /* @__PURE__ */ jsx56(SubAgentProgress, { subAgent }),
12611
+ subAgent.childSessions.length > 0 ? /* @__PURE__ */ jsx56("div", { className: "workspace-agents-status-panel__detail-subagent-children", children: subAgent.childSessions.map((childSession) => /* @__PURE__ */ jsx56(
12612
+ AgentSubAgentCard,
12613
+ {
12614
+ subAgent: childSession,
12615
+ onLinkClick
12616
+ },
12617
+ childSession.childSessionId
12618
+ )) }) : null
13101
12619
  ] }) });
13102
12620
  }
13103
12621
  function SubAgentProgress({
@@ -15296,9 +14814,8 @@ function useProjectedAgentConversation({
15296
14814
 
15297
14815
  export {
15298
14816
  Button,
15299
- partitionSubAgentTimelineItems,
15300
- buildSubAgentLanesByCallId,
15301
- attachSubAgentLanesToConversationVM,
14817
+ isWorkspaceAgentToolCallItem,
14818
+ resolveWorkspaceAgentToolName,
15302
14819
  buildWorkspaceAgentSessionDetailViewModel,
15303
14820
  skillTriggerForPrefix,
15304
14821
  labelForProviderSkill,
@@ -15338,4 +14855,4 @@ export {
15338
14855
  AgentConversationFlow,
15339
14856
  useProjectedAgentConversation
15340
14857
  };
15341
- //# sourceMappingURL=chunk-ZPKPIHMZ.js.map
14858
+ //# sourceMappingURL=chunk-HLVC4NNL.js.map