@dbx-tools/ui-mastra 0.9.178 → 0.9.179
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.react.ts +1 -1
- package/index.ts +1 -1
- package/package.json +7 -7
- package/src/react/bubbles.tsx +8 -8
- package/src/react/chat-feedback.ts +11 -0
- package/src/react/chat-transcript.tsx +5 -2
package/index.react.ts
CHANGED
|
@@ -28,7 +28,7 @@ export * as types from "./src/react/types.ts";
|
|
|
28
28
|
export { AssistantBubble, UserBubble } from "./src/react/bubbles.tsx";
|
|
29
29
|
export { resolveApprovalContinuation, useChatApprovals } from "./src/react/chat-approvals.ts";
|
|
30
30
|
export { ChatComposer } from "./src/react/chat-composer.tsx";
|
|
31
|
-
export { genieFeedbackTarget, messageFeedbackDestination, useChatFeedback } from "./src/react/chat-feedback.ts";
|
|
31
|
+
export { genieFeedbackTarget, messageFeedbackDestination, mlflowTraceUrl, useChatFeedback } from "./src/react/chat-feedback.ts";
|
|
32
32
|
export type { GenieFeedbackTarget, MessageFeedbackDestination } from "./src/react/chat-feedback.ts";
|
|
33
33
|
export { useChatHistory } from "./src/react/chat-history.ts";
|
|
34
34
|
export { useChatSessions } from "./src/react/chat-sessions.ts";
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@databricks/appkit-ui": "0.81.0",
|
|
35
|
-
"@dbx-tools/shared-auth": "^0.9.
|
|
36
|
-
"@dbx-tools/shared-core": "^0.9.
|
|
37
|
-
"@dbx-tools/shared-genie": "^0.9.
|
|
38
|
-
"@dbx-tools/shared-mastra": "^0.9.
|
|
39
|
-
"@dbx-tools/shared-model": "^0.9.
|
|
40
|
-
"@dbx-tools/ui": "^0.9.
|
|
35
|
+
"@dbx-tools/shared-auth": "^0.9.179",
|
|
36
|
+
"@dbx-tools/shared-core": "^0.9.179",
|
|
37
|
+
"@dbx-tools/shared-genie": "^0.9.179",
|
|
38
|
+
"@dbx-tools/shared-mastra": "^0.9.179",
|
|
39
|
+
"@dbx-tools/shared-model": "^0.9.179",
|
|
40
|
+
"@dbx-tools/ui": "^0.9.179",
|
|
41
41
|
"@mastra/client-js": "1.50.0",
|
|
42
42
|
"@mastra/core": "1.71.0",
|
|
43
43
|
"@tanstack/react-table": "^8.21.3",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"version": "0.9.
|
|
58
|
+
"version": "0.9.179",
|
|
59
59
|
"types": "index.ts",
|
|
60
60
|
"dbxToolsConfig": {
|
|
61
61
|
"tags": [
|
package/src/react/bubbles.tsx
CHANGED
|
@@ -339,8 +339,8 @@ type AssistantBubbleProps = {
|
|
|
339
339
|
feedbackRequest?: string;
|
|
340
340
|
/** Last thumbs the user left on this message, for highlighting. */
|
|
341
341
|
feedbackValue?: FeedbackValue;
|
|
342
|
-
/** MLflow
|
|
343
|
-
|
|
342
|
+
/** MLflow trace link shown only to viewers with `CAN_MANAGE`. */
|
|
343
|
+
mlflowTraceUrl?: string;
|
|
344
344
|
};
|
|
345
345
|
|
|
346
346
|
/** Render one assistant message with tool progress, actions, and optional feedback. */
|
|
@@ -357,7 +357,7 @@ export const AssistantBubble = ({
|
|
|
357
357
|
feedbackMode,
|
|
358
358
|
feedbackRequest,
|
|
359
359
|
feedbackValue,
|
|
360
|
-
|
|
360
|
+
mlflowTraceUrl,
|
|
361
361
|
}: AssistantBubbleProps) => {
|
|
362
362
|
const pendingApprovals = mergePendingApprovals(
|
|
363
363
|
collectPendingApprovals(message.parts),
|
|
@@ -398,7 +398,7 @@ export const AssistantBubble = ({
|
|
|
398
398
|
hasText || activityItems.length > 0 || pendingApprovals.length > 0,
|
|
399
399
|
);
|
|
400
400
|
const hasFooterActions =
|
|
401
|
-
hasText && (isLast || Boolean(onExport) || Boolean(onFeedback) || Boolean(
|
|
401
|
+
hasText && (isLast || Boolean(onExport) || Boolean(onFeedback) || Boolean(mlflowTraceUrl));
|
|
402
402
|
const showFooter = showResponseStatus || hasFooterActions;
|
|
403
403
|
// Charts and tables are placed at inline marker positions in
|
|
404
404
|
// the assistant's prose. `prepare_chart` / `render_data` mint
|
|
@@ -499,21 +499,21 @@ export const AssistantBubble = ({
|
|
|
499
499
|
{...(feedbackValue ? { value: feedbackValue } : {})}
|
|
500
500
|
/>
|
|
501
501
|
)}
|
|
502
|
-
{hasText &&
|
|
502
|
+
{hasText && mlflowTraceUrl && (
|
|
503
503
|
<Tooltip>
|
|
504
504
|
<TooltipTrigger asChild>
|
|
505
505
|
<Button asChild type="button" size="icon" variant="ghost" className="size-7">
|
|
506
506
|
<a
|
|
507
|
-
href={
|
|
507
|
+
href={mlflowTraceUrl}
|
|
508
508
|
target="_blank"
|
|
509
509
|
rel="noreferrer"
|
|
510
|
-
aria-label="Open MLflow
|
|
510
|
+
aria-label="Open MLflow trace"
|
|
511
511
|
>
|
|
512
512
|
<BugIcon className="size-3" />
|
|
513
513
|
</a>
|
|
514
514
|
</Button>
|
|
515
515
|
</TooltipTrigger>
|
|
516
|
-
<TooltipContent>Open MLflow
|
|
516
|
+
<TooltipContent>Open MLflow trace</TooltipContent>
|
|
517
517
|
</Tooltip>
|
|
518
518
|
)}
|
|
519
519
|
{showResponseStatus && (
|
|
@@ -65,6 +65,17 @@ export function messageFeedbackDestination(
|
|
|
65
65
|
return undefined;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
/** Build the Databricks MLflow detail URL for one captured trace. */
|
|
69
|
+
export function mlflowTraceUrl(experimentUrl: string, traceId?: string): string | undefined {
|
|
70
|
+
const resolvedTraceId = traceId?.trim();
|
|
71
|
+
if (!resolvedTraceId) return undefined;
|
|
72
|
+
const url = new URL(experimentUrl);
|
|
73
|
+
url.pathname = `${url.pathname.replace(/\/+$/, "")}/traces/${encodeURIComponent(resolvedTraceId)}`;
|
|
74
|
+
url.search = "";
|
|
75
|
+
url.hash = "";
|
|
76
|
+
return url.toString();
|
|
77
|
+
}
|
|
78
|
+
|
|
68
79
|
/** Submit feedback to the destination selected for the assistant message. */
|
|
69
80
|
export function useChatFeedback({
|
|
70
81
|
activeKey,
|
|
@@ -15,7 +15,7 @@ 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";
|
|
17
17
|
import { AssistantBubble, UserBubble } from "./bubbles.tsx";
|
|
18
|
-
import { messageFeedbackDestination } from "./chat-feedback.ts";
|
|
18
|
+
import { messageFeedbackDestination, mlflowTraceUrl } from "./chat-feedback.ts";
|
|
19
19
|
import { SuggestionPills } from "./suggestion-pills.tsx";
|
|
20
20
|
import { isRespondingChatStatus, type ChatViewProps } from "./types.ts";
|
|
21
21
|
import { messageText } from "../support/export.ts";
|
|
@@ -241,6 +241,9 @@ export const ChatTranscript = ({
|
|
|
241
241
|
feedbackModes,
|
|
242
242
|
messageFeedback?.traceId,
|
|
243
243
|
);
|
|
244
|
+
const traceUrl = mlflowExperimentUrl
|
|
245
|
+
? mlflowTraceUrl(mlflowExperimentUrl, messageFeedback?.traceId)
|
|
246
|
+
: undefined;
|
|
244
247
|
const requestMessage = [...messages.slice(0, index)]
|
|
245
248
|
.reverse()
|
|
246
249
|
.find((candidate) => candidate.role === "user");
|
|
@@ -268,7 +271,7 @@ export const ChatTranscript = ({
|
|
|
268
271
|
: {}),
|
|
269
272
|
}
|
|
270
273
|
: {})}
|
|
271
|
-
{...(
|
|
274
|
+
{...(traceUrl ? { mlflowTraceUrl: traceUrl } : {})}
|
|
272
275
|
/>
|
|
273
276
|
);
|
|
274
277
|
}
|