@mastra/react 0.4.1-alpha.1 → 0.4.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/CHANGELOG.md +16 -0
- package/dist/agent/hooks.d.ts.map +1 -1
- package/dist/index.cjs +33 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +33 -33
- package/dist/index.js.map +1 -1
- package/dist/mastra-react-provider.d.ts +1 -1
- package/package.json +7 -5
package/dist/index.js
CHANGED
|
@@ -67,39 +67,6 @@ var MastraReactProvider = ({
|
|
|
67
67
|
);
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
// src/agent/extractRunIdFromMessages.ts
|
|
71
|
-
var extractRunIdFromMessages = (messages) => {
|
|
72
|
-
for (const message of messages) {
|
|
73
|
-
const metadataSources = [
|
|
74
|
-
message.metadata?.pendingToolApprovals,
|
|
75
|
-
message.metadata?.requireApprovalMetadata,
|
|
76
|
-
message.metadata?.suspendedTools
|
|
77
|
-
];
|
|
78
|
-
for (const source of metadataSources) {
|
|
79
|
-
if (!source || typeof source !== "object") continue;
|
|
80
|
-
for (const suspensionData of Object.values(source)) {
|
|
81
|
-
if (suspensionData && typeof suspensionData === "object" && typeof suspensionData.runId === "string" && suspensionData.runId.length > 0) {
|
|
82
|
-
return suspensionData.runId;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return void 0;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
// src/agent/signal-data.ts
|
|
91
|
-
function convertSignalDataToBase64String(content) {
|
|
92
|
-
if (typeof content === "string") {
|
|
93
|
-
return content;
|
|
94
|
-
}
|
|
95
|
-
const bytes = content instanceof ArrayBuffer ? new Uint8Array(content) : content;
|
|
96
|
-
let binary = "";
|
|
97
|
-
for (const byte of bytes) {
|
|
98
|
-
binary += String.fromCharCode(byte);
|
|
99
|
-
}
|
|
100
|
-
return btoa(binary);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
70
|
// src/lib/ai-sdk/utils/formatCompletionFeedback.ts
|
|
104
71
|
var formatBaseCompletionFeedback = (result, maxIterationReached, formatScorerHeading, incompleteMessage) => {
|
|
105
72
|
const lines = [];
|
|
@@ -1956,6 +1923,39 @@ var fromCoreUserMessageToUIMessage = (coreUserMessage) => {
|
|
|
1956
1923
|
};
|
|
1957
1924
|
};
|
|
1958
1925
|
|
|
1926
|
+
// src/agent/extractRunIdFromMessages.ts
|
|
1927
|
+
var extractRunIdFromMessages = (messages) => {
|
|
1928
|
+
for (const message of messages) {
|
|
1929
|
+
const metadataSources = [
|
|
1930
|
+
message.metadata?.pendingToolApprovals,
|
|
1931
|
+
message.metadata?.requireApprovalMetadata,
|
|
1932
|
+
message.metadata?.suspendedTools
|
|
1933
|
+
];
|
|
1934
|
+
for (const source of metadataSources) {
|
|
1935
|
+
if (!source || typeof source !== "object") continue;
|
|
1936
|
+
for (const suspensionData of Object.values(source)) {
|
|
1937
|
+
if (suspensionData && typeof suspensionData === "object" && typeof suspensionData.runId === "string" && suspensionData.runId.length > 0) {
|
|
1938
|
+
return suspensionData.runId;
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
return void 0;
|
|
1944
|
+
};
|
|
1945
|
+
|
|
1946
|
+
// src/agent/signal-data.ts
|
|
1947
|
+
function convertSignalDataToBase64String(content) {
|
|
1948
|
+
if (typeof content === "string") {
|
|
1949
|
+
return content;
|
|
1950
|
+
}
|
|
1951
|
+
const bytes = content instanceof ArrayBuffer ? new Uint8Array(content) : content;
|
|
1952
|
+
let binary = "";
|
|
1953
|
+
for (const byte of bytes) {
|
|
1954
|
+
binary += String.fromCharCode(byte);
|
|
1955
|
+
}
|
|
1956
|
+
return btoa(binary);
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
1959
|
// src/agent/hooks.ts
|
|
1960
1960
|
var isThreadSignalUnsupportedError = (error) => {
|
|
1961
1961
|
const candidate = error;
|