@agents24/chat-react 0.5.48 → 0.5.49
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/activity.d.ts +2 -0
- package/dist/{chunk-3UKX2RRE.js → chunk-7EDOWQZW.js} +11 -1
- package/dist/chunk-7EDOWQZW.js.map +1 -0
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/registry/agents24-chat.json +9 -9
- package/dist/scaffold/app.d.ts +1 -1
- package/dist/scaffold/index.cjs +2 -1
- package/dist/scaffold/index.cjs.map +1 -1
- package/dist/scaffold/index.js +2 -1
- package/dist/scaffold/index.js.map +1 -1
- package/dist/styles.css +3 -0
- package/dist/ui/agent-chat-message.d.ts +3 -2
- package/dist/ui/agent-response-timeline.d.ts +3 -1
- package/dist/ui/index.cjs +94 -31
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.js +86 -33
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/tool-sessions.d.ts +8 -2
- package/package.json +3 -3
- package/scaffold/src/app.tsx +3 -2
- package/dist/chunk-3UKX2RRE.js.map +0 -1
package/dist/styles.css
CHANGED
|
@@ -198,12 +198,15 @@ button.a24-tool-trigger:focus-visible { outline: 2px solid var(--a24-focus); out
|
|
|
198
198
|
.a24-tool-trigger-row--root .a24-tool-orb { justify-content: flex-start; }
|
|
199
199
|
.a24-tool-trigger-row--root .a24-tool-completed-icon { justify-content: flex-start; width: 1rem; }
|
|
200
200
|
.a24-tool-trigger__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
201
|
+
.a24-tool-trigger__status { flex: 0 1 auto; font-size: .75rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
201
202
|
.a24-tool-resource-action { appearance: none; background: transparent; border: 0; border-radius: .375rem; color: var(--a24-text); cursor: pointer; flex: 0 1 auto; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .75rem; max-width: 16rem; min-width: 0; overflow: hidden; padding: .125rem .25rem; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-overflow: ellipsis; text-underline-offset: .18em; white-space: nowrap; }
|
|
202
203
|
.a24-tool-resource-action:hover { background: var(--a24-surface-hover); text-decoration-color: currentColor; }
|
|
203
204
|
.a24-tool-resource-action:focus-visible { outline: 2px solid var(--a24-focus); outline-offset: 2px; }
|
|
204
205
|
.a24-tool-trigger__chevron { flex: 0 0 auto; height: .75rem; opacity: 0; transition: opacity 140ms ease; width: .75rem; }
|
|
205
206
|
.a24-tool-trigger:hover .a24-tool-trigger__chevron,
|
|
206
207
|
.a24-tool-trigger:focus-visible .a24-tool-trigger__chevron { opacity: .7; }
|
|
208
|
+
.a24-tool-trigger[aria-expanded="false"]:dir(rtl) > .a24-tool-trigger__chevron,
|
|
209
|
+
.a24-completed-work:not([open]) > .a24-completed-work__summary:dir(rtl) > svg { transform: scaleX(-1); }
|
|
207
210
|
.a24-tool-disclosure__content { color: var(--a24-muted); font-size: .875rem; margin-top: .25rem; padding-inline-start: 1rem; }
|
|
208
211
|
.a24-tool-list-frame { min-width: 0; position: relative; }
|
|
209
212
|
.a24-tool-list-frame::before,
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import type { ChatHitlPart, ChatHitlResponse, ChatMessage } from "../types";
|
|
5
5
|
import { type ChatAttachmentContentResolver } from "./adapters";
|
|
6
6
|
import { type AgentChatMessageActionHandlers } from "./agent-chat-actions";
|
|
7
|
-
import { type AgentChatPartActionState, type AgentChatTimelineComponent } from "./agent-response-timeline";
|
|
7
|
+
import { type AgentChatPartActionState, type AgentChatTimelineComponent, type AgentResponseTimelineProps } from "./agent-response-timeline";
|
|
8
8
|
import type { AgentChatToolLabelMode } from "./tool-sessions";
|
|
9
9
|
export type AgentChatUserMessageContentProps = {
|
|
10
10
|
collapsedLines?: number;
|
|
@@ -23,6 +23,7 @@ export type AgentChatMessageProps = {
|
|
|
23
23
|
contentClassName?: string;
|
|
24
24
|
dir?: "ltr" | "rtl";
|
|
25
25
|
hitlLabels?: Partial<HitlSubmissionLabels>;
|
|
26
|
+
statusLabels?: AgentResponseTimelineProps["statusLabels"];
|
|
26
27
|
onHitlPaint?: (durationMs: number) => void;
|
|
27
28
|
getHitlActionState?: (part: ChatHitlPart) => AgentChatPartActionState | undefined;
|
|
28
29
|
message: ChatMessage;
|
|
@@ -51,4 +52,4 @@ export declare function AgentChatUserMessageActionRow({ children, className, }:
|
|
|
51
52
|
children: React.ReactNode;
|
|
52
53
|
className?: string;
|
|
53
54
|
}): import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
export declare function AgentChatMessage({ actionHandlers, additionalActions, actions, actionsClassName, attachmentContentResolver, className, contentClassName, dir, getHitlActionState, hitlLabels, onHitlPaint, message, nodeActivityMode, onHitlAction, Timeline, toolLabelMode, renderAssistantContent, renderUserContent, showAssistantAttachments, streamingMessageId, userMessageCollapsedLines, userMessageContent, userMessageCollapseThreshold, userMessageShowLessLabel, userMessageShowMoreLabel, }: AgentChatMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export declare function AgentChatMessage({ actionHandlers, additionalActions, actions, actionsClassName, attachmentContentResolver, className, contentClassName, dir, getHitlActionState, hitlLabels, statusLabels, onHitlPaint, message, nodeActivityMode, onHitlAction, Timeline, toolLabelMode, renderAssistantContent, renderUserContent, showAssistantAttachments, streamingMessageId, userMessageCollapsedLines, userMessageContent, userMessageCollapseThreshold, userMessageShowLessLabel, userMessageShowMoreLabel, }: AgentChatMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,7 @@ import type { HitlSubmissionOptions } from "@agents24/react";
|
|
|
2
2
|
import { type HitlSubmissionLabels } from "./hitl-submission-status";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import type { ChatHitlPart, ChatHitlResponse, ChatMessage, ChatNodeActivityPart, ChatPart, ChatToolPart, ChatUiBlocksPart } from "../types";
|
|
5
|
+
import { type AgentChatStatusLabels } from "../activity";
|
|
5
6
|
import type { McpConnectRequiredStatus } from "./mcp-connect-required-card";
|
|
6
7
|
import { type MessageResponseProps } from "./message-response";
|
|
7
8
|
import { type AgentChatToolLabelMode, type AgentChatToolSlots, type AgentChatToolViewMode } from "./tool-sessions";
|
|
@@ -24,6 +25,7 @@ export type AgentResponseTimelineProps = {
|
|
|
24
25
|
parts?: readonly ChatPart[];
|
|
25
26
|
renderUiBlocks?: (part: ChatUiBlocksPart) => React.ReactNode;
|
|
26
27
|
responseProps?: Omit<MessageResponseProps, "children" | "streaming" | "streamingId">;
|
|
28
|
+
statusLabels?: Partial<AgentChatStatusLabels>;
|
|
27
29
|
toolSlots?: AgentChatToolSlots;
|
|
28
30
|
toolViewMode?: AgentChatToolViewMode;
|
|
29
31
|
toolLabelMode?: AgentChatToolLabelMode;
|
|
@@ -54,4 +56,4 @@ export type AgentChatPartProps = {
|
|
|
54
56
|
toolSlots?: AgentChatToolSlots;
|
|
55
57
|
};
|
|
56
58
|
export declare function AgentChatPart({ activeToolId, getHitlActionState, hitlLabels, onHitlPaint, isLoading, isTextStreaming, message, onHitlAction, part, responseProps, toolSlots, }: AgentChatPartProps): import("react/jsx-runtime").JSX.Element | null;
|
|
57
|
-
export declare function AgentResponseTimeline({ getHitlActionState, hitlLabels, onHitlPaint, isLoading, message, nodeActivityMode, onHitlAction, onNodeSelect, parts: displayParts, renderUiBlocks, responseProps, toolSlots: suppliedToolSlots, toolViewMode, toolLabelMode, }: AgentResponseTimelineProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare function AgentResponseTimeline({ getHitlActionState, hitlLabels, onHitlPaint, isLoading, message, nodeActivityMode, onHitlAction, onNodeSelect, parts: displayParts, renderUiBlocks, responseProps, statusLabels, toolSlots: suppliedToolSlots, toolViewMode, toolLabelMode, }: AgentResponseTimelineProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/ui/index.cjs
CHANGED
|
@@ -111,6 +111,7 @@ __export(ui_exports, {
|
|
|
111
111
|
contextStatusMetrics: () => contextStatusMetrics,
|
|
112
112
|
createAgentChatComposerFile: () => createAgentChatComposerFile,
|
|
113
113
|
createDictationComposerFile: () => createDictationComposerFile,
|
|
114
|
+
defaultAgentChatStatusLabels: () => defaultAgentChatStatusLabels,
|
|
114
115
|
defaultHitlSubmissionLabels: () => defaultHitlSubmissionLabels,
|
|
115
116
|
dictationPcmWorkletSource: () => processorSource,
|
|
116
117
|
getAgentChatActivity: () => getAgentChatActivity,
|
|
@@ -118,6 +119,7 @@ __export(ui_exports, {
|
|
|
118
119
|
hitlTitle: () => hitlTitle,
|
|
119
120
|
isAgentChatSubagent: () => isAgentChatSubagent,
|
|
120
121
|
isAgentChatToolRunning: () => isAgentChatToolRunning,
|
|
122
|
+
isAgentChatToolWaiting: () => isAgentChatToolWaiting,
|
|
121
123
|
isHitlSubmissionCompact: () => isHitlSubmissionCompact,
|
|
122
124
|
latestRunningAgentChatToolId: () => latestRunningAgentChatToolId,
|
|
123
125
|
markerVariants: () => markerVariants,
|
|
@@ -2241,6 +2243,15 @@ function AgentChatComposer({
|
|
|
2241
2243
|
}
|
|
2242
2244
|
|
|
2243
2245
|
// src/activity.ts
|
|
2246
|
+
var defaultAgentChatStatusLabels = {
|
|
2247
|
+
thinking: "Thinking",
|
|
2248
|
+
planning: "Planning next moves",
|
|
2249
|
+
capacity: "Waiting for provider capacity",
|
|
2250
|
+
waiting: "Waiting for external work",
|
|
2251
|
+
interrupted: "Waiting to resume",
|
|
2252
|
+
cancelling: "Cancelling",
|
|
2253
|
+
toolWaitingDetail: "This tool continues when the external result is ready."
|
|
2254
|
+
};
|
|
2244
2255
|
function getAgentChatActivity(message, parts = message.parts, isLoading = false) {
|
|
2245
2256
|
if (message.role !== "assistant" || message.isFinal || message.responseCompletion || parts.some((part) => part.kind === "hitl" && part.status === "pending")) return null;
|
|
2246
2257
|
const status = message.activity?.status;
|
|
@@ -3995,6 +4006,9 @@ function isAgentChatSubagent(part) {
|
|
|
3995
4006
|
function isAgentChatToolRunning(part) {
|
|
3996
4007
|
return part.state === "input-available" || part.state === "input-streaming";
|
|
3997
4008
|
}
|
|
4009
|
+
function isAgentChatToolWaiting(part, callIds) {
|
|
4010
|
+
return !!part.toolCallId && isAgentChatToolRunning(part) && callIds?.has(part.toolCallId) === true;
|
|
4011
|
+
}
|
|
3998
4012
|
function latestRunningAgentChatToolId(parts) {
|
|
3999
4013
|
const active = [...parts].reverse().find(isAgentChatToolRunning);
|
|
4000
4014
|
return active?.toolCallId || active?.id || null;
|
|
@@ -4113,7 +4127,7 @@ function AgentChatActivityRow({
|
|
|
4113
4127
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "a24-tool-trigger-row a24-tool-trigger-row--root", "data-agents24-model-turn": modelTurnId, role: "status", children: onSelect ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "a24-tool-trigger a24-tool-trigger--root a24-tool-trigger--active", onClick: onSelect, type: "button", children: content }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "a24-tool-trigger a24-tool-trigger--root a24-tool-trigger--active", children: content }) });
|
|
4114
4128
|
}
|
|
4115
4129
|
function AgentChatModelTurnRow({ part }) {
|
|
4116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AgentChatActivityRow, { label:
|
|
4130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AgentChatActivityRow, { label: defaultAgentChatStatusLabels.planning, modelTurnId: part.modelTurnId });
|
|
4117
4131
|
}
|
|
4118
4132
|
function AgentChatNodeActivityRow({
|
|
4119
4133
|
renderActivityIcon,
|
|
@@ -4187,21 +4201,26 @@ function ToolDisclosure({
|
|
|
4187
4201
|
renderActivityIcon,
|
|
4188
4202
|
completedIcon,
|
|
4189
4203
|
accessibleLabel,
|
|
4190
|
-
accessory
|
|
4204
|
+
accessory,
|
|
4205
|
+
waitingLabel
|
|
4191
4206
|
}) {
|
|
4192
4207
|
const [open, setOpen] = React15.useState(false);
|
|
4193
4208
|
const contentId = React15.useId();
|
|
4194
4209
|
const expandable = React15.Children.toArray(children).length > 0;
|
|
4195
|
-
const leadingIcon = showOrb ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToolActivityOrb, { label: statusLabel || "Working", kind: grouped ? "group" : "tool", part, renderActivityIcon }) : completedIcon;
|
|
4210
|
+
const leadingIcon = waitingLabel ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: "a24-tool-completed-icon", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.Clock, {}) }) : showOrb ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToolActivityOrb, { label: statusLabel || "Working", kind: grouped ? "group" : "tool", part, renderActivityIcon }) : completedIcon;
|
|
4211
|
+
const triggerLabel = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "a24-tool-trigger__label", children: label }),
|
|
4213
|
+
waitingLabel ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "a24-tool-trigger__status", children: waitingLabel }) : null
|
|
4214
|
+
] });
|
|
4196
4215
|
if (!expandable) {
|
|
4197
4216
|
const triggerClassName = cn("a24-tool-trigger", root && "a24-tool-trigger--root", root && !leadingIcon && "a24-tool-trigger--without-orb", error && "a24-tool-trigger--error", loading && "a24-tool-trigger--active");
|
|
4198
4217
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("a24-tool-trigger-row", root && "a24-tool-trigger-row--root"), children: [
|
|
4199
4218
|
onSelect && part ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("button", { className: triggerClassName, onClick: () => onSelect(part), type: "button", children: [
|
|
4200
4219
|
leadingIcon,
|
|
4201
|
-
|
|
4220
|
+
triggerLabel
|
|
4202
4221
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: triggerClassName, children: [
|
|
4203
4222
|
leadingIcon,
|
|
4204
|
-
|
|
4223
|
+
triggerLabel
|
|
4205
4224
|
] }),
|
|
4206
4225
|
accessory
|
|
4207
4226
|
] });
|
|
@@ -4224,7 +4243,7 @@ function ToolDisclosure({
|
|
|
4224
4243
|
type: "button",
|
|
4225
4244
|
children: [
|
|
4226
4245
|
leadingIcon,
|
|
4227
|
-
|
|
4246
|
+
triggerLabel,
|
|
4228
4247
|
open ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.ChevronDown, { "aria-hidden": "true", className: "a24-tool-trigger__chevron" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.ChevronRight, { "aria-hidden": "true", className: "a24-tool-trigger__chevron" })
|
|
4229
4248
|
]
|
|
4230
4249
|
}
|
|
@@ -4283,17 +4302,20 @@ function AgentChatToolRow({
|
|
|
4283
4302
|
part,
|
|
4284
4303
|
root = true,
|
|
4285
4304
|
showOrb,
|
|
4286
|
-
slots
|
|
4305
|
+
slots,
|
|
4306
|
+
statusLabels,
|
|
4307
|
+
waitingToolCallIds
|
|
4287
4308
|
}) {
|
|
4288
|
-
const
|
|
4309
|
+
const waiting = isAgentChatToolWaiting(part, waitingToolCallIds);
|
|
4310
|
+
const active = !waiting && isActive(part, activeToolId);
|
|
4289
4311
|
const failed = part.state === "output-error";
|
|
4290
4312
|
const failureMessage = part.failure?.message || null;
|
|
4291
|
-
const detail = failed ? failureMessage : optionalText(part.presentation.detail);
|
|
4313
|
+
const detail = failed ? failureMessage : optionalText(part.presentation.detail) ?? (waiting ? statusLabels?.toolWaitingDetail ?? defaultAgentChatStatusLabels.toolWaitingDetail : null);
|
|
4292
4314
|
const hostDetails = failed ? null : slots?.renderToolDetails?.(part);
|
|
4293
4315
|
const deterministicLabel = toolRowLabel(part, Boolean(slots?.onResourceAction));
|
|
4294
4316
|
const generatedLabel = slots?.toolLabelMode !== "deterministic" ? part.presentation.generatedActivity?.title : void 0;
|
|
4295
4317
|
const context = toolSlotContext(active, deterministicLabel, part, slots);
|
|
4296
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { "data-agents24-tool-part": part.type, "data-state": part.state, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
4318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { "data-agents24-tool-part": part.type, "data-state": waiting ? "waiting" : part.state, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
4297
4319
|
ToolDisclosure,
|
|
4298
4320
|
{
|
|
4299
4321
|
renderActivityIcon: slots?.renderActivityIcon,
|
|
@@ -4308,6 +4330,7 @@ function AgentChatToolRow({
|
|
|
4308
4330
|
root,
|
|
4309
4331
|
showOrb: isAgentChatToolRunning(part) && (showOrb ?? active),
|
|
4310
4332
|
statusLabel: active ? generatedLabel ?? context.label : void 0,
|
|
4333
|
+
waitingLabel: waiting ? statusLabels?.waiting ?? defaultAgentChatStatusLabels.waiting : void 0,
|
|
4311
4334
|
children: [
|
|
4312
4335
|
detail ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: cn("a24-tool-detail", failed && "a24-tool-detail--error"), children: detail }) : null,
|
|
4313
4336
|
hostDetails
|
|
@@ -4324,7 +4347,9 @@ function AgentChatToolSession({
|
|
|
4324
4347
|
leadingModelTurn,
|
|
4325
4348
|
modelTurn,
|
|
4326
4349
|
parts,
|
|
4327
|
-
slots
|
|
4350
|
+
slots,
|
|
4351
|
+
statusLabels,
|
|
4352
|
+
waitingToolCallIds
|
|
4328
4353
|
}) {
|
|
4329
4354
|
const presentedLiveRef = React15.useRef(false);
|
|
4330
4355
|
if (isLive && isLatestActivity) presentedLiveRef.current = true;
|
|
@@ -4337,21 +4362,27 @@ function AgentChatToolSession({
|
|
|
4337
4362
|
activeToolId,
|
|
4338
4363
|
part: parts[0],
|
|
4339
4364
|
showOrb: isLive === void 0 ? void 0 : isLive && isLatestActivity,
|
|
4340
|
-
slots
|
|
4365
|
+
slots,
|
|
4366
|
+
statusLabels,
|
|
4367
|
+
waitingToolCallIds
|
|
4341
4368
|
}
|
|
4342
4369
|
);
|
|
4343
4370
|
}
|
|
4371
|
+
const waitingParts = waitingToolCallIds?.size ? parts.filter((part) => isAgentChatToolWaiting(part, waitingToolCallIds)) : [];
|
|
4372
|
+
const waiting = waitingParts.length > 0;
|
|
4344
4373
|
const visibleIndex = running ? activeIndex : parts.length - 1;
|
|
4345
|
-
const visiblePart = parts[visibleIndex];
|
|
4374
|
+
const visiblePart = waitingParts.at(-1) ?? parts[visibleIndex];
|
|
4346
4375
|
const planning = Boolean(modelTurn);
|
|
4376
|
+
const planningLabel = statusLabels?.planning ?? defaultAgentChatStatusLabels.planning;
|
|
4347
4377
|
const presentingActivity = isLatestActivity && (planning || running || isLive);
|
|
4348
4378
|
const failed = isLatestActivity && (visiblePart.state === "output-error" || visiblePart.state === "cancelled");
|
|
4349
4379
|
const generatedGroupTitle = slots?.toolLabelMode !== "deterministic" ? parts.findLast((part) => part.presentation.generatedActivity?.groupTitle)?.presentation.generatedActivity?.groupTitle : void 0;
|
|
4350
|
-
const sessionOpen = isSessionOpen ?? presentingActivity;
|
|
4380
|
+
const sessionOpen = waiting || (isSessionOpen ?? presentingActivity);
|
|
4351
4381
|
const actions2 = sessionOpen ? [] : completedToolActions(parts);
|
|
4352
4382
|
const recap = !sessionOpen && slots?.toolLabelMode !== "deterministic" ? completedRecap : void 0;
|
|
4353
4383
|
const recapActions = recap ? recap.actions : actions2;
|
|
4354
|
-
const
|
|
4384
|
+
const waitingTitle = waitingParts.length === 1 ? (slots?.toolLabelMode === "deterministic" ? void 0 : visiblePart.presentation.generatedActivity?.title) ?? toolRowLabel(visiblePart, true) : void 0;
|
|
4385
|
+
const label = sessionOpen ? waitingTitle ?? generatedGroupTitle ?? (planning ? planningLabel : toolRowLabel(visiblePart, true)) : recap?.label ?? completedToolSummary(actions2, parts);
|
|
4355
4386
|
const customLabel = slots?.renderToolGroupLabel?.({ parts, phase: sessionOpen ? "live" : "completed", label, actions: actions2, recap });
|
|
4356
4387
|
const groupIconMode = slots?.groupIconMode ?? "per-action";
|
|
4357
4388
|
const perAction = customLabel == null && recapActions && recapActions.length > 1 && groupIconMode === "per-action";
|
|
@@ -4359,12 +4390,12 @@ function AgentChatToolSession({
|
|
|
4359
4390
|
const reel = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
4360
4391
|
ToolActivityReel,
|
|
4361
4392
|
{
|
|
4362
|
-
initialLabel: leadingModelTurn && !generatedGroupTitle ?
|
|
4393
|
+
initialLabel: leadingModelTurn && !generatedGroupTitle ? planningLabel : void 0,
|
|
4363
4394
|
initialShownAt: leadingModelTurn?.timestamp,
|
|
4364
4395
|
label: liveReelLabel
|
|
4365
4396
|
}
|
|
4366
4397
|
);
|
|
4367
|
-
const labelContent = sessionOpen && presentedLiveRef.current ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: presentingActivity ? "a24-tool-shimmer" : void 0, children: customLabel != null && typeof customLabel !== "string" ? customLabel : reel }) : customLabel ?? (perAction ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CompletedToolActionList, { actions: recapActions, parts, renderIcon: slots?.renderCompletedToolIcon }) : label);
|
|
4398
|
+
const labelContent = sessionOpen && !waiting && presentedLiveRef.current ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: presentingActivity ? "a24-tool-shimmer" : void 0, children: customLabel != null && typeof customLabel !== "string" ? customLabel : reel }) : customLabel ?? (perAction ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CompletedToolActionList, { actions: recapActions, parts, renderIcon: slots?.renderCompletedToolIcon }) : label);
|
|
4368
4399
|
const leadingIcon = !sessionOpen && !perAction && groupIconMode !== "none" ? completedToolIcon(
|
|
4369
4400
|
"group",
|
|
4370
4401
|
recap ? parts : actions2[0]?.parts ?? [visiblePart],
|
|
@@ -4380,13 +4411,24 @@ function AgentChatToolSession({
|
|
|
4380
4411
|
error: failed,
|
|
4381
4412
|
grouped: true,
|
|
4382
4413
|
label: labelContent,
|
|
4383
|
-
loading: presentingActivity && sessionOpen,
|
|
4414
|
+
loading: presentingActivity && sessionOpen && !waiting,
|
|
4384
4415
|
onExpandedChange: slots?.onExpandedChange,
|
|
4385
4416
|
part: visiblePart,
|
|
4386
4417
|
root: true,
|
|
4387
4418
|
showOrb: sessionOpen && isLive && isLatestActivity,
|
|
4388
4419
|
statusLabel: label,
|
|
4389
|
-
|
|
4420
|
+
waitingLabel: waiting ? statusLabels?.waiting ?? defaultAgentChatStatusLabels.waiting : void 0,
|
|
4421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToolList, { children: parts.map((part) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { role: "listitem", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
4422
|
+
AgentChatToolRow,
|
|
4423
|
+
{
|
|
4424
|
+
activeToolId,
|
|
4425
|
+
part,
|
|
4426
|
+
root: false,
|
|
4427
|
+
slots,
|
|
4428
|
+
statusLabels,
|
|
4429
|
+
waitingToolCallIds
|
|
4430
|
+
}
|
|
4431
|
+
) }, part.id)) })
|
|
4390
4432
|
}
|
|
4391
4433
|
);
|
|
4392
4434
|
}
|
|
@@ -4677,6 +4719,7 @@ function AgentResponseTimeline({
|
|
|
4677
4719
|
parts: displayParts,
|
|
4678
4720
|
renderUiBlocks,
|
|
4679
4721
|
responseProps,
|
|
4722
|
+
statusLabels,
|
|
4680
4723
|
toolSlots: suppliedToolSlots,
|
|
4681
4724
|
toolViewMode = "closed",
|
|
4682
4725
|
toolLabelMode
|
|
@@ -4687,6 +4730,8 @@ function AgentResponseTimeline({
|
|
|
4687
4730
|
const liveToolActivity = canShowToolActivity && !message.isFinal && !message.responseCompletion && (isLoading || message.activity?.status === "running");
|
|
4688
4731
|
const parts = (displayParts || message.parts || []).filter((part) => part.kind !== "data" && (part.kind !== "text" || Boolean(part.text.trim())) && (part.kind !== "reasoning" || Boolean(part.text?.trim() || part.label?.trim())) && (part.kind !== "tool" || !isInternalAskUserTool(part)) && (part.kind !== "hitl" || part.hitlKind === "user_input" || part.status === "pending" || getHitlActionState?.(part)?.status === "accepted") && (part.kind !== "model-turn" || part.turnKind === "agent" && !message.isFinal && !message.responseCompletion && (!message.activity || message.activity.status === "running")) && (part.kind !== "node-activity" || nodeActivityMode === "all" || nodeActivityMode === "default" && part.defaultChatVisible));
|
|
4689
4732
|
const toolParts = parts.filter((part) => part.kind === "tool");
|
|
4733
|
+
const waitingCallIds = !message.isFinal && !message.responseCompletion && message.activity?.status === "waiting" && message.activity.waitingToolCallIds?.length ? new Set(message.activity.waitingToolCallIds) : void 0;
|
|
4734
|
+
const hasVisibleWaitingTool = waitingCallIds && toolParts.some((part) => !isAgentChatSubagent(part) && isAgentChatToolWaiting(part, waitingCallIds));
|
|
4690
4735
|
const activeToolId = canShowToolActivity ? latestRunningAgentChatToolId(toolParts) : null;
|
|
4691
4736
|
const activeTextPartId = getActiveStreamingTextPartId(
|
|
4692
4737
|
{ ...message, parts: [...parts] },
|
|
@@ -4699,7 +4744,18 @@ function AgentResponseTimeline({
|
|
|
4699
4744
|
const isLatestActivity = segmentIndex === segments.length - 1;
|
|
4700
4745
|
if (segment.kind === "tool" && toolViewMode === "expanded") {
|
|
4701
4746
|
const showOrb = liveToolActivity && Boolean(activeToolId && (segment.part.id === activeToolId || segment.part.toolCallId === activeToolId));
|
|
4702
|
-
rendered.push(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4747
|
+
rendered.push(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4748
|
+
AgentChatToolRow,
|
|
4749
|
+
{
|
|
4750
|
+
activeToolId,
|
|
4751
|
+
part: segment.part,
|
|
4752
|
+
showOrb,
|
|
4753
|
+
slots: toolSlots,
|
|
4754
|
+
statusLabels,
|
|
4755
|
+
waitingToolCallIds: waitingCallIds
|
|
4756
|
+
},
|
|
4757
|
+
segment.part.id
|
|
4758
|
+
));
|
|
4703
4759
|
continue;
|
|
4704
4760
|
}
|
|
4705
4761
|
if (segment.kind === "tool" || segment.kind === "tool-session") {
|
|
@@ -4719,7 +4775,9 @@ function AgentResponseTimeline({
|
|
|
4719
4775
|
parts: session.parts,
|
|
4720
4776
|
leadingModelTurn: session.leadingModelTurn,
|
|
4721
4777
|
modelTurn: session.modelTurn,
|
|
4722
|
-
slots: toolSlots
|
|
4778
|
+
slots: toolSlots,
|
|
4779
|
+
statusLabels,
|
|
4780
|
+
waitingToolCallIds: waitingCallIds
|
|
4723
4781
|
},
|
|
4724
4782
|
`tool-session-${session.parts[0].id}`
|
|
4725
4783
|
));
|
|
@@ -4733,7 +4791,15 @@ function AgentResponseTimeline({
|
|
|
4733
4791
|
if (part.kind === "model-turn") {
|
|
4734
4792
|
const key = activeActivityClaimed ? part.id : `${message.id}-active-activity`;
|
|
4735
4793
|
activeActivityClaimed = true;
|
|
4736
|
-
rendered.push(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4794
|
+
rendered.push(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4795
|
+
AgentChatActivityRow,
|
|
4796
|
+
{
|
|
4797
|
+
renderActivityIcon: toolSlots?.renderActivityIcon,
|
|
4798
|
+
label: statusLabels?.planning ?? defaultAgentChatStatusLabels.planning,
|
|
4799
|
+
modelTurnId: part.modelTurnId
|
|
4800
|
+
},
|
|
4801
|
+
key
|
|
4802
|
+
));
|
|
4737
4803
|
continue;
|
|
4738
4804
|
}
|
|
4739
4805
|
if (part.kind === "node-activity") {
|
|
@@ -4771,19 +4837,12 @@ function AgentResponseTimeline({
|
|
|
4771
4837
|
rendered.push(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MessageResponse, { children: message.content }, `${message.id}-fallback`));
|
|
4772
4838
|
}
|
|
4773
4839
|
const activity = getAgentChatActivity(message, parts, isLoading);
|
|
4774
|
-
if (activity) {
|
|
4775
|
-
const labels = {
|
|
4776
|
-
thinking: "Thinking",
|
|
4777
|
-
capacity: "Waiting for provider capacity",
|
|
4778
|
-
waiting: "Waiting for external work",
|
|
4779
|
-
interrupted: "Waiting to resume",
|
|
4780
|
-
cancelling: "Cancelling"
|
|
4781
|
-
};
|
|
4840
|
+
if (activity && (activity !== "waiting" || !hasVisibleWaitingTool)) {
|
|
4782
4841
|
rendered.push(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4783
4842
|
AgentChatActivityRow,
|
|
4784
4843
|
{
|
|
4785
4844
|
renderActivityIcon: toolSlots?.renderActivityIcon,
|
|
4786
|
-
label:
|
|
4845
|
+
label: statusLabels?.[activity] ?? defaultAgentChatStatusLabels[activity]
|
|
4787
4846
|
},
|
|
4788
4847
|
`${message.id}-active-activity`
|
|
4789
4848
|
));
|
|
@@ -4976,6 +5035,7 @@ function AgentChatMessage({
|
|
|
4976
5035
|
dir,
|
|
4977
5036
|
getHitlActionState,
|
|
4978
5037
|
hitlLabels,
|
|
5038
|
+
statusLabels,
|
|
4979
5039
|
onHitlPaint,
|
|
4980
5040
|
message,
|
|
4981
5041
|
nodeActivityMode,
|
|
@@ -5044,6 +5104,7 @@ function AgentChatMessage({
|
|
|
5044
5104
|
{
|
|
5045
5105
|
getHitlActionState,
|
|
5046
5106
|
hitlLabels,
|
|
5107
|
+
statusLabels,
|
|
5047
5108
|
onHitlPaint,
|
|
5048
5109
|
isLoading: isStreaming,
|
|
5049
5110
|
message,
|
|
@@ -5383,6 +5444,7 @@ function McpConnectRequiredCard({
|
|
|
5383
5444
|
contextStatusMetrics,
|
|
5384
5445
|
createAgentChatComposerFile,
|
|
5385
5446
|
createDictationComposerFile,
|
|
5447
|
+
defaultAgentChatStatusLabels,
|
|
5386
5448
|
defaultHitlSubmissionLabels,
|
|
5387
5449
|
dictationPcmWorkletSource,
|
|
5388
5450
|
getAgentChatActivity,
|
|
@@ -5390,6 +5452,7 @@ function McpConnectRequiredCard({
|
|
|
5390
5452
|
hitlTitle,
|
|
5391
5453
|
isAgentChatSubagent,
|
|
5392
5454
|
isAgentChatToolRunning,
|
|
5455
|
+
isAgentChatToolWaiting,
|
|
5393
5456
|
isHitlSubmissionCompact,
|
|
5394
5457
|
latestRunningAgentChatToolId,
|
|
5395
5458
|
markerVariants,
|