@dbx-tools/ui-mastra 0.9.61 → 0.9.64
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 +1 -1
- package/package.json +6 -6
- package/src/react/bubbles.tsx +4 -2
- package/src/support/tool-events.ts +10 -1
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.
|
|
6
|
+
export const PACKAGE_VERSION = "0.9.64";
|
|
7
7
|
export * as reactBubbles from "./src/react/bubbles.tsx";
|
|
8
8
|
export * as reactChatApprovals from "./src/react/chat-approvals.ts";
|
|
9
9
|
export * as reactChatComposer from "./src/react/chat-composer.tsx";
|
package/package.json
CHANGED
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"react-dom": "~19.2.4"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@dbx-tools/shared-core": "^0.9.
|
|
33
|
-
"@dbx-tools/shared-genie": "^0.9.
|
|
34
|
-
"@dbx-tools/shared-mastra": "^0.9.
|
|
35
|
-
"@dbx-tools/shared-model": "^0.9.
|
|
36
|
-
"@dbx-tools/ui": "^0.9.
|
|
32
|
+
"@dbx-tools/shared-core": "^0.9.64",
|
|
33
|
+
"@dbx-tools/shared-genie": "^0.9.64",
|
|
34
|
+
"@dbx-tools/shared-mastra": "^0.9.64",
|
|
35
|
+
"@dbx-tools/shared-model": "^0.9.64",
|
|
36
|
+
"@dbx-tools/ui": "^0.9.64",
|
|
37
37
|
"@mastra/client-js": "1.50.0",
|
|
38
38
|
"@mastra/core": "1.71.0",
|
|
39
39
|
"@tanstack/react-table": "^8.21.3",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"version": "0.9.
|
|
53
|
+
"version": "0.9.64",
|
|
54
54
|
"dbxToolsConfig": {
|
|
55
55
|
"tags": [
|
|
56
56
|
"ui"
|
package/src/react/bubbles.tsx
CHANGED
|
@@ -43,6 +43,7 @@ import type {
|
|
|
43
43
|
} from "./types.ts";
|
|
44
44
|
import { copyText } from "../support/clipboard.ts";
|
|
45
45
|
import {
|
|
46
|
+
compactReasoningText,
|
|
46
47
|
genieReasoningText,
|
|
47
48
|
mergeToolEvents,
|
|
48
49
|
toolEventsFromParts,
|
|
@@ -55,7 +56,8 @@ import {
|
|
|
55
56
|
const getReasoningText = (parts: UIMessage["parts"]): string =>
|
|
56
57
|
parts
|
|
57
58
|
.filter((p): p is { type: "reasoning"; text: string } => p.type === "reasoning")
|
|
58
|
-
.map((p) => p.text)
|
|
59
|
+
.map((p) => compactReasoningText(p.text))
|
|
60
|
+
.filter(Boolean)
|
|
59
61
|
.join("\n\n");
|
|
60
62
|
|
|
61
63
|
const RoleAvatar = ({ role }: { role: UIMessage["role"] }) => (
|
|
@@ -424,7 +426,7 @@ export const AssistantBubble = ({
|
|
|
424
426
|
<span>{isReasoningStreaming ? "Thinking..." : "Thoughts"}</span>
|
|
425
427
|
</CollapsibleTrigger>
|
|
426
428
|
<CollapsibleContent>
|
|
427
|
-
<div className="mt-1 border-l-2 border-border/60 pl-
|
|
429
|
+
<div className="mt-1 border-l-2 border-border/60 pl-2.5 text-xs text-muted-foreground">
|
|
428
430
|
<ToolMarkdown>{reasoning}</ToolMarkdown>
|
|
429
431
|
</div>
|
|
430
432
|
</CollapsibleContent>
|
|
@@ -2,6 +2,15 @@ import { GENIE_PROGRESS_PART_TYPE, GenieProgressPartDataSchema } from "@dbx-tool
|
|
|
2
2
|
import { getToolOrDynamicToolName, isToolOrDynamicToolUIPart, type UIMessage } from "ai";
|
|
3
3
|
import type { ToolEvent } from "../react/types.ts";
|
|
4
4
|
|
|
5
|
+
/** Collapse one reasoning event into a compact paragraph. */
|
|
6
|
+
export function compactReasoningText(text: string): string {
|
|
7
|
+
return stripMarkdownTables(text)
|
|
8
|
+
.split(/\r?\n/)
|
|
9
|
+
.map((line) => line.trim())
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.join(" ");
|
|
12
|
+
}
|
|
13
|
+
|
|
5
14
|
/**
|
|
6
15
|
* Collect Genie `thinking` events for the assistant Thoughts panel.
|
|
7
16
|
*
|
|
@@ -14,7 +23,7 @@ export function genieReasoningText(events: ToolEvent[]): string {
|
|
|
14
23
|
for (const event of events) {
|
|
15
24
|
for (const progress of event.progress ?? []) {
|
|
16
25
|
if (progress.type !== "thinking") continue;
|
|
17
|
-
const text =
|
|
26
|
+
const text = compactReasoningText(progress.text);
|
|
18
27
|
if (text) sections.push(text);
|
|
19
28
|
}
|
|
20
29
|
}
|