@mcp-b/react-components 0.58.0 → 0.59.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 (91) hide show
  1. package/dist/{EmployeeChrome-DsdIek0l.d.ts → EmployeeChrome-QSki0QT4.d.ts} +4 -4
  2. package/dist/{ResponsiveSidebarShell-DoZlSP30.d.ts → ResponsiveSidebarShell-DzBGlRJF.d.ts} +23 -8
  3. package/dist/{ThinkChatActivity-BkGjTY4r.d.ts → ThinkChatActivity-C4_hPEmb.d.ts} +20 -4
  4. package/dist/{ThinkChatActivitySummary-DZVy3uQV.d.ts → ThinkChatActivitySummary-ChJ8Iu2T.d.ts} +3 -3
  5. package/dist/{ThinkChatToolParts-BucHi63O.d.ts → ThinkChatToolParts-BrntWlpa.d.ts} +29 -3
  6. package/dist/{WorkspaceConceptPanel-97ZyVpZI.js → WorkspaceConceptPanel-D21iRsWm.js} +7 -4
  7. package/dist/{WorkspaceFileView-M2jC2P4p.js → WorkspaceFileView-CsWwQA1U.js} +80 -74
  8. package/dist/app-bar-outlet-CNfNzY4Y.js +6 -0
  9. package/dist/components/agents-sdk/AgentEvent.js +2 -2
  10. package/dist/components/agents-sdk/BrowserLiveScreen.js +49 -11
  11. package/dist/components/agents-sdk/EmployeeApp.d.ts +2 -3
  12. package/dist/components/agents-sdk/EmployeeApp.js +4 -4
  13. package/dist/components/agents-sdk/EmployeeChat.js +1 -1
  14. package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
  15. package/dist/components/agents-sdk/EmployeeChrome.js +213 -201
  16. package/dist/components/agents-sdk/EmployeeSchedules.d.ts +1 -1
  17. package/dist/components/agents-sdk/EmployeeSchedules.js +6 -6
  18. package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +1 -1
  19. package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
  20. package/dist/components/agents-sdk/ManagerOfficeScreens.js +5 -18
  21. package/dist/components/agents-sdk/ModelSelector.js +1 -1
  22. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +8 -9
  23. package/dist/components/agents-sdk/SubagentRunPanel.js +133 -122
  24. package/dist/components/agents-sdk/ThinkChat.d.ts +1 -1
  25. package/dist/components/agents-sdk/ThinkChat.js +26 -3
  26. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  27. package/dist/components/agents-sdk/ThinkChatActivity.js +110 -110
  28. package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
  29. package/dist/components/agents-sdk/ThinkChatActivitySummary.js +183 -40
  30. package/dist/components/agents-sdk/ThinkChatToolPanels.d.ts +8 -4
  31. package/dist/components/agents-sdk/ThinkChatToolPanels.js +308 -62
  32. package/dist/components/agents-sdk/ThinkChatToolParts.d.ts +2 -2
  33. package/dist/components/agents-sdk/ThinkChatToolParts.js +71 -1
  34. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +3 -4
  35. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +5 -5
  36. package/dist/components/agents-sdk/ThinkFullApp.d.ts +1 -1
  37. package/dist/components/agents-sdk/ThinkFullApp.js +6 -1
  38. package/dist/components/agents-sdk/ThinkRoutineActions.js +14 -22
  39. package/dist/components/agents-sdk/ThinkThreadPicker.js +1 -1
  40. package/dist/components/agents-sdk/WorkspaceExecution.js +138 -131
  41. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
  42. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  43. package/dist/components/agents-sdk/WorkspaceHeader.js +26 -28
  44. package/dist/components/agents-sdk/WorkspaceProject.js +1 -1
  45. package/dist/components/agents-sdk/WorkspaceUserScript.js +1 -1
  46. package/dist/components/ai-sdk/Activity.d.ts +1 -1
  47. package/dist/components/ai-sdk/Activity.js +84 -6
  48. package/dist/components/ai-sdk/AgentChatMessageEditor.js +1 -1
  49. package/dist/components/ai-sdk/Approval.js +2 -1
  50. package/dist/components/ai-sdk/ComposerLink.js +1 -1
  51. package/dist/components/ai-sdk/ConnectedAppCards.js +63 -45
  52. package/dist/components/ai-sdk/Conversation.js +1 -1
  53. package/dist/components/ai-sdk/ExpansionState.d.ts +16 -6
  54. package/dist/components/ai-sdk/ExpansionState.js +25 -7
  55. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  56. package/dist/components/ai-sdk/MessageScrollerVirtual.js +98 -11
  57. package/dist/components/ai-sdk/PromptInput.js +7 -3
  58. package/dist/components/ai-sdk/PromptInputComposerEditor.js +2 -2
  59. package/dist/components/ai-sdk/Queue.js +1 -1
  60. package/dist/components/ai-sdk/ToolInvocation.d.ts +8 -0
  61. package/dist/components/ai-sdk/ToolInvocation.js +45 -19
  62. package/dist/components/foundations/ToggleGroup.js +1 -1
  63. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +2 -2
  64. package/dist/components/general-purpose/ResponsiveSidebarShell.js +162 -87
  65. package/dist/components/general-purpose/Terminal.js +1 -1
  66. package/dist/components/general-purpose/WebPreview.js +1 -1
  67. package/dist/components/nanites/AgentToolDetail.d.ts +1 -3
  68. package/dist/components/nanites/AgentToolDetail.js +30 -39
  69. package/dist/merge-refs-DAh6reu8.js +26 -0
  70. package/dist/styles/activity.css +74 -0
  71. package/dist/styles/agent-chat.css +7 -0
  72. package/dist/styles/agent-tool-detail.css +2 -17
  73. package/dist/styles/app-top-bar.css +6 -7
  74. package/dist/styles/base.css +1 -1
  75. package/dist/styles/employee-chrome.css +0 -7
  76. package/dist/styles/message-scroller.css +8 -0
  77. package/dist/styles/message.css +1 -1
  78. package/dist/styles/responsive-sidebar-shell.css +10 -25
  79. package/dist/styles/scroll-area.css +16 -0
  80. package/dist/styles/scrollbars.css +55 -41
  81. package/dist/styles/search-field.css +0 -1
  82. package/dist/styles/subagent-run.css +36 -196
  83. package/dist/styles/think-chat-tool-panels.css +38 -5
  84. package/dist/styles/think-execution-workbench.css +4 -0
  85. package/dist/styles/think-full-app.css +1 -6
  86. package/dist/styles/workspace-concepts.css +6 -39
  87. package/dist/styles/workspace-explorer.css +4 -11
  88. package/package.json +2 -2
  89. package/dist/components/agents-sdk/SubagentRunDetails.d.ts +0 -40
  90. package/dist/components/agents-sdk/SubagentRunDetails.js +0 -98
  91. package/dist/merge-refs-DF_7w2x_.js +0 -18
@@ -1,6 +1,6 @@
1
1
  import { J as PromptInputMessage } from "./PromptInput-C3adKglc.js";
2
2
  import { n as AgentToolRunValue } from "./AgentToolRunsContext-DniwGn96.js";
3
- import { n as ResponsiveSidebarShell } from "./ResponsiveSidebarShell-DoZlSP30.js";
3
+ import { i as ResponsiveSidebarShell } from "./ResponsiveSidebarShell-DzBGlRJF.js";
4
4
  import { t as ThinkThreadItem } from "./ThinkThreadPicker-BmIZmpae.js";
5
5
  import * as React from "react";
6
6
  //#region src/components/agents-sdk/EmployeeChrome.d.ts
@@ -128,8 +128,8 @@ interface EmployeeMenuProps {
128
128
  declare function EmployeeMenu({ renderLink, view, identity, onModel, onSignOut, companion, passkeys, follow, workbenchNavigation, navigation }: EmployeeMenuProps): React.JSX.Element;
129
129
  interface EmployeeShellProps<Thread extends ThinkThreadItem = ThinkThreadItem> extends EmployeeMenuProps {
130
130
  view: EmployeeView;
131
- /** Compact workbench back control; the host can return from a file to its workspace. */
132
- compactBack?: React.ReactNode;
131
+ /** Replaces the default Back to chat link in every layout. */
132
+ back?: React.ReactNode;
133
133
  /** Host-projected thread history; the chrome neither fetches nor persists it. */
134
134
  threads?: readonly Thread[];
135
135
  /** Selected thread, used for the title, the picker, and the return link. */
@@ -146,7 +146,7 @@ interface EmployeeShellProps<Thread extends ThinkThreadItem = ThinkThreadItem> e
146
146
  navigation?: readonly EmployeeWorkbenchItem[];
147
147
  children: React.ReactNode;
148
148
  }
149
- declare function EmployeeShell<Thread extends ThinkThreadItem = ThinkThreadItem>({ view, threads, threadId, agentRun, renderLink, appBarLeading, compactBack, onDeleteThread, sidebar, sidebarLabel, navigation, children, ...menu }: EmployeeShellProps<Thread>): React.JSX.Element;
149
+ declare function EmployeeShell<Thread extends ThinkThreadItem = ThinkThreadItem>({ view, threads, threadId, agentRun, back, renderLink, appBarLeading, onDeleteThread, sidebar, sidebarLabel, navigation, children, ...menu }: EmployeeShellProps<Thread>): React.JSX.Element;
150
150
  /** Policy and connection gates are host facts, not design-system presets. */
151
151
  declare function EmployeeGate({ status, connectingLabel, identity, brand, modelSetup }: {
152
152
  status: EmployeeStatus;
@@ -10,6 +10,8 @@ interface ResponsiveSidebarShellControls {
10
10
  closeSidebar: () => void;
11
11
  /** Close only when the shell is currently using its compact drawer layout. */
12
12
  closeSidebarOnCompact: () => void;
13
+ /** Recover a replaced toolbar control after a menu's closing animation completes. */
14
+ restoreBarFocus: () => void;
13
15
  }
14
16
  /** Reuse the shell's measured layout and drawer controls instead of observing it again. */
15
17
  declare function useResponsiveSidebarShell(): ResponsiveSidebarShellControls;
@@ -20,10 +22,8 @@ declare function useResponsiveSidebarShell(): ResponsiveSidebarShellControls;
20
22
  */
21
23
  interface AppBarSlots {
22
24
  /**
23
- * App-owned route element rendered as a labelled back control. Back owns
24
- * the leading slot the same way `leading` does: the shell's own sidebar
25
- * toggle stands down and compact sidebars stay reachable through
26
- * `compactTitleTrigger`.
25
+ * App-owned route element rendered as a labelled back control in the
26
+ * leading group, beside the sidebar toggle when no other trigger owns it.
27
27
  */
28
28
  back?: {
29
29
  label: string;
@@ -70,8 +70,11 @@ interface ResponsiveSidebarShellProps extends Omit<React.HTMLAttributes<HTMLDivE
70
70
  * Omit for a shell that is only a bar row over content — the app bar then
71
71
  * has one mount point whether or not a sidebar exists.
72
72
  *
73
- * Open/closed is shell-internal: it is ephemeral presentation state, not a
74
- * route, so no host controls it and no resize ever writes into a router.
73
+ * Open/closed is ephemeral presentation state, not a route. It is
74
+ * uncontrolled by default and can be controlled with `sidebarOpen` and
75
+ * `onSidebarOpenChange`; the shell never writes resize changes into a router.
76
+ * If `bar.hidden` is used with a sidebar, the host-owned bar must provide a
77
+ * control that can open the sidebar.
75
78
  */
76
79
  sidebar?: React.ReactNode | ((controls: ResponsiveSidebarShellControls) => React.ReactNode);
77
80
  /** Main content. */
@@ -90,6 +93,8 @@ interface ResponsiveSidebarShellProps extends Omit<React.HTMLAttributes<HTMLDivE
90
93
  defaultSidebarWidth?: number;
91
94
  /** Shell-owned application bar composed from slots. */
92
95
  bar?: ResponsiveSidebarShellBar;
96
+ /** Let the active ThinkFullApp workbench compose its controls into this bar row. */
97
+ contentBar?: boolean;
93
98
  /**
94
99
  * Host-owned error shown in the main column above the content, without
95
100
  * replacing it. The shell renders the alert anatomy; pass the message.
@@ -106,9 +111,19 @@ interface ResponsiveSidebarShellProps extends Omit<React.HTMLAttributes<HTMLDivE
106
111
  * hook, and its container name `responsive-sidebar-shell` is public contract:
107
112
  * surfaces that compose the shell size themselves against it.
108
113
  */
109
- declare function ResponsiveSidebarShell({ sidebar, sidebarLabel, sidebarOpen, sidebarTogglePlacement, defaultSidebarOpen, defaultSidebarWidth, onSidebarOpenChange, bar, error, showMainLabel, className, children, ref, style, ...props }: ResponsiveSidebarShellProps & {
114
+ declare function ResponsiveSidebarShell({ sidebar, sidebarLabel, sidebarOpen, sidebarTogglePlacement, defaultSidebarOpen, defaultSidebarWidth, onSidebarOpenChange, bar, contentBar, error, showMainLabel, className, children, ref, style, ...props }: ResponsiveSidebarShellProps & {
110
115
  /** Ref forwarded to the component's rendered root element. */
111
116
  ref?: React.Ref<HTMLDivElement>;
112
117
  }): React.JSX.Element;
118
+ /** Pane-owned slots; the enclosing shell retains its own title renderer. */
119
+ type ResponsiveSidebarAppBarProps = Pick<ResponsiveSidebarShellBar, "title" | "titleRender" | "leading" | "actions" | "primary" | "label" | "className">;
120
+ /**
121
+ * A pane's title, Back control and actions share its enclosing shell's bar.
122
+ * Outside an opted-in workbench this renders a standalone application bar.
123
+ * A portal preserves the pane's state and providers without registering
124
+ * React nodes in ancestor state or rerendering the conversation on each action.
125
+ * Submit controls moved here must name their owning form with `form`.
126
+ */
127
+ declare function ResponsiveSidebarAppBar(props: ResponsiveSidebarAppBarProps): React.JSX.Element;
113
128
  //#endregion
114
- export { ResponsiveSidebarShellProps as a, ResponsiveSidebarShellControls as i, ResponsiveSidebarShell as n, useResponsiveSidebarShell as o, ResponsiveSidebarShellBar as r, AppBarSlots as t };
129
+ export { ResponsiveSidebarShellBar as a, useResponsiveSidebarShell as c, ResponsiveSidebarShell as i, ResponsiveSidebarAppBar as n, ResponsiveSidebarShellControls as o, ResponsiveSidebarAppBarProps as r, ResponsiveSidebarShellProps as s, AppBarSlots as t };
@@ -1,8 +1,8 @@
1
1
  import { i as AgentMessageRenderPartContext } from "./AgentMessageParts-BtWwiE4f.js";
2
2
  import { AgentChatMessageContentProps } from "./components/agents-sdk/AgentChat.js";
3
3
  import { n as AgentToolRunValue } from "./AgentToolRunsContext-DniwGn96.js";
4
- import { l as ThinkChatPart } from "./ThinkChatToolParts-BucHi63O.js";
5
- import { t as ThinkChatActivityDescription } from "./ThinkChatActivitySummary-DZVy3uQV.js";
4
+ import { u as ThinkChatPart } from "./ThinkChatToolParts-BrntWlpa.js";
5
+ import { t as ThinkChatActivityDescription } from "./ThinkChatActivitySummary-ChJ8Iu2T.js";
6
6
  import * as React from "react";
7
7
  import { DynamicToolUIPart, ToolUIPart, UIMessage } from "ai";
8
8
  //#region src/components/agents-sdk/ThinkChatActivity.d.ts
@@ -34,13 +34,22 @@ interface ThinkChatActivityRendererOptions<MessageT extends UIMessage = UIMessag
34
34
  interface ThinkChatActivityProps {
35
35
  /** Render with the log expanded. */
36
36
  defaultOpen?: boolean;
37
+ /** Consecutive reasoning and tool parts to summarize and inspect, in recorded order. */
37
38
  parts: readonly ThinkChatPart[];
38
- /** Defaults to deriving from part states (reasoning streaming, tool awaiting output). */
39
+ /**
40
+ * Explicit streaming state. When omitted, terminal metadata or a settled action
41
+ * takes precedence over stale part states before streaming is inferred.
42
+ */
39
43
  isStreaming?: boolean;
40
44
  /** Per-tool action/panel overrides, keyed by tool name. */
41
45
  toolRenderers?: ThinkChatToolRenderers;
42
46
  /** Replaces the summary action after the activity settles. */
43
47
  settledAction?: string;
48
+ /**
49
+ * Marks step states as terminal even when this run does not show the message
50
+ * summary. Defaults to whether `settledAction` is provided.
51
+ */
52
+ isTerminal?: boolean;
44
53
  /**
45
54
  * Uniquely identifies this run across the whole transcript for persisted
46
55
  * disclosure state (the activity renderer passes `${message.id}:${runStart}`).
@@ -50,7 +59,14 @@ interface ThinkChatActivityProps {
50
59
  */
51
60
  stateKey: string;
52
61
  }
53
- declare function ThinkChatActivity({ parts, defaultOpen, isStreaming, toolRenderers, settledAction, stateKey }: ThinkChatActivityProps): React.JSX.Element | null;
62
+ /**
63
+ * One run of agent work as a collapsed Activity block: while streaming the
64
+ * action shimmers with the live step; settled, it becomes a short summary
65
+ * ("Thought, read 2 files and ran a command") over an expandable step log
66
+ * with per-tool panels. Normally reached through `ThinkChat.MessageContent`;
67
+ * exported for apps that lay out messages themselves.
68
+ */
69
+ declare function ThinkChatActivity({ parts, defaultOpen, isStreaming, toolRenderers, settledAction, isTerminal, stateKey }: ThinkChatActivityProps): React.JSX.Element | null;
54
70
  /**
55
71
  * Builds a renderPart handler that folds every run of consecutive activity
56
72
  * parts (reasoning + tool calls) into one collapsed Activity box. Everything
@@ -1,5 +1,5 @@
1
1
  import { i as AgentActivityIconKind, s as AgentActivitySummary } from "./AgentActivity-DSObWhDU.js";
2
- import { l as ThinkChatPart } from "./ThinkChatToolParts-BucHi63O.js";
2
+ import { u as ThinkChatPart } from "./ThinkChatToolParts-BrntWlpa.js";
3
3
  import { DynamicToolUIPart, ToolUIPart } from "ai";
4
4
  //#region src/components/agents-sdk/ThinkChatActivitySummary.d.ts
5
5
  interface ThinkChatToolDescriber {
@@ -17,14 +17,14 @@ interface ThinkChatActivityDescription {
17
17
  detail?: string;
18
18
  }
19
19
  declare function activityPartUrl(part: ThinkChatPart): string | null;
20
- declare function activityPartIconKind(part: ThinkChatPart): AgentActivityIconKind;
20
+ declare function activityPartIconKind(part: ThinkChatPart, hasUrl?: boolean): AgentActivityIconKind;
21
21
  /**
22
22
  * One-line natural-language action for an activity part ("Ran vp test",
23
23
  * "Fetched developers.cloudflare.com/agents/"); `null` for boundaries that
24
24
  * aren't steps (step-start). Exported so a custom `renderPart` can reuse the
25
25
  * built-in labels for tools it doesn't override.
26
26
  */
27
- declare function describeThinkChatActivityPart(part: ThinkChatPart, toolRenderers?: ThinkChatToolDescribers): ThinkChatActivityDescription | null;
27
+ declare function describeThinkChatActivityPart(part: ThinkChatPart, toolRenderers?: ThinkChatToolDescribers, isTerminalTurn?: boolean): ThinkChatActivityDescription | null;
28
28
  declare function summarizeActivitySteps(parts: readonly ThinkChatPart[]): string;
29
29
  interface ThinkChatToolLifecycleSnapshot {
30
30
  toolName: string;
@@ -141,8 +141,8 @@ type BrowserToolPart = ToolUIPart<BrowserUITools>;
141
141
  declare function isBrowserToolPart(part: ThinkChatPart): part is BrowserToolPart;
142
142
  type ExecuteToolPart = ToolUIPart<{
143
143
  execute: {
144
- input: ProxyToolInput;
145
- output: ProxyToolOutput;
144
+ input: unknown;
145
+ output: unknown;
146
146
  };
147
147
  }>;
148
148
  declare function isExecuteToolPart(part: ThinkChatPart): part is ExecuteToolPart;
@@ -152,6 +152,32 @@ declare function isThinkChatActivityPart(part: ThinkChatPart | undefined, exclud
152
152
  declare function isPartWorking(part: ThinkChatPart): boolean;
153
153
  /** Errored or denied — upstream's simplified tool-part state vocabulary. */
154
154
  declare function isPartFailed(part: ThinkChatPart): boolean;
155
+ /** Known outcome envelopes from Think actions and Rook's static tools. */
156
+ type ThinkToolOutcome = "failed" | "denied" | undefined;
157
+ type FollowUpReceipt = {
158
+ operation: "schedule";
159
+ id: string;
160
+ scheduledFor: string;
161
+ prompt: string;
162
+ } | {
163
+ operation: "list";
164
+ followUps: {
165
+ id: string;
166
+ scheduledFor: string;
167
+ prompt: string;
168
+ }[];
169
+ } | {
170
+ operation: "cancel";
171
+ id: string;
172
+ cancelled: boolean;
173
+ };
174
+ /** Validated final receipt for the static Rook follow-up action only. */
175
+ declare function readFollowUpReceipt(part: ThinkChatPart): FollowUpReceipt | undefined;
176
+ /**
177
+ * Interpret only contracts known to return error envelopes. Dynamic/MCP
178
+ * results may have an ordinary `error` field and remain generic data.
179
+ */
180
+ declare function thinkToolOutcome(part: ThinkChatPart): ThinkToolOutcome;
155
181
  declare function displayUrl(url: string | undefined): string;
156
182
  //#endregion
157
- export { isWorkspaceToolPart as S, isPartWorking as _, SessionContextToolPart as a, isSkillToolPart as b, ThinkBashToolPart as c, WorkspaceToolPart as d, displayUrl as f, isPartFailed as g, isFetchToolPart as h, SessionContextToolName as i, ThinkChatPart as l, isExecuteToolPart as m, ExecuteToolPart as n, SkillToolPart as o, isBrowserToolPart as p, FetchToolPart as r, ThinkBashToolOutput as s, BrowserToolPart as t, ThinkWorkspaceToolName as u, isSessionContextToolFailure as v, isThinkChatActivityPart as x, isSessionContextToolPart as y };
183
+ export { isThinkChatActivityPart as C, thinkToolOutcome as E, isSkillToolPart as S, readFollowUpReceipt as T, isFetchToolPart as _, SessionContextToolName as a, isSessionContextToolFailure as b, ThinkBashToolOutput as c, ThinkToolOutcome as d, ThinkWorkspaceToolName as f, isExecuteToolPart as g, isBrowserToolPart as h, FollowUpReceipt as i, ThinkBashToolPart as l, displayUrl as m, ExecuteToolPart as n, SessionContextToolPart as o, WorkspaceToolPart as p, FetchToolPart as r, SkillToolPart as s, BrowserToolPart as t, ThinkChatPart as u, isPartFailed as v, isWorkspaceToolPart as w, isSessionContextToolPart as x, isPartWorking as y };
@@ -1,14 +1,17 @@
1
+ import { ResponsiveSidebarAppBar } from "./components/general-purpose/ResponsiveSidebarShell.js";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  //#region src/components/_internal/WorkspaceConceptPanel.tsx
3
4
  /** Shared workbench chrome keeps the title visible while its content scrolls. */
4
5
  function WorkspaceConceptPanel({ heading, children, ...props }) {
5
6
  return /* @__PURE__ */ jsxs("section", {
6
7
  ...props,
7
- children: [/* @__PURE__ */ jsx("header", {
8
+ children: [/* @__PURE__ */ jsx(ResponsiveSidebarAppBar, {
8
9
  className: "workspace-concept-panel__header",
9
- children: /* @__PURE__ */ jsx("h2", {
10
- className: "workspace-concept-panel__title",
11
- children: heading
10
+ label: `${heading} controls`,
11
+ title: heading,
12
+ titleRender: (props) => /* @__PURE__ */ jsx("h2", {
13
+ ...props,
14
+ children: props.children
12
15
  })
13
16
  }), /* @__PURE__ */ jsx("div", {
14
17
  className: "workspace-concept-panel__body",
@@ -3,6 +3,7 @@ import { i as formatClock } from "./format-CWaZEp5o.js";
3
3
  import { t as CopyButton } from "./copy-button-M4sAp9xS.js";
4
4
  import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-Bs_Z03eC.js";
5
5
  import { AppTopBar } from "./components/general-purpose/AppTopBar.js";
6
+ import { t as ContentAppBarOutletContext } from "./app-bar-outlet-CNfNzY4Y.js";
6
7
  import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/agents-sdk/WorkspaceFile.js";
7
8
  import { i as useWorkspaceNavigationContext } from "./WorkspaceLink-BeFAXpbI.js";
8
9
  import { useWorkspaceNavigationRestoration } from "./components/agents-sdk/WorkspaceNavigationRestoration.js";
@@ -603,11 +604,7 @@ function useWorkspaceFileNavigation(path, file, isLoading, isPreparingAsset) {
603
604
  }
604
605
  /** Workspace file preview composed from CodeBlock and AppTopBar. */
605
606
  function WorkspaceFileView({ preview, appearance = "contained", file, path, isLoading, isRefreshing, leading, actions, showSkillIdentity = true, onRefresh }) {
606
- const [markdownViewState, setMarkdownViewState] = React.useState(() => ({
607
- path,
608
- view: "preview"
609
- }));
610
- const markdownView = markdownViewState.path === path ? markdownViewState.view : "preview";
607
+ const [markdownView, toggleMarkdownView] = useWorkspaceFileViewMode(path);
611
608
  const isMarkdown = isWorkspaceMarkdownPath(path);
612
609
  const headingPrefix = React.useId().replaceAll(":", "");
613
610
  const media = inferWorkspaceMedia(path, file?.asset?.mimeType ?? file?.info?.mimeType);
@@ -629,87 +626,96 @@ function WorkspaceFileView({ preview, appearance = "contained", file, path, isLo
629
626
  downloadUrl: assetUrl.downloadUrl,
630
627
  allowOpen: media?.mimeType !== "image/svg+xml"
631
628
  }) : null;
632
- const headerProps = {
633
- path,
634
- leading: workspaceNavigation ? /* @__PURE__ */ jsx(AppTopBar.Link, {
635
- label: "Back to workspace",
636
- "data-workspace-back": "",
637
- render: workspaceNavigation.navigation.renderLink({ kind: "files" }),
638
- children: /* @__PURE__ */ jsx(ArrowLeftIcon, { "aria-hidden": "true" })
639
- }) : leading,
640
- actions: /* @__PURE__ */ jsxs(Fragment, { children: [
641
- actions,
642
- assetActions,
643
- isMarkdown || preview ? /* @__PURE__ */ jsx(WorkspaceViewToggle, {
644
- view: markdownView,
645
- isMarkdown,
646
- onToggle: () => setMarkdownViewState({
647
- path,
648
- view: markdownView === "preview" ? "source" : "preview"
649
- })
650
- }) : null
651
- ] }),
652
- isRefreshing,
653
- onRefresh
654
- };
655
- const unavailable = filePreviewStatus(file, isLoading, assetUrl.error, isPreparingAsset, media);
656
- if (!file || unavailable) return /* @__PURE__ */ jsxs("div", {
657
- ref: fileViewRef,
658
- className: "workspace-explorer__file",
659
- "data-appearance": appearance,
660
- "data-workspace-restoration-scope": "file",
661
- children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
662
- className: "workspace-explorer__empty",
663
- "data-workspace-file-content": "",
664
- "data-workspace-focus-target": "",
665
- role: unavailable?.role,
666
- children: unavailable?.message ?? "File preview is unavailable."
667
- })]
668
- });
669
- if (file.asset && media && assetUrl.url) return /* @__PURE__ */ jsxs("div", {
670
- ref: fileViewRef,
671
- className: "workspace-explorer__file",
672
- "data-appearance": appearance,
673
- "data-workspace-restoration-scope": "file",
674
- children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx(WorkspaceMediaPreview, {
675
- asset: file.asset,
676
- fileName: file.name,
677
- media,
678
- url: assetUrl.url,
679
- downloadUrl: assetUrl.downloadUrl,
680
- onScroll: handleScroll
681
- })]
682
- });
683
- if (preview && markdownView === "preview") return /* @__PURE__ */ jsxs("div", {
684
- ref: fileViewRef,
685
- className: "workspace-explorer__file",
686
- "data-appearance": appearance,
687
- "data-workspace-restoration-scope": "file",
688
- children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
689
- className: "workspace-explorer__preview",
690
- "data-workspace-file-content": "",
691
- "data-workspace-focus-target": "",
692
- onScroll: handleScroll,
693
- children: preview
694
- })]
695
- });
629
+ const resolvedLeading = workspaceNavigation ? /* @__PURE__ */ jsx(AppTopBar.Link, {
630
+ label: "Back to workspace",
631
+ "data-workspace-back": "",
632
+ render: workspaceNavigation.navigation.renderLink({ kind: "files" }),
633
+ children: /* @__PURE__ */ jsx(ArrowLeftIcon, { "aria-hidden": "true" })
634
+ }) : leading;
635
+ const viewActions = /* @__PURE__ */ jsxs(Fragment, { children: [
636
+ actions,
637
+ assetActions,
638
+ isMarkdown || preview ? /* @__PURE__ */ jsx(WorkspaceViewToggle, {
639
+ view: markdownView,
640
+ isMarkdown,
641
+ onToggle: toggleMarkdownView
642
+ }) : null
643
+ ] });
644
+ const previewing = markdownView === "preview";
696
645
  return /* @__PURE__ */ jsx("div", {
697
646
  ref: fileViewRef,
698
647
  className: "workspace-explorer__file",
699
648
  "data-appearance": appearance,
700
649
  "data-workspace-restoration-scope": "file",
701
- children: /* @__PURE__ */ jsx(WorkspaceTextFile, {
650
+ children: /* @__PURE__ */ jsx(WorkspaceFileBody, {
702
651
  file,
703
- headerProps,
704
- handleScroll,
705
- markdown: isMarkdown && markdownView === "preview" ? /* @__PURE__ */ jsx(WorkspaceMarkdownArticle, {
652
+ unavailable: filePreviewStatus(file, isLoading, assetUrl.error, isPreparingAsset, media),
653
+ media,
654
+ assetUrl,
655
+ preview: previewing ? preview : void 0,
656
+ markdown: file && isMarkdown && previewing ? /* @__PURE__ */ jsx(WorkspaceMarkdownArticle, {
706
657
  file,
707
658
  path,
708
659
  showSkillIdentity,
709
660
  components: markdownComponents,
710
661
  rehypePlugins: workspaceRehypePlugins
711
- }) : void 0
662
+ }) : void 0,
663
+ headerProps: {
664
+ path,
665
+ leading: resolvedLeading,
666
+ actions: viewActions,
667
+ isRefreshing,
668
+ onRefresh
669
+ },
670
+ handleScroll
671
+ })
672
+ });
673
+ }
674
+ /** Markdown and host previews open rendered for each path; source is one toggle away. */
675
+ function useWorkspaceFileViewMode(path) {
676
+ const [state, setState] = React.useState(() => ({
677
+ path,
678
+ view: "preview"
679
+ }));
680
+ const view = state.path === path ? state.view : "preview";
681
+ const toggle = () => setState({
682
+ path,
683
+ view: view === "preview" ? "source" : "preview"
684
+ });
685
+ return [view, toggle];
686
+ }
687
+ /** The status, media, host preview, or text body under the file's header. */
688
+ function WorkspaceFileBody({ file, unavailable, media, assetUrl, preview, markdown, headerProps, handleScroll }) {
689
+ if (!file || unavailable) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
690
+ className: "workspace-explorer__empty",
691
+ "data-workspace-file-content": "",
692
+ "data-workspace-focus-target": "",
693
+ role: unavailable?.role,
694
+ children: unavailable?.message ?? "File preview is unavailable."
695
+ })] });
696
+ if (file.asset && media && assetUrl.url) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx(WorkspaceMediaPreview, {
697
+ asset: file.asset,
698
+ fileName: file.name,
699
+ media,
700
+ url: assetUrl.url,
701
+ downloadUrl: assetUrl.downloadUrl,
702
+ onScroll: handleScroll
703
+ })] });
704
+ if (preview) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
705
+ className: "workspace-explorer__preview",
706
+ "data-workspace-file-content": "",
707
+ "data-workspace-focus-target": "",
708
+ onScroll: handleScroll,
709
+ children: /* @__PURE__ */ jsx(ContentAppBarOutletContext.Provider, {
710
+ value: null,
711
+ children: preview
712
712
  })
713
+ })] });
714
+ return /* @__PURE__ */ jsx(WorkspaceTextFile, {
715
+ file,
716
+ headerProps,
717
+ handleScroll,
718
+ markdown
713
719
  });
714
720
  }
715
721
  function WorkspaceTextFile({ file, headerProps, handleScroll, markdown }) {
@@ -0,0 +1,6 @@
1
+ import { createContext } from "react";
2
+ //#region src/components/_internal/app-bar-outlet.ts
3
+ const ShellAppBarOutletContext = createContext(null);
4
+ const ContentAppBarOutletContext = createContext(null);
5
+ //#endregion
6
+ export { ShellAppBarOutletContext as n, ContentAppBarOutletContext as t };
@@ -2,9 +2,9 @@ import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { Activity, ActivityContent, ActivityText, ActivityTrigger } from "../ai-sdk/Activity.js";
3
3
  import { r as firstLine } from "../../format-CWaZEp5o.js";
4
4
  import { MessageResponse } from "../ai-sdk/Message.js";
5
- import { NaniteMark } from "../nanites/NaniteScene.js";
6
- import { getSubagentRunName } from "./SubagentRunIndicator.js";
7
5
  import { useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
6
+ import { getSubagentRunName } from "./SubagentRunIndicator.js";
7
+ import { NaniteMark } from "../nanites/NaniteScene.js";
8
8
  import "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { isTextUIPart } from "ai";
@@ -77,6 +77,7 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
77
77
  const [keyboardOpen, setKeyboardOpen] = useState(false);
78
78
  const touch = useRef(null);
79
79
  const mousePress = useRef(null);
80
+ const forwardedKeys = useRef(/* @__PURE__ */ new Map());
80
81
  function cancelPointerState() {
81
82
  const activeTouch = touch.current;
82
83
  const activeMouse = mousePress.current;
@@ -88,8 +89,29 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
88
89
  if (activeMouse?.pressed) releases.push(release(activeMouse.lastPage, activeMouse.button, 0, activeMouse.clickCount, activeMouse.modifiers));
89
90
  sendInput(releases);
90
91
  }
92
+ function cancelForwardedKeys() {
93
+ const releases = [];
94
+ for (const { key, code, keyCode } of forwardedKeys.current.values()) releases.push({
95
+ kind: "key",
96
+ type: "keyUp",
97
+ key,
98
+ code,
99
+ windowsVirtualKeyCode: keyCode,
100
+ modifiers: 0
101
+ });
102
+ forwardedKeys.current.clear();
103
+ sendInput(releases);
104
+ }
105
+ const releaseKeysOnWindowBlur = useEffectEvent(() => cancelForwardedKeys());
106
+ useEffect(() => {
107
+ window.addEventListener("blur", releaseKeysOnWindowBlur);
108
+ return () => window.removeEventListener("blur", releaseKeysOnWindowBlur);
109
+ }, []);
91
110
  const attachInput = useCallback((element) => {
92
- if (input.current !== element) cancelPointerState();
111
+ if (input.current !== element) {
112
+ cancelPointerState();
113
+ cancelForwardedKeys();
114
+ }
93
115
  input.current = element;
94
116
  setInputElement(element);
95
117
  syncInputBounds();
@@ -129,6 +151,7 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
129
151
  const closingViewerId = viewerId;
130
152
  connection = void 0;
131
153
  cancelPointerState();
154
+ cancelForwardedKeys();
132
155
  channel.current = null;
133
156
  geometry.current = null;
134
157
  if (!disposed) setStreamed(null);
@@ -235,6 +258,7 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
235
258
  if (!status) return;
236
259
  if (status.kind === "idle") {
237
260
  cancelPointerState();
261
+ cancelForwardedKeys();
238
262
  geometry.current = null;
239
263
  syncInputBounds();
240
264
  setFailure(null);
@@ -245,7 +269,10 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
245
269
  if (status.kind === "streaming") {
246
270
  if (status.tabId !== tabId) return;
247
271
  const previous = geometry.current;
248
- if (previous?.tabId !== status.tabId || previous.streamGeneration !== status.streamGeneration) cancelPointerState();
272
+ if (previous?.tabId !== status.tabId || previous.streamGeneration !== status.streamGeneration) {
273
+ cancelPointerState();
274
+ cancelForwardedKeys();
275
+ }
249
276
  geometry.current = status;
250
277
  syncInputBounds();
251
278
  setFailure(null);
@@ -283,12 +310,13 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
283
310
  function sendInput(events) {
284
311
  const open = channel.current;
285
312
  const status = geometry.current;
286
- if (open?.readyState !== "open" || !status || events.length === 0) return;
313
+ if (open?.readyState !== "open" || !status || events.length === 0) return false;
287
314
  open.send(currentProtocol.current.serializeInput({
288
315
  tabId: status.tabId,
289
316
  streamGeneration: status.streamGeneration,
290
317
  events
291
318
  }));
319
+ return true;
292
320
  }
293
321
  /**
294
322
  * A browser-chrome command needs only the channel, not a live stream:
@@ -500,9 +528,9 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
500
528
  },
501
529
  onKeyDown: (event) => {
502
530
  event.currentTarget.removeAttribute("data-pointer-focus");
503
- if (event.nativeEvent.isComposing) return;
531
+ if (event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;
504
532
  if (event.key === "Enter" || event.key === "Tab") event.preventDefault();
505
- sendInput([{
533
+ if (sendInput([{
506
534
  kind: "key",
507
535
  type: "keyDown",
508
536
  key: event.key,
@@ -510,16 +538,23 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
510
538
  windowsVirtualKeyCode: event.keyCode,
511
539
  ...event.key === "Enter" ? { text: "\r" } : {},
512
540
  modifiers: modifiers(event)
513
- }]);
541
+ }])) forwardedKeys.current.set(event.code || event.key, {
542
+ key: event.key,
543
+ code: event.code,
544
+ keyCode: event.keyCode
545
+ });
514
546
  },
515
547
  onKeyUp: (event) => {
516
- if (event.nativeEvent.isComposing) return;
548
+ const physicalKey = event.code || event.key;
549
+ const forwardedKey = forwardedKeys.current.get(physicalKey);
550
+ if (!forwardedKey) return;
551
+ forwardedKeys.current.delete(physicalKey);
517
552
  sendInput([{
518
553
  kind: "key",
519
554
  type: "keyUp",
520
- key: event.key,
521
- code: event.code,
522
- windowsVirtualKeyCode: event.keyCode,
555
+ key: forwardedKey.key,
556
+ code: forwardedKey.code,
557
+ windowsVirtualKeyCode: forwardedKey.keyCode,
523
558
  modifiers: modifiers(event)
524
559
  }]);
525
560
  },
@@ -534,7 +569,10 @@ function BrowserLiveScreen({ sendSignal: sendHostSignal, subscribeSignals, proto
534
569
  onContextMenu: (event) => {
535
570
  event.preventDefault();
536
571
  },
537
- onBlur: (event) => event.currentTarget.removeAttribute("data-pointer-focus"),
572
+ onBlur: (event) => {
573
+ event.currentTarget.removeAttribute("data-pointer-focus");
574
+ cancelForwardedKeys();
575
+ },
538
576
  onMouseDown: (event) => {
539
577
  const gesture = mousePress.current;
540
578
  if (!gesture || gesture.pressed) return;
@@ -1,5 +1,5 @@
1
1
  import { l as WorkspaceNavigationAdapter } from "../../WorkspaceLink-Buo6gKj2.js";
2
- import { f as EmployeeShellProps, l as EmployeeModelSetup, n as EmployeeBrand, p as EmployeeStatus, t as EmployeeAgentRun } from "../../EmployeeChrome-DsdIek0l.js";
2
+ import { f as EmployeeShellProps, l as EmployeeModelSetup, n as EmployeeBrand, p as EmployeeStatus, t as EmployeeAgentRun } from "../../EmployeeChrome-QSki0QT4.js";
3
3
  import * as React from "react";
4
4
  //#region src/components/agents-sdk/EmployeeApp.d.ts
5
5
  export interface EmployeeAppRootProps extends EmployeeShellProps {
@@ -21,12 +21,11 @@ export interface EmployeeAppContentProps {
21
21
  /** Current output pane, or null when the conversation occupies the screen. */
22
22
  workbench: React.ReactNode;
23
23
  live: React.ReactNode;
24
- report?: React.ReactNode;
25
24
  /** Place transcript hydration boundaries here so they cannot replace navigation or output. */
26
25
  children: React.ReactNode;
27
26
  }
28
27
  /** Stable content lanes. Hosts hydrate the conversation locally and retain output while waiting. */
29
- declare function EmployeeAppContent({ view, workbench, live, report, children }: EmployeeAppContentProps): React.JSX.Element;
28
+ declare function EmployeeAppContent({ view, workbench, live, children }: EmployeeAppContentProps): React.JSX.Element;
30
29
  /** Local run failure presentation; keep the parent connection and queue above this part. */
31
30
  declare function EmployeeAppConversation({ run, children }: {
32
31
  run: EmployeeAgentRun | null;
@@ -9,7 +9,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  /** Persistent admission and navigation frame. Put keyed runtimes and Suspense inside it. */
10
10
  function EmployeeAppRoot({ status, workspaceNavigation, brand, modelSetup, schedules, shell, ref, children, ...chrome }) {
11
11
  const admitted = status === "ready" || status === "connecting";
12
- if (chrome.view === "files" && workspaceNavigation?.current.destination.kind === "file") chrome.compactBack ??= /* @__PURE__ */ jsx(WorkbenchBack, {
12
+ if (chrome.view === "files" && workspaceNavigation?.current.destination.kind === "file") chrome.back ??= /* @__PURE__ */ jsx(WorkbenchBack, {
13
13
  navigation: workspaceNavigation,
14
14
  filesOpen: true
15
15
  });
@@ -33,14 +33,14 @@ function EmployeeAppRoot({ status, workspaceNavigation, brand, modelSetup, sched
33
33
  });
34
34
  }
35
35
  /** Stable content lanes. Hosts hydrate the conversation locally and retain output while waiting. */
36
- function EmployeeAppContent({ view, workbench, live, report, children }) {
36
+ function EmployeeAppContent({ view, workbench, live, children }) {
37
37
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(ThinkFullApp.Root, {
38
38
  workbenchOpen: Boolean(workbench),
39
39
  hidden: view === "live",
40
40
  children: [
41
- /* @__PURE__ */ jsxs(ThinkFullApp.Conversation, {
41
+ /* @__PURE__ */ jsx(ThinkFullApp.Conversation, {
42
42
  "data-workspace-restoration-scope": "chat",
43
- children: [report, children]
43
+ children
44
44
  }),
45
45
  /* @__PURE__ */ jsx(ThinkFullApp.ResizeHandle, {}),
46
46
  /* @__PURE__ */ jsx(ThinkFullApp.Workbench, { children: workbench })
@@ -4,9 +4,9 @@ import { CodexModelSelector } from "../extension/CodexModelSelector.js";
4
4
  import { ConversationTabPicker } from "../extension/ConversationTabPicker.js";
5
5
  import { n as SetupChecklistGroup } from "../../SetupChecklist-CKQ-mKYt.js";
6
6
  import { AgentChat, useAgentChatCompaction } from "./AgentChat.js";
7
- import { ThinkChat } from "./ThinkChat.js";
8
7
  import { McpServerPickerItems } from "./McpServerPicker.js";
9
8
  import { EmployeeStartScreen } from "./EmployeeStartScreen.js";
9
+ import { ThinkChat } from "./ThinkChat.js";
10
10
  import * as React from "react";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
12
  //#region src/components/agents-sdk/EmployeeChat.tsx