@mastra/react 1.0.0-beta.25 → 1.0.3-alpha.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/CHANGELOG.md +2773 -3
- package/LICENSE.md +15 -0
- package/dist/agent/extractRunIdFromMessages.d.ts +10 -0
- package/dist/agent/extractRunIdFromMessages.d.ts.map +1 -0
- package/dist/agent/hooks.d.ts +91 -0
- package/dist/agent/hooks.d.ts.map +1 -0
- package/dist/agent/signal-data.d.ts +2 -0
- package/dist/agent/signal-data.d.ts.map +1 -0
- package/dist/{src/agent → agent}/types.d.ts +6 -1
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/index.cjs +3743 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3676 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/mastra-db/accumulator.d.ts +48 -0
- package/dist/lib/mastra-db/accumulator.d.ts.map +1 -0
- package/dist/lib/mastra-db/formatCompletionFeedback.d.ts +19 -0
- package/dist/lib/mastra-db/formatCompletionFeedback.d.ts.map +1 -0
- package/dist/lib/mastra-db/fromCoreUserMessage.d.ts +14 -0
- package/dist/lib/mastra-db/fromCoreUserMessage.d.ts.map +1 -0
- package/dist/lib/mastra-db/index.d.ts +6 -0
- package/dist/lib/mastra-db/index.d.ts.map +1 -0
- package/dist/lib/mastra-db/types.d.ts +171 -0
- package/dist/lib/mastra-db/types.d.ts.map +1 -0
- package/dist/lib/use-mutation.d.ts +28 -0
- package/dist/lib/use-mutation.d.ts.map +1 -0
- package/dist/mastra-client-context.d.ts +26 -0
- package/dist/mastra-client-context.d.ts.map +1 -0
- package/dist/mastra-react-provider.d.ts +5 -0
- package/dist/mastra-react-provider.d.ts.map +1 -0
- package/dist/react.css +184 -322
- package/dist/{src/ui → ui}/Code/Code.d.ts +2 -1
- package/dist/ui/Code/Code.d.ts.map +1 -0
- package/dist/ui/Code/highlight.d.ts +4 -0
- package/dist/ui/Code/highlight.d.ts.map +1 -0
- package/dist/ui/Code/index.d.ts +2 -0
- package/dist/ui/Code/index.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Entity/Entity.d.ts +2 -1
- package/dist/ui/Entity/Entity.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Entity/Entry.d.ts +2 -1
- package/dist/ui/Entity/Entry.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Entity/ToolApproval.d.ts +1 -0
- package/dist/ui/Entity/ToolApproval.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Entity/context.d.ts +4 -3
- package/dist/ui/Entity/context.d.ts.map +1 -0
- package/dist/ui/Entity/index.d.ts +5 -0
- package/dist/ui/Entity/index.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Entity/types.d.ts +1 -0
- package/dist/ui/Entity/types.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Icon/Icon.d.ts +2 -1
- package/dist/ui/Icon/Icon.d.ts.map +1 -0
- package/dist/ui/Icon/index.d.ts +2 -0
- package/dist/ui/Icon/index.d.ts.map +1 -0
- package/dist/{src/ui → ui}/IconButton/IconButton.d.ts +2 -1
- package/dist/ui/IconButton/IconButton.d.ts.map +1 -0
- package/dist/ui/IconButton/index.d.ts +2 -0
- package/dist/ui/IconButton/index.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Icons/AgentIcon.d.ts +2 -1
- package/dist/ui/Icons/AgentIcon.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Icons/ToolsIcon.d.ts +2 -1
- package/dist/ui/Icons/ToolsIcon.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Icons/WorkflowIcon.d.ts +2 -1
- package/dist/ui/Icons/WorkflowIcon.d.ts.map +1 -0
- package/dist/ui/Icons/index.d.ts +4 -0
- package/dist/ui/Icons/index.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Message/Message.d.ts +2 -1
- package/dist/ui/Message/Message.d.ts.map +1 -0
- package/dist/ui/Message/index.d.ts +2 -0
- package/dist/ui/Message/index.d.ts.map +1 -0
- package/dist/ui/MessageFactory/MessageFactory.d.ts +22 -0
- package/dist/ui/MessageFactory/MessageFactory.d.ts.map +1 -0
- package/dist/ui/MessageFactory/index.d.ts +3 -0
- package/dist/ui/MessageFactory/index.d.ts.map +1 -0
- package/dist/ui/MessageFactory/types.d.ts +181 -0
- package/dist/ui/MessageFactory/types.d.ts.map +1 -0
- package/dist/{src/ui → ui}/Tooltip/Tooltip.d.ts +2 -1
- package/dist/ui/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/ui/Tooltip/index.d.ts +2 -0
- package/dist/ui/Tooltip/index.d.ts.map +1 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/voice/index.d.ts +5 -0
- package/dist/voice/index.d.ts.map +1 -0
- package/dist/voice/play-stream-with-web-audio.d.ts +2 -0
- package/dist/voice/play-stream-with-web-audio.d.ts.map +1 -0
- package/dist/voice/record-mic-to-file.d.ts +2 -0
- package/dist/voice/record-mic-to-file.d.ts.map +1 -0
- package/dist/voice/use-speech-recognition.d.ts +20 -0
- package/dist/voice/use-speech-recognition.d.ts.map +1 -0
- package/dist/workflows/WorkflowStepFactory/WorkflowStepFactory.d.ts +8 -0
- package/dist/workflows/WorkflowStepFactory/WorkflowStepFactory.d.ts.map +1 -0
- package/dist/workflows/WorkflowStepFactory/index.d.ts +3 -0
- package/dist/workflows/WorkflowStepFactory/index.d.ts.map +1 -0
- package/dist/workflows/WorkflowStepFactory/types.d.ts +72 -0
- package/dist/workflows/WorkflowStepFactory/types.d.ts.map +1 -0
- package/dist/workflows/hooks.d.ts +34 -0
- package/dist/workflows/hooks.d.ts.map +1 -0
- package/dist/workflows/index.d.ts +4 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/types.d.ts +122 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/use-stream-workflow.d.ts +39 -0
- package/dist/workflows/use-stream-workflow.d.ts.map +1 -0
- package/package.json +35 -31
- package/dist/chunk-55VPMN3N-Ax1F4Y75.js +0 -249
- package/dist/chunk-55VPMN3N-Ax1F4Y75.js.map +0 -1
- package/dist/chunk-55VPMN3N-BHqoDkCq.cjs +0 -251
- package/dist/chunk-55VPMN3N-BHqoDkCq.cjs.map +0 -1
- package/dist/index-BaK_Y6TP.cjs +0 -185
- package/dist/index-BaK_Y6TP.cjs.map +0 -1
- package/dist/index-C1OzXW5i.js +0 -180
- package/dist/index-C1OzXW5i.js.map +0 -1
- package/dist/index-ChvWx-iU.cjs +0 -20711
- package/dist/index-ChvWx-iU.cjs.map +0 -1
- package/dist/index-D3JtF_Zl.js +0 -20628
- package/dist/index-D3JtF_Zl.js.map +0 -1
- package/dist/src/agent/hooks.d.ts +0 -65
- package/dist/src/index.d.ts +0 -6
- package/dist/src/lib/ai-sdk/index.d.ts +0 -4
- package/dist/src/lib/ai-sdk/memory/resolveInitialMessages.d.ts +0 -12
- package/dist/src/lib/ai-sdk/memory/resolveInitialMessages.test.d.ts +0 -1
- package/dist/src/lib/ai-sdk/transformers/AISdkNetworkTransformer.d.ts +0 -10
- package/dist/src/lib/ai-sdk/transformers/AISdkNetworkTransformer.test.d.ts +0 -1
- package/dist/src/lib/ai-sdk/transformers/types.d.ts +0 -10
- package/dist/src/lib/ai-sdk/types.d.ts +0 -106
- package/dist/src/lib/ai-sdk/utils/fromCoreUserMessageToUIMessage.d.ts +0 -10
- package/dist/src/lib/ai-sdk/utils/fromCoreUserMessageToUIMessage.test.d.ts +0 -1
- package/dist/src/lib/ai-sdk/utils/toAssistantUIMessage.d.ts +0 -14
- package/dist/src/lib/ai-sdk/utils/toAssistantUIMessage.test.d.ts +0 -1
- package/dist/src/lib/ai-sdk/utils/toUIMessage.d.ts +0 -17
- package/dist/src/lib/ai-sdk/utils/toUIMessage.test.d.ts +0 -1
- package/dist/src/mastra-client-context.d.ts +0 -10
- package/dist/src/mastra-react-provider.d.ts +0 -4
- package/dist/src/ui/Code/highlight.d.ts +0 -3
- package/dist/src/ui/Code/index.d.ts +0 -1
- package/dist/src/ui/Entity/Entity.stories.d.ts +0 -22
- package/dist/src/ui/Entity/index.d.ts +0 -4
- package/dist/src/ui/Icon/index.d.ts +0 -1
- package/dist/src/ui/IconButton/IconButton.stories.d.ts +0 -12
- package/dist/src/ui/IconButton/index.d.ts +0 -1
- package/dist/src/ui/Icons/index.d.ts +0 -3
- package/dist/src/ui/Message/Message.stories.d.ts +0 -13
- package/dist/src/ui/Message/index.d.ts +0 -1
- package/dist/src/ui/Tooltip/Tooltip.stories.d.ts +0 -12
- package/dist/src/ui/Tooltip/index.d.ts +0 -1
- package/dist/src/ui/index.d.ts +0 -7
- package/dist/token-6GSAFR2W-SPYPLMBM-CWoxKwfk.cjs +0 -64
- package/dist/token-6GSAFR2W-SPYPLMBM-CWoxKwfk.cjs.map +0 -1
- package/dist/token-6GSAFR2W-SPYPLMBM-ChURikIE.js +0 -60
- package/dist/token-6GSAFR2W-SPYPLMBM-ChURikIE.js.map +0 -1
- package/dist/token-util-NEHG7TUY-JRJTGTAB-BU9ZxL1w.cjs +0 -11
- package/dist/token-util-NEHG7TUY-JRJTGTAB-BU9ZxL1w.cjs.map +0 -1
- package/dist/token-util-NEHG7TUY-JRJTGTAB-hEay2AHp.js +0 -7
- package/dist/token-util-NEHG7TUY-JRJTGTAB-hEay2AHp.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BundledLanguage } from 'shiki/bundle/web';
|
|
1
|
+
import type { BundledLanguage } from 'shiki/bundle/web';
|
|
2
2
|
export interface CodeBlockProps {
|
|
3
3
|
code: string;
|
|
4
4
|
language: BundledLanguage;
|
|
@@ -11,3 +11,4 @@ export interface CodeCopyButtonProps {
|
|
|
11
11
|
code: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const CodeCopyButton: ({ code }: CodeCopyButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/ui/Code/Code.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIxD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,0IAC8G,CAAC;AAE1I,eAAO,MAAM,SAAS,GAAI,oCAAoC,cAAc,4CAa3E,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc,GAAI,UAAU,mBAAmB,4CAe3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../src/ui/Code/highlight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,wBAWlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Code/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityVariant } from './types';
|
|
1
|
+
import type { EntityVariant } from './types.js';
|
|
2
2
|
export interface EntityProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
3
|
variant?: EntityVariant;
|
|
4
4
|
initialExpanded?: boolean;
|
|
@@ -11,3 +11,4 @@ export declare const EntityTrigger: ({ className, children, ...props }: React.Co
|
|
|
11
11
|
export declare const EntityContentClass: string;
|
|
12
12
|
export declare const EntityContent: ({ className, ...props }: React.ComponentPropsWithoutRef<"div">) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
13
|
export declare const EntityCaret: ({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=Entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../src/ui/Entity/Entity.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACxE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,GAAI,6DAMpB,WAAW,4CAQb,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAM9B,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAMrE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,mCAAmC,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,4CAoBxG,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAI9B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,yBAAyB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,mDAM3F,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,yBAAyB,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,4CAejF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementType } from 'react';
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
2
|
export declare const EntryClass = "mastra:space-y-2";
|
|
3
3
|
export declare const Entry: ({ className, ...props }: React.ComponentPropsWithoutRef<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
type EntryTitleProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
@@ -7,3 +7,4 @@ type EntryTitleProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
|
7
7
|
export declare const EntryTitleClass = "mastra:font-mono mastra:text-sm mastra:text-text3";
|
|
8
8
|
export declare const EntryTitle: ({ className, as: Root, ...props }: EntryTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
10
|
+
//# sourceMappingURL=Entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Entry.d.ts","sourceRoot":"","sources":["../../../src/ui/Entity/Entry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzC,eAAO,MAAM,UAAU,qBAAqB,CAAC;AAC7C,eAAO,MAAM,KAAK,GAAI,yBAAyB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,4CAEnF,CAAC;AAEF,KAAK,eAAe,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC7D,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,eAAe,sDAAsD,CAAC;AACnF,eAAO,MAAM,UAAU,GAAI,mCAA0C,eAAe,4CAEnF,CAAC"}
|
|
@@ -8,3 +8,4 @@ export declare const ToolApprovalContentClass: string;
|
|
|
8
8
|
export declare const ToolApprovalContent: ({ className, ...props }: React.ComponentPropsWithoutRef<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare const ToolApprovalActionsClass: string;
|
|
10
10
|
export declare const ToolApprovalActions: ({ className, ...props }: React.ComponentPropsWithoutRef<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=ToolApproval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolApproval.d.ts","sourceRoot":"","sources":["../../../src/ui/Entity/ToolApproval.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,QAG7B,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,yBAAyB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,4CAE1F,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAmF,CAAC;AACvH,eAAO,MAAM,iBAAiB,GAAI,yBAAyB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,4CAE/F,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAGnC,CAAC;AACF,eAAO,MAAM,kBAAkB,GAAI,yBAAyB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,4CAEhG,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAA0C,CAAC;AAChF,eAAO,MAAM,mBAAmB,GAAI,yBAAyB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,4CAEjG,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAA0D,CAAC;AAChG,eAAO,MAAM,mBAAmB,GAAI,yBAAyB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,4CAEjG,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { EntityVariant } from './types';
|
|
1
|
+
import type { EntityVariant } from './types.js';
|
|
2
2
|
export type EntityContextType = {
|
|
3
3
|
expanded: boolean;
|
|
4
4
|
setExpanded: (expanded: boolean) => void;
|
|
5
5
|
variant: EntityVariant;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare const EntityContext: import(
|
|
9
|
-
export declare const EntityProvider: import(
|
|
8
|
+
export declare const EntityContext: import("react").Context<EntityContextType>;
|
|
9
|
+
export declare const EntityProvider: import("react").Provider<EntityContextType>;
|
|
10
10
|
export declare const useEntity: () => EntityContextType;
|
|
11
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/ui/Entity/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,aAAa,4CAKxB,CAAC;AAEH,eAAO,MAAM,cAAc,6CAAyB,CAAC;AAErD,eAAO,MAAM,SAAS,yBAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ui/Entity/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface IconProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -9,3 +9,4 @@ export declare const IconSizes: {
|
|
|
9
9
|
lg: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const Icon: ({ children, className, size, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/ui/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACtE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,SAAS;;;;CAIrB,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,yCAAgD,SAAS,4CAM7E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconProps } from '../Icon/Icon';
|
|
1
|
+
import type { IconProps } from '../Icon/Icon.js';
|
|
2
2
|
export interface IconButtonProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
tooltip: React.ReactNode;
|
|
@@ -6,3 +6,4 @@ export interface IconButtonProps extends React.ComponentPropsWithoutRef<'button'
|
|
|
6
6
|
}
|
|
7
7
|
export declare const IconButtonClass = "mastra:text-text3 mastra:hover:text-text6 mastra:active:text-text6 mastra:hover:bg-surface4 mastra:active:bg-surface5 mastra:rounded-md mastra:cursor-pointer";
|
|
8
8
|
export declare const IconButton: ({ children, tooltip, size, className, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/ui/IconButton/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IAC/E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,kKACqI,CAAC;AAElK,eAAO,MAAM,UAAU,GAAI,kDAAyD,eAAe,4CAiBlG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/IconButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentIcon.d.ts","sourceRoot":"","sources":["../../../src/ui/Icons/AgentIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,SAAS,GAAI,yBAAyB,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,4CAqB/E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolsIcon.d.ts","sourceRoot":"","sources":["../../../src/ui/Icons/ToolsIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,SAAS,GAAI,yBAAyB,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,4CAiB/E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowIcon.d.ts","sourceRoot":"","sources":["../../../src/ui/Icons/WorkflowIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,YAAY,GAAI,yBAAyB,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,4CAiBlF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Icons/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
2
|
export interface MessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
position: 'left' | 'right';
|
|
4
4
|
}
|
|
@@ -23,3 +23,4 @@ export declare const MessageListClass = "mastra:overflow-y-auto mastra:h-full ma
|
|
|
23
23
|
export declare const MessageList: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export declare const MessageStreamingClass = "mastra:inline-block mastra:w-[2px] mastra:h-[1em] mastra:bg-text5 mastra:ml-0.5 mastra:align-text-bottom mastra:animate-pulse";
|
|
25
25
|
export declare const MessageStreaming: ({ className, ...props }: HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=Message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/ui/Message/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAClE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,YAAY,oFAAoF,CAAC;AAC9G,eAAO,MAAM,OAAO,GAAI,6CAA6C,YAAY,4CAiBhF,CAAC;AAEF,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,eAAO,MAAM,mBAAmB,2GAC0E,CAAC;AAC3G,eAAO,MAAM,cAAc,GAAI,gDAAgD,mBAAmB,4CAOjG,CAAC;AAEF,eAAO,MAAM,mBAAmB,uIACsG,CAAC;AACvI,eAAO,MAAM,cAAc,GAAI,mCAAmC,cAAc,CAAC,cAAc,CAAC,4CAM/F,CAAC;AAEF,eAAO,MAAM,kBAAkB,iDAAiD,CAAC;AACjF,eAAO,MAAM,aAAa,GAAI,mCAAmC,cAAc,CAAC,cAAc,CAAC,4CAM9F,CAAC;AAEF,eAAO,MAAM,iBAAiB,8IAC+G,CAAC;AAC9I,eAAO,MAAM,YAAY,GAAI,mCAAmC,cAAc,CAAC,gBAAgB,CAAC,4CAM/F,CAAC;AAEF,eAAO,MAAM,sBAAsB,kFAAkF,CAAC;AACtH,eAAO,MAAM,iBAAiB,GAAI,mCAAmC,cAAc,CAAC,eAAe,CAAC,4CAMnG,CAAC;AAEF,eAAO,MAAM,sBAAsB,qCAAqC,CAAC;AACzE,eAAO,MAAM,iBAAiB,GAAI,mCAAmC,cAAc,CAAC,eAAe,CAAC,4CAMnG,CAAC;AAEF,eAAO,MAAM,gBAAgB,qDAAqD,CAAC;AAEnF,eAAO,MAAM,WAAW,GAAI,mCAAmC,cAAc,CAAC,cAAc,CAAC,4CAkB5F,CAAC;AAEF,eAAO,MAAM,qBAAqB,kIAC+F,CAAC;AAElI,eAAO,MAAM,gBAAgB,GAAI,yBAAyB,cAAc,CAAC,eAAe,CAAC,4CAExF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Message/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MastraDBMessage } from '@mastra/core/agent/message-list';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { AccumulatorPart } from '../../lib/mastra-db/index.js';
|
|
4
|
+
import type { DynamicToolPart, MessageRenderers, MessageRoleRenderers, MessageStatusRenderers } from './types.js';
|
|
5
|
+
export interface MessageFactoryProps extends MessageRenderers {
|
|
6
|
+
/** The message whose `content.parts` are rendered. */
|
|
7
|
+
message: MastraDBMessage;
|
|
8
|
+
/** Optional wrappers keyed off `message.role`. */
|
|
9
|
+
roles?: MessageRoleRenderers;
|
|
10
|
+
/** Optional message-level slots dispatched off `message.content.metadata`. */
|
|
11
|
+
status?: MessageStatusRenderers;
|
|
12
|
+
/** Rendered for any part that has no matching renderer. Defaults to `null`. */
|
|
13
|
+
fallback?: (part: AccumulatorPart | DynamicToolPart) => ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Renders a single {@link MastraDBMessage} by dispatching each part in
|
|
17
|
+
* `content.parts` to an optional, type-safe, per-part-type render function.
|
|
18
|
+
* Only the renderer matching a part's `type` is invoked, and each renderer
|
|
19
|
+
* receives fully narrowed props.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MessageFactory: import("react").MemoExoticComponent<({ message, roles, status, fallback, ...renderers }: MessageFactoryProps) => import("react/jsx-runtime").JSX.Element>;
|
|
22
|
+
//# sourceMappingURL=MessageFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageFactory.d.ts","sourceRoot":"","sources":["../../../src/ui/MessageFactory/MessageFactory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAY,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAA2B,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,EAEV,eAAe,EAEf,gBAAgB,EAEhB,oBAAoB,EACpB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,sDAAsD;IACtD,OAAO,EAAE,eAAe,CAAC;IACzB,kDAAkD;IAClD,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,8EAA8E;IAC9E,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,KAAK,SAAS,CAAC;CACnE;AAgOD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,2FA/D0D,mBAAmB,6CA+D7C,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export * from './MessageFactory.js';
|
|
2
|
+
export type { MessageRenderers, MessageRoleRenderers, MessageRoleRendererProps, MessageStatusRenderers, TripwireRendererProps, WarningRendererProps, ErrorRendererProps, PendingRendererProps, TaskRendererProps, DynamicToolPart, MessageFactoryPart, DataPart, PartByType, TextPart, ReasoningPart, FilePart, StepStartPart, ToolInvocationPart, SourceDocumentPart, SourceUrlPart, } from './types.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/MessageFactory/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,GACd,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { MastraDBMessage, AIV5Type } from '@mastra/core/agent/message-list';
|
|
2
|
+
import type { IsTaskCompletePayload } from '@mastra/core/stream';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import type { AccumulatorPart, MastraReasoningPart, MastraTextPart, TripwireMetadata } from '../../lib/mastra-db/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Extract the concrete part shape for a given discriminant from the runtime
|
|
7
|
+
* accumulator union. Deriving from the already-concrete `AccumulatorPart`
|
|
8
|
+
* (rather than the deeply-generic v4/v5 types) keeps these helpers cheap and
|
|
9
|
+
* avoids TS2589 ("type instantiation is excessively deep") at the call sites.
|
|
10
|
+
*/
|
|
11
|
+
export type PartByType<T extends string> = Extract<AccumulatorPart, {
|
|
12
|
+
type: T;
|
|
13
|
+
}>;
|
|
14
|
+
type TextRuntimeExtensions = Partial<Pick<MastraTextPart, 'textId' | 'state' | 'providerMetadata' | 'createdAt'>>;
|
|
15
|
+
type ReasoningRuntimeExtensions = Partial<Pick<MastraReasoningPart, 'reasoningId' | 'state' | 'redacted' | 'providerMetadata' | 'createdAt'>>;
|
|
16
|
+
/** Narrowed part shape passed to the `Text` renderer. */
|
|
17
|
+
export type TextPart = Omit<PartByType<'text'>, keyof TextRuntimeExtensions> & TextRuntimeExtensions;
|
|
18
|
+
/** Narrowed part shape passed to the `Reasoning` renderer. */
|
|
19
|
+
export type ReasoningPart = Omit<PartByType<'reasoning'>, keyof ReasoningRuntimeExtensions> & ReasoningRuntimeExtensions;
|
|
20
|
+
/** Narrowed part shape passed to the `File` renderer. */
|
|
21
|
+
export type FilePart = PartByType<'file'>;
|
|
22
|
+
/** Narrowed part shape passed to the `StepStart` renderer. */
|
|
23
|
+
export type StepStartPart = PartByType<'step-start'>;
|
|
24
|
+
/** Narrowed part shape passed to the `ToolInvocation` renderer. */
|
|
25
|
+
export type ToolInvocationPart = PartByType<'tool-invocation'>;
|
|
26
|
+
/** Narrowed part shape passed to the `SourceDocument` renderer. */
|
|
27
|
+
export type SourceDocumentPart = PartByType<'source-document'>;
|
|
28
|
+
/**
|
|
29
|
+
* Flat `source-url` citation shape passed to the `SourceUrl` renderer. Both the
|
|
30
|
+
* runtime `type: 'source-url'` part and the legacy persisted `type: 'source'`
|
|
31
|
+
* part (normalized) are dispatched with this shape.
|
|
32
|
+
*/
|
|
33
|
+
export type SourceUrlPart = AIV5Type.SourceUrlUIPart;
|
|
34
|
+
/**
|
|
35
|
+
* The `data-${string}` member of the accumulator union (e.g. `data-signal`,
|
|
36
|
+
* `data-om-observation`). Matched at runtime via `type.startsWith('data-')`.
|
|
37
|
+
*/
|
|
38
|
+
export type DataPart = Extract<AccumulatorPart, {
|
|
39
|
+
type: `data-${string}`;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Runtime-only tool part shape. `dynamic-tool` and the AI SDK v5 `tool-${string}`
|
|
43
|
+
* streaming variant are NOT members of the typed `MastraMessagePart` /
|
|
44
|
+
* `AccumulatorPart` union — the accumulator stores them via a boundary cast
|
|
45
|
+
* during network/agent-execution and OM (observational memory) flows
|
|
46
|
+
* (`src/lib/mastra-db/accumulator.ts`). They share the same structural fields
|
|
47
|
+
* and are treated identically by the agent-builder playground, so a single
|
|
48
|
+
* `DynamicTool` renderer covers both. Declared here explicitly because
|
|
49
|
+
* `Extract<AccumulatorPart, { type: 'dynamic-tool' }>` resolves to `never`.
|
|
50
|
+
*/
|
|
51
|
+
export type DynamicToolPart = {
|
|
52
|
+
type: 'dynamic-tool' | `tool-${string}`;
|
|
53
|
+
toolName?: string;
|
|
54
|
+
toolCallId?: string;
|
|
55
|
+
state?: string;
|
|
56
|
+
input?: unknown;
|
|
57
|
+
output?: unknown;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Every part shape `MessageFactory` can dispatch at runtime: the typed
|
|
61
|
+
* accumulator union plus the boundary-cast `dynamic-tool` / `tool-${string}`
|
|
62
|
+
* parts. This is the single source of truth for the factory's internal
|
|
63
|
+
* `RuntimePart` and the precise union consumers (e.g. Storybook) should type
|
|
64
|
+
* part arrays against instead of `unknown[]`.
|
|
65
|
+
*/
|
|
66
|
+
export type MessageFactoryPart = AccumulatorPart | DynamicToolPart;
|
|
67
|
+
/**
|
|
68
|
+
* Optional, per-part-type render functions. Each renderer receives the exact
|
|
69
|
+
* narrowed part shape for its discriminant, so destructuring is fully
|
|
70
|
+
* type-checked and only the renderer matching a part's `type` is ever invoked.
|
|
71
|
+
*/
|
|
72
|
+
export type MessageRenderers = {
|
|
73
|
+
Text?: (part: TextPart) => ReactNode;
|
|
74
|
+
Reasoning?: (part: ReasoningPart) => ReactNode;
|
|
75
|
+
File?: (part: FilePart) => ReactNode;
|
|
76
|
+
StepStart?: (part: StepStartPart) => ReactNode;
|
|
77
|
+
ToolInvocation?: (part: ToolInvocationPart) => ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* Receives the flat `source-url` citation shape ({@link AIV5Type.SourceUrlUIPart}).
|
|
80
|
+
* Both the runtime `type: 'source-url'` part and the legacy persisted
|
|
81
|
+
* `type: 'source'` part (whose nested `source` is normalized to this shape)
|
|
82
|
+
* are dispatched here, so the renderer always gets `sourceId`/`url`/`title`.
|
|
83
|
+
*/
|
|
84
|
+
SourceUrl?: (part: SourceUrlPart) => ReactNode;
|
|
85
|
+
SourceDocument?: (part: SourceDocumentPart) => ReactNode;
|
|
86
|
+
Data?: (part: DataPart) => ReactNode;
|
|
87
|
+
/** Covers runtime-only `dynamic-tool` and AI SDK v5 `tool-${string}` parts. */
|
|
88
|
+
DynamicTool?: (part: DynamicToolPart) => ReactNode;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Props passed to an optional role-level wrapper. `children` is the rendered
|
|
92
|
+
* list of parts; the wrapper decides how to frame them for the message role.
|
|
93
|
+
*/
|
|
94
|
+
export type MessageRoleRendererProps = {
|
|
95
|
+
message: MastraDBMessage;
|
|
96
|
+
children: ReactNode;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Optional wrappers keyed off `message.role`. When omitted, parts render
|
|
100
|
+
* unwrapped (inside a fragment).
|
|
101
|
+
*/
|
|
102
|
+
export type MessageRoleRenderers = {
|
|
103
|
+
User?: (props: MessageRoleRendererProps) => ReactNode;
|
|
104
|
+
Assistant?: (props: MessageRoleRendererProps) => ReactNode;
|
|
105
|
+
System?: (props: MessageRoleRendererProps) => ReactNode;
|
|
106
|
+
Signal?: (props: MessageRoleRendererProps) => ReactNode;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Props passed to the `Tripwire` status slot. Rendered *instead of* the parts
|
|
110
|
+
* walk when `message.content.metadata.status === 'tripwire'`. `text` is the
|
|
111
|
+
* message's joined text body (the reason a notice would display).
|
|
112
|
+
*/
|
|
113
|
+
export type TripwireRendererProps = {
|
|
114
|
+
text: string;
|
|
115
|
+
tripwire?: TripwireMetadata;
|
|
116
|
+
message: MastraDBMessage;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Props passed to the `Warning` status slot. Rendered *instead of* the parts
|
|
120
|
+
* walk when `message.content.metadata.status === 'warning'`.
|
|
121
|
+
*/
|
|
122
|
+
export type WarningRendererProps = {
|
|
123
|
+
text: string;
|
|
124
|
+
message: MastraDBMessage;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Props passed to the `Error` status slot. Rendered *instead of* the parts
|
|
128
|
+
* walk when `message.content.metadata.status === 'error'`.
|
|
129
|
+
*/
|
|
130
|
+
export type ErrorRendererProps = {
|
|
131
|
+
text: string;
|
|
132
|
+
message: MastraDBMessage;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Props passed to the `Task` status slot. Rendered *alongside* (after) the
|
|
136
|
+
* parts walk when a task-completion verdict exists on the message metadata
|
|
137
|
+
* (`completionResult ?? isTaskCompleteResult`).
|
|
138
|
+
*
|
|
139
|
+
* Shaped as the persisted subset of {@link IsTaskCompletePayload}: only
|
|
140
|
+
* `passed` and `suppressFeedback` survive persistence (the accumulator writes
|
|
141
|
+
* `completionResult: { passed }`). The richer payload fields (`iteration`,
|
|
142
|
+
* `results`, `duration`, `reason`, ...) are not available from stored metadata.
|
|
143
|
+
*/
|
|
144
|
+
export type TaskRendererProps = Pick<IsTaskCompletePayload, 'passed'> & Partial<Pick<IsTaskCompletePayload, 'suppressFeedback'>> & {
|
|
145
|
+
text: string;
|
|
146
|
+
message: MastraDBMessage;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Props passed to the `Pending` status slot. Rendered *wrapping* the parts walk
|
|
150
|
+
* when `message.content.metadata.status === 'pending'`, so the optimistic user
|
|
151
|
+
* bubble still renders inline while the consumer applies a "sending" style.
|
|
152
|
+
*/
|
|
153
|
+
export type PendingRendererProps = {
|
|
154
|
+
children: ReactNode;
|
|
155
|
+
text: string;
|
|
156
|
+
message: MastraDBMessage;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Optional message-level slots dispatched off `message.content.metadata`.
|
|
160
|
+
*
|
|
161
|
+
* - `Tripwire` / `Warning` / `Error` are *replacement* slots: when
|
|
162
|
+
* `metadata.status` matches, the slot renders instead of the parts walk.
|
|
163
|
+
* - `Pending` is a *wrapping* slot: when `metadata.status === 'pending'` the
|
|
164
|
+
* slot wraps the parts walk so the optimistic bubble renders with a
|
|
165
|
+
* "sending" style.
|
|
166
|
+
* - `Task` is an *adjacent* slot: when a completion verdict exists it renders
|
|
167
|
+
* alongside the parts.
|
|
168
|
+
*
|
|
169
|
+
* The factory only reads metadata and forwards it; it never filters (e.g. it
|
|
170
|
+
* still invokes `Task` when `suppressFeedback` is true). The consumer decides
|
|
171
|
+
* what to render or skip.
|
|
172
|
+
*/
|
|
173
|
+
export type MessageStatusRenderers = {
|
|
174
|
+
Tripwire?: (props: TripwireRendererProps) => ReactNode;
|
|
175
|
+
Warning?: (props: WarningRendererProps) => ReactNode;
|
|
176
|
+
Error?: (props: ErrorRendererProps) => ReactNode;
|
|
177
|
+
Pending?: (props: PendingRendererProps) => ReactNode;
|
|
178
|
+
Task?: (props: TaskRendererProps) => ReactNode;
|
|
179
|
+
};
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C,CAAC,GAAG;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,SAAS,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAC;IACrD,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAC;IACrD,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC;CAChD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TooltipTriggerProps, TooltipContentProps } from '@radix-ui/react-tooltip';
|
|
1
|
+
import type { TooltipTriggerProps, TooltipContentProps } from '@radix-ui/react-tooltip';
|
|
2
2
|
export interface TooltipProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
}
|
|
@@ -6,3 +6,4 @@ export declare const Tooltip: ({ children }: TooltipProps) => import("react/jsx-
|
|
|
6
6
|
export declare const TooltipContentClass = "mastra:bg-surface4 mastra:text-text6 mastra mastra:rounded-lg mastra:py-1 mastra:px-2 mastra:text-xs mastra:border mastra:border-border1 mastra-tooltip-enter";
|
|
7
7
|
export declare const TooltipContent: ({ children, className, ...props }: TooltipContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare const TooltipTrigger: (props: TooltipTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/ui/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AASxF,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACzE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,OAAO,GAAI,cAAc,YAAY,4CAMjD,CAAC;AAEF,eAAO,MAAM,mBAAmB,kKACiI,CAAC;AAClK,eAAO,MAAM,cAAc,GAAI,mCAAmC,mBAAmB,4CAQpF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,4CAExD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Tooltip/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './Entity/index.js';
|
|
2
|
+
export * from './Code/index.js';
|
|
3
|
+
export * from './Icon/index.js';
|
|
4
|
+
export * from './IconButton/index.js';
|
|
5
|
+
export * from './Icons/index.js';
|
|
6
|
+
export * from './Tooltip/index.js';
|
|
7
|
+
export * from './Message/index.js';
|
|
8
|
+
export * from './MessageFactory/index.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { recordMicrophoneToFile } from './record-mic-to-file.js';
|
|
2
|
+
export { playStreamWithWebAudio } from './play-stream-with-web-audio.js';
|
|
3
|
+
export { useSpeechRecognition } from './use-speech-recognition.js';
|
|
4
|
+
export type { SpeechRecognitionState, UseSpeechRecognitionArgs } from './use-speech-recognition.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/voice/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"play-stream-with-web-audio.d.ts","sourceRoot":"","sources":["../../src/voice/play-stream-with-web-audio.ts"],"names":[],"mappings":"AAAA,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,IAAI,uBA4CxF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-mic-to-file.d.ts","sourceRoot":"","sources":["../../src/voice/record-mic-to-file.ts"],"names":[],"mappings":"AAAA,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,0BAsB1E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MastraClient } from '@mastra/client-js';
|
|
2
|
+
type Agent = ReturnType<MastraClient['getAgent']>;
|
|
3
|
+
type VoiceRequestContext = Parameters<Agent['voice']['getSpeakers']>[0];
|
|
4
|
+
export interface SpeechRecognitionState {
|
|
5
|
+
isListening: boolean;
|
|
6
|
+
transcript: string;
|
|
7
|
+
error: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface UseSpeechRecognitionArgs {
|
|
10
|
+
language?: string;
|
|
11
|
+
agentId?: string;
|
|
12
|
+
requestContext?: VoiceRequestContext;
|
|
13
|
+
}
|
|
14
|
+
type SpeechRecognitionResult = SpeechRecognitionState & {
|
|
15
|
+
start: () => void;
|
|
16
|
+
stop: () => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const useSpeechRecognition: ({ language, agentId, requestContext, }: UseSpeechRecognitionArgs) => SpeechRecognitionResult;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=use-speech-recognition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-speech-recognition.d.ts","sourceRoot":"","sources":["../../src/voice/use-speech-recognition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,KAAK,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;AAClD,KAAK,mBAAmB,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAExE,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAED,KAAK,uBAAuB,GAAG,sBAAsB,GAAG;IACtD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,wCAIlC,wBAAwB,KAAG,uBA4C7B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ResolvedWorkflowStep, WorkflowStepRenderers } from './types.js';
|
|
2
|
+
export interface WorkflowStepFactoryProps<TStep extends ResolvedWorkflowStep = ResolvedWorkflowStep> extends WorkflowStepRenderers<TStep> {
|
|
3
|
+
step: TStep;
|
|
4
|
+
}
|
|
5
|
+
declare const WorkflowStepFactoryComponent: <TStep extends ResolvedWorkflowStep>({ step, Step, MapStep, ForEachStep, ParallelStep, Conditional, LoopStep, SleepStep, SleepUntilStep, NestedWorkflowStep, UnknownStep, }: WorkflowStepFactoryProps<TStep>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const WorkflowStepFactory: typeof WorkflowStepFactoryComponent;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=WorkflowStepFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowStepFactory.d.ts","sourceRoot":"","sources":["../../../src/workflows/WorkflowStepFactory/WorkflowStepFactory.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE3E,MAAM,WAAW,wBAAwB,CACvC,KAAK,SAAS,oBAAoB,GAAG,oBAAoB,CACzD,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACpC,IAAI,EAAE,KAAK,CAAC;CACb;AAOD,QAAA,MAAM,4BAA4B,GAAI,KAAK,SAAS,oBAAoB,EAAE,wIAYvE,wBAAwB,CAAC,KAAK,CAAC,4CAkCjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAyC,OAAO,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workflows/WorkflowStepFactory/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC"}
|