@mcp-b/react-components 0.17.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/dist/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
  2. package/dist/{AgentChat-CRuMi1Pb.d.ts → AgentChat-ClxViuUM.d.ts} +1 -20
  3. package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
  4. package/dist/{CodeBlock-Co1noLbC.js → CodeBlock-Bb-IPBc_.js} +9 -6
  5. package/dist/{CodeBlock-Dnpr88ZQ.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
  6. package/dist/{FileTree-B7bBsUyU.js → FileTree-CUlXfnmc.js} +42 -16
  7. package/dist/{Message-C4eYRogZ.js → Message-rZEaaD8Q.js} +13 -20
  8. package/dist/{ModelSelector-BNrZlY_Y.js → ModelSelector-4GsCWcZV.js} +15 -22
  9. package/dist/{PromptInput-OLfXPuHM.d.ts → PromptInput-Bdh9pqlo.d.ts} +4 -6
  10. package/dist/{Select-CwSqP07Y.d.ts → Select-B_13gg_J.d.ts} +2 -2
  11. package/dist/{Tabs-9zddXDQo.d.ts → Tabs-ColWK-XA.d.ts} +10 -2
  12. package/dist/{ThinkChat-DInElus-.js → ThinkChat-15EhfvYJ.js} +84 -61
  13. package/dist/{ThinkChatActivity-BgesTfZ4.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +4 -7
  14. package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
  15. package/dist/{Toggle-DaXpe1Lc.d.ts → Toggle-JKZ43D5S.d.ts} +1 -1
  16. package/dist/{ToggleGroup-yseEWkOC.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +2 -2
  17. package/dist/Workspace-Jez8ffUj.d.ts +274 -0
  18. package/dist/{WorkspaceExplorer-sZewzT2O.d.ts → WorkspaceExplorer-B9dQWNVK.d.ts} +2 -2
  19. package/dist/{WorkspaceFile-C8UzuSH4.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
  20. package/dist/{WorkspaceFileView-DNdGAEiX.js → WorkspaceFileView-CEdArlOT.js} +120 -127
  21. package/dist/{WorkspaceLink-B1ykV1dS.js → WorkspaceLink-BYYeTQLf.js} +6 -27
  22. package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
  23. package/dist/{class-names-Bk-QLWWI.js → class-names-BiMDVpUo.js} +4 -1
  24. package/dist/components/Accordion.js +7 -2
  25. package/dist/components/Activity.js +2 -2
  26. package/dist/components/AgentActivity.d.ts +1 -1
  27. package/dist/components/AgentActivity.js +4 -5
  28. package/dist/components/AgentActivityPreview.d.ts +9 -9
  29. package/dist/components/AgentActivityPreview.js +8 -12
  30. package/dist/components/AgentAttention.d.ts +1 -1
  31. package/dist/components/AgentAttention.js +1 -1
  32. package/dist/components/AgentChat.d.ts +1 -1
  33. package/dist/components/AgentChat.js +94 -62
  34. package/dist/components/AgentChatMessageEditor.js +2 -2
  35. package/dist/components/AgentChatTurnError.js +2 -2
  36. package/dist/components/AgentConnection.js +3 -3
  37. package/dist/components/AgentMessageParts.js +1 -1
  38. package/dist/components/AgentToolDetail.d.ts +6 -4
  39. package/dist/components/AgentToolDetail.js +12 -10
  40. package/dist/components/AlertDialog.js +1 -1
  41. package/dist/components/AppTopBar.d.ts +24 -7
  42. package/dist/components/AppTopBar.js +32 -8
  43. package/dist/components/Approval.js +4 -4
  44. package/dist/components/Artifact.d.ts +1 -1
  45. package/dist/components/Artifact.js +6 -4
  46. package/dist/components/Autocomplete.js +1 -1
  47. package/dist/components/Avatar.d.ts +1 -1
  48. package/dist/components/Avatar.js +2 -2
  49. package/dist/components/Badge.js +3 -0
  50. package/dist/components/BrowserLiveView.js +27 -12
  51. package/dist/components/BrowserReplay.js +4 -3
  52. package/dist/components/BrowserRunPanel.js +5 -5
  53. package/dist/components/Button.d.ts +1 -1
  54. package/dist/components/Button.js +14 -11
  55. package/dist/components/Card.d.ts +7 -8
  56. package/dist/components/Card.js +19 -10
  57. package/dist/components/ChainOfThought.d.ts +1 -1
  58. package/dist/components/ChainOfThought.js +2 -2
  59. package/dist/components/ChatGptSignInScreen.js +8 -8
  60. package/dist/components/Checkbox.js +2 -2
  61. package/dist/components/CheckboxGroup.js +1 -1
  62. package/dist/components/Checkpoint.js +2 -2
  63. package/dist/components/CodeBlock.d.ts +1 -1
  64. package/dist/components/CodeBlock.js +1 -1
  65. package/dist/components/CodexModelSelector.js +35 -15
  66. package/dist/components/Collapsible.js +2 -2
  67. package/dist/components/Combobox.js +1 -1
  68. package/dist/components/Commit.d.ts +1 -1
  69. package/dist/components/Commit.js +3 -3
  70. package/dist/components/Context.js +1 -1
  71. package/dist/components/ContextMenu.js +2 -2
  72. package/dist/components/Conversation.d.ts +1 -1
  73. package/dist/components/Conversation.js +5 -4
  74. package/dist/components/DescriptionListParts.js +1 -1
  75. package/dist/components/Dialog.js +1 -1
  76. package/dist/components/EnvironmentVariables.d.ts +1 -1
  77. package/dist/components/EnvironmentVariables.js +3 -3
  78. package/dist/components/Field.js +5 -2
  79. package/dist/components/Fieldset.js +1 -1
  80. package/dist/components/FileTree.d.ts +6 -0
  81. package/dist/components/FileTree.js +1 -1
  82. package/dist/components/Form.js +1 -1
  83. package/dist/components/GithubMotionMark.js +1 -1
  84. package/dist/components/IconButton.d.ts +2 -3
  85. package/dist/components/IconButton.js +2 -1
  86. package/dist/components/InlineCitation.js +1 -1
  87. package/dist/components/Input.js +1 -1
  88. package/dist/components/Marker.js +1 -1
  89. package/dist/components/McpConnectionRequest.js +2 -2
  90. package/dist/components/McpServerPicker.js +2 -2
  91. package/dist/components/MediaPreviewCard.d.ts +103 -0
  92. package/dist/components/MediaPreviewCard.js +193 -0
  93. package/dist/components/Menu.js +1 -1
  94. package/dist/components/Menubar.js +2 -2
  95. package/dist/components/Message.d.ts +4 -1
  96. package/dist/components/Message.js +1 -1
  97. package/dist/components/MessageScroller.d.ts +1 -1
  98. package/dist/components/MessageScroller.js +5 -4
  99. package/dist/components/Meter.js +1 -1
  100. package/dist/components/ModelSelector.d.ts +4 -3
  101. package/dist/components/ModelSelector.js +1 -1
  102. package/dist/components/NavigationMenu.js +1 -1
  103. package/dist/components/NumberField.js +1 -1
  104. package/dist/components/Plan.js +2 -2
  105. package/dist/components/Popover.js +1 -1
  106. package/dist/components/PreviewCard.js +1 -1
  107. package/dist/components/PricingBillingToggle.js +1 -1
  108. package/dist/components/PricingFAQ.js +1 -1
  109. package/dist/components/PricingPage.js +2 -1
  110. package/dist/components/PricingPlanCard.js +4 -3
  111. package/dist/components/PricingUsageCalculator.js +2 -2
  112. package/dist/components/Progress.js +1 -1
  113. package/dist/components/PromptInput.d.ts +1 -1
  114. package/dist/components/PromptInput.js +31 -18
  115. package/dist/components/Queue.d.ts +1 -1
  116. package/dist/components/Queue.js +2 -3
  117. package/dist/components/RadioGroup.js +1 -1
  118. package/dist/components/Reasoning.js +3 -6
  119. package/dist/components/ResizableSidePanel.js +1 -1
  120. package/dist/components/ResponsiveSidebarShell.js +16 -10
  121. package/dist/components/ScrollArea.js +2 -1
  122. package/dist/components/SearchField.d.ts +43 -0
  123. package/dist/components/SearchField.js +52 -0
  124. package/dist/components/Select.d.ts +1 -1
  125. package/dist/components/Select.js +5 -6
  126. package/dist/components/Separator.js +1 -1
  127. package/dist/components/Slider.js +1 -1
  128. package/dist/components/Sources.js +2 -2
  129. package/dist/components/Stepper.js +16 -9
  130. package/dist/components/SubagentRunDetails.js +1 -1
  131. package/dist/components/SubagentRunIndicator.js +2 -2
  132. package/dist/components/SubagentRunList.d.ts +3 -5
  133. package/dist/components/SubagentRunList.js +3 -4
  134. package/dist/components/SubagentRunSelector.d.ts +8 -12
  135. package/dist/components/SubagentRunSelector.js +17 -20
  136. package/dist/components/Switch.d.ts +2 -2
  137. package/dist/components/Switch.js +4 -5
  138. package/dist/components/Tabs.d.ts +2 -2
  139. package/dist/components/Tabs.js +12 -3
  140. package/dist/components/Task.js +2 -2
  141. package/dist/components/Terminal.d.ts +2 -2
  142. package/dist/components/Terminal.js +5 -4
  143. package/dist/components/TestResults.js +10 -6
  144. package/dist/components/Textarea.js +1 -1
  145. package/dist/components/ThemeModeControl.js +1 -1
  146. package/dist/components/ThinkChat.d.ts +33 -20
  147. package/dist/components/ThinkChat.js +4 -4
  148. package/dist/components/ThinkChatActivity.d.ts +2 -2
  149. package/dist/components/ThinkChatActivity.js +8 -10
  150. package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
  151. package/dist/components/ThinkChatActivitySummary.js +7 -3
  152. package/dist/components/ThinkChatToolPanels.js +26 -16
  153. package/dist/components/ThinkExecutionDetail.js +2 -2
  154. package/dist/components/ThinkExecutionStatus.js +2 -2
  155. package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
  156. package/dist/components/ThinkExecutionWorkbench.js +70 -134
  157. package/dist/components/ThinkFullApp.d.ts +36 -35
  158. package/dist/components/ThinkFullApp.js +156 -109
  159. package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
  160. package/dist/components/ThinkFullAppViewSwitch.js +1 -1
  161. package/dist/components/ThinkRecoveryNotice.js +18 -12
  162. package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
  163. package/dist/components/ThinkRoutineBrowser.js +33 -40
  164. package/dist/components/ThinkRoutineDetail.d.ts +5 -2
  165. package/dist/components/ThinkRoutineDetail.js +4 -4
  166. package/dist/components/ThinkRoutineForm.d.ts +3 -2
  167. package/dist/components/ThinkRoutineForm.js +11 -10
  168. package/dist/components/ThinkRoutineLibrary.d.ts +24 -31
  169. package/dist/components/ThinkRoutineLibrary.js +57 -80
  170. package/dist/components/ThinkRoutineRuns.d.ts +3 -2
  171. package/dist/components/ThinkRoutineRuns.js +31 -24
  172. package/dist/components/ThinkThreadPicker.d.ts +17 -11
  173. package/dist/components/ThinkThreadPicker.js +163 -39
  174. package/dist/components/Toast.js +1 -1
  175. package/dist/components/Toggle.d.ts +1 -1
  176. package/dist/components/Toggle.js +9 -7
  177. package/dist/components/ToggleGroup.d.ts +1 -1
  178. package/dist/components/ToggleGroup.js +15 -13
  179. package/dist/components/ToolInvocation.js +1 -1
  180. package/dist/components/Toolbar.js +1 -1
  181. package/dist/components/Tooltip.d.ts +8 -1
  182. package/dist/components/Tooltip.js +11 -2
  183. package/dist/components/TransitionSurface.d.ts +27 -0
  184. package/dist/components/TransitionSurface.js +20 -0
  185. package/dist/components/WebPreview.d.ts +5 -5
  186. package/dist/components/WebPreview.js +68 -54
  187. package/dist/components/Workspace.d.ts +2 -2
  188. package/dist/components/Workspace.js +358 -328
  189. package/dist/components/WorkspaceBrowser.d.ts +4 -7
  190. package/dist/components/WorkspaceBrowser.js +15 -25
  191. package/dist/components/WorkspaceExplorer.d.ts +5 -5
  192. package/dist/components/WorkspaceExplorer.js +19 -32
  193. package/dist/components/WorkspaceFile.d.ts +1 -1
  194. package/dist/components/WorkspaceFileView.d.ts +14 -2
  195. package/dist/components/WorkspaceFileView.js +1 -1
  196. package/dist/components/WorkspaceHeader.d.ts +0 -8
  197. package/dist/components/WorkspaceHeader.js +3 -15
  198. package/dist/components/WorkspaceLink.d.ts +1 -1
  199. package/dist/components/WorkspaceLink.js +1 -1
  200. package/dist/components/icons.d.ts +2 -2
  201. package/dist/components/icons.js +2 -2
  202. package/dist/{copy-button-cYsJBauI.js → copy-button-BtRwhRks.js} +3 -2
  203. package/dist/{copy-button-CQx3LQAC.d.ts → copy-button-D7aAYA-2.d.ts} +1 -1
  204. package/dist/{icons--FqCZEc3.js → icons-DKXiSepE.js} +7 -3
  205. package/dist/{icons-DpUqY8Mp.d.ts → icons-DkRtZmvT.d.ts} +22 -2
  206. package/dist/navigation-link-Cob7KBlM.js +19 -0
  207. package/dist/styles/accordion.css +4 -19
  208. package/dist/styles/activity.css +48 -56
  209. package/dist/styles/agent-activity-preview.css +2 -0
  210. package/dist/styles/agent-chat.css +14 -22
  211. package/dist/styles/alert-dialog.css +16 -18
  212. package/dist/styles/app-top-bar.css +17 -9
  213. package/dist/styles/approval.css +11 -6
  214. package/dist/styles/artifact.css +6 -6
  215. package/dist/styles/autocomplete.css +2 -1
  216. package/dist/styles/avatar.css +35 -30
  217. package/dist/styles/badge.css +10 -10
  218. package/dist/styles/base-ui-motion.css +94 -39
  219. package/dist/styles/browser-control-overlay.css +0 -1
  220. package/dist/styles/browser-live-view.css +39 -22
  221. package/dist/styles/browser-replay.css +1 -1
  222. package/dist/styles/browser-run-panel.css +8 -4
  223. package/dist/styles/button.css +36 -33
  224. package/dist/styles/card.css +5 -6
  225. package/dist/styles/chain-of-thought.css +22 -16
  226. package/dist/styles/checkbox.css +18 -5
  227. package/dist/styles/codex-model-selector.css +46 -8
  228. package/dist/styles/collapsible.css +10 -10
  229. package/dist/styles/combobox.css +3 -2
  230. package/dist/styles/commit.css +19 -18
  231. package/dist/styles/composition-motion.css +83 -0
  232. package/dist/styles/context-menu.css +3 -3
  233. package/dist/styles/context.css +11 -10
  234. package/dist/styles/conversation.css +18 -23
  235. package/dist/styles/dialog.css +15 -15
  236. package/dist/styles/field.css +32 -12
  237. package/dist/styles/file-tree.css +69 -9
  238. package/dist/styles/form.css +1 -1
  239. package/dist/styles/index.css +5 -0
  240. package/dist/styles/input.css +2 -2
  241. package/dist/styles/marker.css +14 -13
  242. package/dist/styles/mcp-server-picker.css +20 -17
  243. package/dist/styles/media-preview-card.css +160 -0
  244. package/dist/styles/menu.css +11 -11
  245. package/dist/styles/menubar.css +12 -11
  246. package/dist/styles/message.css +27 -21
  247. package/dist/styles/meter.css +2 -2
  248. package/dist/styles/model-selector.css +16 -14
  249. package/dist/styles/motion-reduction.css +29 -0
  250. package/dist/styles/navigation-menu.css +14 -30
  251. package/dist/styles/number-field.css +22 -4
  252. package/dist/styles/plan.css +5 -0
  253. package/dist/styles/popover.css +15 -16
  254. package/dist/styles/preview-card.css +2 -32
  255. package/dist/styles/progress.css +8 -3
  256. package/dist/styles/prompt-input.css +87 -70
  257. package/dist/styles/queue.css +48 -32
  258. package/dist/styles/radio.css +19 -12
  259. package/dist/styles/reasoning.css +2 -1
  260. package/dist/styles/recipes.css +109 -37
  261. package/dist/styles/resizable-side-panel.css +4 -10
  262. package/dist/styles/responsive-sidebar-shell.css +16 -15
  263. package/dist/styles/scroll-area.css +32 -15
  264. package/dist/styles/search-field.css +21 -0
  265. package/dist/styles/select.css +19 -12
  266. package/dist/styles/slider.css +25 -29
  267. package/dist/styles/sources.css +3 -3
  268. package/dist/styles/stepper.css +36 -26
  269. package/dist/styles/subagent-run.css +1 -1
  270. package/dist/styles/switch.css +32 -29
  271. package/dist/styles/tabs.css +79 -23
  272. package/dist/styles/task.css +13 -9
  273. package/dist/styles/test-results.css +29 -23
  274. package/dist/styles/theme-mode-control.css +8 -0
  275. package/dist/styles/think-execution-workbench.css +18 -15
  276. package/dist/styles/think-full-app.css +45 -68
  277. package/dist/styles/think-routine-library.css +43 -24
  278. package/dist/styles/think-thread-picker.css +193 -51
  279. package/dist/styles/toast.css +48 -27
  280. package/dist/styles/toggle-group.css +2 -36
  281. package/dist/styles/toggle.css +29 -5
  282. package/dist/styles/toolbar.css +25 -27
  283. package/dist/styles/tooltip.css +2 -32
  284. package/dist/styles/transition-surface.css +55 -0
  285. package/dist/styles/workspace-explorer.css +99 -44
  286. package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
  287. package/dist/utils/codex-model-catalog.d.ts +2 -8
  288. package/dist/utils/codex-model-catalog.js +2 -16
  289. package/dist/utils/mcp-server-catalog.d.ts +139 -0
  290. package/dist/utils/mcp-server-catalog.js +98 -0
  291. package/dist/utils/structured-code.d.ts +1 -1
  292. package/package.json +13 -7
  293. package/dist/Workspace-C9RFoxcu.d.ts +0 -62
  294. package/dist/summarize-tool-input-BUJsENSn.js +0 -12
@@ -5,16 +5,19 @@ import * as React from "react";
5
5
  interface ThinkRoutineDetailProps<TRoutine extends ThinkRoutine = ThinkRoutine> extends React.HTMLAttributes<HTMLElement> {
6
6
  routine: TRoutine;
7
7
  busy?: boolean;
8
+ showOwner?: boolean;
8
9
  onEnabledChange?: (enabled: boolean) => void;
9
- onRunSelect?: (run: ThinkRoutineRunOf<TRoutine>) => void;
10
+ /** App-authored TanStack Router Link for each recent execution. */
11
+ renderRunLink?: (run: ThinkRoutineRunOf<TRoutine>) => React.ReactElement;
10
12
  }
11
13
  /** Readable definition, schedule settings, and recent executions for one routine. */
12
14
  declare function ThinkRoutineDetail<TRoutine extends ThinkRoutine = ThinkRoutine>({
13
15
  busy,
14
16
  className,
15
17
  routine,
18
+ showOwner,
16
19
  onEnabledChange,
17
- onRunSelect,
20
+ renderRunLink,
18
21
  ref,
19
22
  ...props
20
23
  }: ThinkRoutineDetailProps<TRoutine> & {
@@ -1,4 +1,4 @@
1
- import { t as cx } from "../class-names-Bk-QLWWI.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
2
  import { Badge } from "./Badge.js";
3
3
  import { Switch } from "./Switch.js";
4
4
  import { getThinkRoutineNextRun } from "./ThinkRoutine.js";
@@ -10,7 +10,7 @@ function taskInstructions(routine) {
10
10
  return typeof routine.task.prompt === "string" ? routine.task.prompt : "Runs an app-defined scheduled handler.";
11
11
  }
12
12
  /** Readable definition, schedule settings, and recent executions for one routine. */
13
- function ThinkRoutineDetail({ busy = false, className, routine, onEnabledChange, onRunSelect, ref, ...props }) {
13
+ function ThinkRoutineDetail({ busy = false, className, routine, showOwner = true, onEnabledChange, renderRunLink, ref, ...props }) {
14
14
  const titleId = React.useId();
15
15
  const definitionId = React.useId();
16
16
  const settingsId = React.useId();
@@ -72,7 +72,7 @@ function ThinkRoutineDetail({ busy = false, className, routine, onEnabledChange,
72
72
  children: [
73
73
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "Repeats" }), /* @__PURE__ */ jsx("dd", { children: routine.task.schedule })] }),
74
74
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "Next run" }), /* @__PURE__ */ jsx("dd", { children: getThinkRoutineNextRun(routine) })] }),
75
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "Agent" }), /* @__PURE__ */ jsx("dd", { children: routine.owner.name })] })
75
+ showOwner ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "Agent" }), /* @__PURE__ */ jsx("dd", { children: routine.owner.name })] }) : null
76
76
  ]
77
77
  }),
78
78
  /* @__PURE__ */ jsxs("div", {
@@ -93,7 +93,7 @@ function ThinkRoutineDetail({ busy = false, className, routine, onEnabledChange,
93
93
  }),
94
94
  /* @__PURE__ */ jsx(ThinkRoutineRuns, {
95
95
  runs: routine.runs,
96
- onRunSelect
96
+ renderRunLink
97
97
  })
98
98
  ]
99
99
  });
@@ -12,15 +12,16 @@ interface ThinkRoutineFormProps extends React.HTMLAttributes<HTMLElement> {
12
12
  * `getDefaultTimezone()` own wall-clock fallback behavior.
13
13
  */
14
14
  schedules: readonly ThinkScheduledTaskSchedule[];
15
- onCancel?: () => void;
15
+ /** App-authored TanStack Router Link to the routine catalog. */
16
+ cancelLink?: React.ReactElement;
16
17
  onCreate: (request: ThinkRoutineCreateRequest) => void;
17
18
  }
18
19
  /** Authoring surface for a serializable, prompt-based Think scheduled task. */
19
20
  declare function ThinkRoutineForm({
20
21
  busy,
22
+ cancelLink,
21
23
  className,
22
24
  owners,
23
- onCancel,
24
25
  onCreate,
25
26
  schedules,
26
27
  ref,
@@ -1,6 +1,7 @@
1
- import { t as cx } from "../class-names-Bk-QLWWI.js";
2
- import { V as SpinnerIcon } from "../icons--FqCZEc3.js";
3
- import { Button } from "./Button.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import { K as SpinnerIcon } from "../icons-DKXiSepE.js";
3
+ import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
4
+ import { Button, buttonVariants } from "./Button.js";
4
5
  import { Field } from "./Field.js";
5
6
  import { Form } from "./Form.js";
6
7
  import { Textarea } from "./Textarea.js";
@@ -32,7 +33,7 @@ function RoutineSelect({ label, onValueChange, options, value }) {
32
33
  });
33
34
  }
34
35
  /** Authoring surface for a serializable, prompt-based Think scheduled task. */
35
- function ThinkRoutineForm({ busy = false, className, owners, onCancel, onCreate, schedules, ref, ...props }) {
36
+ function ThinkRoutineForm({ busy = false, cancelLink, className, owners, onCreate, schedules, ref, ...props }) {
36
37
  const [name, setName] = React.useState("");
37
38
  const [ownerId, setOwnerId] = React.useState(owners[0]?.id ?? "");
38
39
  const [prompt, setPrompt] = React.useState("");
@@ -131,12 +132,12 @@ function ThinkRoutineForm({ busy = false, className, owners, onCancel, onCreate,
131
132
  })
132
133
  ] }), /* @__PURE__ */ jsxs("footer", {
133
134
  className: "think-routine-library__form-actions",
134
- children: [onCancel ? /* @__PURE__ */ jsx(Button, {
135
- type: "button",
136
- variant: "ghost",
137
- color: "neutral",
138
- disabled: busy,
139
- onClick: onCancel,
135
+ children: [cancelLink ? /* @__PURE__ */ jsx(NavigationLink, {
136
+ render: cancelLink,
137
+ className: buttonVariants({
138
+ variant: "ghost",
139
+ color: "neutral"
140
+ }),
140
141
  children: "Cancel"
141
142
  }) : null, /* @__PURE__ */ jsxs(Button, {
142
143
  type: "submit",
@@ -1,7 +1,6 @@
1
1
  import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
2
2
  import { ThinkRoutine, ThinkRoutineCreateRequest, ThinkRoutineOwner, ThinkRoutineRunOf } from "./ThinkRoutine.js";
3
3
  import * as React from "react";
4
- import { ThinkScheduledTaskSchedule } from "@cloudflare/think";
5
4
 
6
5
  //#region src/components/ThinkRoutineLibrary.d.ts
7
6
  interface ThinkRoutineLibraryDetailRenderProps<TRoutine extends ThinkRoutine = ThinkRoutine> {
@@ -12,37 +11,33 @@ interface ThinkRoutineLibraryDetailRenderProps<TRoutine extends ThinkRoutine = T
12
11
  /** Custom detail surfaces must honor this while invoking the supplied actions. */
13
12
  busy: boolean;
14
13
  onEnabledChange?: (enabled: boolean) => void;
15
- onRunSelect?: (run: ThinkRoutineRunOf<TRoutine>) => void;
14
+ renderRunLink?: (run: ThinkRoutineRunOf<TRoutine>) => React.ReactElement;
16
15
  }
17
16
  interface ThinkRoutineLibraryProps<TRoutine extends ThinkRoutine = ThinkRoutine> extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
18
17
  /** App-owned routine catalog assembled from native Think and Agents records. */
19
18
  routines: readonly TRoutine[];
20
- /** Agents available as owners when authoring a routine. */
21
- owners: readonly ThinkRoutineOwner[];
22
- /** Upstream Think schedule DSL values offered by the composed authoring form. */
23
- schedules: readonly ThinkScheduledTaskSchedule[];
24
- /** Selected routine id when selection is controlled by the host app. */
25
- selectedRoutineId?: string;
26
- /** Initial routine id when the library owns selection state. */
27
- defaultSelectedRoutineId?: string;
28
- /** Called when the user selects a routine from the collection. */
29
- onSelectedRoutineIdChange?: (routineId: string) => void;
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 to show routine owners in the browser 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;
30
33
  /** Product navigation rendered after the built-in schedule navigation control. */
31
34
  appBarLeading?: React.ReactNode;
32
- /** Opens a host-owned create route instead of the library's built-in form. */
33
- onCreateRoutineRequest?: () => void;
34
- /** Creates an app-owned routine from a whole native Think scheduled task. */
35
- onCreateRoutine?: (request: ThinkRoutineCreateRequest) => void | Promise<void>;
36
- /** Opens a host-owned editor for the selected routine. */
37
- onEditRoutine?: (routine: TRoutine) => void;
38
35
  /** Starts the selected routine immediately. */
39
36
  onRunRoutine?: (routine: TRoutine) => void | Promise<void>;
40
37
  /** Activates or pauses the selected app-owned routine. */
41
38
  onRoutineEnabledChange?: (routine: TRoutine, enabled: boolean) => void | Promise<void>;
42
39
  /** Permanently removes the selected app-owned routine. */
43
40
  onDeleteRoutine?: (routine: TRoutine) => void | Promise<void>;
44
- /** Opens one native Workflow or submission from the selected routine history. */
45
- onRunSelect?: (routine: TRoutine, run: ThinkRoutineRunOf<TRoutine>) => void;
46
41
  /**
47
42
  * Replaces only the selected-routine surface while preserving the library
48
43
  * shell, navigation, actions, async state, and upstream routine contract.
@@ -52,29 +47,27 @@ interface ThinkRoutineLibraryProps<TRoutine extends ThinkRoutine = ThinkRoutine>
52
47
  /**
53
48
  * Full-page, cross-agent routine library. This intentionally does not live in
54
49
  * ThinkFullApp's per-thread workbench: the host app owns aggregation, routes,
55
- * authoring callables, and the association between schedules and native runs.
50
+ * authoring routes, and the association between schedules and native runs.
56
51
  * The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
57
- * `ThinkRoutineRuns`, and `ThinkRoutineForm`; consumers may also use those
58
- * surfaces independently.
52
+ * and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
53
+ * route and may also use these surfaces independently.
59
54
  */
60
55
  declare function ThinkRoutineLibrary<TRoutine extends ThinkRoutine = ThinkRoutine>({
61
56
  appBarLeading,
62
57
  className,
63
- defaultSelectedRoutineId,
64
- onCreateRoutine,
65
- onCreateRoutineRequest,
58
+ createRoutineLink,
59
+ error: catalogError,
66
60
  onDeleteRoutine,
67
- onEditRoutine,
68
61
  onRoutineEnabledChange,
69
62
  onRunRoutine,
70
- onRunSelect,
71
- onSelectedRoutineIdChange,
72
- owners,
63
+ renderEditRoutineLink,
64
+ renderRoutineLink,
73
65
  renderRoutineDetail,
74
- schedules,
66
+ renderRunLink,
75
67
  ref,
76
68
  routines,
77
69
  selectedRoutineId,
70
+ showOwner,
78
71
  ...props
79
72
  }: ThinkRoutineLibraryProps<TRoutine> & {
80
73
  ref?: React.Ref<HTMLDivElement>;
@@ -1,23 +1,23 @@
1
- import { t as cx } from "../class-names-Bk-QLWWI.js";
2
- import { F as PlayIcon, J as WarningIcon, V as SpinnerIcon, g as EllipsisIcon, n as ArrowLeftIcon } from "../icons--FqCZEc3.js";
3
- import { Button } from "./Button.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import { B as PlayIcon, K as SpinnerIcon, Q as WarningIcon, d as ChevronDownIcon, y as EllipsisIcon } from "../icons-DKXiSepE.js";
3
+ import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
4
+ import { Button, buttonVariants } from "./Button.js";
4
5
  import { Menu } from "./Menu.js";
5
6
  import { AppTopBar } from "./AppTopBar.js";
6
7
  import { AlertDialog } from "./AlertDialog.js";
7
8
  import { ResponsiveSidebarShell } from "./ResponsiveSidebarShell.js";
8
9
  import { ThinkRoutineBrowser } from "./ThinkRoutineBrowser.js";
9
10
  import { ThinkRoutineDetail } from "./ThinkRoutineDetail.js";
10
- import { ThinkRoutineForm } from "./ThinkRoutineForm.js";
11
11
  import * as React from "react";
12
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
13
  //#region src/components/ThinkRoutineLibrary.tsx
14
14
  function errorMessage(error) {
15
15
  return error instanceof Error ? error.message : String(error);
16
16
  }
17
- function RoutineTopBarActions({ busy, onDelete, onEdit, onRun, routineName }) {
17
+ function RoutineTopBarActions({ busy, onDelete, editLink, onRun, routineName }) {
18
18
  const [deleteOpen, setDeleteOpen] = React.useState(false);
19
19
  const moreActionsRef = React.useRef(null);
20
- const hasMenu = Boolean(onEdit || onDelete);
20
+ const hasMenu = Boolean(editLink || onDelete);
21
21
  if (!onRun && !hasMenu) return null;
22
22
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(AppTopBar.Trailing, {
23
23
  "aria-label": "Schedule actions",
@@ -39,8 +39,8 @@ function RoutineTopBarActions({ busy, onDelete, onEdit, onRun, routineName }) {
39
39
  }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
40
40
  align: "end",
41
41
  sideOffset: 4,
42
- children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [onEdit ? /* @__PURE__ */ jsx(Menu.Item, {
43
- onClick: onEdit,
42
+ children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [editLink ? /* @__PURE__ */ jsx(Menu.Item, {
43
+ render: editLink,
44
44
  children: "Edit schedule"
45
45
  }) : null, onDelete ? /* @__PURE__ */ jsx(Menu.Item, {
46
46
  variant: "destructive",
@@ -77,33 +77,25 @@ function RoutineTopBarActions({ busy, onDelete, onEdit, onRun, routineName }) {
77
77
  /**
78
78
  * Full-page, cross-agent routine library. This intentionally does not live in
79
79
  * ThinkFullApp's per-thread workbench: the host app owns aggregation, routes,
80
- * authoring callables, and the association between schedules and native runs.
80
+ * authoring routes, and the association between schedules and native runs.
81
81
  * The application shell composes `ThinkRoutineBrowser`, `ThinkRoutineDetail`,
82
- * `ThinkRoutineRuns`, and `ThinkRoutineForm`; consumers may also use those
83
- * surfaces independently.
82
+ * and `ThinkRoutineRuns`; consumers compose `ThinkRoutineForm` in their create
83
+ * route and may also use these surfaces independently.
84
84
  */
85
- function ThinkRoutineLibrary({ appBarLeading, className, defaultSelectedRoutineId, onCreateRoutine, onCreateRoutineRequest, onDeleteRoutine, onEditRoutine, onRoutineEnabledChange, onRunRoutine, onRunSelect, onSelectedRoutineIdChange, owners, renderRoutineDetail, schedules, ref, routines, selectedRoutineId, ...props }) {
86
- const [view, setView] = React.useState("library");
87
- 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 }) {
88
86
  const [busy, setBusy] = React.useState(false);
89
87
  const [announcement, setAnnouncement] = React.useState("");
90
- const [error, setError] = React.useState(null);
91
- const activeId = selectedRoutineId ?? innerSelectedId;
92
- const selectedRoutine = routines.find((routine) => routine.id === activeId) ?? (selectedRoutineId === void 0 ? routines[0] : void 0);
93
- const requestCreate = onCreateRoutineRequest ?? (onCreateRoutine ? () => setView("create") : void 0);
94
- const selectRoutine = (id) => {
95
- if (selectedRoutineId === void 0) setInnerSelectedId(id);
96
- onSelectedRoutineIdChange?.(id);
97
- };
88
+ const [actionError, setActionError] = React.useState(null);
89
+ const selectedRoutine = selectedRoutineId ? routines.find((routine) => routine.id === selectedRoutineId) : void 0;
98
90
  const perform = async (action, message) => {
99
91
  setBusy(true);
100
- setError(null);
92
+ setActionError(null);
101
93
  try {
102
94
  await action();
103
95
  setAnnouncement(message);
104
96
  return true;
105
97
  } catch (nextError) {
106
- setError(errorMessage(nextError));
98
+ setActionError(errorMessage(nextError));
107
99
  return false;
108
100
  } finally {
109
101
  setBusy(false);
@@ -112,82 +104,60 @@ function ThinkRoutineLibrary({ appBarLeading, className, defaultSelectedRoutineI
112
104
  const detailProps = selectedRoutine ? {
113
105
  routine: selectedRoutine,
114
106
  busy,
115
- onRunSelect: onRunSelect ? (run) => onRunSelect(selectedRoutine, run) : void 0,
107
+ renderRunLink: renderRunLink ? (run) => renderRunLink(selectedRoutine, run) : void 0,
116
108
  onEnabledChange: onRoutineEnabledChange ? (enabled) => void perform(() => onRoutineEnabledChange(selectedRoutine, enabled), `${selectedRoutine.name} ${enabled ? "activated" : "paused"}.`) : void 0
117
109
  } : void 0;
118
- if (view === "create") return /* @__PURE__ */ jsxs("div", {
119
- ref,
120
- className: cx("think-routine-library", className),
121
- ...props,
122
- children: [
123
- error ? /* @__PURE__ */ jsxs("div", {
124
- className: "think-routine-library__error",
125
- role: "alert",
126
- children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: error })]
127
- }) : null,
128
- /* @__PURE__ */ jsxs(AppTopBar.Root, {
129
- "aria-label": "Schedule editor controls",
130
- children: [/* @__PURE__ */ jsxs(AppTopBar.Leading, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
131
- label: "Back to schedules",
132
- onClick: () => setView("library"),
133
- children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
134
- }), appBarLeading] }), /* @__PURE__ */ jsx(AppTopBar.Title, { children: "New schedule" })]
135
- }),
136
- /* @__PURE__ */ jsx(ThinkRoutineForm, {
137
- busy,
138
- owners,
139
- schedules,
140
- onCancel: () => setView("library"),
141
- onCreate: (request) => {
142
- if (!onCreateRoutine) return;
143
- perform(() => onCreateRoutine(request), `Created ${request.name}.`).then((created) => {
144
- if (created) setView("library");
145
- });
146
- }
147
- }),
148
- /* @__PURE__ */ jsx("div", {
149
- className: "think-routine-library__status sigvelo-visually-hidden",
150
- role: "status",
151
- "aria-atomic": "true",
152
- children: announcement
153
- })
154
- ]
155
- });
156
110
  return /* @__PURE__ */ jsxs("div", {
157
111
  ref,
158
112
  className: cx("think-routine-library", className),
159
113
  ...props,
160
114
  children: [
161
- error ? /* @__PURE__ */ jsxs("div", {
115
+ catalogError || actionError ? /* @__PURE__ */ jsxs("div", {
162
116
  className: "think-routine-library__error",
163
117
  role: "alert",
164
- children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: error })]
118
+ children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: catalogError || actionError })]
165
119
  }) : null,
166
120
  /* @__PURE__ */ jsx(ResponsiveSidebarShell, {
167
121
  className: "think-routine-library__layout",
168
122
  sidebarLabel: "schedules",
123
+ defaultSidebarOpen: false,
169
124
  toolbarLabel: "Schedule navigation controls",
170
125
  showMainLabel: "Show selected schedule",
171
- topBar: ({ sidebarToggle }) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
126
+ topBar: ({ sidebarId, sidebarOpen, sidebarToggle, toggleSidebar }) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
172
127
  "aria-label": "Schedule controls",
173
128
  children: [
174
129
  /* @__PURE__ */ jsxs(AppTopBar.Leading, { children: [sidebarToggle, appBarLeading] }),
175
- /* @__PURE__ */ jsx(AppTopBar.Title, { children: selectedRoutine?.name ?? "Schedules" }),
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] }),
176
144
  /* @__PURE__ */ jsx(RoutineTopBarActions, {
177
145
  busy,
178
146
  routineName: selectedRoutine?.name ?? "schedule",
147
+ editLink: selectedRoutine && renderEditRoutineLink ? renderEditRoutineLink(selectedRoutine) : void 0,
179
148
  onRun: selectedRoutine && onRunRoutine ? () => void perform(() => onRunRoutine(selectedRoutine), `Started ${selectedRoutine.name}.`) : void 0,
180
- onEdit: selectedRoutine && onEditRoutine ? () => onEditRoutine(selectedRoutine) : void 0,
181
149
  onDelete: selectedRoutine && onDeleteRoutine ? () => void perform(() => onDeleteRoutine(selectedRoutine), `Deleted ${selectedRoutine.name}.`) : void 0
182
150
  })
183
151
  ]
184
152
  }),
185
153
  sidebar: ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ThinkRoutineBrowser, {
186
154
  routines,
187
- selectedRoutineId: selectedRoutine?.id,
188
- onCreateRoutine: requestCreate,
189
- onSelectedRoutineIdChange: (id) => {
190
- selectRoutine(id);
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;
191
161
  closeSidebarOnCompact();
192
162
  }
193
163
  }),
@@ -195,17 +165,24 @@ function ThinkRoutineLibrary({ appBarLeading, className, defaultSelectedRoutineI
195
165
  className: "think-routine-library__main",
196
166
  children: detailProps ? /* @__PURE__ */ jsx(React.Fragment, { children: renderRoutineDetail ? renderRoutineDetail({
197
167
  ...detailProps,
198
- defaultDetail: /* @__PURE__ */ jsx(ThinkRoutineDetail, { ...detailProps })
199
- }) : /* @__PURE__ */ jsx(ThinkRoutineDetail, { ...detailProps }) }, detailProps.routine.id) : /* @__PURE__ */ jsxs("div", {
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", {
200
176
  className: "think-routine-library__empty-detail",
201
177
  children: [
202
- /* @__PURE__ */ jsx("h1", { children: routines.length ? "Schedule unavailable" : "No schedules yet" }),
178
+ /* @__PURE__ */ jsx("h1", { children: selectedRoutineId ? "Schedule unavailable" : routines.length ? "Select a schedule" : "No schedules yet" }),
203
179
  /* @__PURE__ */ jsx("p", { children: routines.length ? "Select an available schedule." : "Create a schedule to run recurring Think prompts." }),
204
- !routines.length && requestCreate ? /* @__PURE__ */ jsx(Button, {
205
- className: "think-routine-library__empty-action",
206
- type: "button",
207
- color: "primary",
208
- onClick: requestCreate,
180
+ !routines.length && createRoutineLink ? /* @__PURE__ */ jsx(NavigationLink, {
181
+ render: createRoutineLink,
182
+ className: buttonVariants({
183
+ color: "primary",
184
+ className: "think-routine-library__empty-action"
185
+ }),
209
186
  children: "Create schedule"
210
187
  }) : null
211
188
  ]
@@ -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
- onRunSelect?: (run: TRun) => void;
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
- onRunSelect,
18
+ renderRunLink,
18
19
  ref,
19
20
  ...props
20
21
  }: ThinkRoutineRunsProps<TRun> & {
@@ -1,13 +1,14 @@
1
- import { t as cx } from "../class-names-Bk-QLWWI.js";
2
- import { Button } from "./Button.js";
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.", onRunSelect, ref, ...props }) {
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
- return /* @__PURE__ */ jsx("li", {
35
- "data-status": status,
36
- children: /* @__PURE__ */ jsxs(Button, {
37
- type: "button",
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
- disabled: !onRunSelect,
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 passed back to the app's route state. */
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>, "onSelect" | "title"> {
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
- /** Selected child-agent/thread id. */
38
- selectedId?: string;
39
- /** Called when a thread row is selected; callers route this into `useAgent({ sub })`. */
40
- onSelect: (id: string) => void;
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 route `onSelect` into the
58
- * child `useAgent({ sub: [...] })` name. Keep backend contract notes beside the
59
- * parent Think agent because `listThreads()`/`createThread()` are app-owned.
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
- selectedId,
64
- onSelect,
69
+ renderThreadLink,
65
70
  onCreate,
71
+ onDelete,
66
72
  className,
67
73
  title,
68
74
  "aria-label": ariaLabel,