@agent-native/toolkit 0.226.0 → 0.226.1-nightly-20261107004051
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/app/agentkit/react/components.d.ts +11 -9
- package/dist/app/agentkit/react/components.d.ts.map +1 -1
- package/dist/app/agentkit/react/components.js +115 -111
- package/dist/app/agentkit/react/components.js.map +1 -1
- package/dist/app/agentkit/react/stop-button.js +5 -5
- package/dist/app/agentkit/react/stop-button.js.map +1 -1
- package/dist/app/agentkit/react/styles.css +19 -48
- package/dist/app/auth/AuthPage.d.ts.map +1 -1
- package/dist/app/auth/AuthPage.js +7 -5
- package/dist/app/auth/AuthPage.js.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.js +7 -2
- package/dist/app/chat/AgentKitAssistantChat.js.map +1 -1
- package/dist/app/integrations/IntegrationDetailPage.d.ts.map +1 -1
- package/dist/app/integrations/IntegrationDetailPage.js +43 -1
- package/dist/app/integrations/IntegrationDetailPage.js.map +1 -1
- package/dist/app/integrations/IntegrationsPage.d.ts.map +1 -1
- package/dist/app/integrations/IntegrationsPage.js +16 -7
- package/dist/app/integrations/IntegrationsPage.js.map +1 -1
- package/dist/app/integrations/connected-server-id.d.ts +17 -0
- package/dist/app/integrations/connected-server-id.d.ts.map +1 -0
- package/dist/app/integrations/connected-server-id.js +26 -0
- package/dist/app/integrations/connected-server-id.js.map +1 -0
- package/dist/composer/TiptapComposer.d.ts +5 -3
- package/dist/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/composer/TiptapComposer.js +1 -1
- package/dist/composer/TiptapComposer.js.map +1 -1
- package/package.json +4 -4
- package/src/app/agentkit/react/components.interaction.spec.tsx +112 -0
- package/src/app/agentkit/react/components.tsx +178 -192
- package/src/app/agentkit/react/lifecycle.spec.tsx +5 -16
- package/src/app/agentkit/react/stop-button.spec.tsx +1 -1
- package/src/app/agentkit/react/stop-button.tsx +5 -5
- package/src/app/agentkit/react/styles.css +19 -48
- package/src/app/agentkit/react/work-handoff.spec.tsx +202 -69
- package/src/app/auth/AuthPage.interaction.spec.tsx +17 -1
- package/src/app/auth/AuthPage.tsx +12 -4
- package/src/app/chat/AgentKitAssistantChat.tsx +6 -2
- package/src/app/integrations/IntegrationDetailPage.spec.tsx +30 -0
- package/src/app/integrations/IntegrationDetailPage.tsx +85 -1
- package/src/app/integrations/IntegrationsPage.spec.tsx +74 -0
- package/src/app/integrations/IntegrationsPage.tsx +47 -20
- package/src/app/integrations/connected-server-id.ts +34 -0
- package/src/composer/TiptapComposer.spec.ts +7 -7
- package/src/composer/TiptapComposer.tsx +12 -13
- package/src/composer/TiptapComposer.voice-toolbar.spec.tsx +24 -1
|
@@ -82,18 +82,20 @@ export declare function formatAgentKitDuration(ms: number, units?: {
|
|
|
82
82
|
minute?: string;
|
|
83
83
|
second?: string;
|
|
84
84
|
}): string;
|
|
85
|
-
export declare const AgentActivityGroup: import("react").MemoExoticComponent<({ runId, afterSequence, throughSequence, excludeAgentActivities, isCurrentSegment, messageId, foldedReasoningMessageId, summarizesTurn, }: {
|
|
86
|
-
runId?: RunId;
|
|
87
|
-
afterSequence?: number;
|
|
88
|
-
throughSequence?: number;
|
|
89
|
-
excludeAgentActivities?: boolean;
|
|
90
|
-
isCurrentSegment?: boolean;
|
|
85
|
+
export declare const AgentActivityGroup: import("react").MemoExoticComponent<({ runId, afterSequence, throughSequence, excludeAgentActivities, isCurrentSegment, messageId, foldedReasoningMessageId, summarizesTurn, part, }: {
|
|
86
|
+
runId?: RunId | undefined;
|
|
87
|
+
afterSequence?: number | undefined;
|
|
88
|
+
throughSequence?: number | undefined;
|
|
89
|
+
excludeAgentActivities?: boolean | undefined;
|
|
90
|
+
isCurrentSegment?: boolean | undefined;
|
|
91
91
|
/** The reply this work segment precedes. */
|
|
92
|
-
messageId?: string;
|
|
92
|
+
messageId?: string | undefined;
|
|
93
93
|
/** A saved reply whose reasoning before its answer joins this group. */
|
|
94
|
-
foldedReasoningMessageId?: string;
|
|
94
|
+
foldedReasoningMessageId?: string | undefined;
|
|
95
95
|
/** This segment is its run's whole turn, so it shows a row with no work. */
|
|
96
|
-
summarizesTurn?: boolean;
|
|
96
|
+
summarizesTurn?: boolean | undefined;
|
|
97
|
+
/** Only the steps' result cards, or only the work row; both by default. */
|
|
98
|
+
part?: "results" | "row" | undefined;
|
|
97
99
|
}) => import("react").JSX.Element | null>;
|
|
98
100
|
/** True inside a work step's expanded reasoning, where the step is the disclosure. */
|
|
99
101
|
export declare function useAgentKitInWorkStep(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/app/agentkit/react/components.tsx"],"names":[],"mappings":"AAkDA,OAAO,EAGL,SAAS,EAeT,KAAK,aAAa,EAClB,KAAK,SAAS,EAKd,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AASf,OAAO,EAYL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAO1B,MAAM,sBAAsB,CAAC;AAgB9B,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAW3E,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAE3B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAGd,KAAK,WAAW,EAChB,KAAK,KAAK,EACX,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAaL,KAAK,+BAA+B,EAIpC,KAAK,mBAAmB,EAKxB,KAAK,0BAA0B,EAChC,MAAM,cAAc,CAAC;AAetB,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAqBhC,MAAM,WAA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AE,iBAAiB,+BAgoDnB;AAED,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1182,7 +1182,7 @@ function sameRunWork(previous, next, runId) {
|
|
|
1182
1182
|
}
|
|
1183
1183
|
return true;
|
|
1184
1184
|
}
|
|
1185
|
-
export const AgentActivityGroup = memo(function AgentActivityGroup({ runId, afterSequence, throughSequence, excludeAgentActivities = false, isCurrentSegment = true, messageId, foldedReasoningMessageId, summarizesTurn = false, }) {
|
|
1185
|
+
export const AgentActivityGroup = memo(function AgentActivityGroup({ runId, afterSequence, throughSequence, excludeAgentActivities = false, isCurrentSegment = true, messageId, foldedReasoningMessageId, summarizesTurn = false, part, }) {
|
|
1186
1186
|
const { threadId, slots, registry, labels, formatWorkedForDuration, loadRunUsage, } = useAgentKit();
|
|
1187
1187
|
const thread = useAgentThreadSlice((previous, next) => sameRunWork(previous, next, runId));
|
|
1188
1188
|
const runEvents = agentRunEvents(thread, runId);
|
|
@@ -1425,6 +1425,9 @@ export const AgentActivityGroup = memo(function AgentActivityGroup({ runId, afte
|
|
|
1425
1425
|
minute: labels.durationMinuteShort,
|
|
1426
1426
|
second: labels.durationSecondShort,
|
|
1427
1427
|
});
|
|
1428
|
+
const resultCards = durableToolResults.length && part !== "row" ? (_jsx("div", { "data-agentkit-tool-results": "true", children: durableToolResults.map(({ tool, Renderer }) => (_jsx(Renderer, { value: tool, threadId: threadId }, tool.id))) })) : null;
|
|
1429
|
+
if (part === "results")
|
|
1430
|
+
return resultCards;
|
|
1428
1431
|
if (activityItems.length === 0 &&
|
|
1429
1432
|
durableToolResults.length === 0 &&
|
|
1430
1433
|
!activelyWorking) {
|
|
@@ -1524,7 +1527,7 @@ export const AgentActivityGroup = memo(function AgentActivityGroup({ runId, afte
|
|
|
1524
1527
|
AgentActivityItem;
|
|
1525
1528
|
return _jsx(Renderer, { value: call.activity, threadId: threadId }, call.id);
|
|
1526
1529
|
};
|
|
1527
|
-
return (_jsxs(_Fragment, { children: [
|
|
1530
|
+
return (_jsxs(_Fragment, { children: [resultCards, hasExpandableActivity || activelyWorking ? (_jsx(AgentWorkDisclosure, { label: baseSummaryLabel, failedCount: failedCount, icon: summaryIcon, running: visiblyRunning, expandable: hasExpandableActivity, runId: runId, messageId: messageId, current: currentActivity ? (_jsxs("span", { className: "agentkit-activities-current", "data-running": "true", "data-agentkit-current-activity": "true", children: [_jsx(ActivitySourceIcon, { activity: currentActivity, threadId: threadId, compact: true }), _jsx("span", { className: "agentkit-activities-current-label agent-running-shimmer", children: currentActivityLabel })] })) : null, currentLabel: currentActivity ? (_jsx("span", { className: "agentkit-activities-current", "data-running": "true", "data-agentkit-current-activity": "true", children: _jsx("span", { className: "agentkit-activities-current-label agent-running-shimmer", children: currentActivityLabel }) })) : null, children: _jsx(AgentWorkStepList, { steps: steps, threadId: threadId, running: activelyWorking, renderCall: renderCall }) })) : (_jsx("div", { className: "agentkit-activities-static", children: summaryLabel || currentActivity ? (_jsx(AgentKitDisclosureSummary, { as: "static", className: "agentkit-activities-summary", open: false, onToggle: () => { }, expandable: false, icon: summaryIcon, label: summaryLabel ? (_jsx("span", { className: "agentkit-activities-label", children: summaryLabel })) : (_jsx("span", { className: "agentkit-activities-current", "data-running": "true", "data-agentkit-current-activity": "true", children: _jsx("span", { className: "agentkit-activities-current-label agent-running-shimmer", children: currentActivityLabel }) })) })) : null }))] }));
|
|
1528
1531
|
});
|
|
1529
1532
|
const WORK_STEP_PREVIEW_COUNT = 6;
|
|
1530
1533
|
const WORK_GROUP_PREVIEW_COUNT = 4;
|
|
@@ -1724,7 +1727,16 @@ function AgentWorkStepList({ steps, threadId, running, renderCall, }) {
|
|
|
1724
1727
|
}
|
|
1725
1728
|
function AgentWorkDisclosure({ label, failedCount = 0, icon, running, expandable = true, current, currentLabel, runId, messageId, children, }) {
|
|
1726
1729
|
const { slots, labels, workedForRowLayout } = useAgentKit();
|
|
1727
|
-
const
|
|
1730
|
+
const row = useContext(AgentWorkRowOpenContext);
|
|
1731
|
+
const [open, setOpen] = useState(() => row?.opened.has(row.key) ?? false);
|
|
1732
|
+
useEffect(() => {
|
|
1733
|
+
if (!row)
|
|
1734
|
+
return;
|
|
1735
|
+
if (open)
|
|
1736
|
+
row.opened.add(row.key);
|
|
1737
|
+
else
|
|
1738
|
+
row.opened.delete(row.key);
|
|
1739
|
+
}, [open, row]);
|
|
1728
1740
|
const contentId = useId();
|
|
1729
1741
|
const Summary = slots.workedForSummary;
|
|
1730
1742
|
const failed = label && failedCount > 0
|
|
@@ -1736,9 +1748,7 @@ function AgentWorkDisclosure({ label, failedCount = 0, icon, running, expandable
|
|
|
1736
1748
|
? failed.split("{{summary}}")
|
|
1737
1749
|
: ["", ""];
|
|
1738
1750
|
const fullLabel = failed ? failed.replace("{{summary}}", () => label) : label;
|
|
1739
|
-
const
|
|
1740
|
-
const footerHost = footer?.element ?? null;
|
|
1741
|
-
const handoff = useAgentWorkHandoff(running, footer, setOpen);
|
|
1751
|
+
const footerHost = useAgentMessageWorkHost(messageId);
|
|
1742
1752
|
const summaryLabel = label ? (_jsx("span", { className: "agentkit-activities-label", children: failedBefore || failedAfter ? (_jsxs(_Fragment, { children: [failedBefore, label, _jsx("span", { className: "agentkit-activities-failed", children: failedAfter })] })) : (fullLabel) })) : (currentLabel);
|
|
1743
1753
|
const summaryContent = Summary ? (_jsx(Summary, { label: fullLabel, ...(running === undefined ? {} : { running }), expandable: expandable, open: open, current: current, ...(workedForRowLayout === undefined
|
|
1744
1754
|
? {}
|
|
@@ -1746,61 +1756,10 @@ function AgentWorkDisclosure({ label, failedCount = 0, icon, running, expandable
|
|
|
1746
1756
|
// The row stays one mounted trigger from "Thinking" through the first
|
|
1747
1757
|
// activity, so it never flickers; until then it is not a tab stop. Finished
|
|
1748
1758
|
// work with nothing to expand is text, not a disabled button.
|
|
1749
|
-
const disclosure = (_jsxs("div", {
|
|
1750
|
-
//
|
|
1751
|
-
//
|
|
1752
|
-
|
|
1753
|
-
// reply glides up instead of jumping.
|
|
1754
|
-
return (_jsxs(_Fragment, { children: [handoff.leavingHeight ? (_jsx("div", { className: "agentkit-work-handoff", "data-agentkit-work-handoff": "leave", "aria-hidden": "true", inert: true, style: {
|
|
1755
|
-
"--agentkit-work-handoff-size": `${handoff.leavingHeight}px`,
|
|
1756
|
-
}, children: _jsx(AgentKitDisclosureSummary, { as: "static", className: "agentkit-activities-summary", rowClassName: "agentkit-activities-row", open: false, onToggle: noop, expandable: false, style: workedForRowSummaryStyle(workedForRowLayout), icon: icon, label: summaryLabel, children: summaryContent }) })) : null, footerHost ? createPortal(disclosure, footerHost) : disclosure] }));
|
|
1757
|
-
}
|
|
1758
|
-
const AGENT_WORK_HANDOFF_MS = 180;
|
|
1759
|
-
/**
|
|
1760
|
-
* Tracks a work row's move from above its reply to the reply's footer. Only
|
|
1761
|
-
* a finish seen live animates (the row ran, or its reply streamed): a saved
|
|
1762
|
-
* thread renders the row in place for one unpainted pass before its host
|
|
1763
|
-
* registers, and that must not read as a finish. A row opened to watch live
|
|
1764
|
-
* work closes as it moves, so its steps never land below the reply.
|
|
1765
|
-
*/
|
|
1766
|
-
function useAgentWorkHandoff(running, footer, setOpen) {
|
|
1767
|
-
const prefersReducedMotion = usePrefersReducedMotion();
|
|
1768
|
-
const footerHost = footer?.element ?? null;
|
|
1769
|
-
const live = footer?.live ?? false;
|
|
1770
|
-
const inPlaceRef = useRef(null);
|
|
1771
|
-
const sawRunningRef = useRef(false);
|
|
1772
|
-
const inPlaceHeightRef = useRef(0);
|
|
1773
|
-
const previousHostRef = useRef(null);
|
|
1774
|
-
const [leavingHeight, setLeavingHeight] = useState(0);
|
|
1775
|
-
// Measured on every in-place commit, because once the row portals away
|
|
1776
|
-
// its old box is gone. The placeholder keeps the row's margins from the
|
|
1777
|
-
// stylesheet, so only the border box is carried over.
|
|
1778
|
-
useLayoutEffect(() => {
|
|
1779
|
-
if (running)
|
|
1780
|
-
sawRunningRef.current = true;
|
|
1781
|
-
if (footerHost || !inPlaceRef.current)
|
|
1782
|
-
return;
|
|
1783
|
-
inPlaceHeightRef.current = inPlaceRef.current.offsetHeight;
|
|
1784
|
-
});
|
|
1785
|
-
useLayoutEffect(() => {
|
|
1786
|
-
const previousHost = previousHostRef.current;
|
|
1787
|
-
previousHostRef.current = footerHost;
|
|
1788
|
-
if (!footerHost || previousHost)
|
|
1789
|
-
return;
|
|
1790
|
-
if (!live && !sawRunningRef.current)
|
|
1791
|
-
return;
|
|
1792
|
-
setOpen(false);
|
|
1793
|
-
if (prefersReducedMotion || inPlaceHeightRef.current <= 0)
|
|
1794
|
-
return;
|
|
1795
|
-
setLeavingHeight(inPlaceHeightRef.current);
|
|
1796
|
-
}, [footerHost, live, prefersReducedMotion, setOpen]);
|
|
1797
|
-
useEffect(() => {
|
|
1798
|
-
if (!leavingHeight)
|
|
1799
|
-
return;
|
|
1800
|
-
const timer = setTimeout(() => setLeavingHeight(0), AGENT_WORK_HANDOFF_MS + 60);
|
|
1801
|
-
return () => clearTimeout(timer);
|
|
1802
|
-
}, [leavingHeight]);
|
|
1803
|
-
return { inPlaceRef, leavingHeight: footerHost ? leavingHeight : 0 };
|
|
1759
|
+
const disclosure = (_jsxs("div", { className: "agentkit-activities", "data-running": running ? "true" : undefined, "data-expandable": expandable ? "true" : "false", "data-open": open ? "true" : "false", children: [_jsx(AgentKitDisclosureSummary, { as: expandable || running ? "button" : "static", className: "agentkit-activities-summary", rowClassName: "agentkit-activities-row", open: open, onToggle: () => setOpen((value) => !value), expandable: expandable, controls: contentId, style: workedForRowSummaryStyle(workedForRowLayout), chevronStyle: workedForRowChevronStyle(workedForRowLayout), icon: icon, label: summaryLabel, children: summaryContent }), _jsxs(AgentKitDisclosureContent, { id: contentId, open: open, onReveal: expandable ? () => setOpen(true) : undefined, children: [runId && expandable && !running ? (_jsx(AgentRunDetails, { runId: runId, messageId: messageId, open: open })) : null, children] })] }));
|
|
1760
|
+
// A reply's work sits on its footer line, live or finished, so the finish
|
|
1761
|
+
// never moves it.
|
|
1762
|
+
return footerHost ? createPortal(disclosure, footerHost) : disclosure;
|
|
1804
1763
|
}
|
|
1805
1764
|
function AgentReasoningPartDisclosure({ label, text, active, resetKey, }) {
|
|
1806
1765
|
const [open, setOpen] = useState(false);
|
|
@@ -2497,15 +2456,14 @@ function createAgentMessageWorkHosts() {
|
|
|
2497
2456
|
};
|
|
2498
2457
|
return {
|
|
2499
2458
|
get: (messageId) => hosts.get(messageId),
|
|
2500
|
-
set(messageId,
|
|
2501
|
-
|
|
2502
|
-
if (current?.element === host.element && current.live === host.live)
|
|
2459
|
+
set(messageId, element) {
|
|
2460
|
+
if (hosts.get(messageId) === element)
|
|
2503
2461
|
return;
|
|
2504
|
-
hosts.set(messageId,
|
|
2462
|
+
hosts.set(messageId, element);
|
|
2505
2463
|
notify();
|
|
2506
2464
|
},
|
|
2507
2465
|
release(messageId, element) {
|
|
2508
|
-
if (hosts.get(messageId)
|
|
2466
|
+
if (hosts.get(messageId) !== element)
|
|
2509
2467
|
return;
|
|
2510
2468
|
hosts.delete(messageId);
|
|
2511
2469
|
notify();
|
|
@@ -2516,6 +2474,12 @@ function createAgentMessageWorkHosts() {
|
|
|
2516
2474
|
},
|
|
2517
2475
|
};
|
|
2518
2476
|
}
|
|
2477
|
+
/**
|
|
2478
|
+
* The work rows the reader opened, by run and segment. A segment's row
|
|
2479
|
+
* remounts when narration hides it and again when the run finishes, and an
|
|
2480
|
+
* opened row comes back open.
|
|
2481
|
+
*/
|
|
2482
|
+
const AgentWorkRowOpenContext = createContext(null);
|
|
2519
2483
|
const AgentMessageWorkHostsContext = createContext(null);
|
|
2520
2484
|
function noopSubscribe() {
|
|
2521
2485
|
return () => undefined;
|
|
@@ -2524,22 +2488,16 @@ function useAgentMessageWorkHost(messageId) {
|
|
|
2524
2488
|
const hosts = useContext(AgentMessageWorkHostsContext);
|
|
2525
2489
|
return useSyncExternalStore(hosts?.subscribe ?? noopSubscribe, () => (messageId ? (hosts?.get(messageId) ?? null) : null), () => null);
|
|
2526
2490
|
}
|
|
2527
|
-
/**
|
|
2528
|
-
|
|
2529
|
-
* the reply stops streaming.
|
|
2530
|
-
*/
|
|
2531
|
-
function useAgentMessageWorkHostRef(messageId, streaming) {
|
|
2491
|
+
/** A callback ref that offers its element as a reply's work row host. */
|
|
2492
|
+
function useAgentMessageWorkHostRef(messageId) {
|
|
2532
2493
|
const hosts = useContext(AgentMessageWorkHostsContext);
|
|
2533
2494
|
const [element, setElement] = useState(null);
|
|
2534
|
-
const sawStreamingRef = useRef(false);
|
|
2535
2495
|
useLayoutEffect(() => {
|
|
2536
|
-
if (
|
|
2537
|
-
sawStreamingRef.current = true;
|
|
2538
|
-
if (!hosts || !messageId || !element || streaming)
|
|
2496
|
+
if (!hosts || !messageId || !element)
|
|
2539
2497
|
return;
|
|
2540
|
-
hosts.set(messageId,
|
|
2498
|
+
hosts.set(messageId, element);
|
|
2541
2499
|
return () => hosts.release(messageId, element);
|
|
2542
|
-
}, [element, hosts, messageId
|
|
2500
|
+
}, [element, hosts, messageId]);
|
|
2543
2501
|
return setElement;
|
|
2544
2502
|
}
|
|
2545
2503
|
const RUN_USAGE_CACHE_MS = 5 * 60_000;
|
|
@@ -2804,8 +2762,8 @@ export const AgentMessageActions = memo(function AgentMessageActions({ value: me
|
|
|
2804
2762
|
const { messageSeq, requestId, runId } = position;
|
|
2805
2763
|
const isAssistant = message.role === "assistant";
|
|
2806
2764
|
const isLastAssistantMessage = isAssistant && position.isLast;
|
|
2807
|
-
//
|
|
2808
|
-
const workHostRef = useAgentMessageWorkHostRef(isAssistant ? message.id : undefined
|
|
2765
|
+
// The reply's work row sits on this footer line, live or finished.
|
|
2766
|
+
const workHostRef = useAgentMessageWorkHostRef(isAssistant ? message.id : undefined);
|
|
2809
2767
|
const [copied, setCopied] = useState(false);
|
|
2810
2768
|
const [feedback, setFeedback] = useState(null);
|
|
2811
2769
|
const [feedbackConfirmed, setFeedbackConfirmed] = useState(false);
|
|
@@ -3152,7 +3110,7 @@ export function AgentRunFailure({ error, runId, threadId, }) {
|
|
|
3152
3110
|
// A failure the user can recover from is a warning; red means it is final.
|
|
3153
3111
|
const tone = error.retryable === true ? "warning" : "danger";
|
|
3154
3112
|
const ToneIcon = tone === "warning" ? IconAlertTriangle : IconAlertCircle;
|
|
3155
|
-
return (_jsxs("div", { className: "agentkit-run-failure", "data-tone": tone, "data-error-code": error.code, "data-run-id": runId, "data-thread-id": threadId, role: !superseded && latestFailure ? "alert" : undefined, children: [_jsx(ToneIcon, { "aria-hidden": "true", className: "agentkit-icon" }), _jsxs("div", { className: "agentkit-run-failure-copy", children: [_jsx("strong", { children: labels.runFailed }), _jsx("span", { ...SESSION_REPLAY_MASK_PROPS, children: error.message }), canContinue ? (_jsx("div", { className: "agentkit-error-actions", children: _jsx(ActionButton, { emphasis: "outline", size: "compact", pending: continuing, onPress: continueRun, children: labels.continueRun }) })) : null, continueFailed ? (_jsx("span", { className: "agentkit-command-error", role: "alert", children: labels.continueRunUnavailable })) : null] })] }));
|
|
3113
|
+
return (_jsxs("div", { className: "agentkit-run-failure", "data-tone": tone, "data-error-code": error.code, "data-run-id": runId, "data-thread-id": threadId, role: !superseded && latestFailure ? "alert" : undefined, children: [_jsx(ToneIcon, { "aria-hidden": "true", className: "agentkit-icon" }), _jsxs("div", { className: "agentkit-run-failure-copy", children: [_jsx("strong", { children: labels.runFailed }), _jsx("span", { ...SESSION_REPLAY_MASK_PROPS, children: error.message }), canContinue ? (_jsx("div", { className: "agentkit-error-actions", children: _jsx(ActionButton, { emphasis: "outline", size: "compact", pending: continuing, onPress: continueRun, children: labels.continueRun }) })) : null, continueFailed && !superseded ? (_jsx("span", { className: "agentkit-command-error", role: "alert", children: labels.continueRunUnavailable })) : null] })] }));
|
|
3156
3114
|
}
|
|
3157
3115
|
export function AgentConnectionErrorView({ error, threadId, recover, recovering, recoveryError, dismiss, }) {
|
|
3158
3116
|
const { labels } = useAgentKit();
|
|
@@ -4043,6 +4001,7 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4043
4001
|
setMessage: setEditingMessage,
|
|
4044
4002
|
}), [editingMessage, messageEditEnabled, setEditingMessage]);
|
|
4045
4003
|
const [messageWorkHosts] = useState(createAgentMessageWorkHosts);
|
|
4004
|
+
const [openedWorkRows] = useState(() => new Set());
|
|
4046
4005
|
const hasConversation = thread.messages.length > 0 ||
|
|
4047
4006
|
pendingSubmissions.length > 0 ||
|
|
4048
4007
|
hasRenderedMessages;
|
|
@@ -4607,11 +4566,16 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4607
4566
|
const messageId = reasoningMessageId(event);
|
|
4608
4567
|
return messageId ? [messageId] : [];
|
|
4609
4568
|
}));
|
|
4569
|
+
// A saved reply's reasoning before its answer joins the work group above
|
|
4570
|
+
// it, so the turn shows one disclosure; the stream did not place it there.
|
|
4571
|
+
const foldsLeadingReasoning = (message) => message.status !== "streaming" &&
|
|
4572
|
+
!groupedReasoningMessageIds.has(message.id) &&
|
|
4573
|
+
leadingReasoningMessage(message) !== undefined;
|
|
4610
4574
|
const hasRunWork = (runId, afterSequence, throughSequence) => runWorkStarts.some((event) => event.runId === runId &&
|
|
4611
4575
|
sequenceInRange(event.sequence, { afterSequence, throughSequence }));
|
|
4612
4576
|
// A message the user sent into a running turn ends the run's work so far,
|
|
4613
4577
|
// even when no reply was written before it.
|
|
4614
|
-
const { runSegmentEnds, steerSequences } = useMemo(() => {
|
|
4578
|
+
const { runSegmentEnds, runSegmentStarts, steerSequences } = useMemo(() => {
|
|
4615
4579
|
const deliveredAt = new Map();
|
|
4616
4580
|
for (const event of thread.events) {
|
|
4617
4581
|
if (event.type === "message.created" &&
|
|
@@ -4621,16 +4585,22 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4621
4585
|
}
|
|
4622
4586
|
}
|
|
4623
4587
|
const ends = new Map();
|
|
4588
|
+
const starts = new Map();
|
|
4624
4589
|
const steers = new Map();
|
|
4590
|
+
const endSegment = (runId, id, sequence) => {
|
|
4591
|
+
const previous = ends.get(runId);
|
|
4592
|
+
if (previous)
|
|
4593
|
+
starts.set(runId, previous);
|
|
4594
|
+
ends.set(runId, { id, sequence });
|
|
4595
|
+
};
|
|
4625
4596
|
for (const message of thread.messages) {
|
|
4626
4597
|
const runId = messageRunIds.get(message.id);
|
|
4627
4598
|
if (!runId)
|
|
4628
4599
|
continue;
|
|
4629
4600
|
if (message.role === "assistant") {
|
|
4630
4601
|
const sequence = messageBoundarySequences.get(message.id);
|
|
4631
|
-
if (sequence !== undefined)
|
|
4632
|
-
|
|
4633
|
-
}
|
|
4602
|
+
if (sequence !== undefined)
|
|
4603
|
+
endSegment(runId, message.id, sequence);
|
|
4634
4604
|
continue;
|
|
4635
4605
|
}
|
|
4636
4606
|
const sequence = message.role === "user" ? deliveredAt.get(message.id) : undefined;
|
|
@@ -4645,9 +4615,13 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4645
4615
|
if (!workBefore)
|
|
4646
4616
|
continue;
|
|
4647
4617
|
steers.set(message.id, sequence);
|
|
4648
|
-
|
|
4618
|
+
endSegment(runId, message.id, sequence);
|
|
4649
4619
|
}
|
|
4650
|
-
return {
|
|
4620
|
+
return {
|
|
4621
|
+
runSegmentEnds: ends,
|
|
4622
|
+
runSegmentStarts: starts,
|
|
4623
|
+
steerSequences: steers,
|
|
4624
|
+
};
|
|
4651
4625
|
}, [
|
|
4652
4626
|
messageBoundarySequences,
|
|
4653
4627
|
messageRunIds,
|
|
@@ -4668,15 +4642,29 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4668
4642
|
...activeRunsBeforeAssistantOutput,
|
|
4669
4643
|
]));
|
|
4670
4644
|
const pendingRuns = new Set(pendingRunIds);
|
|
4671
|
-
//
|
|
4672
|
-
//
|
|
4673
|
-
//
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4645
|
+
// While a run works on its reply, the reply's work is one row below its
|
|
4646
|
+
// latest text, shown while work runs there: above the reply, narration
|
|
4647
|
+
// pushes it out of view, and split at that text, the work before reads as
|
|
4648
|
+
// finished while the run works. Result cards stay above the reply, where
|
|
4649
|
+
// they sit once it finishes. A finished reply with nothing running after
|
|
4650
|
+
// it keeps its row in its footer.
|
|
4651
|
+
const liveReplies = new Map();
|
|
4652
|
+
for (const [runId, reply] of lastAssistantMessagesByRun) {
|
|
4653
|
+
if (thread.runs[runId]?.status !== "running" ||
|
|
4654
|
+
runSegmentEnds.get(runId)?.id !== reply.id) {
|
|
4655
|
+
continue;
|
|
4656
|
+
}
|
|
4657
|
+
const start = runSegmentStarts.get(runId);
|
|
4658
|
+
const message = thread.messages.find(({ id }) => id === reply.id);
|
|
4659
|
+
if ((message?.status === "streaming" || pendingRuns.has(runId)) &&
|
|
4660
|
+
hasRunWork(runId, start?.sequence)) {
|
|
4661
|
+
liveReplies.set(runId, {
|
|
4662
|
+
replyId: reply.id,
|
|
4663
|
+
start,
|
|
4664
|
+
foldsReasoning: message ? foldsLeadingReasoning(message) : false,
|
|
4665
|
+
});
|
|
4666
|
+
}
|
|
4667
|
+
}
|
|
4680
4668
|
const runRevision = (runId) => `${runId}:${eventIndex.byRun.get(runId)?.length ?? 0}`;
|
|
4681
4669
|
const renderRunFailure = (runId) => {
|
|
4682
4670
|
const error = failedRuns.get(runId);
|
|
@@ -4704,8 +4692,9 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4704
4692
|
rowElementCacheRef.current.set(key, { deps, element });
|
|
4705
4693
|
return element;
|
|
4706
4694
|
};
|
|
4707
|
-
const renderRunWork = ({ runId, anchor, afterSequence, throughSequence, messageId, foldedReasoningMessageId, summarizesTurn, }) => {
|
|
4708
|
-
const
|
|
4695
|
+
const renderRunWork = ({ runId, anchor, afterSequence, throughSequence, messageId, foldedReasoningMessageId, summarizesTurn, part, }) => {
|
|
4696
|
+
const openKey = `${threadId}:${runId}:${anchor}`;
|
|
4697
|
+
const key = `run-work:${openKey}${part === "row" ? ":row" : ""}`;
|
|
4709
4698
|
const resetKey = `${anchor}:${runRevision(runId)}`;
|
|
4710
4699
|
return cachedRowElement(key, [
|
|
4711
4700
|
resetKey,
|
|
@@ -4714,8 +4703,10 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4714
4703
|
messageId,
|
|
4715
4704
|
foldedReasoningMessageId,
|
|
4716
4705
|
summarizesTurn,
|
|
4706
|
+
part,
|
|
4717
4707
|
], () => renderRunWorkElement({
|
|
4718
4708
|
key,
|
|
4709
|
+
openKey,
|
|
4719
4710
|
resetKey,
|
|
4720
4711
|
runId,
|
|
4721
4712
|
afterSequence,
|
|
@@ -4723,12 +4714,30 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4723
4714
|
messageId,
|
|
4724
4715
|
foldedReasoningMessageId,
|
|
4725
4716
|
summarizesTurn,
|
|
4717
|
+
part,
|
|
4726
4718
|
}));
|
|
4727
4719
|
};
|
|
4728
|
-
const renderRunWorkElement = ({ key, resetKey, runId, afterSequence, throughSequence, messageId, foldedReasoningMessageId, summarizesTurn, }) => (
|
|
4720
|
+
const renderRunWorkElement = ({ key, openKey, resetKey, runId, afterSequence, throughSequence, messageId, foldedReasoningMessageId, summarizesTurn, part, }) => (_jsx(AgentKitSurfaceBoundary, { surface: "activity", resetKey: resetKey, children: _jsxs(AgentWorkRowOpenContext.Provider, { value: { key: openKey, opened: openedWorkRows }, children: [part === "row" ? null : (_jsxs(_Fragment, { children: [_jsx(AgentCollaborationFeed, { runId: runId, afterSequence: afterSequence, throughSequence: throughSequence }), _jsx(AgentTaskGroup, { runId: runId, afterSequence: afterSequence, throughSequence: throughSequence })] })), _jsx(AgentActivityGroup, { runId: runId, afterSequence: afterSequence, throughSequence: throughSequence, excludeAgentActivities: true, isCurrentSegment: throughSequence === undefined, messageId: messageId, foldedReasoningMessageId: foldedReasoningMessageId, summarizesTurn: summarizesTurn, part: part })] }) }, key));
|
|
4729
4721
|
const renderRunTail = (runId) => {
|
|
4730
4722
|
const items = [];
|
|
4731
|
-
|
|
4723
|
+
const liveReply = liveReplies.get(runId);
|
|
4724
|
+
if (liveReply) {
|
|
4725
|
+
// While the reply's text is the newest output the text is the focus,
|
|
4726
|
+
// so the row shows only while work runs after it.
|
|
4727
|
+
if (pendingRuns.has(runId)) {
|
|
4728
|
+
items.push(renderRunWork({
|
|
4729
|
+
runId,
|
|
4730
|
+
anchor: liveReply.start?.id ?? "start",
|
|
4731
|
+
afterSequence: liveReply.start?.sequence,
|
|
4732
|
+
messageId: liveReply.replyId,
|
|
4733
|
+
foldedReasoningMessageId: liveReply.foldsReasoning
|
|
4734
|
+
? liveReply.replyId
|
|
4735
|
+
: undefined,
|
|
4736
|
+
part: "row",
|
|
4737
|
+
}));
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4740
|
+
else if (pendingRuns.has(runId)) {
|
|
4732
4741
|
const boundary = runSegmentEnds.get(runId);
|
|
4733
4742
|
items.push(renderRunWork({
|
|
4734
4743
|
runId,
|
|
@@ -4762,7 +4771,8 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4762
4771
|
runEndedAt.set(run.id, completedAt);
|
|
4763
4772
|
}
|
|
4764
4773
|
const tailRunIds = Array.from(new Set([
|
|
4765
|
-
...pendingRunIds
|
|
4774
|
+
...pendingRunIds,
|
|
4775
|
+
...liveReplies.keys(),
|
|
4766
4776
|
...Array.from(failedRuns.keys()).filter((runId) => !lastAssistantMessagesByRun.has(runId)),
|
|
4767
4777
|
...Array.from(cancelledRuns).filter((runId) => !lastAssistantMessagesByRun.has(runId)),
|
|
4768
4778
|
]));
|
|
@@ -4862,28 +4872,22 @@ export function AgentKitChat({ title, toolbar, composer = true, composerProps, h
|
|
|
4862
4872
|
lastAssistantMessagesByRun.get(runId)?.id === message.id &&
|
|
4863
4873
|
!hasRunWork(runId, sequence) &&
|
|
4864
4874
|
!hasVisibleReasoning(message));
|
|
4865
|
-
const
|
|
4866
|
-
liveReplyRunIds.has(runId) &&
|
|
4867
|
-
lastAssistantMessagesByRun.get(runId)?.id === message.id;
|
|
4875
|
+
const isLiveReply = isAssistantBoundary && liveReplies.get(runId)?.replyId === message.id;
|
|
4868
4876
|
const rendersRunWork = Boolean(isAssistantBoundary &&
|
|
4869
4877
|
runId &&
|
|
4870
4878
|
(summarizesTurn ||
|
|
4871
|
-
hasRunWork(runId, previousAssistant?.sequence,
|
|
4872
|
-
|
|
4873
|
-
// it, so the turn shows one disclosure; the stream did not place it there.
|
|
4874
|
-
const foldsReasoning = rendersRunWork &&
|
|
4875
|
-
message.status !== "streaming" &&
|
|
4876
|
-
!groupedReasoningMessageIds.has(message.id) &&
|
|
4877
|
-
leadingReasoningMessage(message) !== undefined;
|
|
4879
|
+
hasRunWork(runId, previousAssistant?.sequence, isLiveReply ? undefined : sequence)));
|
|
4880
|
+
const foldsReasoning = rendersRunWork && foldsLeadingReasoning(message);
|
|
4878
4881
|
if (rendersRunWork && runId) {
|
|
4879
4882
|
transcriptItems.push(renderRunWork({
|
|
4880
4883
|
runId,
|
|
4881
4884
|
anchor: previousAssistant?.id ?? "start",
|
|
4882
4885
|
afterSequence: previousAssistant?.sequence,
|
|
4883
|
-
throughSequence:
|
|
4886
|
+
throughSequence: isLiveReply ? undefined : sequence,
|
|
4884
4887
|
messageId: message.id,
|
|
4885
4888
|
foldedReasoningMessageId: foldsReasoning ? message.id : undefined,
|
|
4886
4889
|
summarizesTurn,
|
|
4890
|
+
part: isLiveReply ? "results" : undefined,
|
|
4887
4891
|
}));
|
|
4888
4892
|
}
|
|
4889
4893
|
const messageValue = displayMessageFor(message);
|