@mastra/playground-ui 5.0.1-alpha.2 → 5.0.1-alpha.3
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/domains/agents/agent/agent-traces.d.ts +2 -1
- package/dist/domains/networks/index.d.ts +1 -0
- package/dist/domains/networks/network-context.d.ts +13 -0
- package/dist/index.cjs.js +53 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +52 -17
- package/dist/index.es.js.map +1 -1
- package/dist/services/network-runtime-provider.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -4285,7 +4285,7 @@ function MastraRuntimeProvider({
|
|
|
4285
4285
|
] });
|
|
4286
4286
|
}
|
|
4287
4287
|
|
|
4288
|
-
const defaultModelSettings = {
|
|
4288
|
+
const defaultModelSettings$1 = {
|
|
4289
4289
|
maxRetries: 2,
|
|
4290
4290
|
maxSteps: 5,
|
|
4291
4291
|
temperature: 0.5,
|
|
@@ -4293,10 +4293,10 @@ const defaultModelSettings = {
|
|
|
4293
4293
|
};
|
|
4294
4294
|
const AgentContext = createContext({});
|
|
4295
4295
|
function AgentProvider({ children }) {
|
|
4296
|
-
const [modelSettings, setModelSettings] = useState(defaultModelSettings);
|
|
4296
|
+
const [modelSettings, setModelSettings] = useState(defaultModelSettings$1);
|
|
4297
4297
|
const [chatWithGenerate, setChatWithGenerate] = useState(false);
|
|
4298
4298
|
const resetModelSettings = () => {
|
|
4299
|
-
setModelSettings(defaultModelSettings);
|
|
4299
|
+
setModelSettings(defaultModelSettings$1);
|
|
4300
4300
|
};
|
|
4301
4301
|
return /* @__PURE__ */ jsx(
|
|
4302
4302
|
AgentContext.Provider,
|
|
@@ -5329,7 +5329,7 @@ const variantClasses = {
|
|
|
5329
5329
|
};
|
|
5330
5330
|
const Time = ({ durationMs, tokenCount, variant, progressPercent }) => {
|
|
5331
5331
|
const variantClass = variant ? variantClasses[variant] : "bg-accent3";
|
|
5332
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
5332
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-[166px] shrink-0", children: [
|
|
5333
5333
|
/* @__PURE__ */ jsx("div", { className: "bg-surface4 relative h-[6px] w-full rounded-full p-px overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: clsx("absolute h-1 rounded-full", variantClass), style: { width: `${progressPercent}%` } }) }),
|
|
5334
5334
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 pt-0.5", children: [
|
|
5335
5335
|
/* @__PURE__ */ jsxs(Txt, { variant: "ui-sm", className: "text-icon2 font-medium", children: [
|
|
@@ -5380,8 +5380,8 @@ const Span = ({ children, durationMs, variant, tokenCount, spans, isRoot, onClic
|
|
|
5380
5380
|
const progressPercent = durationMs / traceDuration * 100;
|
|
5381
5381
|
const TextEl = onClick ? "button" : "div";
|
|
5382
5382
|
return /* @__PURE__ */ jsx(TraceDurationProvider, { durationMs, children: /* @__PURE__ */ jsxs("li", { children: [
|
|
5383
|
-
/* @__PURE__ */ jsxs("div", { className: clsx("
|
|
5384
|
-
/* @__PURE__ */ jsxs("div", { className: "flex h-8 items-center gap-1", children: [
|
|
5383
|
+
/* @__PURE__ */ jsxs("div", { className: clsx("flex justify-between items-center gap-2 rounded-md pl-2", isActive && "bg-surface4"), children: [
|
|
5384
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-8 items-center gap-1 min-w-0", children: [
|
|
5385
5385
|
spans ? /* @__PURE__ */ jsx(
|
|
5386
5386
|
"button",
|
|
5387
5387
|
{
|
|
@@ -5684,15 +5684,15 @@ const TracesSidebar = ({ onResize }) => {
|
|
|
5684
5684
|
);
|
|
5685
5685
|
};
|
|
5686
5686
|
|
|
5687
|
-
function AgentTraces({ agentName, baseUrl }) {
|
|
5688
|
-
return /* @__PURE__ */ jsx(TraceProvider, { children: /* @__PURE__ */ jsx(AgentTracesInner, { agentName, baseUrl }) });
|
|
5687
|
+
function AgentTraces({ agentName, baseUrl, className }) {
|
|
5688
|
+
return /* @__PURE__ */ jsx(TraceProvider, { children: /* @__PURE__ */ jsx(AgentTracesInner, { agentName, baseUrl, className }) });
|
|
5689
5689
|
}
|
|
5690
|
-
function AgentTracesInner({ agentName, baseUrl }) {
|
|
5690
|
+
function AgentTracesInner({ agentName, baseUrl, className }) {
|
|
5691
5691
|
const [sidebarWidth, setSidebarWidth] = useState(100);
|
|
5692
5692
|
const { traces, firstCallLoading, error } = useTraces(agentName, baseUrl);
|
|
5693
5693
|
const { isOpen: open } = useContext(TraceContext);
|
|
5694
|
-
return /* @__PURE__ */ jsxs("
|
|
5695
|
-
/* @__PURE__ */ jsx("div", { className: clsx("h-full", open ? "w-auto" : "w-full"), children: /* @__PURE__ */ jsx(TracesTable, { traces, isLoading: firstCallLoading, error }) }),
|
|
5694
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx("h-full relative overflow-hidden flex", className), children: [
|
|
5695
|
+
/* @__PURE__ */ jsx("div", { className: clsx("h-full overflow-y-scroll", open ? "w-auto" : "w-full"), children: /* @__PURE__ */ jsx(TracesTable, { traces, isLoading: firstCallLoading, error }) }),
|
|
5696
5696
|
open && /* @__PURE__ */ jsx(TracesSidebar, { width: sidebarWidth, onResize: setSidebarWidth })
|
|
5697
5697
|
] });
|
|
5698
5698
|
}
|
|
@@ -5707,11 +5707,13 @@ function MastraNetworkRuntimeProvider({
|
|
|
5707
5707
|
memory,
|
|
5708
5708
|
threadId,
|
|
5709
5709
|
baseUrl,
|
|
5710
|
-
refreshThreadList
|
|
5710
|
+
refreshThreadList,
|
|
5711
|
+
modelSettings = {}
|
|
5711
5712
|
}) {
|
|
5712
5713
|
const [isRunning, setIsRunning] = useState(false);
|
|
5713
5714
|
const [messages, setMessages] = useState(initialMessages || []);
|
|
5714
5715
|
const [currentThreadId, setCurrentThreadId] = useState(threadId);
|
|
5716
|
+
const { frequencyPenalty, presencePenalty, maxRetries, maxSteps, maxTokens, temperature, topK, topP, instructions } = modelSettings;
|
|
5715
5717
|
useEffect(() => {
|
|
5716
5718
|
if (messages.length === 0 || currentThreadId !== threadId) {
|
|
5717
5719
|
if (initialMessages && threadId && memory) {
|
|
@@ -5721,8 +5723,6 @@ function MastraNetworkRuntimeProvider({
|
|
|
5721
5723
|
}
|
|
5722
5724
|
}, [initialMessages, threadId, memory, messages]);
|
|
5723
5725
|
const mastra = createMastraClient(baseUrl);
|
|
5724
|
-
console.log("MastraClient initialized");
|
|
5725
|
-
console.log(messages, "###");
|
|
5726
5726
|
const network = mastra.getNetwork(agentId);
|
|
5727
5727
|
const onNew = async (message) => {
|
|
5728
5728
|
if (message.content[0]?.type !== "text") throw new Error("Only text messages are supported");
|
|
@@ -5751,6 +5751,15 @@ function MastraNetworkRuntimeProvider({
|
|
|
5751
5751
|
}
|
|
5752
5752
|
],
|
|
5753
5753
|
runId: agentId,
|
|
5754
|
+
frequencyPenalty,
|
|
5755
|
+
presencePenalty,
|
|
5756
|
+
maxRetries,
|
|
5757
|
+
maxSteps,
|
|
5758
|
+
maxTokens,
|
|
5759
|
+
temperature,
|
|
5760
|
+
topK,
|
|
5761
|
+
topP,
|
|
5762
|
+
instructions,
|
|
5754
5763
|
...memory ? { threadId, resourceId: agentId } : {}
|
|
5755
5764
|
});
|
|
5756
5765
|
if (!response.body) {
|
|
@@ -6105,8 +6114,34 @@ const ToolFallback = (props) => {
|
|
|
6105
6114
|
}) });
|
|
6106
6115
|
};
|
|
6107
6116
|
|
|
6117
|
+
const defaultModelSettings = {
|
|
6118
|
+
maxRetries: 2,
|
|
6119
|
+
maxSteps: 5,
|
|
6120
|
+
temperature: 0.5,
|
|
6121
|
+
topP: 1
|
|
6122
|
+
};
|
|
6123
|
+
const NetworkContext = createContext({});
|
|
6124
|
+
function NetworkProvider({ children }) {
|
|
6125
|
+
const [modelSettings, setModelSettings] = useState(defaultModelSettings);
|
|
6126
|
+
const resetModelSettings = () => {
|
|
6127
|
+
setModelSettings(defaultModelSettings);
|
|
6128
|
+
};
|
|
6129
|
+
return /* @__PURE__ */ jsx(
|
|
6130
|
+
NetworkContext.Provider,
|
|
6131
|
+
{
|
|
6132
|
+
value: {
|
|
6133
|
+
modelSettings,
|
|
6134
|
+
setModelSettings,
|
|
6135
|
+
resetModelSettings
|
|
6136
|
+
},
|
|
6137
|
+
children
|
|
6138
|
+
}
|
|
6139
|
+
);
|
|
6140
|
+
}
|
|
6141
|
+
|
|
6108
6142
|
const NetworkChat = ({ agentId, memory }) => {
|
|
6109
|
-
|
|
6143
|
+
const { modelSettings } = useContext(NetworkContext);
|
|
6144
|
+
return /* @__PURE__ */ jsx(MastraNetworkRuntimeProvider, { agentId, memory, modelSettings, children: /* @__PURE__ */ jsx("div", { className: "h-full pb-4", children: /* @__PURE__ */ jsx(Thread, { ToolFallback }) }) });
|
|
6110
6145
|
};
|
|
6111
6146
|
|
|
6112
6147
|
function WorkflowTraces({ workflowName, baseUrl }) {
|
|
@@ -8647,7 +8682,7 @@ function VNextWorkflowTrigger({
|
|
|
8647
8682
|
] }) }, stepId) });
|
|
8648
8683
|
}) })
|
|
8649
8684
|
] }),
|
|
8650
|
-
isSuspendedSteps && suspendedSteps?.map((step) => {
|
|
8685
|
+
!isWatchingVNextWorkflow && isSuspendedSteps && suspendedSteps?.map((step) => {
|
|
8651
8686
|
const stepDefinition = vNextWorkflow.steps[step.stepId];
|
|
8652
8687
|
const stepSchema = stepDefinition?.resumeSchema ? resolveSerializedZodOutput(jsonSchemaToZod(parse(stepDefinition.resumeSchema))) : z.record(z.string(), z.any());
|
|
8653
8688
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4", children: [
|
|
@@ -8846,5 +8881,5 @@ const DarkLogo = (props) => /* @__PURE__ */ jsxs("svg", { width: "100", height:
|
|
|
8846
8881
|
)
|
|
8847
8882
|
] });
|
|
8848
8883
|
|
|
8849
|
-
export { AgentChat, AgentCoinIcon, AgentContext, AgentEvals, AgentIcon, 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, EntryCell, EnvIcon, EvaluatorCoinIcon, FiltersIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, JudgeIcon, LatencyIcon, LogsIcon, MastraResizablePanel, MemoryIcon, NetworkChat, OpenAIIcon, PromptIcon, RepoIcon, Row, ScoreIcon, SettingsIcon, SlashIcon, Table, Tbody, Th, Thead, ToolsIcon, TraceIcon, TsIcon, Txt, TxtCell, UnitCell, VNextWorkflowGraph, VNextWorkflowTrigger, VariablesIcon, WorkflowCoinIcon, WorkflowGraph, WorkflowIcon, WorkflowRunContext, WorkflowRunProvider, WorkflowTraces, WorkflowTrigger };
|
|
8884
|
+
export { AgentChat, AgentCoinIcon, AgentContext, AgentEvals, AgentIcon, 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, EntryCell, EnvIcon, EvaluatorCoinIcon, FiltersIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, JudgeIcon, LatencyIcon, LogsIcon, MastraResizablePanel, MemoryIcon, NetworkChat, NetworkContext, NetworkProvider, OpenAIIcon, PromptIcon, RepoIcon, Row, ScoreIcon, SettingsIcon, SlashIcon, Table, Tbody, Th, Thead, ToolsIcon, TraceIcon, TsIcon, Txt, TxtCell, UnitCell, VNextWorkflowGraph, VNextWorkflowTrigger, VariablesIcon, WorkflowCoinIcon, WorkflowGraph, WorkflowIcon, WorkflowRunContext, WorkflowRunProvider, WorkflowTraces, WorkflowTrigger };
|
|
8850
8885
|
//# sourceMappingURL=index.es.js.map
|