@mastra/client-js 0.0.0-fix-cloud-peer-deps-libsql-20250929202200 → 0.0.0-fix-network-silence-20250930164151
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 +7 -3
- package/dist/index.cjs +42 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -9
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +11 -1
- package/dist/resources/workflow.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1034,9 +1034,11 @@ var Agent = class extends BaseResource {
|
|
|
1034
1034
|
if (toolCall) {
|
|
1035
1035
|
toolCalls.push(toolCall);
|
|
1036
1036
|
}
|
|
1037
|
+
let shouldExecuteClientTool = false;
|
|
1037
1038
|
for (const toolCall2 of toolCalls) {
|
|
1038
1039
|
const clientTool = processedParams.clientTools?.[toolCall2.toolName];
|
|
1039
1040
|
if (clientTool && clientTool.execute) {
|
|
1041
|
+
shouldExecuteClientTool = true;
|
|
1040
1042
|
const result = await clientTool.execute(
|
|
1041
1043
|
{
|
|
1042
1044
|
context: toolCall2?.args,
|
|
@@ -1085,6 +1087,11 @@ var Agent = class extends BaseResource {
|
|
|
1085
1087
|
});
|
|
1086
1088
|
}
|
|
1087
1089
|
}
|
|
1090
|
+
if (!shouldExecuteClientTool) {
|
|
1091
|
+
setTimeout(() => {
|
|
1092
|
+
writable.close();
|
|
1093
|
+
}, 0);
|
|
1094
|
+
}
|
|
1088
1095
|
} else {
|
|
1089
1096
|
setTimeout(() => {
|
|
1090
1097
|
writable.close();
|
|
@@ -1697,10 +1704,20 @@ var Workflow = class extends BaseResource {
|
|
|
1697
1704
|
return {
|
|
1698
1705
|
runId,
|
|
1699
1706
|
start: async (p) => {
|
|
1700
|
-
return this.start({
|
|
1707
|
+
return this.start({
|
|
1708
|
+
runId,
|
|
1709
|
+
inputData: p.inputData,
|
|
1710
|
+
runtimeContext: p.runtimeContext,
|
|
1711
|
+
tracingOptions: p.tracingOptions
|
|
1712
|
+
});
|
|
1701
1713
|
},
|
|
1702
1714
|
startAsync: async (p) => {
|
|
1703
|
-
return this.startAsync({
|
|
1715
|
+
return this.startAsync({
|
|
1716
|
+
runId,
|
|
1717
|
+
inputData: p.inputData,
|
|
1718
|
+
runtimeContext: p.runtimeContext,
|
|
1719
|
+
tracingOptions: p.tracingOptions
|
|
1720
|
+
});
|
|
1704
1721
|
},
|
|
1705
1722
|
watch: async (onRecord) => {
|
|
1706
1723
|
return this.watch({ runId }, onRecord);
|
|
@@ -1709,10 +1726,22 @@ var Workflow = class extends BaseResource {
|
|
|
1709
1726
|
return this.stream({ runId, inputData: p.inputData, runtimeContext: p.runtimeContext });
|
|
1710
1727
|
},
|
|
1711
1728
|
resume: async (p) => {
|
|
1712
|
-
return this.resume({
|
|
1729
|
+
return this.resume({
|
|
1730
|
+
runId,
|
|
1731
|
+
step: p.step,
|
|
1732
|
+
resumeData: p.resumeData,
|
|
1733
|
+
runtimeContext: p.runtimeContext,
|
|
1734
|
+
tracingOptions: p.tracingOptions
|
|
1735
|
+
});
|
|
1713
1736
|
},
|
|
1714
1737
|
resumeAsync: async (p) => {
|
|
1715
|
-
return this.resumeAsync({
|
|
1738
|
+
return this.resumeAsync({
|
|
1739
|
+
runId,
|
|
1740
|
+
step: p.step,
|
|
1741
|
+
resumeData: p.resumeData,
|
|
1742
|
+
runtimeContext: p.runtimeContext,
|
|
1743
|
+
tracingOptions: p.tracingOptions
|
|
1744
|
+
});
|
|
1716
1745
|
},
|
|
1717
1746
|
resumeStreamVNext: async (p) => {
|
|
1718
1747
|
return this.resumeStreamVNext({
|
|
@@ -1733,7 +1762,7 @@ var Workflow = class extends BaseResource {
|
|
|
1733
1762
|
const runtimeContext = parseClientRuntimeContext(params.runtimeContext);
|
|
1734
1763
|
return this.request(`/api/workflows/${this.workflowId}/start?runId=${params.runId}`, {
|
|
1735
1764
|
method: "POST",
|
|
1736
|
-
body: { inputData: params?.inputData, runtimeContext }
|
|
1765
|
+
body: { inputData: params?.inputData, runtimeContext, tracingOptions: params.tracingOptions }
|
|
1737
1766
|
});
|
|
1738
1767
|
}
|
|
1739
1768
|
/**
|
|
@@ -1745,6 +1774,7 @@ var Workflow = class extends BaseResource {
|
|
|
1745
1774
|
step,
|
|
1746
1775
|
runId,
|
|
1747
1776
|
resumeData,
|
|
1777
|
+
tracingOptions,
|
|
1748
1778
|
...rest
|
|
1749
1779
|
}) {
|
|
1750
1780
|
const runtimeContext = parseClientRuntimeContext(rest.runtimeContext);
|
|
@@ -1753,7 +1783,8 @@ var Workflow = class extends BaseResource {
|
|
|
1753
1783
|
body: {
|
|
1754
1784
|
step,
|
|
1755
1785
|
resumeData,
|
|
1756
|
-
runtimeContext
|
|
1786
|
+
runtimeContext,
|
|
1787
|
+
tracingOptions
|
|
1757
1788
|
}
|
|
1758
1789
|
});
|
|
1759
1790
|
}
|
|
@@ -1770,7 +1801,7 @@ var Workflow = class extends BaseResource {
|
|
|
1770
1801
|
const runtimeContext = parseClientRuntimeContext(params.runtimeContext);
|
|
1771
1802
|
return this.request(`/api/workflows/${this.workflowId}/start-async?${searchParams.toString()}`, {
|
|
1772
1803
|
method: "POST",
|
|
1773
|
-
body: { inputData: params.inputData, runtimeContext }
|
|
1804
|
+
body: { inputData: params.inputData, runtimeContext, tracingOptions: params.tracingOptions }
|
|
1774
1805
|
});
|
|
1775
1806
|
}
|
|
1776
1807
|
/**
|
|
@@ -1934,7 +1965,8 @@ var Workflow = class extends BaseResource {
|
|
|
1934
1965
|
body: {
|
|
1935
1966
|
step: params.step,
|
|
1936
1967
|
resumeData: params.resumeData,
|
|
1937
|
-
runtimeContext
|
|
1968
|
+
runtimeContext,
|
|
1969
|
+
tracingOptions: params.tracingOptions
|
|
1938
1970
|
}
|
|
1939
1971
|
});
|
|
1940
1972
|
}
|
|
@@ -1950,7 +1982,8 @@ var Workflow = class extends BaseResource {
|
|
|
1950
1982
|
body: {
|
|
1951
1983
|
step: params.step,
|
|
1952
1984
|
resumeData: params.resumeData,
|
|
1953
|
-
runtimeContext
|
|
1985
|
+
runtimeContext,
|
|
1986
|
+
tracingOptions: params.tracingOptions
|
|
1954
1987
|
}
|
|
1955
1988
|
});
|
|
1956
1989
|
}
|