@dbx-tools/ui-mastra 0.9.110 → 0.9.111

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
@@ -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.110";
6
+ export const PACKAGE_VERSION = "0.9.111";
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.110",
33
- "@dbx-tools/shared-genie": "^0.9.110",
34
- "@dbx-tools/shared-mastra": "^0.9.110",
35
- "@dbx-tools/shared-model": "^0.9.110",
36
- "@dbx-tools/ui": "^0.9.110",
32
+ "@dbx-tools/shared-core": "^0.9.111",
33
+ "@dbx-tools/shared-genie": "^0.9.111",
34
+ "@dbx-tools/shared-mastra": "^0.9.111",
35
+ "@dbx-tools/shared-model": "^0.9.111",
36
+ "@dbx-tools/ui": "^0.9.111",
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.110",
53
+ "version": "0.9.111",
54
54
  "dbxToolsConfig": {
55
55
  "tags": [
56
56
  "ui"
@@ -22,6 +22,9 @@ import type { ToolEvent, ToolProgress } from "./types.ts";
22
22
  * `Execute Command` rather than `Mastra Workspace Execute Command`.
23
23
  */
24
24
  const MASTRA_WORKSPACE_TOOL_PREFIX = "mastra_workspace_";
25
+ const TOOL_LABELS: Readonly<Record<string, string>> = {
26
+ execute_typescript: "Run Workflow",
27
+ };
25
28
 
26
29
  /**
27
30
  * Turn a snake/camel tool id into a Title Cased label the user can
@@ -38,6 +41,8 @@ const MASTRA_WORKSPACE_TOOL_PREFIX = "mastra_workspace_";
38
41
  * `myCoolTool` -> `My Cool Tool`
39
42
  */
40
43
  export const humanizeToolName = (toolName: string): string => {
44
+ const explicitLabel = TOOL_LABELS[toolName];
45
+ if (explicitLabel) return explicitLabel;
41
46
  const label = toolName.startsWith(MASTRA_WORKSPACE_TOOL_PREFIX)
42
47
  ? toolName.slice(MASTRA_WORKSPACE_TOOL_PREFIX.length)
43
48
  : toolName;
@@ -590,6 +595,41 @@ const hasExpandableDetails = (event: ToolEvent): boolean => {
590
595
  );
591
596
  };
592
597
 
598
+ const ToolCallDetails = ({
599
+ event,
600
+ showQuestion = false,
601
+ }: {
602
+ event: ToolEvent;
603
+ showQuestion?: boolean;
604
+ }) => {
605
+ const question = askGenieQuestion(event);
606
+ const summary = summarizeProgress(event.progress ?? []);
607
+ const inputPresentation =
608
+ "input" in event ? toolInputPresentation(event.toolName, event.input) : undefined;
609
+ const outputPresentation =
610
+ "output" in event ? toolOutputPresentation(event.toolName, event.output) : undefined;
611
+
612
+ return (
613
+ <div className="flex flex-col gap-2">
614
+ {showQuestion && question ? (
615
+ <p className="break-words px-0.5 text-xs italic text-foreground/80">{question}</p>
616
+ ) : null}
617
+ {inputPresentation ? (
618
+ <ToolInputSource presentation={inputPresentation} />
619
+ ) : "input" in event ? (
620
+ <RawToolPayload label="Request" value={event.input} />
621
+ ) : null}
622
+ <WebSearchProgressDetails event={event} />
623
+ <ToolProgressDetails summary={summary} omitQuestion />
624
+ {outputPresentation ? (
625
+ <ToolInputSource presentation={outputPresentation} />
626
+ ) : "output" in event ? (
627
+ <RawToolPayload label="Response" value={event.output} />
628
+ ) : null}
629
+ </div>
630
+ );
631
+ };
632
+
593
633
  /**
594
634
  * One row inside {@link ToolSessionPill}. Always-visible header
595
635
  * shows the status icon, the tool's verb (`Called Ask Genie`,
@@ -608,12 +648,7 @@ const ToolCallRow = ({ event }: { event: ToolEvent }) => {
608
648
  const isRunning = event.status === "running";
609
649
  const isError = event.status === "error";
610
650
  const question = askGenieQuestion(event);
611
- const summary = summarizeProgress(event.progress ?? []);
612
651
  const expandable = hasExpandableDetails(event);
613
- const inputPresentation =
614
- "input" in event ? toolInputPresentation(event.toolName, event.input) : undefined;
615
- const outputPresentation =
616
- "output" in event ? toolOutputPresentation(event.toolName, event.output) : undefined;
617
652
  // Inner rows defer to the live wire status when running (e.g.
618
653
  // "Executing query") so users tracking the open pill see the
619
654
  // backend's freshest state - not just the static
@@ -659,19 +694,8 @@ const ToolCallRow = ({ event }: { event: ToolEvent }) => {
659
694
  {header}
660
695
  </CollapsibleTrigger>
661
696
  <CollapsibleContent>
662
- <div className="flex flex-col gap-2 px-2 pb-2">
663
- {inputPresentation ? (
664
- <ToolInputSource presentation={inputPresentation} />
665
- ) : "input" in event ? (
666
- <RawToolPayload label="Request" value={event.input} />
667
- ) : null}
668
- <WebSearchProgressDetails event={event} />
669
- <ToolProgressDetails summary={summary} omitQuestion />
670
- {outputPresentation ? (
671
- <ToolInputSource presentation={outputPresentation} />
672
- ) : "output" in event ? (
673
- <RawToolPayload label="Response" value={event.output} />
674
- ) : null}
697
+ <div className="px-2 pb-2">
698
+ <ToolCallDetails event={event} />
675
699
  </div>
676
700
  </CollapsibleContent>
677
701
  </Collapsible>
@@ -762,10 +786,12 @@ export const ToolSessionPill = ({ events }: { events: ToolEvent[] }) => {
762
786
  )}
763
787
  </CollapsibleTrigger>
764
788
  <CollapsibleContent>
765
- <div className="mt-1.5 flex flex-col gap-1">
766
- {events.map((event) => (
767
- <ToolCallRow key={event.id} event={event} />
768
- ))}
789
+ <div className={cn("mt-1.5", events.length > 1 && "flex flex-col gap-1")}>
790
+ {events.length === 1 ? (
791
+ <ToolCallDetails event={latest} showQuestion />
792
+ ) : (
793
+ events.map((event) => <ToolCallRow key={event.id} event={event} />)
794
+ )}
769
795
  </div>
770
796
  </CollapsibleContent>
771
797
  </Collapsible>