@mcp-b/react-components 0.16.1 → 0.18.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/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
- package/dist/{AgentChat-CrlpbvQJ.d.ts → AgentChat-ClxViuUM.d.ts} +4 -29
- package/dist/AgentMessageParts-CyD2UB3V.d.ts +46 -0
- package/dist/AgentToolRunsContext-BVe4stgw.d.ts +21 -0
- package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
- package/dist/{CodeBlock-BmB4Xaqq.js → CodeBlock-Bfp5PAg3.js} +9 -6
- package/dist/{CodeBlock-BRajW4QU.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
- package/dist/Collapsible-N64ASIQr.d.ts +119 -0
- package/dist/{Combobox-B9Fcd6q-.d.ts → Combobox-CYc37s5l.d.ts} +11 -33
- package/dist/{FileTree-CkVbIMWV.js → FileTree-3zYtrddG.js} +46 -20
- package/dist/{Menu-Bgu-ufb5.d.ts → Menu-L6MZm-7N.d.ts} +15 -56
- package/dist/{Message-BkMdE3bS.js → Message-BXtmfc9Q.js} +13 -20
- package/dist/{ModelSelector-SlJNgwKY.js → ModelSelector-Cqw_qrUG.js} +18 -25
- package/dist/{PromptInput-BWTuXMOD.d.ts → PromptInput-Bdh9pqlo.d.ts} +41 -71
- package/dist/{ResponsiveSidebarShell-Dd9DCcBT.d.ts → ResponsiveSidebarShell-CsAh4NyL.d.ts} +1 -0
- package/dist/{Select-BeEsefzh.d.ts → Select-B_13gg_J.d.ts} +16 -44
- package/dist/{Tabs-3Zc4tb9D.d.ts → Tabs-ColWK-XA.d.ts} +14 -20
- package/dist/{ThinkChat-CzC-zNGA.js → ThinkChat-15EhfvYJ.js} +123 -73
- package/dist/{ThinkChatActivity-BFQnb2ct.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +9 -4
- package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
- package/dist/{ThinkChatContext-C3Eb1Xpi.d.ts → ThinkChatContext-DrsZqdaO.d.ts} +1 -1
- package/dist/ThinkRecoveryNotice-DFIcG9UX.d.ts +19 -0
- package/dist/{Toggle-CAAlNl-M.d.ts → Toggle-JKZ43D5S.d.ts} +2 -2
- package/dist/{ToggleGroup-8hPv-b69.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +4 -5
- package/dist/Workspace-Jez8ffUj.d.ts +274 -0
- package/dist/WorkspaceExplorer-B9dQWNVK.d.ts +32 -0
- package/dist/{WorkspaceFile-DOZkPwzu.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
- package/dist/{WorkspaceFileView-rSN_yT0L.js → WorkspaceFileView-C68Ub8S8.js} +121 -128
- package/dist/{WorkspaceLink-DIPbXrUM.js → WorkspaceLink-BYYeTQLf.js} +20 -55
- package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
- package/dist/class-names-BiMDVpUo.js +14 -0
- package/dist/components/Accordion.d.ts +5 -15
- package/dist/components/Accordion.js +16 -10
- package/dist/components/Activity.d.ts +5 -10
- package/dist/components/Activity.js +2 -2
- package/dist/components/AgentActivity.d.ts +1 -1
- package/dist/components/AgentActivity.js +4 -5
- package/dist/components/AgentActivityPreview.d.ts +9 -9
- package/dist/components/AgentActivityPreview.js +8 -12
- package/dist/components/AgentAttention.d.ts +2 -2
- package/dist/components/AgentAttention.js +1 -1
- package/dist/components/AgentChat.d.ts +2 -2
- package/dist/components/AgentChat.js +113 -218
- package/dist/components/AgentChatMessageEditor.js +3 -3
- package/dist/components/AgentChatTurnError.js +2 -2
- package/dist/components/AgentConnection.js +4 -4
- package/dist/components/AgentMessageParts.d.ts +2 -0
- package/dist/components/AgentMessageParts.js +119 -0
- package/dist/components/AgentToolDetail.d.ts +57 -0
- package/dist/components/AgentToolDetail.js +100 -0
- package/dist/components/AgentToolRunsContext.d.ts +2 -0
- package/dist/components/AgentToolRunsContext.js +16 -0
- package/dist/components/AlertDialog.d.ts +7 -19
- package/dist/components/AlertDialog.js +21 -32
- package/dist/components/AppTopBar.d.ts +28 -8
- package/dist/components/AppTopBar.js +36 -12
- package/dist/components/Approval.d.ts +102 -0
- package/dist/components/Approval.js +227 -0
- package/dist/components/Artifact.d.ts +3 -5
- package/dist/components/Artifact.js +7 -5
- package/dist/components/Autocomplete.d.ts +11 -33
- package/dist/components/Autocomplete.js +23 -30
- package/dist/components/Avatar.d.ts +4 -12
- package/dist/components/Avatar.js +13 -12
- package/dist/components/Badge.js +3 -0
- package/dist/components/BrowserLiveView.js +27 -12
- package/dist/components/BrowserReplay.js +4 -3
- package/dist/components/BrowserRunPanel.js +58 -78
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Button.js +14 -16
- package/dist/components/Card.d.ts +7 -8
- package/dist/components/Card.js +19 -10
- package/dist/components/ChainOfThought.d.ts +5 -11
- package/dist/components/ChainOfThought.js +3 -2
- package/dist/components/ChatGptSignInScreen.js +8 -8
- package/dist/components/Checkbox.d.ts +2 -4
- package/dist/components/Checkbox.js +6 -5
- package/dist/components/CheckboxGroup.d.ts +1 -3
- package/dist/components/CheckboxGroup.js +15 -14
- package/dist/components/Checkpoint.d.ts +64 -0
- package/dist/components/Checkpoint.js +63 -0
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.d.ts +1 -1
- package/dist/components/CodexModelSelector.js +2 -2
- package/dist/components/Collapsible.d.ts +1 -124
- package/dist/components/Collapsible.js +7 -10
- package/dist/components/Combobox.d.ts +1 -1
- package/dist/components/Combobox.js +23 -30
- package/dist/components/Commit.d.ts +5 -11
- package/dist/components/Commit.js +6 -5
- package/dist/components/Context.js +1 -1
- package/dist/components/ContextMenu.d.ts +21 -37
- package/dist/components/ContextMenu.js +34 -51
- package/dist/components/Conversation.d.ts +3 -5
- package/dist/components/Conversation.js +5 -4
- package/dist/components/DescriptionListParts.js +1 -1
- package/dist/components/Dialog.d.ts +6 -17
- package/dist/components/Dialog.js +17 -24
- package/dist/components/EnvironmentVariables.d.ts +1 -1
- package/dist/components/EnvironmentVariables.js +4 -3
- package/dist/components/Field.d.ts +17 -20
- package/dist/components/Field.js +20 -17
- package/dist/components/Fieldset.d.ts +2 -7
- package/dist/components/Fieldset.js +7 -6
- package/dist/components/FileTree.d.ts +6 -0
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Form.d.ts +1 -4
- package/dist/components/Form.js +3 -2
- package/dist/components/GithubMotionMark.js +1 -1
- package/dist/components/IconButton.d.ts +2 -3
- package/dist/components/IconButton.js +2 -1
- package/dist/components/InlineCitation.d.ts +66 -0
- package/dist/components/InlineCitation.js +142 -0
- package/dist/components/Input.d.ts +1 -4
- package/dist/components/Input.js +3 -2
- package/dist/components/Marker.js +1 -1
- package/dist/components/McpConnectionRequest.js +2 -2
- package/dist/components/McpServerPicker.d.ts +1 -1
- package/dist/components/McpServerPicker.js +6 -5
- package/dist/components/MediaPreviewCard.d.ts +103 -0
- package/dist/components/MediaPreviewCard.js +193 -0
- package/dist/components/Menu.d.ts +1 -1
- package/dist/components/Menu.js +33 -52
- package/dist/components/Menubar.d.ts +22 -43
- package/dist/components/Menubar.js +36 -53
- package/dist/components/Message.d.ts +7 -7
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.d.ts +2 -2
- package/dist/components/MessageScroller.js +6 -5
- package/dist/components/Meter.d.ts +5 -20
- package/dist/components/Meter.js +11 -10
- package/dist/components/ModelSelector.d.ts +6 -9
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.d.ts +11 -33
- package/dist/components/NavigationMenu.js +23 -30
- package/dist/components/NumberField.d.ts +6 -24
- package/dist/components/NumberField.js +13 -12
- package/dist/components/Plan.d.ts +103 -0
- package/dist/components/Plan.js +113 -0
- package/dist/components/Popover.d.ts +9 -36
- package/dist/components/Popover.js +23 -34
- package/dist/components/PreviewCard.d.ts +6 -24
- package/dist/components/PreviewCard.js +13 -24
- package/dist/components/PricingBillingToggle.js +1 -1
- package/dist/components/PricingFAQ.js +1 -1
- package/dist/components/PricingPage.js +2 -1
- package/dist/components/PricingPlanCard.js +5 -4
- package/dist/components/PricingUsageCalculator.js +3 -3
- package/dist/components/Progress.d.ts +3 -8
- package/dist/components/Progress.js +7 -10
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +83 -218
- package/dist/components/Queue.d.ts +7 -17
- package/dist/components/Queue.js +2 -3
- package/dist/components/RadioGroup.d.ts +3 -8
- package/dist/components/RadioGroup.js +7 -10
- package/dist/components/Reasoning.d.ts +4 -8
- package/dist/components/Reasoning.js +3 -6
- package/dist/components/ResizableSidePanel.js +2 -2
- package/dist/components/ResponsiveSidebarShell.d.ts +1 -1
- package/dist/components/ResponsiveSidebarShell.js +18 -11
- package/dist/components/ScrollArea.d.ts +5 -20
- package/dist/components/ScrollArea.js +12 -10
- package/dist/components/SearchField.d.ts +43 -0
- package/dist/components/SearchField.js +52 -0
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Select.js +33 -57
- package/dist/components/Separator.d.ts +1 -5
- package/dist/components/Separator.js +3 -6
- package/dist/components/Slider.d.ts +6 -19
- package/dist/components/Slider.js +15 -14
- package/dist/components/Sources.d.ts +4 -9
- package/dist/components/Sources.js +3 -2
- package/dist/components/Stepper.js +16 -9
- package/dist/components/SubagentRunDetails.js +1 -1
- package/dist/components/SubagentRunIndicator.js +2 -2
- package/dist/components/SubagentRunList.d.ts +3 -5
- package/dist/components/SubagentRunList.js +3 -5
- package/dist/components/SubagentRunSelector.d.ts +9 -22
- package/dist/components/SubagentRunSelector.js +29 -31
- package/dist/components/Switch.d.ts +4 -7
- package/dist/components/Switch.js +6 -10
- package/dist/components/Tabs.d.ts +2 -2
- package/dist/components/Tabs.js +21 -18
- package/dist/components/Task.d.ts +4 -9
- package/dist/components/Task.js +4 -3
- package/dist/components/Terminal.d.ts +3 -4
- package/dist/components/Terminal.js +5 -4
- package/dist/components/TestResults.d.ts +4 -9
- package/dist/components/TestResults.js +11 -6
- package/dist/components/Textarea.js +1 -1
- package/dist/components/ThemeModeControl.js +1 -1
- package/dist/components/ThinkChat.d.ts +45 -22
- package/dist/components/ThinkChat.js +7 -5
- package/dist/components/ThinkChatActivity.d.ts +2 -2
- package/dist/components/ThinkChatActivity.js +24 -7
- package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/ThinkChatActivitySummary.js +7 -3
- package/dist/components/ThinkChatContext.d.ts +1 -1
- package/dist/components/ThinkChatToolPanels.js +27 -17
- package/dist/components/ThinkExecutionDetail.js +2 -2
- package/dist/components/ThinkExecutionStatus.js +2 -2
- package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
- package/dist/components/ThinkExecutionWorkbench.js +70 -134
- package/dist/components/ThinkFullApp.d.ts +40 -15
- package/dist/components/ThinkFullApp.js +193 -117
- package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/ThinkFullAppViewSwitch.js +2 -2
- package/dist/components/ThinkPendingApproval.d.ts +60 -0
- package/dist/components/ThinkPendingApproval.js +99 -0
- package/dist/components/ThinkRecoveryNotice.d.ts +2 -0
- package/dist/components/ThinkRecoveryNotice.js +46 -0
- package/dist/components/ThinkRoutine.js +1 -0
- package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
- package/dist/components/ThinkRoutineBrowser.js +37 -44
- package/dist/components/ThinkRoutineDetail.d.ts +5 -2
- package/dist/components/ThinkRoutineDetail.js +4 -4
- package/dist/components/ThinkRoutineForm.d.ts +3 -2
- package/dist/components/ThinkRoutineForm.js +11 -10
- package/dist/components/ThinkRoutineLibrary.d.ts +27 -25
- package/dist/components/ThinkRoutineLibrary.js +104 -80
- package/dist/components/ThinkRoutineRuns.d.ts +3 -2
- package/dist/components/ThinkRoutineRuns.js +31 -24
- package/dist/components/ThinkThreadPicker.d.ts +17 -11
- package/dist/components/ThinkThreadPicker.js +163 -39
- package/dist/components/ThinkThreadShell.d.ts +1 -1
- package/dist/components/Toast.d.ts +7 -28
- package/dist/components/Toast.js +15 -14
- package/dist/components/Toggle.d.ts +1 -1
- package/dist/components/Toggle.js +10 -8
- package/dist/components/ToggleGroup.d.ts +1 -1
- package/dist/components/ToggleGroup.js +21 -26
- package/dist/components/ToolApproval.d.ts +28 -0
- package/dist/components/ToolApproval.js +35 -0
- package/dist/components/ToolInvocation.d.ts +26 -0
- package/dist/components/ToolInvocation.js +72 -0
- package/dist/components/Toolbar.d.ts +6 -24
- package/dist/components/Toolbar.js +13 -12
- package/dist/components/Tooltip.d.ts +11 -10
- package/dist/components/Tooltip.js +17 -11
- package/dist/components/TransitionSurface.d.ts +27 -0
- package/dist/components/TransitionSurface.js +20 -0
- package/dist/components/WebPreview.d.ts +6 -7
- package/dist/components/WebPreview.js +70 -55
- package/dist/components/Workspace.d.ts +2 -2
- package/dist/components/Workspace.js +361 -346
- package/dist/components/WorkspaceBrowser.d.ts +4 -7
- package/dist/components/WorkspaceBrowser.js +16 -26
- package/dist/components/WorkspaceExplorer.d.ts +5 -33
- package/dist/components/WorkspaceExplorer.js +19 -32
- package/dist/components/WorkspaceFile.d.ts +1 -1
- package/dist/components/WorkspaceFileView.d.ts +14 -2
- package/dist/components/WorkspaceFileView.js +1 -1
- package/dist/components/WorkspaceHeader.d.ts +0 -8
- package/dist/components/WorkspaceHeader.js +3 -15
- package/dist/components/WorkspaceLink.d.ts +1 -1
- package/dist/components/WorkspaceLink.js +1 -1
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-DtPMgN7e.d.ts → copy-button-D7aAYA-2.d.ts} +2 -3
- package/dist/{copy-button-Dejn5heL.js → copy-button-DeK6KXEV.js} +3 -2
- package/dist/{icons-CpfUer49.js → icons-CQJ-aMnI.js} +7 -3
- package/dist/{icons-GQd1xF4e.d.ts → icons-CYXmvKlJ.d.ts} +22 -2
- package/dist/navigation-link-Cob7KBlM.js +19 -0
- package/dist/styles/accordion.css +4 -19
- package/dist/styles/activity.css +48 -56
- package/dist/styles/agent-activity-preview.css +6 -0
- package/dist/styles/agent-chat.css +14 -63
- package/dist/styles/agent-connection.css +0 -12
- package/dist/styles/agent-tool-detail.css +54 -0
- package/dist/styles/alert-dialog.css +16 -18
- package/dist/styles/app-top-bar.css +17 -9
- package/dist/styles/approval.css +177 -0
- package/dist/styles/artifact.css +6 -18
- package/dist/styles/autocomplete.css +2 -1
- package/dist/styles/avatar.css +35 -30
- package/dist/styles/badge.css +10 -10
- package/dist/styles/base-ui-motion.css +94 -39
- package/dist/styles/browser-control-overlay.css +0 -1
- package/dist/styles/browser-live-view.css +39 -22
- package/dist/styles/browser-replay.css +1 -1
- package/dist/styles/browser-run-panel.css +13 -6
- package/dist/styles/button.css +36 -33
- package/dist/styles/card.css +5 -6
- package/dist/styles/chain-of-thought.css +22 -24
- package/dist/styles/checkbox.css +18 -5
- package/dist/styles/checkpoint.css +58 -0
- package/dist/styles/codex-model-selector.css +3 -7
- package/dist/styles/collapsible.css +10 -10
- package/dist/styles/combobox.css +4 -3
- package/dist/styles/commit.css +19 -39
- package/dist/styles/composition-motion.css +83 -0
- package/dist/styles/context-menu.css +3 -11
- package/dist/styles/context.css +11 -10
- package/dist/styles/conversation.css +18 -23
- package/dist/styles/dialog.css +15 -15
- package/dist/styles/environment-variables.css +0 -13
- package/dist/styles/field.css +32 -12
- package/dist/styles/file-tree.css +66 -22
- package/dist/styles/form.css +1 -1
- package/dist/styles/index.css +13 -4
- package/dist/styles/inline-citation.css +107 -0
- package/dist/styles/input.css +2 -2
- package/dist/styles/marker.css +14 -13
- package/dist/styles/mcp-server-picker.css +20 -47
- package/dist/styles/media-preview-card.css +160 -0
- package/dist/styles/menu.css +11 -40
- package/dist/styles/menubar.css +12 -19
- package/dist/styles/message-scroller.css +0 -12
- package/dist/styles/message.css +25 -31
- package/dist/styles/meter.css +2 -2
- package/dist/styles/model-selector.css +16 -34
- package/dist/styles/motion-reduction.css +29 -0
- package/dist/styles/navigation-menu.css +14 -30
- package/dist/styles/number-field.css +22 -4
- package/dist/styles/plan.css +132 -0
- package/dist/styles/popover.css +15 -52
- package/dist/styles/preview-card.css +2 -32
- package/dist/styles/progress.css +8 -3
- package/dist/styles/prompt-input.css +76 -269
- package/dist/styles/queue.css +48 -32
- package/dist/styles/radio.css +19 -12
- package/dist/styles/reasoning.css +2 -1
- package/dist/styles/recipes.css +207 -26
- package/dist/styles/resizable-side-panel.css +4 -10
- package/dist/styles/responsive-sidebar-shell.css +32 -34
- package/dist/styles/scroll-area.css +32 -15
- package/dist/styles/search-field.css +21 -0
- package/dist/styles/select.css +19 -12
- package/dist/styles/slider.css +25 -29
- package/dist/styles/sources.css +3 -11
- package/dist/styles/stepper.css +36 -26
- package/dist/styles/subagent-run.css +13 -71
- package/dist/styles/switch.css +32 -29
- package/dist/styles/tabs.css +79 -23
- package/dist/styles/task.css +11 -23
- package/dist/styles/test-results.css +29 -36
- package/dist/styles/theme-mode-control.css +8 -0
- package/dist/styles/think-execution-workbench.css +18 -15
- package/dist/styles/think-full-app.css +51 -100
- package/dist/styles/think-routine-library.css +51 -40
- package/dist/styles/think-thread-picker.css +207 -50
- package/dist/styles/toast.css +48 -34
- package/dist/styles/toggle-group.css +2 -36
- package/dist/styles/toggle.css +29 -5
- package/dist/styles/toolbar.css +25 -27
- package/dist/styles/tooltip.css +2 -32
- package/dist/styles/transition-surface.css +55 -0
- package/dist/styles/utilities.css +31 -0
- package/dist/styles/web-preview.css +0 -21
- package/dist/styles/workspace-explorer.css +104 -99
- package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
- package/dist/think-agent-Cip5KAPj.d.ts +7 -0
- package/dist/utils/codex-model-catalog.d.ts +4 -4
- package/dist/utils/mcp-server-catalog.d.ts +132 -0
- package/dist/utils/mcp-server-catalog.js +90 -0
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/workspace-path-L_KmjRjq.js +26 -0
- package/package.json +14 -9
- package/dist/Workspace-D39LxGvP.d.ts +0 -62
- package/dist/class-names-9UtZwb0J.js +0 -12
- package/dist/components/AppFrame.d.ts +0 -24
- package/dist/components/AppFrame.js +0 -25
- package/dist/components/Shell.d.ts +0 -163
- package/dist/components/Shell.js +0 -137
- package/dist/components/SubagentRun.d.ts +0 -86
- package/dist/components/SubagentRun.js +0 -108
- package/dist/styles/app-frame.css +0 -15
- package/dist/styles/shell.css +0 -122
- package/dist/summarize-tool-input-BUJsENSn.js +0 -12
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { G as SpinnerIcon, Z as WarningIcon, u as ChevronDownIcon, v as EllipsisIcon, z as PlayIcon } from "../icons-CQJ-aMnI.js";
|
|
3
|
+
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
4
|
+
import { Button, buttonVariants } from "./Button.js";
|
|
3
5
|
import { Menu } from "./Menu.js";
|
|
4
6
|
import { AppTopBar } from "./AppTopBar.js";
|
|
7
|
+
import { AlertDialog } from "./AlertDialog.js";
|
|
5
8
|
import { ResponsiveSidebarShell } from "./ResponsiveSidebarShell.js";
|
|
6
9
|
import { ThinkRoutineBrowser } from "./ThinkRoutineBrowser.js";
|
|
7
10
|
import { ThinkRoutineDetail } from "./ThinkRoutineDetail.js";
|
|
8
|
-
import { ThinkRoutineForm } from "./ThinkRoutineForm.js";
|
|
9
11
|
import * as React from "react";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
13
|
//#region src/components/ThinkRoutineLibrary.tsx
|
|
12
14
|
function errorMessage(error) {
|
|
13
15
|
return error instanceof Error ? error.message : String(error);
|
|
14
16
|
}
|
|
15
|
-
function RoutineTopBarActions({ busy, onDelete, onRun }) {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
function RoutineTopBarActions({ busy, onDelete, editLink, onRun, routineName }) {
|
|
18
|
+
const [deleteOpen, setDeleteOpen] = React.useState(false);
|
|
19
|
+
const moreActionsRef = React.useRef(null);
|
|
20
|
+
const hasMenu = Boolean(editLink || onDelete);
|
|
21
|
+
if (!onRun && !hasMenu) return null;
|
|
22
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(AppTopBar.Trailing, {
|
|
18
23
|
"aria-label": "Schedule actions",
|
|
19
24
|
children: [onRun ? /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
20
25
|
label: "Run schedule",
|
|
@@ -22,53 +27,75 @@ function RoutineTopBarActions({ busy, onDelete, onRun }) {
|
|
|
22
27
|
disabled: busy,
|
|
23
28
|
onClick: onRun,
|
|
24
29
|
children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {})
|
|
25
|
-
}) : null,
|
|
30
|
+
}) : null, hasMenu ? /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
26
31
|
label: "More schedule actions",
|
|
27
32
|
tooltip: "More actions",
|
|
28
33
|
disabled: busy,
|
|
29
|
-
render: /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
34
|
+
render: /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
35
|
+
ref: moreActionsRef,
|
|
36
|
+
unstyled: true
|
|
37
|
+
}),
|
|
30
38
|
children: /* @__PURE__ */ jsx(EllipsisIcon, {})
|
|
31
39
|
}), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
32
40
|
align: "end",
|
|
33
41
|
sideOffset: 4,
|
|
34
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [editLink ? /* @__PURE__ */ jsx(Menu.Item, {
|
|
43
|
+
render: editLink,
|
|
44
|
+
children: "Edit schedule"
|
|
45
|
+
}) : null, onDelete ? /* @__PURE__ */ jsx(Menu.Item, {
|
|
35
46
|
variant: "destructive",
|
|
36
47
|
disabled: busy,
|
|
37
|
-
onClick:
|
|
48
|
+
onClick: () => setDeleteOpen(true),
|
|
38
49
|
children: "Delete schedule"
|
|
39
|
-
}) })
|
|
50
|
+
}) : null] })
|
|
40
51
|
}) })] }) : null]
|
|
41
|
-
})
|
|
52
|
+
}), onDelete ? /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
53
|
+
open: deleteOpen,
|
|
54
|
+
onOpenChange: setDeleteOpen,
|
|
55
|
+
children: /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [/* @__PURE__ */ jsx(AlertDialog.Backdrop, {}), /* @__PURE__ */ jsx(AlertDialog.Viewport, { children: /* @__PURE__ */ jsxs(AlertDialog.Popup, {
|
|
56
|
+
finalFocus: moreActionsRef,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsxs(AlertDialog.Title, { children: [
|
|
59
|
+
"Delete ",
|
|
60
|
+
routineName,
|
|
61
|
+
"?"
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ jsx(AlertDialog.Description, { children: "This permanently deletes the schedule and stops its future runs." }),
|
|
64
|
+
/* @__PURE__ */ jsxs(AlertDialog.Footer, { children: [/* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
65
|
+
disabled: busy,
|
|
66
|
+
children: "Cancel"
|
|
67
|
+
}), /* @__PURE__ */ jsx(AlertDialog.Close, {
|
|
68
|
+
variant: "destructive",
|
|
69
|
+
disabled: busy,
|
|
70
|
+
onClick: onDelete,
|
|
71
|
+
children: "Delete schedule"
|
|
72
|
+
})] })
|
|
73
|
+
]
|
|
74
|
+
}) })] })
|
|
75
|
+
}) : null] });
|
|
42
76
|
}
|
|
43
77
|
/**
|
|
44
78
|
* Full-page, cross-agent routine library. This intentionally does not live in
|
|
45
79
|
* ThinkFullApp's per-thread workbench: the host app owns aggregation, routes,
|
|
46
|
-
* authoring
|
|
80
|
+
* authoring routes, and the association between schedules and native runs.
|
|
47
81
|
* The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
|
|
48
|
-
*
|
|
49
|
-
* surfaces independently.
|
|
82
|
+
* and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
|
|
83
|
+
* route and may also use these surfaces independently.
|
|
50
84
|
*/
|
|
51
|
-
function ThinkRoutineLibrary({ className,
|
|
52
|
-
const [view, setView] = React.useState("library");
|
|
53
|
-
const [innerSelectedId, setInnerSelectedId] = React.useState(defaultSelectedRoutineId ?? routines[0]?.id ?? "");
|
|
85
|
+
function ThinkRoutineLibrary({ appBarLeading, className, createRoutineLink, error: catalogError, onDeleteRoutine, onRoutineEnabledChange, onRunRoutine, renderEditRoutineLink, renderRoutineLink, renderRoutineDetail, renderRunLink, ref, routines, selectedRoutineId, showOwner = true, ...props }) {
|
|
54
86
|
const [busy, setBusy] = React.useState(false);
|
|
55
87
|
const [announcement, setAnnouncement] = React.useState("");
|
|
56
|
-
const [
|
|
57
|
-
const
|
|
58
|
-
const selectedRoutine = routines.find((routine) => routine.id === activeId) ?? (selectedRoutineId === void 0 ? routines[0] : void 0);
|
|
59
|
-
const selectRoutine = (id) => {
|
|
60
|
-
if (selectedRoutineId === void 0) setInnerSelectedId(id);
|
|
61
|
-
onSelectedRoutineIdChange?.(id);
|
|
62
|
-
};
|
|
88
|
+
const [actionError, setActionError] = React.useState(null);
|
|
89
|
+
const selectedRoutine = selectedRoutineId ? routines.find((routine) => routine.id === selectedRoutineId) : void 0;
|
|
63
90
|
const perform = async (action, message) => {
|
|
64
91
|
setBusy(true);
|
|
65
|
-
|
|
92
|
+
setActionError(null);
|
|
66
93
|
try {
|
|
67
94
|
await action();
|
|
68
95
|
setAnnouncement(message);
|
|
69
96
|
return true;
|
|
70
97
|
} catch (nextError) {
|
|
71
|
-
|
|
98
|
+
setActionError(errorMessage(nextError));
|
|
72
99
|
return false;
|
|
73
100
|
} finally {
|
|
74
101
|
setBusy(false);
|
|
@@ -77,69 +104,47 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
|
|
|
77
104
|
const detailProps = selectedRoutine ? {
|
|
78
105
|
routine: selectedRoutine,
|
|
79
106
|
busy,
|
|
80
|
-
|
|
107
|
+
renderRunLink: renderRunLink ? (run) => renderRunLink(selectedRoutine, run) : void 0,
|
|
81
108
|
onEnabledChange: onRoutineEnabledChange ? (enabled) => void perform(() => onRoutineEnabledChange(selectedRoutine, enabled), `${selectedRoutine.name} ${enabled ? "activated" : "paused"}.`) : void 0
|
|
82
109
|
} : void 0;
|
|
83
|
-
if (view === "create") return /* @__PURE__ */ jsxs("div", {
|
|
84
|
-
ref,
|
|
85
|
-
className: cx("think-routine-library", className),
|
|
86
|
-
...props,
|
|
87
|
-
children: [
|
|
88
|
-
error ? /* @__PURE__ */ jsxs("div", {
|
|
89
|
-
className: "think-routine-library__error",
|
|
90
|
-
role: "alert",
|
|
91
|
-
children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: error })]
|
|
92
|
-
}) : null,
|
|
93
|
-
/* @__PURE__ */ jsxs(AppTopBar.Root, {
|
|
94
|
-
"aria-label": "Schedule editor controls",
|
|
95
|
-
children: [/* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
96
|
-
label: "Back to schedules",
|
|
97
|
-
onClick: () => setView("library"),
|
|
98
|
-
children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
|
|
99
|
-
}) }), /* @__PURE__ */ jsx(AppTopBar.Title, { children: "New schedule" })]
|
|
100
|
-
}),
|
|
101
|
-
/* @__PURE__ */ jsx(ThinkRoutineForm, {
|
|
102
|
-
busy,
|
|
103
|
-
owners,
|
|
104
|
-
schedules,
|
|
105
|
-
onCancel: () => setView("library"),
|
|
106
|
-
onCreate: (request) => {
|
|
107
|
-
if (!onCreateRoutine) return;
|
|
108
|
-
perform(() => onCreateRoutine(request), `Created ${request.name}.`).then((created) => {
|
|
109
|
-
if (created) setView("library");
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ jsx("div", {
|
|
114
|
-
className: "think-routine-library__status",
|
|
115
|
-
role: "status",
|
|
116
|
-
"aria-atomic": "true",
|
|
117
|
-
children: announcement
|
|
118
|
-
})
|
|
119
|
-
]
|
|
120
|
-
});
|
|
121
110
|
return /* @__PURE__ */ jsxs("div", {
|
|
122
111
|
ref,
|
|
123
112
|
className: cx("think-routine-library", className),
|
|
124
113
|
...props,
|
|
125
114
|
children: [
|
|
126
|
-
|
|
115
|
+
catalogError || actionError ? /* @__PURE__ */ jsxs("div", {
|
|
127
116
|
className: "think-routine-library__error",
|
|
128
117
|
role: "alert",
|
|
129
|
-
children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children:
|
|
118
|
+
children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: catalogError || actionError })]
|
|
130
119
|
}) : null,
|
|
131
120
|
/* @__PURE__ */ jsx(ResponsiveSidebarShell, {
|
|
132
121
|
className: "think-routine-library__layout",
|
|
133
122
|
sidebarLabel: "schedules",
|
|
123
|
+
defaultSidebarOpen: false,
|
|
134
124
|
toolbarLabel: "Schedule navigation controls",
|
|
135
125
|
showMainLabel: "Show selected schedule",
|
|
136
|
-
topBar: ({ sidebarToggle }) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
|
|
126
|
+
topBar: ({ sidebarId, sidebarOpen, sidebarToggle, toggleSidebar }) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
|
|
137
127
|
"aria-label": "Schedule controls",
|
|
138
128
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ jsxs(AppTopBar.Leading, { children: [sidebarToggle, appBarLeading] }),
|
|
130
|
+
/* @__PURE__ */ jsxs(AppTopBar.Title, { children: [/* @__PURE__ */ jsx("span", {
|
|
131
|
+
className: "think-routine-library__app-title",
|
|
132
|
+
children: selectedRoutine?.name ?? "Schedules"
|
|
133
|
+
}), selectedRoutine ? /* @__PURE__ */ jsxs(Button, {
|
|
134
|
+
type: "button",
|
|
135
|
+
variant: "ghost",
|
|
136
|
+
color: "neutral",
|
|
137
|
+
size: "sm",
|
|
138
|
+
className: "think-routine-library__schedule-trigger",
|
|
139
|
+
"aria-controls": sidebarId,
|
|
140
|
+
"aria-expanded": sidebarOpen,
|
|
141
|
+
onClick: (event) => toggleSidebar(event.currentTarget),
|
|
142
|
+
children: [/* @__PURE__ */ jsx("span", { children: selectedRoutine.name }), /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": "true" })]
|
|
143
|
+
}) : null] }),
|
|
141
144
|
/* @__PURE__ */ jsx(RoutineTopBarActions, {
|
|
142
145
|
busy,
|
|
146
|
+
routineName: selectedRoutine?.name ?? "schedule",
|
|
147
|
+
editLink: selectedRoutine && renderEditRoutineLink ? renderEditRoutineLink(selectedRoutine) : void 0,
|
|
143
148
|
onRun: selectedRoutine && onRunRoutine ? () => void perform(() => onRunRoutine(selectedRoutine), `Started ${selectedRoutine.name}.`) : void 0,
|
|
144
149
|
onDelete: selectedRoutine && onDeleteRoutine ? () => void perform(() => onDeleteRoutine(selectedRoutine), `Deleted ${selectedRoutine.name}.`) : void 0
|
|
145
150
|
})
|
|
@@ -147,10 +152,12 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
|
|
|
147
152
|
}),
|
|
148
153
|
sidebar: ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ThinkRoutineBrowser, {
|
|
149
154
|
routines,
|
|
150
|
-
selectedRoutineId
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
selectedRoutineId,
|
|
156
|
+
showOwner,
|
|
157
|
+
renderRoutineLink,
|
|
158
|
+
createRoutineLink,
|
|
159
|
+
onRoutineLinkClick: (event) => {
|
|
160
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.currentTarget.target === "_blank") return;
|
|
154
161
|
closeSidebarOnCompact();
|
|
155
162
|
}
|
|
156
163
|
}),
|
|
@@ -158,15 +165,32 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
|
|
|
158
165
|
className: "think-routine-library__main",
|
|
159
166
|
children: detailProps ? /* @__PURE__ */ jsx(React.Fragment, { children: renderRoutineDetail ? renderRoutineDetail({
|
|
160
167
|
...detailProps,
|
|
161
|
-
defaultDetail: /* @__PURE__ */ jsx(ThinkRoutineDetail, {
|
|
162
|
-
|
|
168
|
+
defaultDetail: /* @__PURE__ */ jsx(ThinkRoutineDetail, {
|
|
169
|
+
...detailProps,
|
|
170
|
+
showOwner
|
|
171
|
+
})
|
|
172
|
+
}) : /* @__PURE__ */ jsx(ThinkRoutineDetail, {
|
|
173
|
+
...detailProps,
|
|
174
|
+
showOwner
|
|
175
|
+
}) }, detailProps.routine.id) : /* @__PURE__ */ jsxs("div", {
|
|
163
176
|
className: "think-routine-library__empty-detail",
|
|
164
|
-
children: [
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ jsx("h1", { children: selectedRoutineId ? "Schedule unavailable" : routines.length ? "Select a schedule" : "No schedules yet" }),
|
|
179
|
+
/* @__PURE__ */ jsx("p", { children: routines.length ? "Select an available schedule." : "Create a schedule to run recurring Think prompts." }),
|
|
180
|
+
!routines.length && createRoutineLink ? /* @__PURE__ */ jsx(NavigationLink, {
|
|
181
|
+
render: createRoutineLink,
|
|
182
|
+
className: buttonVariants({
|
|
183
|
+
color: "primary",
|
|
184
|
+
className: "think-routine-library__empty-action"
|
|
185
|
+
}),
|
|
186
|
+
children: "Create schedule"
|
|
187
|
+
}) : null
|
|
188
|
+
]
|
|
165
189
|
})
|
|
166
190
|
})
|
|
167
191
|
}),
|
|
168
192
|
/* @__PURE__ */ jsx("div", {
|
|
169
|
-
className: "think-routine-library__status",
|
|
193
|
+
className: "think-routine-library__status sigvelo-visually-hidden",
|
|
170
194
|
role: "status",
|
|
171
195
|
"aria-atomic": "true",
|
|
172
196
|
children: announcement
|
|
@@ -6,7 +6,8 @@ interface ThinkRoutineRunsProps<TRun extends ThinkExecutionRun = ThinkExecutionR
|
|
|
6
6
|
runs: readonly TRun[];
|
|
7
7
|
title?: React.ReactNode;
|
|
8
8
|
emptyState?: React.ReactNode;
|
|
9
|
-
|
|
9
|
+
/** App-authored TanStack Router Link for each durable execution destination. */
|
|
10
|
+
renderRunLink?: (run: TRun) => React.ReactElement;
|
|
10
11
|
}
|
|
11
12
|
/** Compact execution history shared by routine detail surfaces. */
|
|
12
13
|
declare function ThinkRoutineRuns<TRun extends ThinkExecutionRun = ThinkExecutionRun>({
|
|
@@ -14,7 +15,7 @@ declare function ThinkRoutineRuns<TRun extends ThinkExecutionRun = ThinkExecutio
|
|
|
14
15
|
runs,
|
|
15
16
|
title,
|
|
16
17
|
emptyState,
|
|
17
|
-
|
|
18
|
+
renderRunLink,
|
|
18
19
|
ref,
|
|
19
20
|
...props
|
|
20
21
|
}: ThinkRoutineRunsProps<TRun> & {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
3
|
+
import { buttonVariants } from "./Button.js";
|
|
3
4
|
import { Badge } from "./Badge.js";
|
|
4
5
|
import { formatThinkExecutionShortTimestamp, getThinkExecutionRunId, getThinkExecutionRunStatus, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
5
6
|
import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
|
|
6
7
|
import * as React from "react";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/ThinkRoutineRuns.tsx
|
|
9
10
|
/** Compact execution history shared by routine detail surfaces. */
|
|
10
|
-
function ThinkRoutineRuns({ className, runs, title = "Recent runs", emptyState = "Run this schedule now or wait for its next occurrence.",
|
|
11
|
+
function ThinkRoutineRuns({ className, runs, title = "Recent runs", emptyState = "Run this schedule now or wait for its next occurrence.", renderRunLink, ref, ...props }) {
|
|
11
12
|
const titleId = React.useId();
|
|
12
13
|
return /* @__PURE__ */ jsxs("section", {
|
|
13
14
|
ref,
|
|
@@ -31,30 +32,36 @@ function ThinkRoutineRuns({ className, runs, title = "Recent runs", emptyState =
|
|
|
31
32
|
children: runs.map((run) => {
|
|
32
33
|
const status = getThinkExecutionRunStatus(run);
|
|
33
34
|
const kind = isThinkSubmissionRun(run) ? "submission" : "workflow";
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(ThinkExecutionStatus, {
|
|
37
|
+
run,
|
|
38
|
+
className: "think-routine-library__run-marker"
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx("strong", { children: formatThinkExecutionShortTimestamp(run.createdAt, "Not scheduled") }) }),
|
|
41
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
42
|
+
className: "think-routine-library__run-kind",
|
|
38
43
|
variant: "ghost",
|
|
39
44
|
color: "neutral",
|
|
40
45
|
size: "sm",
|
|
46
|
+
children: kind
|
|
47
|
+
})
|
|
48
|
+
] });
|
|
49
|
+
const runClassName = buttonVariants({
|
|
50
|
+
variant: "ghost",
|
|
51
|
+
color: "neutral",
|
|
52
|
+
size: "sm",
|
|
53
|
+
className: "think-routine-library__run"
|
|
54
|
+
});
|
|
55
|
+
return /* @__PURE__ */ jsx("li", {
|
|
56
|
+
"data-status": status,
|
|
57
|
+
children: renderRunLink ? /* @__PURE__ */ jsx(NavigationLink, {
|
|
58
|
+
render: renderRunLink(run),
|
|
59
|
+
className: runClassName,
|
|
60
|
+
"aria-label": `Open ${kind} ${getThinkExecutionRunId(run)}`,
|
|
61
|
+
children: content
|
|
62
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
41
63
|
className: "think-routine-library__run",
|
|
42
|
-
|
|
43
|
-
onClick: onRunSelect ? () => onRunSelect(run) : void 0,
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ jsx(ThinkExecutionStatus, {
|
|
46
|
-
run,
|
|
47
|
-
className: "think-routine-library__run-marker"
|
|
48
|
-
}),
|
|
49
|
-
/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx("strong", { children: formatThinkExecutionShortTimestamp(run.createdAt, "Not scheduled") }) }),
|
|
50
|
-
/* @__PURE__ */ jsx(Badge, {
|
|
51
|
-
className: "think-routine-library__run-kind",
|
|
52
|
-
variant: "ghost",
|
|
53
|
-
color: "neutral",
|
|
54
|
-
size: "sm",
|
|
55
|
-
children: kind
|
|
56
|
-
})
|
|
57
|
-
]
|
|
64
|
+
children: content
|
|
58
65
|
})
|
|
59
66
|
}, `${kind}:${getThinkExecutionRunId(run)}`);
|
|
60
67
|
})
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
//#region src/components/ThinkThreadPicker.d.ts
|
|
4
4
|
interface ThinkThreadItem {
|
|
5
|
-
/** Stable child-agent/thread id
|
|
5
|
+
/** Stable child-agent/thread id used by the app-authored link's route params. */
|
|
6
6
|
id: string;
|
|
7
7
|
/** Human-readable thread title, usually generated by the parent Think agent. */
|
|
8
8
|
title: string;
|
|
@@ -31,15 +31,20 @@ interface ThinkThreadStatusIndicatorsProps {
|
|
|
31
31
|
summary: ThinkThreadStatusSummary;
|
|
32
32
|
className?: string;
|
|
33
33
|
}
|
|
34
|
-
interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "
|
|
34
|
+
interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
|
|
35
35
|
/** Threads from the parent agent, already sorted in the order the app wants to show. */
|
|
36
36
|
threads: readonly ThinkThreadItem[];
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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;
|
|
41
44
|
/** Optional parent-agent create action, usually `parent.stub.createThread()`. */
|
|
42
45
|
onCreate?: () => void | Promise<void>;
|
|
46
|
+
/** Optional parent-agent delete action, usually `parent.stub.deleteThread(thread.id)`. */
|
|
47
|
+
onDelete?: (thread: ThinkThreadItem) => void | Promise<void>;
|
|
43
48
|
/** Visible heading for the roster. */
|
|
44
49
|
title?: React.ReactNode;
|
|
45
50
|
/** Accessible label for the list navigation. */
|
|
@@ -54,15 +59,16 @@ declare function ThinkThreadStatusIndicators({
|
|
|
54
59
|
* Thread roster UI for sub-agent chat apps.
|
|
55
60
|
*
|
|
56
61
|
* This component does not call Think or Cloudflare RPC methods directly. Feed
|
|
57
|
-
* it from the parent agent's roster method, then
|
|
58
|
-
* child `useAgent({ sub: [...] })` name. Keep backend contract
|
|
59
|
-
* parent Think agent because
|
|
62
|
+
* it from the parent agent's roster method, then render app-owned route links
|
|
63
|
+
* that select the child `useAgent({ sub: [...] })` name. Keep backend contract
|
|
64
|
+
* notes beside the parent Think agent because
|
|
65
|
+
* `listThreads()`/`createThread()`/`deleteThread()` are app-owned.
|
|
60
66
|
*/
|
|
61
67
|
declare function ThinkThreadPicker({
|
|
62
68
|
threads,
|
|
63
|
-
|
|
64
|
-
onSelect,
|
|
69
|
+
renderThreadLink,
|
|
65
70
|
onCreate,
|
|
71
|
+
onDelete,
|
|
66
72
|
className,
|
|
67
73
|
title,
|
|
68
74
|
"aria-label": ariaLabel,
|