@dbx-tools/ui-mastra 0.9.153 → 0.9.157

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 (38) hide show
  1. package/index.react.ts +61 -0
  2. package/index.support.ts +40 -0
  3. package/index.ts +1 -79
  4. package/package.json +21 -10
  5. package/src/react/_assistant-response-status.tsx +1 -1
  6. package/src/react/_external-link-dialog.tsx +1 -1
  7. package/src/react/_model-selector.tsx +5 -5
  8. package/src/react/bubbles.tsx +3 -3
  9. package/src/react/chat-composer.tsx +1 -1
  10. package/src/react/chat-feedback.ts +5 -5
  11. package/src/react/chat-history.ts +4 -4
  12. package/src/react/chat-stream.ts +4 -5
  13. package/src/react/chat-thread-layout.tsx +9 -2
  14. package/src/react/chat-transcript.tsx +3 -3
  15. package/src/react/data-grid.tsx +4 -4
  16. package/src/react/embed-slots.tsx +10 -6
  17. package/src/react/export-menu.tsx +1 -1
  18. package/src/react/feedback-controls.tsx +1 -1
  19. package/src/react/markdown.tsx +2 -4
  20. package/src/react/mastra-assistant.tsx +1 -1
  21. package/src/react/mastra-chat.tsx +17 -17
  22. package/src/react/suggestion-pills.tsx +1 -1
  23. package/src/react/suggestions.ts +1 -1
  24. package/src/react/thread-sidebar.tsx +1 -1
  25. package/src/react/thread-tabs.tsx +1 -1
  26. package/src/react/tool-pill.tsx +7 -9
  27. package/src/react/types.ts +1 -3
  28. package/src/react/use-chat-thread-query.ts +27 -0
  29. package/src/support/chart-option.ts +2 -2
  30. package/src/support/chart-theme.ts +2 -2
  31. package/src/support/export.ts +10 -13
  32. package/src/support/genie-client.ts +22 -13
  33. package/src/support/mastra-client.ts +39 -32
  34. package/src/support/thread-sessions.ts +0 -2
  35. package/src/support/thread-tabs.ts +12 -2
  36. package/src/support/tool-events.ts +1 -1
  37. package/src/react/index.ts +0 -72
  38. package/src/support/index.ts +0 -32
package/index.react.ts ADDED
@@ -0,0 +1,61 @@
1
+ // GENERATED by projen watch - DO NOT EDIT.
2
+ // Regenerated from the exporting modules in ./src.
3
+ // Hand edits are overwritten on the next watch; this file is read-only.
4
+
5
+ export * as bubbles from "./src/react/bubbles.tsx";
6
+ export * as chatApprovals from "./src/react/chat-approvals.ts";
7
+ export * as chatComposer from "./src/react/chat-composer.tsx";
8
+ export * as chatFeedback from "./src/react/chat-feedback.ts";
9
+ export * as chatHistory from "./src/react/chat-history.ts";
10
+ export * as chatSessions from "./src/react/chat-sessions.ts";
11
+ export * as chatStream from "./src/react/chat-stream.ts";
12
+ export * as chatThreadLayout from "./src/react/chat-thread-layout.tsx";
13
+ export * as chatTranscript from "./src/react/chat-transcript.tsx";
14
+ export * as chatView from "./src/react/chat-view.tsx";
15
+ export * as dataGrid from "./src/react/data-grid.tsx";
16
+ export * as embedSlots from "./src/react/embed-slots.tsx";
17
+ export * as exportMenu from "./src/react/export-menu.tsx";
18
+ export * as feedbackControls from "./src/react/feedback-controls.tsx";
19
+ export * as markdown from "./src/react/markdown.tsx";
20
+ export * as mastraAssistant from "./src/react/mastra-assistant.tsx";
21
+ export * as mastraChat from "./src/react/mastra-chat.tsx";
22
+ export * as suggestionPills from "./src/react/suggestion-pills.tsx";
23
+ export * as suggestions from "./src/react/suggestions.ts";
24
+ export * as threadSidebar from "./src/react/thread-sidebar.tsx";
25
+ export * as threadTabs from "./src/react/thread-tabs.tsx";
26
+ export * as toolPill from "./src/react/tool-pill.tsx";
27
+ export * as types from "./src/react/types.ts";
28
+ export { AssistantBubble, UserBubble } from "./src/react/bubbles.tsx";
29
+ export { resolveApprovalContinuation, useChatApprovals } from "./src/react/chat-approvals.ts";
30
+ export { ChatComposer } from "./src/react/chat-composer.tsx";
31
+ export { genieFeedbackTarget, useChatFeedback } from "./src/react/chat-feedback.ts";
32
+ export type { GenieFeedbackTarget } from "./src/react/chat-feedback.ts";
33
+ export { useChatHistory } from "./src/react/chat-history.ts";
34
+ export { useChatSessions } from "./src/react/chat-sessions.ts";
35
+ export type { ThreadSessionReader, ThreadSessionUpdater, ThreadMessageWriter } from "./src/react/chat-sessions.ts";
36
+ export { closeOnTerminalChunk, waitForTerminalChunk, useChatStream } from "./src/react/chat-stream.ts";
37
+ export { ChatThreadLayout } from "./src/react/chat-thread-layout.tsx";
38
+ export { useChatTranscriptController, ChatTranscript } from "./src/react/chat-transcript.tsx";
39
+ export type { ChatTranscriptController } from "./src/react/chat-transcript.tsx";
40
+ export { ChatView } from "./src/react/chat-view.tsx";
41
+ export { colorizeDelta, renderDataCell, humanizeLabel, TABLE_WRAPPER_CLASSES, DataGrid } from "./src/react/data-grid.tsx";
42
+ export type { DataRow } from "./src/react/data-grid.tsx";
43
+ export { MarkdownWithEmbeds } from "./src/react/embed-slots.tsx";
44
+ export { ExportMenu } from "./src/react/export-menu.tsx";
45
+ export { FeedbackControls } from "./src/react/feedback-controls.tsx";
46
+ export { AssistantMarkdown, ToolMarkdown, SqlBlock, SourceBlock } from "./src/react/markdown.tsx";
47
+ export { useMastraAssistant, MastraAssistant } from "./src/react/mastra-assistant.tsx";
48
+ export type { MastraAssistantMode, MastraAssistantSide, MastraAssistantLauncherPosition, MastraAssistantResizeOptions, MastraAssistantLauncherOptions, MastraAssistantController, MastraAssistantProps } from "./src/react/mastra-assistant.tsx";
49
+ export { useMastraChat, MastraChat } from "./src/react/mastra-chat.tsx";
50
+ export type { ThreadIdChangeReason, UseMastraChatOptions, MastraChatProps } from "./src/react/mastra-chat.tsx";
51
+ export { SuggestionPills } from "./src/react/suggestion-pills.tsx";
52
+ export type { SuggestionPillsProps } from "./src/react/suggestion-pills.tsx";
53
+ export { dedupeSuggestions, collectSuggestions } from "./src/react/suggestions.ts";
54
+ export { ThreadSidebar } from "./src/react/thread-sidebar.tsx";
55
+ export type { ThreadSidebarProps } from "./src/react/thread-sidebar.tsx";
56
+ export { ThreadActions, ThreadTabs } from "./src/react/thread-tabs.tsx";
57
+ export type { ThreadTabsProps, ThreadActionsProps } from "./src/react/thread-tabs.tsx";
58
+ export { humanizeToolName, formatRawToolPayload, structuredToolPayload, detectToolSourceLanguage, toolInputPresentation, toolOutputPresentation, webSearchProgressGroups, webSearchQueryLabel, webSearchResultLabel, ToolSessionPill } from "./src/react/tool-pill.tsx";
59
+ export type { ToolInputPresentation, WebSearchProgressGroup } from "./src/react/tool-pill.tsx";
60
+ export type { ChatStatus, ToolEvent, ToolProgress, ChatModelOption, ChatInputMessage, QueuedSteer, FeedbackValue, FeedbackSubmission, MessageFeedback, ThreadSummary, ThreadPlacement, ChatViewProps, ApprovalDecision, PendingApproval } from "./src/react/types.ts";
61
+ export { useChatThreadQuery } from "./src/react/use-chat-thread-query.ts";
@@ -0,0 +1,40 @@
1
+ // GENERATED by projen watch - DO NOT EDIT.
2
+ // Regenerated from the exporting modules in ./src.
3
+ // Hand edits are overwritten on the next watch; this file is read-only.
4
+
5
+ export * as activeRuns from "./src/support/active-runs.ts";
6
+ export * as chartOption from "./src/support/chart-option.ts";
7
+ export * as chartTheme from "./src/support/chart-theme.ts";
8
+ export * as clipboard from "./src/support/clipboard.ts";
9
+ export * as download from "./src/support/download.ts";
10
+ export * as exportModule from "./src/support/export.ts";
11
+ export * as genieClient from "./src/support/genie-client.ts";
12
+ export * as mastraClient from "./src/support/mastra-client.ts";
13
+ export * as modelSelection from "./src/support/model-selection.ts";
14
+ export * as requestContext from "./src/support/request-context.ts";
15
+ export * as threadLabels from "./src/support/thread-labels.ts";
16
+ export * as threadPersistence from "./src/support/thread-persistence.ts";
17
+ export * as threadSessions from "./src/support/thread-sessions.ts";
18
+ export * as threadTabs from "./src/support/thread-tabs.ts";
19
+ export * as toolEvents from "./src/support/tool-events.ts";
20
+ export { StoredActiveRunSchema, activeRunStorageKey, readStoredActiveRuns, storeActiveRun, removeStoredActiveRun } from "./src/support/active-runs.ts";
21
+ export type { StoredActiveRun } from "./src/support/active-runs.ts";
22
+ export { normalizeChartOption } from "./src/support/chart-option.ts";
23
+ export { LIGHT_CHART_CHROME, resolveChartChrome, useChartChrome } from "./src/support/chart-theme.ts";
24
+ export type { ChartChrome } from "./src/support/chart-theme.ts";
25
+ export { copyText } from "./src/support/clipboard.ts";
26
+ export { downloadFile } from "./src/support/download.ts";
27
+ export { exportChat, messageText } from "./src/support/export.ts";
28
+ export type { ExportFormat, ExportBrand, EmbedResolver, ExportChatOptions } from "./src/support/export.ts";
29
+ export { GenieChatClient } from "./src/support/genie-client.ts";
30
+ export { MastraChatRequestError, MastraPluginClient, useMastraConfig, useMastraClient, useMastraMlflowExperiment, useMastraModels, useMastraDefaultModel, useMastraSuggestions, useMastraThreads, useChartFetch, useStatementFetch, useVisualizationFetch } from "./src/support/mastra-client.ts";
31
+ export type { MastraStreamResponse, MastraMemoryThread, ByIdFetchState } from "./src/support/mastra-client.ts";
32
+ export { defaultReasoningEffort, modelStorageKey, readStoredModel, storeSelectedModel } from "./src/support/model-selection.ts";
33
+ export { snapshotRequestContext } from "./src/support/request-context.ts";
34
+ export type { MastraRequestContextInput, MastraRequestContextSource } from "./src/support/request-context.ts";
35
+ export { threadTitle, relativeTime } from "./src/support/thread-labels.ts";
36
+ export { threadStorageKey } from "./src/support/thread-persistence.ts";
37
+ export { DEFAULT_THREAD_SESSION_KEY, createThreadSession, isSessionRunning, lastUserMessage, interruptedTurnMessages, enqueueSteer, removeSteer, reorderSteers, sessionKey } from "./src/support/thread-sessions.ts";
38
+ export type { SessionQueuedSteer, SessionRun, ThreadSession } from "./src/support/thread-sessions.ts";
39
+ export { THREAD_TAB_SEED_MAX, syncThreadTabs, closeThreadTab, nextActiveThreadTab } from "./src/support/thread-tabs.ts";
40
+ export { compactReasoningText, genieReasoningText, toolEventsFromParts, mergeToolEvents } from "./src/support/tool-events.ts";
package/index.ts CHANGED
@@ -3,82 +3,4 @@
3
3
  // Hand edits are overwritten on the next watch; this file is read-only.
4
4
 
5
5
  export const PACKAGE_IDENTIFIER = "@dbx-tools/ui-mastra";
6
- export const PACKAGE_VERSION = "0.9.153";
7
- export * as reactBubbles from "./src/react/bubbles.tsx";
8
- export * as reactChatApprovals from "./src/react/chat-approvals.ts";
9
- export * as reactChatComposer from "./src/react/chat-composer.tsx";
10
- export * as reactChatFeedback from "./src/react/chat-feedback.ts";
11
- export * as reactChatHistory from "./src/react/chat-history.ts";
12
- export * as reactChatSessions from "./src/react/chat-sessions.ts";
13
- export * as reactChatStream from "./src/react/chat-stream.ts";
14
- export * as reactChatThreadLayout from "./src/react/chat-thread-layout.tsx";
15
- export * as reactChatTranscript from "./src/react/chat-transcript.tsx";
16
- export * as reactChatView from "./src/react/chat-view.tsx";
17
- export * as reactDataGrid from "./src/react/data-grid.tsx";
18
- export * as reactEmbedSlots from "./src/react/embed-slots.tsx";
19
- export * as reactExportMenu from "./src/react/export-menu.tsx";
20
- export * as reactFeedbackControls from "./src/react/feedback-controls.tsx";
21
- export * as reactMarkdown from "./src/react/markdown.tsx";
22
- export * as reactMastraAssistant from "./src/react/mastra-assistant.tsx";
23
- export * as reactMastraChat from "./src/react/mastra-chat.tsx";
24
- export * as reactSuggestionPills from "./src/react/suggestion-pills.tsx";
25
- export * as reactSuggestions from "./src/react/suggestions.ts";
26
- export * as reactThreadSidebar from "./src/react/thread-sidebar.tsx";
27
- export * as reactThreadTabs from "./src/react/thread-tabs.tsx";
28
- export * as reactToolPill from "./src/react/tool-pill.tsx";
29
- export * as reactTypes from "./src/react/types.ts";
30
- export * as supportActiveRuns from "./src/support/active-runs.ts";
31
- export * as supportChartOption from "./src/support/chart-option.ts";
32
- export * as supportChartTheme from "./src/support/chart-theme.ts";
33
- export * as supportClipboard from "./src/support/clipboard.ts";
34
- export * as supportDownload from "./src/support/download.ts";
35
- export * as supportExport from "./src/support/export.ts";
36
- export * as supportGenieClient from "./src/support/genie-client.ts";
37
- export * as supportMastraClient from "./src/support/mastra-client.ts";
38
- export * as supportModelSelection from "./src/support/model-selection.ts";
39
- export * as supportRequestContext from "./src/support/request-context.ts";
40
- export * as supportThreadLabels from "./src/support/thread-labels.ts";
41
- export * as supportThreadPersistence from "./src/support/thread-persistence.ts";
42
- export * as supportThreadSessions from "./src/support/thread-sessions.ts";
43
- export * as supportThreadTabs from "./src/support/thread-tabs.ts";
44
- export * as supportToolEvents from "./src/support/tool-events.ts";
45
- export { AssistantBubble, UserBubble } from "./src/react/bubbles.tsx";
46
- export { ChatComposer } from "./src/react/chat-composer.tsx";
47
- export type { GenieFeedbackTarget } from "./src/react/chat-feedback.ts";
48
- export type { ThreadSessionReader, ThreadSessionUpdater, ThreadMessageWriter } from "./src/react/chat-sessions.ts";
49
- export { ChatThreadLayout } from "./src/react/chat-thread-layout.tsx";
50
- export { useChatTranscriptController, ChatTranscript } from "./src/react/chat-transcript.tsx";
51
- export type { ChatTranscriptController } from "./src/react/chat-transcript.tsx";
52
- export { ChatView } from "./src/react/chat-view.tsx";
53
- export { TABLE_WRAPPER_CLASSES, DataGrid } from "./src/react/data-grid.tsx";
54
- export type { DataRow } from "./src/react/data-grid.tsx";
55
- export { MarkdownWithEmbeds } from "./src/react/embed-slots.tsx";
56
- export { ExportMenu } from "./src/react/export-menu.tsx";
57
- export { FeedbackControls } from "./src/react/feedback-controls.tsx";
58
- export { AssistantMarkdown, ToolMarkdown, SqlBlock, SourceBlock } from "./src/react/markdown.tsx";
59
- export type { MastraAssistantMode, MastraAssistantSide, MastraAssistantLauncherPosition, MastraAssistantResizeOptions, MastraAssistantLauncherOptions, MastraAssistantController, MastraAssistantProps } from "./src/react/mastra-assistant.tsx";
60
- export { useMastraChat, MastraChat } from "./src/react/mastra-chat.tsx";
61
- export type { ThreadIdChangeReason, UseMastraChatOptions, MastraChatProps } from "./src/react/mastra-chat.tsx";
62
- export { SuggestionPills } from "./src/react/suggestion-pills.tsx";
63
- export type { SuggestionPillsProps } from "./src/react/suggestion-pills.tsx";
64
- export { dedupeSuggestions, collectSuggestions } from "./src/react/suggestions.ts";
65
- export { ThreadSidebar } from "./src/react/thread-sidebar.tsx";
66
- export type { ThreadSidebarProps } from "./src/react/thread-sidebar.tsx";
67
- export { ThreadActions, ThreadTabs } from "./src/react/thread-tabs.tsx";
68
- export type { ThreadTabsProps, ThreadActionsProps } from "./src/react/thread-tabs.tsx";
69
- export { humanizeToolName, ToolSessionPill } from "./src/react/tool-pill.tsx";
70
- export type { ToolInputPresentation, WebSearchProgressGroup } from "./src/react/tool-pill.tsx";
71
- export type { ChatStatus, ToolEvent, ToolProgress, ChatModelOption, ChatInputMessage, QueuedSteer, FeedbackValue, FeedbackSubmission, MessageFeedback, ThreadSummary, ThreadPlacement, ChatViewProps, ApprovalDecision, PendingApproval } from "./src/react/types.ts";
72
- export { StoredActiveRunSchema, activeRunStorageKey } from "./src/support/active-runs.ts";
73
- export type { StoredActiveRun } from "./src/support/active-runs.ts";
74
- export { LIGHT_CHART_CHROME } from "./src/support/chart-theme.ts";
75
- export type { ChartChrome } from "./src/support/chart-theme.ts";
76
- export type { ExportFormat, ExportBrand, EmbedResolver, ExportChatOptions } from "./src/support/export.ts";
77
- export { GenieChatClient } from "./src/support/genie-client.ts";
78
- export { MastraChatRequestError, MastraPluginClient, useMastraConfig, useMastraClient, useMastraMlflowExperiment, useMastraModels, useMastraDefaultModel, useMastraSuggestions, useMastraThreads, useChartFetch, useStatementFetch, useVisualizationFetch } from "./src/support/mastra-client.ts";
79
- export type { MastraStreamResponse, MastraMemoryThread, ByIdFetchState } from "./src/support/mastra-client.ts";
80
- export { defaultReasoningEffort, modelStorageKey, readStoredModel, storeSelectedModel } from "./src/support/model-selection.ts";
81
- export type { MastraRequestContextInput, MastraRequestContextSource } from "./src/support/request-context.ts";
82
- export { DEFAULT_THREAD_SESSION_KEY } from "./src/support/thread-sessions.ts";
83
- export type { SessionQueuedSteer, SessionRun, ThreadSession } from "./src/support/thread-sessions.ts";
84
- export { THREAD_TAB_SEED_MAX } from "./src/support/thread-tabs.ts";
6
+ export const PACKAGE_VERSION = "0.9.157";
package/package.json CHANGED
@@ -22,19 +22,22 @@
22
22
  "@types/react-dom": "^19.2.2",
23
23
  "react": "~19.2.4",
24
24
  "react-dom": "~19.2.4",
25
+ "react-router-dom": "^7.6.2",
25
26
  "typescript": "^5.9.3"
26
27
  },
27
28
  "peerDependencies": {
28
29
  "react": "~19.2.4",
29
- "react-dom": "~19.2.4"
30
+ "react-dom": "~19.2.4",
31
+ "react-router-dom": "^7.6.2"
30
32
  },
31
33
  "dependencies": {
32
34
  "@databricks/appkit-ui": "0.81.0",
33
- "@dbx-tools/shared-core": "^0.9.153",
34
- "@dbx-tools/shared-genie": "^0.9.153",
35
- "@dbx-tools/shared-mastra": "^0.9.153",
36
- "@dbx-tools/shared-model": "^0.9.153",
37
- "@dbx-tools/ui": "^0.9.153",
35
+ "@dbx-tools/shared-auth": "^0.9.157",
36
+ "@dbx-tools/shared-core": "^0.9.157",
37
+ "@dbx-tools/shared-genie": "^0.9.157",
38
+ "@dbx-tools/shared-mastra": "^0.9.157",
39
+ "@dbx-tools/shared-model": "^0.9.157",
40
+ "@dbx-tools/ui": "^0.9.157",
38
41
  "@mastra/client-js": "1.50.0",
39
42
  "@mastra/core": "1.71.0",
40
43
  "@tanstack/react-table": "^8.21.3",
@@ -47,11 +50,13 @@
47
50
  "streamdown": "^2.5.0",
48
51
  "zod": "4.3.6"
49
52
  },
53
+ "main": "index.ts",
50
54
  "license": "Apache-2.0",
51
55
  "publishConfig": {
52
56
  "access": "public"
53
57
  },
54
- "version": "0.9.153",
58
+ "version": "0.9.157",
59
+ "types": "index.ts",
55
60
  "dbxToolsConfig": {
56
61
  "tags": [
57
62
  "ui"
@@ -59,14 +64,20 @@
59
64
  },
60
65
  "type": "module",
61
66
  "exports": {
62
- "./react": "./src/react/index.ts",
67
+ ".": "./index.ts",
68
+ "./react": "./index.react.ts",
69
+ "./support": "./index.support.ts",
63
70
  "./styles.css": "./src/styles.css",
64
- "./*": "./src/*/index.ts",
65
71
  "./package.json": "./package.json"
66
72
  },
67
73
  "files": [
68
- "index.ts",
74
+ "index*.ts",
69
75
  "src"
70
76
  ],
77
+ "peerDependenciesMeta": {
78
+ "react-router-dom": {
79
+ "optional": true
80
+ }
81
+ },
71
82
  "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"bunx projen\"."
72
83
  }
@@ -1,4 +1,4 @@
1
- import { Spinner } from "@dbx-tools/ui/react";
1
+ import { Spinner } from "@databricks/appkit-ui/react";
2
2
 
3
3
  import type { ChatStatus } from "./types.ts";
4
4
 
@@ -8,7 +8,7 @@ import {
8
8
  AlertDialogHeader,
9
9
  AlertDialogTitle,
10
10
  Button,
11
- } from "@dbx-tools/ui/react";
11
+ } from "@databricks/appkit-ui/react";
12
12
  import { CheckIcon, CopyIcon, ExternalLinkIcon } from "lucide-react";
13
13
  import { useEffect, useMemo, useRef, useState } from "react";
14
14
  import type { LinkSafetyModalProps } from "streamdown";
@@ -1,5 +1,3 @@
1
- import { stringUtils } from "@dbx-tools/shared-core";
2
- import type { ReasoningEffort } from "@dbx-tools/shared-model";
3
1
  import {
4
2
  Button,
5
3
  DropdownMenu,
@@ -17,7 +15,9 @@ import {
17
15
  Slider,
18
16
  Spinner,
19
17
  useIsMobile,
20
- } from "@dbx-tools/ui/react";
18
+ } from "@databricks/appkit-ui/react";
19
+ import { toLabel } from "@dbx-tools/shared-core";
20
+ import type { ReasoningEffort } from "@dbx-tools/shared-model";
21
21
  import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
22
22
  import { useMemo, useState, type ReactNode } from "react";
23
23
  import type { ChatModelOption, ChatViewProps } from "./types.ts";
@@ -38,7 +38,7 @@ interface ModelSelectorProps {
38
38
 
39
39
  /** Convert a normalized family token into a compact menu label. */
40
40
  function familyLabel(family: string): string {
41
- return family.length <= 3 ? family.toUpperCase() : stringUtils.toLabel(family);
41
+ return family.length <= 3 ? family.toUpperCase() : toLabel(family);
42
42
  }
43
43
 
44
44
  /** Resolve the label shown for a model endpoint. */
@@ -57,7 +57,7 @@ const ReasoningControl = ({
57
57
  onChange: NonNullable<ChatViewProps["onReasoningEffortChange"]>;
58
58
  }) => {
59
59
  const selectedIndex = value === undefined ? 0 : Math.max(0, efforts.indexOf(value) + 1);
60
- const selectedLabel = value === undefined ? "Auto" : stringUtils.toLabel(value);
60
+ const selectedLabel = value === undefined ? "Auto" : toLabel(value);
61
61
 
62
62
  return (
63
63
  <div className="space-y-2 px-2 py-1.5">
@@ -8,12 +8,12 @@ import {
8
8
  Item,
9
9
  ItemContent,
10
10
  ItemMedia,
11
- RecordPreview,
12
11
  Tooltip,
13
12
  TooltipContent,
14
13
  TooltipTrigger,
15
14
  cn,
16
- } from "@dbx-tools/ui/react";
15
+ } from "@databricks/appkit-ui/react";
16
+ import { RecordPreview } from "@dbx-tools/ui/react";
17
17
  import type { UIMessage } from "ai";
18
18
  import {
19
19
  BugIcon,
@@ -39,13 +39,13 @@ import { ToolSessionPill, humanizeToolName } from "./tool-pill.tsx";
39
39
  import type {
40
40
  ApprovalDecision,
41
41
  ChatStatus,
42
- ExportFormat,
43
42
  FeedbackSubmission,
44
43
  FeedbackValue,
45
44
  PendingApproval,
46
45
  ToolEvent,
47
46
  } from "./types.ts";
48
47
  import { copyText } from "../support/clipboard.ts";
48
+ import type { ExportFormat } from "../support/export.ts";
49
49
  import { mergeToolEvents, toolEventsFromParts } from "../support/tool-events.ts";
50
50
 
51
51
  // User / assistant message bubbles plus the inline approval card and
@@ -17,7 +17,7 @@ import {
17
17
  TooltipContent,
18
18
  TooltipTrigger,
19
19
  cn,
20
- } from "@dbx-tools/ui/react";
20
+ } from "@databricks/appkit-ui/react";
21
21
  import type { FileUIPart } from "ai";
22
22
  import {
23
23
  GripVerticalIcon,
@@ -1,6 +1,6 @@
1
- import { errorUtils, log } from "@dbx-tools/shared-core";
2
- import { genieModel } from "@dbx-tools/shared-genie";
3
- import type { FeedbackMode } from "@dbx-tools/shared-mastra/feedback";
1
+ import { log, toError } from "@dbx-tools/shared-core";
2
+ import { GenieMessageSchema } from "@dbx-tools/shared-genie";
3
+ import type { FeedbackMode } from "@dbx-tools/shared-mastra";
4
4
  import type { UIMessage } from "ai";
5
5
  import { useCallback, useRef } from "react";
6
6
  import type { ThreadSessionUpdater } from "./chat-sessions.ts";
@@ -33,7 +33,7 @@ export function genieFeedbackTarget(message: UIMessage): GenieFeedbackTarget | u
33
33
  typeof event.output === "object" && event.output !== null && "message" in event.output
34
34
  ? event.output.message
35
35
  : undefined;
36
- const parsed = genieModel.GenieMessageSchema.safeParse(output);
36
+ const parsed = GenieMessageSchema.safeParse(output);
37
37
  if (!parsed.success) continue;
38
38
  const genieMessage = parsed.data;
39
39
  const messageId = genieMessage.message_id ?? genieMessage.id;
@@ -107,7 +107,7 @@ export function useChatFeedback({
107
107
  logger.error("feedback error", {
108
108
  feedbackMode,
109
109
  ...(traceId ? { traceId } : {}),
110
- error: errorUtils.toError(error),
110
+ error: toError(error),
111
111
  });
112
112
  }
113
113
  },
@@ -1,4 +1,4 @@
1
- import { errorUtils, log } from "@dbx-tools/shared-core";
1
+ import { log, toError } from "@dbx-tools/shared-core";
2
2
  import type { UIMessage } from "ai";
3
3
  import { useCallback, useEffect, useRef, useState } from "react";
4
4
  import { toChronologicalUiMessages } from "./_history-messages.ts";
@@ -116,7 +116,7 @@ export function useChatHistory({
116
116
  .catch((error: unknown) => {
117
117
  if ((error as { name?: string }).name === "AbortError") throw error;
118
118
  logger.warn("suspended-run discovery error", {
119
- error: errorUtils.toError(error),
119
+ error: toError(error),
120
120
  });
121
121
  return { runs: [], total: 0 };
122
122
  });
@@ -140,7 +140,7 @@ export function useChatHistory({
140
140
  .catch((error: unknown) => {
141
141
  if (cancelled || (error as { name?: string }).name === "AbortError") return;
142
142
  logger.error("history load error", {
143
- error: errorUtils.toError(error),
143
+ error: toError(error),
144
144
  });
145
145
  updateSession(threadId, (current) => ({
146
146
  ...current,
@@ -181,7 +181,7 @@ export function useChatHistory({
181
181
  .catch((error: unknown) => {
182
182
  logger.error("history load-more error", {
183
183
  page,
184
- error: errorUtils.toError(error),
184
+ error: toError(error),
185
185
  });
186
186
  updateSession(threadId, (current) => ({
187
187
  ...current,
@@ -1,6 +1,5 @@
1
- import { errorUtils, log, stringUtils } from "@dbx-tools/shared-core";
2
- import { feedback } from "@dbx-tools/shared-mastra";
3
- import { isStaleMastraResumeError } from "@dbx-tools/shared-mastra/resume";
1
+ import { log, toError, trimToUndefined } from "@dbx-tools/shared-core";
2
+ import { MLFLOW_TRACE_ID_HEADER, isStaleMastraResumeError } from "@dbx-tools/shared-mastra";
4
3
  import { readUIMessageStream, type UIMessage, type UIMessageChunk } from "ai";
5
4
  import { useCallback } from "react";
6
5
  import type {
@@ -15,7 +14,7 @@ const logger = log.logger("ui-mastra/chat");
15
14
  /** Read the MLflow trace id captured by the server on a stream response. */
16
15
  const readMlflowTraceId = (stream: unknown): string | undefined => {
17
16
  const headers = (stream as { headers?: { get?: (name: string) => string | null } })?.headers;
18
- return stringUtils.trimToUndefined(headers?.get?.(feedback.MLFLOW_TRACE_ID_HEADER));
17
+ return trimToUndefined(headers?.get?.(MLFLOW_TRACE_ID_HEADER));
19
18
  };
20
19
 
21
20
  class StreamAborted extends Error {}
@@ -139,7 +138,7 @@ export function useChatStream({ getSession, updateSession, writeMessages }: UseC
139
138
  if (error instanceof StreamAborted || signal.aborted) return;
140
139
  if (isStaleMastraResumeError(error)) {
141
140
  logger.warn("ignored stale mastra resume", {
142
- error: errorUtils.toError(error),
141
+ error: toError(error),
143
142
  });
144
143
  return;
145
144
  }
@@ -5,7 +5,7 @@ import {
5
5
  TooltipProvider,
6
6
  TooltipTrigger,
7
7
  cn,
8
- } from "@dbx-tools/ui/react";
8
+ } from "@databricks/appkit-ui/react";
9
9
  import { PanelLeftIcon, PanelRightIcon } from "lucide-react";
10
10
  import React, { useEffect, useRef, useState } from "react";
11
11
  import { ThreadSidebar, type ThreadSidebarProps } from "./thread-sidebar.tsx";
@@ -152,9 +152,16 @@ export const ChatThreadLayout = ({
152
152
  };
153
153
 
154
154
  const [openTabIds, setOpenTabIds] = useState<string[]>([]);
155
+ const tabsSeededRef = useRef(false);
155
156
  useEffect(() => {
156
157
  if (!tabbedThreads) return;
157
- setOpenTabIds((previous) => syncThreadTabs(previous, threads ?? [], activeThreadId));
158
+ const seed = !tabsSeededRef.current;
159
+ tabsSeededRef.current = true;
160
+ setOpenTabIds((previous) =>
161
+ syncThreadTabs(previous, threads ?? [], activeThreadId, {
162
+ seed,
163
+ }),
164
+ );
158
165
  }, [tabbedThreads, threads, activeThreadId]);
159
166
 
160
167
  const closeTab = (threadId: string) => {
@@ -1,4 +1,3 @@
1
- import { errorUtils } from "@dbx-tools/shared-core";
2
1
  import {
3
2
  Alert,
4
3
  AlertDescription,
@@ -10,7 +9,8 @@ import {
10
9
  EmptyMedia,
11
10
  EmptyTitle,
12
11
  Spinner,
13
- } from "@dbx-tools/ui/react";
12
+ } from "@databricks/appkit-ui/react";
13
+ import { errorMessage } from "@dbx-tools/shared-core";
14
14
  import { isToolUIPart } from "ai";
15
15
  import { ArrowDownIcon, MessageSquareIcon, RefreshCwIcon, TriangleAlertIcon } from "lucide-react";
16
16
  import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
@@ -298,7 +298,7 @@ export const ChatTranscript = ({
298
298
  <AlertTitle>Something went wrong</AlertTitle>
299
299
  <AlertDescription>
300
300
  {error
301
- ? errorUtils.errorMessage(error)
301
+ ? errorMessage(error)
302
302
  : "The assistant ran into an error. Please try again."}
303
303
  </AlertDescription>
304
304
  </Alert>
@@ -1,4 +1,3 @@
1
- import { stringUtils } from "@dbx-tools/shared-core";
2
1
  import {
3
2
  Button,
4
3
  DropdownMenu,
@@ -12,7 +11,8 @@ import {
12
11
  TableHeader,
13
12
  TableRow,
14
13
  cn,
15
- } from "@dbx-tools/ui/react";
14
+ } from "@databricks/appkit-ui/react";
15
+ import { type TokenizeOptions, toLabel } from "@dbx-tools/shared-core";
16
16
  import {
17
17
  flexRender,
18
18
  getCoreRowModel,
@@ -83,8 +83,8 @@ export function renderDataCell(value: unknown): React.ReactNode {
83
83
  * column id, accessor key, and CSV header, so only the on-screen label
84
84
  * is prettified.
85
85
  */
86
- export function humanizeLabel(value: string, options?: stringUtils.TokenizeOptions): string {
87
- return stringUtils.toLabel(value, options);
86
+ export function humanizeLabel(value: string, options?: TokenizeOptions): string {
87
+ return toLabel(value, options);
88
88
  }
89
89
 
90
90
  /**
@@ -1,6 +1,10 @@
1
- import { GenieQueryVisualization } from "@databricks/appkit-ui/react";
2
- import { markers, type ParsedMarker } from "@dbx-tools/shared-mastra";
3
- import { Spinner } from "@dbx-tools/ui/react";
1
+ import { GenieQueryVisualization, Spinner } from "@databricks/appkit-ui/react";
2
+ import {
3
+ type ParsedMarker,
4
+ isUuid,
5
+ parseMarkers,
6
+ stripIncompleteMarkerTail,
7
+ } from "@dbx-tools/shared-mastra";
4
8
  import { ClockIcon } from "lucide-react";
5
9
  import { lazy, Suspense, useMemo, useRef } from "react";
6
10
  import { DataGrid, humanizeLabel } from "./data-grid.tsx";
@@ -209,7 +213,7 @@ type RenderSegment =
209
213
  * known, renderable type resolves to a slot.
210
214
  */
211
215
  const markerSegment = (marker: ParsedMarker): RenderSegment => {
212
- if (!markers.isUuid(marker.id)) return { kind: "text", text: "" };
216
+ if (!isUuid(marker.id)) return { kind: "text", text: "" };
213
217
  switch (marker.type) {
214
218
  case "chart":
215
219
  return { kind: "chart", chartId: marker.id };
@@ -228,7 +232,7 @@ const splitTextWithEmbeds = (text: string): RenderSegment[] => {
228
232
  // `parseMarkers` yields hits in source order with no overlaps (one
229
233
  // regex pass), so the spans splice in directly - no sort or
230
234
  // overlap guard needed.
231
- for (const marker of markers.parseMarkers(text)) {
235
+ for (const marker of parseMarkers(text)) {
232
236
  if (marker.start > lastIdx) {
233
237
  segments.push({ kind: "text", text: text.slice(lastIdx, marker.start) });
234
238
  }
@@ -273,7 +277,7 @@ export const MarkdownWithEmbeds = ({
273
277
  text: string;
274
278
  streaming?: boolean;
275
279
  }) => {
276
- const segments = splitTextWithEmbeds(markers.stripIncompleteMarkerTail(text));
280
+ const segments = splitTextWithEmbeds(stripIncompleteMarkerTail(text));
277
281
  return (
278
282
  <>
279
283
  {segments.map((seg, i) => {
@@ -7,7 +7,7 @@ import {
7
7
  Tooltip,
8
8
  TooltipContent,
9
9
  TooltipTrigger,
10
- } from "@dbx-tools/ui/react";
10
+ } from "@databricks/appkit-ui/react";
11
11
  import { DownloadIcon, FileTextIcon } from "lucide-react";
12
12
  import type { ExportFormat } from "../support/export.ts";
13
13
 
@@ -12,7 +12,7 @@ import {
12
12
  TooltipContent,
13
13
  TooltipTrigger,
14
14
  cn,
15
- } from "@dbx-tools/ui/react";
15
+ } from "@databricks/appkit-ui/react";
16
16
  import { MessageSquareTextIcon, ThumbsDownIcon, ThumbsUpIcon } from "lucide-react";
17
17
  import { useState } from "react";
18
18
  import type { FeedbackSubmission, FeedbackValue } from "./types.ts";
@@ -11,11 +11,9 @@ import {
11
11
  Tooltip,
12
12
  TooltipContent,
13
13
  TooltipTrigger,
14
- createShikiPlugin,
15
- highlightToHtml,
16
- useHighlightedHtml,
17
14
  cn,
18
- } from "@dbx-tools/ui/react";
15
+ } from "@databricks/appkit-ui/react";
16
+ import { createShikiPlugin, highlightToHtml, useHighlightedHtml } from "@dbx-tools/ui/react";
19
17
  import { CheckIcon, CopyIcon } from "lucide-react";
20
18
  import React, { useEffect, useRef, useState } from "react";
21
19
  import { Streamdown } from "streamdown";
@@ -5,7 +5,7 @@ import {
5
5
  TooltipProvider,
6
6
  TooltipTrigger,
7
7
  cn,
8
- } from "@dbx-tools/ui/react";
8
+ } from "@databricks/appkit-ui/react";
9
9
  import { BotIcon, MessageCircleIcon, XIcon } from "lucide-react";
10
10
  import {
11
11
  createContext,