@mastra/react 1.4.4-alpha.6 → 1.4.4-alpha.8
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 +18 -0
- package/dist/agent/hooks.d.ts.map +1 -1
- package/dist/index.cjs +22 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2418,14 +2418,28 @@ const useChat = ({ agentId, resourceId, threadId, initialMessages, requestContex
|
|
|
2418
2418
|
}
|
|
2419
2419
|
return;
|
|
2420
2420
|
}
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
await
|
|
2427
|
-
|
|
2428
|
-
|
|
2421
|
+
try {
|
|
2422
|
+
await (resumeData !== void 0 ? await agent.resumeStream(resumeData, {
|
|
2423
|
+
runId: currentRunId,
|
|
2424
|
+
toolCallId,
|
|
2425
|
+
...continuation
|
|
2426
|
+
}) : await agent.approveToolCall({
|
|
2427
|
+
runId: currentRunId,
|
|
2428
|
+
toolCallId,
|
|
2429
|
+
...continuation
|
|
2430
|
+
})).processDataStream({ onChunk: async (chunk) => {
|
|
2431
|
+
await processStreamChunk(chunk, onChunk);
|
|
2432
|
+
} });
|
|
2433
|
+
setIsRunning(false);
|
|
2434
|
+
} catch (error) {
|
|
2435
|
+
setToolCallApprovals((prev) => {
|
|
2436
|
+
const next = { ...prev };
|
|
2437
|
+
delete next[toolCallId];
|
|
2438
|
+
return next;
|
|
2439
|
+
});
|
|
2440
|
+
setIsRunning(false);
|
|
2441
|
+
throw error;
|
|
2442
|
+
}
|
|
2429
2443
|
};
|
|
2430
2444
|
const declineToolCall = async (toolCallId) => {
|
|
2431
2445
|
const onChunk = _onChunk.current;
|