@mcp-b/react-components 0.57.1 → 0.58.1
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/Card-BPkXIkBz.d.ts +46 -0
- package/dist/{CodeBlock-Bl-q7wMc.js → CodeBlock-Bs_Z03eC.js} +2 -1
- package/dist/{CodeBlock-CPotpyyM.d.ts → CodeBlock-DYp5V_4O.d.ts} +1 -1
- package/dist/{EmployeeChrome-CN99SVfF.d.ts → EmployeeChrome-DsdIek0l.d.ts} +2 -10
- package/dist/ExecutionBoard-DHfMvKlB.d.ts +64 -0
- package/dist/ExecutionResult-BSZsUbrL.js +279 -0
- package/dist/{FileTree-CfOhUyp3.js → FileTree-DyLBn7O_.js} +1 -1
- package/dist/{ManagerOffice-CMJ7laGe.js → ManagerOffice-C8AQcaXs.js} +5 -20
- package/dist/{McpConnectorForm-BPWCo9bU.d.ts → McpConnectorForm-D4bY-lm_.d.ts} +1 -1
- package/dist/{McpPluginCatalog-uSh0gGeY.d.ts → McpPluginCatalog-2FZDLCeK.d.ts} +2 -2
- package/dist/{SetupChecklist-BiWQkKEq.js → SetupChecklist-CKQ-mKYt.js} +2 -2
- package/dist/{ThinkRoutine-DGlKJbIy.d.ts → ThinkRoutine-DoZjbzyn.d.ts} +15 -3
- package/dist/{Workspace-Cr-aGDfx.d.ts → Workspace-iCkXvQRJ.d.ts} +1 -1
- package/dist/WorkspaceConcept-ByaG-kBq.d.ts +38 -0
- package/dist/WorkspaceExecutionTable-DNhj6YDX.d.ts +239 -0
- package/dist/{WorkspaceFile-DiwiJEwO.d.ts → WorkspaceFile-DkIZKoK6.d.ts} +1 -1
- package/dist/{WorkspaceFileView-CCe_o79q.js → WorkspaceFileView-M2jC2P4p.js} +217 -139
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.js +10 -10
- package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/EmployeeApp.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeApp.js +3 -7
- package/dist/components/agents-sdk/EmployeeChat.js +4 -4
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChrome.js +78 -63
- package/dist/components/agents-sdk/EmployeeSchedules.d.ts +6 -3
- package/dist/components/agents-sdk/EmployeeSchedules.js +12 -10
- package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +2 -2
- package/dist/components/agents-sdk/EmployeeStartScreen.js +3 -3
- package/dist/components/agents-sdk/ExecutionBoard.d.ts +2 -0
- package/dist/components/agents-sdk/ExecutionBoard.js +648 -0
- package/dist/components/agents-sdk/ManagerAccountActions.js +2 -2
- package/dist/components/agents-sdk/ManagerOffice.d.ts +1 -1
- package/dist/components/agents-sdk/ManagerOffice.js +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.js +4 -3
- package/dist/components/agents-sdk/McpConnectionRequest.d.ts +1 -1
- package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +1 -1
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +17 -8
- package/dist/components/agents-sdk/McpServerIcon.d.ts +1 -1
- package/dist/components/agents-sdk/McpServerPicker.d.ts +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +2 -2
- package/dist/components/agents-sdk/ModelEndpointDialog.js +1 -1
- package/dist/components/agents-sdk/ModelSelector.js +4 -4
- package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
- package/dist/components/agents-sdk/SubagentRunPanel.js +2 -2
- package/dist/components/agents-sdk/SubagentRunSelector.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +2 -2
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +238 -209
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +14 -35
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutine.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkRoutineActions.js +25 -15
- package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
- package/dist/components/agents-sdk/ThinkRoutineDetail.d.ts +5 -2
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +13 -7
- package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +23 -6
- package/dist/components/agents-sdk/ThinkRoutineForm.js +521 -214
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -2
- package/dist/components/agents-sdk/TypeSafeConnectionDialog.d.ts +10 -0
- package/dist/components/agents-sdk/TypeSafeConnectionDialog.js +34 -0
- package/dist/components/agents-sdk/WorkbenchBack.js +1 -1
- package/dist/components/agents-sdk/Workspace.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceConcept.d.ts +2 -37
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +7 -6
- package/dist/components/agents-sdk/WorkspaceExecution.d.ts +2 -92
- package/dist/components/agents-sdk/WorkspaceExecution.js +650 -133
- package/dist/components/agents-sdk/WorkspaceExecutionTable.d.ts +2 -0
- package/dist/components/agents-sdk/WorkspaceExecutionTable.js +824 -0
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +3 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +4 -3
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +4 -2
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceProject.js +6 -5
- package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceUserScript.js +5 -4
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +2 -2
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.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.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.js +1 -1
- package/dist/components/ai-sdk/ConnectedAppCards.d.ts +1 -1
- package/dist/components/ai-sdk/ConnectedAppCards.js +3 -3
- package/dist/components/ai-sdk/Context.js +1 -1
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.js +2 -2
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +6 -6
- package/dist/components/ai-sdk/Queue.js +1 -1
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +2 -2
- package/dist/components/extension/CodexModelSelector.js +2 -2
- package/dist/components/extension/ConversationTabPicker.js +2 -2
- package/dist/components/foundations/Card.d.ts +2 -45
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/Collapsible.js +1 -1
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/icons.d.ts +2 -2
- package/dist/components/foundations/icons.js +2 -2
- package/dist/components/general-purpose/AccountSignInDialog.js +1 -1
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.js +2 -2
- package/dist/components/general-purpose/TestResults.js +1 -1
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.js +2 -2
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.js +1 -1
- package/dist/{copy-button-CSDuDfdP.js → copy-button-M4sAp9xS.js} +1 -1
- package/dist/execution-result-DWVmm-bL.js +80 -0
- package/dist/{icons-CUuD7iEh.d.ts → icons-Dj6id76o.d.ts} +2 -1
- package/dist/{icons-cuEtsgj9.js → icons-DvlrWt54.js} +4 -3
- package/dist/{mcp-server-catalog-DgA9BnL0.d.ts → mcp-server-catalog-kaMWaSAL.d.ts} +3 -1
- package/dist/styles/app-top-bar.css +2 -1
- package/dist/styles/base.css +1 -0
- package/dist/styles/chatgpt-sign-in-screen.css +8 -14
- package/dist/styles/description-list.css +12 -9
- package/dist/styles/execution-board.css +383 -0
- package/dist/styles/index.css +3 -0
- package/dist/styles/mcp-plugin-catalog.css +8 -7
- package/dist/styles/message-scroller.css +8 -0
- package/dist/styles/think-chat-tool-panels.css +1 -2
- package/dist/styles/think-execution-workbench.css +1 -12
- package/dist/styles/think-routine.css +39 -41
- package/dist/styles/workspace-concepts.css +441 -17
- package/dist/styles/workspace-explorer.css +18 -4
- package/dist/utils/mcp-server-catalog.d.ts +2 -2
- package/dist/utils/mcp-server-catalog.js +18 -1
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/{workspace-assets-Bg7XhPsk.js → workspace-assets-DVn0d-fN.js} +24 -81
- package/dist/workspace-delete-DfloiBWp.js +80 -0
- package/package.json +3 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { H as RefreshIcon,
|
|
2
|
+
import { H as RefreshIcon, tt as WarningIcon, y as EllipsisIcon } from "../../icons-DvlrWt54.js";
|
|
3
3
|
import { buttonVariants } from "../foundations/Button.js";
|
|
4
|
+
import { Menu } from "../foundations/Menu.js";
|
|
4
5
|
import { IconButton } from "../foundations/IconButton.js";
|
|
5
6
|
import { a as formatErrorMessage } from "../../format-CWaZEp5o.js";
|
|
6
|
-
import {
|
|
7
|
+
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
7
8
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
8
9
|
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
9
|
-
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
10
10
|
import { getThinkExecutionRunAccessibleName, getThinkExecutionRunId, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
11
11
|
import { ThinkExecutionRunSummary } from "./ThinkExecutionStatus.js";
|
|
12
12
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
2
1
|
import { AgentChatTurnError } from "../ai-sdk/AgentChatTurnError.js";
|
|
2
|
+
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/agents-sdk/ThinkRecoveryNotice.tsx
|
|
5
5
|
function connectionReason(error) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { ThinkRoutine, ThinkRoutineOwner, ThinkRoutineRunOf, getThinkRoutineNextRun };
|
|
1
|
+
import { a as getThinkRoutineNextRun, i as ThinkRoutineScript, n as ThinkRoutineOwner, r as ThinkRoutineRunOf, t as ThinkRoutine } from "../../ThinkRoutine-DoZjbzyn.js";
|
|
2
|
+
export { ThinkRoutine, ThinkRoutineOwner, ThinkRoutineRunOf, ThinkRoutineScript, getThinkRoutineNextRun };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AppTopBar } from "../../AppTopBar-DwzydmXu.js";
|
|
2
|
-
import { t as ThinkRoutine } from "../../ThinkRoutine-
|
|
2
|
+
import { t as ThinkRoutine } from "../../ThinkRoutine-DoZjbzyn.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
//#region src/components/agents-sdk/ThinkRoutineActions.d.ts
|
|
5
5
|
export interface ThinkRoutineActionsRootProps<TRoutine extends ThinkRoutine = ThinkRoutine> {
|
|
@@ -27,7 +27,7 @@ export type ThinkRoutineActionProps = Omit<React.ComponentProps<typeof AppTopBar
|
|
|
27
27
|
label?: string;
|
|
28
28
|
};
|
|
29
29
|
/** Explicit run control; preserves the complete shared button composition contract. */
|
|
30
|
-
declare function ThinkRoutineRun(props: ThinkRoutineActionProps): React.JSX.Element | null;
|
|
30
|
+
declare function ThinkRoutineRun({ label, tooltip, children, ...props }: ThinkRoutineActionProps): React.JSX.Element | null;
|
|
31
31
|
/** Delete confirmation stays open on failure; only its source-scoped action can settle it. */
|
|
32
32
|
declare function ThinkRoutineDelete(props: ThinkRoutineActionProps): React.JSX.Element | null;
|
|
33
33
|
declare function ThinkRoutineError(props: React.ComponentPropsWithRef<"div">): React.JSX.Element | null;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button } from "../foundations/Button.js";
|
|
1
|
+
import { $ as TrashIcon, K as SpinnerIcon, z as PlayIcon } from "../../icons-DvlrWt54.js";
|
|
2
|
+
import { Button, buttonVariants } from "../foundations/Button.js";
|
|
3
|
+
import { Tooltip } from "../foundations/Tooltip.js";
|
|
3
4
|
import { a as formatErrorMessage } from "../../format-CWaZEp5o.js";
|
|
4
5
|
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
6
|
+
import { Toolbar } from "../foundations/Toolbar.js";
|
|
5
7
|
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
6
8
|
import { AlertDialog } from "../foundations/AlertDialog.js";
|
|
9
|
+
import { t as executionErrorSummary } from "../../execution-result-DWVmm-bL.js";
|
|
7
10
|
import * as React from "react";
|
|
8
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
12
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
@@ -58,7 +61,7 @@ function ThinkRoutineActionsRoot({ routine, sourceKey, onRun, onEnabledChange, o
|
|
|
58
61
|
} catch (next) {
|
|
59
62
|
setState((current) => current.scope === scope ? {
|
|
60
63
|
...current,
|
|
61
|
-
error: formatErrorMessage(next)
|
|
64
|
+
error: executionErrorSummary(formatErrorMessage(next))
|
|
62
65
|
} : current);
|
|
63
66
|
return false;
|
|
64
67
|
} finally {
|
|
@@ -95,20 +98,27 @@ function ThinkRoutineActionsRoot({ routine, sourceKey, onRun, onEnabledChange, o
|
|
|
95
98
|
});
|
|
96
99
|
}
|
|
97
100
|
/** Explicit run control; preserves the complete shared button composition contract. */
|
|
98
|
-
function ThinkRoutineRun(props) {
|
|
101
|
+
function ThinkRoutineRun({ label = "Run now", tooltip = label, children, ...props }) {
|
|
99
102
|
const { busy, run } = useRoutineActions();
|
|
100
103
|
if (!run) return null;
|
|
101
|
-
return /* @__PURE__ */ jsx(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
105
|
+
render: /* @__PURE__ */ jsx(Toolbar.Button, {
|
|
106
|
+
...mergeProps({
|
|
107
|
+
unstyled: true,
|
|
108
|
+
className: buttonVariants({ size: "sm" }),
|
|
109
|
+
onClick: () => {
|
|
110
|
+
run();
|
|
111
|
+
}
|
|
112
|
+
}, props),
|
|
113
|
+
"aria-label": label,
|
|
114
|
+
disabled: busy || props.disabled
|
|
115
|
+
}),
|
|
116
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {}), "Run now"] })
|
|
117
|
+
}), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
118
|
+
side: "bottom",
|
|
119
|
+
sideOffset: 6,
|
|
120
|
+
children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: tooltip })
|
|
121
|
+
}) })] });
|
|
112
122
|
}
|
|
113
123
|
/** Delete confirmation stays open on failure; only its source-scoped action can settle it. */
|
|
114
124
|
function ThinkRoutineDelete(props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ThinkRoutine } from "../../ThinkRoutine-
|
|
1
|
+
import { t as ThinkRoutine } from "../../ThinkRoutine-DoZjbzyn.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
//#region src/components/agents-sdk/ThinkRoutineBrowser.d.ts
|
|
4
4
|
export type ThinkRoutineFilter = "all" | "active" | "paused";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { B as PlusIcon } from "../../icons-
|
|
2
|
+
import { B as PlusIcon } from "../../icons-DvlrWt54.js";
|
|
3
3
|
import { buttonVariants } from "../foundations/Button.js";
|
|
4
4
|
import { Tooltip } from "../foundations/Tooltip.js";
|
|
5
5
|
import { t as capitalize } from "../../format-CWaZEp5o.js";
|
|
6
|
-
import { EmptyState } from "../foundations/EmptyState.js";
|
|
7
6
|
import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
7
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
8
8
|
import { SearchField } from "../foundations/SearchField.js";
|
|
9
9
|
import { ToggleGroup } from "../foundations/ToggleGroup.js";
|
|
10
10
|
import { getThinkRoutineNextRun } from "./ThinkRoutine.js";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as WorkspaceExecution } from "../../WorkspaceExecutionTable-DNhj6YDX.js";
|
|
2
|
+
import { r as ThinkRoutineRunOf, t as ThinkRoutine } from "../../ThinkRoutine-DoZjbzyn.js";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
//#region src/components/agents-sdk/ThinkRoutineDetail.d.ts
|
|
4
5
|
export interface ThinkRoutineDetailProps<TRoutine extends ThinkRoutine = ThinkRoutine> extends React.HTMLAttributes<HTMLElement> {
|
|
5
6
|
routine: TRoutine;
|
|
7
|
+
/** Saved workflow metadata, including friendly input labels. */
|
|
8
|
+
script?: WorkspaceExecution;
|
|
6
9
|
busy?: boolean;
|
|
7
10
|
showOwner?: boolean;
|
|
8
11
|
onEnabledChange?: (enabled: boolean) => void;
|
|
@@ -10,7 +13,7 @@ export interface ThinkRoutineDetailProps<TRoutine extends ThinkRoutine = ThinkRo
|
|
|
10
13
|
renderRunLink?: (run: ThinkRoutineRunOf<TRoutine>) => React.ReactElement;
|
|
11
14
|
}
|
|
12
15
|
/** Readable definition, schedule settings, and recent executions for one routine. */
|
|
13
|
-
export declare function ThinkRoutineDetail<TRoutine extends ThinkRoutine = ThinkRoutine>({ busy, className, routine, showOwner, onEnabledChange, renderRunLink, ref, ...props }: ThinkRoutineDetailProps<TRoutine> & {
|
|
16
|
+
export declare function ThinkRoutineDetail<TRoutine extends ThinkRoutine = ThinkRoutine>({ busy, className, routine, script, showOwner, onEnabledChange, renderRunLink, ref, ...props }: ThinkRoutineDetailProps<TRoutine> & {
|
|
14
17
|
ref?: React.Ref<HTMLElement>;
|
|
15
18
|
}): React.JSX.Element;
|
|
16
19
|
//#endregion
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
+
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
3
|
+
import { t as ExecutionResult } from "../../ExecutionResult-BSZsUbrL.js";
|
|
2
4
|
import { getThinkRoutineNextRun } from "./ThinkRoutine.js";
|
|
3
5
|
import { Switch } from "../foundations/Switch.js";
|
|
4
6
|
import { ThinkRoutineRuns } from "./ThinkRoutineRuns.js";
|
|
5
7
|
import * as React from "react";
|
|
6
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
9
|
//#region src/components/agents-sdk/ThinkRoutineDetail.tsx
|
|
8
|
-
function taskInstructions(routine) {
|
|
9
|
-
return typeof routine.task.prompt === "string" ? routine.task.prompt : "Runs an app-defined scheduled handler.";
|
|
10
|
-
}
|
|
11
10
|
/** Readable definition, schedule settings, and recent executions for one routine. */
|
|
12
|
-
function ThinkRoutineDetail({ busy = false, className, routine, showOwner = true, onEnabledChange, renderRunLink, ref, ...props }) {
|
|
11
|
+
function ThinkRoutineDetail({ busy = false, className, routine, script, showOwner = true, onEnabledChange, renderRunLink, ref, ...props }) {
|
|
13
12
|
const titleId = React.useId();
|
|
14
13
|
const definitionId = React.useId();
|
|
15
14
|
const settingsId = React.useId();
|
|
@@ -39,11 +38,18 @@ function ThinkRoutineDetail({ busy = false, className, routine, showOwner = true
|
|
|
39
38
|
className: "think-routine__section-heading",
|
|
40
39
|
children: /* @__PURE__ */ jsx("h2", {
|
|
41
40
|
id: definitionId,
|
|
42
|
-
children: "Instructions"
|
|
41
|
+
children: "script" in routine.task ? script?.name ?? "Saved workflow" : "Instructions"
|
|
43
42
|
})
|
|
44
|
-
}), /* @__PURE__ */ jsx(
|
|
43
|
+
}), "script" in routine.task ? /* @__PURE__ */ jsx(DescriptionList.Root, {
|
|
44
|
+
align: "start",
|
|
45
|
+
variant: "divided",
|
|
46
|
+
children: Object.entries(routine.task.script.args ?? {}).map(([name, value]) => /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: script?.parameters.find((parameter) => parameter.name === name)?.label ?? name.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ") }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx(ExecutionResult, {
|
|
47
|
+
result: value,
|
|
48
|
+
showSummary: false
|
|
49
|
+
}) })] }, name))
|
|
50
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
45
51
|
className: "think-routine__instructions",
|
|
46
|
-
children:
|
|
52
|
+
children: typeof routine.task.prompt === "string" ? routine.task.prompt : "Runs an app-defined scheduled handler."
|
|
47
53
|
})]
|
|
48
54
|
}), /* @__PURE__ */ jsxs("aside", {
|
|
49
55
|
className: "think-routine__settings",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { p as WorkspaceExecution } from "../../WorkspaceExecutionTable-DNhj6YDX.js";
|
|
2
|
+
import { i as ThinkRoutineScript } from "../../ThinkRoutine-DoZjbzyn.js";
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { ThinkScheduledTaskSchedule } from "@cloudflare/think";
|
|
3
5
|
//#region src/components/agents-sdk/ThinkRoutineForm.d.ts
|
|
@@ -17,25 +19,40 @@ export interface ThinkRoutineFormRoutine {
|
|
|
17
19
|
name: string;
|
|
18
20
|
task: {
|
|
19
21
|
prompt: string;
|
|
22
|
+
} | {
|
|
23
|
+
script: ThinkRoutineScript;
|
|
20
24
|
};
|
|
21
25
|
parsedSchedule: ThinkRoutineFormSchedule;
|
|
22
26
|
}
|
|
23
27
|
/** Prompt routine draft emitted by the routine form. */
|
|
24
|
-
export
|
|
28
|
+
export type ThinkRoutineFormValue = {
|
|
25
29
|
name: string;
|
|
26
|
-
prompt: string;
|
|
27
30
|
schedule: ThinkScheduledTaskSchedule;
|
|
28
|
-
}
|
|
31
|
+
} & ({
|
|
32
|
+
prompt: string;
|
|
33
|
+
} | {
|
|
34
|
+
script: ThinkRoutineScript;
|
|
35
|
+
});
|
|
29
36
|
export interface ThinkRoutineFormProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSubmit"> {
|
|
30
37
|
/** Existing routine projected through Think's schedule parser. Omit when creating. */
|
|
31
38
|
routine?: ThinkRoutineFormRoutine;
|
|
32
|
-
/**
|
|
39
|
+
/** Selects a saved workflow when creating a schedule. Existing routines take precedence. */
|
|
40
|
+
initialScript?: ThinkRoutineScript;
|
|
41
|
+
/** Saved workflows with the same input metadata used by the execution board. */
|
|
42
|
+
scripts?: readonly WorkspaceExecution[];
|
|
43
|
+
/** Keeps the workflow chooser unavailable while its catalog loads. */
|
|
44
|
+
scriptsLoading?: boolean;
|
|
45
|
+
/** Readable catalog loading failure; existing schedule values remain available. */
|
|
46
|
+
scriptsError?: string;
|
|
47
|
+
/** App-authored link back to the schedule or workflow that opened this form. */
|
|
33
48
|
cancelLink?: React.ReactElement;
|
|
49
|
+
/** Accessible name for the back link, matching its actual destination. */
|
|
50
|
+
cancelLabel?: string;
|
|
34
51
|
/** Receives the validated routine fields when the user creates or updates the schedule. */
|
|
35
52
|
onSubmit: (value: ThinkRoutineFormValue) => void | Promise<void>;
|
|
36
53
|
}
|
|
37
|
-
/**
|
|
38
|
-
export declare function ThinkRoutineForm({ cancelLink, className, routine, onSubmit, ref, ...props }: ThinkRoutineFormProps & {
|
|
54
|
+
/** Create/edit surface for scheduled instructions or a saved workflow. */
|
|
55
|
+
export declare function ThinkRoutineForm({ cancelLink, cancelLabel, className, routine, initialScript, scripts, scriptsLoading, scriptsError, onSubmit, ref, ...props }: ThinkRoutineFormProps & {
|
|
39
56
|
/** Ref forwarded to the component's rendered root element. */
|
|
40
57
|
ref?: React.Ref<HTMLDivElement>;
|
|
41
58
|
}): React.JSX.Element;
|