@mastra/client-js 0.15.1-alpha.0 → 0.15.1-alpha.2
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/index.cjs +15 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/process-mastra-stream.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.15.1-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`ee9108f`](https://github.com/mastra-ai/mastra/commit/ee9108fa29bb8368fc23df158c9f0645b2d7b65c)]:
|
|
8
|
+
- @mastra/core@0.20.1-alpha.2
|
|
9
|
+
|
|
10
|
+
## 0.15.1-alpha.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Mutable shared workflow run state ([#8545](https://github.com/mastra-ai/mastra/pull/8545))
|
|
15
|
+
|
|
16
|
+
- add tripwire reason in playground ([#8568](https://github.com/mastra-ai/mastra/pull/8568))
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`c621613`](https://github.com/mastra-ai/mastra/commit/c621613069173c69eb2c3ef19a5308894c6549f0), [`12b1189`](https://github.com/mastra-ai/mastra/commit/12b118942445e4de0dd916c593e33ec78dc3bc73), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`076b092`](https://github.com/mastra-ai/mastra/commit/076b0924902ff0f49d5712d2df24c4cca683713f), [`2aee9e7`](https://github.com/mastra-ai/mastra/commit/2aee9e7d188b8b256a4ddc203ccefb366b4867fa), [`c582906`](https://github.com/mastra-ai/mastra/commit/c5829065a346260f96c4beb8af131b94804ae3ad), [`fa2eb96`](https://github.com/mastra-ai/mastra/commit/fa2eb96af16c7d433891a73932764960d3235c1d), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`a739d0c`](https://github.com/mastra-ai/mastra/commit/a739d0c8b37cd89569e04a6ca0827083c6167e19), [`603e927`](https://github.com/mastra-ai/mastra/commit/603e9279db8bf8a46caf83881c6b7389ccffff7e), [`cd45982`](https://github.com/mastra-ai/mastra/commit/cd4598291cda128a88738734ae6cbef076ebdebd), [`874f74d`](https://github.com/mastra-ai/mastra/commit/874f74da4b1acf6517f18132d035612c3ecc394a), [`0baf2ba`](https://github.com/mastra-ai/mastra/commit/0baf2bab8420277072ef1f95df5ea7b0a2f61fe7), [`26e968d`](https://github.com/mastra-ai/mastra/commit/26e968db2171ded9e4d47aa1b4f19e1e771158d0), [`cbd3fb6`](https://github.com/mastra-ai/mastra/commit/cbd3fb65adb03a7c0df193cb998aed5ac56675ee)]:
|
|
19
|
+
- @mastra/core@0.20.1-alpha.1
|
|
20
|
+
|
|
3
21
|
## 0.15.1-alpha.0
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -790,6 +790,14 @@ var Agent = class extends BaseResource {
|
|
|
790
790
|
// but this is completely wrong and this fn is probably broken. Remove ":any" and you'll see a bunch of type errors
|
|
791
791
|
onChunk: async (chunk) => {
|
|
792
792
|
switch (chunk.type) {
|
|
793
|
+
case "tripwire": {
|
|
794
|
+
message.parts.push({
|
|
795
|
+
type: "text",
|
|
796
|
+
text: chunk.payload.tripwireReason
|
|
797
|
+
});
|
|
798
|
+
execUpdate();
|
|
799
|
+
break;
|
|
800
|
+
}
|
|
793
801
|
case "step-start": {
|
|
794
802
|
if (!replaceLastMessage) {
|
|
795
803
|
message.id = chunk.payload.messageId;
|
|
@@ -986,18 +994,17 @@ var Agent = class extends BaseResource {
|
|
|
986
994
|
streamForWritable.pipeTo(
|
|
987
995
|
new WritableStream({
|
|
988
996
|
async write(chunk) {
|
|
997
|
+
let writer;
|
|
989
998
|
try {
|
|
999
|
+
writer = writable.getWriter();
|
|
990
1000
|
const text = new TextDecoder().decode(chunk);
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1001
|
+
const lines = text.split("\n\n");
|
|
1002
|
+
const readableLines = lines.filter((line) => line !== "[DONE]").join("\n\n");
|
|
1003
|
+
await writer.write(new TextEncoder().encode(readableLines));
|
|
994
1004
|
} catch {
|
|
995
|
-
|
|
996
|
-
const writer = writable.getWriter();
|
|
997
|
-
try {
|
|
998
|
-
await writer.write(chunk);
|
|
1005
|
+
await writer?.write(chunk);
|
|
999
1006
|
} finally {
|
|
1000
|
-
writer
|
|
1007
|
+
writer?.releaseLock();
|
|
1001
1008
|
}
|
|
1002
1009
|
}
|
|
1003
1010
|
}),
|