@mcp-b/react-components 0.39.0 → 0.41.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/{AgentChat-CVO7xyLC.d.ts → AgentChat-DVr2giwD.d.ts} +1 -1
- package/dist/{AgentToolRunsContext-BCVqCtJ1.d.ts → AgentToolRunsContext-daY67hFM.d.ts} +12 -0
- package/dist/AppTopBar-ZdgmB_Lu.d.ts +97 -0
- package/dist/{CodeBlock-DO4Hdu1R.js → CodeBlock-BjELA-_s.js} +1 -1
- package/dist/{FileTree-DbQMpvxV.js → FileTree-DMYRdT6R.js} +1 -1
- package/dist/McpConnectorForm-MRm1r59e.d.ts +39 -0
- package/dist/{Message-DBsHHhcM.d.ts → Message-D_vCVEGB.d.ts} +20 -1
- package/dist/{ThinkChatActivity-D6-_5Phw.d.ts → ThinkChatActivity-DyGHj01E.d.ts} +1 -1
- package/dist/{ThinkExecutionRun-lYYgyeE1.d.ts → ThinkExecutionRun-k8bpyXqt.d.ts} +3 -3
- package/dist/Toolbar-CBOseBQr.d.ts +152 -0
- package/dist/{WorkspaceFileView-D0r7xnq5.js → WorkspaceFileView-D0yFwoDr.js} +3 -3
- package/dist/{WorkspaceMessageResponse-Cy28WGSz.d.ts → WorkspaceMessageResponse-D66ty4FO.d.ts} +1 -1
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.d.ts +1 -1
- package/dist/components/agents-sdk/AgentChat.js +41 -18
- package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +1 -1
- package/dist/components/agents-sdk/AgentToolRunsContext.js +12 -0
- package/dist/components/agents-sdk/BrowserLiveScreen.d.ts +135 -0
- package/dist/components/agents-sdk/BrowserLiveScreen.js +637 -0
- package/dist/components/agents-sdk/BrowserLiveView.d.ts +2 -2
- package/dist/components/agents-sdk/BrowserLiveView.js +6 -9
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.d.ts +72 -25
- package/dist/components/agents-sdk/BrowserRunPanel.js +111 -70
- package/dist/components/agents-sdk/ManagerOffice.d.ts +156 -0
- package/dist/components/agents-sdk/ManagerOffice.js +662 -0
- package/dist/components/agents-sdk/McpConnectionRequest.js +3 -3
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +1 -38
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +8 -2
- package/dist/components/agents-sdk/McpPluginCatalog.js +79 -61
- package/dist/components/agents-sdk/McpServerPicker.d.ts +1 -1
- package/dist/components/agents-sdk/McpServerPicker.js +2 -2
- package/dist/components/agents-sdk/ModelSelector.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
- package/dist/components/agents-sdk/SubagentRunDetails.d.ts +1 -9
- package/dist/components/agents-sdk/SubagentRunDetails.js +1 -9
- package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
- package/dist/components/agents-sdk/SubagentRunSelector.d.ts +4 -2
- package/dist/components/agents-sdk/SubagentRunSelector.js +7 -6
- package/dist/components/agents-sdk/ThinkChat.d.ts +4 -4
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionDetail.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +43 -43
- package/dist/components/agents-sdk/ThinkExecutionRun.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkExecutionRun.js +5 -6
- package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +8 -12
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +8 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +43 -38
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +18 -6
- package/dist/components/agents-sdk/ThinkFullApp.js +112 -144
- package/dist/components/agents-sdk/ThinkRoutine.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +4 -15
- package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +69 -89
- package/dist/components/agents-sdk/ThinkRoutineRuns.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +3 -10
- package/dist/components/agents-sdk/ThinkThreadPicker.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 +2 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +11 -11
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentAttention.d.ts +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +1 -1
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.d.ts +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/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.d.ts +2 -2
- package/dist/components/ai-sdk/Message.js +25 -3
- 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 +1 -1
- package/dist/components/ai-sdk/PromptInput.js +1 -1
- package/dist/components/ai-sdk/Queue.d.ts +4 -4
- package/dist/components/ai-sdk/Queue.js +6 -15
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.d.ts +2 -2
- package/dist/components/ai-sdk/Task.js +2 -2
- package/dist/components/extension/ChatGptSignInScreen.d.ts +21 -10
- package/dist/components/extension/ChatGptSignInScreen.js +42 -34
- package/dist/components/extension/CodexModelSelector.js +1 -1
- package/dist/components/extension/ConversationTabPicker.js +1 -1
- package/dist/components/foundations/Avatar.d.ts +1 -10
- package/dist/components/foundations/Avatar.js +1 -10
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/CheckboxGroup.js +1 -0
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/LinkButton.d.ts +12 -10
- package/dist/components/foundations/LinkButton.js +15 -11
- 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/Toolbar.d.ts +1 -151
- package/dist/components/foundations/icons.d.ts +2 -2
- package/dist/components/foundations/icons.js +2 -2
- package/dist/components/general-purpose/AppTopBar.d.ts +1 -90
- package/dist/components/general-purpose/AppTopBar.js +2 -1
- package/dist/components/general-purpose/Commit.d.ts +2 -2
- package/dist/components/general-purpose/Commit.js +5 -13
- package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +4 -7
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingBillingToggle.js +4 -9
- package/dist/components/general-purpose/PricingPlanCard.js +15 -14
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +95 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +90 -34
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.d.ts +1 -1
- package/dist/components/general-purpose/Terminal.js +4 -12
- package/dist/components/general-purpose/TestResults.d.ts +1 -1
- package/dist/components/general-purpose/TestResults.js +8 -21
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.d.ts +1 -1
- package/dist/components/general-purpose/WebPreview.js +4 -12
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
- package/dist/components/nanites/AgentToolDetail.js +7 -7
- package/dist/components/nanites/NaniteScene.js +11 -11
- package/dist/{copy-button-4YvddK4e.js → copy-button-lys9N_aI.js} +1 -1
- package/dist/{icons-BGZ916hb.d.ts → icons-0corjfxR.d.ts} +6 -16
- package/dist/{icons-B4mGvCvc.js → icons-CVFSeTJn.js} +3 -5
- package/dist/styles/agent-attention.css +5 -5
- package/dist/styles/agent-chat.css +47 -12
- package/dist/styles/agent-tool-detail.css +2 -12
- package/dist/styles/app-icon.css +12 -18
- package/dist/styles/app-top-bar.css +32 -6
- package/dist/styles/avatar.css +6 -22
- package/dist/styles/base.css +2 -8
- package/dist/styles/browser-live-screen.css +38 -0
- package/dist/styles/browser-live-view.css +12 -4
- package/dist/styles/browser-run-panel.css +20 -16
- package/dist/styles/chatgpt-sign-in-screen.css +11 -5
- package/dist/styles/commit.css +24 -1
- package/dist/styles/environment-variables.css +3 -0
- package/dist/styles/index.css +5 -4
- package/dist/styles/manager-office.css +486 -0
- package/dist/styles/mcp-plugin-catalog.css +39 -35
- package/dist/styles/mcp-server-picker.css +1 -1
- package/dist/styles/message.css +41 -18
- package/dist/styles/nanite-scene.css +9 -9
- package/dist/styles/pricing-page.css +12 -8
- package/dist/styles/prompt-input.css +8 -13
- package/dist/styles/recipes.css +1 -57
- package/dist/styles/responsive-sidebar-shell.css +70 -20
- package/dist/styles/subagent-run.css +20 -3
- package/dist/styles/terminal.css +19 -0
- package/dist/styles/test-results.css +10 -1
- package/dist/styles/think-execution-status.css +8 -24
- package/dist/styles/think-execution-workbench.css +98 -105
- package/dist/styles/think-full-app.css +81 -185
- package/dist/styles/think-routine-library.css +0 -40
- package/dist/styles/think-thread-picker.css +8 -3
- package/dist/styles/transition-surface.css +7 -8
- package/dist/styles/utilities.css +42 -0
- package/dist/styles/web-preview.css +28 -5
- package/dist/styles/workspace-explorer.css +4 -23
- package/dist/styles/workspace-mount-manager.css +22 -0
- package/package.json +37 -35
- package/dist/ResponsiveSidebarShell-DWjULskY.d.ts +0 -68
- package/dist/components/agents-sdk/AgentActivityPreview.d.ts +0 -46
- package/dist/components/agents-sdk/AgentActivityPreview.js +0 -93
- package/dist/components/agents-sdk/ThinkThreadShell.d.ts +0 -38
- package/dist/components/agents-sdk/ThinkThreadShell.js +0 -27
- package/dist/components/foundations/Badge.d.ts +0 -62
- package/dist/components/foundations/Badge.js +0 -55
- package/dist/components/foundations/StatusPill.d.ts +0 -43
- package/dist/components/foundations/StatusPill.js +0 -35
- package/dist/components/general-purpose/Shell.d.ts +0 -149
- package/dist/components/general-purpose/Shell.js +0 -116
- package/dist/styles/agent-activity-preview-overlay.css +0 -169
- package/dist/styles/agent-activity-preview.css +0 -209
- package/dist/styles/badge.css +0 -120
- package/dist/styles/shell.css +0 -122
- package/dist/styles/status-pill.css +0 -39
|
@@ -2,7 +2,26 @@ import * as React from "react";
|
|
|
2
2
|
import { BrowserLiveView } from "agents/browser";
|
|
3
3
|
|
|
4
4
|
//#region src/components/agents-sdk/BrowserRunPanel.d.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* One entry of the drawn tab strip. The panel synthesizes browser chrome
|
|
7
|
+
* around content Chrome itself never paints, so a tab is whatever record of a
|
|
8
|
+
* page the host holds — a Browser Run target, a claimed extension tab — cut
|
|
9
|
+
* down to the identity and words the strip needs.
|
|
10
|
+
*/
|
|
11
|
+
interface BrowserRunPanelTab {
|
|
12
|
+
/** Stable identity; the strip's selection value. Hosts stringify their own ids. */
|
|
13
|
+
id: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
url?: string;
|
|
16
|
+
}
|
|
17
|
+
interface BrowserRunPanelCommonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
18
|
+
/** Error from the host's browser session or transport. */
|
|
19
|
+
error?: React.ReactNode;
|
|
20
|
+
/** Panel heading. */
|
|
21
|
+
label?: React.ReactNode;
|
|
22
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
23
|
+
}
|
|
24
|
+
interface BrowserRunPanelHostedProps extends BrowserRunPanelCommonProps {
|
|
6
25
|
/** Host-side Browser Run Live View data from `connector.liveView()`. */
|
|
7
26
|
liveView?: BrowserLiveView;
|
|
8
27
|
/** Refreshes the Live View URL before it expires. */
|
|
@@ -11,36 +30,64 @@ interface BrowserRunPanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
11
30
|
onCloseSession?: () => void | Promise<void>;
|
|
12
31
|
/** True while the app is fetching Live View data. */
|
|
13
32
|
loading?: boolean;
|
|
14
|
-
/** Error from the app-owned browser session fetch/refresh path. */
|
|
15
|
-
error?: React.ReactNode;
|
|
16
|
-
/** Panel heading. */
|
|
17
|
-
label?: React.ReactNode;
|
|
18
33
|
/** Empty state shown when there is no shared browser session. */
|
|
19
34
|
empty?: React.ReactNode;
|
|
20
35
|
/** Fallback passed through to `BrowserLiveView` after URL expiry/failure. */
|
|
21
36
|
fallback?: React.ReactNode;
|
|
37
|
+
children?: never;
|
|
38
|
+
tabs?: never;
|
|
39
|
+
selectedTabId?: never;
|
|
40
|
+
onSelectTab?: never;
|
|
41
|
+
url?: never;
|
|
42
|
+
onOpenUrl?: never;
|
|
43
|
+
urlPlaceholder?: never;
|
|
44
|
+
urlDisabled?: never;
|
|
45
|
+
urlLabel?: never;
|
|
46
|
+
navigation?: never;
|
|
47
|
+
}
|
|
48
|
+
interface BrowserRunPanelStreamedProps extends BrowserRunPanelCommonProps {
|
|
49
|
+
/**
|
|
50
|
+
* The host's own browser surface — typically a `BrowserLiveView` carrying a
|
|
51
|
+
* host-fed stream. The panel frames it with the drawn tab strip and address
|
|
52
|
+
* bar; the host keeps everything transport: media, input, reconnection.
|
|
53
|
+
*/
|
|
54
|
+
children: React.ReactNode;
|
|
55
|
+
/** The drawn tab strip; it renders only with more than one entry. */
|
|
56
|
+
tabs?: readonly BrowserRunPanelTab[];
|
|
57
|
+
/** Controlled selection over `tabs`; null selects nothing. */
|
|
58
|
+
selectedTabId?: string | null;
|
|
59
|
+
/** A viewer picked a tab it is not watching; the host grants or ignores it. */
|
|
60
|
+
onSelectTab?: (tabId: string) => void;
|
|
61
|
+
/** Address bar value: the streamed page's current URL. */
|
|
62
|
+
url?: string;
|
|
63
|
+
/** Commits an address-bar entry. Absent, the address bar is read-only. */
|
|
64
|
+
onOpenUrl?: (url: string) => void;
|
|
65
|
+
urlPlaceholder?: string;
|
|
66
|
+
urlDisabled?: boolean;
|
|
67
|
+
/** Accessible name for the address input. */
|
|
68
|
+
urlLabel?: string;
|
|
69
|
+
/** Navigation controls before the address input, e.g. Back and Reload. */
|
|
70
|
+
navigation?: React.ReactNode;
|
|
71
|
+
liveView?: never;
|
|
72
|
+
onRefresh?: never;
|
|
73
|
+
onCloseSession?: never;
|
|
74
|
+
loading?: never;
|
|
75
|
+
empty?: never;
|
|
76
|
+
fallback?: never;
|
|
22
77
|
}
|
|
78
|
+
type BrowserRunPanelProps = BrowserRunPanelHostedProps | BrowserRunPanelStreamedProps;
|
|
23
79
|
/**
|
|
24
|
-
*
|
|
80
|
+
* Browser panel chrome — drawn tab strip, address bar, edge-to-edge body — for
|
|
81
|
+
* browser surfaces Chrome itself never paints.
|
|
25
82
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
83
|
+
* Two hosts fill it in. A Browser Run host passes upstream `BrowserLiveView`
|
|
84
|
+
* data from `connector.liveView()`, and the panel derives tabs, address, and
|
|
85
|
+
* an embedded live view itself, calling app-provided refresh/close callbacks.
|
|
86
|
+
* A streaming host instead passes `children` — its own live surface — with
|
|
87
|
+
* the tab strip, address bar, and navigation controlled from the host's own
|
|
88
|
+
* records, because a remote screencast carries only page pixels and every
|
|
89
|
+
* piece of chrome around it has to be synthesized from host state.
|
|
29
90
|
*/
|
|
30
|
-
declare function BrowserRunPanel(
|
|
31
|
-
liveView,
|
|
32
|
-
onRefresh,
|
|
33
|
-
onCloseSession,
|
|
34
|
-
loading,
|
|
35
|
-
error,
|
|
36
|
-
label,
|
|
37
|
-
empty,
|
|
38
|
-
fallback,
|
|
39
|
-
className,
|
|
40
|
-
ref,
|
|
41
|
-
...props
|
|
42
|
-
}: BrowserRunPanelProps & {
|
|
43
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
44
|
-
}): React.JSX.Element;
|
|
91
|
+
declare function BrowserRunPanel(props: BrowserRunPanelProps): React.JSX.Element;
|
|
45
92
|
//#endregion
|
|
46
|
-
export { BrowserRunPanel, BrowserRunPanelProps };
|
|
93
|
+
export { BrowserRunPanel, BrowserRunPanelProps, BrowserRunPanelTab };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Button } from "../foundations/Button.js";
|
|
2
|
+
import { K as SpinnerIcon, tt as XIcon } from "../../icons-CVFSeTJn.js";
|
|
4
3
|
import { Tabs } from "../foundations/Tabs.js";
|
|
5
|
-
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
6
4
|
import { WebPreview, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewUrl } from "../general-purpose/WebPreview.js";
|
|
5
|
+
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
7
6
|
import * as React from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
//#region src/components/agents-sdk/BrowserRunPanel.tsx
|
|
10
9
|
function isInspectablePage(target) {
|
|
11
10
|
const pageUrl = target.pageUrl;
|
|
12
11
|
return Boolean(pageUrl && !pageUrl.startsWith("about:") && !pageUrl.startsWith("chrome:") && !pageUrl.startsWith("devtools:"));
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
13
|
+
function tabLabel(tab) {
|
|
14
|
+
return tab.title || tab.url || tab.id;
|
|
16
15
|
}
|
|
17
|
-
function
|
|
18
|
-
return (
|
|
16
|
+
function tabGlyph(tab) {
|
|
17
|
+
return tabLabel(tab).trim().charAt(0).toUpperCase() || "•";
|
|
19
18
|
}
|
|
20
19
|
function pickTarget(targets, targetId) {
|
|
21
20
|
return (targetId ? targets.find((target) => target.targetId === targetId) : void 0) ?? targets.find(isInspectablePage) ?? targets[0];
|
|
@@ -28,105 +27,64 @@ function BrowserRunPanelState({ children, role, tone = "neutral" }) {
|
|
|
28
27
|
children
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
* The app owns `createBrowserRuntime()`, `connector.liveView()`, polling, and
|
|
35
|
-
* session cleanup. This component only renders upstream `BrowserLiveView`
|
|
36
|
-
* data and calls app-provided refresh/close callbacks.
|
|
37
|
-
*/
|
|
38
|
-
function BrowserRunPanel({ liveView, onRefresh, onCloseSession, loading, error, label = "Browser", empty = "No live browser session", fallback, className, ref, ...props }) {
|
|
39
|
-
const [requestedTargetId, setRequestedTargetId] = React.useState();
|
|
40
|
-
const [receivedAt, setReceivedAt] = React.useState(() => Date.now());
|
|
41
|
-
React.useEffect(() => {
|
|
42
|
-
if (liveView) setReceivedAt(Date.now());
|
|
43
|
-
}, [liveView]);
|
|
44
|
-
const targets = liveView?.targets ?? [];
|
|
45
|
-
const target = pickTarget(targets, requestedTargetId);
|
|
46
|
-
const pageUrl = target?.pageUrl ?? "";
|
|
47
|
-
const body = target && liveView ? /* @__PURE__ */ jsx(BrowserLiveView, {
|
|
48
|
-
source: {
|
|
49
|
-
url: target.url,
|
|
50
|
-
targetId: target.targetId,
|
|
51
|
-
expiresInMs: liveView.expiresInMs
|
|
52
|
-
},
|
|
53
|
-
receivedAt,
|
|
54
|
-
pageTitle: target.title ?? target.pageUrl,
|
|
55
|
-
fallback,
|
|
56
|
-
className: "browser-run-panel__live-view"
|
|
57
|
-
}) : loading ? /* @__PURE__ */ jsxs(BrowserRunPanelState, {
|
|
58
|
-
role: "status",
|
|
59
|
-
children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), "Loading browser session"]
|
|
60
|
-
}) : /* @__PURE__ */ jsx(BrowserRunPanelState, { children: empty });
|
|
30
|
+
/** The one rendering of the panel chrome, whichever mode filled its props in. */
|
|
31
|
+
function BrowserRunPanelFrame({ body, bodyBusy, bodyTabValue, className, error, label = "Browser", navigation, navigationEnd, onOpenUrl, onSelectTab, ref, selectedTabId, tabs, url, urlDisabled, urlLabel = "Browser page URL", urlPlaceholder, urlReadOnly, ...props }) {
|
|
61
32
|
const bodyProps = {
|
|
62
33
|
className: "web-preview__body browser-run-panel__body",
|
|
63
|
-
"aria-busy":
|
|
34
|
+
"aria-busy": bodyBusy || void 0
|
|
64
35
|
};
|
|
65
36
|
return /* @__PURE__ */ jsxs(Tabs.Root, {
|
|
66
37
|
className: cx("browser-run-panel", className),
|
|
67
|
-
value:
|
|
38
|
+
value: selectedTabId ?? null,
|
|
68
39
|
onValueChange: (value) => {
|
|
69
|
-
if (typeof value === "string")
|
|
40
|
+
if (typeof value === "string" && value !== selectedTabId) onSelectTab?.(value);
|
|
70
41
|
},
|
|
71
42
|
render: /* @__PURE__ */ jsx(WebPreview, {
|
|
72
43
|
ref,
|
|
73
|
-
url
|
|
44
|
+
url,
|
|
45
|
+
...onOpenUrl ? { onUrlChange: onOpenUrl } : {},
|
|
74
46
|
role: "region",
|
|
75
47
|
"aria-label": typeof label === "string" ? label : "Browser",
|
|
76
48
|
...props
|
|
77
49
|
}),
|
|
78
50
|
children: [
|
|
79
|
-
|
|
51
|
+
tabs.length > 1 ? /* @__PURE__ */ jsx(WebPreviewNavigation, { children: /* @__PURE__ */ jsx(Tabs.List, {
|
|
80
52
|
className: "browser-run-panel__tabs",
|
|
81
53
|
"aria-label": "Open browser pages",
|
|
82
54
|
activateOnFocus: true,
|
|
83
|
-
children:
|
|
84
|
-
value:
|
|
55
|
+
children: tabs.map((tab) => /* @__PURE__ */ jsxs(Tabs.Tab, {
|
|
56
|
+
value: tab.id,
|
|
85
57
|
className: "browser-run-panel__tab",
|
|
86
|
-
render: /* @__PURE__ */ jsx(Button, {
|
|
87
|
-
type: "button",
|
|
88
|
-
variant: "ghost",
|
|
89
|
-
color: "neutral",
|
|
90
|
-
size: "sm"
|
|
91
|
-
}),
|
|
92
58
|
children: [/* @__PURE__ */ jsx("span", {
|
|
93
59
|
className: "browser-run-panel__tab-glyph",
|
|
94
60
|
"aria-hidden": "true",
|
|
95
|
-
children:
|
|
61
|
+
children: tabGlyph(tab)
|
|
96
62
|
}), /* @__PURE__ */ jsx("span", {
|
|
97
63
|
className: "browser-run-panel__tab-title sigvelo-truncate",
|
|
98
|
-
children:
|
|
64
|
+
children: tabLabel(tab)
|
|
99
65
|
})]
|
|
100
|
-
},
|
|
66
|
+
}, tab.id))
|
|
101
67
|
}) }) : null,
|
|
102
68
|
/* @__PURE__ */ jsxs(WebPreviewNavigation, {
|
|
103
69
|
className: "browser-run-panel__address-bar",
|
|
104
70
|
children: [
|
|
71
|
+
navigation,
|
|
105
72
|
/* @__PURE__ */ jsx(WebPreviewUrl, {
|
|
106
|
-
"aria-label":
|
|
107
|
-
placeholder:
|
|
108
|
-
readOnly:
|
|
73
|
+
"aria-label": urlLabel,
|
|
74
|
+
placeholder: urlPlaceholder,
|
|
75
|
+
readOnly: urlReadOnly,
|
|
76
|
+
disabled: urlDisabled
|
|
109
77
|
}),
|
|
110
|
-
|
|
111
|
-
action: "reload",
|
|
112
|
-
label: "Refresh browser view",
|
|
113
|
-
disabled: loading,
|
|
114
|
-
onClick: () => void onRefresh()
|
|
115
|
-
}) : null,
|
|
116
|
-
onCloseSession ? /* @__PURE__ */ jsx(WebPreviewNavigationButton, {
|
|
117
|
-
label: "Close browser session",
|
|
118
|
-
onClick: () => void onCloseSession(),
|
|
119
|
-
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
120
|
-
}) : null
|
|
78
|
+
navigationEnd
|
|
121
79
|
]
|
|
122
80
|
}),
|
|
123
81
|
error ? /* @__PURE__ */ jsx(BrowserRunPanelState, {
|
|
124
82
|
tone: "danger",
|
|
125
83
|
children: error
|
|
126
84
|
}) : null,
|
|
127
|
-
|
|
85
|
+
bodyTabValue !== void 0 ? /* @__PURE__ */ jsx(Tabs.Panel, {
|
|
128
86
|
...bodyProps,
|
|
129
|
-
value:
|
|
87
|
+
value: bodyTabValue,
|
|
130
88
|
children: body
|
|
131
89
|
}) : /* @__PURE__ */ jsx("div", {
|
|
132
90
|
...bodyProps,
|
|
@@ -135,5 +93,88 @@ function BrowserRunPanel({ liveView, onRefresh, onCloseSession, loading, error,
|
|
|
135
93
|
]
|
|
136
94
|
});
|
|
137
95
|
}
|
|
96
|
+
function HostedBrowserRunPanel({ liveView, onRefresh, onCloseSession, loading, error, label, empty = "No live browser session", fallback, ...props }) {
|
|
97
|
+
const [requestedTargetId, setRequestedTargetId] = React.useState();
|
|
98
|
+
const [receivedAt, setReceivedAt] = React.useState(() => Date.now());
|
|
99
|
+
React.useEffect(() => {
|
|
100
|
+
if (liveView) setReceivedAt(Date.now());
|
|
101
|
+
}, [liveView]);
|
|
102
|
+
const targets = liveView?.targets ?? [];
|
|
103
|
+
const target = pickTarget(targets, requestedTargetId);
|
|
104
|
+
const body = target && liveView ? /* @__PURE__ */ jsx(BrowserLiveView, {
|
|
105
|
+
fill: true,
|
|
106
|
+
source: {
|
|
107
|
+
url: target.url,
|
|
108
|
+
targetId: target.targetId,
|
|
109
|
+
expiresInMs: liveView.expiresInMs
|
|
110
|
+
},
|
|
111
|
+
receivedAt,
|
|
112
|
+
pageTitle: target.title ?? target.pageUrl,
|
|
113
|
+
fallback
|
|
114
|
+
}) : loading ? /* @__PURE__ */ jsxs(BrowserRunPanelState, {
|
|
115
|
+
role: "status",
|
|
116
|
+
children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), "Loading browser session"]
|
|
117
|
+
}) : /* @__PURE__ */ jsx(BrowserRunPanelState, { children: empty });
|
|
118
|
+
return /* @__PURE__ */ jsx(BrowserRunPanelFrame, {
|
|
119
|
+
...props,
|
|
120
|
+
body,
|
|
121
|
+
bodyBusy: loading,
|
|
122
|
+
bodyTabValue: targets.length > 1 && target ? target.targetId : void 0,
|
|
123
|
+
error,
|
|
124
|
+
label,
|
|
125
|
+
navigationEnd: /* @__PURE__ */ jsxs(Fragment, { children: [onRefresh ? /* @__PURE__ */ jsx(WebPreviewNavigationButton, {
|
|
126
|
+
action: "reload",
|
|
127
|
+
label: "Refresh browser view",
|
|
128
|
+
disabled: loading,
|
|
129
|
+
onClick: () => void onRefresh()
|
|
130
|
+
}) : null, onCloseSession ? /* @__PURE__ */ jsx(WebPreviewNavigationButton, {
|
|
131
|
+
label: "Close browser session",
|
|
132
|
+
onClick: () => void onCloseSession(),
|
|
133
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
134
|
+
}) : null] }),
|
|
135
|
+
onSelectTab: setRequestedTargetId,
|
|
136
|
+
selectedTabId: target?.targetId ?? null,
|
|
137
|
+
tabs: targets.map((candidate) => ({
|
|
138
|
+
id: candidate.targetId,
|
|
139
|
+
...candidate.title === void 0 ? {} : { title: candidate.title },
|
|
140
|
+
...candidate.pageUrl === void 0 ? {} : { url: candidate.pageUrl }
|
|
141
|
+
})),
|
|
142
|
+
url: target?.pageUrl ?? "",
|
|
143
|
+
urlPlaceholder: "Waiting for browser session",
|
|
144
|
+
urlReadOnly: true
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function StreamedBrowserRunPanel({ children, tabs = [], selectedTabId = null, onSelectTab, url = "", onOpenUrl, urlPlaceholder, urlDisabled, urlLabel, navigation, ...props }) {
|
|
148
|
+
return /* @__PURE__ */ jsx(BrowserRunPanelFrame, {
|
|
149
|
+
...props,
|
|
150
|
+
body: children,
|
|
151
|
+
navigation,
|
|
152
|
+
onOpenUrl,
|
|
153
|
+
onSelectTab,
|
|
154
|
+
selectedTabId,
|
|
155
|
+
tabs,
|
|
156
|
+
url,
|
|
157
|
+
urlDisabled,
|
|
158
|
+
urlLabel,
|
|
159
|
+
urlPlaceholder,
|
|
160
|
+
urlReadOnly: onOpenUrl === void 0 || void 0
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Browser panel chrome — drawn tab strip, address bar, edge-to-edge body — for
|
|
165
|
+
* browser surfaces Chrome itself never paints.
|
|
166
|
+
*
|
|
167
|
+
* Two hosts fill it in. A Browser Run host passes upstream `BrowserLiveView`
|
|
168
|
+
* data from `connector.liveView()`, and the panel derives tabs, address, and
|
|
169
|
+
* an embedded live view itself, calling app-provided refresh/close callbacks.
|
|
170
|
+
* A streaming host instead passes `children` — its own live surface — with
|
|
171
|
+
* the tab strip, address bar, and navigation controlled from the host's own
|
|
172
|
+
* records, because a remote screencast carries only page pixels and every
|
|
173
|
+
* piece of chrome around it has to be synthesized from host state.
|
|
174
|
+
*/
|
|
175
|
+
function BrowserRunPanel(props) {
|
|
176
|
+
if (props.children !== void 0) return /* @__PURE__ */ jsx(StreamedBrowserRunPanel, { ...props });
|
|
177
|
+
return /* @__PURE__ */ jsx(HostedBrowserRunPanel, { ...props });
|
|
178
|
+
}
|
|
138
179
|
//#endregion
|
|
139
180
|
export { BrowserRunPanel };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/agents-sdk/ManagerOffice.d.ts
|
|
4
|
+
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
|
+
*/
|
|
10
|
+
type ManagerOfficeView = {
|
|
11
|
+
kind: "attention";
|
|
12
|
+
} | {
|
|
13
|
+
kind: "employee";
|
|
14
|
+
employeeId: string;
|
|
15
|
+
};
|
|
16
|
+
interface ManagerOfficeHandoff {
|
|
17
|
+
/** Stable handoff identity. */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Exact claimed browser tab waiting for the manager. */
|
|
20
|
+
tabId: number;
|
|
21
|
+
/** Exact action the employee needs from the manager. */
|
|
22
|
+
reason: string;
|
|
23
|
+
/**
|
|
24
|
+
* The employee's own words about what it is blocked on, verbatim. The reason
|
|
25
|
+
* is the headline a manager scans; this is the ask they answer, so it is not
|
|
26
|
+
* truncated and not summarized by this component.
|
|
27
|
+
*/
|
|
28
|
+
request?: string;
|
|
29
|
+
/** Work item that owns the handoff. */
|
|
30
|
+
workId: string;
|
|
31
|
+
/** Human-readable title of the owning work. */
|
|
32
|
+
workTitle: string;
|
|
33
|
+
/** Unix timestamp in milliseconds when this handoff began. */
|
|
34
|
+
createdAt: number;
|
|
35
|
+
}
|
|
36
|
+
interface ManagerOfficeWork {
|
|
37
|
+
/** Stable work identity. */
|
|
38
|
+
id: string;
|
|
39
|
+
/** Human-readable outcome or conversation title. */
|
|
40
|
+
title: string;
|
|
41
|
+
/** Canonical thread lifecycle status. */
|
|
42
|
+
status: ManagerOfficeWorkStatus;
|
|
43
|
+
/** Unix timestamp in milliseconds of the latest lifecycle transition. */
|
|
44
|
+
updatedAt: number;
|
|
45
|
+
}
|
|
46
|
+
interface ManagerOfficeRoutine {
|
|
47
|
+
/** Stable routine identity. */
|
|
48
|
+
id: string;
|
|
49
|
+
/** Human-readable recurring responsibility. */
|
|
50
|
+
name: string;
|
|
51
|
+
/** Human-readable schedule supplied by the host. */
|
|
52
|
+
schedule: string;
|
|
53
|
+
/** Whether future occurrences are enabled. */
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
/** Completed runs among the bounded recent run history. */
|
|
56
|
+
completedRuns: number;
|
|
57
|
+
/** Terminal runs among the bounded recent run history. */
|
|
58
|
+
finishedRuns: number;
|
|
59
|
+
}
|
|
60
|
+
/** Which way work moves through a channel, from the employee's side. */
|
|
61
|
+
type ManagerOfficeChannelDirection = "input" | "output" | "both";
|
|
62
|
+
type ManagerOfficeChannelStatus = "connected" | "needs-auth" | "error";
|
|
63
|
+
interface ManagerOfficeChannel {
|
|
64
|
+
/** Stable channel identity. */
|
|
65
|
+
id: string;
|
|
66
|
+
/** Service the employee reaches through, such as “Slack” or “Gmail”. */
|
|
67
|
+
name: string;
|
|
68
|
+
direction: ManagerOfficeChannelDirection;
|
|
69
|
+
status: ManagerOfficeChannelStatus;
|
|
70
|
+
/** Connected account or workspace, or the reason the channel stopped. */
|
|
71
|
+
detail?: string;
|
|
72
|
+
/**
|
|
73
|
+
* 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
|
+
*/
|
|
76
|
+
icon?: React.ReactNode;
|
|
77
|
+
}
|
|
78
|
+
interface ManagerOfficeEmployeeBase {
|
|
79
|
+
/** Stable employee identity used by routes and list keys. */
|
|
80
|
+
id: string;
|
|
81
|
+
/** Short presentation name. */
|
|
82
|
+
name: string;
|
|
83
|
+
/** Verified employee email. */
|
|
84
|
+
email: string;
|
|
85
|
+
/** One or two characters rendered when no avatar image exists. */
|
|
86
|
+
initials: string;
|
|
87
|
+
}
|
|
88
|
+
interface ManagerOfficeConnectedEmployee extends ManagerOfficeEmployeeBase {
|
|
89
|
+
status: "needs-you" | "working" | "idle" | "issue";
|
|
90
|
+
/** Plain-language summary of the employee's role. */
|
|
91
|
+
role: string;
|
|
92
|
+
handoffs: readonly ManagerOfficeHandoff[];
|
|
93
|
+
work: readonly ManagerOfficeWork[];
|
|
94
|
+
routines: readonly ManagerOfficeRoutine[];
|
|
95
|
+
/** Every service the employee reads from or acts on. Empty is meaningful. */
|
|
96
|
+
channels: readonly ManagerOfficeChannel[];
|
|
97
|
+
}
|
|
98
|
+
interface ManagerOfficeDisconnectedEmployee extends ManagerOfficeEmployeeBase {
|
|
99
|
+
status: "offline" | "connecting" | "unavailable";
|
|
100
|
+
/** Honest explanation of the connection state and the manager's next option. */
|
|
101
|
+
statusDescription: string;
|
|
102
|
+
}
|
|
103
|
+
type ManagerOfficeEmployee = ManagerOfficeConnectedEmployee | ManagerOfficeDisconnectedEmployee;
|
|
104
|
+
type ManagerOfficeEmployeeStatus = ManagerOfficeEmployee["status"];
|
|
105
|
+
interface ManagerOfficeNavigation {
|
|
106
|
+
/** App-owned route element for the aggregate handoff view. */
|
|
107
|
+
renderAttentionLink(): React.ReactElement;
|
|
108
|
+
/** App-owned route element for one employee. */
|
|
109
|
+
renderEmployeeLink(employee: ManagerOfficeEmployee): React.ReactElement;
|
|
110
|
+
/** App-owned route element for a handoff's exact work. */
|
|
111
|
+
renderHandoffLink(employee: ManagerOfficeConnectedEmployee, handoff: ManagerOfficeHandoff): React.ReactElement;
|
|
112
|
+
/** App-owned route element for one work item. */
|
|
113
|
+
renderWorkLink(employee: ManagerOfficeConnectedEmployee, work: ManagerOfficeWork): React.ReactElement;
|
|
114
|
+
/** App-owned route element for one recurring responsibility. */
|
|
115
|
+
renderRoutineLink(employee: ManagerOfficeConnectedEmployee, routine: ManagerOfficeRoutine): React.ReactElement;
|
|
116
|
+
/** App-owned route element for starting new work with one employee. */
|
|
117
|
+
renderNewWorkLink(employee: ManagerOfficeConnectedEmployee): React.ReactElement;
|
|
118
|
+
/** App-owned route element for browsing one employee's workspace. */
|
|
119
|
+
renderWorkspaceLink(employee: ManagerOfficeConnectedEmployee): React.ReactElement;
|
|
120
|
+
}
|
|
121
|
+
interface ManagerOfficeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
122
|
+
/** Current disposable navigation projection; durable selection remains app-owned. */
|
|
123
|
+
view: ManagerOfficeView;
|
|
124
|
+
/** Employees projected from their owning runtimes. */
|
|
125
|
+
employees: readonly ManagerOfficeEmployee[];
|
|
126
|
+
/** Router elements supplied by the consuming app. */
|
|
127
|
+
navigation: ManagerOfficeNavigation;
|
|
128
|
+
/** Add/sign-out controls rendered in the office rail. Pass `null` for none. */
|
|
129
|
+
officeActions: React.ReactNode;
|
|
130
|
+
/**
|
|
131
|
+
* Actions rendered for the selected connected employee. Compose interactive
|
|
132
|
+
* controls through `AppTopBar.Control` so they join the toolbar; pass `null`
|
|
133
|
+
* for none.
|
|
134
|
+
*/
|
|
135
|
+
renderEmployeeActions: (employee: ManagerOfficeConnectedEmployee) => React.ReactNode;
|
|
136
|
+
/** Action shown in the empty office. Pass `null` for none. */
|
|
137
|
+
emptyOfficeAction: React.ReactNode;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Multi-employee manager office: aggregate handoffs, employee roster, and one
|
|
141
|
+
* employee dossier. The consuming app owns authentication, Agent connections,
|
|
142
|
+
* routing, and the selected employee's full work surface.
|
|
143
|
+
*/
|
|
144
|
+
declare function ManagerOffice({
|
|
145
|
+
className,
|
|
146
|
+
emptyOfficeAction,
|
|
147
|
+
employees,
|
|
148
|
+
navigation,
|
|
149
|
+
officeActions,
|
|
150
|
+
renderEmployeeActions,
|
|
151
|
+
style,
|
|
152
|
+
view,
|
|
153
|
+
...props
|
|
154
|
+
}: ManagerOfficeProps): React.JSX.Element;
|
|
155
|
+
//#endregion
|
|
156
|
+
export { ManagerOffice, ManagerOfficeChannel, ManagerOfficeChannelDirection, ManagerOfficeChannelStatus, ManagerOfficeConnectedEmployee, ManagerOfficeDisconnectedEmployee, ManagerOfficeEmployee, ManagerOfficeEmployeeStatus, ManagerOfficeHandoff, ManagerOfficeNavigation, ManagerOfficeProps, ManagerOfficeRoutine, ManagerOfficeView, ManagerOfficeWork, ManagerOfficeWorkStatus };
|