@mastra/playground-ui 5.1.2-alpha.1 → 5.1.2-alpha.2
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/dist/index.cjs.js +61 -57
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +62 -60
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/ui/button.d.ts +1 -1
- package/dist/src/components/ui/command.d.ts +2 -2
- package/dist/src/components/ui/resizable.d.ts +1 -1
- package/dist/src/contexts/mastra-client-context.d.ts +9 -0
- package/dist/src/domains/agents/agent/agent-chat.d.ts +1 -1
- package/dist/src/domains/agents/agent/agent-evals.d.ts +1 -2
- package/dist/src/domains/workflows/workflow/legacy-workflow-graph.d.ts +1 -2
- package/dist/src/domains/workflows/workflow/legacy-workflow-trigger.d.ts +1 -2
- package/dist/src/domains/workflows/workflow/workflow-graph.d.ts +1 -2
- package/dist/src/domains/workflows/workflow/workflow-trigger.d.ts +1 -2
- package/dist/src/hooks/use-evals.d.ts +1 -1
- package/dist/src/hooks/use-traces.d.ts +1 -1
- package/dist/src/hooks/use-workflows.d.ts +5 -5
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lib/mastra-client.d.ts +1 -1
- package/dist/src/services/mastra-runtime-provider.d.ts +1 -1
- package/dist/src/services/network-runtime-provider.d.ts +1 -1
- package/dist/src/types.d.ts +0 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { createContext, useContext, forwardRef, useState, useEffect, memo, useMemo, useRef, useCallback, Suspense, Fragment as Fragment$1 } from 'react';
|
|
4
|
+
import { MastraClient } from '@mastra/client-js';
|
|
2
5
|
import { useMessage, MessagePrimitive, ActionBarPrimitive, useComposerRuntime, ComposerPrimitive, useAttachment, AttachmentPrimitive, ThreadPrimitive, useExternalStoreRuntime, CompositeAttachmentAdapter, SimpleImageAttachmentAdapter, AssistantRuntimeProvider } from '@assistant-ui/react';
|
|
3
6
|
import { CheckIcon as CheckIcon$1, CopyIcon, ChevronUpIcon, X, FileIcon, CircleXIcon, Mic, PlusIcon, ArrowUp, Copy, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, Check, ChevronUp, ChevronDown, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Network, PauseIcon, Loader2, CircleDashed, Footprints, CircleCheck, CircleX, Workflow, AlertCircleIcon, AlertCircle, CalendarIcon, Braces, Brackets, TrashIcon, Plus, Minus, Maximize, CirclePause } from 'lucide-react';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import React__default, { forwardRef, useState, useEffect, memo, useMemo, useRef, createContext, useContext, useCallback, Suspense, Fragment as Fragment$1 } from 'react';
|
|
6
7
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
8
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
8
9
|
import { TooltipProvider as TooltipProvider$1 } from '@radix-ui/react-tooltip';
|
|
@@ -19,7 +20,6 @@ import CodeMirror from '@uiw/react-codemirror';
|
|
|
19
20
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
20
21
|
import { useShallow } from 'zustand/shallow';
|
|
21
22
|
import { RuntimeContext } from '@mastra/core/di';
|
|
22
|
-
import { MastraClient } from '@mastra/client-js';
|
|
23
23
|
import { create } from 'zustand';
|
|
24
24
|
import { persist } from 'zustand/middleware';
|
|
25
25
|
import { format, formatDistanceToNow, isValid } from 'date-fns';
|
|
@@ -52,7 +52,32 @@ import { CodeBlock as CodeBlock$1 } from 'react-code-block';
|
|
|
52
52
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
53
53
|
import { useReactTable, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
54
54
|
|
|
55
|
-
import './index.css';
|
|
55
|
+
import './index.css';const createMastraClient = (baseUrl, mastraClientHeaders = {}) => {
|
|
56
|
+
return new MastraClient({
|
|
57
|
+
baseUrl: baseUrl || "",
|
|
58
|
+
// only add the header if the baseUrl is not provided i.e it's a local dev environment
|
|
59
|
+
headers: !baseUrl ? { ...mastraClientHeaders, "x-mastra-dev-playground": "true" } : mastraClientHeaders
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const MastraClientContext = createContext(void 0);
|
|
64
|
+
const MastraClientProvider = ({
|
|
65
|
+
children,
|
|
66
|
+
baseUrl,
|
|
67
|
+
headers
|
|
68
|
+
}) => {
|
|
69
|
+
const client = createMastraClient(baseUrl, headers);
|
|
70
|
+
return /* @__PURE__ */ jsx(MastraClientContext.Provider, { value: { client }, children });
|
|
71
|
+
};
|
|
72
|
+
const useMastraClient = () => {
|
|
73
|
+
const context = useContext(MastraClientContext);
|
|
74
|
+
if (context === void 0) {
|
|
75
|
+
throw new Error("useMastraClient must be used within a MastraClientProvider");
|
|
76
|
+
}
|
|
77
|
+
return context.client;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
56
81
|
|
|
57
82
|
const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
58
83
|
const cx = clsx;
|
|
@@ -4453,14 +4478,6 @@ const CircleStopIcon = () => {
|
|
|
4453
4478
|
return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", width: "16", height: "16", children: /* @__PURE__ */ jsx("rect", { width: "10", height: "10", x: "3", y: "3", rx: "2" }) });
|
|
4454
4479
|
};
|
|
4455
4480
|
|
|
4456
|
-
const createMastraClient = (baseUrl) => {
|
|
4457
|
-
return new MastraClient({
|
|
4458
|
-
baseUrl: baseUrl || "",
|
|
4459
|
-
// only add the header if the baseUrl is not provided i.e it's a local dev environment
|
|
4460
|
-
headers: !baseUrl ? { "x-mastra-dev-playground": "true" } : {}
|
|
4461
|
-
});
|
|
4462
|
-
};
|
|
4463
|
-
|
|
4464
4481
|
const fileToBase64 = async (file) => {
|
|
4465
4482
|
return new Promise((resolve, reject) => {
|
|
4466
4483
|
const reader = new FileReader();
|
|
@@ -4502,7 +4519,6 @@ function MastraRuntimeProvider({
|
|
|
4502
4519
|
agentName,
|
|
4503
4520
|
memory,
|
|
4504
4521
|
threadId,
|
|
4505
|
-
baseUrl,
|
|
4506
4522
|
refreshThreadList,
|
|
4507
4523
|
modelSettings = {},
|
|
4508
4524
|
chatWithGenerate,
|
|
@@ -4543,7 +4559,7 @@ function MastraRuntimeProvider({
|
|
|
4543
4559
|
}
|
|
4544
4560
|
}
|
|
4545
4561
|
}, [initialMessages, threadId, memory]);
|
|
4546
|
-
const mastra =
|
|
4562
|
+
const mastra = useMastraClient();
|
|
4547
4563
|
const agent = mastra.getAgent(agentId);
|
|
4548
4564
|
const onNew = async (message) => {
|
|
4549
4565
|
if (message.content[0]?.type !== "text") throw new Error("Only text messages are supported");
|
|
@@ -4901,7 +4917,6 @@ const AgentChat = ({
|
|
|
4901
4917
|
threadId,
|
|
4902
4918
|
initialMessages,
|
|
4903
4919
|
memory,
|
|
4904
|
-
baseUrl,
|
|
4905
4920
|
refreshThreadList,
|
|
4906
4921
|
showFileSupport
|
|
4907
4922
|
}) => {
|
|
@@ -4915,7 +4930,6 @@ const AgentChat = ({
|
|
|
4915
4930
|
threadId,
|
|
4916
4931
|
initialMessages,
|
|
4917
4932
|
memory,
|
|
4918
|
-
baseUrl,
|
|
4919
4933
|
refreshThreadList,
|
|
4920
4934
|
modelSettings,
|
|
4921
4935
|
chatWithGenerate,
|
|
@@ -5095,10 +5109,10 @@ const TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5095
5109
|
));
|
|
5096
5110
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
5097
5111
|
|
|
5098
|
-
const useEvalsByAgentId = (agentId, type
|
|
5112
|
+
const useEvalsByAgentId = (agentId, type) => {
|
|
5099
5113
|
const [evals, setEvals] = useState([]);
|
|
5100
5114
|
const [isLoading, setIsLoading] = useState(true);
|
|
5101
|
-
const client =
|
|
5115
|
+
const client = useMastraClient();
|
|
5102
5116
|
const fetchEvals = async (_agentId) => {
|
|
5103
5117
|
setIsLoading(true);
|
|
5104
5118
|
const activeAgentId = _agentId ?? agentId;
|
|
@@ -5136,18 +5150,14 @@ const tabIndicatorClass = cn(
|
|
|
5136
5150
|
"focus-visible:outline-none"
|
|
5137
5151
|
);
|
|
5138
5152
|
const tabContentClass = cn("data-[state=inactive]:mt-0 min-h-0 h-full grid grid-rows-[1fr]");
|
|
5139
|
-
function AgentEvals({ agentId
|
|
5153
|
+
function AgentEvals({ agentId }) {
|
|
5140
5154
|
const [activeTab, setActiveTab] = useState("live");
|
|
5141
5155
|
const {
|
|
5142
5156
|
evals: liveEvals,
|
|
5143
5157
|
isLoading: isLiveLoading,
|
|
5144
5158
|
refetchEvals: refetchLiveEvals
|
|
5145
|
-
} = useEvalsByAgentId(agentId, "live"
|
|
5146
|
-
const {
|
|
5147
|
-
evals: ciEvals,
|
|
5148
|
-
isLoading: isCiLoading,
|
|
5149
|
-
refetchEvals: refetchCiEvals
|
|
5150
|
-
} = useEvalsByAgentId(agentId, "ci", baseUrl);
|
|
5159
|
+
} = useEvalsByAgentId(agentId, "live");
|
|
5160
|
+
const { evals: ciEvals, isLoading: isCiLoading, refetchEvals: refetchCiEvals } = useEvalsByAgentId(agentId, "ci");
|
|
5151
5161
|
const contextValue = {
|
|
5152
5162
|
handleRefresh,
|
|
5153
5163
|
isLoading: activeTab === "live" ? isLiveLoading : isCiLoading
|
|
@@ -6198,7 +6208,6 @@ function MastraNetworkRuntimeProvider({
|
|
|
6198
6208
|
initialMessages,
|
|
6199
6209
|
memory,
|
|
6200
6210
|
threadId,
|
|
6201
|
-
baseUrl,
|
|
6202
6211
|
refreshThreadList,
|
|
6203
6212
|
modelSettings = {}
|
|
6204
6213
|
}) {
|
|
@@ -6214,7 +6223,7 @@ function MastraNetworkRuntimeProvider({
|
|
|
6214
6223
|
}
|
|
6215
6224
|
}
|
|
6216
6225
|
}, [initialMessages, threadId, memory, messages]);
|
|
6217
|
-
const mastra =
|
|
6226
|
+
const mastra = useMastraClient();
|
|
6218
6227
|
const network = mastra.getNetwork(agentId);
|
|
6219
6228
|
const onNew = async (message) => {
|
|
6220
6229
|
if (message.content[0]?.type !== "text") throw new Error("Only text messages are supported");
|
|
@@ -6696,10 +6705,10 @@ const sanitizeWorkflowWatchResult = (record) => {
|
|
|
6696
6705
|
};
|
|
6697
6706
|
return sanitizedRecord;
|
|
6698
6707
|
};
|
|
6699
|
-
const useLegacyWorkflow = (workflowId
|
|
6708
|
+
const useLegacyWorkflow = (workflowId) => {
|
|
6700
6709
|
const [legacyWorkflow, setLegacyWorkflow] = useState(null);
|
|
6701
6710
|
const [isLoading, setIsLoading] = useState(true);
|
|
6702
|
-
const client =
|
|
6711
|
+
const client = useMastraClient();
|
|
6703
6712
|
useEffect(() => {
|
|
6704
6713
|
const fetchWorkflow = async () => {
|
|
6705
6714
|
setIsLoading(true);
|
|
@@ -6741,10 +6750,10 @@ const useLegacyWorkflow = (workflowId, baseUrl) => {
|
|
|
6741
6750
|
}, [workflowId]);
|
|
6742
6751
|
return { legacyWorkflow, isLoading };
|
|
6743
6752
|
};
|
|
6744
|
-
const useWorkflow = (workflowId
|
|
6753
|
+
const useWorkflow = (workflowId) => {
|
|
6745
6754
|
const [workflow, setWorkflow] = useState(null);
|
|
6746
6755
|
const [isLoading, setIsLoading] = useState(true);
|
|
6747
|
-
const client =
|
|
6756
|
+
const client = useMastraClient();
|
|
6748
6757
|
useEffect(() => {
|
|
6749
6758
|
const fetchWorkflow = async () => {
|
|
6750
6759
|
setIsLoading(true);
|
|
@@ -6768,8 +6777,8 @@ const useWorkflow = (workflowId, baseUrl) => {
|
|
|
6768
6777
|
}, [workflowId]);
|
|
6769
6778
|
return { workflow, isLoading };
|
|
6770
6779
|
};
|
|
6771
|
-
const useExecuteWorkflow = (
|
|
6772
|
-
const client =
|
|
6780
|
+
const useExecuteWorkflow = () => {
|
|
6781
|
+
const client = useMastraClient();
|
|
6773
6782
|
const createLegacyWorkflowRun = async ({ workflowId, prevRunId }) => {
|
|
6774
6783
|
try {
|
|
6775
6784
|
const workflow = client.getLegacyWorkflow(workflowId);
|
|
@@ -6848,11 +6857,12 @@ const useExecuteWorkflow = (baseUrl) => {
|
|
|
6848
6857
|
startAsyncWorkflowRun
|
|
6849
6858
|
};
|
|
6850
6859
|
};
|
|
6851
|
-
const useWatchWorkflow = (
|
|
6860
|
+
const useWatchWorkflow = () => {
|
|
6852
6861
|
const [isWatchingLegacyWorkflow, setIsWatchingLegacyWorkflow] = useState(false);
|
|
6853
6862
|
const [isWatchingWorkflow, setIsWatchingWorkflow] = useState(false);
|
|
6854
6863
|
const [legacyWatchResult, setLegacyWatchResult] = useState(null);
|
|
6855
6864
|
const [watchResult, setWatchResult] = useState(null);
|
|
6865
|
+
const client = useMastraClient();
|
|
6856
6866
|
const debouncedSetLegacyWorkflowWatchResult = useDebouncedCallback((record) => {
|
|
6857
6867
|
const formattedResults = Object.entries(record.results || {}).reduce(
|
|
6858
6868
|
(acc, [key, value]) => {
|
|
@@ -6881,7 +6891,6 @@ const useWatchWorkflow = (baseUrl) => {
|
|
|
6881
6891
|
const watchLegacyWorkflow = async ({ workflowId, runId }) => {
|
|
6882
6892
|
try {
|
|
6883
6893
|
setIsWatchingLegacyWorkflow(true);
|
|
6884
|
-
const client = createMastraClient(baseUrl);
|
|
6885
6894
|
const workflow = client.getLegacyWorkflow(workflowId);
|
|
6886
6895
|
await workflow.watch({ runId }, (record) => {
|
|
6887
6896
|
try {
|
|
@@ -6907,7 +6916,6 @@ const useWatchWorkflow = (baseUrl) => {
|
|
|
6907
6916
|
const watchWorkflow = async ({ workflowId, runId }) => {
|
|
6908
6917
|
try {
|
|
6909
6918
|
setIsWatchingWorkflow(true);
|
|
6910
|
-
const client = createMastraClient(baseUrl);
|
|
6911
6919
|
const workflow = client.getWorkflow(workflowId);
|
|
6912
6920
|
await workflow.watch({ runId }, (record) => {
|
|
6913
6921
|
try {
|
|
@@ -6935,9 +6943,10 @@ const useWatchWorkflow = (baseUrl) => {
|
|
|
6935
6943
|
watchResult
|
|
6936
6944
|
};
|
|
6937
6945
|
};
|
|
6938
|
-
const useResumeWorkflow = (
|
|
6946
|
+
const useResumeWorkflow = () => {
|
|
6939
6947
|
const [isResumingLegacyWorkflow, setIsResumingLegacyWorkflow] = useState(false);
|
|
6940
6948
|
const [isResumingWorkflow, setIsResumingWorkflow] = useState(false);
|
|
6949
|
+
const client = useMastraClient();
|
|
6941
6950
|
const resumeLegacyWorkflow = async ({
|
|
6942
6951
|
workflowId,
|
|
6943
6952
|
stepId,
|
|
@@ -6946,7 +6955,6 @@ const useResumeWorkflow = (baseUrl) => {
|
|
|
6946
6955
|
}) => {
|
|
6947
6956
|
try {
|
|
6948
6957
|
setIsResumingLegacyWorkflow(true);
|
|
6949
|
-
const client = createMastraClient(baseUrl);
|
|
6950
6958
|
const response = await client.getLegacyWorkflow(workflowId).resume({ stepId, runId, context });
|
|
6951
6959
|
return response;
|
|
6952
6960
|
} catch (error) {
|
|
@@ -6965,7 +6973,6 @@ const useResumeWorkflow = (baseUrl) => {
|
|
|
6965
6973
|
}) => {
|
|
6966
6974
|
try {
|
|
6967
6975
|
setIsResumingWorkflow(true);
|
|
6968
|
-
const client = createMastraClient(baseUrl);
|
|
6969
6976
|
const runtimeContext = new RuntimeContext$1();
|
|
6970
6977
|
Object.entries(playgroundRuntimeContext).forEach(([key, value]) => {
|
|
6971
6978
|
runtimeContext.set(key, value);
|
|
@@ -8248,8 +8255,8 @@ const lodashTitleCase = (str) => {
|
|
|
8248
8255
|
return camelCased.replace(/([A-Z])/g, " $1").replace(/^./, (str2) => str2.toUpperCase()).trim();
|
|
8249
8256
|
};
|
|
8250
8257
|
|
|
8251
|
-
function LegacyWorkflowGraph({ workflowId
|
|
8252
|
-
const { legacyWorkflow, isLoading } = useLegacyWorkflow(workflowId
|
|
8258
|
+
function LegacyWorkflowGraph({ workflowId }) {
|
|
8259
|
+
const { legacyWorkflow, isLoading } = useLegacyWorkflow(workflowId);
|
|
8253
8260
|
if (isLoading) {
|
|
8254
8261
|
return /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-[600px]" }) });
|
|
8255
8262
|
}
|
|
@@ -9121,18 +9128,17 @@ const WorkflowResult = ({ jsonResult, sanitizedJsonResult }) => {
|
|
|
9121
9128
|
|
|
9122
9129
|
function LegacyWorkflowTrigger({
|
|
9123
9130
|
workflowId,
|
|
9124
|
-
baseUrl,
|
|
9125
9131
|
setRunId
|
|
9126
9132
|
}) {
|
|
9127
9133
|
const { legacyResult: result, setLegacyResult: setResult, payload, setPayload } = useContext(WorkflowRunContext);
|
|
9128
|
-
const { isLoading, legacyWorkflow: workflow } = useLegacyWorkflow(workflowId
|
|
9129
|
-
const { createLegacyWorkflowRun: createWorkflowRun, startLegacyWorkflowRun: startWorkflowRun } = useExecuteWorkflow(
|
|
9134
|
+
const { isLoading, legacyWorkflow: workflow } = useLegacyWorkflow(workflowId);
|
|
9135
|
+
const { createLegacyWorkflowRun: createWorkflowRun, startLegacyWorkflowRun: startWorkflowRun } = useExecuteWorkflow();
|
|
9130
9136
|
const {
|
|
9131
9137
|
watchLegacyWorkflow: watchWorkflow,
|
|
9132
9138
|
legacyWatchResult: watchResult,
|
|
9133
9139
|
isWatchingLegacyWorkflow: isWatchingWorkflow
|
|
9134
|
-
} = useWatchWorkflow(
|
|
9135
|
-
const { resumeLegacyWorkflow: resumeWorkflow, isResumingLegacyWorkflow: isResumingWorkflow } = useResumeWorkflow(
|
|
9140
|
+
} = useWatchWorkflow();
|
|
9141
|
+
const { resumeLegacyWorkflow: resumeWorkflow, isResumingLegacyWorkflow: isResumingWorkflow } = useResumeWorkflow();
|
|
9136
9142
|
const [suspendedSteps, setSuspendedSteps] = useState([]);
|
|
9137
9143
|
const [isRunning, setIsRunning] = useState(false);
|
|
9138
9144
|
const triggerSchema = workflow?.triggerSchema;
|
|
@@ -9557,8 +9563,8 @@ function WorkflowGraphInner({ workflow, onShowTrace }) {
|
|
|
9557
9563
|
) });
|
|
9558
9564
|
}
|
|
9559
9565
|
|
|
9560
|
-
function WorkflowGraph({ workflowId,
|
|
9561
|
-
const { workflow, isLoading } = useWorkflow(workflowId
|
|
9566
|
+
function WorkflowGraph({ workflowId, onShowTrace }) {
|
|
9567
|
+
const { workflow, isLoading } = useWorkflow(workflowId);
|
|
9562
9568
|
if (isLoading) {
|
|
9563
9569
|
return /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-[600px]" }) });
|
|
9564
9570
|
}
|
|
@@ -9592,17 +9598,13 @@ const WorkflowStatus = ({ stepId, status }) => {
|
|
|
9592
9598
|
);
|
|
9593
9599
|
};
|
|
9594
9600
|
|
|
9595
|
-
function WorkflowTrigger({
|
|
9596
|
-
workflowId,
|
|
9597
|
-
baseUrl,
|
|
9598
|
-
setRunId
|
|
9599
|
-
}) {
|
|
9601
|
+
function WorkflowTrigger({ workflowId, setRunId }) {
|
|
9600
9602
|
const { runtimeContext } = usePlaygroundStore();
|
|
9601
9603
|
const { result, setResult, payload, setPayload } = useContext(WorkflowRunContext);
|
|
9602
|
-
const { isLoading, workflow } = useWorkflow(workflowId
|
|
9603
|
-
const { createWorkflowRun, startWorkflowRun } = useExecuteWorkflow(
|
|
9604
|
-
const { watchWorkflow, watchResult, isWatchingWorkflow } = useWatchWorkflow(
|
|
9605
|
-
const { resumeWorkflow, isResumingWorkflow } = useResumeWorkflow(
|
|
9604
|
+
const { isLoading, workflow } = useWorkflow(workflowId);
|
|
9605
|
+
const { createWorkflowRun, startWorkflowRun } = useExecuteWorkflow();
|
|
9606
|
+
const { watchWorkflow, watchResult, isWatchingWorkflow } = useWatchWorkflow();
|
|
9607
|
+
const { resumeWorkflow, isResumingWorkflow } = useResumeWorkflow();
|
|
9606
9608
|
const [suspendedSteps, setSuspendedSteps] = useState([]);
|
|
9607
9609
|
const [isRunning, setIsRunning] = useState(false);
|
|
9608
9610
|
const triggerSchema = workflow?.inputSchema;
|
|
@@ -10092,9 +10094,9 @@ function usePolling({
|
|
|
10092
10094
|
};
|
|
10093
10095
|
}
|
|
10094
10096
|
|
|
10095
|
-
const useTraces = (componentName,
|
|
10097
|
+
const useTraces = (componentName, isWorkflow = false) => {
|
|
10096
10098
|
const [traces, setTraces] = useState([]);
|
|
10097
|
-
const client = useMemo(() =>
|
|
10099
|
+
const client = useMemo(() => useMastraClient(), []);
|
|
10098
10100
|
const fetchFn = useCallback(async () => {
|
|
10099
10101
|
try {
|
|
10100
10102
|
const res = await client.getTelemetry({
|
|
@@ -10134,5 +10136,5 @@ const useTraces = (componentName, baseUrl, isWorkflow = false) => {
|
|
|
10134
10136
|
return { traces, firstCallLoading, error };
|
|
10135
10137
|
};
|
|
10136
10138
|
|
|
10137
|
-
export { AgentChat, AgentCoinIcon, AgentContext, AgentEvals, AgentIcon, AgentNetworkCoinIcon, AgentProvider, AgentTraces, AiIcon, ApiIcon, Badge$1 as Badge, BranchIcon, Breadcrumb, Button, Cell, CheckIcon, ChevronIcon, CommitIcon, CrossIcon, Crumb, DarkLogo, DataTable, DateTimeCell, DbIcon, DebugIcon, DeploymentIcon, DividerIcon, DocsIcon, DynamicForm, EmptyState, Entity, EntityContent, EntityDescription, EntityIcon, EntityName, EntryCell, EnvIcon, EvaluatorCoinIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, JudgeIcon, LatencyIcon, LegacyWorkflowGraph, LegacyWorkflowTrigger, LogsIcon, MastraResizablePanel, McpCoinIcon, McpServerIcon, MemoryIcon, NetworkChat, NetworkContext, NetworkProvider, OpenAIIcon, PromptIcon, RepoIcon, Row, ScoreIcon, SettingsIcon, SlashIcon, Table, Tbody, Th, Thead, ThreadDeleteButton, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolsIcon, TraceIcon, TsIcon, Txt, TxtCell, UnitCell, VariablesIcon, WorkflowCoinIcon, WorkflowGraph, WorkflowIcon, WorkflowRunContext, WorkflowRunProvider, WorkflowTraces, WorkflowTrigger, refineTraces, useCurrentRun, usePlaygroundStore, usePolling, useSpeechRecognition, useTraces };
|
|
10139
|
+
export { AgentChat, AgentCoinIcon, AgentContext, AgentEvals, AgentIcon, AgentNetworkCoinIcon, AgentProvider, AgentTraces, AiIcon, ApiIcon, Badge$1 as Badge, BranchIcon, Breadcrumb, Button, Cell, CheckIcon, ChevronIcon, CommitIcon, CrossIcon, Crumb, DarkLogo, DataTable, DateTimeCell, DbIcon, DebugIcon, DeploymentIcon, DividerIcon, DocsIcon, DynamicForm, EmptyState, Entity, EntityContent, EntityDescription, EntityIcon, EntityName, EntryCell, EnvIcon, EvaluatorCoinIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, JudgeIcon, LatencyIcon, LegacyWorkflowGraph, LegacyWorkflowTrigger, LogsIcon, MastraClientProvider, MastraResizablePanel, McpCoinIcon, McpServerIcon, MemoryIcon, NetworkChat, NetworkContext, NetworkProvider, OpenAIIcon, PromptIcon, RepoIcon, Row, ScoreIcon, SettingsIcon, SlashIcon, Table, Tbody, Th, Thead, ThreadDeleteButton, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolsIcon, TraceIcon, TsIcon, Txt, TxtCell, UnitCell, VariablesIcon, WorkflowCoinIcon, WorkflowGraph, WorkflowIcon, WorkflowRunContext, WorkflowRunProvider, WorkflowTraces, WorkflowTrigger, refineTraces, useCurrentRun, useMastraClient, usePlaygroundStore, usePolling, useSpeechRecognition, useTraces };
|
|
10138
10140
|
//# sourceMappingURL=index.es.js.map
|