@tutti-os/agent-gui 0.0.103 → 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.
- package/dist/{AgentGUI-D6IQ0F_N.d.ts → AgentGUI-DQ9gVoXh.d.ts} +2 -3
- package/dist/agent-conversation/index.d.ts +3 -3
- package/dist/agent-conversation/index.js +6 -6
- package/dist/agent-gui.d.ts +3 -3
- package/dist/agent-gui.js +13 -13
- package/dist/agent-message-center/index.d.ts +1 -1
- package/dist/agent-message-center/index.js +6 -6
- package/dist/{agentConversationVM-BzHZhwFP.d.ts → agentConversationVM-CkcYM5Wg.d.ts} +3 -1
- package/dist/{agentGuiNodeTypes-8U3q_frv.d.ts → agentGuiNodeTypes-B9vcvjmR.d.ts} +1 -2
- package/dist/{chunk-WXMBD2O7.js → chunk-747L443E.js} +6 -6
- package/dist/chunk-747L443E.js.map +1 -0
- package/dist/{chunk-L2MTZMVH.js → chunk-7N524ZK7.js} +715 -417
- package/dist/chunk-7N524ZK7.js.map +1 -0
- package/dist/{chunk-5Z4ZXXX4.js → chunk-AKKDP2LI.js} +2 -2
- package/dist/{chunk-IBFGOAY3.js → chunk-F5LFPORI.js} +2 -2
- package/dist/{chunk-SGGGE2F3.js → chunk-FJ4W2VC5.js} +4 -4
- package/dist/{chunk-IVY4OL7B.js → chunk-HLVC4NNL.js} +435 -935
- package/dist/chunk-HLVC4NNL.js.map +1 -0
- package/dist/{chunk-3ZBDWWCV.js → chunk-MUPZPISC.js} +2 -2
- package/dist/{chunk-PCXBTG5X.js → chunk-NOXQOGT5.js} +3 -3
- package/dist/{chunk-6PMLIVTI.js → chunk-OFSDOID4.js} +2 -2
- package/dist/{chunk-ZRJS4MOQ.js → chunk-QI3JAO4J.js} +2 -2
- package/dist/{chunk-RGG5UGJD.js → chunk-SKCLZXSW.js} +1 -5
- package/dist/chunk-SKCLZXSW.js.map +1 -0
- package/dist/{chunk-UHOVZI6B.js → chunk-TPV2SV6L.js} +3 -3
- package/dist/{chunk-XZD5KTM4.js → chunk-VAB7EIL5.js} +5 -5
- package/dist/context-mention-palette/index.js +7 -7
- package/dist/i18n/index.d.ts +0 -4
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +13 -13
- package/dist/mention-search.js +5 -5
- package/dist/workbench/contribution.js +3 -3
- package/dist/workbench/index.js +3 -3
- package/dist/workbench/sessionTitle.js +2 -2
- package/package.json +14 -14
- package/dist/chunk-IVY4OL7B.js.map +0 -1
- package/dist/chunk-L2MTZMVH.js.map +0 -1
- package/dist/chunk-RGG5UGJD.js.map +0 -1
- package/dist/chunk-WXMBD2O7.js.map +0 -1
- /package/dist/{chunk-5Z4ZXXX4.js.map → chunk-AKKDP2LI.js.map} +0 -0
- /package/dist/{chunk-IBFGOAY3.js.map → chunk-F5LFPORI.js.map} +0 -0
- /package/dist/{chunk-SGGGE2F3.js.map → chunk-FJ4W2VC5.js.map} +0 -0
- /package/dist/{chunk-3ZBDWWCV.js.map → chunk-MUPZPISC.js.map} +0 -0
- /package/dist/{chunk-PCXBTG5X.js.map → chunk-NOXQOGT5.js.map} +0 -0
- /package/dist/{chunk-6PMLIVTI.js.map → chunk-OFSDOID4.js.map} +0 -0
- /package/dist/{chunk-ZRJS4MOQ.js.map → chunk-QI3JAO4J.js.map} +0 -0
- /package/dist/{chunk-UHOVZI6B.js.map → chunk-TPV2SV6L.js.map} +0 -0
- /package/dist/{chunk-XZD5KTM4.js.map → chunk-VAB7EIL5.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
isWorkspaceAgentSyntheticControlMessage,
|
|
17
17
|
mentionItemToAttrs,
|
|
18
18
|
parseAgentMentionMarkdown
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NOXQOGT5.js";
|
|
20
20
|
import {
|
|
21
21
|
AgentGUIConversation_styles_default,
|
|
22
22
|
AgentMessageMarkdown,
|
|
@@ -34,12 +34,12 @@ import {
|
|
|
34
34
|
resolveWorkspaceFilePathCandidate,
|
|
35
35
|
resolveWorkspaceLinkAction,
|
|
36
36
|
useAgentTargetPresentations
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-TPV2SV6L.js";
|
|
38
38
|
import {
|
|
39
39
|
useOptionalAgentActivityRuntime,
|
|
40
40
|
useOptionalAgentHostApi,
|
|
41
41
|
workspaceAgentProviderLabel
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-OFSDOID4.js";
|
|
43
43
|
import {
|
|
44
44
|
fileChangeCountFromChanges,
|
|
45
45
|
fileChangeEntriesFromChanges,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
import {
|
|
52
52
|
getActiveUiLanguage,
|
|
53
53
|
translate
|
|
54
|
-
} from "./chunk-
|
|
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(
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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:
|
|
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 =
|
|
2607
|
+
const id = stringValue3(option?.optionId) ?? stringValue3(option?.id);
|
|
3116
2608
|
if (!id) {
|
|
3117
2609
|
return [];
|
|
3118
2610
|
}
|
|
3119
|
-
const label =
|
|
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:
|
|
3125
|
-
...
|
|
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
|
|
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:
|
|
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:
|
|
2665
|
+
requestId: stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
|
|
3174
2666
|
kind: "exit",
|
|
3175
|
-
title:
|
|
2667
|
+
title: stringValue4(objectValue2(input?.toolCall)?.title) ?? call.name,
|
|
3176
2668
|
status: call.status,
|
|
3177
|
-
plan:
|
|
3178
|
-
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:
|
|
3194
|
-
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,12 +2694,12 @@ function projectAgentPlanModeItem(call, input) {
|
|
|
3202
2694
|
itemKind: "plan-mode",
|
|
3203
2695
|
id: call.id,
|
|
3204
2696
|
turnId: call.turnId ?? "turn:unknown",
|
|
3205
|
-
requestId:
|
|
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:
|
|
3210
|
-
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
|
}
|
|
@@ -3234,7 +2726,7 @@ function keepPlanningOption(optionId) {
|
|
|
3234
2726
|
function normalizeToolName4(value) {
|
|
3235
2727
|
return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
|
|
3236
2728
|
}
|
|
3237
|
-
function
|
|
2729
|
+
function stringValue4(value) {
|
|
3238
2730
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
3239
2731
|
}
|
|
3240
2732
|
function objectValue2(value) {
|
|
@@ -3262,9 +2754,9 @@ function projectAgentTaskItem(call, input, output, metadata) {
|
|
|
3262
2754
|
id: call.id,
|
|
3263
2755
|
turnId: call.turnId ?? "turn:unknown",
|
|
3264
2756
|
title: call.summary.trim() || call.name,
|
|
3265
|
-
status:
|
|
3266
|
-
prompt:
|
|
3267
|
-
delegateSessionId:
|
|
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),
|
|
3268
2760
|
steps,
|
|
3269
2761
|
result: firstNonEmptyText(output),
|
|
3270
2762
|
resultMarkdown: firstNonEmptyText(output),
|
|
@@ -3278,8 +2770,8 @@ function normalizeTaskSteps(values, turnId) {
|
|
|
3278
2770
|
if (!step) {
|
|
3279
2771
|
return [];
|
|
3280
2772
|
}
|
|
3281
|
-
const toolName =
|
|
3282
|
-
const callType =
|
|
2773
|
+
const toolName = stringValue5(step.toolName) ?? stringValue5(step.tool_name) ?? stringValue5(step.name);
|
|
2774
|
+
const callType = stringValue5(step.callType) ?? stringValue5(step.call_type);
|
|
3283
2775
|
if (isApprovalToolCall({ toolName, callType })) {
|
|
3284
2776
|
return [];
|
|
3285
2777
|
}
|
|
@@ -3292,11 +2784,11 @@ function normalizeTaskSteps(values, turnId) {
|
|
|
3292
2784
|
const locations = arrayValue3(step.locations);
|
|
3293
2785
|
return [
|
|
3294
2786
|
{
|
|
3295
|
-
id:
|
|
2787
|
+
id: stringValue5(step.toolUseId) ?? stringValue5(step.id) ?? `step-${index + 1}`,
|
|
3296
2788
|
turnId,
|
|
3297
2789
|
name: toolName ? humanizeToolLabel(toolName) : `Step ${index + 1}`,
|
|
3298
2790
|
toolName: toolName ?? null,
|
|
3299
|
-
status:
|
|
2791
|
+
status: stringValue5(step.status) ?? stringValue5(objectValue3(step.toolResult)?.status) ?? stringValue5(objectValue3(step.tool_result)?.status),
|
|
3300
2792
|
summary: firstNonEmptyText(outputPayload, inputPayload) ?? "",
|
|
3301
2793
|
payload: {
|
|
3302
2794
|
input: inputPayload,
|
|
@@ -3304,12 +2796,12 @@ function normalizeTaskSteps(values, turnId) {
|
|
|
3304
2796
|
error: errorPayload
|
|
3305
2797
|
},
|
|
3306
2798
|
tool: projectAgentTaskStepTool({
|
|
3307
|
-
id:
|
|
2799
|
+
id: stringValue5(step.toolUseId) ?? stringValue5(step.id) ?? `step-${index + 1}`,
|
|
3308
2800
|
turnId,
|
|
3309
2801
|
toolName,
|
|
3310
|
-
name:
|
|
2802
|
+
name: stringValue5(step.name),
|
|
3311
2803
|
callType,
|
|
3312
|
-
status:
|
|
2804
|
+
status: stringValue5(step.status) ?? stringValue5(outputPayload?.status),
|
|
3313
2805
|
summary: firstNonEmptyText(outputPayload, inputPayload) ?? "",
|
|
3314
2806
|
payload,
|
|
3315
2807
|
metadata,
|
|
@@ -3391,7 +2883,7 @@ function projectAgentTaskStepTool(step) {
|
|
|
3391
2883
|
function humanizeToolLabel(value) {
|
|
3392
2884
|
return value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/^\w/, (match) => match.toUpperCase());
|
|
3393
2885
|
}
|
|
3394
|
-
function
|
|
2886
|
+
function stringValue5(value) {
|
|
3395
2887
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
3396
2888
|
}
|
|
3397
2889
|
function numberValue(value) {
|
|
@@ -4095,7 +3587,7 @@ function userPromptContentBlocks(message, fallbackWorkspaceId) {
|
|
|
4095
3587
|
);
|
|
4096
3588
|
const content = Array.isArray(item?.payload?.content) ? item.payload.content : null;
|
|
4097
3589
|
if (!content) return [];
|
|
4098
|
-
const displayPrompt =
|
|
3590
|
+
const displayPrompt = firstString2(
|
|
4099
3591
|
message.sourceTimelineItems?.map(
|
|
4100
3592
|
(candidate) => typeof candidate.payload?.displayPrompt === "string" ? candidate.payload.displayPrompt : ""
|
|
4101
3593
|
) ?? []
|
|
@@ -4128,7 +3620,7 @@ function userPromptContentBlocks(message, fallbackWorkspaceId) {
|
|
|
4128
3620
|
function optionalString(value) {
|
|
4129
3621
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
4130
3622
|
}
|
|
4131
|
-
function
|
|
3623
|
+
function firstString2(values) {
|
|
4132
3624
|
for (const value of values) {
|
|
4133
3625
|
const trimmed = value.trim();
|
|
4134
3626
|
if (trimmed) return trimmed;
|
|
@@ -4505,11 +3997,11 @@ function collectContentDiffFiles(messageId, toolName, occurredAtUnixMs, contentI
|
|
|
4505
3997
|
if (!item) {
|
|
4506
3998
|
return [];
|
|
4507
3999
|
}
|
|
4508
|
-
const type =
|
|
4000
|
+
const type = stringValue6(item.type);
|
|
4509
4001
|
if (type && type !== "diff") {
|
|
4510
4002
|
return [];
|
|
4511
4003
|
}
|
|
4512
|
-
const path = normalizedFilePath(
|
|
4004
|
+
const path = normalizedFilePath(stringValue6(item.path), options);
|
|
4513
4005
|
if (!path) {
|
|
4514
4006
|
return [];
|
|
4515
4007
|
}
|
|
@@ -4518,10 +4010,10 @@ function collectContentDiffFiles(messageId, toolName, occurredAtUnixMs, contentI
|
|
|
4518
4010
|
relatedChange ? fileChangeTypeValue(relatedChange) : null
|
|
4519
4011
|
);
|
|
4520
4012
|
const unifiedDiff = firstNonEmptyString(
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4013
|
+
stringValue6(item.diff),
|
|
4014
|
+
stringValue6(item.patch),
|
|
4015
|
+
stringValue6(relatedChange?.unified_diff),
|
|
4016
|
+
stringValue6(relatedChange?.unifiedDiff)
|
|
4525
4017
|
);
|
|
4526
4018
|
let oldString = firstPresentString6(
|
|
4527
4019
|
literalStringValue(item.oldText),
|
|
@@ -4808,9 +4300,9 @@ function nestedTaskStepsFromPayload(payload, output) {
|
|
|
4808
4300
|
}
|
|
4809
4301
|
function nestedTaskStepStatusKind(step, fallback) {
|
|
4810
4302
|
return firstNonEmptyString(
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4303
|
+
stringValue6(step.statusKind),
|
|
4304
|
+
stringValue6(step.status),
|
|
4305
|
+
stringValue6(step.toolStatus)
|
|
4814
4306
|
) ?? fallback ?? null;
|
|
4815
4307
|
}
|
|
4816
4308
|
function firstLocationPath(value) {
|
|
@@ -4819,7 +4311,7 @@ function firstLocationPath(value) {
|
|
|
4819
4311
|
}
|
|
4820
4312
|
for (const item of value) {
|
|
4821
4313
|
const record = objectValue5(item);
|
|
4822
|
-
const path =
|
|
4314
|
+
const path = stringValue6(record?.path);
|
|
4823
4315
|
if (path) {
|
|
4824
4316
|
return path;
|
|
4825
4317
|
}
|
|
@@ -4831,14 +4323,14 @@ function firstPathValue(value) {
|
|
|
4831
4323
|
return null;
|
|
4832
4324
|
}
|
|
4833
4325
|
for (const item of value) {
|
|
4834
|
-
const path =
|
|
4326
|
+
const path = stringValue6(item);
|
|
4835
4327
|
if (path) {
|
|
4836
4328
|
return path;
|
|
4837
4329
|
}
|
|
4838
4330
|
}
|
|
4839
4331
|
return null;
|
|
4840
4332
|
}
|
|
4841
|
-
function
|
|
4333
|
+
function stringValue6(value) {
|
|
4842
4334
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
4843
4335
|
}
|
|
4844
4336
|
function literalStringValue(value) {
|
|
@@ -4993,8 +4485,8 @@ function filesFromCall(call, options) {
|
|
|
4993
4485
|
return [];
|
|
4994
4486
|
}
|
|
4995
4487
|
return extractFileChanges({
|
|
4996
|
-
id:
|
|
4997
|
-
toolName:
|
|
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,
|
|
4998
4490
|
statusKind: nestedTaskStepStatusKind(step, call.statusKind ?? null),
|
|
4999
4491
|
occurredAtUnixMs: numberValue2(step.occurredAtUnixMs) ?? numberValue2(step.occurred_at_unix_ms) ?? call.occurredAtUnixMs ?? null,
|
|
5000
4492
|
payload: objectValue5(step.payload),
|
|
@@ -5031,7 +4523,7 @@ function patchBatchesFromCall(call, options) {
|
|
|
5031
4523
|
return [];
|
|
5032
4524
|
}
|
|
5033
4525
|
return patchBatchFromPayload({
|
|
5034
|
-
id:
|
|
4526
|
+
id: stringValue6(step.toolUseId) ?? stringValue6(step.id) ?? `${call.id}:step:${index + 1}`,
|
|
5035
4527
|
payload: objectValue5(step.payload),
|
|
5036
4528
|
toolInput: objectValue5(step.toolInput) ?? objectValue5(step.tool_input),
|
|
5037
4529
|
toolOutput: objectValue5(step.toolResult) ?? objectValue5(step.tool_result),
|
|
@@ -5060,11 +4552,11 @@ function patchBatchFromPayload(input) {
|
|
|
5060
4552
|
return [
|
|
5061
4553
|
{
|
|
5062
4554
|
cwd: firstNonEmptyString(
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
4555
|
+
stringValue6(input.payload?.cwd),
|
|
4556
|
+
stringValue6(payloadInput?.cwd),
|
|
4557
|
+
stringValue6(rawInput?.cwd),
|
|
4558
|
+
stringValue6(payloadOutput?.cwd),
|
|
4559
|
+
stringValue6(metadata?.cwd),
|
|
5068
4560
|
input.options.defaultCwd ?? null
|
|
5069
4561
|
) ?? null,
|
|
5070
4562
|
toolCallId: input.id,
|
|
@@ -5081,10 +4573,10 @@ function patchChangesFromChangeMap(changes) {
|
|
|
5081
4573
|
}
|
|
5082
4574
|
const normalizedType = normalizeChangeType(fileChangeTypeValue(change));
|
|
5083
4575
|
const unifiedDiff = firstNonEmptyString(
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
4576
|
+
stringValue6(change.unified_diff),
|
|
4577
|
+
stringValue6(change.unifiedDiff),
|
|
4578
|
+
stringValue6(change.diff),
|
|
4579
|
+
stringValue6(change.patch)
|
|
5088
4580
|
) ?? null;
|
|
5089
4581
|
let oldString = firstPresentString6(
|
|
5090
4582
|
literalStringValue(change.old_string),
|
|
@@ -5160,10 +4652,10 @@ function extractFileChanges(input) {
|
|
|
5160
4652
|
input.occurredAtUnixMs,
|
|
5161
4653
|
arrayValue5(objectValue5(payload?.fileChanges)?.files),
|
|
5162
4654
|
firstNonEmptyString(
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
4655
|
+
stringValue6(input.input?.patch),
|
|
4656
|
+
stringValue6(input.output?.patch),
|
|
4657
|
+
stringValue6(payload?.patch),
|
|
4658
|
+
stringValue6(metadata?.patch)
|
|
5167
4659
|
),
|
|
5168
4660
|
firstPresentString6(
|
|
5169
4661
|
literalStringValue(input.output?.oldString),
|
|
@@ -5207,24 +4699,24 @@ function extractFileChanges(input) {
|
|
|
5207
4699
|
if (filesFromContentDiff.length > 0) {
|
|
5208
4700
|
return filesFromContentDiff;
|
|
5209
4701
|
}
|
|
5210
|
-
const summaryFallbackPath = input.input?.summaryPathFallback === true ?
|
|
5211
|
-
const explicitInputPath = summaryFallbackPath ? null :
|
|
4702
|
+
const summaryFallbackPath = input.input?.summaryPathFallback === true ? stringValue6(input.input?.path) : null;
|
|
4703
|
+
const explicitInputPath = summaryFallbackPath ? null : stringValue6(input.input?.path);
|
|
5212
4704
|
const filePath = firstNonEmptyString(
|
|
5213
4705
|
firstPathValue(payloadPaths),
|
|
5214
|
-
|
|
5215
|
-
|
|
4706
|
+
stringValue6(input.input?.file_path),
|
|
4707
|
+
stringValue6(input.input?.filePath),
|
|
5216
4708
|
explicitInputPath,
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
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),
|
|
5222
4714
|
firstLocationPath(inputLocations),
|
|
5223
4715
|
firstLocationPath(payloadLocations)
|
|
5224
4716
|
) ?? extractAgentPatchPath(
|
|
5225
4717
|
firstNonEmptyString(
|
|
5226
|
-
|
|
5227
|
-
|
|
4718
|
+
stringValue6(input.input?.patch),
|
|
4719
|
+
stringValue6(input.output?.patch)
|
|
5228
4720
|
)
|
|
5229
4721
|
) ?? summaryFallbackPath;
|
|
5230
4722
|
const normalizedFilePathValue = normalizedFilePath(filePath, input.options);
|
|
@@ -5232,11 +4724,11 @@ function extractFileChanges(input) {
|
|
|
5232
4724
|
return [];
|
|
5233
4725
|
}
|
|
5234
4726
|
const patch = firstNonEmptyString(
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
4727
|
+
stringValue6(input.input?.patch),
|
|
4728
|
+
stringValue6(input.output?.patch),
|
|
4729
|
+
stringValue6(payload?.patch),
|
|
4730
|
+
stringValue6(metadata?.patch),
|
|
4731
|
+
stringValue6(input.output?.content)
|
|
5240
4732
|
) ?? null;
|
|
5241
4733
|
const oldString = firstPresentString6(
|
|
5242
4734
|
literalStringValue(input.output?.oldString),
|
|
@@ -5259,10 +4751,10 @@ function extractFileChanges(input) {
|
|
|
5259
4751
|
);
|
|
5260
4752
|
const explicitChangeType = normalizeChangeType(
|
|
5261
4753
|
firstNonEmptyString(
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
4754
|
+
stringValue6(payload?.fileChangeKind),
|
|
4755
|
+
stringValue6(metadata?.fileChangeKind),
|
|
4756
|
+
stringValue6(input.input?.fileChangeKind),
|
|
4757
|
+
stringValue6(input.output?.fileChangeKind)
|
|
5266
4758
|
)
|
|
5267
4759
|
) ?? null;
|
|
5268
4760
|
const changeType = explicitChangeType ?? (normalizedToolName === "write" || normalizedToolName === "writefile" ? "created" : normalizedToolName === "notebookedit" ? "created" : inferAgentPatchChangeType(patch));
|
|
@@ -5302,16 +4794,16 @@ function isStructuredWriteTool(normalizedToolName, payload, metadata) {
|
|
|
5302
4794
|
return false;
|
|
5303
4795
|
}
|
|
5304
4796
|
const activityKind = firstNonEmptyString(
|
|
5305
|
-
|
|
5306
|
-
|
|
4797
|
+
stringValue6(payload?.activityKind),
|
|
4798
|
+
stringValue6(metadata?.activityKind)
|
|
5307
4799
|
);
|
|
5308
4800
|
if (activityKind === "write_file" || activityKind === "edit_file" || activityKind === "delete_file") {
|
|
5309
4801
|
return true;
|
|
5310
4802
|
}
|
|
5311
4803
|
return normalizeChangeType(
|
|
5312
4804
|
firstNonEmptyString(
|
|
5313
|
-
|
|
5314
|
-
|
|
4805
|
+
stringValue6(payload?.fileChangeKind),
|
|
4806
|
+
stringValue6(metadata?.fileChangeKind)
|
|
5315
4807
|
)
|
|
5316
4808
|
) !== null;
|
|
5317
4809
|
}
|
|
@@ -5321,15 +4813,15 @@ function collectMetadataFiles(messageId, toolName, occurredAtUnixMs, files, patc
|
|
|
5321
4813
|
}
|
|
5322
4814
|
return files.flatMap((value, index) => {
|
|
5323
4815
|
const file = objectValue5(value);
|
|
5324
|
-
const path = normalizedFilePath(
|
|
4816
|
+
const path = normalizedFilePath(stringValue6(file?.path), options);
|
|
5325
4817
|
if (!path) {
|
|
5326
4818
|
return [];
|
|
5327
4819
|
}
|
|
5328
4820
|
const fileUnifiedDiff = firstNonEmptyString(
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
4821
|
+
stringValue6(file?.diff),
|
|
4822
|
+
stringValue6(file?.patch),
|
|
4823
|
+
stringValue6(file?.unifiedDiff),
|
|
4824
|
+
stringValue6(file?.unified_diff)
|
|
5333
4825
|
) ?? patch;
|
|
5334
4826
|
const fileOldString = firstPresentString6(
|
|
5335
4827
|
literalStringValue(file?.oldString),
|
|
@@ -5340,7 +4832,7 @@ function collectMetadataFiles(messageId, toolName, occurredAtUnixMs, files, patc
|
|
|
5340
4832
|
literalStringValue(file?.new_string)
|
|
5341
4833
|
) ?? newString;
|
|
5342
4834
|
const fileContent = firstPresentString6(literalStringValue(file?.content)) ?? content;
|
|
5343
|
-
const change = normalizeChangeType(
|
|
4835
|
+
const change = normalizeChangeType(stringValue6(file?.change));
|
|
5344
4836
|
return [
|
|
5345
4837
|
buildFileChange({
|
|
5346
4838
|
id: `${messageId}:${index + 1}`,
|
|
@@ -5365,10 +4857,10 @@ function collectChangeMapFiles(messageId, toolName, occurredAtUnixMs, changes, o
|
|
|
5365
4857
|
}
|
|
5366
4858
|
const normalizedType = normalizeChangeType(fileChangeTypeValue(change));
|
|
5367
4859
|
const unifiedDiff = firstNonEmptyString(
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
4860
|
+
stringValue6(change.unified_diff),
|
|
4861
|
+
stringValue6(change.unifiedDiff),
|
|
4862
|
+
stringValue6(change.diff),
|
|
4863
|
+
stringValue6(change.patch)
|
|
5372
4864
|
);
|
|
5373
4865
|
let oldString = firstPresentString6(
|
|
5374
4866
|
literalStringValue(change.old_string),
|
|
@@ -8999,9 +8491,9 @@ function WriteLinedIcon(props) {
|
|
|
8999
8491
|
|
|
9000
8492
|
// shared/agentConversation/components/tool-renderers/render-data/agentToolFileChangeRenderData.ts
|
|
9001
8493
|
function getFileChangeRenderData(call) {
|
|
9002
|
-
const payloadInput =
|
|
9003
|
-
const payloadOutput =
|
|
9004
|
-
const 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);
|
|
9005
8497
|
const inputLocations = arrayValue6(call.locations) ?? arrayValue6(call.input?.locations) ?? arrayValue6(payloadInput?.locations);
|
|
9006
8498
|
const fromStructuredPatch = structuredPatchFiles(
|
|
9007
8499
|
call.output?.structuredPatch ?? payloadOutput?.structuredPatch ?? call.payload?.structuredPatch ?? call.output?.files ?? payloadOutput?.files
|
|
@@ -9035,44 +8527,44 @@ function getFileChangeRenderData(call) {
|
|
|
9035
8527
|
if (fromContentDiff.length > 0) {
|
|
9036
8528
|
return fromContentDiff;
|
|
9037
8529
|
}
|
|
9038
|
-
const inputPath =
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
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),
|
|
9045
8537
|
firstLocationPath2(inputLocations)
|
|
9046
8538
|
);
|
|
9047
|
-
const unifiedDiff =
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
8539
|
+
const unifiedDiff = firstString3(
|
|
8540
|
+
stringValue7(call.output?.patch),
|
|
8541
|
+
stringValue7(payloadOutput?.patch),
|
|
8542
|
+
stringValue7(call.output?.diff),
|
|
8543
|
+
stringValue7(payloadOutput?.diff)
|
|
9052
8544
|
);
|
|
9053
|
-
const path =
|
|
8545
|
+
const path = firstString3(
|
|
9054
8546
|
inputPath,
|
|
9055
8547
|
unifiedDiff ? extractAgentPatchPath(unifiedDiff) : null
|
|
9056
8548
|
);
|
|
9057
8549
|
if (!path) {
|
|
9058
8550
|
return [];
|
|
9059
8551
|
}
|
|
9060
|
-
const content =
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
8552
|
+
const content = firstString3(
|
|
8553
|
+
stringValue7(call.input?.content),
|
|
8554
|
+
stringValue7(payloadInput?.content),
|
|
8555
|
+
stringValue7(rawInput?.content)
|
|
9064
8556
|
);
|
|
9065
|
-
const oldString =
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
8557
|
+
const oldString = firstString3(
|
|
8558
|
+
stringValue7(call.input?.old_string),
|
|
8559
|
+
stringValue7(payloadInput?.old_string),
|
|
8560
|
+
stringValue7(call.output?.oldString),
|
|
8561
|
+
stringValue7(payloadOutput?.oldString)
|
|
9070
8562
|
);
|
|
9071
|
-
const newString =
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
8563
|
+
const newString = firstString3(
|
|
8564
|
+
stringValue7(call.input?.new_string),
|
|
8565
|
+
stringValue7(payloadInput?.new_string),
|
|
8566
|
+
stringValue7(call.output?.newString),
|
|
8567
|
+
stringValue7(payloadOutput?.newString)
|
|
9076
8568
|
);
|
|
9077
8569
|
const changeType = inferFileChangeType(
|
|
9078
8570
|
call.toolName,
|
|
@@ -9109,33 +8601,33 @@ function structuredPatchFiles(value) {
|
|
|
9109
8601
|
return [];
|
|
9110
8602
|
}
|
|
9111
8603
|
return patches.flatMap((item) => {
|
|
9112
|
-
const patch =
|
|
9113
|
-
const path =
|
|
9114
|
-
|
|
9115
|
-
|
|
8604
|
+
const patch = recordValue4(item);
|
|
8605
|
+
const path = firstString3(
|
|
8606
|
+
stringValue7(patch?.filePath),
|
|
8607
|
+
stringValue7(patch?.path)
|
|
9116
8608
|
);
|
|
9117
|
-
const diff =
|
|
9118
|
-
|
|
9119
|
-
|
|
8609
|
+
const diff = firstString3(
|
|
8610
|
+
stringValue7(patch?.diff),
|
|
8611
|
+
stringValue7(patch?.patch)
|
|
9120
8612
|
);
|
|
9121
8613
|
if (!path) {
|
|
9122
8614
|
return [];
|
|
9123
8615
|
}
|
|
9124
|
-
const oldString =
|
|
9125
|
-
|
|
9126
|
-
|
|
8616
|
+
const oldString = firstString3(
|
|
8617
|
+
stringValue7(patch?.oldString),
|
|
8618
|
+
stringValue7(patch?.old_string)
|
|
9127
8619
|
);
|
|
9128
|
-
const newString =
|
|
9129
|
-
|
|
9130
|
-
|
|
8620
|
+
const newString = firstString3(
|
|
8621
|
+
stringValue7(patch?.newString),
|
|
8622
|
+
stringValue7(patch?.new_string)
|
|
9131
8623
|
);
|
|
9132
|
-
const content =
|
|
8624
|
+
const content = firstString3(stringValue7(patch?.content), newString);
|
|
9133
8625
|
if (!diff && !oldString && !newString && !content) {
|
|
9134
8626
|
return [];
|
|
9135
8627
|
}
|
|
9136
8628
|
const changeType = firstKnownChangeType(
|
|
9137
|
-
normalizeChangeType2(
|
|
9138
|
-
normalizeChangeType2(
|
|
8629
|
+
normalizeChangeType2(stringValue7(patch?.kind)),
|
|
8630
|
+
normalizeChangeType2(stringValue7(patch?.change)),
|
|
9139
8631
|
inferFileChangeType(null, diff, content, oldString, newString)
|
|
9140
8632
|
);
|
|
9141
8633
|
const stats = fileChangeStats(
|
|
@@ -9161,7 +8653,7 @@ function structuredPatchFiles(value) {
|
|
|
9161
8653
|
});
|
|
9162
8654
|
}
|
|
9163
8655
|
function detailedDiffFiles(value) {
|
|
9164
|
-
const diff =
|
|
8656
|
+
const diff = stringValue7(value);
|
|
9165
8657
|
if (!diff) {
|
|
9166
8658
|
return [];
|
|
9167
8659
|
}
|
|
@@ -9186,35 +8678,35 @@ function detailedDiffFiles(value) {
|
|
|
9186
8678
|
];
|
|
9187
8679
|
}
|
|
9188
8680
|
function fileChangesFiles(value) {
|
|
9189
|
-
const record =
|
|
8681
|
+
const record = recordValue4(value);
|
|
9190
8682
|
const files = arrayValue6(record?.files);
|
|
9191
8683
|
if (!files) {
|
|
9192
8684
|
return [];
|
|
9193
8685
|
}
|
|
9194
8686
|
return files.flatMap((item) => {
|
|
9195
|
-
const file =
|
|
9196
|
-
const path =
|
|
8687
|
+
const file = recordValue4(item);
|
|
8688
|
+
const path = stringValue7(file?.path);
|
|
9197
8689
|
if (!path) {
|
|
9198
8690
|
return [];
|
|
9199
8691
|
}
|
|
9200
|
-
const unifiedDiff =
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
8692
|
+
const unifiedDiff = firstString3(
|
|
8693
|
+
stringValue7(file?.diff),
|
|
8694
|
+
stringValue7(file?.patch),
|
|
8695
|
+
stringValue7(file?.unifiedDiff),
|
|
8696
|
+
stringValue7(file?.unified_diff)
|
|
9205
8697
|
);
|
|
9206
|
-
const oldString =
|
|
9207
|
-
|
|
9208
|
-
|
|
8698
|
+
const oldString = firstString3(
|
|
8699
|
+
stringValue7(file?.oldString),
|
|
8700
|
+
stringValue7(file?.old_string)
|
|
9209
8701
|
);
|
|
9210
|
-
const newString =
|
|
9211
|
-
|
|
9212
|
-
|
|
8702
|
+
const newString = firstString3(
|
|
8703
|
+
stringValue7(file?.newString),
|
|
8704
|
+
stringValue7(file?.new_string)
|
|
9213
8705
|
);
|
|
9214
|
-
const content =
|
|
8706
|
+
const content = firstString3(stringValue7(file?.content), newString);
|
|
9215
8707
|
const changeType = firstKnownChangeType(
|
|
9216
|
-
normalizeChangeType2(
|
|
9217
|
-
normalizeChangeType2(
|
|
8708
|
+
normalizeChangeType2(stringValue7(file?.change)),
|
|
8709
|
+
normalizeChangeType2(stringValue7(file?.kind)),
|
|
9218
8710
|
inferFileChangeType(null, unifiedDiff, content, oldString, newString)
|
|
9219
8711
|
);
|
|
9220
8712
|
const stats = fileChangeStats(
|
|
@@ -9246,21 +8738,21 @@ function changeMapFiles(value) {
|
|
|
9246
8738
|
if (!normalizedPath) {
|
|
9247
8739
|
return [];
|
|
9248
8740
|
}
|
|
9249
|
-
const unifiedDiff =
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
8741
|
+
const unifiedDiff = firstString3(
|
|
8742
|
+
stringValue7(change.unified_diff),
|
|
8743
|
+
stringValue7(change.unifiedDiff),
|
|
8744
|
+
stringValue7(change.diff),
|
|
8745
|
+
stringValue7(change.patch)
|
|
9254
8746
|
);
|
|
9255
|
-
const explicitContent =
|
|
8747
|
+
const explicitContent = stringValue7(change.content);
|
|
9256
8748
|
const normalizedType = normalizeChangeType2(fileChangeTypeValue(change));
|
|
9257
|
-
let oldString =
|
|
9258
|
-
|
|
9259
|
-
|
|
8749
|
+
let oldString = firstString3(
|
|
8750
|
+
stringValue7(change.old_string),
|
|
8751
|
+
stringValue7(change.oldString)
|
|
9260
8752
|
);
|
|
9261
|
-
let newString =
|
|
9262
|
-
|
|
9263
|
-
|
|
8753
|
+
let newString = firstString3(
|
|
8754
|
+
stringValue7(change.new_string),
|
|
8755
|
+
stringValue7(change.newString),
|
|
9264
8756
|
explicitContent
|
|
9265
8757
|
);
|
|
9266
8758
|
if (normalizedType === "created" && oldString === null && newString !== null) {
|
|
@@ -9273,7 +8765,7 @@ function changeMapFiles(value) {
|
|
|
9273
8765
|
if (normalizedType === "deleted" && newString === null && oldString !== null) {
|
|
9274
8766
|
newString = "";
|
|
9275
8767
|
}
|
|
9276
|
-
const content =
|
|
8768
|
+
const content = firstString3(
|
|
9277
8769
|
normalizedType === "deleted" ? null : explicitContent,
|
|
9278
8770
|
normalizedType === "created" ? newString : null
|
|
9279
8771
|
);
|
|
@@ -9319,40 +8811,40 @@ function contentDiffFiles(value, changesValue, toolName) {
|
|
|
9319
8811
|
])
|
|
9320
8812
|
);
|
|
9321
8813
|
return items.flatMap((item) => {
|
|
9322
|
-
const record =
|
|
8814
|
+
const record = recordValue4(item);
|
|
9323
8815
|
if (!record) {
|
|
9324
8816
|
return [];
|
|
9325
8817
|
}
|
|
9326
|
-
const type =
|
|
8818
|
+
const type = stringValue7(record.type);
|
|
9327
8819
|
if (type && type !== "diff") {
|
|
9328
8820
|
return [];
|
|
9329
8821
|
}
|
|
9330
|
-
const path =
|
|
8822
|
+
const path = stringValue7(record.path);
|
|
9331
8823
|
if (!path) {
|
|
9332
8824
|
return [];
|
|
9333
8825
|
}
|
|
9334
8826
|
const relatedChange = changesByPath.get(path) ?? null;
|
|
9335
|
-
const unifiedDiff =
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
8827
|
+
const unifiedDiff = firstString3(
|
|
8828
|
+
stringValue7(record.diff),
|
|
8829
|
+
stringValue7(record.patch),
|
|
8830
|
+
stringValue7(relatedChange?.unified_diff),
|
|
8831
|
+
stringValue7(relatedChange?.unifiedDiff)
|
|
9340
8832
|
);
|
|
9341
8833
|
const normalizedType = normalizeChangeType2(
|
|
9342
8834
|
relatedChange ? fileChangeTypeValue(relatedChange) : null
|
|
9343
8835
|
);
|
|
9344
|
-
let oldString =
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
8836
|
+
let oldString = firstString3(
|
|
8837
|
+
stringValue7(record.oldText),
|
|
8838
|
+
stringValue7(record.oldString),
|
|
8839
|
+
stringValue7(relatedChange?.old_string),
|
|
8840
|
+
stringValue7(relatedChange?.oldString)
|
|
9349
8841
|
);
|
|
9350
|
-
let newString =
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
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)
|
|
9356
8848
|
);
|
|
9357
8849
|
if (normalizedType === "created" && oldString === null && newString !== null) {
|
|
9358
8850
|
oldString = "";
|
|
@@ -9364,9 +8856,9 @@ function contentDiffFiles(value, changesValue, toolName) {
|
|
|
9364
8856
|
if (normalizedType === "deleted" && newString === null && oldString !== null) {
|
|
9365
8857
|
newString = "";
|
|
9366
8858
|
}
|
|
9367
|
-
const explicitContent =
|
|
9368
|
-
|
|
9369
|
-
|
|
8859
|
+
const explicitContent = firstString3(
|
|
8860
|
+
stringValue7(record.content),
|
|
8861
|
+
stringValue7(relatedChange?.content)
|
|
9370
8862
|
);
|
|
9371
8863
|
const changeType = firstKnownChangeType(
|
|
9372
8864
|
normalizedType,
|
|
@@ -9381,7 +8873,7 @@ function contentDiffFiles(value, changesValue, toolName) {
|
|
|
9381
8873
|
if (changeType === "created" && oldString === null && newString !== null) {
|
|
9382
8874
|
oldString = "";
|
|
9383
8875
|
}
|
|
9384
|
-
const content =
|
|
8876
|
+
const content = firstString3(
|
|
9385
8877
|
changeType === "deleted" ? null : explicitContent,
|
|
9386
8878
|
changeType === "created" ? newString : null
|
|
9387
8879
|
);
|
|
@@ -9561,7 +9053,7 @@ function languageForPath(path) {
|
|
|
9561
9053
|
function normalizeToolName7(value) {
|
|
9562
9054
|
return (value ?? "").trim().replace(/[_\s-]+/g, "").toLowerCase();
|
|
9563
9055
|
}
|
|
9564
|
-
function
|
|
9056
|
+
function firstString3(...values) {
|
|
9565
9057
|
for (const value of values) {
|
|
9566
9058
|
if (typeof value === "string" && value.trim()) {
|
|
9567
9059
|
return value.trim();
|
|
@@ -9569,7 +9061,7 @@ function firstString4(...values) {
|
|
|
9569
9061
|
}
|
|
9570
9062
|
return null;
|
|
9571
9063
|
}
|
|
9572
|
-
function
|
|
9064
|
+
function recordValue4(value) {
|
|
9573
9065
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
9574
9066
|
}
|
|
9575
9067
|
function arrayValue6(value) {
|
|
@@ -9580,42 +9072,42 @@ function firstLocationPath2(value) {
|
|
|
9580
9072
|
return null;
|
|
9581
9073
|
}
|
|
9582
9074
|
for (const item of value) {
|
|
9583
|
-
const record =
|
|
9584
|
-
const path =
|
|
9075
|
+
const record = recordValue4(item);
|
|
9076
|
+
const path = stringValue7(record?.path);
|
|
9585
9077
|
if (path) {
|
|
9586
9078
|
return path;
|
|
9587
9079
|
}
|
|
9588
9080
|
}
|
|
9589
9081
|
return null;
|
|
9590
9082
|
}
|
|
9591
|
-
function
|
|
9083
|
+
function stringValue7(value) {
|
|
9592
9084
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
9593
9085
|
}
|
|
9594
9086
|
|
|
9595
9087
|
// shared/agentConversation/components/tool-renderers/render-data/agentToolRenderData.ts
|
|
9596
9088
|
function getCommandRenderData(call) {
|
|
9597
|
-
const inputRawInput =
|
|
9598
|
-
const payloadInput =
|
|
9599
|
-
const payloadInputRawInput =
|
|
9600
|
-
const outputRawOutput =
|
|
9601
|
-
const errorRawOutput =
|
|
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);
|
|
9602
9094
|
return {
|
|
9603
|
-
command:
|
|
9604
|
-
|
|
9605
|
-
|
|
9095
|
+
command: firstString4(
|
|
9096
|
+
stringValue8(call.input?.command),
|
|
9097
|
+
stringValue8(call.input?.cmd),
|
|
9606
9098
|
commandArrayToString(call.input?.command),
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
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)
|
|
9613
9105
|
),
|
|
9614
|
-
cwd:
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9106
|
+
cwd: firstString4(
|
|
9107
|
+
stringValue8(call.input?.cwd),
|
|
9108
|
+
stringValue8(inputRawInput?.cwd),
|
|
9109
|
+
stringValue8(payloadInput?.cwd),
|
|
9110
|
+
stringValue8(payloadInputRawInput?.cwd)
|
|
9619
9111
|
),
|
|
9620
9112
|
stdout: firstRawString(
|
|
9621
9113
|
rawStringValue(call.output?.stdout),
|
|
@@ -9650,42 +9142,42 @@ function getCommandRenderData(call) {
|
|
|
9650
9142
|
function getSearchRenderData(call) {
|
|
9651
9143
|
const canonicalContent = contentText(call.content);
|
|
9652
9144
|
const canonicalFiles = locationPaths(call.locations);
|
|
9653
|
-
const output =
|
|
9145
|
+
const output = firstString4(
|
|
9654
9146
|
canonicalContent,
|
|
9655
9147
|
contentText(call.output?.content),
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
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),
|
|
9662
9154
|
""
|
|
9663
9155
|
) ?? "";
|
|
9664
9156
|
const outputLines = output.split("\n").filter(Boolean);
|
|
9665
9157
|
const mode = canonicalFiles.length > 0 && !output ? "list_files" : searchMode(call.output, output);
|
|
9666
9158
|
const filenames = canonicalFiles.length > 0 ? canonicalFiles : stringArray(call.output?.filenames);
|
|
9667
9159
|
return {
|
|
9668
|
-
query:
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
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)
|
|
9674
9166
|
),
|
|
9675
|
-
scope:
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9167
|
+
scope: firstString4(
|
|
9168
|
+
stringValue8(call.input?.path),
|
|
9169
|
+
stringValue8(call.input?.file_path),
|
|
9170
|
+
stringValue8(call.input?.glob)
|
|
9679
9171
|
),
|
|
9680
9172
|
mode,
|
|
9681
9173
|
files: filenames.length > 0 ? filenames : mode === "list_files" ? outputLines : [],
|
|
9682
9174
|
lines: outputLines,
|
|
9683
9175
|
output,
|
|
9684
|
-
error:
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
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)
|
|
9689
9181
|
) ?? ""
|
|
9690
9182
|
};
|
|
9691
9183
|
}
|
|
@@ -9693,45 +9185,45 @@ function getWebSearchRenderData(call) {
|
|
|
9693
9185
|
const queries = normalizedQueries(
|
|
9694
9186
|
call.input?.search_query,
|
|
9695
9187
|
call.input?.searchQuery,
|
|
9696
|
-
|
|
9697
|
-
|
|
9188
|
+
recordValue5(call.input?.action)?.search_query,
|
|
9189
|
+
recordValue5(call.input?.action)?.searchQuery
|
|
9698
9190
|
);
|
|
9699
9191
|
return {
|
|
9700
|
-
query:
|
|
9701
|
-
|
|
9702
|
-
|
|
9192
|
+
query: firstString4(
|
|
9193
|
+
stringValue8(call.input?.query),
|
|
9194
|
+
stringValue8(recordValue5(call.input?.action)?.query),
|
|
9703
9195
|
queries[0] ?? null
|
|
9704
9196
|
),
|
|
9705
9197
|
queries,
|
|
9706
|
-
url:
|
|
9707
|
-
|
|
9708
|
-
|
|
9198
|
+
url: firstString4(
|
|
9199
|
+
stringValue8(call.input?.url),
|
|
9200
|
+
stringValue8(recordValue5(call.input?.action)?.url)
|
|
9709
9201
|
),
|
|
9710
|
-
output:
|
|
9711
|
-
|
|
9202
|
+
output: firstString4(
|
|
9203
|
+
stringValue8(call.output?.text),
|
|
9712
9204
|
contentText(call.content),
|
|
9713
9205
|
contentText(call.output?.content),
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9206
|
+
stringValue8(call.output?.stdout),
|
|
9207
|
+
stringValue8(call.output?.output),
|
|
9208
|
+
stringValue8(call.output?.content)
|
|
9717
9209
|
) ?? "",
|
|
9718
|
-
error:
|
|
9719
|
-
|
|
9720
|
-
|
|
9210
|
+
error: firstString4(
|
|
9211
|
+
stringValue8(call.error?.message),
|
|
9212
|
+
stringValue8(call.error?.stdout)
|
|
9721
9213
|
) ?? ""
|
|
9722
9214
|
};
|
|
9723
9215
|
}
|
|
9724
9216
|
function getWebFetchRenderData(call, maxContentLength = 3e3) {
|
|
9725
|
-
const url =
|
|
9726
|
-
|
|
9727
|
-
|
|
9217
|
+
const url = firstString4(
|
|
9218
|
+
stringValue8(call.input?.url),
|
|
9219
|
+
stringValue8(recordValue5(call.input?.action)?.url)
|
|
9728
9220
|
);
|
|
9729
|
-
const content =
|
|
9221
|
+
const content = firstString4(
|
|
9730
9222
|
contentText(call.content),
|
|
9731
9223
|
contentText(call.output?.content),
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9224
|
+
stringValue8(call.output?.output),
|
|
9225
|
+
stringValue8(call.output?.content),
|
|
9226
|
+
stringValue8(call.output?.stdout)
|
|
9735
9227
|
);
|
|
9736
9228
|
return {
|
|
9737
9229
|
url,
|
|
@@ -9747,21 +9239,21 @@ function getTodoRenderData(call) {
|
|
|
9747
9239
|
return [];
|
|
9748
9240
|
}
|
|
9749
9241
|
return todos.flatMap((todo) => {
|
|
9750
|
-
const record =
|
|
9751
|
-
const content =
|
|
9752
|
-
|
|
9753
|
-
|
|
9242
|
+
const record = recordValue5(todo);
|
|
9243
|
+
const content = firstString4(
|
|
9244
|
+
stringValue8(record?.content),
|
|
9245
|
+
stringValue8(record?.text)
|
|
9754
9246
|
);
|
|
9755
9247
|
if (!content) {
|
|
9756
9248
|
return [];
|
|
9757
9249
|
}
|
|
9758
|
-
return [{ content, status:
|
|
9250
|
+
return [{ content, status: stringValue8(record?.status) }];
|
|
9759
9251
|
});
|
|
9760
9252
|
}
|
|
9761
9253
|
function getToolSearchRenderData(call) {
|
|
9762
|
-
const query =
|
|
9763
|
-
const matches = arrayValue7(call.output?.matches)?.map(
|
|
9764
|
-
const totalDeferredTools = numberValue3(call.output?.total_deferred_tools) ?? numberValue3(call.output?.totalDeferredTools) ?? numberValue3(
|
|
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);
|
|
9765
9257
|
const mode = query?.startsWith("select:") ? "direct" : "search";
|
|
9766
9258
|
const displayQuery = query?.startsWith("select:") ? query.slice("select:".length) : query?.startsWith("+") ? query.slice(1) : query;
|
|
9767
9259
|
return {
|
|
@@ -9773,22 +9265,22 @@ function getToolSearchRenderData(call) {
|
|
|
9773
9265
|
};
|
|
9774
9266
|
}
|
|
9775
9267
|
function getPlanModeRenderData(call) {
|
|
9776
|
-
const enterText = call.rendererKind === "plan-enter" ?
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9268
|
+
const enterText = call.rendererKind === "plan-enter" ? firstString4(
|
|
9269
|
+
stringValue8(call.planMode?.plan),
|
|
9270
|
+
stringValue8(call.output?.text),
|
|
9271
|
+
stringValue8(call.input?.content),
|
|
9780
9272
|
nonEmpty(call.summary),
|
|
9781
9273
|
"Exploring codebase and designing implementation approach."
|
|
9782
9274
|
) : null;
|
|
9783
|
-
const filePath =
|
|
9784
|
-
|
|
9785
|
-
|
|
9275
|
+
const filePath = firstString4(
|
|
9276
|
+
stringValue8(call.input?.filePath),
|
|
9277
|
+
stringValue8(call.input?.file_path)
|
|
9786
9278
|
);
|
|
9787
9279
|
return {
|
|
9788
9280
|
enterText,
|
|
9789
|
-
plan: call.rendererKind === "plan-enter" ? null :
|
|
9790
|
-
|
|
9791
|
-
|
|
9281
|
+
plan: call.rendererKind === "plan-enter" ? null : firstString4(
|
|
9282
|
+
stringValue8(call.input?.plan),
|
|
9283
|
+
stringValue8(call.payload?.plan),
|
|
9792
9284
|
nonEmpty(call.summary)
|
|
9793
9285
|
),
|
|
9794
9286
|
filePath,
|
|
@@ -9798,51 +9290,51 @@ function getPlanModeRenderData(call) {
|
|
|
9798
9290
|
function getTaskRenderData(call) {
|
|
9799
9291
|
const task = call.task;
|
|
9800
9292
|
const steps = task?.steps ?? normalizeTaskStepsFromCall(call);
|
|
9801
|
-
const outputRawOutput =
|
|
9802
|
-
const errorRawOutput =
|
|
9293
|
+
const outputRawOutput = recordValue5(call.output?.rawOutput);
|
|
9294
|
+
const errorRawOutput = recordValue5(call.error?.rawOutput);
|
|
9803
9295
|
return {
|
|
9804
9296
|
title: task?.title ?? call.name,
|
|
9805
|
-
status: task?.status ??
|
|
9297
|
+
status: task?.status ?? stringValue8(call.metadata?.taskStatus) ?? stringValue8(call.metadata?.subagentStatus),
|
|
9806
9298
|
durationText: typeof task?.durationMs === "number" && Number.isFinite(task.durationMs) ? formatDuration(task.durationMs) : null,
|
|
9807
9299
|
latestStepSummary: task?.status === "running" ? steps.at(-1)?.summary ?? null : null,
|
|
9808
|
-
prompt:
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9300
|
+
prompt: firstString4(
|
|
9301
|
+
stringValue8(task?.prompt),
|
|
9302
|
+
stringValue8(call.input?.prompt),
|
|
9303
|
+
stringValue8(call.input?.description),
|
|
9304
|
+
stringValue8(call.payload?.description)
|
|
9813
9305
|
),
|
|
9814
|
-
childSessionId:
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
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)
|
|
9822
9314
|
),
|
|
9823
9315
|
steps,
|
|
9824
|
-
resultMarkdown:
|
|
9825
|
-
|
|
9316
|
+
resultMarkdown: firstString4(
|
|
9317
|
+
stringValue8(task?.resultMarkdown),
|
|
9826
9318
|
firstNonEmptyStructuredText(call.output, outputRawOutput)
|
|
9827
9319
|
),
|
|
9828
9320
|
errorMarkdown: firstNonEmptyStructuredText(call.error, errorRawOutput)
|
|
9829
9321
|
};
|
|
9830
9322
|
}
|
|
9831
9323
|
function getSkillRenderData(call) {
|
|
9832
|
-
const inputRawInput =
|
|
9324
|
+
const inputRawInput = recordValue5(call.input?.rawInput);
|
|
9833
9325
|
const outputRawOutput = call.output?.rawOutput;
|
|
9834
|
-
const success = booleanValue(call.output?.success) ?? legacySkillSuccess(outputRawOutput) ?? booleanValue(
|
|
9326
|
+
const success = booleanValue(call.output?.success) ?? legacySkillSuccess(outputRawOutput) ?? booleanValue(recordValue5(outputRawOutput)?.success);
|
|
9835
9327
|
return {
|
|
9836
|
-
skill:
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9328
|
+
skill: firstString4(
|
|
9329
|
+
stringValue8(call.input?.skill),
|
|
9330
|
+
stringValue8(inputRawInput?.skill),
|
|
9331
|
+
stringValue8(call.output?.commandName),
|
|
9332
|
+
stringValue8(recordValue5(outputRawOutput)?.commandName),
|
|
9841
9333
|
nonEmpty(call.summary)
|
|
9842
9334
|
),
|
|
9843
|
-
args:
|
|
9844
|
-
|
|
9845
|
-
|
|
9335
|
+
args: firstString4(
|
|
9336
|
+
stringValue8(call.input?.args),
|
|
9337
|
+
stringValue8(inputRawInput?.args)
|
|
9846
9338
|
),
|
|
9847
9339
|
success,
|
|
9848
9340
|
statusText: success === null ? null : success ? "Skill loaded" : "Failed to load skill"
|
|
@@ -9855,7 +9347,7 @@ function getImageGenerationRenderData(call) {
|
|
|
9855
9347
|
content: call.content,
|
|
9856
9348
|
outputContent: call.output?.content,
|
|
9857
9349
|
inputPrompt: call.input?.prompt,
|
|
9858
|
-
payloadInputPrompt:
|
|
9350
|
+
payloadInputPrompt: recordValue5(call.payload?.input)?.prompt
|
|
9859
9351
|
});
|
|
9860
9352
|
return {
|
|
9861
9353
|
prompt: preview.prompt,
|
|
@@ -9887,31 +9379,31 @@ function getToolFallbackText(call) {
|
|
|
9887
9379
|
function normalizeTaskStepsFromCall(call) {
|
|
9888
9380
|
const steps = arrayValue7(call.metadata?.steps) ?? arrayValue7(call.output?.steps) ?? arrayValue7(call.payload?.steps) ?? [];
|
|
9889
9381
|
return steps.flatMap((value, index) => {
|
|
9890
|
-
const step =
|
|
9382
|
+
const step = recordValue5(value);
|
|
9891
9383
|
if (!step) {
|
|
9892
9384
|
return [];
|
|
9893
9385
|
}
|
|
9894
|
-
const toolName =
|
|
9386
|
+
const toolName = stringValue8(step.toolName) ?? stringValue8(step.tool_name) ?? stringValue8(step.name) ?? null;
|
|
9895
9387
|
const name = toolName ? humanizeToolName2(toolName) : `Step ${index + 1}`;
|
|
9896
|
-
const status =
|
|
9388
|
+
const status = stringValue8(step.status) ?? stringValue8(recordValue5(step.toolResult)?.status) ?? stringValue8(recordValue5(step.tool_result)?.status) ?? null;
|
|
9897
9389
|
const summary = firstNonEmptyStructuredText(
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9390
|
+
recordValue5(step.toolResult),
|
|
9391
|
+
recordValue5(step.tool_result),
|
|
9392
|
+
recordValue5(step.toolInput),
|
|
9393
|
+
recordValue5(step.tool_input)
|
|
9902
9394
|
) ?? "";
|
|
9903
9395
|
return [
|
|
9904
9396
|
{
|
|
9905
|
-
id:
|
|
9397
|
+
id: stringValue8(step.toolUseId) ?? stringValue8(step.id) ?? `step-${index + 1}`,
|
|
9906
9398
|
turnId: call.turnId,
|
|
9907
9399
|
name,
|
|
9908
9400
|
toolName,
|
|
9909
9401
|
status,
|
|
9910
9402
|
summary,
|
|
9911
9403
|
payload: {
|
|
9912
|
-
input:
|
|
9913
|
-
output:
|
|
9914
|
-
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)
|
|
9915
9407
|
},
|
|
9916
9408
|
tool: null,
|
|
9917
9409
|
occurredAtUnixMs: null
|
|
@@ -9975,7 +9467,7 @@ function normalizeCommandStatus(value) {
|
|
|
9975
9467
|
}
|
|
9976
9468
|
}
|
|
9977
9469
|
function searchMode(output, outputText) {
|
|
9978
|
-
const mode =
|
|
9470
|
+
const mode = stringValue8(output?.mode);
|
|
9979
9471
|
if (mode === "files_with_matches" || mode === "content" || mode === "count" || mode === "list_files") {
|
|
9980
9472
|
return mode;
|
|
9981
9473
|
}
|
|
@@ -9998,7 +9490,7 @@ function commandArrayToString(value) {
|
|
|
9998
9490
|
return parts.length > 0 ? parts.join(" ") : null;
|
|
9999
9491
|
}
|
|
10000
9492
|
function durationToMs(value) {
|
|
10001
|
-
const record =
|
|
9493
|
+
const record = recordValue5(value);
|
|
10002
9494
|
if (!record) {
|
|
10003
9495
|
return null;
|
|
10004
9496
|
}
|
|
@@ -10015,15 +9507,15 @@ function contentText(value) {
|
|
|
10015
9507
|
return null;
|
|
10016
9508
|
}
|
|
10017
9509
|
const text = items.flatMap((item) => {
|
|
10018
|
-
const record =
|
|
9510
|
+
const record = recordValue5(item);
|
|
10019
9511
|
if (!record) {
|
|
10020
9512
|
return [];
|
|
10021
9513
|
}
|
|
10022
9514
|
return [
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
9515
|
+
firstString4(
|
|
9516
|
+
stringValue8(record.text),
|
|
9517
|
+
stringValue8(record.content),
|
|
9518
|
+
stringValue8(recordValue5(record.content)?.text)
|
|
10027
9519
|
)
|
|
10028
9520
|
].filter(Boolean);
|
|
10029
9521
|
}).join("\n").trim();
|
|
@@ -10036,38 +9528,38 @@ function structuredText(value) {
|
|
|
10036
9528
|
if (typeof value === "number" || typeof value === "boolean") {
|
|
10037
9529
|
return String(value);
|
|
10038
9530
|
}
|
|
10039
|
-
const record =
|
|
9531
|
+
const record = recordValue5(value);
|
|
10040
9532
|
if (!record) {
|
|
10041
9533
|
return null;
|
|
10042
9534
|
}
|
|
10043
|
-
const preferred =
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
9535
|
+
const preferred = firstString4(
|
|
9536
|
+
stringValue8(record.plan),
|
|
9537
|
+
stringValue8(record.text),
|
|
9538
|
+
stringValue8(record.output),
|
|
9539
|
+
stringValue8(record.content),
|
|
10048
9540
|
contentText(record.content),
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
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)
|
|
10064
9556
|
);
|
|
10065
9557
|
if (preferred) {
|
|
10066
9558
|
return preferred;
|
|
10067
9559
|
}
|
|
10068
9560
|
return null;
|
|
10069
9561
|
}
|
|
10070
|
-
function
|
|
9562
|
+
function firstString4(...values) {
|
|
10071
9563
|
for (const value of values) {
|
|
10072
9564
|
if (typeof value === "string" && value.trim()) {
|
|
10073
9565
|
return value.trim();
|
|
@@ -10086,13 +9578,13 @@ function firstRawString(...values) {
|
|
|
10086
9578
|
function nonEmpty(value) {
|
|
10087
9579
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
10088
9580
|
}
|
|
10089
|
-
function
|
|
9581
|
+
function recordValue5(value) {
|
|
10090
9582
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
10091
9583
|
}
|
|
10092
9584
|
function arrayValue7(value) {
|
|
10093
9585
|
return Array.isArray(value) ? value : null;
|
|
10094
9586
|
}
|
|
10095
|
-
function
|
|
9587
|
+
function stringValue8(value) {
|
|
10096
9588
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
10097
9589
|
}
|
|
10098
9590
|
function rawStringValue(value) {
|
|
@@ -10132,15 +9624,15 @@ function locationPaths(value) {
|
|
|
10132
9624
|
return [];
|
|
10133
9625
|
}
|
|
10134
9626
|
const paths = locations.flatMap((location) => {
|
|
10135
|
-
const record =
|
|
9627
|
+
const record = recordValue5(location);
|
|
10136
9628
|
if (!record) {
|
|
10137
9629
|
return [];
|
|
10138
9630
|
}
|
|
10139
9631
|
return [
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
9632
|
+
firstString4(
|
|
9633
|
+
stringValue8(record.path),
|
|
9634
|
+
stringValue8(record.filePath),
|
|
9635
|
+
stringValue8(record.file_path)
|
|
10144
9636
|
)
|
|
10145
9637
|
].filter((path) => path !== null);
|
|
10146
9638
|
});
|
|
@@ -11118,9 +10610,9 @@ function AgentReadContent({
|
|
|
11118
10610
|
call
|
|
11119
10611
|
}) {
|
|
11120
10612
|
"use memo";
|
|
11121
|
-
const path =
|
|
10613
|
+
const path = stringValue9(call.input?.path) ?? stringValue9(call.input?.file_path) ?? stringValue9(call.input?.filePath) ?? stringValue9(call.input?.file) ?? null;
|
|
11122
10614
|
const file = objectValue6(call.output?.file);
|
|
11123
|
-
const outputText =
|
|
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);
|
|
11124
10616
|
const fileLineRange = fileRange(file);
|
|
11125
10617
|
const fileTotalLines = numericValue(file?.totalLines);
|
|
11126
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(
|
|
@@ -11165,9 +10657,9 @@ function contentText2(value) {
|
|
|
11165
10657
|
const record = item;
|
|
11166
10658
|
const nestedContent = record.content && typeof record.content === "object" && !Array.isArray(record.content) ? record.content : null;
|
|
11167
10659
|
return [
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
10660
|
+
stringValue9(record.text),
|
|
10661
|
+
stringValue9(record.content),
|
|
10662
|
+
stringValue9(nestedContent?.text)
|
|
11171
10663
|
].filter((entry) => Boolean(entry));
|
|
11172
10664
|
}).join("\n").trim();
|
|
11173
10665
|
return text || null;
|
|
@@ -11371,13 +10863,13 @@ function hasWebSearchContent(call) {
|
|
|
11371
10863
|
function hasReadContent(call) {
|
|
11372
10864
|
const file = objectValue6(call.output?.file);
|
|
11373
10865
|
return Boolean(
|
|
11374
|
-
|
|
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
|
|
11375
10867
|
);
|
|
11376
10868
|
}
|
|
11377
10869
|
function hasWriteContent(call) {
|
|
11378
10870
|
const files = getFileChangeRenderData(call);
|
|
11379
10871
|
return Boolean(
|
|
11380
|
-
files.some((file) => file.content || file.unifiedDiff) || files.length === 0 && (call.summary.trim() ||
|
|
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))
|
|
11381
10873
|
);
|
|
11382
10874
|
}
|
|
11383
10875
|
function hasEditContent(call) {
|
|
@@ -11385,7 +10877,7 @@ function hasEditContent(call) {
|
|
|
11385
10877
|
return Boolean(
|
|
11386
10878
|
files.some(
|
|
11387
10879
|
(file) => file.unifiedDiff || file.oldString !== null && file.newString !== null || file.content
|
|
11388
|
-
) || files.length === 0 && (
|
|
10880
|
+
) || files.length === 0 && (stringValue9(call.input?.path) || stringValue9(call.input?.file_path) || stringValue9(call.input?.filePath))
|
|
11389
10881
|
);
|
|
11390
10882
|
}
|
|
11391
10883
|
function readContentText(value) {
|
|
@@ -11399,9 +10891,9 @@ function readContentText(value) {
|
|
|
11399
10891
|
const record = item;
|
|
11400
10892
|
const nestedContent = record.content && typeof record.content === "object" && !Array.isArray(record.content) ? record.content : null;
|
|
11401
10893
|
return [
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
10894
|
+
stringValue9(record.text),
|
|
10895
|
+
stringValue9(record.content),
|
|
10896
|
+
stringValue9(nestedContent?.text)
|
|
11405
10897
|
].filter((entry) => Boolean(entry));
|
|
11406
10898
|
}).join("\n").trim();
|
|
11407
10899
|
return text || null;
|
|
@@ -11415,7 +10907,7 @@ function objectValue6(value) {
|
|
|
11415
10907
|
function arrayValue8(value) {
|
|
11416
10908
|
return Array.isArray(value) ? value : null;
|
|
11417
10909
|
}
|
|
11418
|
-
function
|
|
10910
|
+
function stringValue9(value) {
|
|
11419
10911
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
11420
10912
|
}
|
|
11421
10913
|
function numericValue2(value) {
|
|
@@ -11523,7 +11015,7 @@ function AgentEditContent({
|
|
|
11523
11015
|
"use memo";
|
|
11524
11016
|
const files = getFileChangeRenderData(call);
|
|
11525
11017
|
const [file] = files;
|
|
11526
|
-
const path = file?.path ??
|
|
11018
|
+
const path = file?.path ?? stringValue9(call.input?.path) ?? stringValue9(call.input?.file_path) ?? stringValue9(call.input?.filePath) ?? null;
|
|
11527
11019
|
const patchFiles = files.filter((candidate) => candidate.unifiedDiff);
|
|
11528
11020
|
const diffFiles = files.filter(
|
|
11529
11021
|
(candidate) => !candidate.unifiedDiff && candidate.oldString !== null && candidate.newString !== null
|
|
@@ -11696,13 +11188,13 @@ function normalizeLinks(value, output) {
|
|
|
11696
11188
|
const explicitLinks = arrayValue8(value)?.map(optionRecord).filter(
|
|
11697
11189
|
(candidate) => candidate !== null
|
|
11698
11190
|
).flatMap((link) => {
|
|
11699
|
-
const url =
|
|
11191
|
+
const url = stringValue9(link.url);
|
|
11700
11192
|
if (!url) {
|
|
11701
11193
|
return [];
|
|
11702
11194
|
}
|
|
11703
11195
|
return [
|
|
11704
11196
|
{
|
|
11705
|
-
title:
|
|
11197
|
+
title: stringValue9(link.title) ?? url,
|
|
11706
11198
|
url,
|
|
11707
11199
|
domain: domainForUrl2(url)
|
|
11708
11200
|
}
|
|
@@ -11723,13 +11215,13 @@ function normalizeLinks(value, output) {
|
|
|
11723
11215
|
const parsed = JSON.parse(linksJson);
|
|
11724
11216
|
return parsed.flatMap((entry) => {
|
|
11725
11217
|
const link = optionRecord(entry);
|
|
11726
|
-
const url =
|
|
11218
|
+
const url = stringValue9(link?.url);
|
|
11727
11219
|
if (!url) {
|
|
11728
11220
|
return [];
|
|
11729
11221
|
}
|
|
11730
11222
|
return [
|
|
11731
11223
|
{
|
|
11732
|
-
title:
|
|
11224
|
+
title: stringValue9(link?.title) ?? url,
|
|
11733
11225
|
url,
|
|
11734
11226
|
domain: domainForUrl2(url)
|
|
11735
11227
|
}
|
|
@@ -11814,7 +11306,7 @@ function approvalPreviewCall(call) {
|
|
|
11814
11306
|
return null;
|
|
11815
11307
|
}
|
|
11816
11308
|
const normalizedKind = normalizeToolKind(
|
|
11817
|
-
|
|
11309
|
+
stringValue9(toolCall.kind) ?? stringValue9(toolCall.title) ?? stringValue9(toolCall.toolName)
|
|
11818
11310
|
);
|
|
11819
11311
|
const preview = approvalPreviewKindFor(normalizedKind);
|
|
11820
11312
|
if (!preview) {
|
|
@@ -11827,10 +11319,10 @@ function approvalPreviewCall(call) {
|
|
|
11827
11319
|
kind: "tool-call",
|
|
11828
11320
|
id: `${call.id}:approval-preview`,
|
|
11829
11321
|
turnId: call.turnId,
|
|
11830
|
-
name:
|
|
11322
|
+
name: stringValue9(toolCall.title) ?? call.name,
|
|
11831
11323
|
toolName: preview.toolName,
|
|
11832
11324
|
callType: "tool",
|
|
11833
|
-
status:
|
|
11325
|
+
status: stringValue9(toolCall.status) ?? call.status,
|
|
11834
11326
|
statusKind: call.statusKind,
|
|
11835
11327
|
summary: "",
|
|
11836
11328
|
compactSummary: null,
|
|
@@ -11866,7 +11358,7 @@ function AgentAskUserQuestionContent({
|
|
|
11866
11358
|
}) {
|
|
11867
11359
|
"use memo";
|
|
11868
11360
|
const questions = call.askUserQuestion?.questions ?? [];
|
|
11869
|
-
const outputText =
|
|
11361
|
+
const outputText = stringValue10(call.output?.text);
|
|
11870
11362
|
if (questions.length === 0) {
|
|
11871
11363
|
return null;
|
|
11872
11364
|
}
|
|
@@ -11927,7 +11419,7 @@ function formatAnswer(answer) {
|
|
|
11927
11419
|
}
|
|
11928
11420
|
return typeof answer === "string" && answer.trim() ? answer.trim() : null;
|
|
11929
11421
|
}
|
|
11930
|
-
function
|
|
11422
|
+
function stringValue10(value) {
|
|
11931
11423
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
11932
11424
|
}
|
|
11933
11425
|
|
|
@@ -12004,7 +11496,7 @@ function AgentBashContent({
|
|
|
12004
11496
|
}) {
|
|
12005
11497
|
"use memo";
|
|
12006
11498
|
const commandData = getCommandRenderData(call);
|
|
12007
|
-
const fallbackErrorText = commandData.status === "failed" && !commandData.stdout && !commandData.stderr ?
|
|
11499
|
+
const fallbackErrorText = commandData.status === "failed" && !commandData.stdout && !commandData.stderr ? stringValue9(call.error?.message) : null;
|
|
12008
11500
|
return /* @__PURE__ */ jsx37("div", { className: "workspace-agents-status-panel__detail-tool-body workspace-agents-status-panel__detail-tool-body--plain", children: /* @__PURE__ */ jsx37(
|
|
12009
11501
|
AgentTerminalBlock,
|
|
12010
11502
|
{
|
|
@@ -12132,8 +11624,8 @@ function normalizeMcpPayload(call) {
|
|
|
12132
11624
|
toolName: call.toolName,
|
|
12133
11625
|
name: call.name
|
|
12134
11626
|
});
|
|
12135
|
-
const server = target?.server ??
|
|
12136
|
-
const tool = target?.tool ??
|
|
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;
|
|
12137
11629
|
const structured = firstStructuredValue(
|
|
12138
11630
|
call.output?.structuredContent,
|
|
12139
11631
|
parseJsonString(call.output?.content),
|
|
@@ -12143,19 +11635,19 @@ function normalizeMcpPayload(call) {
|
|
|
12143
11635
|
return {
|
|
12144
11636
|
server,
|
|
12145
11637
|
tool,
|
|
12146
|
-
inputSummary:
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
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)
|
|
12152
11644
|
),
|
|
12153
11645
|
structured,
|
|
12154
|
-
text:
|
|
11646
|
+
text: firstString5(
|
|
12155
11647
|
contentArrayText(call.output?.content),
|
|
12156
|
-
|
|
12157
|
-
|
|
12158
|
-
|
|
11648
|
+
stringValue9(call.output?.content),
|
|
11649
|
+
stringValue9(call.output?.output),
|
|
11650
|
+
stringValue9(call.output?.stdout)
|
|
12159
11651
|
)
|
|
12160
11652
|
};
|
|
12161
11653
|
}
|
|
@@ -12190,21 +11682,21 @@ function parsedItems(value) {
|
|
|
12190
11682
|
return [];
|
|
12191
11683
|
}
|
|
12192
11684
|
function itemPrimaryText(item) {
|
|
12193
|
-
return
|
|
12194
|
-
|
|
12195
|
-
|
|
12196
|
-
|
|
12197
|
-
|
|
12198
|
-
|
|
12199
|
-
|
|
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)
|
|
12200
11692
|
);
|
|
12201
11693
|
}
|
|
12202
11694
|
function itemSecondaryText(item) {
|
|
12203
|
-
return
|
|
12204
|
-
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
|
|
11695
|
+
return firstString5(
|
|
11696
|
+
stringValue9(item.summary),
|
|
11697
|
+
stringValue9(item.description),
|
|
11698
|
+
stringValue9(item.status),
|
|
11699
|
+
stringValue9(item.type)
|
|
12208
11700
|
);
|
|
12209
11701
|
}
|
|
12210
11702
|
function firstStructuredValue(...values) {
|
|
@@ -12239,16 +11731,16 @@ function contentArrayText(value) {
|
|
|
12239
11731
|
return [];
|
|
12240
11732
|
}
|
|
12241
11733
|
return [
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
|
|
12245
|
-
|
|
11734
|
+
firstString5(
|
|
11735
|
+
stringValue9(record.text),
|
|
11736
|
+
stringValue9(record.content),
|
|
11737
|
+
stringValue9(objectValue6(record.content)?.text)
|
|
12246
11738
|
)
|
|
12247
11739
|
].filter((candidate) => Boolean(candidate));
|
|
12248
11740
|
}).join("\n").trim();
|
|
12249
11741
|
return text || null;
|
|
12250
11742
|
}
|
|
12251
|
-
function
|
|
11743
|
+
function firstString5(...values) {
|
|
12252
11744
|
for (const value of values) {
|
|
12253
11745
|
if (value) {
|
|
12254
11746
|
return value;
|
|
@@ -12714,7 +12206,7 @@ function AgentWriteContent({
|
|
|
12714
12206
|
"use memo";
|
|
12715
12207
|
const files = getFileChangeRenderData(call);
|
|
12716
12208
|
const [file] = files;
|
|
12717
|
-
const path = file?.path ??
|
|
12209
|
+
const path = file?.path ?? stringValue9(call.input?.path) ?? stringValue9(call.input?.file_path) ?? stringValue9(call.input?.filePath) ?? null;
|
|
12718
12210
|
const contentFiles = files.filter((candidate) => candidate.content);
|
|
12719
12211
|
const contentPaths = new Set(contentFiles.map((candidate) => candidate.path));
|
|
12720
12212
|
const patchFiles = files.filter(
|
|
@@ -13021,7 +12513,7 @@ function AgentSubAgentCards({
|
|
|
13021
12513
|
subAgent,
|
|
13022
12514
|
onLinkClick
|
|
13023
12515
|
},
|
|
13024
|
-
subAgent.
|
|
12516
|
+
subAgent.childSessionId
|
|
13025
12517
|
)) });
|
|
13026
12518
|
}
|
|
13027
12519
|
var AgentSubAgentCard = memo(
|
|
@@ -13029,7 +12521,7 @@ var AgentSubAgentCard = memo(
|
|
|
13029
12521
|
(prev, next) => prev.onLinkClick === next.onLinkClick && subAgentVMEquals(prev.subAgent, next.subAgent)
|
|
13030
12522
|
);
|
|
13031
12523
|
function subAgentVMEquals(left, right) {
|
|
13032
|
-
return left.
|
|
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;
|
|
13033
12525
|
}
|
|
13034
12526
|
function AgentSubAgentCardImpl({
|
|
13035
12527
|
subAgent,
|
|
@@ -13109,12 +12601,21 @@ function SubAgentHeader({
|
|
|
13109
12601
|
);
|
|
13110
12602
|
}
|
|
13111
12603
|
function SubAgentBody({
|
|
13112
|
-
subAgent
|
|
12604
|
+
subAgent,
|
|
12605
|
+
onLinkClick
|
|
13113
12606
|
}) {
|
|
13114
12607
|
"use memo";
|
|
13115
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: [
|
|
13116
12609
|
subAgent.task ? /* @__PURE__ */ jsx56("div", { className: "workspace-agents-status-panel__detail-subagent-task-strip", children: subAgent.task }) : null,
|
|
13117
|
-
/* @__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
|
|
13118
12619
|
] }) });
|
|
13119
12620
|
}
|
|
13120
12621
|
function SubAgentProgress({
|
|
@@ -15313,9 +14814,8 @@ function useProjectedAgentConversation({
|
|
|
15313
14814
|
|
|
15314
14815
|
export {
|
|
15315
14816
|
Button,
|
|
15316
|
-
|
|
15317
|
-
|
|
15318
|
-
attachSubAgentLanesToConversationVM,
|
|
14817
|
+
isWorkspaceAgentToolCallItem,
|
|
14818
|
+
resolveWorkspaceAgentToolName,
|
|
15319
14819
|
buildWorkspaceAgentSessionDetailViewModel,
|
|
15320
14820
|
skillTriggerForPrefix,
|
|
15321
14821
|
labelForProviderSkill,
|
|
@@ -15355,4 +14855,4 @@ export {
|
|
|
15355
14855
|
AgentConversationFlow,
|
|
15356
14856
|
useProjectedAgentConversation
|
|
15357
14857
|
};
|
|
15358
|
-
//# sourceMappingURL=chunk-
|
|
14858
|
+
//# sourceMappingURL=chunk-HLVC4NNL.js.map
|