@mcp-b/react-components 0.44.1 → 0.45.0
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/{AgentToolRunsContext-daY67hFM.d.ts → AgentToolRunsContext-jtmveaRE.d.ts} +8 -7
- package/dist/{CodeBlock-Dl7a3Wqo.js → CodeBlock-8K1p1BDU.js} +1 -1
- package/dist/{FileTree-Uu3ZnW1u.js → FileTree-QTP57Qz4.js} +1 -1
- package/dist/{ResponsiveSidebarShell-DOXd5T-d.d.ts → ResponsiveSidebarShell-BTVPxLJK.d.ts} +12 -0
- package/dist/{SetupChecklist-DOp-zqjh.js → SetupChecklist-CZeToAbu.js} +1 -1
- package/dist/{ThinkChat-BES_3Mb-.js → ThinkChat-CWMcl79Q.js} +3 -21
- package/dist/{WorkspaceFileView-BublZXky.js → WorkspaceFileView-DJ8Oxz57.js} +3 -3
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.js +18 -13
- package/dist/components/agents-sdk/AgentEvent.d.ts +42 -0
- package/dist/components/agents-sdk/AgentEvent.js +96 -0
- package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +1 -1
- package/dist/components/agents-sdk/AgentToolRunsContext.js +11 -7
- package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +2 -2
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/ManagerOffice.d.ts +104 -10
- package/dist/components/agents-sdk/ManagerOffice.js +1171 -147
- package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +4 -4
- package/dist/components/agents-sdk/McpServerPicker.js +3 -3
- package/dist/components/agents-sdk/ModelSelector.js +4 -4
- package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
- package/dist/components/agents-sdk/SubagentRunDetails.js +1 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +21 -3
- package/dist/components/agents-sdk/SubagentRunIndicator.js +56 -6
- package/dist/components/agents-sdk/SubagentRunSelector.js +5 -12
- package/dist/components/agents-sdk/ThinkChat.d.ts +1 -2
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +3 -3
- package/dist/components/agents-sdk/ThinkChatActivitySummary.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +3 -3
- package/dist/components/agents-sdk/ThinkExecutionRun.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +13 -3
- package/dist/components/agents-sdk/ThinkFullApp.js +51 -5
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
- package/dist/components/agents-sdk/ThinkPendingApproval.js +1 -1
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +3 -3
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +4 -4
- package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +4 -4
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
- package/dist/components/agents-sdk/ThinkSidepanel.d.ts +22 -4
- package/dist/components/agents-sdk/ThinkSidepanel.js +69 -30
- package/dist/components/agents-sdk/ThinkThreadPicker.js +5 -5
- package/dist/components/agents-sdk/Workspace.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +4 -21
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +2 -2
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.js +1 -1
- package/dist/components/ai-sdk/Checkpoint.js +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ConnectedAppCards.js +3 -3
- package/dist/components/ai-sdk/Context.js +1 -1
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.js +2 -2
- package/dist/components/ai-sdk/InlineCitation.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.js +2 -2
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
- package/dist/components/ai-sdk/Plan.js +2 -2
- package/dist/components/ai-sdk/PromptInput.js +3 -3
- package/dist/components/ai-sdk/Queue.js +2 -2
- package/dist/components/ai-sdk/Reasoning.js +2 -2
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/ai-sdk/ToolInvocation.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +1 -1
- package/dist/components/extension/CodexModelSelector.js +2 -2
- package/dist/components/extension/ConversationTabPicker.js +2 -2
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/Collapsible.js +1 -1
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/ToggleGroup.d.ts +1 -1
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/foundations/icons.js +1 -1
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- package/dist/components/general-purpose/ResizableSidePanel.js +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +72 -22
- package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.js +2 -2
- package/dist/components/general-purpose/TestResults.js +1 -1
- package/dist/components/general-purpose/ThemeModeControl.js +2 -2
- package/dist/components/general-purpose/WebPreview.js +3 -3
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.js +4 -4
- package/dist/{copy-button-DHhf-J1d.js → copy-button-BpA7wQva.js} +1 -1
- package/dist/{format-DB2mX9DA.js → format-COCyV98Z.js} +23 -1
- package/dist/{progress-ring-BEocM1e3.js → progress-ring-Cgii90dC.js} +1 -1
- package/dist/styles/agent-event.css +14 -0
- package/dist/styles/avatar.css +2 -1
- package/dist/styles/base.css +4 -0
- package/dist/styles/button.css +10 -0
- package/dist/styles/index.css +1 -0
- package/dist/styles/manager-office.css +1303 -70
- package/dist/styles/message-scroller.css +5 -0
- package/dist/styles/responsive-sidebar-shell.css +47 -0
- package/dist/styles/subagent-run.css +29 -19
- package/dist/styles/think-full-app.css +139 -4
- package/dist/styles/think-sidepanel.css +0 -5
- package/dist/styles/think-thread-picker.css +13 -12
- package/dist/styles/workspace-mount-manager.css +0 -22
- package/package.json +8 -8
- package/dist/{icons-Dw-im7lg.js → icons-DbrksZyY.js} +1 -1
|
@@ -25,13 +25,14 @@ type AgentToolEventSource = Parameters<typeof useAgentToolEvents>[0]["agent"] &
|
|
|
25
25
|
* The subscription's listener attaches in a passive effect, after paint. A
|
|
26
26
|
* host whose transport is in-process (the browser extension's port bridge)
|
|
27
27
|
* can complete the connect and deliver the replay before that effect runs —
|
|
28
|
-
* reliably so on a hot return from a drill-in.
|
|
29
|
-
* `useAgent` buffers `agent-tool-event` frames from socket
|
|
30
|
-
* `useAgentToolEvents` drains them when its listener
|
|
31
|
-
*
|
|
32
|
-
* socket).
|
|
33
|
-
*
|
|
34
|
-
*
|
|
28
|
+
* reliably so on a hot return from a drill-in. The fix lives in the Agents
|
|
29
|
+
* SDK, not here: `useAgent` buffers `agent-tool-event` frames from socket
|
|
30
|
+
* construction and `useAgentToolEvents` drains them when its listener
|
|
31
|
+
* attaches (`_bufferAgentToolReplayFrame` is the seam for a non-`useAgent`
|
|
32
|
+
* socket). As of agents 0.21.0 that is still the browser host's vendored
|
|
33
|
+
* edit, not a published release; a host on the published package has to
|
|
34
|
+
* buffer and re-dispatch the frames around its own socket before this hook
|
|
35
|
+
* can see them. Network transports are not affected in practice: the round
|
|
35
36
|
* trip loses to the effect flush.
|
|
36
37
|
*/
|
|
37
38
|
declare function useSourceScopedAgentToolEvents<Part extends AgentToolRunPart = UIMessage["parts"][number]>(agent: AgentToolEventSource): {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-BiMDVpUo.js";
|
|
2
|
-
import { t as CopyButton } from "./copy-button-DHhf-J1d.js";
|
|
3
2
|
import { Select } from "./components/foundations/Select.js";
|
|
3
|
+
import { t as CopyButton } from "./copy-button-BpA7wQva.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { createHighlighter } from "shiki";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-BiMDVpUo.js";
|
|
2
|
-
import { C as FolderIcon, S as FileIcon, p as ChevronRightIcon, w as FolderOpenIcon } from "./icons-
|
|
2
|
+
import { C as FolderIcon, S as FileIcon, p as ChevronRightIcon, w as FolderOpenIcon } from "./icons-DbrksZyY.js";
|
|
3
3
|
import { t as NavigationLink } from "./navigation-link-kqMa81v5.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -72,6 +72,14 @@ interface ResponsiveSidebarShellProps extends Omit<React.HTMLAttributes<HTMLDivE
|
|
|
72
72
|
children?: React.ReactNode;
|
|
73
73
|
/** Short noun used by the toggle and resize control, such as “threads” or “schedules”. */
|
|
74
74
|
sidebarLabel?: string;
|
|
75
|
+
/** Whether the sidebar is open. Omit for internal state. */
|
|
76
|
+
sidebarOpen?: boolean;
|
|
77
|
+
/** Move the wide-layout toggle into the sidebar while it is open. */
|
|
78
|
+
sidebarTogglePlacement?: "main" | "sidebar";
|
|
79
|
+
/** Initial sidebar state when `sidebarOpen` is uncontrolled. */
|
|
80
|
+
defaultSidebarOpen?: boolean;
|
|
81
|
+
/** Called when the sidebar is opened or closed. */
|
|
82
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
75
83
|
/** Initial desktop sidebar width in CSS pixels. */
|
|
76
84
|
defaultSidebarWidth?: number;
|
|
77
85
|
/** Shell-owned application bar composed from slots. */
|
|
@@ -95,7 +103,11 @@ interface ResponsiveSidebarShellProps extends Omit<React.HTMLAttributes<HTMLDivE
|
|
|
95
103
|
declare function ResponsiveSidebarShell({
|
|
96
104
|
sidebar,
|
|
97
105
|
sidebarLabel,
|
|
106
|
+
sidebarOpen,
|
|
107
|
+
sidebarTogglePlacement,
|
|
108
|
+
defaultSidebarOpen,
|
|
98
109
|
defaultSidebarWidth,
|
|
110
|
+
onSidebarOpenChange,
|
|
99
111
|
bar,
|
|
100
112
|
error,
|
|
101
113
|
showMainLabel,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as mergeBaseClassName } from "./class-names-BiMDVpUo.js";
|
|
2
|
-
import { V as PlusIcon, d as CheckIcon, et as WarningIcon, f as ChevronDownIcon } from "./icons-
|
|
2
|
+
import { V as PlusIcon, d as CheckIcon, et as WarningIcon, f as ChevronDownIcon } from "./icons-DbrksZyY.js";
|
|
3
3
|
import { Button } from "./components/foundations/Button.js";
|
|
4
4
|
import { Menu } from "./components/foundations/Menu.js";
|
|
5
5
|
import * as React from "react";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { TransitionSurface } from "./components/foundations/TransitionSurface.js";
|
|
2
|
+
import { AgentToolRunsProvider, useSourceScopedAgentToolEvents } from "./components/agents-sdk/AgentToolRunsContext.js";
|
|
2
3
|
import { AgentChat, compactingNotice } from "./components/agents-sdk/AgentChat.js";
|
|
3
|
-
import { AgentToolRunsProvider, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents } from "./components/agents-sdk/AgentToolRunsContext.js";
|
|
4
|
-
import { SubagentRunList } from "./components/agents-sdk/SubagentRunList.js";
|
|
5
4
|
import { ThinkChatContext, ThinkChatLiveContext, useOptionalThinkChatContext, useThinkChatContext } from "./components/agents-sdk/ThinkChatContext.js";
|
|
6
5
|
import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./components/agents-sdk/ThinkChatActivity.js";
|
|
7
6
|
import { ThinkRecoveryNotice } from "./components/agents-sdk/ThinkRecoveryNotice.js";
|
|
8
7
|
import { t as WorkspaceMessageResponse } from "./WorkspaceMessageResponse-CJCmGvTx.js";
|
|
9
8
|
import * as React from "react";
|
|
10
|
-
import {
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { isTextUIPart } from "ai";
|
|
12
11
|
import { useAgentChat } from "@cloudflare/think/react";
|
|
13
12
|
import { useAgent } from "agents/react";
|
|
@@ -195,9 +194,8 @@ const ThinkChatApprovalsContext = React.createContext(null);
|
|
|
195
194
|
* inside the log) or `excludeTools` + your own `renderPart` (standalone
|
|
196
195
|
* card) — see README "App-specific tools" and the Custom Tool Panel story.
|
|
197
196
|
*/
|
|
198
|
-
function ThinkChatMessages({
|
|
197
|
+
function ThinkChatMessages({ draft, loading, renderPart, excludeTools, renderAgentToolRunLink, renderWorkspaceHtmlArtifact, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, sessionCompaction, ...props }) {
|
|
199
198
|
const chat = useOptionalThinkChatContext();
|
|
200
|
-
const agentTools = useOptionalAgentToolRuns();
|
|
201
199
|
const approvals = React.useContext(ThinkChatApprovalsContext);
|
|
202
200
|
const resolvedApprovals = resolveThinkApprovalProps({
|
|
203
201
|
thinkStub,
|
|
@@ -259,19 +257,6 @@ function ThinkChatMessages({ composerHeader, draft, loading, renderPart, exclude
|
|
|
259
257
|
children: [compactionSizeText(landedCompaction), " Context usage updates after your next message."]
|
|
260
258
|
}) : null;
|
|
261
259
|
const recoveryActive = chat && (chat.isRecovering || chat.connectionError || chat.error);
|
|
262
|
-
const backgroundRuns = renderAgentToolRunLink ? agentTools?.unboundRuns : void 0;
|
|
263
|
-
const resolvedComposerHeader = composerHeader || backgroundRuns?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [composerHeader, backgroundRuns?.length && renderAgentToolRunLink ? /* @__PURE__ */ jsxs("div", {
|
|
264
|
-
className: "subagent-run__tray",
|
|
265
|
-
"data-slot": "background-agent-runs",
|
|
266
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
267
|
-
className: "subagent-run__tray-label",
|
|
268
|
-
children: "Background agents"
|
|
269
|
-
}), /* @__PURE__ */ jsx(SubagentRunList, {
|
|
270
|
-
"aria-label": "Background agent runs",
|
|
271
|
-
runs: backgroundRuns,
|
|
272
|
-
renderRunLink: renderAgentToolRunLink
|
|
273
|
-
})]
|
|
274
|
-
}) : null] }) : void 0;
|
|
275
260
|
const submit = ({ text, files, references }, send) => {
|
|
276
261
|
setDismissedCompaction(sessionCompaction?.lastCompaction ?? null);
|
|
277
262
|
const prompt = [...references?.map(({ trigger, value }) => trigger ? `${trigger}${value}` : value) ?? [], text.trim()].filter(Boolean).join(" ");
|
|
@@ -288,7 +273,6 @@ function ThinkChatMessages({ composerHeader, draft, loading, renderPart, exclude
|
|
|
288
273
|
messages: EMPTY_DRAFT_MESSAGES,
|
|
289
274
|
status: "ready",
|
|
290
275
|
notice,
|
|
291
|
-
composerHeader: resolvedComposerHeader,
|
|
292
276
|
loading: true
|
|
293
277
|
});
|
|
294
278
|
if (!chat) {
|
|
@@ -299,7 +283,6 @@ function ThinkChatMessages({ composerHeader, draft, loading, renderPart, exclude
|
|
|
299
283
|
messages: draft.messages ?? EMPTY_DRAFT_MESSAGES,
|
|
300
284
|
status: draft.status ?? "ready",
|
|
301
285
|
notice: notice ?? sessionCompactionNotice,
|
|
302
|
-
composerHeader: resolvedComposerHeader,
|
|
303
286
|
onSubmit: (message) => submit(message, draft.onSubmit)
|
|
304
287
|
});
|
|
305
288
|
}
|
|
@@ -314,7 +297,6 @@ function ThinkChatMessages({ composerHeader, draft, loading, renderPart, exclude
|
|
|
314
297
|
onExecutionSettled: resolvedApprovals.onExecutionSettled,
|
|
315
298
|
pendingApprovals: resolvedApprovals.pendingApprovals,
|
|
316
299
|
notice: notice ?? (recoveryActive ? defaultNotice : sessionCompactionNotice),
|
|
317
|
-
composerHeader: resolvedComposerHeader,
|
|
318
300
|
onRegenerate: (messageId) => void chat.regenerate({ messageId }),
|
|
319
301
|
onSubmit: (message) => submit(message, chat.sendMessage)
|
|
320
302
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as EyeIcon, d as CheckIcon, et as WarningIcon, k as MaximizeIcon, m as CodeIcon, r as ArrowLeftIcon, v as DownloadIcon } from "./icons-
|
|
2
|
-
import {
|
|
1
|
+
import { b as EyeIcon, d as CheckIcon, et as WarningIcon, k as MaximizeIcon, m as CodeIcon, r as ArrowLeftIcon, v as DownloadIcon } from "./icons-DbrksZyY.js";
|
|
2
|
+
import { i as formatClock } from "./format-COCyV98Z.js";
|
|
3
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-8K1p1BDU.js";
|
|
3
4
|
import { AppTopBar } from "./components/general-purpose/AppTopBar.js";
|
|
4
|
-
import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-Dl7a3Wqo.js";
|
|
5
5
|
import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/agents-sdk/WorkspaceFile.js";
|
|
6
6
|
import { c as useWorkspaceNavigationContext, s as useWorkspaceNavigationRestoration } from "./WorkspaceLink-DtH66bAY.js";
|
|
7
7
|
import { n as createWorkspaceRehypePlugins, t as WorkspaceMessageResponse } from "./WorkspaceMessageResponse-CJCmGvTx.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { canRequestFavicon, inferFaviconUrl } from "../../utils/favicon.js";
|
|
2
|
-
import { D as LinkIcon, P as MonitorIcon, Q as TerminalIcon, S as FileIcon, T as InfoIcon, W as SearchIcon, et as WarningIcon, tt as WrenchIcon, z as PencilIcon } from "../../icons-
|
|
2
|
+
import { D as LinkIcon, P as MonitorIcon, Q as TerminalIcon, S as FileIcon, T as InfoIcon, W as SearchIcon, et as WarningIcon, tt as WrenchIcon, z as PencilIcon } from "../../icons-DbrksZyY.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/agents-sdk/AgentActivity.tsx
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ExpansionStateProvider } from "../ai-sdk/ExpansionState.js";
|
|
3
|
+
import { $ as TrashIcon, H as QueueIcon, I as MoveToFrontIcon, U as RefreshIcon, V as PlusIcon, q as SpinnerIcon, t as ArchiveIcon, z as PencilIcon } from "../../icons-DbrksZyY.js";
|
|
3
4
|
import { Button } from "../foundations/Button.js";
|
|
5
|
+
import { AgentChatMessageEditor } from "../ai-sdk/AgentChatMessageEditor.js";
|
|
4
6
|
import { IconButton } from "../foundations/IconButton.js";
|
|
7
|
+
import { Menu } from "../foundations/Menu.js";
|
|
8
|
+
import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputPermissionSelector, PromptInputReferences, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PromptInputTray, usePromptInputAttachments } from "../ai-sdk/PromptInput.js";
|
|
9
|
+
import { AgentChatStartScreen } from "../ai-sdk/AgentChatStartScreen.js";
|
|
5
10
|
import { Message, MessageAction, MessageActions, MessageMeta, MessageTimestamp } from "../ai-sdk/Message.js";
|
|
6
|
-
import { ExpansionStateProvider } from "../ai-sdk/ExpansionState.js";
|
|
7
11
|
import { AgentMessageParts } from "../ai-sdk/AgentMessageParts.js";
|
|
12
|
+
import { Marker, MarkerContent } from "../foundations/Marker.js";
|
|
13
|
+
import { t as CopyButton } from "../../copy-button-BpA7wQva.js";
|
|
8
14
|
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "../ai-sdk/Context.js";
|
|
9
|
-
import { EmptyState } from "../foundations/EmptyState.js";
|
|
10
15
|
import { VirtualMessageScroller } from "../ai-sdk/MessageScrollerVirtual.js";
|
|
11
16
|
import { QueueItem, QueueItemActions, QueueItemContent } from "../ai-sdk/Queue.js";
|
|
12
|
-
import {
|
|
13
|
-
import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputPermissionSelector, PromptInputReferences, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PromptInputTray, usePromptInputAttachments } from "../ai-sdk/PromptInput.js";
|
|
14
|
-
import { AgentChatStartScreen } from "../ai-sdk/AgentChatStartScreen.js";
|
|
15
|
-
import { AgentChatMessageEditor } from "../ai-sdk/AgentChatMessageEditor.js";
|
|
16
|
-
import { Marker, MarkerContent } from "../foundations/Marker.js";
|
|
17
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
17
18
|
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
19
|
+
import { AgentEventRow, getAgentEvent } from "./AgentEvent.js";
|
|
18
20
|
import { PromptInputApproval, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals } from "./PromptInputApproval.js";
|
|
19
|
-
import { t as CopyButton } from "../../copy-button-DHhf-J1d.js";
|
|
20
21
|
import * as React from "react";
|
|
21
22
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { isCompactionMessage } from "agents/experimental/memory/utils";
|
|
23
23
|
import { isTextUIPart } from "ai";
|
|
24
|
+
import { isCompactionMessage } from "agents/experimental/memory/utils";
|
|
24
25
|
//#region src/components/agents-sdk/AgentChat.tsx
|
|
25
26
|
/**
|
|
26
27
|
* Agents exports this helper from `agents/sessions` after cloudflare/agents#1896;
|
|
@@ -175,9 +176,13 @@ function isCompactedPart(message, partIndex) {
|
|
|
175
176
|
function AgentChatTranscriptRowBodyImpl({ message, messageIndex, status, renderPart, renderMessageAfter, editing, canEdit, editDisabled, onEditAndResend, onStartEdit, onCancelEdit, onFinishEdit, editButtonRef, responseNumber, showAssistantActions, showCopy, showRetry, onRegenerate, onCopyStatus }) {
|
|
176
177
|
const messageTime = getAgentChatMessageTime(message);
|
|
177
178
|
const userText = getEditableUserText(message);
|
|
179
|
+
const agentEvent = getAgentEvent(message);
|
|
178
180
|
return /* @__PURE__ */ jsx(Fragment, { children: isCompactionMessage(message) ? /* @__PURE__ */ jsx(Marker, {
|
|
179
181
|
variant: "separator",
|
|
180
182
|
children: /* @__PURE__ */ jsx(MarkerContent, { children: "Context compacted" })
|
|
183
|
+
}) : agentEvent ? /* @__PURE__ */ jsx(AgentEventRow, {
|
|
184
|
+
message,
|
|
185
|
+
event: agentEvent
|
|
181
186
|
}) : /* @__PURE__ */ jsx(Message, {
|
|
182
187
|
from: message.role,
|
|
183
188
|
children: editing && onEditAndResend ? /* @__PURE__ */ jsx(AgentChatMessageEditor, {
|
|
@@ -482,9 +487,9 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
482
487
|
composerInputRef.current?.focus();
|
|
483
488
|
}, [pendingApprovalKey]);
|
|
484
489
|
const contextUsage = contextWindow ? getContextUsage(messages) : void 0;
|
|
485
|
-
const newestAssistantIndex = messages.findLastIndex((message) => message.role === "assistant" && !isCompactionMessage(message));
|
|
490
|
+
const newestAssistantIndex = messages.findLastIndex((message) => message.role === "assistant" && !isCompactionMessage(message) && !getAgentEvent(message));
|
|
486
491
|
const lastAssistantIndex = onRegenerate && status !== "streaming" && status !== "submitted" ? newestAssistantIndex : -1;
|
|
487
|
-
const lastUserIndex = onEditAndResend ? messages.findLastIndex((message) => message.role === "user") : -1;
|
|
492
|
+
const lastUserIndex = onEditAndResend ? messages.findLastIndex((message) => message.role === "user" && !getAgentEvent(message)) : -1;
|
|
488
493
|
const [editingMessageId, setEditingMessageId] = React.useState();
|
|
489
494
|
const restoreEditFocus = React.useRef(false);
|
|
490
495
|
const editButtonRef = React.useRef(null);
|
|
@@ -502,7 +507,7 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
502
507
|
}, []);
|
|
503
508
|
let assistantResponseCount = 0;
|
|
504
509
|
const assistantResponseNumbers = messages.map((message) => {
|
|
505
|
-
if (message.role !== "assistant" || isCompactionMessage(message)) return 0;
|
|
510
|
+
if (message.role !== "assistant" || isCompactionMessage(message) || getAgentEvent(message)) return 0;
|
|
506
511
|
assistantResponseCount += 1;
|
|
507
512
|
return assistantResponseCount;
|
|
508
513
|
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { UIMessage } from "ai";
|
|
3
|
+
|
|
4
|
+
//#region src/components/agents-sdk/AgentEvent.d.ts
|
|
5
|
+
interface AgentEvent {
|
|
6
|
+
source: string;
|
|
7
|
+
runId?: string;
|
|
8
|
+
/** Terminal status of the run this completion notice reports. */
|
|
9
|
+
status?: string;
|
|
10
|
+
/** Milestone name when the turn is a mid-run report, absent for a completion. */
|
|
11
|
+
milestone?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Classify a framework-injected background-run message. Think persists a
|
|
15
|
+
* `submitMessages` turn's metadata under `metadata.turnMetadata` on the
|
|
16
|
+
* user-role message it appends (a completion notice, a `react` milestone), and
|
|
17
|
+
* puts a `narrate` milestone's metadata directly on the assistant message it
|
|
18
|
+
* adds — so both shapes are read. Anything else is an ordinary message.
|
|
19
|
+
*/
|
|
20
|
+
declare function getAgentEvent(message: UIMessage): AgentEvent | null;
|
|
21
|
+
interface AgentEventRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
message: UIMessage;
|
|
23
|
+
event: AgentEvent;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One collapsed transcript row for a background run's report or completion
|
|
27
|
+
* notice: who reported, what happened, and the first line of what it said;
|
|
28
|
+
* expanding shows the whole text the model received. The run's name comes
|
|
29
|
+
* from the parent's retained-run projection when the row is inside an
|
|
30
|
+
* `AgentToolRunsProvider`.
|
|
31
|
+
*/
|
|
32
|
+
declare function AgentEventRow({
|
|
33
|
+
className,
|
|
34
|
+
event,
|
|
35
|
+
message,
|
|
36
|
+
ref,
|
|
37
|
+
...props
|
|
38
|
+
}: AgentEventRowProps & {
|
|
39
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
40
|
+
}): React.JSX.Element;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { AgentEvent, AgentEventRow, AgentEventRowProps, getAgentEvent };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
+
import { Activity, ActivityContent, ActivityText, ActivityTrigger } from "../ai-sdk/Activity.js";
|
|
3
|
+
import { r as firstLine } from "../../format-COCyV98Z.js";
|
|
4
|
+
import { MessageResponse } from "../ai-sdk/Message.js";
|
|
5
|
+
import { NaniteMark } from "../nanites/NaniteScene.js";
|
|
6
|
+
import { getSubagentRunName } from "./SubagentRunIndicator.js";
|
|
7
|
+
import { useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { isTextUIPart } from "ai";
|
|
11
|
+
//#region src/components/agents-sdk/AgentEvent.tsx
|
|
12
|
+
/**
|
|
13
|
+
* `metadata.source` values Think stamps on the turns it injects for a
|
|
14
|
+
* detached (background) agent-tool run: upstream's default and the source the
|
|
15
|
+
* browser host passes for a delegated run's completion and milestone reports.
|
|
16
|
+
* A turn tagged with one of these was written by the runtime, not typed by the
|
|
17
|
+
* person, so the transcript renders it as an agent event rather than a user
|
|
18
|
+
* bubble.
|
|
19
|
+
*/
|
|
20
|
+
const AGENT_EVENT_SOURCES = /* @__PURE__ */ new Set(["delegate-completion", "detached-agent-tool"]);
|
|
21
|
+
function stringField(record, key) {
|
|
22
|
+
const value = record[key];
|
|
23
|
+
return typeof value === "string" ? value : void 0;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Classify a framework-injected background-run message. Think persists a
|
|
27
|
+
* `submitMessages` turn's metadata under `metadata.turnMetadata` on the
|
|
28
|
+
* user-role message it appends (a completion notice, a `react` milestone), and
|
|
29
|
+
* puts a `narrate` milestone's metadata directly on the assistant message it
|
|
30
|
+
* adds — so both shapes are read. Anything else is an ordinary message.
|
|
31
|
+
*/
|
|
32
|
+
function getAgentEvent(message) {
|
|
33
|
+
const metadata = message.metadata;
|
|
34
|
+
if (!metadata || typeof metadata !== "object") return null;
|
|
35
|
+
const record = metadata;
|
|
36
|
+
const turnMetadata = record.turnMetadata;
|
|
37
|
+
const candidate = turnMetadata && typeof turnMetadata === "object" ? turnMetadata : record;
|
|
38
|
+
const source = stringField(candidate, "source");
|
|
39
|
+
if (source === void 0 || !AGENT_EVENT_SOURCES.has(source)) return null;
|
|
40
|
+
return {
|
|
41
|
+
source,
|
|
42
|
+
runId: stringField(candidate, "runId"),
|
|
43
|
+
status: stringField(candidate, "status"),
|
|
44
|
+
milestone: stringField(candidate, "milestone")
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function eventVerb(event) {
|
|
48
|
+
if (event.milestone) return "reported";
|
|
49
|
+
switch (event.status) {
|
|
50
|
+
case "completed": return "finished";
|
|
51
|
+
case "error": return "failed";
|
|
52
|
+
case "aborted": return "was cancelled";
|
|
53
|
+
case "interrupted": return "was interrupted";
|
|
54
|
+
default: return "ended";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Both formatters — Think's `formatDetachedCompletion` and the host's
|
|
59
|
+
* milestone override — open with a one-line `Background task "…" (run …)`
|
|
60
|
+
* heading and put the child's own words in the next paragraph. The row's own
|
|
61
|
+
* action line already says that much, so the preview starts after it.
|
|
62
|
+
*/
|
|
63
|
+
const RUNTIME_HEADING = /^Background task .*?\n\n/u;
|
|
64
|
+
/** The first line of the event's own words, without the runtime heading. */
|
|
65
|
+
function agentEventPreview(text) {
|
|
66
|
+
return firstLine(text.replace(RUNTIME_HEADING, "")) || void 0;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* One collapsed transcript row for a background run's report or completion
|
|
70
|
+
* notice: who reported, what happened, and the first line of what it said;
|
|
71
|
+
* expanding shows the whole text the model received. The run's name comes
|
|
72
|
+
* from the parent's retained-run projection when the row is inside an
|
|
73
|
+
* `AgentToolRunsProvider`.
|
|
74
|
+
*/
|
|
75
|
+
function AgentEventRow({ className, event, message, ref, ...props }) {
|
|
76
|
+
const agentTools = useOptionalAgentToolRuns();
|
|
77
|
+
const run = event.runId ? agentTools?.runsById[event.runId] : void 0;
|
|
78
|
+
const name = run ? getSubagentRunName(run) : "Background task";
|
|
79
|
+
const text = message.parts.filter(isTextUIPart).map((part) => part.text).join("\n").trim();
|
|
80
|
+
return /* @__PURE__ */ jsxs(Activity, {
|
|
81
|
+
ref,
|
|
82
|
+
"data-slot": "agent-event",
|
|
83
|
+
"data-source": event.source,
|
|
84
|
+
"data-status": event.status,
|
|
85
|
+
className: cx("agent-event", className),
|
|
86
|
+
stateKey: `agent-event:${message.id}`,
|
|
87
|
+
...props,
|
|
88
|
+
children: [/* @__PURE__ */ jsx(ActivityTrigger, {
|
|
89
|
+
icon: /* @__PURE__ */ jsx(NaniteMark, { index: run?.order }),
|
|
90
|
+
action: `${name} ${eventVerb(event)}`,
|
|
91
|
+
detail: agentEventPreview(text)
|
|
92
|
+
}), /* @__PURE__ */ jsx(ActivityContent, { children: /* @__PURE__ */ jsx(ActivityText, { children: /* @__PURE__ */ jsx(MessageResponse, { children: text }) }) })]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { AgentEventRow, getAgentEvent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as useOptionalAgentToolRuns, i as AgentToolRunsProviderProps, n as AgentToolEventsValue, o as useSourceScopedAgentToolEvents, r as AgentToolRunsProvider, t as AgentToolEventSource } from "../../AgentToolRunsContext-
|
|
1
|
+
import { a as useOptionalAgentToolRuns, i as AgentToolRunsProviderProps, n as AgentToolEventsValue, o as useSourceScopedAgentToolEvents, r as AgentToolRunsProvider, t as AgentToolEventSource } from "../../AgentToolRunsContext-jtmveaRE.js";
|
|
2
2
|
export { AgentToolEventSource, AgentToolEventsValue, AgentToolRunsProvider, AgentToolRunsProviderProps, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents };
|
|
@@ -14,20 +14,24 @@ import { useAgentToolEvents } from "agents/react";
|
|
|
14
14
|
* The subscription's listener attaches in a passive effect, after paint. A
|
|
15
15
|
* host whose transport is in-process (the browser extension's port bridge)
|
|
16
16
|
* can complete the connect and deliver the replay before that effect runs —
|
|
17
|
-
* reliably so on a hot return from a drill-in.
|
|
18
|
-
* `useAgent` buffers `agent-tool-event` frames from socket
|
|
19
|
-
* `useAgentToolEvents` drains them when its listener
|
|
20
|
-
*
|
|
21
|
-
* socket).
|
|
22
|
-
*
|
|
23
|
-
*
|
|
17
|
+
* reliably so on a hot return from a drill-in. The fix lives in the Agents
|
|
18
|
+
* SDK, not here: `useAgent` buffers `agent-tool-event` frames from socket
|
|
19
|
+
* construction and `useAgentToolEvents` drains them when its listener
|
|
20
|
+
* attaches (`_bufferAgentToolReplayFrame` is the seam for a non-`useAgent`
|
|
21
|
+
* socket). As of agents 0.21.0 that is still the browser host's vendored
|
|
22
|
+
* edit, not a published release; a host on the published package has to
|
|
23
|
+
* buffer and re-dispatch the frames around its own socket before this hook
|
|
24
|
+
* can see them. Network transports are not affected in practice: the round
|
|
24
25
|
* trip loses to the effect flush.
|
|
25
26
|
*/
|
|
26
27
|
function useSourceScopedAgentToolEvents(agent) {
|
|
27
28
|
const agentTools = useAgentToolEvents({ agent });
|
|
28
29
|
const sourceIdentity = JSON.stringify(agent.path);
|
|
29
30
|
const resetAgentTools = React.useEffectEvent(() => agentTools.resetLocalState());
|
|
31
|
+
const seenIdentity = React.useRef(sourceIdentity);
|
|
30
32
|
React.useEffect(() => {
|
|
33
|
+
if (seenIdentity.current === sourceIdentity) return;
|
|
34
|
+
seenIdentity.current = sourceIdentity;
|
|
31
35
|
resetAgentTools();
|
|
32
36
|
}, [sourceIdentity]);
|
|
33
37
|
return agentTools;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as KeyboardIcon, U as RefreshIcon, r as ArrowLeftIcon } from "../../icons-
|
|
1
|
+
import { E as KeyboardIcon, U as RefreshIcon, r as ArrowLeftIcon } from "../../icons-DbrksZyY.js";
|
|
2
2
|
import { Button } from "../foundations/Button.js";
|
|
3
3
|
import { WebPreviewNavigationButton } from "../general-purpose/WebPreview.js";
|
|
4
4
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { _ as DotIcon, k as MaximizeIcon, q as SpinnerIcon } from "../../icons-
|
|
2
|
+
import { _ as DotIcon, k as MaximizeIcon, q as SpinnerIcon } from "../../icons-DbrksZyY.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { Dialog } from "../foundations/Dialog.js";
|
|
5
5
|
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { B as PlayIcon, R as PauseIcon } from "../../icons-
|
|
2
|
+
import { B as PlayIcon, R as PauseIcon } from "../../icons-DbrksZyY.js";
|
|
3
3
|
import { IconButton } from "../foundations/IconButton.js";
|
|
4
|
-
import {
|
|
4
|
+
import { i as formatClock } from "../../format-COCyV98Z.js";
|
|
5
5
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
6
6
|
import { Slider } from "../foundations/Slider.js";
|
|
7
7
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { nt as XIcon, q as SpinnerIcon } from "../../icons-
|
|
2
|
+
import { nt as XIcon, q as SpinnerIcon } from "../../icons-DbrksZyY.js";
|
|
3
3
|
import { Tabs } from "../foundations/Tabs.js";
|
|
4
4
|
import { WebPreview, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewUrl } from "../general-purpose/WebPreview.js";
|
|
5
5
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { n as ResponsiveSidebarShell } from "../../ResponsiveSidebarShell-BTVPxLJK.js";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
|
|
3
4
|
//#region src/components/agents-sdk/ManagerOffice.d.ts
|
|
4
5
|
type ManagerOfficeWorkStatus = "idle" | "running" | "attention" | "error" | "interrupted";
|
|
5
|
-
/**
|
|
6
|
-
* The rail already lists every employee, so there is no separate roster view:
|
|
7
|
-
* the office opens on the one thing that needs a person, and an employee is a
|
|
8
|
-
* selection in the rail rather than a page reached through a second list.
|
|
9
|
-
*/
|
|
6
|
+
/** The app-owned projection currently shown by the manager office. */
|
|
10
7
|
type ManagerOfficeView = {
|
|
8
|
+
kind: "dashboard";
|
|
9
|
+
} | {
|
|
11
10
|
kind: "attention";
|
|
12
11
|
} | {
|
|
13
12
|
kind: "employee";
|
|
@@ -40,6 +39,8 @@ interface ManagerOfficeWork {
|
|
|
40
39
|
title: string;
|
|
41
40
|
/** Canonical thread lifecycle status. */
|
|
42
41
|
status: ManagerOfficeWorkStatus;
|
|
42
|
+
/** Concise result shown to managers when the work is ready for review. */
|
|
43
|
+
summary?: string;
|
|
43
44
|
/** Unix timestamp in milliseconds of the latest lifecycle transition. */
|
|
44
45
|
updatedAt: number;
|
|
45
46
|
}
|
|
@@ -75,6 +76,30 @@ interface ManagerOfficeChannel {
|
|
|
75
76
|
*/
|
|
76
77
|
icon?: React.ReactNode;
|
|
77
78
|
}
|
|
79
|
+
interface ManagerOfficeBrowserPreview {
|
|
80
|
+
/** Title of the tab currently visible on the employee's browser. */
|
|
81
|
+
title: string;
|
|
82
|
+
/** Display-safe URL supplied by the host. */
|
|
83
|
+
url: string;
|
|
84
|
+
}
|
|
85
|
+
interface ManagerOfficeAnalyticsPoint {
|
|
86
|
+
/** Start of the reporting bucket as a Unix timestamp in milliseconds. */
|
|
87
|
+
timestamp: number;
|
|
88
|
+
/** Outcomes completed during this bucket. */
|
|
89
|
+
completed: number;
|
|
90
|
+
/** Employee runtime consumed during this bucket. */
|
|
91
|
+
workloadHours: number;
|
|
92
|
+
/** Host-estimated inference and tool cost during this bucket. */
|
|
93
|
+
estimatedCost: number;
|
|
94
|
+
}
|
|
95
|
+
interface ManagerOfficeEmployeeAnalytics {
|
|
96
|
+
employeeId: string;
|
|
97
|
+
points: readonly ManagerOfficeAnalyticsPoint[];
|
|
98
|
+
}
|
|
99
|
+
interface ManagerOfficeReportSelection {
|
|
100
|
+
employeeIds: readonly string[];
|
|
101
|
+
rangeDays: 7 | 30 | 90;
|
|
102
|
+
}
|
|
78
103
|
interface ManagerOfficeEmployeeBase {
|
|
79
104
|
/** Stable employee identity used by routes and list keys. */
|
|
80
105
|
id: string;
|
|
@@ -94,6 +119,8 @@ interface ManagerOfficeConnectedEmployee extends ManagerOfficeEmployeeBase {
|
|
|
94
119
|
routines: readonly ManagerOfficeRoutine[];
|
|
95
120
|
/** Every service the employee reads from or acts on. Empty is meaningful. */
|
|
96
121
|
channels: readonly ManagerOfficeChannel[];
|
|
122
|
+
/** The live tab the manager can glance at from the office. */
|
|
123
|
+
browserPreview?: ManagerOfficeBrowserPreview;
|
|
97
124
|
}
|
|
98
125
|
interface ManagerOfficeDisconnectedEmployee extends ManagerOfficeEmployeeBase {
|
|
99
126
|
status: "offline" | "connecting" | "unavailable";
|
|
@@ -127,6 +154,9 @@ type ManagerOfficeDestination = {
|
|
|
127
154
|
} | {
|
|
128
155
|
kind: "new-work";
|
|
129
156
|
employee: ManagerOfficeConnectedEmployee;
|
|
157
|
+
} | {
|
|
158
|
+
kind: "new-routine";
|
|
159
|
+
employee: ManagerOfficeConnectedEmployee;
|
|
130
160
|
} | {
|
|
131
161
|
kind: "workspace";
|
|
132
162
|
employee: ManagerOfficeConnectedEmployee;
|
|
@@ -138,8 +168,10 @@ interface ManagerOfficeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
138
168
|
employees: readonly ManagerOfficeEmployee[];
|
|
139
169
|
/** Returns an app-owned route element for every office destination. */
|
|
140
170
|
renderLink: (destination: ManagerOfficeDestination) => React.ReactElement;
|
|
141
|
-
/** Add/sign-out controls rendered in the office rail. */
|
|
171
|
+
/** Add/sign-out controls rendered in the app bar or office rail. */
|
|
142
172
|
officeActions?: React.ReactNode;
|
|
173
|
+
/** Place the wide-layout Workforce toggle. Defaults to the Workforce sidebar. */
|
|
174
|
+
sidebarTogglePlacement?: React.ComponentProps<typeof ResponsiveSidebarShell>["sidebarTogglePlacement"];
|
|
143
175
|
/**
|
|
144
176
|
* Actions rendered for the selected connected employee. Compose interactive
|
|
145
177
|
* controls through `AppTopBar.Control` so they join the toolbar.
|
|
@@ -147,22 +179,84 @@ interface ManagerOfficeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
147
179
|
renderEmployeeActions?: (employee: ManagerOfficeConnectedEmployee) => React.ReactNode;
|
|
148
180
|
/** Action shown in the empty office. */
|
|
149
181
|
emptyOfficeAction?: React.ReactNode;
|
|
182
|
+
/** Per-employee reporting buckets used by the executive analytics view. */
|
|
183
|
+
analytics?: readonly ManagerOfficeEmployeeAnalytics[];
|
|
184
|
+
/** Currency used for cost estimates. Defaults to USD. */
|
|
185
|
+
analyticsCurrency?: string;
|
|
186
|
+
/** Export the exact filtered portfolio and time range currently on screen. */
|
|
187
|
+
onExportReport?: (selection: ManagerOfficeReportSelection) => void;
|
|
150
188
|
}
|
|
189
|
+
interface ManagerOfficeSidebarProps extends Omit<React.HTMLAttributes<HTMLElement>, "content"> {
|
|
190
|
+
/** Close the office drawer after a compact-width selection. */
|
|
191
|
+
closeSidebarOnCompact?: () => void;
|
|
192
|
+
/** Employees projected from their owning runtimes. */
|
|
193
|
+
employees: readonly ManagerOfficeEmployee[];
|
|
194
|
+
/** App-owned route element for an employee selection. */
|
|
195
|
+
renderLink: ManagerOfficeProps["renderLink"];
|
|
196
|
+
/** Add/sign-out/toggle controls rendered beside Workforce. */
|
|
197
|
+
officeActions?: React.ReactNode;
|
|
198
|
+
/** Employee whose row and optional nested content are active. */
|
|
199
|
+
selectedEmployeeId?: string | null;
|
|
200
|
+
/** App-specific selected-employee content shown after the switcher. */
|
|
201
|
+
content?: React.ReactNode;
|
|
202
|
+
/** Persistent sidebar action, such as starting a conversation with the selected employee. */
|
|
203
|
+
footer?: React.ReactNode;
|
|
204
|
+
}
|
|
205
|
+
type ManagerOfficeSidebarAlertProps = {
|
|
206
|
+
"aria-label"?: string;
|
|
207
|
+
className?: string;
|
|
208
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement>; /** Primary actionable issue title. */
|
|
209
|
+
title: React.ReactNode; /** Quiet owning-work or source context. */
|
|
210
|
+
detail?: React.ReactNode;
|
|
211
|
+
} & ({
|
|
212
|
+
href: string;
|
|
213
|
+
render?: never;
|
|
214
|
+
} | {
|
|
215
|
+
render: React.ReactElement;
|
|
216
|
+
href?: never;
|
|
217
|
+
});
|
|
218
|
+
/** Dense nested action for an employee alert already signalled by the roster status. */
|
|
219
|
+
declare function ManagerOfficeSidebarAlert({
|
|
220
|
+
className,
|
|
221
|
+
detail,
|
|
222
|
+
title,
|
|
223
|
+
...props
|
|
224
|
+
}: ManagerOfficeSidebarAlertProps): React.JSX.Element;
|
|
225
|
+
/**
|
|
226
|
+
* Shared Manager Office rail. Stories and host shells may add employee-owned
|
|
227
|
+
* content, but the Workforce header, roster identity, status language, scrolling,
|
|
228
|
+
* and footer placement stay component-owned and therefore cannot drift.
|
|
229
|
+
*/
|
|
230
|
+
declare function ManagerOfficeSidebar({
|
|
231
|
+
className,
|
|
232
|
+
closeSidebarOnCompact,
|
|
233
|
+
content,
|
|
234
|
+
employees,
|
|
235
|
+
renderLink,
|
|
236
|
+
footer,
|
|
237
|
+
officeActions,
|
|
238
|
+
selectedEmployeeId,
|
|
239
|
+
...props
|
|
240
|
+
}: ManagerOfficeSidebarProps): React.JSX.Element;
|
|
151
241
|
/**
|
|
152
|
-
* Multi-employee manager office: aggregate handoffs, employee
|
|
153
|
-
* employee dossier. The consuming app owns authentication,
|
|
154
|
-
* routing, and the selected employee's full work surface.
|
|
242
|
+
* Multi-employee manager office: a dashboard, aggregate handoffs, employee
|
|
243
|
+
* roster, and one employee dossier. The consuming app owns authentication,
|
|
244
|
+
* Agent connections, routing, and the selected employee's full work surface.
|
|
155
245
|
*/
|
|
156
246
|
declare function ManagerOffice({
|
|
247
|
+
analytics,
|
|
248
|
+
analyticsCurrency,
|
|
157
249
|
className,
|
|
158
250
|
emptyOfficeAction,
|
|
159
251
|
employees,
|
|
160
252
|
renderLink,
|
|
161
253
|
officeActions,
|
|
254
|
+
onExportReport,
|
|
162
255
|
renderEmployeeActions,
|
|
256
|
+
sidebarTogglePlacement,
|
|
163
257
|
style,
|
|
164
258
|
view,
|
|
165
259
|
...props
|
|
166
260
|
}: ManagerOfficeProps): React.JSX.Element;
|
|
167
261
|
//#endregion
|
|
168
|
-
export { ManagerOffice, ManagerOfficeChannel, ManagerOfficeChannelDirection, ManagerOfficeChannelStatus, ManagerOfficeConnectedEmployee, ManagerOfficeDestination, ManagerOfficeDisconnectedEmployee, ManagerOfficeEmployee, ManagerOfficeEmployeeStatus, ManagerOfficeHandoff, ManagerOfficeProps, ManagerOfficeRoutine, ManagerOfficeView, ManagerOfficeWork, ManagerOfficeWorkStatus };
|
|
262
|
+
export { ManagerOffice, ManagerOfficeAnalyticsPoint, ManagerOfficeBrowserPreview, ManagerOfficeChannel, ManagerOfficeChannelDirection, ManagerOfficeChannelStatus, ManagerOfficeConnectedEmployee, ManagerOfficeDestination, ManagerOfficeDisconnectedEmployee, ManagerOfficeEmployee, ManagerOfficeEmployeeAnalytics, ManagerOfficeEmployeeStatus, ManagerOfficeHandoff, ManagerOfficeProps, ManagerOfficeReportSelection, ManagerOfficeRoutine, ManagerOfficeSidebar, ManagerOfficeSidebarAlert, ManagerOfficeSidebarAlertProps, ManagerOfficeSidebarProps, ManagerOfficeView, ManagerOfficeWork, ManagerOfficeWorkStatus };
|