@mcp-b/react-components 0.48.0 → 0.49.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/AgentChatQueue-C_Jaw3Ia.d.ts +48 -0
- package/dist/AgentToolRunsContext-GMe_hSnD.d.ts +35 -0
- package/dist/Avatar-o2NO1fCG.d.ts +124 -0
- package/dist/{Button-CZt3yywF.d.ts → Button-DjONW5UW.d.ts} +1 -1
- package/dist/{CodeBlock-C380GD5t.d.ts → CodeBlock--r6GS8YV.d.ts} +8 -2
- package/dist/{CodeBlock-BSJl682D.js → CodeBlock-g8sADidM.js} +8 -8
- package/dist/{FileTree-DvE0hNZu.js → FileTree-H8mMg4rV.js} +21 -30
- package/dist/{IconButton-BAUFhUk8.d.ts → IconButton-ByiyjkYE.d.ts} +2 -2
- package/dist/{Message-D_vCVEGB.d.ts → Message-DyaTBiV7.d.ts} +17 -4
- package/dist/MessageScrollerVirtual-D4afYwVB.d.ts +84 -0
- package/dist/{PromptInput-DtJHyp0S.d.ts → PromptInput-C4Mofitz.d.ts} +44 -31
- package/dist/PromptInputApproval-D2hpn54U.d.ts +44 -0
- package/dist/Separator-CzhtLYE1.d.ts +41 -0
- package/dist/Toolbar-CGY004u0.d.ts +155 -0
- package/dist/{Workspace-LIoU30n7.d.ts → Workspace-HzGrWDX3.d.ts} +1 -1
- package/dist/{WorkspaceFile-Dq-GC0_T.d.ts → WorkspaceFile-Bouauobc.d.ts} +1 -1
- package/dist/{WorkspaceFileView-C_WnYm-a.js → WorkspaceFileView-DYPtRVpM.js} +5 -4
- package/dist/{WorkspaceLink-B1d2GIGl.js → WorkspaceLink-BYZG-V_I.js} +8 -91
- package/dist/{WorkspaceMessageResponse-BqOezptB.js → WorkspaceMessageResponse-CUJk9_P5.js} +2 -2
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.d.ts +198 -2
- package/dist/components/agents-sdk/AgentChat.js +527 -672
- package/dist/components/agents-sdk/AgentChatQueue.d.ts +2 -0
- package/dist/components/agents-sdk/AgentChatQueue.js +206 -0
- package/dist/components/agents-sdk/AgentEvent.js +2 -2
- package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
- package/dist/components/agents-sdk/AgentToolRunsContext.js +1 -36
- package/dist/components/agents-sdk/BrowserLiveScreen.js +22 -14
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.d.ts +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.d.ts +3 -0
- package/dist/components/agents-sdk/BrowserRunPanel.js +32 -31
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +212 -0
- package/dist/components/agents-sdk/EmployeeChrome.js +555 -0
- package/dist/components/agents-sdk/ManagerOffice.d.ts +79 -40
- package/dist/components/agents-sdk/ManagerOffice.js +291 -281
- package/dist/components/agents-sdk/McpConnectionRequest.d.ts +4 -4
- package/dist/components/agents-sdk/McpConnectionRequest.js +4 -3
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +38 -1
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +93 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +5 -4
- package/dist/components/agents-sdk/McpServerIcon.d.ts +17 -0
- package/dist/components/agents-sdk/McpServerIcon.js +25 -0
- package/dist/components/agents-sdk/McpServerPicker.d.ts +4 -3
- package/dist/components/agents-sdk/McpServerPicker.js +4 -3
- package/dist/components/agents-sdk/ModelSelector.d.ts +4 -4
- package/dist/components/agents-sdk/ModelSelector.js +4 -4
- package/dist/components/agents-sdk/PromptInputApproval.d.ts +1 -43
- package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +2 -3
- package/dist/components/agents-sdk/SessionCompaction.d.ts +88 -1
- package/dist/components/agents-sdk/SessionCompaction.js +2 -2
- package/dist/components/agents-sdk/SubagentRunDetails.d.ts +30 -1
- package/dist/components/agents-sdk/SubagentRunDetails.js +57 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +9 -9
- package/dist/components/agents-sdk/SubagentRunIndicator.js +19 -24
- package/dist/components/agents-sdk/SubagentRunList.d.ts +6 -3
- package/dist/components/agents-sdk/SubagentRunList.js +4 -2
- package/dist/components/agents-sdk/SubagentRunPanel.d.ts +60 -0
- package/dist/components/agents-sdk/SubagentRunPanel.js +255 -0
- package/dist/components/agents-sdk/SubagentRunSelector.d.ts +8 -4
- package/dist/components/agents-sdk/SubagentRunSelector.js +5 -3
- package/dist/components/agents-sdk/ThinkChat.d.ts +102 -2
- package/dist/components/agents-sdk/ThinkChat.js +233 -2
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +76 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +18 -10
- package/dist/components/agents-sdk/ThinkChatContext.d.ts +27 -1
- package/dist/components/agents-sdk/ThinkChatContext.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +24 -19
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +85 -28
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +159 -102
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +40 -158
- package/dist/components/agents-sdk/ThinkFullApp.js +71 -290
- package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +18 -1
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +51 -0
- package/dist/components/agents-sdk/ThinkRoutineActions.js +201 -0
- package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +4 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +17 -15
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +11 -11
- package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +2 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +14 -14
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +7 -7
- package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +90 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
- package/dist/components/agents-sdk/Workspace.d.ts +1 -1
- package/dist/components/agents-sdk/Workspace.js +7 -13
- 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 +1 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +10 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +10 -7
- package/dist/components/agents-sdk/WorkspaceExecution.d.ts +5 -14
- package/dist/components/agents-sdk/WorkspaceExecution.js +24 -38
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +5 -2
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -2
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +60 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +47 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.d.ts +3 -2
- package/dist/components/agents-sdk/WorkspaceMountManager.js +6 -9
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +38 -0
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +86 -0
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +5 -14
- package/dist/components/agents-sdk/WorkspaceProject.js +21 -35
- package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceUserScript.js +8 -5
- package/dist/components/ai-sdk/Activity.d.ts +1 -1
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentAttention.d.ts +2 -2
- package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +89 -2
- package/dist/components/ai-sdk/AgentChatStartScreen.js +64 -43
- package/dist/components/ai-sdk/AgentMessageParts.d.ts +45 -1
- package/dist/components/ai-sdk/Approval.d.ts +1 -1
- package/dist/components/ai-sdk/Approval.js +2 -2
- package/dist/components/ai-sdk/Artifact.d.ts +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 +2 -3
- package/dist/components/ai-sdk/ConnectedAppCards.d.ts +9 -1
- package/dist/components/ai-sdk/ConnectedAppCards.js +28 -21
- package/dist/components/ai-sdk/Context.d.ts +7 -3
- package/dist/components/ai-sdk/Context.js +7 -17
- package/dist/components/ai-sdk/Conversation.d.ts +2 -2
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.d.ts +3 -3
- package/dist/components/ai-sdk/Goal.js +3 -3
- package/dist/components/ai-sdk/InlineCitation.d.ts +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.d.ts +2 -2
- package/dist/components/ai-sdk/Message.js +12 -3
- package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +2 -76
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +39 -5
- package/dist/components/ai-sdk/Plan.d.ts +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
- package/dist/components/ai-sdk/PromptInput.js +175 -231
- package/dist/components/ai-sdk/PromptInputComposerEditor.js +32 -9
- package/dist/components/ai-sdk/Queue.d.ts +28 -5
- package/dist/components/ai-sdk/Queue.js +20 -5
- package/dist/components/ai-sdk/Reasoning.d.ts +1 -1
- package/dist/components/ai-sdk/Reasoning.js +5 -5
- package/dist/components/ai-sdk/Sources.d.ts +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.d.ts +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +1 -1
- package/dist/components/extension/CodexModelSelector.d.ts +5 -0
- package/dist/components/extension/CodexModelSelector.js +2 -2
- package/dist/components/extension/ConversationTabPicker.d.ts +1 -0
- package/dist/components/extension/ConversationTabPicker.js +2 -2
- package/dist/components/foundations/AlertDialog.d.ts +1 -1
- package/dist/components/foundations/AppIcon.d.ts +3 -2
- package/dist/components/foundations/Autocomplete.js +6 -1
- package/dist/components/foundations/Avatar.d.ts +1 -121
- package/dist/components/foundations/Button.d.ts +1 -1
- package/dist/components/foundations/Card.d.ts +22 -27
- package/dist/components/foundations/Card.js +51 -32
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/CheckboxGroup.d.ts +1 -1
- package/dist/components/foundations/Collapsible.d.ts +1 -1
- package/dist/components/foundations/Collapsible.js +1 -1
- package/dist/components/foundations/Combobox.js +6 -1
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/Dialog.d.ts +106 -1
- package/dist/components/foundations/EmptyState.d.ts +1 -1
- package/dist/components/foundations/Field.d.ts +2 -1
- package/dist/components/foundations/Fieldset.d.ts +1 -1
- package/dist/components/foundations/Form.d.ts +4 -4
- package/dist/components/foundations/IconButton.d.ts +1 -1
- package/dist/components/foundations/Label.d.ts +1 -1
- package/dist/components/foundations/LinkButton.d.ts +2 -2
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/Meter.d.ts +1 -1
- package/dist/components/foundations/NumberField.d.ts +1 -1
- package/dist/components/foundations/ScrollArea.d.ts +1 -1
- package/dist/components/foundations/SearchField.d.ts +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +7 -2
- package/dist/components/foundations/Separator.d.ts +1 -40
- package/dist/components/foundations/Stepper.d.ts +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Textarea.d.ts +1 -1
- package/dist/components/foundations/Toast.d.ts +5 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/Toggle.d.ts +70 -1
- package/dist/components/foundations/ToggleGroup.d.ts +4 -3
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/foundations/Toolbar.d.ts +1 -151
- package/dist/components/foundations/TransitionSurface.d.ts +1 -1
- package/dist/components/foundations/icons.js +1 -1
- package/dist/components/general-purpose/ActionGuide.d.ts +10 -26
- package/dist/components/general-purpose/ActionGuide.js +4 -18
- package/dist/components/general-purpose/AppTopBar.d.ts +4 -2
- package/dist/components/general-purpose/Commit.d.ts +2 -2
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.d.ts +1 -7
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.d.ts +4 -0
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- package/dist/components/general-purpose/ResizableSidePanel.d.ts +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +128 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +120 -102
- package/dist/components/general-purpose/SettingsFormDialog.d.ts +14 -27
- package/dist/components/general-purpose/SettingsFormDialog.js +42 -72
- package/dist/components/general-purpose/SetupChecklist.d.ts +1 -0
- package/dist/components/general-purpose/SetupChecklist.js +76 -1
- package/dist/components/general-purpose/Terminal.d.ts +3 -3
- package/dist/components/general-purpose/Terminal.js +11 -6
- package/dist/components/general-purpose/TestResults.d.ts +23 -11
- package/dist/components/general-purpose/TestResults.js +49 -51
- package/dist/components/general-purpose/ThemeModeControl.d.ts +2 -0
- package/dist/components/general-purpose/ThemeModeControl.js +2 -2
- package/dist/components/general-purpose/WebPreview.d.ts +29 -4
- package/dist/components/general-purpose/WebPreview.js +39 -14
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +13 -11
- package/dist/components/nanites/AgentToolDetail.js +21 -42
- package/dist/{copy-button-Dk2vRe9j.js → copy-button-CSDuDfdP.js} +1 -1
- package/dist/{copy-button-C0JyjClr.d.ts → copy-button-OUwOdgEm.d.ts} +1 -1
- package/dist/mcp-server-mAErsxHU.js +27 -0
- package/dist/styles/activity.css +1 -96
- package/dist/styles/agent-chat.css +75 -102
- package/dist/styles/agent-tool-detail.css +0 -16
- package/dist/styles/base.css +1 -1
- package/dist/styles/browser-run-panel.css +1 -15
- package/dist/styles/button.css +7 -1
- package/dist/styles/code-block.css +12 -0
- package/dist/styles/composition-motion.css +0 -2
- package/dist/styles/employee-chrome.css +43 -0
- package/dist/styles/file-tree.css +5 -0
- package/dist/styles/index.css +4 -2
- package/dist/styles/message.css +2 -10
- package/dist/styles/queue.css +71 -0
- package/dist/styles/subagent-run.css +122 -6
- package/dist/styles/test-results.css +2 -5
- package/dist/styles/think-chat-activity.css +13 -0
- package/dist/styles/think-chat-tool-panels.css +81 -0
- package/dist/styles/think-execution-workbench.css +2 -8
- package/dist/styles/think-full-app.css +42 -251
- package/dist/styles/{think-routine-library.css → think-routine.css} +64 -80
- package/dist/styles/web-preview.css +15 -1
- package/dist/utils/mcp-server-catalog.d.ts +1112 -2
- package/dist/utils/mcp-server-catalog.js +28 -9
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/{workspace-assets-GqsCYxqT.js → workspace-assets-Bg7XhPsk.js} +2 -2
- package/package.json +7 -3
- package/dist/AgentChat-BLmQghkt.d.ts +0 -327
- package/dist/AgentChatStartScreen-Bkv7Avni.d.ts +0 -84
- package/dist/AgentMessageParts-C7L-Mv9U.d.ts +0 -46
- package/dist/AgentToolRunsContext-jtmveaRE.d.ts +0 -57
- package/dist/Dialog-B_FhRWaz.d.ts +0 -107
- package/dist/McpConnectorForm-CeYNY0MI.d.ts +0 -39
- package/dist/McpPluginCatalog-3qWu8oK1.d.ts +0 -92
- package/dist/ResponsiveSidebarShell-BTVPxLJK.d.ts +0 -123
- package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
- package/dist/SetupChecklist-DeTU9YpW.js +0 -77
- package/dist/ThinkChat-CwMdEum8.d.ts +0 -185
- package/dist/ThinkChat-DiI6hhDP.js +0 -332
- package/dist/ThinkChatActivity-B3lGVS-6.d.ts +0 -77
- package/dist/ThinkChatContext-COIgzkYp.d.ts +0 -28
- package/dist/ThinkRecoveryNotice-DGWr94rk.d.ts +0 -19
- package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +0 -91
- package/dist/Toggle-DLrIf5YH.d.ts +0 -69
- package/dist/WorkspaceLive-DfjH1Ypm.d.ts +0 -61
- package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +0 -48
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +0 -31
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +0 -34
- package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +0 -80
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +0 -159
- package/dist/components/agents-sdk/ThinkSidepanel.d.ts +0 -200
- package/dist/components/agents-sdk/ThinkSidepanel.js +0 -775
- package/dist/mcp-server-7NR24ASj.js +0 -69
- package/dist/mcp-server-catalog-C_g7C-9o.d.ts +0 -1108
- package/dist/styles/think-sidepanel.css +0 -78
- package/dist/think-agent-Cip5KAPj.d.ts +0 -7
- package/dist/{icons-CeGfXO21.js → icons-cuEtsgj9.js} +1 -1
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/components/agents-sdk/ThinkThreadPicker.d.ts
|
|
4
|
-
interface ThinkThreadItem {
|
|
5
|
-
/** Stable child-agent/thread id used by the app-authored link's route params. */
|
|
6
|
-
id: string;
|
|
7
|
-
/** Human-readable thread title, usually generated by the parent Think agent. */
|
|
8
|
-
title: string;
|
|
9
|
-
/** Optional parent-owned preview for apps that render their own richer sidebar. */
|
|
10
|
-
lastMessagePreview?: string;
|
|
11
|
-
/** Timestamp from the parent registry or metadata row. `updatedAt` wins over `createdAt`. */
|
|
12
|
-
createdAt?: Date | number;
|
|
13
|
-
/** Timestamp from parent-owned thread metadata when available. */
|
|
14
|
-
updatedAt?: Date | number;
|
|
15
|
-
/** Preformatted timestamp label when the app already has one, such as "14m". */
|
|
16
|
-
updatedAtLabel?: string;
|
|
17
|
-
/** Optional upstream/app status string. The picker only displays it; it does not derive it. */
|
|
18
|
-
status?: string;
|
|
19
|
-
/** Human label for `status` when the raw upstream value is not user-facing. */
|
|
20
|
-
statusLabel?: string;
|
|
21
|
-
}
|
|
22
|
-
interface ThinkThreadStatusSummary {
|
|
23
|
-
/** Threads currently processing a turn. */
|
|
24
|
-
running: number;
|
|
25
|
-
/** Completed or interrupted background threads that have not been reviewed. */
|
|
26
|
-
attention: number;
|
|
27
|
-
/** Threads whose latest turn failed. */
|
|
28
|
-
failed: number;
|
|
29
|
-
}
|
|
30
|
-
interface ThinkThreadStatusIndicatorsProps {
|
|
31
|
-
summary: ThinkThreadStatusSummary;
|
|
32
|
-
className?: string;
|
|
33
|
-
}
|
|
34
|
-
interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect" | "title"> {
|
|
35
|
-
/** Threads from the parent agent, already sorted in the order the app wants to show. */
|
|
36
|
-
threads: readonly ThinkThreadItem[];
|
|
37
|
-
/**
|
|
38
|
-
* Renders the application-owned TanStack Router Link for a thread.
|
|
39
|
-
*
|
|
40
|
-
* Put `to`, `params`, `search`, and active state on this element so they stay
|
|
41
|
-
* inferred from the consuming application's registered route tree.
|
|
42
|
-
*/
|
|
43
|
-
renderThreadLink: (thread: ThinkThreadItem) => React.ReactElement;
|
|
44
|
-
/**
|
|
45
|
-
* App-authored TanStack Router Link to the new-thread screen. A thread
|
|
46
|
-
* created on click is an empty thread until someone writes in it.
|
|
47
|
-
*/
|
|
48
|
-
createThreadLink?: React.ReactElement;
|
|
49
|
-
/**
|
|
50
|
-
* Notified on unmodified primary activation. The link still navigates — the
|
|
51
|
-
* route is the selection — so this is for side effects such as closing a
|
|
52
|
-
* compact drawer, never for performing the selection itself.
|
|
53
|
-
*/
|
|
54
|
-
onSelect?: (thread: ThinkThreadItem) => void;
|
|
55
|
-
/** Optional parent-agent delete action, usually `parent.stub.deleteThread(thread.id)`. */
|
|
56
|
-
onDelete?: (thread: ThinkThreadItem) => void | Promise<void>;
|
|
57
|
-
/** Visible heading for the roster. */
|
|
58
|
-
title?: React.ReactNode;
|
|
59
|
-
/** Accessible label for the list navigation. */
|
|
60
|
-
"aria-label"?: string;
|
|
61
|
-
}
|
|
62
|
-
declare function summarizeThinkThreads(threads: readonly Pick<ThinkThreadItem, "status">[]): ThinkThreadStatusSummary;
|
|
63
|
-
declare function ThinkThreadStatusIndicators({
|
|
64
|
-
summary,
|
|
65
|
-
className
|
|
66
|
-
}: ThinkThreadStatusIndicatorsProps): React.JSX.Element | null;
|
|
67
|
-
/**
|
|
68
|
-
* Thread roster UI for sub-agent chat apps.
|
|
69
|
-
*
|
|
70
|
-
* This component does not call Think or Cloudflare RPC methods directly. Feed
|
|
71
|
-
* it from the parent agent's roster method, then render app-owned route links
|
|
72
|
-
* that select the child `useAgent({ sub: [...] })` name. Keep backend contract
|
|
73
|
-
* notes beside the parent Think agent because
|
|
74
|
-
* `listThreads()`/`createThread()`/`deleteThread()` are app-owned.
|
|
75
|
-
*/
|
|
76
|
-
declare function ThinkThreadPicker({
|
|
77
|
-
threads,
|
|
78
|
-
renderThreadLink,
|
|
79
|
-
createThreadLink,
|
|
80
|
-
onSelect,
|
|
81
|
-
onDelete,
|
|
82
|
-
className,
|
|
83
|
-
title,
|
|
84
|
-
"aria-label": ariaLabel,
|
|
85
|
-
ref,
|
|
86
|
-
...props
|
|
87
|
-
}: ThinkThreadPickerProps & {
|
|
88
|
-
ref?: React.Ref<HTMLElement>;
|
|
89
|
-
}): React.JSX.Element;
|
|
90
|
-
//#endregion
|
|
91
|
-
export { ThinkThreadStatusIndicatorsProps as a, ThinkThreadStatusIndicators as i, ThinkThreadPicker as n, ThinkThreadStatusSummary as o, ThinkThreadPickerProps as r, summarizeThinkThreads as s, ThinkThreadItem as t };
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Toggle } from "@base-ui/react/toggle";
|
|
3
|
-
|
|
4
|
-
//#region src/components/foundations/Toggle.d.ts
|
|
5
|
-
interface ToggleVariantsOptions {
|
|
6
|
-
variant?: "default" | "outline" | null;
|
|
7
|
-
size?: "sm" | "md" | "lg" | null;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Props for the Toggle component.
|
|
12
|
-
*/
|
|
13
|
-
interface ToggleProps extends React.ComponentPropsWithoutRef<typeof Toggle>, Omit<ToggleVariantsOptions, "className"> {}
|
|
14
|
-
declare function toggleVariants({
|
|
15
|
-
variant,
|
|
16
|
-
size,
|
|
17
|
-
className
|
|
18
|
-
}?: ToggleVariantsOptions): string;
|
|
19
|
-
/**
|
|
20
|
-
* A two-state button that can be on (pressed) or off.
|
|
21
|
-
* Useful for toggling a setting or mode.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```tsx
|
|
25
|
-
* // Basic toggle
|
|
26
|
-
* <Toggle>
|
|
27
|
-
* Bold
|
|
28
|
-
* </Toggle>
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* // Controlled toggle
|
|
34
|
-
* const [pressed, setPressed] = useState(false);
|
|
35
|
-
*
|
|
36
|
-
* <Toggle pressed={pressed} onPressedChange={setPressed}>
|
|
37
|
-
* {pressed ? 'On' : 'Off'}
|
|
38
|
-
* </Toggle>
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```tsx
|
|
43
|
-
* // With icons
|
|
44
|
-
* <Toggle>
|
|
45
|
-
* {({ pressed }) => pressed ? <BoldIcon filled /> : <BoldIcon />}
|
|
46
|
-
* </Toggle>
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```tsx
|
|
51
|
-
* // Default pressed state
|
|
52
|
-
* <Toggle defaultPressed>
|
|
53
|
-
* Enabled
|
|
54
|
-
* </Toggle>
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @see {@link https://base-ui.com/react/components/toggle | Base UI Toggle}
|
|
58
|
-
*/
|
|
59
|
-
declare function Toggle$1({
|
|
60
|
-
className,
|
|
61
|
-
variant,
|
|
62
|
-
size,
|
|
63
|
-
ref,
|
|
64
|
-
...props
|
|
65
|
-
}: ToggleProps & {
|
|
66
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
67
|
-
}): React.JSX.Element;
|
|
68
|
-
//#endregion
|
|
69
|
-
export { toggleVariants as i, ToggleProps as n, ToggleVariantsOptions as r, Toggle$1 as t };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { r as WorkspaceFileAssetResolver } from "./WorkspaceFile-Dq-GC0_T.js";
|
|
2
|
-
import { y as WorkspaceSource } from "./Workspace-LIoU30n7.js";
|
|
3
|
-
import { QueryClient } from "@tanstack/react-query";
|
|
4
|
-
|
|
5
|
-
//#region src/components/agents-sdk/WorkspaceLive.d.ts
|
|
6
|
-
type WorkspaceChange = {
|
|
7
|
-
type: "changed";
|
|
8
|
-
path: string;
|
|
9
|
-
movedFrom?: string;
|
|
10
|
-
} | {
|
|
11
|
-
type: "unknown";
|
|
12
|
-
};
|
|
13
|
-
/** Host adapter for a native workspace observer. */
|
|
14
|
-
interface WorkspaceChangeSource {
|
|
15
|
-
start?(): void | Promise<void>;
|
|
16
|
-
subscribe(listener: (change: WorkspaceChange) => void): () => void;
|
|
17
|
-
}
|
|
18
|
-
declare function invalidateWorkspaceDirectories(queryClient: QueryClient, sourceKey: string, directories: Iterable<string>, root: string): void;
|
|
19
|
-
interface UseWorkspaceLiveQueriesOptions {
|
|
20
|
-
/** Native observer adapter. Omit for hosts without workspace observation. */
|
|
21
|
-
changes?: WorkspaceChangeSource;
|
|
22
|
-
sourceKey: string | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* The host's workspace boundary. Required, and the same value the concept
|
|
25
|
-
* options were built with: invalidation is prefix-matched on it, so a root
|
|
26
|
-
* that disagrees with the queries silently invalidates nothing.
|
|
27
|
-
*/
|
|
28
|
-
root: string;
|
|
29
|
-
/** Workspace read adapter used to refresh an observed open file in order. */
|
|
30
|
-
source?: WorkspaceSource;
|
|
31
|
-
/** Route-owned open file. Omit or pass null when Files has no selection. */
|
|
32
|
-
selectedPath?: string | null;
|
|
33
|
-
resolveFileAsset?: WorkspaceFileAssetResolver;
|
|
34
|
-
maxInlineAssetBytes?: number;
|
|
35
|
-
/**
|
|
36
|
-
* Disposable freshness tick for hosts without native observation — for
|
|
37
|
-
* example a serialization of settled-turn state. Every change of a defined
|
|
38
|
-
* value invalidates the source's concept queries. It never enters query
|
|
39
|
-
* identity, so data, mutation state, and form drafts survive the refresh.
|
|
40
|
-
*/
|
|
41
|
-
revision?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Synchronize external workspace freshness with the design system's Query
|
|
45
|
-
* resources. This is the one external-system effect: native observer events
|
|
46
|
-
* and host revision ticks both land here as targeted invalidation against
|
|
47
|
-
* stable query keys. Hosts only supply events; neither layer adds another
|
|
48
|
-
* watcher.
|
|
49
|
-
*/
|
|
50
|
-
declare function useWorkspaceLiveQueries({
|
|
51
|
-
changes,
|
|
52
|
-
maxInlineAssetBytes,
|
|
53
|
-
resolveFileAsset,
|
|
54
|
-
selectedPath,
|
|
55
|
-
source,
|
|
56
|
-
sourceKey,
|
|
57
|
-
root,
|
|
58
|
-
revision
|
|
59
|
-
}: UseWorkspaceLiveQueriesOptions): void;
|
|
60
|
-
//#endregion
|
|
61
|
-
export { useWorkspaceLiveQueries as a, invalidateWorkspaceDirectories as i, WorkspaceChange as n, WorkspaceChangeSource as r, UseWorkspaceLiveQueriesOptions as t };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { E as MessageResponseProps } from "./Message-D_vCVEGB.js";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/agents-sdk/WorkspaceMessageResponse.d.ts
|
|
5
|
-
interface WorkspaceFileRenderInput {
|
|
6
|
-
label: string;
|
|
7
|
-
path: string;
|
|
8
|
-
/** Shared workspace link element; hosts pass it through to the preview unchanged. */
|
|
9
|
-
sourceLink: React.ReactElement;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Host callback for one standalone workspace file link in an assistant
|
|
13
|
-
* paragraph. Return a node to replace the link, or `null` to keep it.
|
|
14
|
-
*/
|
|
15
|
-
type WorkspaceFileRenderer = (file: WorkspaceFileRenderInput) => React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Ambient workspace-file renderer for every `WorkspaceMessageResponse` below,
|
|
18
|
-
* and the only way to supply one. The value is read inside the promoted
|
|
19
|
-
* paragraph, not by the response component, so a host handing down a fresh
|
|
20
|
-
* callback every render re-renders only the paragraphs — the memoized Markdown
|
|
21
|
-
* pipeline is untouched and promoted cards keep their state.
|
|
22
|
-
* `ThinkChat.Messages` provides it from its `renderWorkspaceFile` prop; hosts
|
|
23
|
-
* composing `WorkspaceMessageResponse` directly provide it once at their
|
|
24
|
-
* conversation root.
|
|
25
|
-
*/
|
|
26
|
-
declare function WorkspaceFileRendererProvider({
|
|
27
|
-
children,
|
|
28
|
-
renderWorkspaceFile
|
|
29
|
-
}: {
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
renderWorkspaceFile: WorkspaceFileRenderer | undefined;
|
|
32
|
-
}): React.JSX.Element;
|
|
33
|
-
interface WorkspaceMessageResponseProps extends MessageResponseProps {
|
|
34
|
-
/**
|
|
35
|
-
* Whether standalone workspace file links may be promoted. `ThinkChat`
|
|
36
|
-
* passes `false` for user messages: user links remain ordinary navigation.
|
|
37
|
-
*/
|
|
38
|
-
promoteWorkspaceFiles?: boolean;
|
|
39
|
-
}
|
|
40
|
-
/** Adds workspace-aware Markdown links when rendered inside a workspace provider. */
|
|
41
|
-
declare const WorkspaceMessageResponse: React.MemoExoticComponent<({
|
|
42
|
-
components,
|
|
43
|
-
rehypePlugins,
|
|
44
|
-
promoteWorkspaceFiles,
|
|
45
|
-
...props
|
|
46
|
-
}: WorkspaceMessageResponseProps) => React.JSX.Element>;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { WorkspaceMessageResponseProps as a, WorkspaceMessageResponse as i, WorkspaceFileRenderer as n, WorkspaceFileRendererProvider as r, WorkspaceFileRenderInput as t };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ToggleGroupProps } from "../foundations/ToggleGroup.js";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/agents-sdk/ThinkFullAppViewSwitch.d.ts
|
|
5
|
-
interface ThinkFullAppView {
|
|
6
|
-
id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
icon: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
interface ThinkFullAppViewSwitchProps extends Omit<ToggleGroupProps, "children" | "onValueChange" | "value"> {
|
|
11
|
-
views: readonly ThinkFullAppView[];
|
|
12
|
-
value?: string;
|
|
13
|
-
/** Whether pressing the selected view may clear the selection. */
|
|
14
|
-
allowEmpty?: boolean;
|
|
15
|
-
onValueChange: (value: string | undefined, eventDetails: Parameters<NonNullable<ToggleGroupProps["onValueChange"]>>[1]) => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Icon view picker shared by ThinkFullApp's wide workbench and compact app
|
|
19
|
-
* navigation. Base UI owns selection and roving focus; AppTopBar owns the
|
|
20
|
-
* toolbar control and tooltip presentation.
|
|
21
|
-
*/
|
|
22
|
-
declare function ThinkFullAppViewSwitch({
|
|
23
|
-
allowEmpty,
|
|
24
|
-
className,
|
|
25
|
-
onValueChange,
|
|
26
|
-
value,
|
|
27
|
-
views,
|
|
28
|
-
...props
|
|
29
|
-
}: ThinkFullAppViewSwitchProps): React.JSX.Element;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { ThinkFullAppView, ThinkFullAppViewSwitch, ThinkFullAppViewSwitchProps };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { ToggleGroup } from "../foundations/ToggleGroup.js";
|
|
3
|
-
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/agents-sdk/ThinkFullAppViewSwitch.tsx
|
|
7
|
-
/**
|
|
8
|
-
* Icon view picker shared by ThinkFullApp's wide workbench and compact app
|
|
9
|
-
* navigation. Base UI owns selection and roving focus; AppTopBar owns the
|
|
10
|
-
* toolbar control and tooltip presentation.
|
|
11
|
-
*/
|
|
12
|
-
function ThinkFullAppViewSwitch({ allowEmpty = false, className, onValueChange, value, views, ...props }) {
|
|
13
|
-
return /* @__PURE__ */ jsx(ToggleGroup.Root, {
|
|
14
|
-
className: mergeBaseClassName("think-full-app__view-switch", className),
|
|
15
|
-
size: "sm",
|
|
16
|
-
value: value ? [value] : [],
|
|
17
|
-
onValueChange: (nextValue, eventDetails) => {
|
|
18
|
-
const [next] = nextValue;
|
|
19
|
-
if (next || allowEmpty) onValueChange(next, eventDetails);
|
|
20
|
-
},
|
|
21
|
-
...props,
|
|
22
|
-
children: views.map((view) => /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
23
|
-
type: "button",
|
|
24
|
-
label: view.label,
|
|
25
|
-
render: /* @__PURE__ */ jsx(ToggleGroup.Item, {
|
|
26
|
-
type: "button",
|
|
27
|
-
value: view.id
|
|
28
|
-
}),
|
|
29
|
-
children: view.icon
|
|
30
|
-
}, view.id))
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { ThinkFullAppViewSwitch };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { t as AppBarSlots } from "../../ResponsiveSidebarShell-BTVPxLJK.js";
|
|
2
|
-
import { ThinkRoutine, ThinkRoutineRunOf } from "./ThinkRoutine.js";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
//#region src/components/agents-sdk/ThinkRoutineLibrary.d.ts
|
|
6
|
-
interface ThinkRoutineLibraryDetailRenderProps<TRoutine extends ThinkRoutine = ThinkRoutine> {
|
|
7
|
-
/** The selected routine, including any app-owned extension fields. */
|
|
8
|
-
routine: TRoutine;
|
|
9
|
-
/** The standard upstream-first detail surface. Compose this into extensions. */
|
|
10
|
-
defaultDetail: React.ReactNode;
|
|
11
|
-
/** Custom detail surfaces must honor this while invoking the supplied actions. */
|
|
12
|
-
busy: boolean;
|
|
13
|
-
onEnabledChange?: (enabled: boolean) => void;
|
|
14
|
-
renderRunLink?: (run: ThinkRoutineRunOf<TRoutine>) => React.ReactElement;
|
|
15
|
-
}
|
|
16
|
-
interface ThinkRoutineLibraryProps<TRoutine extends ThinkRoutine = ThinkRoutine> extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
17
|
-
/** App-owned routine catalog assembled from native Think and Agents records. */
|
|
18
|
-
routines: readonly TRoutine[];
|
|
19
|
-
/** Routine selected by the current application route. */
|
|
20
|
-
selectedRoutineId: string | null;
|
|
21
|
-
/** App-authored TanStack Router Link for every routine destination. */
|
|
22
|
-
renderRoutineLink: (routine: TRoutine) => React.ReactElement;
|
|
23
|
-
/** App-authored TanStack Router Link to the routine creation route. */
|
|
24
|
-
createRoutineLink?: React.ReactElement;
|
|
25
|
-
/** App-authored TanStack Router Link to edit the selected routine. */
|
|
26
|
-
renderEditRoutineLink?: (routine: TRoutine) => React.ReactElement;
|
|
27
|
-
/** App-authored TanStack Router Link for recent execution destinations. */
|
|
28
|
-
renderRunLink?: (routine: TRoutine, run: ThinkRoutineRunOf<TRoutine>) => React.ReactElement;
|
|
29
|
-
/** Whether owner names appear in the browser, search, and detail. Defaults to true. */
|
|
30
|
-
showOwner?: boolean;
|
|
31
|
-
/** Host-owned catalog error shown above the library without replacing loaded routines. */
|
|
32
|
-
error?: React.ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Application bar slots. `title` defaults to the selected schedule's name.
|
|
35
|
-
* `actions` render before Run / Edit / Delete. `primary` stays last — the
|
|
36
|
-
* host's identity chrome belongs there, not in a second overflow.
|
|
37
|
-
*/
|
|
38
|
-
bar?: AppBarSlots;
|
|
39
|
-
/** Starts the selected routine immediately. */
|
|
40
|
-
onRunRoutine?: (routine: TRoutine) => void | Promise<void>;
|
|
41
|
-
/** Activates or pauses the selected app-owned routine. */
|
|
42
|
-
onRoutineEnabledChange?: (routine: TRoutine, enabled: boolean) => void | Promise<void>;
|
|
43
|
-
/** Permanently removes the selected app-owned routine. */
|
|
44
|
-
onDeleteRoutine?: (routine: TRoutine) => void | Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Replaces only the selected-routine surface while preserving the library
|
|
47
|
-
* shell, navigation, actions, async state, and upstream routine contract.
|
|
48
|
-
*/
|
|
49
|
-
renderRoutineDetail?: (props: ThinkRoutineLibraryDetailRenderProps<TRoutine>) => React.ReactNode;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Full-page, cross-agent routine library. This intentionally does not live in
|
|
53
|
-
* ThinkFullApp's per-thread workbench: the host app owns aggregation, routes,
|
|
54
|
-
* authoring routes, and the association between schedules and native runs.
|
|
55
|
-
* The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
|
|
56
|
-
* and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
|
|
57
|
-
* and edit routes and may also use these surfaces independently.
|
|
58
|
-
*/
|
|
59
|
-
declare function ThinkRoutineLibrary<TRoutine extends ThinkRoutine = ThinkRoutine>({
|
|
60
|
-
bar,
|
|
61
|
-
className,
|
|
62
|
-
createRoutineLink,
|
|
63
|
-
error: catalogError,
|
|
64
|
-
onDeleteRoutine,
|
|
65
|
-
onRoutineEnabledChange,
|
|
66
|
-
onRunRoutine,
|
|
67
|
-
renderEditRoutineLink,
|
|
68
|
-
renderRoutineLink,
|
|
69
|
-
renderRoutineDetail,
|
|
70
|
-
renderRunLink,
|
|
71
|
-
ref,
|
|
72
|
-
routines,
|
|
73
|
-
selectedRoutineId,
|
|
74
|
-
showOwner,
|
|
75
|
-
...props
|
|
76
|
-
}: ThinkRoutineLibraryProps<TRoutine> & {
|
|
77
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
78
|
-
}): React.JSX.Element;
|
|
79
|
-
//#endregion
|
|
80
|
-
export { ThinkRoutineLibrary, ThinkRoutineLibraryDetailRenderProps, ThinkRoutineLibraryProps };
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { K as SpinnerIcon, Q as TrashIcon, R as PencilIcon, z as PlayIcon } from "../../icons-CeGfXO21.js";
|
|
3
|
-
import { buttonVariants } from "../foundations/Button.js";
|
|
4
|
-
import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
|
|
5
|
-
import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
6
|
-
import { AlertDialog } from "../foundations/AlertDialog.js";
|
|
7
|
-
import { EmptyState } from "../foundations/EmptyState.js";
|
|
8
|
-
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
9
|
-
import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
10
|
-
import { ThinkRoutineBrowser } from "./ThinkRoutineBrowser.js";
|
|
11
|
-
import { ThinkRoutineDetail } from "./ThinkRoutineDetail.js";
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
//#region src/components/agents-sdk/ThinkRoutineLibrary.tsx
|
|
15
|
-
function RoutineTopBarActions({ appBarActions, busy, onDelete, editLink, onRun, routineName }) {
|
|
16
|
-
const [deleteOpen, setDeleteOpen] = React.useState(false);
|
|
17
|
-
const deleteButtonRef = React.useRef(null);
|
|
18
|
-
if (!appBarActions && !onRun && !editLink && !onDelete) return null;
|
|
19
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
-
appBarActions,
|
|
21
|
-
onRun ? /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
22
|
-
label: "Run schedule",
|
|
23
|
-
disabled: busy,
|
|
24
|
-
onClick: onRun,
|
|
25
|
-
children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {})
|
|
26
|
-
}) : null,
|
|
27
|
-
editLink ? /* @__PURE__ */ jsx(AppTopBar.Link, {
|
|
28
|
-
label: "Edit schedule",
|
|
29
|
-
render: editLink,
|
|
30
|
-
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
31
|
-
}) : null,
|
|
32
|
-
onDelete ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
33
|
-
ref: deleteButtonRef,
|
|
34
|
-
label: "Delete schedule",
|
|
35
|
-
disabled: busy,
|
|
36
|
-
onClick: () => setDeleteOpen(true),
|
|
37
|
-
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
38
|
-
}), /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
39
|
-
open: deleteOpen,
|
|
40
|
-
onOpenChange: setDeleteOpen,
|
|
41
|
-
children: /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [/* @__PURE__ */ jsx(AlertDialog.Backdrop, {}), /* @__PURE__ */ jsx(AlertDialog.Viewport, { children: /* @__PURE__ */ jsxs(AlertDialog.Popup, {
|
|
42
|
-
finalFocus: deleteButtonRef,
|
|
43
|
-
children: [
|
|
44
|
-
/* @__PURE__ */ jsxs(AlertDialog.Title, { children: [
|
|
45
|
-
"Delete ",
|
|
46
|
-
routineName,
|
|
47
|
-
"?"
|
|
48
|
-
] }),
|
|
49
|
-
/* @__PURE__ */ jsx(AlertDialog.Description, { children: "This permanently deletes the schedule and stops its future runs." }),
|
|
50
|
-
/* @__PURE__ */ jsxs(AlertDialog.Footer, { children: [/* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
51
|
-
disabled: busy,
|
|
52
|
-
children: "Cancel"
|
|
53
|
-
}), /* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
54
|
-
color: "destructive",
|
|
55
|
-
disabled: busy,
|
|
56
|
-
onClick: onDelete,
|
|
57
|
-
children: "Delete schedule"
|
|
58
|
-
})] })
|
|
59
|
-
]
|
|
60
|
-
}) })] })
|
|
61
|
-
})] }) : null
|
|
62
|
-
] });
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Full-page, cross-agent routine library. This intentionally does not live in
|
|
66
|
-
* ThinkFullApp's per-thread workbench: the host app owns aggregation, routes,
|
|
67
|
-
* authoring routes, and the association between schedules and native runs.
|
|
68
|
-
* The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
|
|
69
|
-
* and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
|
|
70
|
-
* and edit routes and may also use these surfaces independently.
|
|
71
|
-
*/
|
|
72
|
-
function ThinkRoutineLibrary({ bar, className, createRoutineLink, error: catalogError, onDeleteRoutine, onRoutineEnabledChange, onRunRoutine, renderEditRoutineLink, renderRoutineLink, renderRoutineDetail, renderRunLink, ref, routines, selectedRoutineId, showOwner = true, ...props }) {
|
|
73
|
-
const [busy, setBusy] = React.useState(false);
|
|
74
|
-
const [announcement, setAnnouncement] = React.useState("");
|
|
75
|
-
const [actionError, setActionError] = React.useState(null);
|
|
76
|
-
const selectedRoutine = selectedRoutineId ? routines.find((routine) => routine.id === selectedRoutineId) : void 0;
|
|
77
|
-
const perform = async (action, message) => {
|
|
78
|
-
setBusy(true);
|
|
79
|
-
setActionError(null);
|
|
80
|
-
try {
|
|
81
|
-
await action();
|
|
82
|
-
setAnnouncement(message);
|
|
83
|
-
return true;
|
|
84
|
-
} catch (nextError) {
|
|
85
|
-
setActionError(formatErrorMessage(nextError));
|
|
86
|
-
return false;
|
|
87
|
-
} finally {
|
|
88
|
-
setBusy(false);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const detailProps = selectedRoutine ? {
|
|
92
|
-
routine: selectedRoutine,
|
|
93
|
-
busy,
|
|
94
|
-
renderRunLink: renderRunLink ? (run) => renderRunLink(selectedRoutine, run) : void 0,
|
|
95
|
-
onEnabledChange: onRoutineEnabledChange ? (enabled) => void perform(() => onRoutineEnabledChange(selectedRoutine, enabled), `${selectedRoutine.name} ${enabled ? "activated" : "paused"}.`) : void 0
|
|
96
|
-
} : void 0;
|
|
97
|
-
return /* @__PURE__ */ jsxs(ResponsiveSidebarShell, {
|
|
98
|
-
ref,
|
|
99
|
-
className: cx("think-routine-library", className),
|
|
100
|
-
...props,
|
|
101
|
-
sidebarLabel: "schedules",
|
|
102
|
-
showMainLabel: "Show selected schedule",
|
|
103
|
-
error: catalogError || actionError || void 0,
|
|
104
|
-
bar: {
|
|
105
|
-
...bar,
|
|
106
|
-
label: "Schedule controls",
|
|
107
|
-
title: bar?.title ?? selectedRoutine?.name ?? "Schedules",
|
|
108
|
-
compactTitleTrigger: selectedRoutine ? /* @__PURE__ */ jsx("span", { children: selectedRoutine.name }) : void 0,
|
|
109
|
-
actions: /* @__PURE__ */ jsx(RoutineTopBarActions, {
|
|
110
|
-
appBarActions: bar?.actions,
|
|
111
|
-
busy,
|
|
112
|
-
routineName: selectedRoutine?.name ?? "schedule",
|
|
113
|
-
editLink: selectedRoutine && renderEditRoutineLink ? renderEditRoutineLink(selectedRoutine) : void 0,
|
|
114
|
-
onRun: selectedRoutine && onRunRoutine ? () => void perform(() => onRunRoutine(selectedRoutine), `Started ${selectedRoutine.name}.`) : void 0,
|
|
115
|
-
onDelete: selectedRoutine && onDeleteRoutine ? () => void perform(() => onDeleteRoutine(selectedRoutine), `Deleted ${selectedRoutine.name}.`) : void 0
|
|
116
|
-
})
|
|
117
|
-
},
|
|
118
|
-
sidebar: ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ThinkRoutineBrowser, {
|
|
119
|
-
routines,
|
|
120
|
-
selectedRoutineId,
|
|
121
|
-
showOwner,
|
|
122
|
-
renderRoutineLink,
|
|
123
|
-
createRoutineLink,
|
|
124
|
-
onRoutineLinkClick: (event) => {
|
|
125
|
-
if (!isPlainPrimaryLinkActivation(event)) return;
|
|
126
|
-
closeSidebarOnCompact();
|
|
127
|
-
}
|
|
128
|
-
}),
|
|
129
|
-
children: [/* @__PURE__ */ jsx("main", {
|
|
130
|
-
className: "think-routine-library__main",
|
|
131
|
-
children: detailProps ? /* @__PURE__ */ jsx(React.Fragment, { children: renderRoutineDetail ? renderRoutineDetail({
|
|
132
|
-
...detailProps,
|
|
133
|
-
defaultDetail: /* @__PURE__ */ jsx(ThinkRoutineDetail, {
|
|
134
|
-
...detailProps,
|
|
135
|
-
showOwner
|
|
136
|
-
})
|
|
137
|
-
}) : /* @__PURE__ */ jsx(ThinkRoutineDetail, {
|
|
138
|
-
...detailProps,
|
|
139
|
-
showOwner
|
|
140
|
-
}) }, detailProps.routine.id) : /* @__PURE__ */ jsx(EmptyState, {
|
|
141
|
-
className: "think-routine-library__empty-detail",
|
|
142
|
-
title: selectedRoutineId ? "Schedule unavailable" : routines.length ? "Select a schedule" : "No schedules yet",
|
|
143
|
-
description: routines.length ? "Select an available schedule." : "Create a schedule to run recurring Think prompts.",
|
|
144
|
-
children: !routines.length && createRoutineLink ? /* @__PURE__ */ jsx(NavigationLink, {
|
|
145
|
-
render: createRoutineLink,
|
|
146
|
-
className: buttonVariants({ color: "primary" }),
|
|
147
|
-
children: "Create schedule"
|
|
148
|
-
}) : null
|
|
149
|
-
})
|
|
150
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
151
|
-
className: "think-routine-library__status sigvelo-visually-hidden",
|
|
152
|
-
role: "status",
|
|
153
|
-
"aria-atomic": "true",
|
|
154
|
-
children: announcement
|
|
155
|
-
})]
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
//#endregion
|
|
159
|
-
export { ThinkRoutineLibrary };
|