@mastra/react 0.1.0-beta.21 → 0.1.0-beta.22

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.
Files changed (24) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/{chunk-55VPMN3N-BuAJ8n05.js → chunk-55VPMN3N-C6D-FCqV.js} +2 -2
  3. package/dist/{chunk-55VPMN3N-BuAJ8n05.js.map → chunk-55VPMN3N-C6D-FCqV.js.map} +1 -1
  4. package/dist/{chunk-55VPMN3N-CcAQjWR_.cjs → chunk-55VPMN3N-CXxvOk-2.cjs} +2 -2
  5. package/dist/{chunk-55VPMN3N-CcAQjWR_.cjs.map → chunk-55VPMN3N-CXxvOk-2.cjs.map} +1 -1
  6. package/dist/{index-Bk0KrCu7.js → index-DFYpOuhE.js} +250 -60
  7. package/dist/index-DFYpOuhE.js.map +1 -0
  8. package/dist/{index-DIo7K8Tu.cjs → index-DiwNdkF4.cjs} +250 -60
  9. package/dist/index-DiwNdkF4.cjs.map +1 -0
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/src/agent/hooks.d.ts +7 -0
  13. package/dist/src/lib/ai-sdk/types.d.ts +36 -1
  14. package/dist/{token-6GSAFR2W-SPYPLMBM-Dw0-CxcM.js → token-6GSAFR2W-SPYPLMBM-BeIpRVyM.js} +3 -3
  15. package/dist/{token-6GSAFR2W-SPYPLMBM-Dw0-CxcM.js.map → token-6GSAFR2W-SPYPLMBM-BeIpRVyM.js.map} +1 -1
  16. package/dist/{token-6GSAFR2W-SPYPLMBM-DiC0Z8QW.cjs → token-6GSAFR2W-SPYPLMBM-CKILUODb.cjs} +3 -3
  17. package/dist/{token-6GSAFR2W-SPYPLMBM-DiC0Z8QW.cjs.map → token-6GSAFR2W-SPYPLMBM-CKILUODb.cjs.map} +1 -1
  18. package/dist/{token-util-NEHG7TUY-JRJTGTAB-5ZAaCe3X.cjs → token-util-NEHG7TUY-JRJTGTAB-DgJBvxO4.cjs} +2 -2
  19. package/dist/{token-util-NEHG7TUY-JRJTGTAB-5ZAaCe3X.cjs.map → token-util-NEHG7TUY-JRJTGTAB-DgJBvxO4.cjs.map} +1 -1
  20. package/dist/{token-util-NEHG7TUY-JRJTGTAB-CrKHYQe8.js → token-util-NEHG7TUY-JRJTGTAB-N8sYk0L_.js} +2 -2
  21. package/dist/{token-util-NEHG7TUY-JRJTGTAB-CrKHYQe8.js.map → token-util-NEHG7TUY-JRJTGTAB-N8sYk0L_.js.map} +1 -1
  22. package/package.json +3 -3
  23. package/dist/index-Bk0KrCu7.js.map +0 -1
  24. package/dist/index-DIo7K8Tu.cjs.map +0 -1
@@ -163,38 +163,57 @@ const toUIMessage = ({ chunk, conversation, metadata }) => {
163
163
  };
164
164
  return [...result, newMessage];
165
165
  }
166
- case "text-start":
167
- case "text-delta": {
166
+ case "text-start": {
168
167
  const lastMessage = result[result.length - 1];
169
168
  if (!lastMessage || lastMessage.role !== "assistant") return result;
170
169
  const parts = [...lastMessage.parts];
171
- let textPartIndex = parts.findIndex((part) => part.type === "text");
172
- if (chunk.type === "text-start") {
173
- if (textPartIndex === -1) {
174
- parts.push({
175
- type: "text",
176
- text: "",
177
- state: "streaming",
178
- providerMetadata: chunk.payload.providerMetadata
179
- });
170
+ const textId = chunk.payload.id || `text-${Date.now()}`;
171
+ const newTextPart = {
172
+ type: "text",
173
+ text: "",
174
+ state: "streaming",
175
+ textId,
176
+ providerMetadata: chunk.payload.providerMetadata
177
+ };
178
+ parts.push(newTextPart);
179
+ return [
180
+ ...result.slice(0, -1),
181
+ {
182
+ ...lastMessage,
183
+ parts
180
184
  }
185
+ ];
186
+ }
187
+ case "text-delta": {
188
+ const lastMessage = result[result.length - 1];
189
+ if (!lastMessage || lastMessage.role !== "assistant") return result;
190
+ const parts = [...lastMessage.parts];
191
+ const textId = chunk.payload.id;
192
+ let textPartIndex = textId ? parts.findLastIndex((part) => part.type === "text" && part.textId === textId) : -1;
193
+ if (textPartIndex === -1) {
194
+ textPartIndex = parts.findLastIndex(
195
+ (part) => part.type === "text" && part.state === "streaming"
196
+ );
197
+ }
198
+ if (textPartIndex === -1) {
199
+ const newTextPart = {
200
+ type: "text",
201
+ text: chunk.payload.text,
202
+ state: "streaming",
203
+ textId,
204
+ providerMetadata: chunk.payload.providerMetadata
205
+ };
206
+ parts.push(newTextPart);
181
207
  } else {
182
- if (textPartIndex === -1) {
183
- parts.push({
184
- type: "text",
185
- text: chunk.payload.text,
186
- state: "streaming",
187
- providerMetadata: chunk.payload.providerMetadata
188
- });
189
- } else {
190
- const textPart = parts[textPartIndex];
191
- if (textPart.type === "text") {
192
- parts[textPartIndex] = {
193
- ...textPart,
194
- text: textPart.text + chunk.payload.text,
195
- state: "streaming"
196
- };
197
- }
208
+ const textPart = parts[textPartIndex];
209
+ if (textPart.type === "text") {
210
+ const extendedTextPart = textPart;
211
+ const updatedTextPart = {
212
+ ...extendedTextPart,
213
+ text: extendedTextPart.text + chunk.payload.text,
214
+ state: "streaming"
215
+ };
216
+ parts[textPartIndex] = updatedTextPart;
198
217
  }
199
218
  }
200
219
  return [
@@ -792,7 +811,8 @@ const toAssistantUIMessage = (message) => {
792
811
  };
793
812
 
794
813
  const resolveInitialMessages = (messages) => {
795
- return messages.map((message) => {
814
+ const messagesLength = messages.length;
815
+ return messages.map((message, index) => {
796
816
  const networkPart = message.parts.find(
797
817
  (part) => typeof part === "object" && part !== null && "type" in part && part.type === "text" && "text" in part && typeof part.text === "string" && part.text.includes('"isNetwork":true')
798
818
  );
@@ -840,7 +860,7 @@ const resolveInitialMessages = (messages) => {
840
860
  content: finalResult.text
841
861
  });
842
862
  }
843
- const result = {
863
+ const result = primitiveType === "tool" ? finalResult?.result : {
844
864
  childMessages,
845
865
  result: finalResult?.text || ""
846
866
  };
@@ -862,6 +882,7 @@ const resolveInitialMessages = (messages) => {
862
882
  mode: "network",
863
883
  selectionReason,
864
884
  agentInput: json.input,
885
+ hasMoreMessages: index < messagesLength - 1,
865
886
  from: primitiveType === "agent" ? "AGENT" : primitiveType === "tool" ? "TOOL" : "WORKFLOW"
866
887
  }
867
888
  };
@@ -3108,8 +3129,8 @@ var require_get_vercel_oidc_token = __commonJS$2({
3108
3129
  }
3109
3130
  try {
3110
3131
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
3111
- await import('./token-util-NEHG7TUY-JRJTGTAB-CrKHYQe8.js'),
3112
- await import('./token-6GSAFR2W-SPYPLMBM-Dw0-CxcM.js')
3132
+ await import('./token-util-NEHG7TUY-JRJTGTAB-N8sYk0L_.js'),
3133
+ await import('./token-6GSAFR2W-SPYPLMBM-BeIpRVyM.js')
3113
3134
  ]);
3114
3135
  if (!token || isExpired(getTokenPayload(token))) {
3115
3136
  await refreshToken();
@@ -4941,20 +4962,6 @@ createIdGenerator$3({
4941
4962
  prefix: "aitxt",
4942
4963
  size: 24
4943
4964
  });
4944
- (class extends TransformStream {
4945
- constructor() {
4946
- super({
4947
- transform(part, controller) {
4948
- controller.enqueue(`data: ${JSON.stringify(part)}
4949
-
4950
- `);
4951
- },
4952
- flush(controller) {
4953
- controller.enqueue("data: [DONE]\n\n");
4954
- }
4955
- });
4956
- }
4957
- });
4958
4965
  function fixJson$2(input) {
4959
4966
  const stack = ["ROOT"];
4960
4967
  let lastValidIndex = -1;
@@ -10069,15 +10076,16 @@ var AIV4Adapter = class {
10069
10076
  */
10070
10077
  static toUIMessage(m) {
10071
10078
  const experimentalAttachments = m.content.experimental_attachments ? [...m.content.experimental_attachments] : [];
10072
- const contentString = typeof m.content.content === `string` && m.content.content !== "" ? m.content.content : m.content.parts.reduce((prev, part) => {
10079
+ const contentString = typeof m.content.content === `string` && m.content.content !== "" ? m.content.content : (m.content.parts ?? []).reduce((prev, part) => {
10073
10080
  if (part.type === `text`) {
10074
10081
  return part.text;
10075
10082
  }
10076
10083
  return prev;
10077
10084
  }, "");
10078
10085
  const parts = [];
10079
- if (m.content.parts.length) {
10080
- for (const part of m.content.parts) {
10086
+ const sourceParts = m.content.parts ?? [];
10087
+ if (sourceParts.length) {
10088
+ for (const part of sourceParts) {
10081
10089
  if (part.type === `file`) {
10082
10090
  let normalizedUrl;
10083
10091
  if (typeof part.data === "string") {
@@ -10100,7 +10108,7 @@ var AIV4Adapter = class {
10100
10108
  const toolInvocation = { ...part.toolInvocation };
10101
10109
  let currentStep = -1;
10102
10110
  let toolStep = -1;
10103
- for (const innerPart of m.content.parts) {
10111
+ for (const innerPart of sourceParts) {
10104
10112
  if (innerPart.type === `step-start`) currentStep++;
10105
10113
  if (innerPart.type === `tool-invocation` && innerPart.toolInvocation.toolCallId === part.toolInvocation.toolCallId) {
10106
10114
  toolStep = currentStep;
@@ -13483,9 +13491,15 @@ var MessageList$1 = class MessageList {
13483
13491
  this.lastCreatedAt = nowTime;
13484
13492
  return now;
13485
13493
  }
13486
- newMessageId() {
13494
+ newMessageId(role) {
13487
13495
  if (this.generateMessageId) {
13488
- return this.generateMessageId();
13496
+ return this.generateMessageId({
13497
+ idType: "message",
13498
+ source: "agent",
13499
+ threadId: this.memoryInfo?.threadId,
13500
+ resourceId: this.memoryInfo?.resourceId,
13501
+ role
13502
+ });
13489
13503
  }
13490
13504
  return v4();
13491
13505
  }
@@ -19200,9 +19214,9 @@ z$1.object({
19200
19214
  steps: z$1.custom().optional()
19201
19215
  });
19202
19216
  var languageModelUsageSchema = z10.object({
19203
- inputTokens: z10.number(),
19204
- outputTokens: z10.number(),
19205
- totalTokens: z10.number(),
19217
+ inputTokens: z10.number().optional(),
19218
+ outputTokens: z10.number().optional(),
19219
+ totalTokens: z10.number().optional(),
19206
19220
  reasoningTokens: z10.number().optional(),
19207
19221
  cachedInputTokens: z10.number().optional()
19208
19222
  });
@@ -19326,7 +19340,7 @@ var coreToolSchema = z$1.object({
19326
19340
  // Zod schema or other schema types - validated at tool execution
19327
19341
  ]),
19328
19342
  outputSchema: z$1.union([z$1.record(z$1.string(), z$1.any()), z$1.any()]).optional(),
19329
- execute: z$1.function(z$1.tuple([z$1.any(), z$1.any()]), z$1.promise(z$1.any())).optional(),
19343
+ execute: z$1.optional(z$1.function(z$1.tuple([z$1.any(), z$1.any()]), z$1.promise(z$1.any()))),
19330
19344
  type: z$1.union([z$1.literal("function"), z$1.literal("provider-defined"), z$1.undefined()]).optional(),
19331
19345
  args: z$1.record(z$1.string(), z$1.any()).optional()
19332
19346
  });
@@ -19505,6 +19519,54 @@ class AISdkNetworkTransformer {
19505
19519
  };
19506
19520
  return [...newConversation, newMessage];
19507
19521
  }
19522
+ if (chunk.type === "agent-execution-approval") {
19523
+ const lastMessage = newConversation[newConversation.length - 1];
19524
+ if (!lastMessage || lastMessage.role !== "assistant") return newConversation;
19525
+ const lastRequireApprovalMetadata = lastMessage.metadata?.mode === "network" ? lastMessage.metadata?.requireApprovalMetadata : {};
19526
+ return [
19527
+ ...newConversation.slice(0, -1),
19528
+ {
19529
+ ...lastMessage,
19530
+ metadata: {
19531
+ ...lastMessage.metadata,
19532
+ mode: "network",
19533
+ requireApprovalMetadata: {
19534
+ ...lastRequireApprovalMetadata,
19535
+ [chunk.payload.toolName]: {
19536
+ toolCallId: chunk.payload.toolCallId,
19537
+ toolName: chunk.payload.toolName,
19538
+ args: chunk.payload.args,
19539
+ runId: chunk.payload.runId
19540
+ }
19541
+ }
19542
+ }
19543
+ }
19544
+ ];
19545
+ }
19546
+ if (chunk.type === "agent-execution-suspended") {
19547
+ const lastMessage = newConversation[newConversation.length - 1];
19548
+ if (!lastMessage || lastMessage.role !== "assistant") return newConversation;
19549
+ const lastSuspendedTools = lastMessage.metadata?.mode === "network" ? lastMessage.metadata?.suspendedTools : {};
19550
+ return [
19551
+ ...newConversation.slice(0, -1),
19552
+ {
19553
+ ...lastMessage,
19554
+ metadata: {
19555
+ ...lastMessage.metadata,
19556
+ mode: "network",
19557
+ suspendedTools: {
19558
+ ...lastSuspendedTools,
19559
+ [chunk.payload.toolName]: {
19560
+ toolCallId: chunk.payload.toolCallId,
19561
+ toolName: chunk.payload.toolName,
19562
+ args: chunk.payload.args,
19563
+ suspendPayload: chunk.payload.suspendPayload
19564
+ }
19565
+ }
19566
+ }
19567
+ }
19568
+ ];
19569
+ }
19508
19570
  if (chunk.type === "agent-execution-end") {
19509
19571
  const lastMessage = newConversation[newConversation.length - 1];
19510
19572
  if (!lastMessage || lastMessage.role !== "assistant") return newConversation;
@@ -19660,6 +19722,30 @@ class AISdkNetworkTransformer {
19660
19722
  };
19661
19723
  return [...newConversation, newMessage];
19662
19724
  }
19725
+ if (chunk.type === "workflow-execution-suspended") {
19726
+ const lastMessage = newConversation[newConversation.length - 1];
19727
+ if (!lastMessage || lastMessage.role !== "assistant") return newConversation;
19728
+ const lastSuspendedTools = lastMessage.metadata?.mode === "network" ? lastMessage.metadata?.suspendedTools : {};
19729
+ return [
19730
+ ...newConversation.slice(0, -1),
19731
+ {
19732
+ ...lastMessage,
19733
+ metadata: {
19734
+ ...lastMessage.metadata,
19735
+ mode: "network",
19736
+ suspendedTools: {
19737
+ ...lastSuspendedTools,
19738
+ [chunk.payload.toolName]: {
19739
+ toolCallId: chunk.payload.toolCallId,
19740
+ toolName: chunk.payload.toolName,
19741
+ args: chunk.payload.args,
19742
+ suspendPayload: chunk.payload.suspendPayload
19743
+ }
19744
+ }
19745
+ }
19746
+ }
19747
+ ];
19748
+ }
19663
19749
  if (chunk.type.startsWith("workflow-execution-event-")) {
19664
19750
  const lastMessage = newConversation[newConversation.length - 1];
19665
19751
  if (!lastMessage || lastMessage.role !== "assistant") return newConversation;
@@ -19727,6 +19813,54 @@ class AISdkNetworkTransformer {
19727
19813
  }
19728
19814
  ];
19729
19815
  }
19816
+ if (chunk.type === "tool-execution-approval") {
19817
+ const lastMessage = newConversation[newConversation.length - 1];
19818
+ if (!lastMessage || lastMessage.role !== "assistant") return newConversation;
19819
+ const lastRequireApprovalMetadata = lastMessage.metadata?.mode === "network" ? lastMessage.metadata?.requireApprovalMetadata : {};
19820
+ return [
19821
+ ...newConversation.slice(0, -1),
19822
+ {
19823
+ ...lastMessage,
19824
+ metadata: {
19825
+ ...lastMessage.metadata,
19826
+ mode: "network",
19827
+ requireApprovalMetadata: {
19828
+ ...lastRequireApprovalMetadata,
19829
+ [chunk.payload.toolName]: {
19830
+ toolCallId: chunk.payload.toolCallId,
19831
+ toolName: chunk.payload.toolName,
19832
+ args: chunk.payload.args,
19833
+ runId: chunk.payload.runId
19834
+ }
19835
+ }
19836
+ }
19837
+ }
19838
+ ];
19839
+ }
19840
+ if (chunk.type === "tool-execution-suspended") {
19841
+ const lastMessage = newConversation[newConversation.length - 1];
19842
+ if (!lastMessage || lastMessage.role !== "assistant") return newConversation;
19843
+ const lastSuspendedTools = lastMessage.metadata?.mode === "network" ? lastMessage.metadata?.suspendedTools : {};
19844
+ return [
19845
+ ...newConversation.slice(0, -1),
19846
+ {
19847
+ ...lastMessage,
19848
+ metadata: {
19849
+ ...lastMessage.metadata,
19850
+ mode: "network",
19851
+ suspendedTools: {
19852
+ ...lastSuspendedTools,
19853
+ [chunk.payload.toolName]: {
19854
+ toolCallId: chunk.payload.toolCallId,
19855
+ toolName: chunk.payload.toolName,
19856
+ args: chunk.payload.args,
19857
+ suspendPayload: chunk.payload.suspendPayload
19858
+ }
19859
+ }
19860
+ }
19861
+ }
19862
+ ];
19863
+ }
19730
19864
  if (chunk.type === "tool-execution-end") {
19731
19865
  const lastMessage = newConversation[newConversation.length - 1];
19732
19866
  if (!lastMessage || lastMessage.role !== "assistant") return newConversation;
@@ -19822,8 +19956,11 @@ const useChat = ({ agentId, resourceId, initializeMessages }) => {
19822
19956
  const initialRunId = extractRunIdFromMessages(initialMessages);
19823
19957
  const _currentRunId = useRef(initialRunId);
19824
19958
  const _onChunk = useRef(void 0);
19959
+ const _networkRunId = useRef(void 0);
19960
+ const _onNetworkChunk = useRef(void 0);
19825
19961
  const [messages, setMessages] = useState(() => resolveInitialMessages(initialMessages));
19826
19962
  const [toolCallApprovals, setToolCallApprovals] = useState({});
19963
+ const [networkToolCallApprovals, setNetworkToolCallApprovals] = useState({});
19827
19964
  const baseClient = useMastraClient();
19828
19965
  const [isRunning, setIsRunning] = useState(false);
19829
19966
  const generate = async ({
@@ -19868,7 +20005,7 @@ const useChat = ({ agentId, resourceId, initializeMessages }) => {
19868
20005
  },
19869
20006
  instructions,
19870
20007
  requestContext,
19871
- ...threadId ? { threadId, resourceId: resourceId || agentId } : {},
20008
+ ...threadId ? { memory: { thread: threadId, resource: resourceId || agentId } } : {},
19872
20009
  providerOptions,
19873
20010
  tracingOptions
19874
20011
  });
@@ -19928,7 +20065,7 @@ const useChat = ({ agentId, resourceId, initializeMessages }) => {
19928
20065
  },
19929
20066
  instructions,
19930
20067
  requestContext,
19931
- ...threadId ? { threadId, resourceId: resourceId || agentId } : {},
20068
+ ...threadId ? { memory: { thread: threadId, resource: resourceId || agentId } } : {},
19932
20069
  providerOptions,
19933
20070
  requireToolApproval,
19934
20071
  tracingOptions
@@ -19974,9 +20111,11 @@ const useChat = ({ agentId, resourceId, initializeMessages }) => {
19974
20111
  },
19975
20112
  runId,
19976
20113
  requestContext,
19977
- ...threadId ? { thread: threadId, resourceId: resourceId || agentId } : {},
20114
+ ...threadId ? { memory: { thread: threadId, resource: resourceId || agentId } } : {},
19978
20115
  tracingOptions
19979
20116
  });
20117
+ _onNetworkChunk.current = onNetworkChunk;
20118
+ _networkRunId.current = runId;
19980
20119
  const transformer = new AISdkNetworkTransformer();
19981
20120
  await response.processDataStream({
19982
20121
  onChunk: async (chunk) => {
@@ -19990,6 +20129,8 @@ const useChat = ({ agentId, resourceId, initializeMessages }) => {
19990
20129
  setIsRunning(false);
19991
20130
  _currentRunId.current = void 0;
19992
20131
  _onChunk.current = void 0;
20132
+ _networkRunId.current = void 0;
20133
+ _onNetworkChunk.current = void 0;
19993
20134
  };
19994
20135
  const approveToolCall = async (toolCallId) => {
19995
20136
  const onChunk = _onChunk.current;
@@ -20025,6 +20166,52 @@ const useChat = ({ agentId, resourceId, initializeMessages }) => {
20025
20166
  });
20026
20167
  setIsRunning(false);
20027
20168
  };
20169
+ const approveNetworkToolCall = async (toolName, runId) => {
20170
+ const onNetworkChunk = _onNetworkChunk.current;
20171
+ const networkRunId = runId || _networkRunId.current;
20172
+ if (!networkRunId)
20173
+ return console.info(
20174
+ "[approveNetworkToolCall] approveNetworkToolCall can only be called after a network stream has started"
20175
+ );
20176
+ setIsRunning(true);
20177
+ setNetworkToolCallApprovals((prev) => ({
20178
+ ...prev,
20179
+ [runId ? `${runId}-${toolName}` : toolName]: { status: "approved" }
20180
+ }));
20181
+ const agent = baseClient.getAgent(agentId);
20182
+ const response = await agent.approveNetworkToolCall({ runId: networkRunId });
20183
+ const transformer = new AISdkNetworkTransformer();
20184
+ await response.processDataStream({
20185
+ onChunk: async (chunk) => {
20186
+ setMessages((prev) => transformer.transform({ chunk, conversation: prev, metadata: { mode: "network" } }));
20187
+ onNetworkChunk?.(chunk);
20188
+ }
20189
+ });
20190
+ setIsRunning(false);
20191
+ };
20192
+ const declineNetworkToolCall = async (toolName, runId) => {
20193
+ const onNetworkChunk = _onNetworkChunk.current;
20194
+ const networkRunId = runId || _networkRunId.current;
20195
+ if (!networkRunId)
20196
+ return console.info(
20197
+ "[declineNetworkToolCall] declineNetworkToolCall can only be called after a network stream has started"
20198
+ );
20199
+ setIsRunning(true);
20200
+ setNetworkToolCallApprovals((prev) => ({
20201
+ ...prev,
20202
+ [runId ? `${runId}-${toolName}` : toolName]: { status: "declined" }
20203
+ }));
20204
+ const agent = baseClient.getAgent(agentId);
20205
+ const response = await agent.declineNetworkToolCall({ runId: networkRunId });
20206
+ const transformer = new AISdkNetworkTransformer();
20207
+ await response.processDataStream({
20208
+ onChunk: async (chunk) => {
20209
+ setMessages((prev) => transformer.transform({ chunk, conversation: prev, metadata: { mode: "network" } }));
20210
+ onNetworkChunk?.(chunk);
20211
+ }
20212
+ });
20213
+ setIsRunning(false);
20214
+ };
20028
20215
  const sendMessage = async ({ mode = "stream", ...args }) => {
20029
20216
  const nextMessage = { role: "user", content: [{ type: "text", text: args.message }] };
20030
20217
  const coreUserMessages = [nextMessage];
@@ -20049,7 +20236,10 @@ const useChat = ({ agentId, resourceId, initializeMessages }) => {
20049
20236
  approveToolCall,
20050
20237
  declineToolCall,
20051
20238
  cancelRun: handleCancelRun,
20052
- toolCallApprovals
20239
+ toolCallApprovals,
20240
+ approveNetworkToolCall,
20241
+ declineNetworkToolCall,
20242
+ networkToolCallApprovals
20053
20243
  };
20054
20244
  };
20055
20245
 
@@ -20369,4 +20559,4 @@ const MessageStreaming = ({ className, ...props }) => {
20369
20559
  };
20370
20560
 
20371
20561
  export { MessageUsages as $, EntryTitleClass as A, EntryTitle as B, CodeBlockClass as C, CodeBlock as D, Entity as E, CodeCopyButton as F, Icon as G, IconButtonClass as H, IconSizes as I, IconButton as J, AgentIcon as K, ToolsIcon as L, MastraReactProvider as M, Tooltip as N, TooltipContentClass as O, TooltipContent as P, TooltipTrigger as Q, MessageClass as R, Message as S, ToolApprovalClass as T, MessageContentClass as U, MessageContent as V, WorkflowIcon as W, MessageActionsClass as X, MessageActions as Y, MessageUsagesClass as Z, __commonJS$2 as _, __require2 as a, MessageUsageClass as a0, MessageUsage as a1, MessageUsageEntryClass as a2, MessageUsageEntry as a3, MessageUsageValueClass as a4, MessageUsageValue as a5, MessageListClass as a6, MessageList as a7, MessageStreamingClass as a8, MessageStreaming as a9, useChat as b, resolveToChildMessages as c, toAssistantUIMessage as d, useEntity as e, EntityTriggerClass as f, EntityTriggerVariantClasses as g, EntityTrigger as h, EntityContentClass as i, EntityContent as j, EntityCaret as k, ToolApproval as l, mapWorkflowStreamChunkToWatchResult as m, ToolApprovalTitleClass as n, ToolApprovalTitle as o, ToolApprovalHeaderClass as p, ToolApprovalHeader as q, require_token_error as r, ToolApprovalContentClass as s, toUIMessage as t, useMastraClient as u, ToolApprovalContent as v, ToolApprovalActionsClass as w, ToolApprovalActions as x, EntryClass as y, Entry as z };
20372
- //# sourceMappingURL=index-Bk0KrCu7.js.map
20562
+ //# sourceMappingURL=index-DFYpOuhE.js.map