@dbx-tools/ui-mastra 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.ts CHANGED
@@ -2,53 +2,53 @@
2
2
  // Regenerated from the exporting modules in ./src.
3
3
  // Hand edits are overwritten on the next watch; this file is read-only.
4
4
 
5
- export * as reactBubbles from "./src/react/bubbles";
6
- export * as reactChatView from "./src/react/chat-view";
7
- export * as reactDataGrid from "./src/react/data-grid";
8
- export * as reactEmbedSlots from "./src/react/embed-slots";
9
- export * as reactExportMenu from "./src/react/export-menu";
10
- export * as reactFeedbackControls from "./src/react/feedback-controls";
11
- export * as reactMarkdown from "./src/react/markdown";
12
- export * as reactMastraChat from "./src/react/mastra-chat";
13
- export * as reactSuggestionPills from "./src/react/suggestion-pills";
14
- export * as reactSuggestions from "./src/react/suggestions";
15
- export * as reactThreadSidebar from "./src/react/thread-sidebar";
16
- export * as reactToolPill from "./src/react/tool-pill";
17
- export * as reactTypes from "./src/react/types";
18
- export * as supportChartOption from "./src/support/chart-option";
19
- export * as supportClipboard from "./src/support/clipboard";
20
- export * as supportDownload from "./src/support/download";
21
- export * as supportExport from "./src/support/export";
22
- export * as supportMastraClient from "./src/support/mastra-client";
23
- export * as supportMastraStream from "./src/support/mastra-stream";
24
- export * as supportShikiPlugin from "./src/support/shiki-plugin";
25
- export * as supportThreadSessions from "./src/support/thread-sessions";
26
- export { AssistantBubble, UserBubble } from "./src/react/bubbles";
27
- export { ChatView } from "./src/react/chat-view";
28
- export { colorizeDelta, renderDataCell, humanizeLabel, TABLE_WRAPPER_CLASSES, DataGrid } from "./src/react/data-grid";
29
- export type { DataRow } from "./src/react/data-grid";
30
- export { MarkdownWithEmbeds } from "./src/react/embed-slots";
31
- export { ExportMenu } from "./src/react/export-menu";
32
- export { FeedbackControls } from "./src/react/feedback-controls";
33
- export { AssistantMarkdown, ToolMarkdown, SqlBlock } from "./src/react/markdown";
34
- export { useMastraChat, MastraChat } from "./src/react/mastra-chat";
35
- export type { UseMastraChatOptions, MastraChatProps } from "./src/react/mastra-chat";
36
- export { SuggestionPills } from "./src/react/suggestion-pills";
37
- export type { SuggestionPillsProps } from "./src/react/suggestion-pills";
38
- export { dedupeSuggestions, collectSuggestions } from "./src/react/suggestions";
39
- export { ThreadSidebar } from "./src/react/thread-sidebar";
40
- export type { ThreadSidebarProps } from "./src/react/thread-sidebar";
41
- export { humanizeToolName, ToolSessionPill } from "./src/react/tool-pill";
42
- export type { ChatStatus, ToolEvent, ToolProgress, ChatModelOption, QueuedSteer, FeedbackValue, FeedbackSubmission, MessageFeedback, ThreadSummary, ChatViewProps, ApprovalDecision, PendingApproval } from "./src/react/types";
43
- export { normalizeChartOption } from "./src/support/chart-option";
44
- export { copyText } from "./src/support/clipboard";
45
- export { downloadFile } from "./src/support/download";
46
- export { exportChat } from "./src/support/export";
47
- export type { ExportFormat, ExportBrand, EmbedResolver, ExportChatOptions } from "./src/support/export";
48
- export { MastraPluginClient, useMastraConfig, useMastraClient, useMastraModels, useMastraDefaultModel, useMastraSuggestions, useMastraThreads, useChartFetch, useStatementFetch } from "./src/support/mastra-client";
49
- export type { ByIdFetchState } from "./src/support/mastra-client";
50
- export { processMastraStream, asMastraStreamResponse } from "./src/support/mastra-stream";
51
- export type { MastraStreamChunk, MastraStreamResponse } from "./src/support/mastra-stream";
52
- export { highlightToHtml, createShikiPlugin } from "./src/support/shiki-plugin";
53
- export { DEFAULT_THREAD_SESSION_KEY, createThreadSession, isSessionRunning, enqueueSteer, removeSteer, reorderSteers, terminateRunningToolEvents, sessionKey } from "./src/support/thread-sessions";
54
- export type { ThreadSession } from "./src/support/thread-sessions";
5
+ export * as reactBubbles from "./src/react/bubbles.tsx";
6
+ export * as reactChatView from "./src/react/chat-view.tsx";
7
+ export * as reactDataGrid from "./src/react/data-grid.tsx";
8
+ export * as reactEmbedSlots from "./src/react/embed-slots.tsx";
9
+ export * as reactExportMenu from "./src/react/export-menu.tsx";
10
+ export * as reactFeedbackControls from "./src/react/feedback-controls.tsx";
11
+ export * as reactMarkdown from "./src/react/markdown.tsx";
12
+ export * as reactMastraChat from "./src/react/mastra-chat.tsx";
13
+ export * as reactSuggestionPills from "./src/react/suggestion-pills.tsx";
14
+ export * as reactSuggestions from "./src/react/suggestions.ts";
15
+ export * as reactThreadSidebar from "./src/react/thread-sidebar.tsx";
16
+ export * as reactToolPill from "./src/react/tool-pill.tsx";
17
+ export * as reactTypes from "./src/react/types.ts";
18
+ export * as supportChartOption from "./src/support/chart-option.ts";
19
+ export * as supportClipboard from "./src/support/clipboard.ts";
20
+ export * as supportDownload from "./src/support/download.ts";
21
+ export * as supportExport from "./src/support/export.ts";
22
+ export * as supportMastraClient from "./src/support/mastra-client.ts";
23
+ export * as supportMastraStream from "./src/support/mastra-stream.ts";
24
+ export * as supportShikiPlugin from "./src/support/shiki-plugin.ts";
25
+ export * as supportThreadSessions from "./src/support/thread-sessions.ts";
26
+ export { AssistantBubble, UserBubble } from "./src/react/bubbles.tsx";
27
+ export { ChatView } from "./src/react/chat-view.tsx";
28
+ export { colorizeDelta, renderDataCell, humanizeLabel, TABLE_WRAPPER_CLASSES, DataGrid } from "./src/react/data-grid.tsx";
29
+ export type { DataRow } from "./src/react/data-grid.tsx";
30
+ export { MarkdownWithEmbeds } from "./src/react/embed-slots.tsx";
31
+ export { ExportMenu } from "./src/react/export-menu.tsx";
32
+ export { FeedbackControls } from "./src/react/feedback-controls.tsx";
33
+ export { AssistantMarkdown, ToolMarkdown, SqlBlock } from "./src/react/markdown.tsx";
34
+ export { useMastraChat, MastraChat } from "./src/react/mastra-chat.tsx";
35
+ export type { UseMastraChatOptions, MastraChatProps } from "./src/react/mastra-chat.tsx";
36
+ export { SuggestionPills } from "./src/react/suggestion-pills.tsx";
37
+ export type { SuggestionPillsProps } from "./src/react/suggestion-pills.tsx";
38
+ export { dedupeSuggestions, collectSuggestions } from "./src/react/suggestions.ts";
39
+ export { ThreadSidebar } from "./src/react/thread-sidebar.tsx";
40
+ export type { ThreadSidebarProps } from "./src/react/thread-sidebar.tsx";
41
+ export { humanizeToolName, ToolSessionPill } from "./src/react/tool-pill.tsx";
42
+ export type { ChatStatus, ToolEvent, ToolProgress, ChatModelOption, QueuedSteer, FeedbackValue, FeedbackSubmission, MessageFeedback, ThreadSummary, ChatViewProps, ApprovalDecision, PendingApproval } from "./src/react/types.ts";
43
+ export { normalizeChartOption } from "./src/support/chart-option.ts";
44
+ export { copyText } from "./src/support/clipboard.ts";
45
+ export { downloadFile } from "./src/support/download.ts";
46
+ export { exportChat } from "./src/support/export.ts";
47
+ export type { ExportFormat, ExportBrand, EmbedResolver, ExportChatOptions } from "./src/support/export.ts";
48
+ export { MastraPluginClient, useMastraConfig, useMastraClient, useMastraModels, useMastraDefaultModel, useMastraSuggestions, useMastraThreads, useChartFetch, useStatementFetch } from "./src/support/mastra-client.ts";
49
+ export type { ByIdFetchState } from "./src/support/mastra-client.ts";
50
+ export { processMastraStream, asMastraStreamResponse } from "./src/support/mastra-stream.ts";
51
+ export type { MastraStreamChunk, MastraStreamResponse } from "./src/support/mastra-stream.ts";
52
+ export { highlightToHtml, createShikiPlugin } from "./src/support/shiki-plugin.ts";
53
+ export { DEFAULT_THREAD_SESSION_KEY, createThreadSession, isSessionRunning, enqueueSteer, removeSteer, reorderSteers, terminateRunningToolEvents, sessionKey } from "./src/support/thread-sessions.ts";
54
+ export type { ThreadSession } from "./src/support/thread-sessions.ts";
package/package.json CHANGED
@@ -25,18 +25,18 @@
25
25
  "shiki": "^3.0.0",
26
26
  "sql-formatter": "^15.6.9",
27
27
  "streamdown": "^2.5.0",
28
- "@dbx-tools/shared-genie": "0.4.0",
29
- "@dbx-tools/shared-core": "0.4.0",
30
- "@dbx-tools/shared-model": "0.4.0",
31
- "@dbx-tools/ui-appkit": "0.4.0",
32
- "@dbx-tools/ui-branding": "0.4.0",
33
- "@dbx-tools/shared-mastra": "0.4.0"
28
+ "@dbx-tools/shared-genie": "0.5.0",
29
+ "@dbx-tools/shared-core": "0.5.0",
30
+ "@dbx-tools/shared-mastra": "0.5.0",
31
+ "@dbx-tools/shared-model": "0.5.0",
32
+ "@dbx-tools/ui-appkit": "0.5.0",
33
+ "@dbx-tools/ui-branding": "0.5.0"
34
34
  },
35
35
  "license": "UNLICENSED",
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "version": "0.4.0",
39
+ "version": "0.5.0",
40
40
  "type": "module",
41
41
  "exports": {
42
42
  "./react": "./src/react/index.ts",
@@ -24,13 +24,13 @@ import {
24
24
  XIcon,
25
25
  } from "lucide-react";
26
26
  import { useState } from "react";
27
- import { MarkdownWithEmbeds } from "./embed-slots";
28
- import { ExportMenu } from "./export-menu";
29
- import { FeedbackControls } from "./feedback-controls";
30
- import { ToolMarkdown } from "./markdown";
31
- import { SuggestionPills } from "./suggestion-pills";
32
- import { collectSuggestions } from "./suggestions";
33
- import { ToolSessionPill, humanizeToolName } from "./tool-pill";
27
+ import { MarkdownWithEmbeds } from "./embed-slots.tsx";
28
+ import { ExportMenu } from "./export-menu.tsx";
29
+ import { FeedbackControls } from "./feedback-controls.tsx";
30
+ import { ToolMarkdown } from "./markdown.tsx";
31
+ import { SuggestionPills } from "./suggestion-pills.tsx";
32
+ import { collectSuggestions } from "./suggestions.ts";
33
+ import { ToolSessionPill, humanizeToolName } from "./tool-pill.tsx";
34
34
  import type {
35
35
  ApprovalDecision,
36
36
  ChatStatus,
@@ -39,8 +39,8 @@ import type {
39
39
  FeedbackValue,
40
40
  PendingApproval,
41
41
  ToolEvent,
42
- } from "./types";
43
- import { copyText } from "../support/clipboard";
42
+ } from "./types.ts";
43
+ import { copyText } from "../support/clipboard.ts";
44
44
 
45
45
  // User / assistant message bubbles plus the inline approval card and
46
46
  // the helpers that surface approval-gated tool calls out of a message's
@@ -47,11 +47,11 @@ import {
47
47
  XIcon,
48
48
  } from "lucide-react";
49
49
  import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
50
- import { AssistantBubble, UserBubble } from "./bubbles";
51
- import { ExportMenu } from "./export-menu";
52
- import { SuggestionPills } from "./suggestion-pills";
53
- import { ThreadSidebar, type ThreadSidebarProps } from "./thread-sidebar";
54
- import type { ChatViewProps } from "./types";
50
+ import { AssistantBubble, UserBubble } from "./bubbles.tsx";
51
+ import { ExportMenu } from "./export-menu.tsx";
52
+ import { SuggestionPills } from "./suggestion-pills.tsx";
53
+ import { ThreadSidebar, type ThreadSidebarProps } from "./thread-sidebar.tsx";
54
+ import type { ChatViewProps } from "./types.ts";
55
55
 
56
56
  // Controlled, presentational chat shell: the scroll container, header
57
57
  // (model picker + clear), empty state, transcript of message bubbles,
@@ -30,7 +30,7 @@ import {
30
30
  DownloadIcon,
31
31
  } from "lucide-react";
32
32
  import React, { useMemo, useState } from "react";
33
- import { downloadFile } from "../support/download";
33
+ import { downloadFile } from "../support/download.ts";
34
34
 
35
35
  // Interactive result table plus the cell/label/CSV helpers it and the
36
36
  // markdown table renderer share. Built on `@tanstack/react-table` over
@@ -3,10 +3,10 @@ import { Spinner } from "@dbx-tools/ui-appkit/react";
3
3
  import ReactECharts from "echarts-for-react";
4
4
  import { ClockIcon } from "lucide-react";
5
5
  import { useMemo } from "react";
6
- import { DataGrid, humanizeLabel } from "./data-grid";
7
- import { AssistantMarkdown } from "./markdown";
8
- import { normalizeChartOption } from "../support/chart-option";
9
- import { useChartFetch, useStatementFetch } from "../support/mastra-client";
6
+ import { DataGrid, humanizeLabel } from "./data-grid.tsx";
7
+ import { AssistantMarkdown } from "./markdown.tsx";
8
+ import { normalizeChartOption } from "../support/chart-option.ts";
9
+ import { useChartFetch, useStatementFetch } from "../support/mastra-client.ts";
10
10
 
11
11
  // Inline embed slots: chart / data tables resolved from `[chart:<id>]`
12
12
  // and `[data:<id>]` markers in the assistant's prose, plus the splitter
@@ -9,7 +9,7 @@ import {
9
9
  TooltipTrigger,
10
10
  } from "@dbx-tools/ui-appkit/react";
11
11
  import { DownloadIcon, FileTextIcon } from "lucide-react";
12
- import type { ExportFormat } from "../support/export";
12
+ import type { ExportFormat } from "../support/export.ts";
13
13
 
14
14
  // Shared export affordance: a download button that opens a small menu of
15
15
  // output formats. Reused for both the whole-conversation export (header,
@@ -12,7 +12,7 @@ import {
12
12
  } from "@dbx-tools/ui-appkit/react";
13
13
  import { MessageSquareTextIcon, ThumbsDownIcon, ThumbsUpIcon } from "lucide-react";
14
14
  import { useState } from "react";
15
- import type { FeedbackSubmission, FeedbackValue } from "./types";
15
+ import type { FeedbackSubmission, FeedbackValue } from "./types.ts";
16
16
 
17
17
  // Per-message feedback action row: thumbs up/down that log immediately,
18
18
  // plus a separate comment affordance that opens a popover for freeform
@@ -20,13 +20,13 @@ export {
20
20
  useMastraSuggestions,
21
21
  useMastraThreads,
22
22
  useStatementFetch,
23
- } from "../support/mastra-client";
24
- export type { ByIdFetchState } from "../support/mastra-client";
25
- export { ChatView } from "./chat-view";
26
- export { ExportMenu } from "./export-menu";
27
- export { MastraChat, useMastraChat } from "./mastra-chat";
28
- export type { MastraChatProps, UseMastraChatOptions } from "./mastra-chat";
29
- export { ThreadSidebar } from "./thread-sidebar";
23
+ } from "../support/mastra-client.ts";
24
+ export type { ByIdFetchState } from "../support/mastra-client.ts";
25
+ export { ChatView } from "./chat-view.tsx";
26
+ export { ExportMenu } from "./export-menu.tsx";
27
+ export { MastraChat, useMastraChat } from "./mastra-chat.tsx";
28
+ export type { MastraChatProps, UseMastraChatOptions } from "./mastra-chat.tsx";
29
+ export { ThreadSidebar } from "./thread-sidebar.tsx";
30
30
  export type {
31
31
  ApprovalDecision,
32
32
  ChatModelOption,
@@ -40,4 +40,4 @@ export type {
40
40
  ThreadSummary,
41
41
  ToolEvent,
42
42
  ToolProgress,
43
- } from "./types";
43
+ } from "./types.ts";
@@ -16,9 +16,9 @@ import { CheckIcon, CopyIcon } from "lucide-react";
16
16
  import React, { useEffect, useMemo, useRef, useState } from "react";
17
17
  import { format as formatSql } from "sql-formatter";
18
18
  import { Streamdown } from "streamdown";
19
- import { DataGrid, TABLE_WRAPPER_CLASSES, colorizeDelta, type DataRow } from "./data-grid";
20
- import { copyText } from "../support/clipboard";
21
- import { createShikiPlugin, highlightToHtml } from "../support/shiki-plugin";
19
+ import { DataGrid, TABLE_WRAPPER_CLASSES, colorizeDelta, type DataRow } from "./data-grid.tsx";
20
+ import { copyText } from "../support/clipboard.ts";
21
+ import { createShikiPlugin, highlightToHtml } from "../support/shiki-plugin.ts";
22
22
 
23
23
  // Markdown rendering for the chat: the streaming `Streamdown` engine
24
24
  // wired with shiki highlighting and AppKit table primitives, plus the
@@ -3,8 +3,8 @@ import { feedback, type MastraThread } from "@dbx-tools/shared-mastra";
3
3
  import { useBrand } from "@dbx-tools/ui-branding/react";
4
4
  import type { UIMessage } from "ai";
5
5
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
6
- import { ChatView } from "./chat-view";
7
- import { dedupeSuggestions } from "./suggestions";
6
+ import { ChatView } from "./chat-view.tsx";
7
+ import { dedupeSuggestions } from "./suggestions.ts";
8
8
  import type {
9
9
  ApprovalDecision,
10
10
  ChatViewProps,
@@ -13,16 +13,16 @@ import type {
13
13
  ThreadSummary,
14
14
  ToolEvent,
15
15
  ToolProgress,
16
- } from "./types";
17
- import { exportChat, type EmbedResolver, type ExportFormat } from "../support/export";
16
+ } from "./types.ts";
17
+ import { exportChat, type EmbedResolver, type ExportFormat } from "../support/export.ts";
18
18
  import {
19
19
  useMastraClient,
20
20
  useMastraDefaultModel,
21
21
  useMastraModels,
22
22
  useMastraSuggestions,
23
23
  useMastraThreads,
24
- } from "../support/mastra-client";
25
- import type { MastraStreamResponse } from "../support/mastra-stream";
24
+ } from "../support/mastra-client.ts";
25
+ import type { MastraStreamResponse } from "../support/mastra-stream.ts";
26
26
  import {
27
27
  createThreadSession,
28
28
  DEFAULT_THREAD_SESSION_KEY,
@@ -33,7 +33,7 @@ import {
33
33
  sessionKey,
34
34
  terminateRunningToolEvents,
35
35
  type ThreadSession,
36
- } from "../support/thread-sessions";
36
+ } from "../support/thread-sessions.ts";
37
37
 
38
38
  // Self-contained drop-in chat. `useMastraChat` drives the conversation
39
39
  // over `@mastra/client-js`: `agent.stream()` returns a Response
@@ -1,4 +1,4 @@
1
- import type { ToolEvent, ToolProgress } from "./types";
1
+ import type { ToolEvent, ToolProgress } from "./types.ts";
2
2
 
3
3
  // Suggested follow-up question extraction: dedupe + cap the
4
4
  // `suggested_questions` events Genie tools emit so the assistant
@@ -17,7 +17,7 @@ import {
17
17
  Trash2Icon,
18
18
  } from "lucide-react";
19
19
  import { useState } from "react";
20
- import type { ThreadSummary } from "./types";
20
+ import type { ThreadSummary } from "./types.ts";
21
21
 
22
22
  // Presentational conversation list. Renders the threads a resource owns
23
23
  // so the user can switch between them, start a new one, rename one, and
@@ -8,8 +8,8 @@ import {
8
8
  cn,
9
9
  } from "@dbx-tools/ui-appkit/react";
10
10
  import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
11
- import { SqlBlock, ToolMarkdown } from "./markdown";
12
- import type { ToolEvent, ToolProgress } from "./types";
11
+ import { SqlBlock, ToolMarkdown } from "./markdown.tsx";
12
+ import type { ToolEvent, ToolProgress } from "./types.ts";
13
13
 
14
14
  // Consolidated tool-session pill and its Genie progress detail view:
15
15
  // groups the wire events one assistant turn produced into per-sub-call
@@ -1,8 +1,8 @@
1
1
  import type { GenieWriterEvent } from "@dbx-tools/shared-mastra";
2
2
  import type { UIMessage } from "ai";
3
- import type { ExportFormat } from "../support/export";
3
+ import type { ExportFormat } from "../support/export.ts";
4
4
 
5
- export type { ExportFormat } from "../support/export";
5
+ export type { ExportFormat } from "../support/export.ts";
6
6
 
7
7
  // Public types for the chat UI: the controlled `ChatView` props plus
8
8
  // the supporting tool-event / approval shapes a host transport feeds
@@ -28,8 +28,8 @@ import { marker as markers, type Chart, type StatementData } from "@dbx-tools/sh
28
28
  import type { UIMessage } from "ai";
29
29
  import * as echarts from "echarts";
30
30
  import { marked } from "marked";
31
- import { normalizeChartOption } from "./chart-option";
32
- import { downloadFile } from "./download";
31
+ import { normalizeChartOption } from "./chart-option.ts";
32
+ import { downloadFile } from "./download.ts";
33
33
 
34
34
  /**
35
35
  * Output formats {@link exportChat} can produce.
@@ -21,7 +21,7 @@ import type { ServingEndpointSummary } from "@dbx-tools/shared-model";
21
21
  import { usePluginClientConfig } from "@dbx-tools/ui-appkit/react";
22
22
  import { MastraClient } from "@mastra/client-js";
23
23
  import { useCallback, useEffect, useMemo, useState } from "react";
24
- import { asMastraStreamResponse, type MastraStreamResponse } from "./mastra-stream";
24
+ import { asMastraStreamResponse, type MastraStreamResponse } from "./mastra-stream.ts";
25
25
 
26
26
  /**
27
27
  * `@mastra/client-js` `MastraClient` extended with the Mastra plugin's
@@ -5,9 +5,9 @@ import type {
5
5
  PendingApproval,
6
6
  QueuedSteer,
7
7
  ToolEvent,
8
- } from "../react/types";
8
+ } from "../react/types.ts";
9
9
 
10
- export type { QueuedSteer } from "../react/types";
10
+ export type { QueuedSteer } from "../react/types.ts";
11
11
 
12
12
  /** Session-scoped transcript + stream state for one conversation thread. */
13
13
  export type ThreadSession = {