@mcp-b/react-components 0.44.1 → 0.46.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.
Files changed (170) hide show
  1. package/dist/{AgentChat-Bibfj7u1.d.ts → AgentChat-BLmQghkt.d.ts} +2 -2
  2. package/dist/{AgentToolRunsContext-daY67hFM.d.ts → AgentToolRunsContext-jtmveaRE.d.ts} +8 -7
  3. package/dist/{CodeBlock-Dl7a3Wqo.js → CodeBlock-BpooTofO.js} +1 -1
  4. package/dist/{FileTree-Uu3ZnW1u.js → FileTree-CAXWXH63.js} +1 -1
  5. package/dist/{McpConnectorForm-MRm1r59e.d.ts → McpConnectorForm-BETdVBRk.d.ts} +1 -1
  6. package/dist/{McpPluginCatalog-mbGw8FTu.d.ts → McpPluginCatalog-C6ip9IvL.d.ts} +2 -2
  7. package/dist/{PromptInput-BRX7FhjH.d.ts → PromptInput-DtJHyp0S.d.ts} +27 -22
  8. package/dist/{ResponsiveSidebarShell-DOXd5T-d.d.ts → ResponsiveSidebarShell-BTVPxLJK.d.ts} +12 -0
  9. package/dist/{SetupChecklist-DOp-zqjh.js → SetupChecklist-DyPZWzK2.js} +2 -2
  10. package/dist/{ThinkChat-BES_3Mb-.js → ThinkChat-qztQ6Clo.js} +7 -22
  11. package/dist/{ThinkChatActivity-CgvmTXXB.d.ts → ThinkChatActivity-B3lGVS-6.d.ts} +1 -1
  12. package/dist/{WorkspaceFileView-BublZXky.js → WorkspaceFileView-BvDbKM2c.js} +3 -3
  13. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  14. package/dist/components/agents-sdk/AgentChat.d.ts +1 -1
  15. package/dist/components/agents-sdk/AgentChat.js +44 -40
  16. package/dist/components/agents-sdk/AgentEvent.d.ts +42 -0
  17. package/dist/components/agents-sdk/AgentEvent.js +96 -0
  18. package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +1 -1
  19. package/dist/components/agents-sdk/AgentToolRunsContext.js +11 -7
  20. package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
  21. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  22. package/dist/components/agents-sdk/BrowserReplay.js +2 -2
  23. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  24. package/dist/components/agents-sdk/ManagerOffice.d.ts +106 -11
  25. package/dist/components/agents-sdk/ManagerOffice.js +1193 -151
  26. package/dist/components/agents-sdk/McpConnectionRequest.d.ts +1 -1
  27. package/dist/components/agents-sdk/McpConnectionRequest.js +11 -5
  28. package/dist/components/agents-sdk/McpConnectorForm.d.ts +1 -1
  29. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  30. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -1
  31. package/dist/components/agents-sdk/McpPluginCatalog.js +11 -7
  32. package/dist/components/agents-sdk/McpServerPicker.d.ts +2 -2
  33. package/dist/components/agents-sdk/McpServerPicker.js +4 -4
  34. package/dist/components/agents-sdk/ModelSelector.js +5 -5
  35. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  36. package/dist/components/agents-sdk/PromptInputCommands.d.ts +5 -2
  37. package/dist/components/agents-sdk/PromptInputCommands.js +81 -3
  38. package/dist/components/agents-sdk/SubagentRunDetails.js +1 -1
  39. package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +21 -3
  40. package/dist/components/agents-sdk/SubagentRunIndicator.js +56 -6
  41. package/dist/components/agents-sdk/SubagentRunSelector.js +5 -12
  42. package/dist/components/agents-sdk/ThinkChat.d.ts +4 -5
  43. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  44. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  45. package/dist/components/agents-sdk/ThinkChatActivity.js +3 -3
  46. package/dist/components/agents-sdk/ThinkChatActivitySummary.js +1 -1
  47. package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
  48. package/dist/components/agents-sdk/ThinkExecutionDetail.js +3 -3
  49. package/dist/components/agents-sdk/ThinkExecutionRun.js +1 -1
  50. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  51. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  52. package/dist/components/agents-sdk/ThinkFullApp.d.ts +14 -4
  53. package/dist/components/agents-sdk/ThinkFullApp.js +51 -5
  54. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
  55. package/dist/components/agents-sdk/ThinkPendingApproval.js +1 -1
  56. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
  57. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +3 -3
  58. package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
  59. package/dist/components/agents-sdk/ThinkRoutineForm.js +4 -4
  60. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +1 -1
  61. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +4 -4
  62. package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
  63. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +22 -4
  64. package/dist/components/agents-sdk/ThinkSidepanel.js +87 -35
  65. package/dist/components/agents-sdk/ThinkThreadPicker.js +5 -5
  66. package/dist/components/agents-sdk/Workspace.js +1 -1
  67. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  68. package/dist/components/agents-sdk/WorkspaceExplorer.js +1 -1
  69. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  70. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  71. package/dist/components/agents-sdk/WorkspaceMountManager.js +4 -21
  72. package/dist/components/ai-sdk/Activity.js +1 -1
  73. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  74. package/dist/components/ai-sdk/Approval.js +2 -2
  75. package/dist/components/ai-sdk/Artifact.js +1 -1
  76. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  77. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  78. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  79. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  80. package/dist/components/ai-sdk/ComposerLink.d.ts +27 -0
  81. package/dist/components/ai-sdk/ComposerLink.js +111 -0
  82. package/dist/components/ai-sdk/ConnectedAppCards.js +3 -3
  83. package/dist/components/ai-sdk/Context.js +1 -1
  84. package/dist/components/ai-sdk/Conversation.js +1 -1
  85. package/dist/components/ai-sdk/Goal.js +2 -2
  86. package/dist/components/ai-sdk/InlineCitation.js +1 -1
  87. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  88. package/dist/components/ai-sdk/Message.js +19 -3
  89. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  90. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  91. package/dist/components/ai-sdk/Plan.js +2 -2
  92. package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
  93. package/dist/components/ai-sdk/PromptInput.js +67 -61
  94. package/dist/components/ai-sdk/PromptInputComposerEditor.d.ts +31 -0
  95. package/dist/components/ai-sdk/PromptInputComposerEditor.js +198 -0
  96. package/dist/components/ai-sdk/Queue.js +2 -2
  97. package/dist/components/ai-sdk/Reasoning.js +2 -2
  98. package/dist/components/ai-sdk/Sources.js +1 -1
  99. package/dist/components/ai-sdk/Task.js +1 -1
  100. package/dist/components/ai-sdk/ToolInvocation.js +1 -1
  101. package/dist/components/extension/ChatGptSignInScreen.js +2 -2
  102. package/dist/components/extension/CodexModelSelector.js +2 -2
  103. package/dist/components/extension/ConversationTabPicker.js +2 -2
  104. package/dist/components/foundations/AppIcon.js +1 -1
  105. package/dist/components/foundations/Checkbox.js +1 -1
  106. package/dist/components/foundations/Collapsible.js +1 -1
  107. package/dist/components/foundations/ContextMenu.js +1 -1
  108. package/dist/components/foundations/Menubar.js +1 -1
  109. package/dist/components/foundations/SearchField.js +1 -1
  110. package/dist/components/foundations/Select.js +1 -1
  111. package/dist/components/foundations/Stepper.js +1 -1
  112. package/dist/components/foundations/Toast.js +1 -1
  113. package/dist/components/foundations/ToggleGroup.d.ts +1 -1
  114. package/dist/components/foundations/ToggleGroup.js +1 -1
  115. package/dist/components/foundations/icons.d.ts +1 -1
  116. package/dist/components/foundations/icons.js +1 -1
  117. package/dist/components/general-purpose/Commit.js +2 -2
  118. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  119. package/dist/components/general-purpose/FileTree.js +1 -1
  120. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  121. package/dist/components/general-purpose/PricingPlanCard.js +2 -2
  122. package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
  123. package/dist/components/general-purpose/ResizableSidePanel.js +1 -1
  124. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -1
  125. package/dist/components/general-purpose/ResponsiveSidebarShell.js +72 -22
  126. package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
  127. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  128. package/dist/components/general-purpose/Terminal.js +2 -2
  129. package/dist/components/general-purpose/TestResults.js +1 -1
  130. package/dist/components/general-purpose/ThemeModeControl.js +2 -2
  131. package/dist/components/general-purpose/WebPreview.js +3 -3
  132. package/dist/components/nanites/AgentConnection.js +2 -2
  133. package/dist/components/nanites/AgentToolDetail.js +4 -4
  134. package/dist/{copy-button-DHhf-J1d.js → copy-button-D7ySsRRo.js} +1 -1
  135. package/dist/{format-DB2mX9DA.js → format-COCyV98Z.js} +23 -1
  136. package/dist/{icons-Dw-im7lg.js → icons-BNEY4gO5.js} +44 -4
  137. package/dist/{icons-6ZnyZJiR.d.ts → icons-D0Pd2P9v.d.ts} +9 -4
  138. package/dist/{mcp-server-SD_S-IpB.js → mcp-server-7NR24ASj.js} +31 -4
  139. package/dist/{mcp-server-catalog-CCj2ItkV.d.ts → mcp-server-catalog-Cbu483Zb.d.ts} +9 -9
  140. package/dist/{progress-ring-BEocM1e3.js → progress-ring-Cgii90dC.js} +1 -1
  141. package/dist/{provider-logos-zjZycgV6.js → provider-logos-DWYY8wNz.js} +31 -6
  142. package/dist/styles/action-guide.css +4 -0
  143. package/dist/styles/agent-attention.css +5 -1
  144. package/dist/styles/agent-chat.css +21 -18
  145. package/dist/styles/agent-event.css +14 -0
  146. package/dist/styles/app-icon.css +21 -0
  147. package/dist/styles/avatar.css +2 -1
  148. package/dist/styles/base.css +4 -0
  149. package/dist/styles/brand-marks.css +22 -0
  150. package/dist/styles/button.css +10 -0
  151. package/dist/styles/composer-link.css +99 -0
  152. package/dist/styles/connected-app-card.css +9 -0
  153. package/dist/styles/github-motion-mark.css +8 -1
  154. package/dist/styles/index.css +3 -0
  155. package/dist/styles/manager-office.css +1313 -73
  156. package/dist/styles/mcp-plugin-catalog.css +4 -0
  157. package/dist/styles/mcp-server-picker.css +2 -0
  158. package/dist/styles/message-scroller.css +5 -0
  159. package/dist/styles/prompt-input.css +14 -53
  160. package/dist/styles/responsive-sidebar-shell.css +47 -0
  161. package/dist/styles/subagent-run.css +29 -19
  162. package/dist/styles/think-full-app.css +139 -4
  163. package/dist/styles/think-sidepanel.css +9 -5
  164. package/dist/styles/think-thread-picker.css +13 -12
  165. package/dist/styles/workspace-mount-manager.css +0 -22
  166. package/dist/utils/composer-link.d.ts +59 -0
  167. package/dist/utils/composer-link.js +203 -0
  168. package/dist/utils/mcp-server-catalog.d.ts +1 -1
  169. package/dist/utils/mcp-server-catalog.js +9 -9
  170. package/package.json +8 -8
@@ -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-daY67hFM.js";
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. Upstream owns the fix:
18
- * `useAgent` buffers `agent-tool-event` frames from socket construction and
19
- * `useAgentToolEvents` drains them when its listener attaches (agents >
20
- * 0.20.1; `_bufferAgentToolReplayFrame` is the seam for a non-`useAgent`
21
- * socket). On older versions such hosts must buffer and re-dispatch
22
- * themselves think-browser-host's `useThinkAgentToolEvents` is that
23
- * interim shim. Network transports are not affected in practice: the round
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-Dw-im7lg.js";
1
+ import { E as KeyboardIcon, U as RefreshIcon, r as ArrowLeftIcon } from "../../icons-BNEY4gO5.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-Dw-im7lg.js";
2
+ import { _ as DotIcon, k as MaximizeIcon, q as SpinnerIcon } from "../../icons-BNEY4gO5.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-Dw-im7lg.js";
2
+ import { B as PlayIcon, R as PauseIcon } from "../../icons-BNEY4gO5.js";
3
3
  import { IconButton } from "../foundations/IconButton.js";
4
- import { r as formatClock } from "../../format-DB2mX9DA.js";
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-Dw-im7lg.js";
2
+ import { nt as XIcon, q as SpinnerIcon } from "../../icons-BNEY4gO5.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
  }
@@ -71,10 +72,35 @@ interface ManagerOfficeChannel {
71
72
  detail?: string;
72
73
  /**
73
74
  * App-owned service mark. Products know their own integrations, so the mark
74
- * comes from them; the package draws the first letter when none is supplied.
75
+ * comes from them. When omitted, a catalog plugin mark is used when the
76
+ * channel name matches a known connector; otherwise the first letter.
75
77
  */
76
78
  icon?: React.ReactNode;
77
79
  }
80
+ interface ManagerOfficeBrowserPreview {
81
+ /** Title of the tab currently visible on the employee's browser. */
82
+ title: string;
83
+ /** Display-safe URL supplied by the host. */
84
+ url: string;
85
+ }
86
+ interface ManagerOfficeAnalyticsPoint {
87
+ /** Start of the reporting bucket as a Unix timestamp in milliseconds. */
88
+ timestamp: number;
89
+ /** Outcomes completed during this bucket. */
90
+ completed: number;
91
+ /** Employee runtime consumed during this bucket. */
92
+ workloadHours: number;
93
+ /** Host-estimated inference and tool cost during this bucket. */
94
+ estimatedCost: number;
95
+ }
96
+ interface ManagerOfficeEmployeeAnalytics {
97
+ employeeId: string;
98
+ points: readonly ManagerOfficeAnalyticsPoint[];
99
+ }
100
+ interface ManagerOfficeReportSelection {
101
+ employeeIds: readonly string[];
102
+ rangeDays: 7 | 30 | 90;
103
+ }
78
104
  interface ManagerOfficeEmployeeBase {
79
105
  /** Stable employee identity used by routes and list keys. */
80
106
  id: string;
@@ -94,6 +120,8 @@ interface ManagerOfficeConnectedEmployee extends ManagerOfficeEmployeeBase {
94
120
  routines: readonly ManagerOfficeRoutine[];
95
121
  /** Every service the employee reads from or acts on. Empty is meaningful. */
96
122
  channels: readonly ManagerOfficeChannel[];
123
+ /** The live tab the manager can glance at from the office. */
124
+ browserPreview?: ManagerOfficeBrowserPreview;
97
125
  }
98
126
  interface ManagerOfficeDisconnectedEmployee extends ManagerOfficeEmployeeBase {
99
127
  status: "offline" | "connecting" | "unavailable";
@@ -127,6 +155,9 @@ type ManagerOfficeDestination = {
127
155
  } | {
128
156
  kind: "new-work";
129
157
  employee: ManagerOfficeConnectedEmployee;
158
+ } | {
159
+ kind: "new-routine";
160
+ employee: ManagerOfficeConnectedEmployee;
130
161
  } | {
131
162
  kind: "workspace";
132
163
  employee: ManagerOfficeConnectedEmployee;
@@ -138,8 +169,10 @@ interface ManagerOfficeProps extends React.HTMLAttributes<HTMLDivElement> {
138
169
  employees: readonly ManagerOfficeEmployee[];
139
170
  /** Returns an app-owned route element for every office destination. */
140
171
  renderLink: (destination: ManagerOfficeDestination) => React.ReactElement;
141
- /** Add/sign-out controls rendered in the office rail. */
172
+ /** Add/sign-out controls rendered in the app bar or office rail. */
142
173
  officeActions?: React.ReactNode;
174
+ /** Place the wide-layout Workforce toggle. Defaults to the Workforce sidebar. */
175
+ sidebarTogglePlacement?: React.ComponentProps<typeof ResponsiveSidebarShell>["sidebarTogglePlacement"];
143
176
  /**
144
177
  * Actions rendered for the selected connected employee. Compose interactive
145
178
  * controls through `AppTopBar.Control` so they join the toolbar.
@@ -147,22 +180,84 @@ interface ManagerOfficeProps extends React.HTMLAttributes<HTMLDivElement> {
147
180
  renderEmployeeActions?: (employee: ManagerOfficeConnectedEmployee) => React.ReactNode;
148
181
  /** Action shown in the empty office. */
149
182
  emptyOfficeAction?: React.ReactNode;
183
+ /** Per-employee reporting buckets used by the executive analytics view. */
184
+ analytics?: readonly ManagerOfficeEmployeeAnalytics[];
185
+ /** Currency used for cost estimates. Defaults to USD. */
186
+ analyticsCurrency?: string;
187
+ /** Export the exact filtered portfolio and time range currently on screen. */
188
+ onExportReport?: (selection: ManagerOfficeReportSelection) => void;
150
189
  }
190
+ interface ManagerOfficeSidebarProps extends Omit<React.HTMLAttributes<HTMLElement>, "content"> {
191
+ /** Close the office drawer after a compact-width selection. */
192
+ closeSidebarOnCompact?: () => void;
193
+ /** Employees projected from their owning runtimes. */
194
+ employees: readonly ManagerOfficeEmployee[];
195
+ /** App-owned route element for an employee selection. */
196
+ renderLink: ManagerOfficeProps["renderLink"];
197
+ /** Add/sign-out/toggle controls rendered beside Workforce. */
198
+ officeActions?: React.ReactNode;
199
+ /** Employee whose row and optional nested content are active. */
200
+ selectedEmployeeId?: string | null;
201
+ /** App-specific selected-employee content shown after the switcher. */
202
+ content?: React.ReactNode;
203
+ /** Persistent sidebar action, such as starting a conversation with the selected employee. */
204
+ footer?: React.ReactNode;
205
+ }
206
+ type ManagerOfficeSidebarAlertProps = {
207
+ "aria-label"?: string;
208
+ className?: string;
209
+ onClick?: React.MouseEventHandler<HTMLAnchorElement>; /** Primary actionable issue title. */
210
+ title: React.ReactNode; /** Quiet owning-work or source context. */
211
+ detail?: React.ReactNode;
212
+ } & ({
213
+ href: string;
214
+ render?: never;
215
+ } | {
216
+ render: React.ReactElement;
217
+ href?: never;
218
+ });
219
+ /** Dense nested action for an employee alert already signalled by the roster status. */
220
+ declare function ManagerOfficeSidebarAlert({
221
+ className,
222
+ detail,
223
+ title,
224
+ ...props
225
+ }: ManagerOfficeSidebarAlertProps): React.JSX.Element;
226
+ /**
227
+ * Shared Manager Office rail. Stories and host shells may add employee-owned
228
+ * content, but the Workforce header, roster identity, status language, scrolling,
229
+ * and footer placement stay component-owned and therefore cannot drift.
230
+ */
231
+ declare function ManagerOfficeSidebar({
232
+ className,
233
+ closeSidebarOnCompact,
234
+ content,
235
+ employees,
236
+ renderLink,
237
+ footer,
238
+ officeActions,
239
+ selectedEmployeeId,
240
+ ...props
241
+ }: ManagerOfficeSidebarProps): React.JSX.Element;
151
242
  /**
152
- * Multi-employee manager office: aggregate handoffs, employee roster, and one
153
- * employee dossier. The consuming app owns authentication, Agent connections,
154
- * routing, and the selected employee's full work surface.
243
+ * Multi-employee manager office: a dashboard, aggregate handoffs, employee
244
+ * roster, and one employee dossier. The consuming app owns authentication,
245
+ * Agent connections, routing, and the selected employee's full work surface.
155
246
  */
156
247
  declare function ManagerOffice({
248
+ analytics,
249
+ analyticsCurrency,
157
250
  className,
158
251
  emptyOfficeAction,
159
252
  employees,
160
253
  renderLink,
161
254
  officeActions,
255
+ onExportReport,
162
256
  renderEmployeeActions,
257
+ sidebarTogglePlacement,
163
258
  style,
164
259
  view,
165
260
  ...props
166
261
  }: ManagerOfficeProps): React.JSX.Element;
167
262
  //#endregion
168
- export { ManagerOffice, ManagerOfficeChannel, ManagerOfficeChannelDirection, ManagerOfficeChannelStatus, ManagerOfficeConnectedEmployee, ManagerOfficeDestination, ManagerOfficeDisconnectedEmployee, ManagerOfficeEmployee, ManagerOfficeEmployeeStatus, ManagerOfficeHandoff, ManagerOfficeProps, ManagerOfficeRoutine, ManagerOfficeView, ManagerOfficeWork, ManagerOfficeWorkStatus };
263
+ export { ManagerOffice, ManagerOfficeAnalyticsPoint, ManagerOfficeBrowserPreview, ManagerOfficeChannel, ManagerOfficeChannelDirection, ManagerOfficeChannelStatus, ManagerOfficeConnectedEmployee, ManagerOfficeDestination, ManagerOfficeDisconnectedEmployee, ManagerOfficeEmployee, ManagerOfficeEmployeeAnalytics, ManagerOfficeEmployeeStatus, ManagerOfficeHandoff, ManagerOfficeProps, ManagerOfficeReportSelection, ManagerOfficeRoutine, ManagerOfficeSidebar, ManagerOfficeSidebarAlert, ManagerOfficeSidebarAlertProps, ManagerOfficeSidebarProps, ManagerOfficeView, ManagerOfficeWork, ManagerOfficeWorkStatus };