@mcp-b/react-components 0.46.7 → 0.47.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 (138) hide show
  1. package/dist/{CodeBlock-CcteqDvA.js → CodeBlock-DMHZiw86.js} +1 -1
  2. package/dist/{FileTree-jtP9471I.js → FileTree-BHebfvkK.js} +1 -1
  3. package/dist/{SetupChecklist-BXwSSorj.js → SetupChecklist-CwRjIDH4.js} +1 -1
  4. package/dist/ThinkChat-CwMdEum8.d.ts +185 -0
  5. package/dist/{ThinkChat-qztQ6Clo.js → ThinkChat-DLDta57t.js} +16 -16
  6. package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +91 -0
  7. package/dist/{Workspace-DZusrEeP.d.ts → Workspace-C_zHq9KZ.d.ts} +1 -1
  8. package/dist/{WorkspaceFileView-D0HyoUV8.js → WorkspaceFileView-ChIJz-fl.js} +4 -4
  9. package/dist/{WorkspaceLink-DtH66bAY.js → WorkspaceLink-B1d2GIGl.js} +7 -2
  10. package/dist/WorkspaceLive-DLGhtIly.d.ts +49 -0
  11. package/dist/{WorkspaceMessageResponse-CJCmGvTx.js → WorkspaceMessageResponse-Dg_aNpoj.js} +76 -40
  12. package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +48 -0
  13. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  14. package/dist/components/agents-sdk/AgentChat.js +10 -10
  15. package/dist/components/agents-sdk/AgentEvent.js +1 -1
  16. package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
  17. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  18. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  19. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  20. package/dist/components/agents-sdk/ManagerOffice.js +4 -4
  21. package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
  22. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  23. package/dist/components/agents-sdk/McpPluginCatalog.js +2 -2
  24. package/dist/components/agents-sdk/McpServerPicker.js +2 -2
  25. package/dist/components/agents-sdk/ModelSelector.js +3 -3
  26. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  27. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  28. package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
  29. package/dist/components/agents-sdk/SubagentRunSelector.js +1 -1
  30. package/dist/components/agents-sdk/ThinkChat.d.ts +1 -180
  31. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  32. package/dist/components/agents-sdk/ThinkChatActivity.js +1 -1
  33. package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
  34. package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
  35. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  36. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  37. package/dist/components/agents-sdk/ThinkFullApp.d.ts +13 -4
  38. package/dist/components/agents-sdk/ThinkFullApp.js +11 -4
  39. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
  40. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
  41. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
  42. package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
  43. package/dist/components/agents-sdk/ThinkRoutineForm.js +4 -4
  44. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +3 -3
  45. package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
  46. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +20 -5
  47. package/dist/components/agents-sdk/ThinkSidepanel.js +56 -44
  48. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +1 -90
  49. package/dist/components/agents-sdk/ThinkThreadPicker.js +4 -4
  50. package/dist/components/agents-sdk/Workspace.d.ts +2 -2
  51. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  52. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  53. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +44 -0
  54. package/dist/components/agents-sdk/WorkspaceConcept.js +42 -0
  55. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +100 -0
  56. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +429 -0
  57. package/dist/components/agents-sdk/WorkspaceExecution.d.ts +106 -0
  58. package/dist/components/agents-sdk/WorkspaceExecution.js +393 -0
  59. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
  60. package/dist/components/agents-sdk/WorkspaceExplorer.js +2 -2
  61. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  62. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  63. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  64. package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -0
  65. package/dist/components/agents-sdk/WorkspaceLive.js +85 -0
  66. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +2 -2
  67. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +2 -2
  68. package/dist/components/agents-sdk/WorkspaceMountManager.js +2 -2
  69. package/dist/components/agents-sdk/WorkspaceProject.d.ts +93 -0
  70. package/dist/components/agents-sdk/WorkspaceProject.js +201 -0
  71. package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +47 -0
  72. package/dist/components/agents-sdk/WorkspaceUserScript.js +146 -0
  73. package/dist/components/ai-sdk/Activity.js +1 -1
  74. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  75. package/dist/components/ai-sdk/Approval.js +2 -2
  76. package/dist/components/ai-sdk/Artifact.js +1 -1
  77. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  78. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  79. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  80. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  81. package/dist/components/ai-sdk/ComposerLink.d.ts +4 -1
  82. package/dist/components/ai-sdk/ComposerLink.js +4 -3
  83. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +22 -2
  84. package/dist/components/ai-sdk/ConnectedAppCards.js +50 -43
  85. package/dist/components/ai-sdk/Conversation.js +1 -1
  86. package/dist/components/ai-sdk/Goal.js +1 -1
  87. package/dist/components/ai-sdk/InlineCitation.js +1 -1
  88. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  89. package/dist/components/ai-sdk/Message.js +1 -1
  90. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  91. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  92. package/dist/components/ai-sdk/Plan.js +1 -1
  93. package/dist/components/ai-sdk/PromptInput.js +5 -5
  94. package/dist/components/ai-sdk/Queue.js +1 -1
  95. package/dist/components/ai-sdk/Reasoning.js +1 -1
  96. package/dist/components/ai-sdk/Sources.js +1 -1
  97. package/dist/components/ai-sdk/Task.js +1 -1
  98. package/dist/components/extension/ChatGptSignInScreen.js +1 -1
  99. package/dist/components/extension/CodexModelSelector.js +2 -2
  100. package/dist/components/extension/ConversationTabPicker.js +2 -2
  101. package/dist/components/foundations/Checkbox.js +1 -1
  102. package/dist/components/foundations/Collapsible.js +1 -1
  103. package/dist/components/foundations/ContextMenu.js +1 -1
  104. package/dist/components/foundations/Menubar.js +1 -1
  105. package/dist/components/foundations/SearchField.js +1 -1
  106. package/dist/components/foundations/Select.js +1 -1
  107. package/dist/components/foundations/Stepper.js +1 -1
  108. package/dist/components/foundations/Toast.js +1 -1
  109. package/dist/components/foundations/ToggleGroup.d.ts +1 -1
  110. package/dist/components/foundations/ToggleGroup.js +1 -1
  111. package/dist/components/foundations/icons.d.ts +2 -2
  112. package/dist/components/foundations/icons.js +2 -2
  113. package/dist/components/general-purpose/Commit.js +2 -2
  114. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  115. package/dist/components/general-purpose/FileTree.js +1 -1
  116. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  117. package/dist/components/general-purpose/PricingPlanCard.js +2 -2
  118. package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
  119. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  120. package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
  121. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  122. package/dist/components/general-purpose/Terminal.js +2 -2
  123. package/dist/components/general-purpose/TestResults.js +1 -1
  124. package/dist/components/general-purpose/ThemeModeControl.js +2 -2
  125. package/dist/components/general-purpose/WebPreview.js +2 -2
  126. package/dist/components/nanites/AgentConnection.js +2 -2
  127. package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
  128. package/dist/components/nanites/AgentToolDetail.js +5 -5
  129. package/dist/{copy-button-BABPlsc-.js → copy-button-CSDuDfdP.js} +1 -1
  130. package/dist/{icons-ChPpNMmU.d.ts → icons-CCZGYUwU.d.ts} +6 -1
  131. package/dist/{icons-BC4HZqSK.js → icons-cuEtsgj9.js} +4 -3
  132. package/dist/styles/connected-app-card.css +8 -0
  133. package/dist/styles/description-list.css +3 -1
  134. package/dist/styles/index.css +1 -0
  135. package/dist/styles/workspace-concepts.css +28 -0
  136. package/dist/workspace-assets-CxpEHsac.js +154 -0
  137. package/package.json +2 -2
  138. package/dist/WorkspaceMessageResponse-D66ty4FO.d.ts +0 -24
@@ -1,5 +1,5 @@
1
- import { AgentChatTurnError } from "../ai-sdk/AgentChatTurnError.js";
2
1
  import { TransitionSurface } from "../foundations/TransitionSurface.js";
2
+ import { AgentChatTurnError } from "../ai-sdk/AgentChatTurnError.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/agents-sdk/ThinkRecoveryNotice.tsx
5
5
  function connectionReason(error) {
@@ -1,10 +1,10 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { B as PlusIcon } from "../../icons-BC4HZqSK.js";
2
+ import { B as PlusIcon } from "../../icons-cuEtsgj9.js";
3
3
  import { buttonVariants } from "../foundations/Button.js";
4
4
  import { Tooltip } from "../foundations/Tooltip.js";
5
5
  import { t as capitalize } from "../../format-COCyV98Z.js";
6
- import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
7
6
  import { EmptyState } from "../foundations/EmptyState.js";
7
+ import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
8
8
  import { SearchField } from "../foundations/SearchField.js";
9
9
  import { ToggleGroup } from "../foundations/ToggleGroup.js";
10
10
  import { getThinkRoutineNextRun } from "./ThinkRoutine.js";
@@ -1,6 +1,6 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { Switch } from "../foundations/Switch.js";
3
2
  import { getThinkRoutineNextRun } from "./ThinkRoutine.js";
3
+ import { Switch } from "../foundations/Switch.js";
4
4
  import { ThinkRoutineRuns } from "./ThinkRoutineRuns.js";
5
5
  import * as React from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,17 +1,17 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { $ as WarningIcon, K as SpinnerIcon, d as CheckIcon, f as ChevronDownIcon, r as ArrowLeftIcon } from "../../icons-BC4HZqSK.js";
2
+ import { K as SpinnerIcon, d as CheckIcon, et as WarningIcon, f as ChevronDownIcon, r as ArrowLeftIcon } from "../../icons-cuEtsgj9.js";
3
3
  import { Button } from "../foundations/Button.js";
4
+ import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
4
5
  import { Field } from "../foundations/Field.js";
5
6
  import { Form } from "../foundations/Form.js";
6
7
  import { Textarea } from "../foundations/Textarea.js";
7
- import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
8
8
  import { Select } from "../foundations/Select.js";
9
+ import { AppTopBar } from "../general-purpose/AppTopBar.js";
10
+ import { Fieldset } from "../foundations/Fieldset.js";
9
11
  import { Checkbox } from "../foundations/Checkbox.js";
10
12
  import { CheckboxGroup } from "../foundations/CheckboxGroup.js";
11
13
  import { Combobox } from "../foundations/Combobox.js";
12
- import { Fieldset } from "../foundations/Fieldset.js";
13
14
  import { NumberField } from "../foundations/NumberField.js";
14
- import { AppTopBar } from "../general-purpose/AppTopBar.js";
15
15
  import * as React from "react";
16
16
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
17
  //#region src/components/agents-sdk/ThinkRoutineForm.tsx
@@ -1,12 +1,12 @@
1
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-BC4HZqSK.js";
2
+ import { K as SpinnerIcon, Q as TrashIcon, R as PencilIcon, z as PlayIcon } from "../../icons-cuEtsgj9.js";
3
3
  import { buttonVariants } from "../foundations/Button.js";
4
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
5
  import { EmptyState } from "../foundations/EmptyState.js";
6
+ import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
8
7
  import { AppTopBar } from "../general-purpose/AppTopBar.js";
9
8
  import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
9
+ import { AlertDialog } from "../foundations/AlertDialog.js";
10
10
  import { ThinkRoutineBrowser } from "./ThinkRoutineBrowser.js";
11
11
  import { ThinkRoutineDetail } from "./ThinkRoutineDetail.js";
12
12
  import * as React from "react";
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { buttonVariants } from "../foundations/Button.js";
3
- import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
4
3
  import { EmptyState } from "../foundations/EmptyState.js";
4
+ import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
5
5
  import { getThinkExecutionRunAccessibleName, getThinkExecutionRunId, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
6
6
  import { ThinkExecutionRunSummary } from "./ThinkExecutionStatus.js";
7
7
  import * as React from "react";
@@ -1,14 +1,20 @@
1
1
  import { ThinkRoutine } from "./ThinkRoutine.js";
2
- import { ThinkChatDraft } from "./ThinkChat.js";
3
- import { ThinkThreadItem } from "./ThinkThreadPicker.js";
4
- import { ThinkFullAppAgent, ThinkFullAppConversation, ThinkFullAppProps } from "./ThinkFullApp.js";
2
+ import { n as ThinkChatDraft } from "../../ThinkChat-CwMdEum8.js";
3
+ import { t as ThinkThreadItem } from "../../ThinkThreadPicker-yFz4vvIf.js";
4
+ import { ThinkFullAppAgent, ThinkFullAppConversation, ThinkFullAppPanel, ThinkFullAppProps, ThinkFullAppView } from "./ThinkFullApp.js";
5
5
  import { SetupChecklistGroupProps } from "../general-purpose/SetupChecklist.js";
6
6
  import * as React from "react";
7
7
  import { UIMessage } from "ai";
8
8
  import { AgentToolRunState } from "agents/agent-tools";
9
9
 
10
10
  //#region src/components/agents-sdk/ThinkSidepanel.d.ts
11
- type ThinkSidepanelView = "chat" | "files" | "plugins" | "schedules" | "live";
11
+ /**
12
+ * Chat, the two exclusive full-screen surfaces, or an opaque workbench panel
13
+ * id. Built-in workbench destinations are `files` and `plugins`; hosts append
14
+ * more through `workbenchPanels`. An unknown id degrades to conversation-only
15
+ * the same way ThinkFullApp does — the requested view is not rewritten.
16
+ */
17
+ type ThinkSidepanelView = ThinkFullAppView | "schedules" | "live";
12
18
  type ThinkSidepanelDestination = {
13
19
  kind: "thread";
14
20
  threadId: string;
@@ -124,6 +130,13 @@ interface ThinkSidepanelProps<AgentT extends ThinkFullAppAgent<State>, State = u
124
130
  workspace?: ThinkFullAppProps<AgentT, State, MessageT>["workspace"];
125
131
  plugins?: ThinkFullAppProps<AgentT, State, MessageT>["plugins"];
126
132
  messages?: ThinkFullAppProps<AgentT, State, MessageT>["messages"];
133
+ /**
134
+ * Extra workbench panels appended after Files and Plugins. The side panel
135
+ * derives bar and overflow destinations from that same list and forwards it
136
+ * to ThinkFullApp. Not a registry: the host passes ordered descriptors whose
137
+ * `render` already closes over design-system panels.
138
+ */
139
+ workbenchPanels?: readonly ThinkFullAppPanel[];
127
140
  /** App-authored TanStack Link for a thread, view, routine, or agent-run destination. */
128
141
  renderLink: (destination: ThinkSidepanelDestination) => React.ReactElement;
129
142
  onDeleteThread?: (thread: ThinkThreadItem) => void | Promise<void>;
@@ -150,7 +163,8 @@ interface ThinkSidepanelProps<AgentT extends ThinkFullAppAgent<State>, State = u
150
163
  /**
151
164
  * The employee side panel: icon-and-tooltip chrome, start screen, schedules,
152
165
  * conversation plus workbench. Hosts hydrate conversation, workspace,
153
- * plugins, and callables. Storybook is the place to iterate the chrome.
166
+ * plugins, workbenchPanels, and callables. Storybook is the place to iterate
167
+ * the chrome.
154
168
  */
155
169
  declare function ThinkSidepanel<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage, TRoutine extends ThinkRoutine = ThinkRoutine, SetupId extends string = string>({
156
170
  agentRun,
@@ -178,6 +192,7 @@ declare function ThinkSidepanel<AgentT extends ThinkFullAppAgent<State>, State =
178
192
  thread,
179
193
  threads,
180
194
  view,
195
+ workbenchPanels,
181
196
  workspace,
182
197
  ...props
183
198
  }: ThinkSidepanelProps<AgentT, State, MessageT, TRoutine, SetupId>): React.JSX.Element;
@@ -1,28 +1,28 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { $ as WarningIcon, A as McpIcon, C as FolderIcon, G as SlackIcon, I as PaperclipIcon, K as SpinnerIcon, R as PencilIcon, S as FileIcon, T as InfoIcon, V as QueueIcon, Z as TerminalIcon, b as EyeIcon, c as BoxIcon, g as DiscordIcon, o as ArrowUpRightIcon, q as SquareIcon, r as ArrowLeftIcon, y as EllipsisIcon } from "../../icons-BC4HZqSK.js";
2
+ import { A as McpIcon, C as FolderIcon, G as SlackIcon, I as PaperclipIcon, K as SpinnerIcon, R as PencilIcon, S as FileIcon, T as InfoIcon, V as QueueIcon, Z as TerminalIcon, b as EyeIcon, c as BoxIcon, et as WarningIcon, g as DiscordIcon, o as ArrowUpRightIcon, q as SquareIcon, r as ArrowLeftIcon, y as EllipsisIcon } from "../../icons-cuEtsgj9.js";
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { Tooltip } from "../foundations/Tooltip.js";
5
- import { Menu } from "../foundations/Menu.js";
6
5
  import { Dialog } from "../foundations/Dialog.js";
7
6
  import { Avatar } from "../foundations/Avatar.js";
8
7
  import { AppIcon } from "../foundations/AppIcon.js";
9
8
  import { n as findCatalogMcpServerCard, t as McpServerIcon } from "../../mcp-server-7NR24ASj.js";
10
- import { DescriptionList } from "../foundations/DescriptionList.js";
11
- import { ChatGptSignInScreen } from "../extension/ChatGptSignInScreen.js";
9
+ import { NaniteMark } from "../nanites/NaniteScene.js";
10
+ import { SubagentRunLabel } from "./SubagentRunIndicator.js";
12
11
  import { EmptyState } from "../foundations/EmptyState.js";
13
- import { Switch } from "../foundations/Switch.js";
14
- import { useTheme } from "../foundations/ThemeProvider.js";
12
+ import { Menu } from "../foundations/Menu.js";
15
13
  import "../foundations/icons.js";
16
- import { ActionGuide } from "../general-purpose/ActionGuide.js";
17
14
  import { AppTopBar } from "../general-purpose/AppTopBar.js";
18
- import { t as SetupChecklistAction } from "../../SetupChecklist-BXwSSorj.js";
19
- import { NaniteMark } from "../nanites/NaniteScene.js";
20
- import { SubagentRunLabel } from "./SubagentRunIndicator.js";
21
15
  import { getThinkExecutionRunId } from "./ThinkExecutionRun.js";
16
+ import { DescriptionList } from "../foundations/DescriptionList.js";
22
17
  import { McpServerPickerAction, McpServerPickerItems } from "./McpServerPicker.js";
23
18
  import { ThinkThreadPicker, summarizeThinkThreads } from "./ThinkThreadPicker.js";
24
19
  import { ThinkFullApp } from "./ThinkFullApp.js";
20
+ import { Switch } from "../foundations/Switch.js";
25
21
  import { ThinkRoutineLibrary } from "./ThinkRoutineLibrary.js";
22
+ import { ActionGuide } from "../general-purpose/ActionGuide.js";
23
+ import { t as SetupChecklistAction } from "../../SetupChecklist-CwRjIDH4.js";
24
+ import { useTheme } from "../foundations/ThemeProvider.js";
25
+ import { ChatGptSignInScreen } from "../extension/ChatGptSignInScreen.js";
26
26
  import * as React from "react";
27
27
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
28
28
  //#region src/components/agents-sdk/ThinkSidepanel.tsx
@@ -84,28 +84,40 @@ function useCompactApp() {
84
84
  }, []);
85
85
  return [ref, compact];
86
86
  }
87
- function WorkspaceLinks({ renderLink, view }) {
88
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AppTopBar.Link, {
89
- label: "Files",
90
- "aria-current": view === "files" ? "page" : void 0,
91
- "data-pressed": view === "files" ? "" : void 0,
92
- render: renderLink({
93
- kind: "view",
94
- view: "files"
95
- }),
96
- children: /* @__PURE__ */ jsx(FileIcon, {})
97
- }), /* @__PURE__ */ jsx(AppTopBar.Link, {
98
- label: "Plugins",
99
- "aria-current": view === "plugins" ? "page" : void 0,
100
- "data-pressed": view === "plugins" ? "" : void 0,
87
+ function workbenchNavItems(workbenchPanels) {
88
+ return [
89
+ {
90
+ id: "files",
91
+ label: "Files",
92
+ icon: /* @__PURE__ */ jsx(FileIcon, {})
93
+ },
94
+ {
95
+ id: "plugins",
96
+ label: "Plugins",
97
+ icon: /* @__PURE__ */ jsx(BoxIcon, {})
98
+ },
99
+ ...workbenchPanels ?? []
100
+ ];
101
+ }
102
+ function isWorkbenchView(view) {
103
+ return view !== "chat" && view !== "schedules" && view !== "live";
104
+ }
105
+ function thinkFullAppView(view) {
106
+ return view === "schedules" || view === "live" ? "chat" : view;
107
+ }
108
+ function WorkbenchLinks({ panels, renderLink, view }) {
109
+ return /* @__PURE__ */ jsx(Fragment, { children: panels.map((panel) => /* @__PURE__ */ jsx(AppTopBar.Link, {
110
+ label: panel.label,
111
+ "aria-current": view === panel.id ? "page" : void 0,
112
+ "data-pressed": view === panel.id ? "" : void 0,
101
113
  render: renderLink({
102
114
  kind: "view",
103
- view: "plugins"
115
+ view: panel.id
104
116
  }),
105
- children: /* @__PURE__ */ jsx(BoxIcon, {})
106
- })] });
117
+ children: panel.icon
118
+ }, panel.id)) });
107
119
  }
108
- function OverflowMenu({ companion, follow, identityEmail, onIdentity, onModel, onSignOut, passkeyVault, renderLink, workbenchInMenu }) {
120
+ function OverflowMenu({ companion, follow, identityEmail, onIdentity, onModel, onSignOut, passkeyVault, renderLink, workbenchInMenu, workbenchNav }) {
109
121
  return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
110
122
  label: "More actions",
111
123
  tooltip: identityEmail ? `Signed in as ${identityEmail}` : void 0,
@@ -119,19 +131,13 @@ function OverflowMenu({ companion, follow, identityEmail, onIdentity, onModel, o
119
131
  align: "end",
120
132
  sideOffset: 4,
121
133
  children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [
122
- workbenchInMenu ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Menu.Item, {
123
- render: renderLink({
124
- kind: "view",
125
- view: "files"
126
- }),
127
- children: [/* @__PURE__ */ jsx(FileIcon, {}), "Files"]
128
- }), /* @__PURE__ */ jsxs(Menu.Item, {
134
+ workbenchInMenu ? workbenchNav.map((panel) => /* @__PURE__ */ jsxs(Menu.Item, {
129
135
  render: renderLink({
130
136
  kind: "view",
131
- view: "plugins"
137
+ view: panel.id
132
138
  }),
133
- children: [/* @__PURE__ */ jsx(BoxIcon, {}), "Plugins"]
134
- })] }) : null,
139
+ children: [panel.icon, panel.label]
140
+ }, panel.id)) : null,
135
141
  /* @__PURE__ */ jsxs(Menu.Item, {
136
142
  render: renderLink({
137
143
  kind: "view",
@@ -567,12 +573,14 @@ function ThinkSidepanelRunTitle({ agentRun }) {
567
573
  /**
568
574
  * The employee side panel: icon-and-tooltip chrome, start screen, schedules,
569
575
  * conversation plus workbench. Hosts hydrate conversation, workspace,
570
- * plugins, and callables. Storybook is the place to iterate the chrome.
576
+ * plugins, workbenchPanels, and callables. Storybook is the place to iterate
577
+ * the chrome.
571
578
  */
572
- function ThinkSidepanel({ agentRun, appBarLeading, brand, className, companion, connectingLabel, conversation, follow, identity, live, messages, modelSetup, onDeleteThread, onModel, onSignOut, passkeyVault, plugins, renderLink, schedules, sourceKey, start, status = "ready", thread, threads = EMPTY_THREADS, view, workspace, ...props }) {
579
+ function ThinkSidepanel({ agentRun, appBarLeading, brand, className, companion, connectingLabel, conversation, follow, identity, live, messages, modelSetup, onDeleteThread, onModel, onSignOut, passkeyVault, plugins, renderLink, schedules, sourceKey, start, status = "ready", thread, threads = EMPTY_THREADS, view, workbenchPanels, workspace, ...props }) {
573
580
  const [identityOpen, setIdentityOpen] = React.useState(false);
574
581
  const [guideOpen, setGuideOpen] = React.useState(false);
575
582
  const [rootRef, compact] = useCompactApp();
583
+ const workbenchNav = workbenchNavItems(workbenchPanels);
576
584
  if (status !== "ready") return /* @__PURE__ */ jsx("div", {
577
585
  ref: rootRef,
578
586
  className: cx("think-sidepanel", className),
@@ -595,9 +603,11 @@ function ThinkSidepanel({ agentRun, appBarLeading, brand, className, companion,
595
603
  onSignOut,
596
604
  passkeyVault,
597
605
  renderLink,
598
- workbenchInMenu: compact
606
+ workbenchInMenu: compact,
607
+ workbenchNav
599
608
  });
600
- const workspaceLinks = compact || agentRun ? void 0 : /* @__PURE__ */ jsx(WorkspaceLinks, {
609
+ const workspaceLinks = compact || agentRun ? void 0 : /* @__PURE__ */ jsx(WorkbenchLinks, {
610
+ panels: workbenchNav,
601
611
  renderLink,
602
612
  view
603
613
  });
@@ -611,7 +621,8 @@ function ThinkSidepanel({ agentRun, appBarLeading, brand, className, companion,
611
621
  render: renderLink({ kind: "new-thread" }),
612
622
  children: /* @__PURE__ */ jsx(PencilIcon, {})
613
623
  }) : void 0;
614
- const workbenchLeading = view === "files" || view === "plugins" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BackToChat, { renderLink }), appBarLeading] }) : newThread || view === "chat" && appBarLeading ? /* @__PURE__ */ jsxs(Fragment, { children: [newThread, view === "chat" ? appBarLeading : null] }) : void 0;
624
+ const chatLeading = newThread || view === "chat" && appBarLeading ? /* @__PURE__ */ jsxs(Fragment, { children: [newThread, view === "chat" ? appBarLeading : null] }) : void 0;
625
+ const workbenchLeading = isWorkbenchView(view) ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BackToChat, { renderLink }), appBarLeading] }) : chatLeading;
615
626
  const chatMessages = employeeMessages({
616
627
  agentRun,
617
628
  brandName: brand.name,
@@ -679,7 +690,7 @@ function ThinkSidepanel({ agentRun, appBarLeading, brand, className, companion,
679
690
  })
680
691
  }), identityDialog]
681
692
  });
682
- const workbenchView = view === "plugins" ? "plugins" : view === "files" ? "files" : "chat";
693
+ const workbenchView = thinkFullAppView(view);
683
694
  const cancelRun = agentRun?.state === "ready" && agentRun.run.status === "running" ? agentRun.onCancel : void 0;
684
695
  const backToThread = agentRun ? /* @__PURE__ */ jsx(AppTopBar.Link, {
685
696
  label: "Back to parent conversation",
@@ -744,6 +755,7 @@ function ThinkSidepanel({ agentRun, appBarLeading, brand, className, companion,
744
755
  sourceKey,
745
756
  workspace: agentRun ? void 0 : workspace,
746
757
  plugins: agentRun ? void 0 : plugins,
758
+ workbenchPanels: agentRun ? void 0 : workbenchPanels,
747
759
  view: workbenchView,
748
760
  threadSidebar: agentRun ? void 0 : ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ThinkThreadPicker, {
749
761
  threads,
@@ -1,91 +1,2 @@
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
1
+ import { a as ThinkThreadStatusIndicatorsProps, i as ThinkThreadStatusIndicators, n as ThinkThreadPicker, o as ThinkThreadStatusSummary, r as ThinkThreadPickerProps, s as summarizeThinkThreads, t as ThinkThreadItem } from "../../ThinkThreadPicker-yFz4vvIf.js";
91
2
  export { ThinkThreadItem, ThinkThreadPicker, ThinkThreadPickerProps, ThinkThreadStatusIndicators, ThinkThreadStatusIndicatorsProps, ThinkThreadStatusSummary, summarizeThinkThreads };
@@ -1,13 +1,13 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { $ as WarningIcon, B as PlusIcon, K as SpinnerIcon, _ as DotIcon, t as ArchiveIcon } from "../../icons-BC4HZqSK.js";
2
+ import { B as PlusIcon, K as SpinnerIcon, _ as DotIcon, et as WarningIcon, t as ArchiveIcon } from "../../icons-cuEtsgj9.js";
3
3
  import { Button, buttonVariants } from "../foundations/Button.js";
4
4
  import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
5
- import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
6
- import { ScrollArea } from "../foundations/ScrollArea.js";
7
- import { AlertDialog } from "../foundations/AlertDialog.js";
8
5
  import { EmptyState } from "../foundations/EmptyState.js";
6
+ import { ScrollArea } from "../foundations/ScrollArea.js";
7
+ import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
9
8
  import { LinkButton } from "../foundations/LinkButton.js";
10
9
  import { SearchField } from "../foundations/SearchField.js";
10
+ import { AlertDialog } from "../foundations/AlertDialog.js";
11
11
  import * as React from "react";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  //#region src/components/agents-sdk/ThinkThreadPicker.tsx
@@ -1,2 +1,2 @@
1
- import { A as workspaceQueryKey, C as workspaceBinaryFileQueryOptions, D as workspaceFileAssetQueryOptions, E as workspaceDirectoryQueryPrefix, O as workspaceFileStatQueryOptions, S as useWorkspace, T as workspaceDirectoryQueryOptions, _ as WorkspaceResolvedAsset, a as WorkspaceDirectoryQueryOptions, b as WorkspaceTextFileQueryKey, c as WorkspaceFileQueryKey, d as WorkspaceFileStatQueryOptions, f as WorkspaceFileVersion, g as WorkspaceQueryKey, h as WorkspaceInfoQueryOptions, i as WorkspaceDirectoryQueryKey, j as workspaceTextFileQueryOptions, k as workspaceInfoQueryOptions, l as WorkspaceFileReadTarget, m as WorkspaceInfoQueryKey, n as WorkspaceBinaryFileQueryKey, o as WorkspaceFileAssetQueryKey, p as WorkspaceInfo, r as WorkspaceBinaryFileQueryOptions, s as WorkspaceFileAssetQueryOptions, t as UseWorkspaceOptions, u as WorkspaceFileStatQueryKey, v as WorkspaceSource, w as workspaceDirectoryQueryKey, x as WorkspaceTextFileQueryOptions, y as WorkspaceState } from "../../Workspace-DZusrEeP.js";
2
- export { UseWorkspaceOptions, WorkspaceBinaryFileQueryKey, WorkspaceBinaryFileQueryOptions, WorkspaceDirectoryQueryKey, WorkspaceDirectoryQueryOptions, WorkspaceFileAssetQueryKey, WorkspaceFileAssetQueryOptions, WorkspaceFileQueryKey, WorkspaceFileReadTarget, WorkspaceFileStatQueryKey, WorkspaceFileStatQueryOptions, WorkspaceFileVersion, WorkspaceInfo, WorkspaceInfoQueryKey, WorkspaceInfoQueryOptions, WorkspaceQueryKey, WorkspaceResolvedAsset, WorkspaceSource, WorkspaceState, WorkspaceTextFileQueryKey, WorkspaceTextFileQueryOptions, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
1
+ import { A as workspaceInfoQueryOptions, C as useWorkspace, D as workspaceDirectoryQueryPrefix, E as workspaceDirectoryQueryOptions, M as workspaceTextFileQueryOptions, O as workspaceFileAssetQueryOptions, S as WorkspaceTextFileQueryOptions, T as workspaceDirectoryQueryKey, _ as WorkspaceQueryOptions, a as WorkspaceDirectoryQueryOptions, b as WorkspaceState, c as WorkspaceFileQueryKey, d as WorkspaceFileStatQueryOptions, f as WorkspaceFileVersion, g as WorkspaceQueryKey, h as WorkspaceInfoQueryOptions, i as WorkspaceDirectoryQueryKey, j as workspaceQueryKey, k as workspaceFileStatQueryOptions, l as WorkspaceFileReadTarget, m as WorkspaceInfoQueryKey, n as WorkspaceBinaryFileQueryKey, o as WorkspaceFileAssetQueryKey, p as WorkspaceInfo, r as WorkspaceBinaryFileQueryOptions, s as WorkspaceFileAssetQueryOptions, t as UseWorkspaceOptions, u as WorkspaceFileStatQueryKey, v as WorkspaceResolvedAsset, w as workspaceBinaryFileQueryOptions, x as WorkspaceTextFileQueryKey, y as WorkspaceSource } from "../../Workspace-C_zHq9KZ.js";
2
+ export { UseWorkspaceOptions, WorkspaceBinaryFileQueryKey, WorkspaceBinaryFileQueryOptions, WorkspaceDirectoryQueryKey, WorkspaceDirectoryQueryOptions, WorkspaceFileAssetQueryKey, WorkspaceFileAssetQueryOptions, WorkspaceFileQueryKey, WorkspaceFileReadTarget, WorkspaceFileStatQueryKey, WorkspaceFileStatQueryOptions, WorkspaceFileVersion, WorkspaceInfo, WorkspaceInfoQueryKey, WorkspaceInfoQueryOptions, WorkspaceQueryKey, WorkspaceQueryOptions, WorkspaceResolvedAsset, WorkspaceSource, WorkspaceState, WorkspaceTextFileQueryKey, WorkspaceTextFileQueryOptions, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
@@ -1,4 +1,4 @@
1
- import { y as WorkspaceState } from "../../Workspace-DZusrEeP.js";
1
+ import { b as WorkspaceState } from "../../Workspace-C_zHq9KZ.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/agents-sdk/WorkspaceBrowser.d.ts
@@ -1,5 +1,5 @@
1
1
  import { SearchField } from "../foundations/SearchField.js";
2
- import { i as FileTreeFolder, r as FileTreeFile, t as FileTree } from "../../FileTree-jtP9471I.js";
2
+ import { i as FileTreeFolder, r as FileTreeFile, t as FileTree } from "../../FileTree-BHebfvkK.js";
3
3
  import { WorkspaceHeader } from "./WorkspaceHeader.js";
4
4
  import * as React from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -0,0 +1,44 @@
1
+ import { _ as WorkspaceQueryOptions, g as WorkspaceQueryKey } from "../../Workspace-C_zHq9KZ.js";
2
+ import { QueryClient, QueryFunction } from "@tanstack/react-query";
3
+
4
+ //#region src/components/agents-sdk/WorkspaceConcept.d.ts
5
+ /**
6
+ * Concept query identity is what the data is: source, root, concept, scope.
7
+ * Freshness never lives in the key — external changes arrive as invalidation
8
+ * through `useWorkspaceLiveQueries` (native observer events or the host's
9
+ * `revision` tick), so cards keep their data, mutation state, and typed form
10
+ * drafts across refreshes.
11
+ */
12
+ type WorkspaceConceptQueryKey = readonly [...WorkspaceQueryKey, "concept", concept: string, scope: string];
13
+ type WorkspaceConceptQueryOptions<TData> = WorkspaceQueryOptions<TData, WorkspaceConceptQueryKey>;
14
+ interface WorkspaceConceptQueryInput<TData> {
15
+ sourceKey: string;
16
+ /**
17
+ * The host's workspace boundary. Required, and never defaulted: concept keys
18
+ * and live invalidation must agree on one root, and a silent `"/"` default on
19
+ * either side leaves a host with a nested root receiving zero invalidations.
20
+ */
21
+ root: string;
22
+ concept: string;
23
+ /** The workspace path (file or directory) this projection reads. */
24
+ scope: string;
25
+ queryFn: QueryFunction<TData, WorkspaceConceptQueryKey>;
26
+ }
27
+ declare function workspaceConceptQueryPrefix(sourceKey: string, root: string): readonly ["workspace", string, string, "concept"];
28
+ declare function workspaceConceptQueryKey(sourceKey: string, root: string, concept: string, scope: string): WorkspaceConceptQueryKey;
29
+ /** Shared concept options for design-system components and host loaders. */
30
+ declare function workspaceConceptQueryOptions<TData>({
31
+ sourceKey,
32
+ root,
33
+ concept,
34
+ scope,
35
+ queryFn
36
+ }: WorkspaceConceptQueryInput<TData>): WorkspaceConceptQueryOptions<TData>;
37
+ /**
38
+ * Invalidate active concept queries touched by an external workspace change.
39
+ * `root` is required and must be the same root the concept options were built
40
+ * with — the prefix is derived from it, so a mismatch invalidates nothing.
41
+ */
42
+ declare function invalidateWorkspaceConceptQueries(queryClient: QueryClient, sourceKey: string, root: string, changedPaths?: readonly string[]): Promise<void>;
43
+ //#endregion
44
+ export { WorkspaceConceptQueryInput, WorkspaceConceptQueryKey, WorkspaceConceptQueryOptions, invalidateWorkspaceConceptQueries, workspaceConceptQueryKey, workspaceConceptQueryOptions, workspaceConceptQueryPrefix };
@@ -0,0 +1,42 @@
1
+ import { workspaceQueryKey } from "./Workspace.js";
2
+ import { queryOptions } from "@tanstack/react-query";
3
+ //#region src/components/agents-sdk/WorkspaceConcept.ts
4
+ function workspaceConceptQueryPrefix(sourceKey, root) {
5
+ return [...workspaceQueryKey(sourceKey, root), "concept"];
6
+ }
7
+ function workspaceConceptQueryKey(sourceKey, root, concept, scope) {
8
+ return [
9
+ ...workspaceConceptQueryPrefix(sourceKey, root),
10
+ concept,
11
+ scope
12
+ ];
13
+ }
14
+ /** Shared concept options for design-system components and host loaders. */
15
+ function workspaceConceptQueryOptions({ sourceKey, root, concept, scope, queryFn }) {
16
+ return queryOptions({
17
+ queryKey: workspaceConceptQueryKey(sourceKey, root, concept, scope),
18
+ queryFn,
19
+ staleTime: Infinity
20
+ });
21
+ }
22
+ function pathsOverlap(left, right) {
23
+ return left === right || left === "/" || right === "/" || left.startsWith(`${right}/`) || right.startsWith(`${left}/`);
24
+ }
25
+ /**
26
+ * Invalidate active concept queries touched by an external workspace change.
27
+ * `root` is required and must be the same root the concept options were built
28
+ * with — the prefix is derived from it, so a mismatch invalidates nothing.
29
+ */
30
+ function invalidateWorkspaceConceptQueries(queryClient, sourceKey, root, changedPaths) {
31
+ const prefix = workspaceConceptQueryPrefix(sourceKey, root);
32
+ return queryClient.invalidateQueries({
33
+ queryKey: prefix,
34
+ predicate: (query) => {
35
+ if (!changedPaths || changedPaths.length === 0) return true;
36
+ const scope = query.queryKey[prefix.length + 1];
37
+ return typeof scope === "string" && changedPaths.some((path) => pathsOverlap(scope, path));
38
+ }
39
+ });
40
+ }
41
+ //#endregion
42
+ export { invalidateWorkspaceConceptQueries, workspaceConceptQueryKey, workspaceConceptQueryOptions, workspaceConceptQueryPrefix };