@mastra/deployer-cloud 0.0.0-toolOptionTypes-20250917085558 → 0.0.0-usechat-duplicate-20251016110554

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 CHANGED
@@ -1,6 +1,330 @@
1
1
  # @mastra/deployer-cloud
2
2
 
3
- ## 0.0.0-toolOptionTypes-20250917085558
3
+ ## 0.0.0-usechat-duplicate-20251016110554
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`5253cd2`](https://github.com/mastra-ai/mastra/commit/5253cd2d5b2cf4558963fa73c6a6b36c72f8875f), [`ca85c93`](https://github.com/mastra-ai/mastra/commit/ca85c932b232e6ad820c811ec176d98e68c59b0a), [`a1d40f8`](https://github.com/mastra-ai/mastra/commit/a1d40f88d4ce42c4508774ad22e38ac582157af2), [`01c4a25`](https://github.com/mastra-ai/mastra/commit/01c4a2506c514d5e861c004d3d2fb3791c6391f3)]:
8
+ - @mastra/deployer@0.0.0-usechat-duplicate-20251016110554
9
+ - @mastra/core@0.0.0-usechat-duplicate-20251016110554
10
+ - @mastra/loggers@0.0.0-usechat-duplicate-20251016110554
11
+
12
+ ## 0.21.0
13
+
14
+ ### Patch Changes
15
+
16
+ - dependencies updates: ([#8635](https://github.com/mastra-ai/mastra/pull/8635))
17
+ - Updated dependency [`redis@^5.8.3` ↗︎](https://www.npmjs.com/package/redis/v/5.8.3) (from `^5.8.2`, in `dependencies`)
18
+
19
+ - Update peer dependencies to match core package version bump (0.21.0) ([#8619](https://github.com/mastra-ai/mastra/pull/8619))
20
+
21
+ - Update peer dependencies to match core package version bump (0.21.0) ([#8557](https://github.com/mastra-ai/mastra/pull/8557))
22
+
23
+ - Update peer dependencies to match core package version bump (0.21.0) ([#8626](https://github.com/mastra-ai/mastra/pull/8626))
24
+
25
+ - Update peer dependencies to match core package version bump (0.21.0) ([#8686](https://github.com/mastra-ai/mastra/pull/8686))
26
+
27
+ - Updated dependencies [[`0fb6616`](https://github.com/mastra-ai/mastra/commit/0fb66169600ed2a3dc1297b1bfa8a7693ebb6e3c), [`1ed9670`](https://github.com/mastra-ai/mastra/commit/1ed9670d3ca50cb60dc2e517738c5eef3968ed27), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`1dbd76a`](https://github.com/mastra-ai/mastra/commit/1dbd76aff29cc764d3a1ac7bb01172fe59cb5992), [`f59fc1e`](https://github.com/mastra-ai/mastra/commit/f59fc1e406b8912e692f6bff6cfd4754cc8d165c), [`ca5a01f`](https://github.com/mastra-ai/mastra/commit/ca5a01f0dd4dabdbfde3beeaf92c7333e0f9bb39), [`158381d`](https://github.com/mastra-ai/mastra/commit/158381d39335be934b81ef8a1947bccace492c25), [`a1799bc`](https://github.com/mastra-ai/mastra/commit/a1799bcc1b5a1cdc188f2ac0165f17a1c4ac6f7b), [`6ff6094`](https://github.com/mastra-ai/mastra/commit/6ff60946f4ecfebdeef6e21d2b230c2204f2c9b8), [`2ddb851`](https://github.com/mastra-ai/mastra/commit/2ddb8519c4b6f1d31be10ffd33b41d2b649a04ff), [`fb703b9`](https://github.com/mastra-ai/mastra/commit/fb703b9634eeaff1a6eb2b5531ce0f9e8fb04727), [`dfe856f`](https://github.com/mastra-ai/mastra/commit/dfe856f7f60ff4765b75930e7b5d82dd0f0f7d89), [`37a2314`](https://github.com/mastra-ai/mastra/commit/37a23148e0e5a3b40d4f9f098b194671a8a49faf), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`05a9dee`](https://github.com/mastra-ai/mastra/commit/05a9dee3d355694d28847bfffb6289657fcf7dfa), [`e3c1077`](https://github.com/mastra-ai/mastra/commit/e3c107763aedd1643d3def5df450c235da9ff76c), [`1908ca0`](https://github.com/mastra-ai/mastra/commit/1908ca0521f90e43779cc29ab590173ca560443c), [`1bccdb3`](https://github.com/mastra-ai/mastra/commit/1bccdb33eb90cbeba2dc5ece1c2561fb774b26b6), [`5ef944a`](https://github.com/mastra-ai/mastra/commit/5ef944a3721d93105675cac2b2311432ff8cc393), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`d6b186f`](https://github.com/mastra-ai/mastra/commit/d6b186fb08f1caf1b86f73d3a5ee88fb999ca3be), [`ee68e82`](https://github.com/mastra-ai/mastra/commit/ee68e8289ea4408d29849e899bc6e78b3bd4e843), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`ea33930`](https://github.com/mastra-ai/mastra/commit/ea339301e82d6318257720d811b043014ee44064), [`65493b3`](https://github.com/mastra-ai/mastra/commit/65493b31c36f6fdb78f9679f7e1ecf0c250aa5ee), [`a998b8f`](https://github.com/mastra-ai/mastra/commit/a998b8f858091c2ec47683e60766cf12d03001e4), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`8a37bdd`](https://github.com/mastra-ai/mastra/commit/8a37bddb6d8614a32c5b70303d583d80c620ea61), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`e0e1cf1`](https://github.com/mastra-ai/mastra/commit/e0e1cf1e37b9dc61099ab331a6d386e44b816310), [`135d6f2`](https://github.com/mastra-ai/mastra/commit/135d6f22a326ed1dffff858700669dff09d2c9eb)]:
28
+ - @mastra/deployer@0.21.0
29
+ - @mastra/core@0.21.0
30
+ - @mastra/loggers@0.10.16
31
+
32
+ ## 0.21.0-alpha.4
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [[`1908ca0`](https://github.com/mastra-ai/mastra/commit/1908ca0521f90e43779cc29ab590173ca560443c)]:
37
+ - @mastra/core@0.21.0-alpha.4
38
+ - @mastra/deployer@0.21.0-alpha.4
39
+
40
+ ## 0.21.0-alpha.3
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [[`a1799bc`](https://github.com/mastra-ai/mastra/commit/a1799bcc1b5a1cdc188f2ac0165f17a1c4ac6f7b), [`6ff6094`](https://github.com/mastra-ai/mastra/commit/6ff60946f4ecfebdeef6e21d2b230c2204f2c9b8)]:
45
+ - @mastra/core@0.21.0-alpha.3
46
+ - @mastra/deployer@0.21.0-alpha.3
47
+
48
+ ## 0.21.0-alpha.2
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [[`f59fc1e`](https://github.com/mastra-ai/mastra/commit/f59fc1e406b8912e692f6bff6cfd4754cc8d165c)]:
53
+ - @mastra/core@0.21.0-alpha.2
54
+ - @mastra/deployer@0.21.0-alpha.2
55
+
56
+ ## 0.21.0-alpha.1
57
+
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies [[`1ed9670`](https://github.com/mastra-ai/mastra/commit/1ed9670d3ca50cb60dc2e517738c5eef3968ed27), [`ca5a01f`](https://github.com/mastra-ai/mastra/commit/ca5a01f0dd4dabdbfde3beeaf92c7333e0f9bb39), [`158381d`](https://github.com/mastra-ai/mastra/commit/158381d39335be934b81ef8a1947bccace492c25), [`fb703b9`](https://github.com/mastra-ai/mastra/commit/fb703b9634eeaff1a6eb2b5531ce0f9e8fb04727), [`dfe856f`](https://github.com/mastra-ai/mastra/commit/dfe856f7f60ff4765b75930e7b5d82dd0f0f7d89), [`37a2314`](https://github.com/mastra-ai/mastra/commit/37a23148e0e5a3b40d4f9f098b194671a8a49faf), [`05a9dee`](https://github.com/mastra-ai/mastra/commit/05a9dee3d355694d28847bfffb6289657fcf7dfa), [`e3c1077`](https://github.com/mastra-ai/mastra/commit/e3c107763aedd1643d3def5df450c235da9ff76c), [`1bccdb3`](https://github.com/mastra-ai/mastra/commit/1bccdb33eb90cbeba2dc5ece1c2561fb774b26b6), [`5ef944a`](https://github.com/mastra-ai/mastra/commit/5ef944a3721d93105675cac2b2311432ff8cc393), [`d6b186f`](https://github.com/mastra-ai/mastra/commit/d6b186fb08f1caf1b86f73d3a5ee88fb999ca3be), [`65493b3`](https://github.com/mastra-ai/mastra/commit/65493b31c36f6fdb78f9679f7e1ecf0c250aa5ee), [`a998b8f`](https://github.com/mastra-ai/mastra/commit/a998b8f858091c2ec47683e60766cf12d03001e4), [`8a37bdd`](https://github.com/mastra-ai/mastra/commit/8a37bddb6d8614a32c5b70303d583d80c620ea61), [`e0e1cf1`](https://github.com/mastra-ai/mastra/commit/e0e1cf1e37b9dc61099ab331a6d386e44b816310)]:
61
+ - @mastra/core@0.21.0-alpha.1
62
+ - @mastra/deployer@0.21.0-alpha.1
63
+
64
+ ## 0.21.0-alpha.0
65
+
66
+ ### Patch Changes
67
+
68
+ - dependencies updates: ([#8635](https://github.com/mastra-ai/mastra/pull/8635))
69
+ - Updated dependency [`redis@^5.8.3` ↗︎](https://www.npmjs.com/package/redis/v/5.8.3) (from `^5.8.2`, in `dependencies`)
70
+
71
+ - Update peer dependencies to match core package version bump (0.21.0) ([#8619](https://github.com/mastra-ai/mastra/pull/8619))
72
+
73
+ - Update peer dependencies to match core package version bump (0.21.0) ([#8557](https://github.com/mastra-ai/mastra/pull/8557))
74
+
75
+ - Update peer dependencies to match core package version bump (0.21.0) ([#8626](https://github.com/mastra-ai/mastra/pull/8626))
76
+
77
+ - Update peer dependencies to match core package version bump (0.21.0) ([#8686](https://github.com/mastra-ai/mastra/pull/8686))
78
+
79
+ - Updated dependencies [[`0fb6616`](https://github.com/mastra-ai/mastra/commit/0fb66169600ed2a3dc1297b1bfa8a7693ebb6e3c), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`1dbd76a`](https://github.com/mastra-ai/mastra/commit/1dbd76aff29cc764d3a1ac7bb01172fe59cb5992), [`2ddb851`](https://github.com/mastra-ai/mastra/commit/2ddb8519c4b6f1d31be10ffd33b41d2b649a04ff), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`ee68e82`](https://github.com/mastra-ai/mastra/commit/ee68e8289ea4408d29849e899bc6e78b3bd4e843), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`ea33930`](https://github.com/mastra-ai/mastra/commit/ea339301e82d6318257720d811b043014ee44064), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`135d6f2`](https://github.com/mastra-ai/mastra/commit/135d6f22a326ed1dffff858700669dff09d2c9eb), [`59d036d`](https://github.com/mastra-ai/mastra/commit/59d036d4c2706b430b0e3f1f1e0ee853ce16ca04)]:
80
+ - @mastra/deployer@0.21.0-alpha.0
81
+ - @mastra/core@0.21.0-alpha.0
82
+ - @mastra/loggers@0.10.16-alpha.0
83
+
84
+ ## 0.20.2
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [[`07eaf25`](https://github.com/mastra-ai/mastra/commit/07eaf25aada9e42235dbf905854de53da4d8121b), [`0d71771`](https://github.com/mastra-ai/mastra/commit/0d71771f5711164c79f8e80919bc84d6bffeb6bc), [`0d6e55e`](https://github.com/mastra-ai/mastra/commit/0d6e55ecc5a2e689cd4fc9c86525e0eb54d82372), [`68b1111`](https://github.com/mastra-ai/mastra/commit/68b11118a1303f93e9c0c157850c0751309304c5)]:
89
+ - @mastra/core@0.20.2
90
+ - @mastra/deployer@0.20.2
91
+
92
+ ## 0.20.2-alpha.1
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies [[`07eaf25`](https://github.com/mastra-ai/mastra/commit/07eaf25aada9e42235dbf905854de53da4d8121b), [`68b1111`](https://github.com/mastra-ai/mastra/commit/68b11118a1303f93e9c0c157850c0751309304c5)]:
97
+ - @mastra/core@0.20.2-alpha.1
98
+ - @mastra/deployer@0.20.2-alpha.1
99
+
100
+ ## 0.20.2-alpha.0
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [[`0d71771`](https://github.com/mastra-ai/mastra/commit/0d71771f5711164c79f8e80919bc84d6bffeb6bc), [`0d6e55e`](https://github.com/mastra-ai/mastra/commit/0d6e55ecc5a2e689cd4fc9c86525e0eb54d82372)]:
105
+ - @mastra/core@0.20.2-alpha.0
106
+ - @mastra/deployer@0.20.2-alpha.0
107
+
108
+ ## 0.20.1
109
+
110
+ ### Patch Changes
111
+
112
+ - Mutable shared workflow run state ([#8545](https://github.com/mastra-ai/mastra/pull/8545))
113
+
114
+ - Add dynamic creation of peerdeps ([#8582](https://github.com/mastra-ai/mastra/pull/8582))
115
+
116
+ - Updated dependencies [[`c621613`](https://github.com/mastra-ai/mastra/commit/c621613069173c69eb2c3ef19a5308894c6549f0), [`ee17cec`](https://github.com/mastra-ai/mastra/commit/ee17cec065f4454740c9cc8f8a841027a5990f57), [`12b1189`](https://github.com/mastra-ai/mastra/commit/12b118942445e4de0dd916c593e33ec78dc3bc73), [`42ffed3`](https://github.com/mastra-ai/mastra/commit/42ffed311b9d8750652bbc55c773be62c989fcc6), [`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), [`ee9108f`](https://github.com/mastra-ai/mastra/commit/ee9108fa29bb8368fc23df158c9f0645b2d7b65c), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`a739d0c`](https://github.com/mastra-ai/mastra/commit/a739d0c8b37cd89569e04a6ca0827083c6167e19), [`a9c4cb7`](https://github.com/mastra-ai/mastra/commit/a9c4cb7d6a35de23ca51066f166a66e0e4cca418), [`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), [`b728a45`](https://github.com/mastra-ai/mastra/commit/b728a45ab3dba59da0f5ee36b81fe246659f305d), [`0baf2ba`](https://github.com/mastra-ai/mastra/commit/0baf2bab8420277072ef1f95df5ea7b0a2f61fe7), [`10e633a`](https://github.com/mastra-ai/mastra/commit/10e633a07d333466d9734c97acfc3dbf757ad2d0), [`a6d69c5`](https://github.com/mastra-ai/mastra/commit/a6d69c5fb50c0875b46275811fece5862f03c6a0), [`84199af`](https://github.com/mastra-ai/mastra/commit/84199af8673f6f9cb59286ffb5477a41932775de), [`7f431af`](https://github.com/mastra-ai/mastra/commit/7f431afd586b7d3265075e73106eb73167edbb86), [`26e968d`](https://github.com/mastra-ai/mastra/commit/26e968db2171ded9e4d47aa1b4f19e1e771158d0), [`cbd3fb6`](https://github.com/mastra-ai/mastra/commit/cbd3fb65adb03a7c0df193cb998aed5ac56675ee)]:
117
+ - @mastra/core@0.20.1
118
+ - @mastra/deployer@0.20.1
119
+
120
+ ## 0.20.1-alpha.4
121
+
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies [[`b728a45`](https://github.com/mastra-ai/mastra/commit/b728a45ab3dba59da0f5ee36b81fe246659f305d)]:
125
+ - @mastra/core@0.20.1-alpha.4
126
+ - @mastra/deployer@0.20.1-alpha.4
127
+
128
+ ## 0.20.1-alpha.3
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies [[`a6d69c5`](https://github.com/mastra-ai/mastra/commit/a6d69c5fb50c0875b46275811fece5862f03c6a0), [`84199af`](https://github.com/mastra-ai/mastra/commit/84199af8673f6f9cb59286ffb5477a41932775de), [`7f431af`](https://github.com/mastra-ai/mastra/commit/7f431afd586b7d3265075e73106eb73167edbb86)]:
133
+ - @mastra/core@0.20.1-alpha.3
134
+ - @mastra/deployer@0.20.1-alpha.3
135
+
136
+ ## 0.20.1-alpha.2
137
+
138
+ ### Patch Changes
139
+
140
+ - Updated dependencies [[`42ffed3`](https://github.com/mastra-ai/mastra/commit/42ffed311b9d8750652bbc55c773be62c989fcc6), [`ee9108f`](https://github.com/mastra-ai/mastra/commit/ee9108fa29bb8368fc23df158c9f0645b2d7b65c)]:
141
+ - @mastra/deployer@0.20.1-alpha.2
142
+ - @mastra/core@0.20.1-alpha.2
143
+
144
+ ## 0.20.1-alpha.1
145
+
146
+ ### Patch Changes
147
+
148
+ - Mutable shared workflow run state ([#8545](https://github.com/mastra-ai/mastra/pull/8545))
149
+
150
+ - Add dynamic creation of peerdeps ([#8582](https://github.com/mastra-ai/mastra/pull/8582))
151
+
152
+ - Updated dependencies [[`c621613`](https://github.com/mastra-ai/mastra/commit/c621613069173c69eb2c3ef19a5308894c6549f0), [`ee17cec`](https://github.com/mastra-ai/mastra/commit/ee17cec065f4454740c9cc8f8a841027a5990f57), [`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), [`a9c4cb7`](https://github.com/mastra-ai/mastra/commit/a9c4cb7d6a35de23ca51066f166a66e0e4cca418), [`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)]:
153
+ - @mastra/core@0.20.1-alpha.1
154
+ - @mastra/deployer@0.20.1-alpha.1
155
+
156
+ ## 0.20.1-alpha.0
157
+
158
+ ### Patch Changes
159
+
160
+ - Updated dependencies [[`10e633a`](https://github.com/mastra-ai/mastra/commit/10e633a07d333466d9734c97acfc3dbf757ad2d0)]:
161
+ - @mastra/core@0.20.1-alpha.0
162
+ - @mastra/deployer@0.20.1-alpha.0
163
+
164
+ ## 0.20.0
165
+
166
+ ### Patch Changes
167
+
168
+ - Creates a playground specific auth token ([#8420](https://github.com/mastra-ai/mastra/pull/8420))
169
+
170
+ - Breaking change to move the agent.streamVNext/generateVNext implementation to the default stream/generate. The old stream/generate have now been moved to streamLegacy and generateLegacy ([#8097](https://github.com/mastra-ai/mastra/pull/8097))
171
+
172
+ - Bump cloud deployer external mastra deps ([#8363](https://github.com/mastra-ai/mastra/pull/8363))
173
+
174
+ - Updated dependencies [[`00cb6bd`](https://github.com/mastra-ai/mastra/commit/00cb6bdf78737c0fac14a5a0c7b532a11e38558a), [`869ba22`](https://github.com/mastra-ai/mastra/commit/869ba222e1d6b58fc1b65e7c9fd55ca4e01b8c2f), [`1b73665`](https://github.com/mastra-ai/mastra/commit/1b73665e8e23f5c09d49fcf3e7d709c75259259e), [`989a4db`](https://github.com/mastra-ai/mastra/commit/989a4dbbaf07a2794d0e1863714c6d10f1244d6b), [`f7d7475`](https://github.com/mastra-ai/mastra/commit/f7d747507341aef60ed39e4b49318db1f86034a6), [`084b77b`](https://github.com/mastra-ai/mastra/commit/084b77b2955960e0190af8db3f77138aa83ed65c), [`a93ff84`](https://github.com/mastra-ai/mastra/commit/a93ff84b5e1af07ee236ac8873dac9b49aa5d501), [`bc5aacb`](https://github.com/mastra-ai/mastra/commit/bc5aacb646d468d325327e36117129f28cd13bf6), [`6b5af12`](https://github.com/mastra-ai/mastra/commit/6b5af12ce9e09066e0c32e821c203a6954498bea), [`bf60e4a`](https://github.com/mastra-ai/mastra/commit/bf60e4a89c515afd9570b7b79f33b95e7d07c397), [`d41aee5`](https://github.com/mastra-ai/mastra/commit/d41aee526d124e35f42720a08e64043229193679), [`e8fe13c`](https://github.com/mastra-ai/mastra/commit/e8fe13c4b4c255a42520127797ec394310f7c919), [`3ca833d`](https://github.com/mastra-ai/mastra/commit/3ca833dc994c38e3c9b4f9b4478a61cd8e07b32a), [`1edb8d1`](https://github.com/mastra-ai/mastra/commit/1edb8d1cfb963e72a12412990fb9170936c9904c), [`fbf6e32`](https://github.com/mastra-ai/mastra/commit/fbf6e324946332d0f5ed8930bf9d4d4479cefd7a), [`4753027`](https://github.com/mastra-ai/mastra/commit/4753027ee889288775c6958bdfeda03ff909af67)]:
175
+ - @mastra/core@0.20.0
176
+ - @mastra/deployer@0.20.0
177
+ - @mastra/loggers@0.10.15
178
+
179
+ ## 0.20.0-alpha.0
180
+
181
+ ### Patch Changes
182
+
183
+ - Creates a playground specific auth token ([#8420](https://github.com/mastra-ai/mastra/pull/8420))
184
+
185
+ - Breaking change to move the agent.streamVNext/generateVNext implementation to the default stream/generate. The old stream/generate have now been moved to streamLegacy and generateLegacy ([#8097](https://github.com/mastra-ai/mastra/pull/8097))
186
+
187
+ - Bump cloud deployer external mastra deps ([#8363](https://github.com/mastra-ai/mastra/pull/8363))
188
+
189
+ - Updated dependencies [[`00cb6bd`](https://github.com/mastra-ai/mastra/commit/00cb6bdf78737c0fac14a5a0c7b532a11e38558a), [`869ba22`](https://github.com/mastra-ai/mastra/commit/869ba222e1d6b58fc1b65e7c9fd55ca4e01b8c2f), [`1b73665`](https://github.com/mastra-ai/mastra/commit/1b73665e8e23f5c09d49fcf3e7d709c75259259e), [`989a4db`](https://github.com/mastra-ai/mastra/commit/989a4dbbaf07a2794d0e1863714c6d10f1244d6b), [`f7d7475`](https://github.com/mastra-ai/mastra/commit/f7d747507341aef60ed39e4b49318db1f86034a6), [`084b77b`](https://github.com/mastra-ai/mastra/commit/084b77b2955960e0190af8db3f77138aa83ed65c), [`a93ff84`](https://github.com/mastra-ai/mastra/commit/a93ff84b5e1af07ee236ac8873dac9b49aa5d501), [`bc5aacb`](https://github.com/mastra-ai/mastra/commit/bc5aacb646d468d325327e36117129f28cd13bf6), [`6b5af12`](https://github.com/mastra-ai/mastra/commit/6b5af12ce9e09066e0c32e821c203a6954498bea), [`bf60e4a`](https://github.com/mastra-ai/mastra/commit/bf60e4a89c515afd9570b7b79f33b95e7d07c397), [`d41aee5`](https://github.com/mastra-ai/mastra/commit/d41aee526d124e35f42720a08e64043229193679), [`e8fe13c`](https://github.com/mastra-ai/mastra/commit/e8fe13c4b4c255a42520127797ec394310f7c919), [`3ca833d`](https://github.com/mastra-ai/mastra/commit/3ca833dc994c38e3c9b4f9b4478a61cd8e07b32a), [`1edb8d1`](https://github.com/mastra-ai/mastra/commit/1edb8d1cfb963e72a12412990fb9170936c9904c), [`fbf6e32`](https://github.com/mastra-ai/mastra/commit/fbf6e324946332d0f5ed8930bf9d4d4479cefd7a), [`4753027`](https://github.com/mastra-ai/mastra/commit/4753027ee889288775c6958bdfeda03ff909af67)]:
190
+ - @mastra/core@0.20.0-alpha.0
191
+ - @mastra/deployer@0.20.0-alpha.0
192
+ - @mastra/loggers@0.10.15-alpha.0
193
+
194
+ ## 0.19.1
195
+
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [[`4a70ccc`](https://github.com/mastra-ai/mastra/commit/4a70ccc5cfa12ae9c2b36545a5814cd98e5a0ead), [`0992b8b`](https://github.com/mastra-ai/mastra/commit/0992b8bf0f4f1ba7ad9940883ec4bb8d867d3105), [`283bea0`](https://github.com/mastra-ai/mastra/commit/283bea07adbaf04a27fa3ad2df611095e0825195)]:
199
+ - @mastra/core@0.19.1
200
+ - @mastra/deployer@0.19.1
201
+
202
+ ## 0.19.1-alpha.1
203
+
204
+ ### Patch Changes
205
+
206
+ - Updated dependencies [[`4a70ccc`](https://github.com/mastra-ai/mastra/commit/4a70ccc5cfa12ae9c2b36545a5814cd98e5a0ead)]:
207
+ - @mastra/core@0.19.1-alpha.1
208
+ - @mastra/deployer@0.19.1-alpha.1
209
+
210
+ ## 0.19.1-alpha.0
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [[`0992b8b`](https://github.com/mastra-ai/mastra/commit/0992b8bf0f4f1ba7ad9940883ec4bb8d867d3105), [`283bea0`](https://github.com/mastra-ai/mastra/commit/283bea07adbaf04a27fa3ad2df611095e0825195)]:
215
+ - @mastra/deployer@0.19.1-alpha.0
216
+ - @mastra/core@0.19.1-alpha.0
217
+
218
+ ## 0.19.0
219
+
220
+ ### Patch Changes
221
+
222
+ - Update peer deps ([#8154](https://github.com/mastra-ai/mastra/pull/8154))
223
+
224
+ - Fix peer deps ([#8134](https://github.com/mastra-ai/mastra/pull/8134))
225
+
226
+ - Update peer deps ([#8276](https://github.com/mastra-ai/mastra/pull/8276))
227
+
228
+ - Updated dependencies [[`5089c84`](https://github.com/mastra-ai/mastra/commit/5089c84a2f535ad12e79b5aa524ad7d8ca5e2b4c), [`5c98f03`](https://github.com/mastra-ai/mastra/commit/5c98f03ae76d9a93cd6be206b4abb7bf186b3163), [`dc099b4`](https://github.com/mastra-ai/mastra/commit/dc099b40fb31147ba3f362f98d991892033c4c67), [`57b75b0`](https://github.com/mastra-ai/mastra/commit/57b75b01c0c64d91c50d7384c700afda89456fe8), [`4c5e65d`](https://github.com/mastra-ai/mastra/commit/4c5e65de746fbdab23eb6072cb999f4c7aeef9f3), [`504438b`](https://github.com/mastra-ai/mastra/commit/504438b961bde211071186bba63a842c4e3db879), [`57b6dd5`](https://github.com/mastra-ai/mastra/commit/57b6dd50f9e6d92c0ed3e7199e6a92752025e3a1), [`b342a68`](https://github.com/mastra-ai/mastra/commit/b342a68e1399cf1ece9ba11bda112db89d21118c), [`a7243e2`](https://github.com/mastra-ai/mastra/commit/a7243e2e58762667a6e3921e755e89d6bb0a3282), [`504438b`](https://github.com/mastra-ai/mastra/commit/504438b961bde211071186bba63a842c4e3db879), [`7fceb0a`](https://github.com/mastra-ai/mastra/commit/7fceb0a327d678e812f90f5387c5bc4f38bd039e), [`303a9c0`](https://github.com/mastra-ai/mastra/commit/303a9c0d7dd58795915979f06a0512359e4532fb), [`df64f9e`](https://github.com/mastra-ai/mastra/commit/df64f9ef814916fff9baedd861c988084e7c41de), [`370f8a6`](https://github.com/mastra-ai/mastra/commit/370f8a6480faec70fef18d72e5f7538f27004301), [`809eea0`](https://github.com/mastra-ai/mastra/commit/809eea092fa80c3f69b9eaf078d843b57fd2a88e), [`683e5a1`](https://github.com/mastra-ai/mastra/commit/683e5a1466e48b686825b2c11f84680f296138e4), [`3679378`](https://github.com/mastra-ai/mastra/commit/3679378673350aa314741dc826f837b1984149bc), [`7775bc2`](https://github.com/mastra-ai/mastra/commit/7775bc20bb1ad1ab24797fb420e4f96c65b0d8ec), [`623ffaf`](https://github.com/mastra-ai/mastra/commit/623ffaf2d969e11e99a0224633cf7b5a0815c857), [`9fc1613`](https://github.com/mastra-ai/mastra/commit/9fc16136400186648880fd990119ac15f7c02ee4), [`61f62aa`](https://github.com/mastra-ai/mastra/commit/61f62aa31bc88fe4ddf8da6240dbcfbeb07358bd), [`db1891a`](https://github.com/mastra-ai/mastra/commit/db1891a4707443720b7cd8a260dc7e1d49b3609c), [`e8f379d`](https://github.com/mastra-ai/mastra/commit/e8f379d390efa264c4e0874f9ac0cf8839b07777), [`652066b`](https://github.com/mastra-ai/mastra/commit/652066bd1efc6bb6813ba950ed1d7573e8b7d9d4), [`3e292ba`](https://github.com/mastra-ai/mastra/commit/3e292ba00837886d5d68a34cbc0d9b703c991883), [`418c136`](https://github.com/mastra-ai/mastra/commit/418c1366843d88e491bca3f87763899ce855ca29), [`ea8d386`](https://github.com/mastra-ai/mastra/commit/ea8d386cd8c5593664515fd5770c06bf2aa980ef), [`67b0f00`](https://github.com/mastra-ai/mastra/commit/67b0f005b520335c71fb85cbaa25df4ce8484a81), [`c2a4919`](https://github.com/mastra-ai/mastra/commit/c2a4919ba6797d8bdb1509e02287496eef69303e), [`c84b7d0`](https://github.com/mastra-ai/mastra/commit/c84b7d093c4657772140cbfd2b15ef72f3315ed5), [`6f67656`](https://github.com/mastra-ai/mastra/commit/6f676562276926e2982401574d1e07157579be30), [`0130986`](https://github.com/mastra-ai/mastra/commit/0130986fc62d0edcc626dd593282661dbb9af141), [`5dc8e9a`](https://github.com/mastra-ai/mastra/commit/5dc8e9a7f8472298cd3d4e8a0cf6d265529f287d)]:
229
+ - @mastra/deployer@0.19.0
230
+ - @mastra/core@0.19.0
231
+ - @mastra/loggers@0.10.14
232
+
233
+ ## 0.19.0-alpha.1
234
+
235
+ ### Patch Changes
236
+
237
+ - Update peer deps ([#8154](https://github.com/mastra-ai/mastra/pull/8154))
238
+
239
+ - Fix peer deps ([#8134](https://github.com/mastra-ai/mastra/pull/8134))
240
+
241
+ - Update peer deps ([#8276](https://github.com/mastra-ai/mastra/pull/8276))
242
+
243
+ - Updated dependencies [[`5089c84`](https://github.com/mastra-ai/mastra/commit/5089c84a2f535ad12e79b5aa524ad7d8ca5e2b4c), [`5c98f03`](https://github.com/mastra-ai/mastra/commit/5c98f03ae76d9a93cd6be206b4abb7bf186b3163), [`57b75b0`](https://github.com/mastra-ai/mastra/commit/57b75b01c0c64d91c50d7384c700afda89456fe8), [`4c5e65d`](https://github.com/mastra-ai/mastra/commit/4c5e65de746fbdab23eb6072cb999f4c7aeef9f3), [`504438b`](https://github.com/mastra-ai/mastra/commit/504438b961bde211071186bba63a842c4e3db879), [`57b6dd5`](https://github.com/mastra-ai/mastra/commit/57b6dd50f9e6d92c0ed3e7199e6a92752025e3a1), [`a7243e2`](https://github.com/mastra-ai/mastra/commit/a7243e2e58762667a6e3921e755e89d6bb0a3282), [`504438b`](https://github.com/mastra-ai/mastra/commit/504438b961bde211071186bba63a842c4e3db879), [`7fceb0a`](https://github.com/mastra-ai/mastra/commit/7fceb0a327d678e812f90f5387c5bc4f38bd039e), [`df64f9e`](https://github.com/mastra-ai/mastra/commit/df64f9ef814916fff9baedd861c988084e7c41de), [`809eea0`](https://github.com/mastra-ai/mastra/commit/809eea092fa80c3f69b9eaf078d843b57fd2a88e), [`683e5a1`](https://github.com/mastra-ai/mastra/commit/683e5a1466e48b686825b2c11f84680f296138e4), [`3679378`](https://github.com/mastra-ai/mastra/commit/3679378673350aa314741dc826f837b1984149bc), [`7775bc2`](https://github.com/mastra-ai/mastra/commit/7775bc20bb1ad1ab24797fb420e4f96c65b0d8ec), [`db1891a`](https://github.com/mastra-ai/mastra/commit/db1891a4707443720b7cd8a260dc7e1d49b3609c), [`e8f379d`](https://github.com/mastra-ai/mastra/commit/e8f379d390efa264c4e0874f9ac0cf8839b07777), [`652066b`](https://github.com/mastra-ai/mastra/commit/652066bd1efc6bb6813ba950ed1d7573e8b7d9d4), [`ea8d386`](https://github.com/mastra-ai/mastra/commit/ea8d386cd8c5593664515fd5770c06bf2aa980ef), [`c2a4919`](https://github.com/mastra-ai/mastra/commit/c2a4919ba6797d8bdb1509e02287496eef69303e), [`6f67656`](https://github.com/mastra-ai/mastra/commit/6f676562276926e2982401574d1e07157579be30), [`0130986`](https://github.com/mastra-ai/mastra/commit/0130986fc62d0edcc626dd593282661dbb9af141), [`5dc8e9a`](https://github.com/mastra-ai/mastra/commit/5dc8e9a7f8472298cd3d4e8a0cf6d265529f287d)]:
244
+ - @mastra/deployer@0.19.0-alpha.1
245
+ - @mastra/core@0.19.0-alpha.1
246
+ - @mastra/loggers@0.10.14-alpha.0
247
+
248
+ ## 0.18.1-alpha.0
249
+
250
+ ### Patch Changes
251
+
252
+ - Updated dependencies [[`dc099b4`](https://github.com/mastra-ai/mastra/commit/dc099b40fb31147ba3f362f98d991892033c4c67), [`b342a68`](https://github.com/mastra-ai/mastra/commit/b342a68e1399cf1ece9ba11bda112db89d21118c), [`303a9c0`](https://github.com/mastra-ai/mastra/commit/303a9c0d7dd58795915979f06a0512359e4532fb), [`370f8a6`](https://github.com/mastra-ai/mastra/commit/370f8a6480faec70fef18d72e5f7538f27004301), [`623ffaf`](https://github.com/mastra-ai/mastra/commit/623ffaf2d969e11e99a0224633cf7b5a0815c857), [`9fc1613`](https://github.com/mastra-ai/mastra/commit/9fc16136400186648880fd990119ac15f7c02ee4), [`61f62aa`](https://github.com/mastra-ai/mastra/commit/61f62aa31bc88fe4ddf8da6240dbcfbeb07358bd), [`3e292ba`](https://github.com/mastra-ai/mastra/commit/3e292ba00837886d5d68a34cbc0d9b703c991883), [`418c136`](https://github.com/mastra-ai/mastra/commit/418c1366843d88e491bca3f87763899ce855ca29), [`c84b7d0`](https://github.com/mastra-ai/mastra/commit/c84b7d093c4657772140cbfd2b15ef72f3315ed5)]:
253
+ - @mastra/core@0.18.1-alpha.0
254
+ - @mastra/deployer@0.18.1-alpha.0
255
+
256
+ ## 0.18.0
257
+
258
+ ### Patch Changes
259
+
260
+ - dependencies updates: ([#8007](https://github.com/mastra-ai/mastra/pull/8007))
261
+ - Updated dependency [`fs-extra@^11.3.2` ↗︎](https://www.npmjs.com/package/fs-extra/v/11.3.2) (from `^11.3.1`, in `dependencies`)
262
+
263
+ - feat: implement trace scoring with batch processing capabilities ([#8033](https://github.com/mastra-ai/mastra/pull/8033))
264
+
265
+ - Update Peerdeps for packages based on core minor bump ([#8025](https://github.com/mastra-ai/mastra/pull/8025))
266
+
267
+ - Updated dependencies [[`288745a`](https://github.com/mastra-ai/mastra/commit/288745a19aa9557db3ab3c877d667ff59f14d79c), [`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`a61f23f`](https://github.com/mastra-ai/mastra/commit/a61f23fbbca4b88b763d94f1d784c47895ed72d7), [`4b339b8`](https://github.com/mastra-ai/mastra/commit/4b339b8141c20d6a6d80583c7e8c5c05d8c19492), [`8f56160`](https://github.com/mastra-ai/mastra/commit/8f56160fd45c740076529148b9c225f6842d43b0), [`d1dc606`](https://github.com/mastra-ai/mastra/commit/d1dc6067b0557a71190b68d56ee15b48c26d2411), [`2d29ad9`](https://github.com/mastra-ai/mastra/commit/2d29ad92763cac02fc1d80c221ac93c39c0c5caf), [`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55), [`d3bd4d4`](https://github.com/mastra-ai/mastra/commit/d3bd4d482a685bbb67bfa89be91c90dca3fa71ad), [`c591dfc`](https://github.com/mastra-ai/mastra/commit/c591dfc1e600fae1dedffe239357d250e146378f), [`1920c5c`](https://github.com/mastra-ai/mastra/commit/1920c5c6d666f687785c73021196aa551e579e0d), [`b6a3b65`](https://github.com/mastra-ai/mastra/commit/b6a3b65d830fa0ca7754ad6481661d1f2c878f21), [`af3abb6`](https://github.com/mastra-ai/mastra/commit/af3abb6f7c7585d856e22d27f4e7d2ece2186b9a), [`5b1ee71`](https://github.com/mastra-ai/mastra/commit/5b1ee71dc3ac92383226dc1e375642ca5f9b4224), [`282379f`](https://github.com/mastra-ai/mastra/commit/282379fafed80c6417fe1e791087110decd481ca)]:
268
+ - @mastra/deployer@0.18.0
269
+ - @mastra/core@0.18.0
270
+ - @mastra/loggers@0.10.13
271
+
272
+ ## 0.18.0-alpha.3
273
+
274
+ ### Patch Changes
275
+
276
+ - feat: implement trace scoring with batch processing capabilities ([#8033](https://github.com/mastra-ai/mastra/pull/8033))
277
+
278
+ - Updated dependencies [[`4b339b8`](https://github.com/mastra-ai/mastra/commit/4b339b8141c20d6a6d80583c7e8c5c05d8c19492), [`8f56160`](https://github.com/mastra-ai/mastra/commit/8f56160fd45c740076529148b9c225f6842d43b0), [`c591dfc`](https://github.com/mastra-ai/mastra/commit/c591dfc1e600fae1dedffe239357d250e146378f), [`1920c5c`](https://github.com/mastra-ai/mastra/commit/1920c5c6d666f687785c73021196aa551e579e0d), [`b6a3b65`](https://github.com/mastra-ai/mastra/commit/b6a3b65d830fa0ca7754ad6481661d1f2c878f21), [`af3abb6`](https://github.com/mastra-ai/mastra/commit/af3abb6f7c7585d856e22d27f4e7d2ece2186b9a), [`282379f`](https://github.com/mastra-ai/mastra/commit/282379fafed80c6417fe1e791087110decd481ca)]:
279
+ - @mastra/core@0.18.0-alpha.3
280
+ - @mastra/deployer@0.18.0-alpha.3
281
+
282
+ ## 0.18.0-alpha.2
283
+
284
+ ### Patch Changes
285
+
286
+ - Update Peerdeps for packages based on core minor bump ([#8025](https://github.com/mastra-ai/mastra/pull/8025))
287
+
288
+ - Updated dependencies [[`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`2d29ad9`](https://github.com/mastra-ai/mastra/commit/2d29ad92763cac02fc1d80c221ac93c39c0c5caf), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55), [`5b1ee71`](https://github.com/mastra-ai/mastra/commit/5b1ee71dc3ac92383226dc1e375642ca5f9b4224)]:
289
+ - @mastra/core@0.18.0-alpha.2
290
+ - @mastra/deployer@0.18.0-alpha.2
291
+ - @mastra/loggers@0.10.13-alpha.0
292
+
293
+ ## 0.17.2-alpha.1
294
+
295
+ ### Patch Changes
296
+
297
+ - dependencies updates: ([#8007](https://github.com/mastra-ai/mastra/pull/8007))
298
+ - Updated dependency [`fs-extra@^11.3.2` ↗︎](https://www.npmjs.com/package/fs-extra/v/11.3.2) (from `^11.3.1`, in `dependencies`)
299
+ - Updated dependencies [[`288745a`](https://github.com/mastra-ai/mastra/commit/288745a19aa9557db3ab3c877d667ff59f14d79c), [`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb)]:
300
+ - @mastra/deployer@0.17.2-alpha.1
301
+ - @mastra/core@0.17.2-alpha.1
302
+
303
+ ## 0.17.2-alpha.0
304
+
305
+ ### Patch Changes
306
+
307
+ - Updated dependencies [[`a61f23f`](https://github.com/mastra-ai/mastra/commit/a61f23fbbca4b88b763d94f1d784c47895ed72d7), [`d1dc606`](https://github.com/mastra-ai/mastra/commit/d1dc6067b0557a71190b68d56ee15b48c26d2411), [`d3bd4d4`](https://github.com/mastra-ai/mastra/commit/d3bd4d482a685bbb67bfa89be91c90dca3fa71ad)]:
308
+ - @mastra/core@0.17.2-alpha.0
309
+ - @mastra/deployer@0.17.2-alpha.0
310
+
311
+ ## 0.17.1
312
+
313
+ ### Patch Changes
314
+
315
+ - Updated dependencies [[`fd00e63`](https://github.com/mastra-ai/mastra/commit/fd00e63759cbcca3473c40cac9843280b0557cff), [`ab610f6`](https://github.com/mastra-ai/mastra/commit/ab610f6f41dbfe6c9502368671485ca7a0aac09b), [`e6bda5f`](https://github.com/mastra-ai/mastra/commit/e6bda5f954ee8493ea18adc1a883f0a5b785ad9b)]:
316
+ - @mastra/core@0.17.1
317
+ - @mastra/deployer@0.17.1
318
+
319
+ ## 0.17.1-alpha.0
320
+
321
+ ### Patch Changes
322
+
323
+ - Updated dependencies [[`fd00e63`](https://github.com/mastra-ai/mastra/commit/fd00e63759cbcca3473c40cac9843280b0557cff), [`ab610f6`](https://github.com/mastra-ai/mastra/commit/ab610f6f41dbfe6c9502368671485ca7a0aac09b), [`e6bda5f`](https://github.com/mastra-ai/mastra/commit/e6bda5f954ee8493ea18adc1a883f0a5b785ad9b)]:
324
+ - @mastra/core@0.17.1-alpha.0
325
+ - @mastra/deployer@0.17.1-alpha.0
326
+
327
+ ## 0.17.0
4
328
 
5
329
  ### Minor Changes
6
330
 
@@ -19,10 +343,35 @@
19
343
 
20
344
  - Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
21
345
 
22
- - Updated dependencies [[`b1c155b`](https://github.com/mastra-ai/mastra/commit/b1c155b57ce702674f207f1d4c6a4ebf94225f44), [`790f7d1`](https://github.com/mastra-ai/mastra/commit/790f7d17895d7a5f75b6b5d2d794c2e820b99d4c), [`3cd6538`](https://github.com/mastra-ai/mastra/commit/3cd6538811fc94f84a19dbd1064f46cb42e38c1d), [`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`fb84c21`](https://github.com/mastra-ai/mastra/commit/fb84c21859d09bdc8f158bd5412bdc4b5835a61c), [`5802bf5`](https://github.com/mastra-ai/mastra/commit/5802bf57f6182e4b67c28d7d91abed349a8d14f3), [`5bda53a`](https://github.com/mastra-ai/mastra/commit/5bda53a9747bfa7d876d754fc92c83a06e503f62), [`f26a8fd`](https://github.com/mastra-ai/mastra/commit/f26a8fd99fcb0497a5d86c28324430d7f6a5fb83), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382), [`7e82fbf`](https://github.com/mastra-ai/mastra/commit/7e82fbf3715175e274d2015eb59fb7f57dc9b09d), [`6047778`](https://github.com/mastra-ai/mastra/commit/6047778e501df460648f31decddf8e443f36e373), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`9d4fc09`](https://github.com/mastra-ai/mastra/commit/9d4fc09b2ad55caa7738c7ceb3a905e454f74cdd), [`d75ccf0`](https://github.com/mastra-ai/mastra/commit/d75ccf06dfd2582b916aa12624e3cd61b279edf1), [`5cadbc4`](https://github.com/mastra-ai/mastra/commit/5cadbc473019b6a08625fc7c624290d564533508), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`60c9cec`](https://github.com/mastra-ai/mastra/commit/60c9cec7048a79a87440f7840c383875bd710d93), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`f0ab020`](https://github.com/mastra-ai/mastra/commit/f0ab02034532a4afb71a1ef4fe243f9a8dffde84), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4), [`897995e`](https://github.com/mastra-ai/mastra/commit/897995e630d572fe2891e7ede817938cabb43251), [`0fed8f2`](https://github.com/mastra-ai/mastra/commit/0fed8f2aa84b167b3415ea6f8f70755775132c8d), [`1a1fbe6`](https://github.com/mastra-ai/mastra/commit/1a1fbe66efb7d94abc373ed0dd9676adb8122454), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`87fd07f`](https://github.com/mastra-ai/mastra/commit/87fd07ff35387a38728967163460231b5d33ae3b), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`36f39c0`](https://github.com/mastra-ai/mastra/commit/36f39c00dc794952dc3c11aab91c2fa8bca74b11), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
23
- - @mastra/deployer@0.0.0-toolOptionTypes-20250917085558
24
- - @mastra/core@0.0.0-toolOptionTypes-20250917085558
25
- - @mastra/loggers@0.0.0-toolOptionTypes-20250917085558
346
+ - Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`b1c155b`](https://github.com/mastra-ai/mastra/commit/b1c155b57ce702674f207f1d4c6a4ebf94225f44), [`790f7d1`](https://github.com/mastra-ai/mastra/commit/790f7d17895d7a5f75b6b5d2d794c2e820b99d4c), [`3cd6538`](https://github.com/mastra-ai/mastra/commit/3cd6538811fc94f84a19dbd1064f46cb42e38c1d), [`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`fb84c21`](https://github.com/mastra-ai/mastra/commit/fb84c21859d09bdc8f158bd5412bdc4b5835a61c), [`5802bf5`](https://github.com/mastra-ai/mastra/commit/5802bf57f6182e4b67c28d7d91abed349a8d14f3), [`5bda53a`](https://github.com/mastra-ai/mastra/commit/5bda53a9747bfa7d876d754fc92c83a06e503f62), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`f26a8fd`](https://github.com/mastra-ai/mastra/commit/f26a8fd99fcb0497a5d86c28324430d7f6a5fb83), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382), [`7e82fbf`](https://github.com/mastra-ai/mastra/commit/7e82fbf3715175e274d2015eb59fb7f57dc9b09d), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`6047778`](https://github.com/mastra-ai/mastra/commit/6047778e501df460648f31decddf8e443f36e373), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`9d4fc09`](https://github.com/mastra-ai/mastra/commit/9d4fc09b2ad55caa7738c7ceb3a905e454f74cdd), [`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`d75ccf0`](https://github.com/mastra-ai/mastra/commit/d75ccf06dfd2582b916aa12624e3cd61b279edf1), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`60c9cec`](https://github.com/mastra-ai/mastra/commit/60c9cec7048a79a87440f7840c383875bd710d93), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6c33d7f`](https://github.com/mastra-ai/mastra/commit/6c33d7f7242804c32e969ad3ab33ff4a6aebda8b), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a), [`f0ab020`](https://github.com/mastra-ai/mastra/commit/f0ab02034532a4afb71a1ef4fe243f9a8dffde84), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4), [`897995e`](https://github.com/mastra-ai/mastra/commit/897995e630d572fe2891e7ede817938cabb43251), [`0fed8f2`](https://github.com/mastra-ai/mastra/commit/0fed8f2aa84b167b3415ea6f8f70755775132c8d), [`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689), [`1a1fbe6`](https://github.com/mastra-ai/mastra/commit/1a1fbe66efb7d94abc373ed0dd9676adb8122454), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`87fd07f`](https://github.com/mastra-ai/mastra/commit/87fd07ff35387a38728967163460231b5d33ae3b), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`36f39c0`](https://github.com/mastra-ai/mastra/commit/36f39c00dc794952dc3c11aab91c2fa8bca74b11), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
347
+ - @mastra/core@0.17.0
348
+ - @mastra/deployer@0.17.0
349
+ - @mastra/loggers@0.10.12
350
+
351
+ ## 0.17.0-alpha.8
352
+
353
+ ### Patch Changes
354
+
355
+ - Updated dependencies [[`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a)]:
356
+ - @mastra/core@0.17.0-alpha.8
357
+ - @mastra/deployer@0.17.0-alpha.8
358
+
359
+ ## 0.17.0-alpha.7
360
+
361
+ ### Patch Changes
362
+
363
+ - Updated dependencies [[`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689)]:
364
+ - @mastra/core@0.17.0-alpha.7
365
+ - @mastra/deployer@0.17.0-alpha.7
366
+
367
+ ## 0.17.0-alpha.6
368
+
369
+ ### Patch Changes
370
+
371
+ - Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6c33d7f`](https://github.com/mastra-ai/mastra/commit/6c33d7f7242804c32e969ad3ab33ff4a6aebda8b), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e)]:
372
+ - @mastra/core@0.17.0-alpha.6
373
+ - @mastra/deployer@0.17.0-alpha.6
374
+ - @mastra/loggers@0.10.12-alpha.1
26
375
 
27
376
  ## 0.17.0-alpha.5
28
377
 
package/README.md CHANGED
@@ -76,6 +76,9 @@ MASTRA_STORAGE_AUTH_TOKEN=your-auth-token
76
76
  BUSINESS_API_RUNNER_LOGS_ENDPOINT=your-logs-endpoint
77
77
  BUSINESS_JWT_TOKEN=your-jwt-token
78
78
 
79
+ # Playground Configuration
80
+ PLAYGROUND_JWT_TOKEN=your-playground-jwt-token
81
+
79
82
  # Runtime Configuration
80
83
  RUNNER_START_TIME=deployment-start-time
81
84
  CI=true|false
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  var url = require('url');
4
4
  var path = require('path');
5
5
  var deployer = require('@mastra/deployer');
6
- var fsExtra = require('fs-extra');
6
+ var esm = require('fs-extra/esm');
7
7
  var os = require('os');
8
8
  var fs = require('fs');
9
9
  var error = require('@mastra/core/error');
@@ -51,8 +51,15 @@ function getAuthEntrypoint() {
51
51
  }
52
52
 
53
53
  async authenticateToken (...args) {
54
- if (typeof args[0] === 'string' && args[0].replace('Bearer ', '') === '${process.env.BUSINESS_JWT_TOKEN}') {
55
- return { id: 'business-api' }
54
+ if (typeof args[0] === 'string') {
55
+ const token = args[0].replace('Bearer ', '');
56
+ const validTokens = [];
57
+ ${process.env.PLAYGROUND_JWT_TOKEN ? `validTokens.push('${process.env.PLAYGROUND_JWT_TOKEN}');` : ""}
58
+ ${process.env.BUSINESS_JWT_TOKEN ? `validTokens.push('${process.env.BUSINESS_JWT_TOKEN}');` : ""}
59
+
60
+ if (validTokens.includes(token)) {
61
+ return { id: 'business-api' }
62
+ }
56
63
  }
57
64
  return this.auth.authenticateToken(...args)
58
65
  }
@@ -318,12 +325,13 @@ var CloudDeployer = class extends deployer.Deployer {
318
325
  async writeInstrumentationFile(outputDirectory) {
319
326
  const instrumentationFile = path.join(outputDirectory, "instrumentation.mjs");
320
327
  const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
321
- await fsExtra.copy(path.join(__dirname, "../templates", "instrumentation-template.js"), instrumentationFile);
328
+ await esm.copy(path.join(__dirname, "../templates", "instrumentation-template.js"), instrumentationFile);
322
329
  }
323
- writePackageJson(outputDirectory, dependencies) {
324
- dependencies.set("@mastra/loggers", "0.10.6");
325
- dependencies.set("@mastra/libsql", "0.13.1");
326
- dependencies.set("@mastra/cloud", "0.1.7");
330
+ async writePackageJson(outputDirectory, dependencies) {
331
+ const versions = await esm.readJSON(path.join(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), "../versions.json"));
332
+ for (const [pkgName, version] of Object.entries(versions || {})) {
333
+ dependencies.set(pkgName, version);
334
+ }
327
335
  return super.writePackageJson(outputDirectory, dependencies);
328
336
  }
329
337
  async lint() {
@@ -361,7 +369,7 @@ import { HttpTransport } from '@mastra/loggers/http';
361
369
  import { evaluate } from '@mastra/core/eval';
362
370
  import { AvailableHooks, registerHook } from '@mastra/core/hooks';
363
371
  import { LibSQLStore, LibSQLVector } from '@mastra/libsql';
364
-
372
+ import { scoreTracesWorkflow } from '@mastra/core/scores/scoreTraces';
365
373
  const startTime = process.env.RUNNER_START_TIME ? new Date(process.env.RUNNER_START_TIME).getTime() : Date.now();
366
374
  const createNodeServerStartTime = Date.now();
367
375
 
@@ -454,6 +462,10 @@ if (process.env.MASTRA_STORAGE_URL && process.env.MASTRA_STORAGE_AUTH_TOKEN) {
454
462
  });
455
463
  }
456
464
 
465
+ if (mastra?.getStorage()) {
466
+ mastra.__registerInternalWorkflow(scoreTracesWorkflow);
467
+ }
468
+
457
469
  ${getAuthEntrypoint()}
458
470
 
459
471
  await createNodeServer(mastra, { playground: false, swaggerUI: false, tools: getToolExports(tools) });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/auth.ts","../src/utils/constants.ts","../src/utils/logger.ts","../src/utils/execa.ts","../src/utils/deps.ts","../src/utils/file.ts","../src/utils/report.ts","../src/index.ts"],"names":["os","createClient","LoggerTransport","resolve","PinoLogger","Transform","execa","fs","join","error","MastraError","FileService","Deployer","dirname","fileURLToPath","copy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAAS,iBAAA,GAAoB;AAClC,EAAA,OAAO;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,6EAAA,EAUsE,OAAA,CAAQ,IAAI,kBAAkB,CAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA,CAAA;AAuB7G;AChCO,IAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,KAAA,KAAU,MAAA;AACpC,IAAM,OAAA,GAAkB,OAAA,CAAQ,GAAA,CAAI,OAAA,IAAW,EAAA;AAC/C,IAAM,UAAA,GAAqB,OAAA,CAAQ,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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,EAgFtB,mBAAmB;;AAAA;;AAAA,EAInB,mBAAmB;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAA,EAUN,OAAO,CAAA;AAAA,gBAAA,EACJ,UAAU,CAAA;AAAA,cAAA,EACZ,QAAQ,CAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAA,EAWT,OAAO,CAAA;AAAA,gBAAA,EACJ,UAAU,CAAA;AAAA,cAAA,EACZ,QAAQ,CAAA;AAAA;AAAA;AAAA,CAAA;AAAA,EAItB;AACF","file":"index.cjs","sourcesContent":["export function getAuthEntrypoint() {\n return `\n import { MastraAuthProvider } from '@mastra/core/server';\n\n class MastraCloudAuth extends MastraAuthProvider {\n constructor (auth) {\n super()\n this.auth = auth\n }\n\n async authenticateToken (...args) {\n if (typeof args[0] === 'string' && args[0].replace('Bearer ', '') === '${process.env.BUSINESS_JWT_TOKEN}') {\n return { id: 'business-api' }\n }\n return this.auth.authenticateToken(...args)\n }\n\n async authorizeUser (...args) {\n if (args[1] && args[1].path === '/api') {\n return true\n }\n if (args[0] && args[0].id === 'business-api') {\n return true\n }\n return this.auth.authorizeUser(...args)\n }\n }\n\n const serverConfig = mastra.getServer()\n if (serverConfig && serverConfig.experimental_auth) {\n const auth = serverConfig.experimental_auth\n serverConfig.experimental_auth = new MastraCloudAuth(auth)\n }\n `;\n}\n","import os from 'os';\n\nexport const LOCAL = process.env.LOCAL === 'true';\nexport const TEAM_ID: string = process.env.TEAM_ID ?? '';\nexport const PROJECT_ID: string = process.env.PROJECT_ID ?? '';\nexport const BUILD_ID: string = process.env.BUILD_ID ?? '';\nexport const BUILD_URL: string = process.env.BUILD_URL ?? '';\nexport const LOG_REDIS_URL: string = process.env.LOG_REDIS_URL ?? 'redis://localhost:6379';\nexport const BUSINESS_JWT_TOKEN: string = process.env.BUSINESS_JWT_TOKEN ?? '';\nexport const USER_IP_ADDRESS: string = process.env.USER_IP_ADDRESS ?? '';\nexport const MASTRA_DIRECTORY: string = process.env.MASTRA_DIRECTORY ?? 'src/mastra';\nexport const PROJECT_ENV_VARS: Record<string, string> = safelyParseJson(process.env.PROJECT_ENV_VARS ?? '{}');\n\nexport const PROJECT_ROOT = LOCAL ? os.tmpdir() + '/project' : (process.env.PROJECT_ROOT ?? '/project');\n\nexport function safelyParseJson(json: string) {\n try {\n return JSON.parse(json);\n } catch {\n return {};\n }\n}\n","import type { TransformCallback } from 'stream';\nimport type { BaseLogMessage, LogLevel } from '@mastra/core/logger';\nimport { LoggerTransport } from '@mastra/core/logger';\nimport { PinoLogger } from '@mastra/loggers';\nimport { createClient } from 'redis';\nimport { BUILD_ID, LOG_REDIS_URL, PROJECT_ID, TEAM_ID } from './constants.js';\n\nconst redisClient = createClient({\n url: LOG_REDIS_URL,\n});\n\nclass RedisTransport extends LoggerTransport {\n _transform(chunk: any, _encoding: string, callback: TransformCallback): void {\n chunk = chunk.toString();\n const logKey = `builder:logs:${TEAM_ID}:${PROJECT_ID}:${BUILD_ID}`;\n const ttl = 2 * 24 * 60 * 60; // 2 days in seconds\n const logData = typeof chunk === 'string' ? chunk : JSON.stringify(chunk);\n\n // Don't block the event loop - process logs asynchronously\n process.nextTick(async () => {\n try {\n // Connect to Redis if not already connected\n if (!redisClient.isOpen) {\n await redisClient.connect().catch(err => {\n console.error('Redis connection error:', err);\n });\n }\n\n // Use pipeline to batch Redis operations\n const pipeline = redisClient.multi();\n pipeline.rPush(logKey, logData);\n pipeline.expire(logKey, ttl);\n await pipeline.exec();\n } catch (err) {\n console.error('Redis logging error:', err);\n }\n });\n\n // Immediately pass through the chunk without waiting\n callback(null, chunk);\n }\n\n _write(chunk: any, encoding?: string, callback?: (error?: Error | null) => void): boolean {\n if (typeof callback === 'function') {\n this._transform(chunk, encoding || 'utf8', callback);\n return true;\n }\n\n this._transform(chunk, encoding || 'utf8', (error: Error | null | undefined) => {\n if (error) console.error('Transform error in write:', error);\n });\n return true;\n }\n\n async _flush(): Promise<void> {\n // // Ensure the pipeline is closed and flushed\n // redisClient.quit().catch(err => {\n // console.error('Redis connection error:', err);\n // });\n // callback();\n await new Promise(resolve => setTimeout(resolve, 10));\n }\n\n async _destroy(err: Error, cb: Function) {\n await closeLogger();\n cb(err);\n }\n\n getLogs(_args: {\n fromDate?: Date;\n toDate?: Date;\n logLevel?: LogLevel;\n filters?: Record<string, any>;\n returnPaginationResults?: boolean;\n page?: number;\n perPage?: number;\n }): Promise<{ logs: BaseLogMessage[]; total: number; page: number; perPage: number; hasMore: boolean }> {\n return Promise.resolve({\n logs: [],\n total: 0,\n page: _args?.page ?? 1,\n perPage: _args?.perPage ?? 100,\n hasMore: false,\n });\n }\n\n getLogsByRunId(_args?: {\n fromDate?: Date;\n toDate?: Date;\n logLevel?: LogLevel;\n filters?: Record<string, any>;\n returnPaginationResults?: boolean;\n page?: number;\n perPage?: number;\n }): Promise<{\n logs: BaseLogMessage[];\n total: number;\n page: number;\n perPage: number;\n hasMore: boolean;\n }> {\n return Promise.resolve({\n logs: [],\n total: 0,\n page: _args?.page ?? 1,\n perPage: _args?.perPage ?? 100,\n hasMore: false,\n });\n }\n}\n\nexport const transport = new RedisTransport();\n\nexport const closeLogger = async () => {\n if (redisClient.isOpen) {\n setTimeout(async () => {\n await redisClient.quit();\n }, 10);\n }\n};\n\nexport const logger = new PinoLogger({\n level: 'info',\n transports: {\n redis: transport,\n },\n});\n","import { Transform } from 'stream';\nimport { execa } from 'execa';\nimport { PROJECT_ENV_VARS, PROJECT_ROOT } from './constants.js';\nimport { logger } from './logger.js';\n\nexport const createPinoStream = () => {\n return new Transform({\n transform(chunk, encoding, callback) {\n // Convert Buffer/string to string and trim whitespace\n const line = chunk.toString().trim();\n\n if (line) {\n // Log each line through Pino\n logger.info(line);\n }\n\n // Pass through the original data\n callback(null, chunk);\n },\n });\n};\n\nexport async function runWithExeca({\n cmd,\n args,\n cwd = process.cwd(),\n env = PROJECT_ENV_VARS,\n}: {\n cmd: string;\n args: string[];\n cwd?: string;\n env?: Record<string, string>;\n}): Promise<{ stdout?: string; stderr?: string; success: boolean; error?: Error }> {\n const pinoStream = createPinoStream();\n\n try {\n const subprocess = execa(cmd, args, {\n cwd,\n env: {\n ...process.env,\n ...env,\n },\n });\n\n // Pipe stdout and stderr through the Pino stream\n subprocess.stdout?.pipe(pinoStream);\n subprocess.stderr?.pipe(pinoStream);\n\n const { stdout, stderr, exitCode } = await subprocess;\n return { stdout, stderr, success: exitCode === 0 };\n } catch (error) {\n logger.error(`Process failed: ${error}`);\n return { success: false, error: error instanceof Error ? error : new Error(String(error)) };\n }\n}\n\nexport function runWithChildProcess(cmd: string, args: string[]): { stdout?: string; stderr?: string } {\n const pinoStream = createPinoStream();\n\n try {\n const { stdout, stderr } = require('child_process').spawnSync(cmd, args, {\n cwd: PROJECT_ROOT,\n encoding: 'utf8',\n shell: true,\n env: {\n ...process.env,\n ...PROJECT_ENV_VARS,\n },\n maxBuffer: 1024 * 1024 * 10, // 10MB buffer\n });\n\n if (stdout) {\n pinoStream.write(stdout);\n }\n if (stderr) {\n pinoStream.write(stderr);\n }\n\n pinoStream.end();\n return { stdout, stderr };\n } catch (error) {\n logger.error('Process failed' + error);\n pinoStream.end();\n return {};\n }\n}\n","import * as fs from 'fs';\nimport { join, resolve } from 'path';\n\nimport { MastraError } from '@mastra/core/error';\nimport { runWithExeca } from './execa.js';\nimport { logger } from './logger.js';\n\nconst MEMOIZED = new Map();\n\nfunction findLockFile(dir: string): string | null {\n const lockFiles = ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', 'bun.lock'];\n for (const file of lockFiles) {\n if (fs.existsSync(join(dir, file))) {\n return file;\n }\n }\n const parentDir = resolve(dir, '..');\n if (parentDir !== dir) {\n return findLockFile(parentDir);\n }\n return null;\n}\n\nexport function detectPm({ path }: { path: string }): string {\n const cached = MEMOIZED.get(path);\n if (cached) {\n return cached;\n }\n\n const lockFile = findLockFile(path);\n let pm: string = 'npm';\n switch (lockFile) {\n case 'pnpm-lock.yaml':\n pm = 'pnpm';\n break;\n case 'package-lock.json':\n pm = 'npm';\n break;\n case 'yarn.lock':\n pm = 'yarn';\n break;\n case 'bun.lock':\n pm = 'bun';\n break;\n default:\n pm = 'npm';\n }\n\n MEMOIZED.set(path, pm);\n return pm;\n}\n\nexport async function installNodeVersion({ path }: { path: string }) {\n let nvmrcExists = false;\n let nodeVersionExists = false;\n\n try {\n fs.accessSync(join(path, '.nvmrc'));\n nvmrcExists = true;\n } catch {\n // File does not exist\n }\n\n try {\n fs.accessSync(join(path, '.node-version'));\n nodeVersionExists = true;\n } catch {\n // File does not exist\n }\n\n if (nvmrcExists || nodeVersionExists) {\n logger.info('Node version file found, installing specified Node.js version...');\n const { success, error } = await runWithExeca({\n cmd: 'n',\n args: ['auto'],\n cwd: path,\n });\n if (!success) {\n throw new MastraError(\n {\n id: 'NODE_FAIL_INSTALL_SPECIFIED_VERSION',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n }\n}\n\nexport async function installDeps({ path, pm }: { path: string; pm?: string }) {\n pm = pm ?? detectPm({ path });\n logger.info(`Installing dependencies with ${pm} in ${path}`);\n const args = ['install'];\n const { success, error } = await runWithExeca({ cmd: pm, args, cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_INSTALL_DEPS',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runInstallCommand({ path, installCommand }: { path: string; installCommand: string }) {\n logger.info(`Running install command ${installCommand} in workspace with ${path}`);\n const { success, error } = await runWithExeca({ cmd: 'sh', args: ['-c', installCommand], cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_CUSTOM_INSTALL_COMMAND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runScript({ scriptName, path, args }: { scriptName: string; path: string; args?: string[] }) {\n const pm = detectPm({ path });\n logger.info(`Running script ${scriptName} in workspace with ${pm}`);\n const { success, error } = await runWithExeca({\n cmd: pm,\n args: pm === 'npm' ? ['run', scriptName, ...(args ?? [])] : [scriptName, ...(args ?? [])],\n cwd: path,\n });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_BUILD_SCRIPT',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runBuildCommand({ command, path }: { command: string; path: string }) {\n logger.info(`Running build command ${command}`);\n const { success, error } = await runWithExeca({ cmd: 'sh', args: ['-c', command], cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_BUILD_COMMAND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n","import { join } from 'path';\nimport { MastraError } from '@mastra/core/error';\nimport { FileService } from '@mastra/deployer';\n\nimport { MASTRA_DIRECTORY } from './constants.js';\n\nexport function getMastraEntryFile(mastraDir: string) {\n try {\n const fileService = new FileService();\n return fileService.getFirstExistingFile([\n join(mastraDir, MASTRA_DIRECTORY, 'index.ts'),\n join(mastraDir, MASTRA_DIRECTORY, 'index.js'),\n ]);\n } catch (error) {\n throw new MastraError(\n {\n id: 'MASTRA_ENTRY_FILE_NOT_FOUND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n","import { PROJECT_ID, BUILD_ID, BUILD_URL, USER_IP_ADDRESS } from './constants.js';\n\nexport function successEntrypoint() {\n return `\n if (process.env.CI !== 'true') {\n await fetch('${process.env.REPORTER_API_URL}', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer ${process.env.REPORTER_API_URL_AUTH_TOKEN}',\n },\n body: JSON.stringify(${JSON.stringify({\n projectId: PROJECT_ID,\n buildId: BUILD_ID,\n status: 'success',\n url: BUILD_URL,\n userIpAddress: USER_IP_ADDRESS,\n })}),\n }).catch(err => {\n console.error('Failed to report build status to monitoring service', {\n error: err,\n });\n })\n }\n `;\n}\n","import { fileURLToPath } from 'node:url';\nimport { join, dirname } from 'path';\nimport { Deployer } from '@mastra/deployer';\nimport { copy } from 'fs-extra';\n\nimport { getAuthEntrypoint } from './utils/auth.js';\nimport { MASTRA_DIRECTORY, BUILD_ID, PROJECT_ID, TEAM_ID } from './utils/constants.js';\nimport { installDeps } from './utils/deps.js';\nimport { getMastraEntryFile } from './utils/file.js';\nimport { successEntrypoint } from './utils/report.js';\n\nexport class CloudDeployer extends Deployer {\n constructor() {\n super({ name: 'cloud' });\n }\n\n async deploy(_outputDirectory: string): Promise<void> {}\n async writeInstrumentationFile(outputDirectory: string) {\n const instrumentationFile = join(outputDirectory, 'instrumentation.mjs');\n const __dirname = dirname(fileURLToPath(import.meta.url));\n\n await copy(join(__dirname, '../templates', 'instrumentation-template.js'), instrumentationFile);\n }\n writePackageJson(outputDirectory: string, dependencies: Map<string, string>) {\n dependencies.set('@mastra/loggers', '0.10.6');\n dependencies.set('@mastra/libsql', '0.13.1');\n dependencies.set('@mastra/cloud', '0.1.7');\n return super.writePackageJson(outputDirectory, dependencies);\n }\n\n async lint() {}\n\n protected async installDependencies(outputDirectory: string, _rootDir = process.cwd()) {\n await installDeps({ path: join(outputDirectory, 'output'), pm: 'npm' });\n }\n\n async bundle(mastraDir: string, outputDirectory: string): Promise<void> {\n const currentCwd = process.cwd();\n process.chdir(mastraDir);\n\n const mastraEntryFile = getMastraEntryFile(mastraDir);\n\n const defaultToolsPath = join(mastraDir, MASTRA_DIRECTORY, 'tools');\n\n await this._bundle(\n this.getEntry(),\n mastraEntryFile,\n {\n outputDirectory,\n projectRoot: mastraDir,\n },\n [defaultToolsPath],\n );\n process.chdir(currentCwd);\n }\n\n getAuthEntrypoint() {\n return getAuthEntrypoint();\n }\n\n private getEntry(): string {\n return `\nimport { createNodeServer, getToolExports } from '#server';\nimport { tools } from '#tools';\nimport { mastra } from '#mastra';\nimport { MultiLogger } from '@mastra/core/logger';\nimport { PinoLogger } from '@mastra/loggers';\nimport { HttpTransport } from '@mastra/loggers/http';\nimport { evaluate } from '@mastra/core/eval';\nimport { AvailableHooks, registerHook } from '@mastra/core/hooks';\nimport { LibSQLStore, LibSQLVector } from '@mastra/libsql';\n\nconst startTime = process.env.RUNNER_START_TIME ? new Date(process.env.RUNNER_START_TIME).getTime() : Date.now();\nconst createNodeServerStartTime = Date.now();\n\nconsole.log(JSON.stringify({\n message: \"Server starting\",\n operation: 'builder.createNodeServer',\n operation_startTime: createNodeServerStartTime,\n type: \"READINESS\",\n startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n\nconst transports = {}\nif (process.env.CI !== 'true') {\n if (process.env.BUSINESS_API_RUNNER_LOGS_ENDPOINT) {\n transports.default = new HttpTransport({\n url: process.env.BUSINESS_API_RUNNER_LOGS_ENDPOINT,\n headers: {\n Authorization: 'Bearer ' + process.env.BUSINESS_JWT_TOKEN,\n },\n });\n }\n}\n\nconst logger = new PinoLogger({\n name: 'MastraCloud',\n transports,\n level: 'debug',\n});\nconst existingLogger = mastra?.getLogger();\nconst combinedLogger = existingLogger ? new MultiLogger([logger, existingLogger]) : logger;\n\nmastra.setLogger({ logger: combinedLogger });\n\nif (mastra?.storage) {\n mastra.storage.init()\n}\n\nif (process.env.MASTRA_STORAGE_URL && process.env.MASTRA_STORAGE_AUTH_TOKEN) {\n const { MastraStorage } = await import('@mastra/core/storage');\n logger.info('Using Mastra Cloud Storage: ' + process.env.MASTRA_STORAGE_URL)\n const storage = new LibSQLStore({\n url: process.env.MASTRA_STORAGE_URL,\n authToken: process.env.MASTRA_STORAGE_AUTH_TOKEN,\n })\n const vector = new LibSQLVector({\n connectionUrl: process.env.MASTRA_STORAGE_URL,\n authToken: process.env.MASTRA_STORAGE_AUTH_TOKEN,\n })\n\n await storage.init()\n mastra?.setStorage(storage)\n\n mastra?.memory?.setStorage(storage)\n mastra?.memory?.setVector(vector)\n\n registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {\n evaluate({\n agentName,\n input,\n metric,\n output,\n runId,\n globalRunId: runId,\n instructions,\n });\n });\n registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {\n if (mastra?.storage) {\n await mastra.storage.insert({\n tableName: MastraStorage.TABLE_EVALS,\n record: {\n input: traceObject.input,\n output: traceObject.output,\n result: JSON.stringify(traceObject.result),\n agent_name: traceObject.agentName,\n metric_name: traceObject.metricName,\n instructions: traceObject.instructions,\n test_info: null,\n global_run_id: traceObject.globalRunId,\n run_id: traceObject.runId,\n created_at: new Date().toISOString(),\n },\n });\n }\n });\n}\n\n${getAuthEntrypoint()}\n\nawait createNodeServer(mastra, { playground: false, swaggerUI: false, tools: getToolExports(tools) });\n\n${successEntrypoint()}\n\nconsole.log(JSON.stringify({\n message: \"Server started\",\n operation: 'builder.createNodeServer',\n operation_startTime: createNodeServerStartTime,\n operation_durationMs: Date.now() - createNodeServerStartTime,\n type: \"READINESS\",\n startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n\n\nconsole.log(JSON.stringify({\n message: \"Runner Initialized\",\n type: \"READINESS\",\n startTime,\n durationMs: Date.now() - startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n`;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/auth.ts","../src/utils/constants.ts","../src/utils/logger.ts","../src/utils/execa.ts","../src/utils/deps.ts","../src/utils/file.ts","../src/utils/report.ts","../src/index.ts"],"names":["os","createClient","LoggerTransport","resolve","PinoLogger","Transform","execa","fs","join","error","MastraError","FileService","Deployer","dirname","fileURLToPath","copy","readJSON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAAS,iBAAA,GAAoB;AAClC,E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A;AAAA,CAAA;AAAA,EAItB;AACF","file":"index.cjs","sourcesContent":["export function getAuthEntrypoint() {\n return `\n import { MastraAuthProvider } from '@mastra/core/server';\n\n class MastraCloudAuth extends MastraAuthProvider {\n constructor (auth) {\n super()\n this.auth = auth\n }\n\n async authenticateToken (...args) {\n if (typeof args[0] === 'string') {\n const token = args[0].replace('Bearer ', '');\n const validTokens = [];\n ${process.env.PLAYGROUND_JWT_TOKEN ? `validTokens.push('${process.env.PLAYGROUND_JWT_TOKEN}');` : ''}\n ${process.env.BUSINESS_JWT_TOKEN ? `validTokens.push('${process.env.BUSINESS_JWT_TOKEN}');` : ''}\n \n if (validTokens.includes(token)) {\n return { id: 'business-api' }\n }\n }\n return this.auth.authenticateToken(...args)\n }\n\n async authorizeUser (...args) {\n if (args[1] && args[1].path === '/api') {\n return true\n }\n if (args[0] && args[0].id === 'business-api') {\n return true\n }\n return this.auth.authorizeUser(...args)\n }\n }\n\n const serverConfig = mastra.getServer()\n if (serverConfig && serverConfig.experimental_auth) {\n const auth = serverConfig.experimental_auth\n serverConfig.experimental_auth = new MastraCloudAuth(auth)\n }\n `;\n}\n","import os from 'os';\n\nexport const LOCAL = process.env.LOCAL === 'true';\nexport const TEAM_ID: string = process.env.TEAM_ID ?? '';\nexport const PROJECT_ID: string = process.env.PROJECT_ID ?? '';\nexport const BUILD_ID: string = process.env.BUILD_ID ?? '';\nexport const BUILD_URL: string = process.env.BUILD_URL ?? '';\nexport const LOG_REDIS_URL: string = process.env.LOG_REDIS_URL ?? 'redis://localhost:6379';\nexport const BUSINESS_JWT_TOKEN: string = process.env.BUSINESS_JWT_TOKEN ?? '';\nexport const PLAYGROUND_JWT_TOKEN: string = process.env.PLAYGROUND_JWT_TOKEN ?? '';\nexport const USER_IP_ADDRESS: string = process.env.USER_IP_ADDRESS ?? '';\nexport const MASTRA_DIRECTORY: string = process.env.MASTRA_DIRECTORY ?? 'src/mastra';\nexport const PROJECT_ENV_VARS: Record<string, string> = safelyParseJson(process.env.PROJECT_ENV_VARS ?? '{}');\n\nexport const PROJECT_ROOT = LOCAL ? os.tmpdir() + '/project' : (process.env.PROJECT_ROOT ?? '/project');\n\nexport function safelyParseJson(json: string) {\n try {\n return JSON.parse(json);\n } catch {\n return {};\n }\n}\n","import type { TransformCallback } from 'stream';\nimport type { BaseLogMessage, LogLevel } from '@mastra/core/logger';\nimport { LoggerTransport } from '@mastra/core/logger';\nimport { PinoLogger } from '@mastra/loggers';\nimport { createClient } from 'redis';\nimport { BUILD_ID, LOG_REDIS_URL, PROJECT_ID, TEAM_ID } from './constants.js';\n\nconst redisClient = createClient({\n url: LOG_REDIS_URL,\n});\n\nclass RedisTransport extends LoggerTransport {\n _transform(chunk: any, _encoding: string, callback: TransformCallback): void {\n chunk = chunk.toString();\n const logKey = `builder:logs:${TEAM_ID}:${PROJECT_ID}:${BUILD_ID}`;\n const ttl = 2 * 24 * 60 * 60; // 2 days in seconds\n const logData = typeof chunk === 'string' ? chunk : JSON.stringify(chunk);\n\n // Don't block the event loop - process logs asynchronously\n process.nextTick(async () => {\n try {\n // Connect to Redis if not already connected\n if (!redisClient.isOpen) {\n await redisClient.connect().catch(err => {\n console.error('Redis connection error:', err);\n });\n }\n\n // Use pipeline to batch Redis operations\n const pipeline = redisClient.multi();\n pipeline.rPush(logKey, logData);\n pipeline.expire(logKey, ttl);\n await pipeline.exec();\n } catch (err) {\n console.error('Redis logging error:', err);\n }\n });\n\n // Immediately pass through the chunk without waiting\n callback(null, chunk);\n }\n\n _write(chunk: any, encoding?: string, callback?: (error?: Error | null) => void): boolean {\n if (typeof callback === 'function') {\n this._transform(chunk, encoding || 'utf8', callback);\n return true;\n }\n\n this._transform(chunk, encoding || 'utf8', (error: Error | null | undefined) => {\n if (error) console.error('Transform error in write:', error);\n });\n return true;\n }\n\n async _flush(): Promise<void> {\n // // Ensure the pipeline is closed and flushed\n // redisClient.quit().catch(err => {\n // console.error('Redis connection error:', err);\n // });\n // callback();\n await new Promise(resolve => setTimeout(resolve, 10));\n }\n\n async _destroy(err: Error, cb: Function) {\n await closeLogger();\n cb(err);\n }\n\n getLogs(_args: {\n fromDate?: Date;\n toDate?: Date;\n logLevel?: LogLevel;\n filters?: Record<string, any>;\n returnPaginationResults?: boolean;\n page?: number;\n perPage?: number;\n }): Promise<{ logs: BaseLogMessage[]; total: number; page: number; perPage: number; hasMore: boolean }> {\n return Promise.resolve({\n logs: [],\n total: 0,\n page: _args?.page ?? 1,\n perPage: _args?.perPage ?? 100,\n hasMore: false,\n });\n }\n\n getLogsByRunId(_args?: {\n fromDate?: Date;\n toDate?: Date;\n logLevel?: LogLevel;\n filters?: Record<string, any>;\n returnPaginationResults?: boolean;\n page?: number;\n perPage?: number;\n }): Promise<{\n logs: BaseLogMessage[];\n total: number;\n page: number;\n perPage: number;\n hasMore: boolean;\n }> {\n return Promise.resolve({\n logs: [],\n total: 0,\n page: _args?.page ?? 1,\n perPage: _args?.perPage ?? 100,\n hasMore: false,\n });\n }\n}\n\nexport const transport = new RedisTransport();\n\nexport const closeLogger = async () => {\n if (redisClient.isOpen) {\n setTimeout(async () => {\n await redisClient.quit();\n }, 10);\n }\n};\n\nexport const logger = new PinoLogger({\n level: 'info',\n transports: {\n redis: transport,\n },\n});\n","import { Transform } from 'stream';\nimport { execa } from 'execa';\nimport { PROJECT_ENV_VARS, PROJECT_ROOT } from './constants.js';\nimport { logger } from './logger.js';\n\nexport const createPinoStream = () => {\n return new Transform({\n transform(chunk, encoding, callback) {\n // Convert Buffer/string to string and trim whitespace\n const line = chunk.toString().trim();\n\n if (line) {\n // Log each line through Pino\n logger.info(line);\n }\n\n // Pass through the original data\n callback(null, chunk);\n },\n });\n};\n\nexport async function runWithExeca({\n cmd,\n args,\n cwd = process.cwd(),\n env = PROJECT_ENV_VARS,\n}: {\n cmd: string;\n args: string[];\n cwd?: string;\n env?: Record<string, string>;\n}): Promise<{ stdout?: string; stderr?: string; success: boolean; error?: Error }> {\n const pinoStream = createPinoStream();\n\n try {\n const subprocess = execa(cmd, args, {\n cwd,\n env: {\n ...process.env,\n ...env,\n },\n });\n\n // Pipe stdout and stderr through the Pino stream\n subprocess.stdout?.pipe(pinoStream);\n subprocess.stderr?.pipe(pinoStream);\n\n const { stdout, stderr, exitCode } = await subprocess;\n return { stdout, stderr, success: exitCode === 0 };\n } catch (error) {\n logger.error(`Process failed: ${error}`);\n return { success: false, error: error instanceof Error ? error : new Error(String(error)) };\n }\n}\n\nexport function runWithChildProcess(cmd: string, args: string[]): { stdout?: string; stderr?: string } {\n const pinoStream = createPinoStream();\n\n try {\n const { stdout, stderr } = require('child_process').spawnSync(cmd, args, {\n cwd: PROJECT_ROOT,\n encoding: 'utf8',\n shell: true,\n env: {\n ...process.env,\n ...PROJECT_ENV_VARS,\n },\n maxBuffer: 1024 * 1024 * 10, // 10MB buffer\n });\n\n if (stdout) {\n pinoStream.write(stdout);\n }\n if (stderr) {\n pinoStream.write(stderr);\n }\n\n pinoStream.end();\n return { stdout, stderr };\n } catch (error) {\n logger.error('Process failed' + error);\n pinoStream.end();\n return {};\n }\n}\n","import * as fs from 'fs';\nimport { join, resolve } from 'path';\n\nimport { MastraError } from '@mastra/core/error';\nimport { runWithExeca } from './execa.js';\nimport { logger } from './logger.js';\n\nconst MEMOIZED = new Map();\n\nfunction findLockFile(dir: string): string | null {\n const lockFiles = ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', 'bun.lock'];\n for (const file of lockFiles) {\n if (fs.existsSync(join(dir, file))) {\n return file;\n }\n }\n const parentDir = resolve(dir, '..');\n if (parentDir !== dir) {\n return findLockFile(parentDir);\n }\n return null;\n}\n\nexport function detectPm({ path }: { path: string }): string {\n const cached = MEMOIZED.get(path);\n if (cached) {\n return cached;\n }\n\n const lockFile = findLockFile(path);\n let pm: string = 'npm';\n switch (lockFile) {\n case 'pnpm-lock.yaml':\n pm = 'pnpm';\n break;\n case 'package-lock.json':\n pm = 'npm';\n break;\n case 'yarn.lock':\n pm = 'yarn';\n break;\n case 'bun.lock':\n pm = 'bun';\n break;\n default:\n pm = 'npm';\n }\n\n MEMOIZED.set(path, pm);\n return pm;\n}\n\nexport async function installNodeVersion({ path }: { path: string }) {\n let nvmrcExists = false;\n let nodeVersionExists = false;\n\n try {\n fs.accessSync(join(path, '.nvmrc'));\n nvmrcExists = true;\n } catch {\n // File does not exist\n }\n\n try {\n fs.accessSync(join(path, '.node-version'));\n nodeVersionExists = true;\n } catch {\n // File does not exist\n }\n\n if (nvmrcExists || nodeVersionExists) {\n logger.info('Node version file found, installing specified Node.js version...');\n const { success, error } = await runWithExeca({\n cmd: 'n',\n args: ['auto'],\n cwd: path,\n });\n if (!success) {\n throw new MastraError(\n {\n id: 'NODE_FAIL_INSTALL_SPECIFIED_VERSION',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n }\n}\n\nexport async function installDeps({ path, pm }: { path: string; pm?: string }) {\n pm = pm ?? detectPm({ path });\n logger.info(`Installing dependencies with ${pm} in ${path}`);\n const args = ['install'];\n const { success, error } = await runWithExeca({ cmd: pm, args, cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_INSTALL_DEPS',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runInstallCommand({ path, installCommand }: { path: string; installCommand: string }) {\n logger.info(`Running install command ${installCommand} in workspace with ${path}`);\n const { success, error } = await runWithExeca({ cmd: 'sh', args: ['-c', installCommand], cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_CUSTOM_INSTALL_COMMAND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runScript({ scriptName, path, args }: { scriptName: string; path: string; args?: string[] }) {\n const pm = detectPm({ path });\n logger.info(`Running script ${scriptName} in workspace with ${pm}`);\n const { success, error } = await runWithExeca({\n cmd: pm,\n args: pm === 'npm' ? ['run', scriptName, ...(args ?? [])] : [scriptName, ...(args ?? [])],\n cwd: path,\n });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_BUILD_SCRIPT',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runBuildCommand({ command, path }: { command: string; path: string }) {\n logger.info(`Running build command ${command}`);\n const { success, error } = await runWithExeca({ cmd: 'sh', args: ['-c', command], cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_BUILD_COMMAND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n","import { join } from 'path';\nimport { MastraError } from '@mastra/core/error';\nimport { FileService } from '@mastra/deployer';\n\nimport { MASTRA_DIRECTORY } from './constants.js';\n\nexport function getMastraEntryFile(mastraDir: string) {\n try {\n const fileService = new FileService();\n return fileService.getFirstExistingFile([\n join(mastraDir, MASTRA_DIRECTORY, 'index.ts'),\n join(mastraDir, MASTRA_DIRECTORY, 'index.js'),\n ]);\n } catch (error) {\n throw new MastraError(\n {\n id: 'MASTRA_ENTRY_FILE_NOT_FOUND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n","import { PROJECT_ID, BUILD_ID, BUILD_URL, USER_IP_ADDRESS } from './constants.js';\n\nexport function successEntrypoint() {\n return `\n if (process.env.CI !== 'true') {\n await fetch('${process.env.REPORTER_API_URL}', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer ${process.env.REPORTER_API_URL_AUTH_TOKEN}',\n },\n body: JSON.stringify(${JSON.stringify({\n projectId: PROJECT_ID,\n buildId: BUILD_ID,\n status: 'success',\n url: BUILD_URL,\n userIpAddress: USER_IP_ADDRESS,\n })}),\n }).catch(err => {\n console.error('Failed to report build status to monitoring service', {\n error: err,\n });\n })\n }\n `;\n}\n","import { fileURLToPath } from 'node:url';\nimport { join, dirname } from 'path';\nimport { Deployer } from '@mastra/deployer';\nimport { copy, readJSON } from 'fs-extra/esm';\n\nimport { getAuthEntrypoint } from './utils/auth.js';\nimport { MASTRA_DIRECTORY, BUILD_ID, PROJECT_ID, TEAM_ID } from './utils/constants.js';\nimport { installDeps } from './utils/deps.js';\nimport { getMastraEntryFile } from './utils/file.js';\nimport { successEntrypoint } from './utils/report.js';\n\nexport class CloudDeployer extends Deployer {\n constructor() {\n super({ name: 'cloud' });\n }\n\n async deploy(_outputDirectory: string): Promise<void> {}\n async writeInstrumentationFile(outputDirectory: string) {\n const instrumentationFile = join(outputDirectory, 'instrumentation.mjs');\n const __dirname = dirname(fileURLToPath(import.meta.url));\n\n await copy(join(__dirname, '../templates', 'instrumentation-template.js'), instrumentationFile);\n }\n async writePackageJson(outputDirectory: string, dependencies: Map<string, string>) {\n const versions = (await readJSON(join(dirname(fileURLToPath(import.meta.url)), '../versions.json'))) as\n | Record<string, string>\n | undefined;\n for (const [pkgName, version] of Object.entries(versions || {})) {\n dependencies.set(pkgName, version);\n }\n\n return super.writePackageJson(outputDirectory, dependencies);\n }\n\n async lint() {}\n\n protected async installDependencies(outputDirectory: string, _rootDir = process.cwd()) {\n await installDeps({ path: join(outputDirectory, 'output'), pm: 'npm' });\n }\n\n async bundle(mastraDir: string, outputDirectory: string): Promise<void> {\n const currentCwd = process.cwd();\n process.chdir(mastraDir);\n\n const mastraEntryFile = getMastraEntryFile(mastraDir);\n\n const defaultToolsPath = join(mastraDir, MASTRA_DIRECTORY, 'tools');\n\n await this._bundle(\n this.getEntry(),\n mastraEntryFile,\n {\n outputDirectory,\n projectRoot: mastraDir,\n },\n [defaultToolsPath],\n );\n process.chdir(currentCwd);\n }\n\n getAuthEntrypoint() {\n return getAuthEntrypoint();\n }\n\n private getEntry(): string {\n return `\nimport { createNodeServer, getToolExports } from '#server';\nimport { tools } from '#tools';\nimport { mastra } from '#mastra';\nimport { MultiLogger } from '@mastra/core/logger';\nimport { PinoLogger } from '@mastra/loggers';\nimport { HttpTransport } from '@mastra/loggers/http';\nimport { evaluate } from '@mastra/core/eval';\nimport { AvailableHooks, registerHook } from '@mastra/core/hooks';\nimport { LibSQLStore, LibSQLVector } from '@mastra/libsql';\nimport { scoreTracesWorkflow } from '@mastra/core/scores/scoreTraces';\nconst startTime = process.env.RUNNER_START_TIME ? new Date(process.env.RUNNER_START_TIME).getTime() : Date.now();\nconst createNodeServerStartTime = Date.now();\n\nconsole.log(JSON.stringify({\n message: \"Server starting\",\n operation: 'builder.createNodeServer',\n operation_startTime: createNodeServerStartTime,\n type: \"READINESS\",\n startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n\nconst transports = {}\nif (process.env.CI !== 'true') {\n if (process.env.BUSINESS_API_RUNNER_LOGS_ENDPOINT) {\n transports.default = new HttpTransport({\n url: process.env.BUSINESS_API_RUNNER_LOGS_ENDPOINT,\n headers: {\n Authorization: 'Bearer ' + process.env.BUSINESS_JWT_TOKEN,\n },\n });\n }\n}\n\nconst logger = new PinoLogger({\n name: 'MastraCloud',\n transports,\n level: 'debug',\n});\nconst existingLogger = mastra?.getLogger();\nconst combinedLogger = existingLogger ? new MultiLogger([logger, existingLogger]) : logger;\n\nmastra.setLogger({ logger: combinedLogger });\n\nif (mastra?.storage) {\n mastra.storage.init()\n}\n\nif (process.env.MASTRA_STORAGE_URL && process.env.MASTRA_STORAGE_AUTH_TOKEN) {\n const { MastraStorage } = await import('@mastra/core/storage');\n logger.info('Using Mastra Cloud Storage: ' + process.env.MASTRA_STORAGE_URL)\n const storage = new LibSQLStore({\n url: process.env.MASTRA_STORAGE_URL,\n authToken: process.env.MASTRA_STORAGE_AUTH_TOKEN,\n })\n const vector = new LibSQLVector({\n connectionUrl: process.env.MASTRA_STORAGE_URL,\n authToken: process.env.MASTRA_STORAGE_AUTH_TOKEN,\n })\n\n await storage.init()\n mastra?.setStorage(storage)\n\n mastra?.memory?.setStorage(storage)\n mastra?.memory?.setVector(vector)\n\n registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {\n evaluate({\n agentName,\n input,\n metric,\n output,\n runId,\n globalRunId: runId,\n instructions,\n });\n });\n registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {\n if (mastra?.storage) {\n await mastra.storage.insert({\n tableName: MastraStorage.TABLE_EVALS,\n record: {\n input: traceObject.input,\n output: traceObject.output,\n result: JSON.stringify(traceObject.result),\n agent_name: traceObject.agentName,\n metric_name: traceObject.metricName,\n instructions: traceObject.instructions,\n test_info: null,\n global_run_id: traceObject.globalRunId,\n run_id: traceObject.runId,\n created_at: new Date().toISOString(),\n },\n });\n }\n });\n}\n\nif (mastra?.getStorage()) {\n mastra.__registerInternalWorkflow(scoreTracesWorkflow);\n}\n\n${getAuthEntrypoint()}\n\nawait createNodeServer(mastra, { playground: false, swaggerUI: false, tools: getToolExports(tools) });\n\n${successEntrypoint()}\n\nconsole.log(JSON.stringify({\n message: \"Server started\",\n operation: 'builder.createNodeServer',\n operation_startTime: createNodeServerStartTime,\n operation_durationMs: Date.now() - createNodeServerStartTime,\n type: \"READINESS\",\n startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n\n\nconsole.log(JSON.stringify({\n message: \"Runner Initialized\",\n type: \"READINESS\",\n startTime,\n durationMs: Date.now() - startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n`;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAS5C,qBAAa,aAAc,SAAQ,QAAQ;;IAKnC,MAAM,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/C,wBAAwB,CAAC,eAAe,EAAE,MAAM;IAMtD,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAOrE,IAAI;cAEM,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,SAAgB;IAI/E,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBvE,iBAAiB;IAIjB,OAAO,CAAC,QAAQ;CA0IjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAS5C,qBAAa,aAAc,SAAQ,QAAQ;;IAKnC,MAAM,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/C,wBAAwB,CAAC,eAAe,EAAE,MAAM;IAMhD,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAW3E,IAAI;cAEM,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,SAAgB;IAI/E,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBvE,iBAAiB;IAIjB,OAAO,CAAC,QAAQ;CA8IjB"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { fileURLToPath } from 'url';
2
2
  import { join, dirname, resolve } from 'path';
3
3
  import { Deployer, FileService } from '@mastra/deployer';
4
- import { copy } from 'fs-extra';
4
+ import { copy, readJSON } from 'fs-extra/esm';
5
5
  import os from 'os';
6
6
  import * as fs from 'fs';
7
7
  import { MastraError } from '@mastra/core/error';
@@ -25,8 +25,15 @@ function getAuthEntrypoint() {
25
25
  }
26
26
 
27
27
  async authenticateToken (...args) {
28
- if (typeof args[0] === 'string' && args[0].replace('Bearer ', '') === '${process.env.BUSINESS_JWT_TOKEN}') {
29
- return { id: 'business-api' }
28
+ if (typeof args[0] === 'string') {
29
+ const token = args[0].replace('Bearer ', '');
30
+ const validTokens = [];
31
+ ${process.env.PLAYGROUND_JWT_TOKEN ? `validTokens.push('${process.env.PLAYGROUND_JWT_TOKEN}');` : ""}
32
+ ${process.env.BUSINESS_JWT_TOKEN ? `validTokens.push('${process.env.BUSINESS_JWT_TOKEN}');` : ""}
33
+
34
+ if (validTokens.includes(token)) {
35
+ return { id: 'business-api' }
36
+ }
30
37
  }
31
38
  return this.auth.authenticateToken(...args)
32
39
  }
@@ -294,10 +301,11 @@ var CloudDeployer = class extends Deployer {
294
301
  const __dirname = dirname(fileURLToPath(import.meta.url));
295
302
  await copy(join(__dirname, "../templates", "instrumentation-template.js"), instrumentationFile);
296
303
  }
297
- writePackageJson(outputDirectory, dependencies) {
298
- dependencies.set("@mastra/loggers", "0.10.6");
299
- dependencies.set("@mastra/libsql", "0.13.1");
300
- dependencies.set("@mastra/cloud", "0.1.7");
304
+ async writePackageJson(outputDirectory, dependencies) {
305
+ const versions = await readJSON(join(dirname(fileURLToPath(import.meta.url)), "../versions.json"));
306
+ for (const [pkgName, version] of Object.entries(versions || {})) {
307
+ dependencies.set(pkgName, version);
308
+ }
301
309
  return super.writePackageJson(outputDirectory, dependencies);
302
310
  }
303
311
  async lint() {
@@ -335,7 +343,7 @@ import { HttpTransport } from '@mastra/loggers/http';
335
343
  import { evaluate } from '@mastra/core/eval';
336
344
  import { AvailableHooks, registerHook } from '@mastra/core/hooks';
337
345
  import { LibSQLStore, LibSQLVector } from '@mastra/libsql';
338
-
346
+ import { scoreTracesWorkflow } from '@mastra/core/scores/scoreTraces';
339
347
  const startTime = process.env.RUNNER_START_TIME ? new Date(process.env.RUNNER_START_TIME).getTime() : Date.now();
340
348
  const createNodeServerStartTime = Date.now();
341
349
 
@@ -428,6 +436,10 @@ if (process.env.MASTRA_STORAGE_URL && process.env.MASTRA_STORAGE_AUTH_TOKEN) {
428
436
  });
429
437
  }
430
438
 
439
+ if (mastra?.getStorage()) {
440
+ mastra.__registerInternalWorkflow(scoreTracesWorkflow);
441
+ }
442
+
431
443
  ${getAuthEntrypoint()}
432
444
 
433
445
  await createNodeServer(mastra, { playground: false, swaggerUI: false, tools: getToolExports(tools) });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/auth.ts","../src/utils/constants.ts","../src/utils/logger.ts","../src/utils/execa.ts","../src/utils/deps.ts","../src/utils/file.ts","../src/utils/report.ts","../src/index.ts"],"names":["resolve","join","MastraError"],"mappings":";;;;;;;;;;;;;;;;AAAO,SAAS,iBAAA,GAAoB;AAClC,EAAA,OAAO;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,6EAAA,EAUsE,OAAA,CAAQ,IAAI,kBAAkB,CAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA,CAAA;AAuB7G;AChCO,IAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,KAAA,KAAU,MAAA;AACpC,IAAM,OAAA,GAAkB,OAAA,CAAQ,GAAA,CAAI,OAAA,IAAW,EAAA;AAC/C,IAAM,UAAA,GAAqB,OAAA,CAAQ,GAAA,CAAI,UAAA,IAAc,EAAA;AACrD,IAAM,QAAA,GAAmB,OAAA,CAAQ,GAAA,CAAI,QAAA,IAAY,EAAA;AACjD,IAAM,SAAA,GAAoB,OAAA,CAAQ,GAAA,CAAI,SAAA,IAAa,EAAA;AACnD,IAAM,aAAA,GAAwB,OAAA,CAAQ,GAAA,CAAI,aAAA,IAAiB,wBAAA;AAE3D,IAAM,eAAA,GAA0B,OAAA,CAAQ,GAAA,CAAI,eAAA,IAAmB,EAAA;AAC/D,IAAM,gBAAA,GAA2B,OAAA,CAAQ,GAAA,CAAI,gBAAA,IAAoB,YAAA;AACjE,IAAM,gBAAA,GAA2C,eAAA,CAAgB,OAAA,CAAQ,G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EAItB;AACF","file":"index.js","sourcesContent":["export function getAuthEntrypoint() {\n return `\n import { MastraAuthProvider } from '@mastra/core/server';\n\n class MastraCloudAuth extends MastraAuthProvider {\n constructor (auth) {\n super()\n this.auth = auth\n }\n\n async authenticateToken (...args) {\n if (typeof args[0] === 'string' && args[0].replace('Bearer ', '') === '${process.env.BUSINESS_JWT_TOKEN}') {\n return { id: 'business-api' }\n }\n return this.auth.authenticateToken(...args)\n }\n\n async authorizeUser (...args) {\n if (args[1] && args[1].path === '/api') {\n return true\n }\n if (args[0] && args[0].id === 'business-api') {\n return true\n }\n return this.auth.authorizeUser(...args)\n }\n }\n\n const serverConfig = mastra.getServer()\n if (serverConfig && serverConfig.experimental_auth) {\n const auth = serverConfig.experimental_auth\n serverConfig.experimental_auth = new MastraCloudAuth(auth)\n }\n `;\n}\n","import os from 'os';\n\nexport const LOCAL = process.env.LOCAL === 'true';\nexport const TEAM_ID: string = process.env.TEAM_ID ?? '';\nexport const PROJECT_ID: string = process.env.PROJECT_ID ?? '';\nexport const BUILD_ID: string = process.env.BUILD_ID ?? '';\nexport const BUILD_URL: string = process.env.BUILD_URL ?? '';\nexport const LOG_REDIS_URL: string = process.env.LOG_REDIS_URL ?? 'redis://localhost:6379';\nexport const BUSINESS_JWT_TOKEN: string = process.env.BUSINESS_JWT_TOKEN ?? '';\nexport const USER_IP_ADDRESS: string = process.env.USER_IP_ADDRESS ?? '';\nexport const MASTRA_DIRECTORY: string = process.env.MASTRA_DIRECTORY ?? 'src/mastra';\nexport const PROJECT_ENV_VARS: Record<string, string> = safelyParseJson(process.env.PROJECT_ENV_VARS ?? '{}');\n\nexport const PROJECT_ROOT = LOCAL ? os.tmpdir() + '/project' : (process.env.PROJECT_ROOT ?? '/project');\n\nexport function safelyParseJson(json: string) {\n try {\n return JSON.parse(json);\n } catch {\n return {};\n }\n}\n","import type { TransformCallback } from 'stream';\nimport type { BaseLogMessage, LogLevel } from '@mastra/core/logger';\nimport { LoggerTransport } from '@mastra/core/logger';\nimport { PinoLogger } from '@mastra/loggers';\nimport { createClient } from 'redis';\nimport { BUILD_ID, LOG_REDIS_URL, PROJECT_ID, TEAM_ID } from './constants.js';\n\nconst redisClient = createClient({\n url: LOG_REDIS_URL,\n});\n\nclass RedisTransport extends LoggerTransport {\n _transform(chunk: any, _encoding: string, callback: TransformCallback): void {\n chunk = chunk.toString();\n const logKey = `builder:logs:${TEAM_ID}:${PROJECT_ID}:${BUILD_ID}`;\n const ttl = 2 * 24 * 60 * 60; // 2 days in seconds\n const logData = typeof chunk === 'string' ? chunk : JSON.stringify(chunk);\n\n // Don't block the event loop - process logs asynchronously\n process.nextTick(async () => {\n try {\n // Connect to Redis if not already connected\n if (!redisClient.isOpen) {\n await redisClient.connect().catch(err => {\n console.error('Redis connection error:', err);\n });\n }\n\n // Use pipeline to batch Redis operations\n const pipeline = redisClient.multi();\n pipeline.rPush(logKey, logData);\n pipeline.expire(logKey, ttl);\n await pipeline.exec();\n } catch (err) {\n console.error('Redis logging error:', err);\n }\n });\n\n // Immediately pass through the chunk without waiting\n callback(null, chunk);\n }\n\n _write(chunk: any, encoding?: string, callback?: (error?: Error | null) => void): boolean {\n if (typeof callback === 'function') {\n this._transform(chunk, encoding || 'utf8', callback);\n return true;\n }\n\n this._transform(chunk, encoding || 'utf8', (error: Error | null | undefined) => {\n if (error) console.error('Transform error in write:', error);\n });\n return true;\n }\n\n async _flush(): Promise<void> {\n // // Ensure the pipeline is closed and flushed\n // redisClient.quit().catch(err => {\n // console.error('Redis connection error:', err);\n // });\n // callback();\n await new Promise(resolve => setTimeout(resolve, 10));\n }\n\n async _destroy(err: Error, cb: Function) {\n await closeLogger();\n cb(err);\n }\n\n getLogs(_args: {\n fromDate?: Date;\n toDate?: Date;\n logLevel?: LogLevel;\n filters?: Record<string, any>;\n returnPaginationResults?: boolean;\n page?: number;\n perPage?: number;\n }): Promise<{ logs: BaseLogMessage[]; total: number; page: number; perPage: number; hasMore: boolean }> {\n return Promise.resolve({\n logs: [],\n total: 0,\n page: _args?.page ?? 1,\n perPage: _args?.perPage ?? 100,\n hasMore: false,\n });\n }\n\n getLogsByRunId(_args?: {\n fromDate?: Date;\n toDate?: Date;\n logLevel?: LogLevel;\n filters?: Record<string, any>;\n returnPaginationResults?: boolean;\n page?: number;\n perPage?: number;\n }): Promise<{\n logs: BaseLogMessage[];\n total: number;\n page: number;\n perPage: number;\n hasMore: boolean;\n }> {\n return Promise.resolve({\n logs: [],\n total: 0,\n page: _args?.page ?? 1,\n perPage: _args?.perPage ?? 100,\n hasMore: false,\n });\n }\n}\n\nexport const transport = new RedisTransport();\n\nexport const closeLogger = async () => {\n if (redisClient.isOpen) {\n setTimeout(async () => {\n await redisClient.quit();\n }, 10);\n }\n};\n\nexport const logger = new PinoLogger({\n level: 'info',\n transports: {\n redis: transport,\n },\n});\n","import { Transform } from 'stream';\nimport { execa } from 'execa';\nimport { PROJECT_ENV_VARS, PROJECT_ROOT } from './constants.js';\nimport { logger } from './logger.js';\n\nexport const createPinoStream = () => {\n return new Transform({\n transform(chunk, encoding, callback) {\n // Convert Buffer/string to string and trim whitespace\n const line = chunk.toString().trim();\n\n if (line) {\n // Log each line through Pino\n logger.info(line);\n }\n\n // Pass through the original data\n callback(null, chunk);\n },\n });\n};\n\nexport async function runWithExeca({\n cmd,\n args,\n cwd = process.cwd(),\n env = PROJECT_ENV_VARS,\n}: {\n cmd: string;\n args: string[];\n cwd?: string;\n env?: Record<string, string>;\n}): Promise<{ stdout?: string; stderr?: string; success: boolean; error?: Error }> {\n const pinoStream = createPinoStream();\n\n try {\n const subprocess = execa(cmd, args, {\n cwd,\n env: {\n ...process.env,\n ...env,\n },\n });\n\n // Pipe stdout and stderr through the Pino stream\n subprocess.stdout?.pipe(pinoStream);\n subprocess.stderr?.pipe(pinoStream);\n\n const { stdout, stderr, exitCode } = await subprocess;\n return { stdout, stderr, success: exitCode === 0 };\n } catch (error) {\n logger.error(`Process failed: ${error}`);\n return { success: false, error: error instanceof Error ? error : new Error(String(error)) };\n }\n}\n\nexport function runWithChildProcess(cmd: string, args: string[]): { stdout?: string; stderr?: string } {\n const pinoStream = createPinoStream();\n\n try {\n const { stdout, stderr } = require('child_process').spawnSync(cmd, args, {\n cwd: PROJECT_ROOT,\n encoding: 'utf8',\n shell: true,\n env: {\n ...process.env,\n ...PROJECT_ENV_VARS,\n },\n maxBuffer: 1024 * 1024 * 10, // 10MB buffer\n });\n\n if (stdout) {\n pinoStream.write(stdout);\n }\n if (stderr) {\n pinoStream.write(stderr);\n }\n\n pinoStream.end();\n return { stdout, stderr };\n } catch (error) {\n logger.error('Process failed' + error);\n pinoStream.end();\n return {};\n }\n}\n","import * as fs from 'fs';\nimport { join, resolve } from 'path';\n\nimport { MastraError } from '@mastra/core/error';\nimport { runWithExeca } from './execa.js';\nimport { logger } from './logger.js';\n\nconst MEMOIZED = new Map();\n\nfunction findLockFile(dir: string): string | null {\n const lockFiles = ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', 'bun.lock'];\n for (const file of lockFiles) {\n if (fs.existsSync(join(dir, file))) {\n return file;\n }\n }\n const parentDir = resolve(dir, '..');\n if (parentDir !== dir) {\n return findLockFile(parentDir);\n }\n return null;\n}\n\nexport function detectPm({ path }: { path: string }): string {\n const cached = MEMOIZED.get(path);\n if (cached) {\n return cached;\n }\n\n const lockFile = findLockFile(path);\n let pm: string = 'npm';\n switch (lockFile) {\n case 'pnpm-lock.yaml':\n pm = 'pnpm';\n break;\n case 'package-lock.json':\n pm = 'npm';\n break;\n case 'yarn.lock':\n pm = 'yarn';\n break;\n case 'bun.lock':\n pm = 'bun';\n break;\n default:\n pm = 'npm';\n }\n\n MEMOIZED.set(path, pm);\n return pm;\n}\n\nexport async function installNodeVersion({ path }: { path: string }) {\n let nvmrcExists = false;\n let nodeVersionExists = false;\n\n try {\n fs.accessSync(join(path, '.nvmrc'));\n nvmrcExists = true;\n } catch {\n // File does not exist\n }\n\n try {\n fs.accessSync(join(path, '.node-version'));\n nodeVersionExists = true;\n } catch {\n // File does not exist\n }\n\n if (nvmrcExists || nodeVersionExists) {\n logger.info('Node version file found, installing specified Node.js version...');\n const { success, error } = await runWithExeca({\n cmd: 'n',\n args: ['auto'],\n cwd: path,\n });\n if (!success) {\n throw new MastraError(\n {\n id: 'NODE_FAIL_INSTALL_SPECIFIED_VERSION',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n }\n}\n\nexport async function installDeps({ path, pm }: { path: string; pm?: string }) {\n pm = pm ?? detectPm({ path });\n logger.info(`Installing dependencies with ${pm} in ${path}`);\n const args = ['install'];\n const { success, error } = await runWithExeca({ cmd: pm, args, cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_INSTALL_DEPS',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runInstallCommand({ path, installCommand }: { path: string; installCommand: string }) {\n logger.info(`Running install command ${installCommand} in workspace with ${path}`);\n const { success, error } = await runWithExeca({ cmd: 'sh', args: ['-c', installCommand], cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_CUSTOM_INSTALL_COMMAND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runScript({ scriptName, path, args }: { scriptName: string; path: string; args?: string[] }) {\n const pm = detectPm({ path });\n logger.info(`Running script ${scriptName} in workspace with ${pm}`);\n const { success, error } = await runWithExeca({\n cmd: pm,\n args: pm === 'npm' ? ['run', scriptName, ...(args ?? [])] : [scriptName, ...(args ?? [])],\n cwd: path,\n });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_BUILD_SCRIPT',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runBuildCommand({ command, path }: { command: string; path: string }) {\n logger.info(`Running build command ${command}`);\n const { success, error } = await runWithExeca({ cmd: 'sh', args: ['-c', command], cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_BUILD_COMMAND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n","import { join } from 'path';\nimport { MastraError } from '@mastra/core/error';\nimport { FileService } from '@mastra/deployer';\n\nimport { MASTRA_DIRECTORY } from './constants.js';\n\nexport function getMastraEntryFile(mastraDir: string) {\n try {\n const fileService = new FileService();\n return fileService.getFirstExistingFile([\n join(mastraDir, MASTRA_DIRECTORY, 'index.ts'),\n join(mastraDir, MASTRA_DIRECTORY, 'index.js'),\n ]);\n } catch (error) {\n throw new MastraError(\n {\n id: 'MASTRA_ENTRY_FILE_NOT_FOUND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n","import { PROJECT_ID, BUILD_ID, BUILD_URL, USER_IP_ADDRESS } from './constants.js';\n\nexport function successEntrypoint() {\n return `\n if (process.env.CI !== 'true') {\n await fetch('${process.env.REPORTER_API_URL}', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer ${process.env.REPORTER_API_URL_AUTH_TOKEN}',\n },\n body: JSON.stringify(${JSON.stringify({\n projectId: PROJECT_ID,\n buildId: BUILD_ID,\n status: 'success',\n url: BUILD_URL,\n userIpAddress: USER_IP_ADDRESS,\n })}),\n }).catch(err => {\n console.error('Failed to report build status to monitoring service', {\n error: err,\n });\n })\n }\n `;\n}\n","import { fileURLToPath } from 'node:url';\nimport { join, dirname } from 'path';\nimport { Deployer } from '@mastra/deployer';\nimport { copy } from 'fs-extra';\n\nimport { getAuthEntrypoint } from './utils/auth.js';\nimport { MASTRA_DIRECTORY, BUILD_ID, PROJECT_ID, TEAM_ID } from './utils/constants.js';\nimport { installDeps } from './utils/deps.js';\nimport { getMastraEntryFile } from './utils/file.js';\nimport { successEntrypoint } from './utils/report.js';\n\nexport class CloudDeployer extends Deployer {\n constructor() {\n super({ name: 'cloud' });\n }\n\n async deploy(_outputDirectory: string): Promise<void> {}\n async writeInstrumentationFile(outputDirectory: string) {\n const instrumentationFile = join(outputDirectory, 'instrumentation.mjs');\n const __dirname = dirname(fileURLToPath(import.meta.url));\n\n await copy(join(__dirname, '../templates', 'instrumentation-template.js'), instrumentationFile);\n }\n writePackageJson(outputDirectory: string, dependencies: Map<string, string>) {\n dependencies.set('@mastra/loggers', '0.10.6');\n dependencies.set('@mastra/libsql', '0.13.1');\n dependencies.set('@mastra/cloud', '0.1.7');\n return super.writePackageJson(outputDirectory, dependencies);\n }\n\n async lint() {}\n\n protected async installDependencies(outputDirectory: string, _rootDir = process.cwd()) {\n await installDeps({ path: join(outputDirectory, 'output'), pm: 'npm' });\n }\n\n async bundle(mastraDir: string, outputDirectory: string): Promise<void> {\n const currentCwd = process.cwd();\n process.chdir(mastraDir);\n\n const mastraEntryFile = getMastraEntryFile(mastraDir);\n\n const defaultToolsPath = join(mastraDir, MASTRA_DIRECTORY, 'tools');\n\n await this._bundle(\n this.getEntry(),\n mastraEntryFile,\n {\n outputDirectory,\n projectRoot: mastraDir,\n },\n [defaultToolsPath],\n );\n process.chdir(currentCwd);\n }\n\n getAuthEntrypoint() {\n return getAuthEntrypoint();\n }\n\n private getEntry(): string {\n return `\nimport { createNodeServer, getToolExports } from '#server';\nimport { tools } from '#tools';\nimport { mastra } from '#mastra';\nimport { MultiLogger } from '@mastra/core/logger';\nimport { PinoLogger } from '@mastra/loggers';\nimport { HttpTransport } from '@mastra/loggers/http';\nimport { evaluate } from '@mastra/core/eval';\nimport { AvailableHooks, registerHook } from '@mastra/core/hooks';\nimport { LibSQLStore, LibSQLVector } from '@mastra/libsql';\n\nconst startTime = process.env.RUNNER_START_TIME ? new Date(process.env.RUNNER_START_TIME).getTime() : Date.now();\nconst createNodeServerStartTime = Date.now();\n\nconsole.log(JSON.stringify({\n message: \"Server starting\",\n operation: 'builder.createNodeServer',\n operation_startTime: createNodeServerStartTime,\n type: \"READINESS\",\n startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n\nconst transports = {}\nif (process.env.CI !== 'true') {\n if (process.env.BUSINESS_API_RUNNER_LOGS_ENDPOINT) {\n transports.default = new HttpTransport({\n url: process.env.BUSINESS_API_RUNNER_LOGS_ENDPOINT,\n headers: {\n Authorization: 'Bearer ' + process.env.BUSINESS_JWT_TOKEN,\n },\n });\n }\n}\n\nconst logger = new PinoLogger({\n name: 'MastraCloud',\n transports,\n level: 'debug',\n});\nconst existingLogger = mastra?.getLogger();\nconst combinedLogger = existingLogger ? new MultiLogger([logger, existingLogger]) : logger;\n\nmastra.setLogger({ logger: combinedLogger });\n\nif (mastra?.storage) {\n mastra.storage.init()\n}\n\nif (process.env.MASTRA_STORAGE_URL && process.env.MASTRA_STORAGE_AUTH_TOKEN) {\n const { MastraStorage } = await import('@mastra/core/storage');\n logger.info('Using Mastra Cloud Storage: ' + process.env.MASTRA_STORAGE_URL)\n const storage = new LibSQLStore({\n url: process.env.MASTRA_STORAGE_URL,\n authToken: process.env.MASTRA_STORAGE_AUTH_TOKEN,\n })\n const vector = new LibSQLVector({\n connectionUrl: process.env.MASTRA_STORAGE_URL,\n authToken: process.env.MASTRA_STORAGE_AUTH_TOKEN,\n })\n\n await storage.init()\n mastra?.setStorage(storage)\n\n mastra?.memory?.setStorage(storage)\n mastra?.memory?.setVector(vector)\n\n registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {\n evaluate({\n agentName,\n input,\n metric,\n output,\n runId,\n globalRunId: runId,\n instructions,\n });\n });\n registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {\n if (mastra?.storage) {\n await mastra.storage.insert({\n tableName: MastraStorage.TABLE_EVALS,\n record: {\n input: traceObject.input,\n output: traceObject.output,\n result: JSON.stringify(traceObject.result),\n agent_name: traceObject.agentName,\n metric_name: traceObject.metricName,\n instructions: traceObject.instructions,\n test_info: null,\n global_run_id: traceObject.globalRunId,\n run_id: traceObject.runId,\n created_at: new Date().toISOString(),\n },\n });\n }\n });\n}\n\n${getAuthEntrypoint()}\n\nawait createNodeServer(mastra, { playground: false, swaggerUI: false, tools: getToolExports(tools) });\n\n${successEntrypoint()}\n\nconsole.log(JSON.stringify({\n message: \"Server started\",\n operation: 'builder.createNodeServer',\n operation_startTime: createNodeServerStartTime,\n operation_durationMs: Date.now() - createNodeServerStartTime,\n type: \"READINESS\",\n startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n\n\nconsole.log(JSON.stringify({\n message: \"Runner Initialized\",\n type: \"READINESS\",\n startTime,\n durationMs: Date.now() - startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n`;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/auth.ts","../src/utils/constants.ts","../src/utils/logger.ts","../src/utils/execa.ts","../src/utils/deps.ts","../src/utils/file.ts","../src/utils/report.ts","../src/index.ts"],"names":["resolve","join","MastraError"],"mappings":";;;;;;;;;;;;;;;;AAAO,SAAS,iBAAA,GAAoB;AAClC,EAAA,OAAO;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,QAAA,EAaC,OAAA,CAAQ,IAAI,oBAAA,GAAuB,CAAA,kBAAA,EAAqB,QAAQ,GAAA,CAAI,oBAAoB,QAAQ,EAAE;AAAA,QAAA,EAClG,OAAA,CAAQ,IAAI,kBAAA,GAAqB,CAAA,kBAAA,EAAqB,QAAQ,GAAA,CAAI,kBAAkB,QAAQ,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA,CAAA;AA0BxG;ACvCO,IAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,KAAA,KAAU,MAAA;AACpC,IAAM,OAAA,GAAk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;AAAA;AAAA;;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA,EAoFtB,mBAAmB;;AAAA;;AAAA,EAInB,mBAAmB;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAA,EAUN,OAAO,CAAA;AAAA,gBAAA,EACJ,UAAU,CAAA;AAAA,cAAA,EACZ,QAAQ,CAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAA,EAWT,OAAO,CAAA;AAAA,gBAAA,EACJ,UAAU,CAAA;AAAA,cAAA,EACZ,QAAQ,CAAA;AAAA;AAAA;AAAA,CAAA;AAAA,EAItB;AACF","file":"index.js","sourcesContent":["export function getAuthEntrypoint() {\n return `\n import { MastraAuthProvider } from '@mastra/core/server';\n\n class MastraCloudAuth extends MastraAuthProvider {\n constructor (auth) {\n super()\n this.auth = auth\n }\n\n async authenticateToken (...args) {\n if (typeof args[0] === 'string') {\n const token = args[0].replace('Bearer ', '');\n const validTokens = [];\n ${process.env.PLAYGROUND_JWT_TOKEN ? `validTokens.push('${process.env.PLAYGROUND_JWT_TOKEN}');` : ''}\n ${process.env.BUSINESS_JWT_TOKEN ? `validTokens.push('${process.env.BUSINESS_JWT_TOKEN}');` : ''}\n \n if (validTokens.includes(token)) {\n return { id: 'business-api' }\n }\n }\n return this.auth.authenticateToken(...args)\n }\n\n async authorizeUser (...args) {\n if (args[1] && args[1].path === '/api') {\n return true\n }\n if (args[0] && args[0].id === 'business-api') {\n return true\n }\n return this.auth.authorizeUser(...args)\n }\n }\n\n const serverConfig = mastra.getServer()\n if (serverConfig && serverConfig.experimental_auth) {\n const auth = serverConfig.experimental_auth\n serverConfig.experimental_auth = new MastraCloudAuth(auth)\n }\n `;\n}\n","import os from 'os';\n\nexport const LOCAL = process.env.LOCAL === 'true';\nexport const TEAM_ID: string = process.env.TEAM_ID ?? '';\nexport const PROJECT_ID: string = process.env.PROJECT_ID ?? '';\nexport const BUILD_ID: string = process.env.BUILD_ID ?? '';\nexport const BUILD_URL: string = process.env.BUILD_URL ?? '';\nexport const LOG_REDIS_URL: string = process.env.LOG_REDIS_URL ?? 'redis://localhost:6379';\nexport const BUSINESS_JWT_TOKEN: string = process.env.BUSINESS_JWT_TOKEN ?? '';\nexport const PLAYGROUND_JWT_TOKEN: string = process.env.PLAYGROUND_JWT_TOKEN ?? '';\nexport const USER_IP_ADDRESS: string = process.env.USER_IP_ADDRESS ?? '';\nexport const MASTRA_DIRECTORY: string = process.env.MASTRA_DIRECTORY ?? 'src/mastra';\nexport const PROJECT_ENV_VARS: Record<string, string> = safelyParseJson(process.env.PROJECT_ENV_VARS ?? '{}');\n\nexport const PROJECT_ROOT = LOCAL ? os.tmpdir() + '/project' : (process.env.PROJECT_ROOT ?? '/project');\n\nexport function safelyParseJson(json: string) {\n try {\n return JSON.parse(json);\n } catch {\n return {};\n }\n}\n","import type { TransformCallback } from 'stream';\nimport type { BaseLogMessage, LogLevel } from '@mastra/core/logger';\nimport { LoggerTransport } from '@mastra/core/logger';\nimport { PinoLogger } from '@mastra/loggers';\nimport { createClient } from 'redis';\nimport { BUILD_ID, LOG_REDIS_URL, PROJECT_ID, TEAM_ID } from './constants.js';\n\nconst redisClient = createClient({\n url: LOG_REDIS_URL,\n});\n\nclass RedisTransport extends LoggerTransport {\n _transform(chunk: any, _encoding: string, callback: TransformCallback): void {\n chunk = chunk.toString();\n const logKey = `builder:logs:${TEAM_ID}:${PROJECT_ID}:${BUILD_ID}`;\n const ttl = 2 * 24 * 60 * 60; // 2 days in seconds\n const logData = typeof chunk === 'string' ? chunk : JSON.stringify(chunk);\n\n // Don't block the event loop - process logs asynchronously\n process.nextTick(async () => {\n try {\n // Connect to Redis if not already connected\n if (!redisClient.isOpen) {\n await redisClient.connect().catch(err => {\n console.error('Redis connection error:', err);\n });\n }\n\n // Use pipeline to batch Redis operations\n const pipeline = redisClient.multi();\n pipeline.rPush(logKey, logData);\n pipeline.expire(logKey, ttl);\n await pipeline.exec();\n } catch (err) {\n console.error('Redis logging error:', err);\n }\n });\n\n // Immediately pass through the chunk without waiting\n callback(null, chunk);\n }\n\n _write(chunk: any, encoding?: string, callback?: (error?: Error | null) => void): boolean {\n if (typeof callback === 'function') {\n this._transform(chunk, encoding || 'utf8', callback);\n return true;\n }\n\n this._transform(chunk, encoding || 'utf8', (error: Error | null | undefined) => {\n if (error) console.error('Transform error in write:', error);\n });\n return true;\n }\n\n async _flush(): Promise<void> {\n // // Ensure the pipeline is closed and flushed\n // redisClient.quit().catch(err => {\n // console.error('Redis connection error:', err);\n // });\n // callback();\n await new Promise(resolve => setTimeout(resolve, 10));\n }\n\n async _destroy(err: Error, cb: Function) {\n await closeLogger();\n cb(err);\n }\n\n getLogs(_args: {\n fromDate?: Date;\n toDate?: Date;\n logLevel?: LogLevel;\n filters?: Record<string, any>;\n returnPaginationResults?: boolean;\n page?: number;\n perPage?: number;\n }): Promise<{ logs: BaseLogMessage[]; total: number; page: number; perPage: number; hasMore: boolean }> {\n return Promise.resolve({\n logs: [],\n total: 0,\n page: _args?.page ?? 1,\n perPage: _args?.perPage ?? 100,\n hasMore: false,\n });\n }\n\n getLogsByRunId(_args?: {\n fromDate?: Date;\n toDate?: Date;\n logLevel?: LogLevel;\n filters?: Record<string, any>;\n returnPaginationResults?: boolean;\n page?: number;\n perPage?: number;\n }): Promise<{\n logs: BaseLogMessage[];\n total: number;\n page: number;\n perPage: number;\n hasMore: boolean;\n }> {\n return Promise.resolve({\n logs: [],\n total: 0,\n page: _args?.page ?? 1,\n perPage: _args?.perPage ?? 100,\n hasMore: false,\n });\n }\n}\n\nexport const transport = new RedisTransport();\n\nexport const closeLogger = async () => {\n if (redisClient.isOpen) {\n setTimeout(async () => {\n await redisClient.quit();\n }, 10);\n }\n};\n\nexport const logger = new PinoLogger({\n level: 'info',\n transports: {\n redis: transport,\n },\n});\n","import { Transform } from 'stream';\nimport { execa } from 'execa';\nimport { PROJECT_ENV_VARS, PROJECT_ROOT } from './constants.js';\nimport { logger } from './logger.js';\n\nexport const createPinoStream = () => {\n return new Transform({\n transform(chunk, encoding, callback) {\n // Convert Buffer/string to string and trim whitespace\n const line = chunk.toString().trim();\n\n if (line) {\n // Log each line through Pino\n logger.info(line);\n }\n\n // Pass through the original data\n callback(null, chunk);\n },\n });\n};\n\nexport async function runWithExeca({\n cmd,\n args,\n cwd = process.cwd(),\n env = PROJECT_ENV_VARS,\n}: {\n cmd: string;\n args: string[];\n cwd?: string;\n env?: Record<string, string>;\n}): Promise<{ stdout?: string; stderr?: string; success: boolean; error?: Error }> {\n const pinoStream = createPinoStream();\n\n try {\n const subprocess = execa(cmd, args, {\n cwd,\n env: {\n ...process.env,\n ...env,\n },\n });\n\n // Pipe stdout and stderr through the Pino stream\n subprocess.stdout?.pipe(pinoStream);\n subprocess.stderr?.pipe(pinoStream);\n\n const { stdout, stderr, exitCode } = await subprocess;\n return { stdout, stderr, success: exitCode === 0 };\n } catch (error) {\n logger.error(`Process failed: ${error}`);\n return { success: false, error: error instanceof Error ? error : new Error(String(error)) };\n }\n}\n\nexport function runWithChildProcess(cmd: string, args: string[]): { stdout?: string; stderr?: string } {\n const pinoStream = createPinoStream();\n\n try {\n const { stdout, stderr } = require('child_process').spawnSync(cmd, args, {\n cwd: PROJECT_ROOT,\n encoding: 'utf8',\n shell: true,\n env: {\n ...process.env,\n ...PROJECT_ENV_VARS,\n },\n maxBuffer: 1024 * 1024 * 10, // 10MB buffer\n });\n\n if (stdout) {\n pinoStream.write(stdout);\n }\n if (stderr) {\n pinoStream.write(stderr);\n }\n\n pinoStream.end();\n return { stdout, stderr };\n } catch (error) {\n logger.error('Process failed' + error);\n pinoStream.end();\n return {};\n }\n}\n","import * as fs from 'fs';\nimport { join, resolve } from 'path';\n\nimport { MastraError } from '@mastra/core/error';\nimport { runWithExeca } from './execa.js';\nimport { logger } from './logger.js';\n\nconst MEMOIZED = new Map();\n\nfunction findLockFile(dir: string): string | null {\n const lockFiles = ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', 'bun.lock'];\n for (const file of lockFiles) {\n if (fs.existsSync(join(dir, file))) {\n return file;\n }\n }\n const parentDir = resolve(dir, '..');\n if (parentDir !== dir) {\n return findLockFile(parentDir);\n }\n return null;\n}\n\nexport function detectPm({ path }: { path: string }): string {\n const cached = MEMOIZED.get(path);\n if (cached) {\n return cached;\n }\n\n const lockFile = findLockFile(path);\n let pm: string = 'npm';\n switch (lockFile) {\n case 'pnpm-lock.yaml':\n pm = 'pnpm';\n break;\n case 'package-lock.json':\n pm = 'npm';\n break;\n case 'yarn.lock':\n pm = 'yarn';\n break;\n case 'bun.lock':\n pm = 'bun';\n break;\n default:\n pm = 'npm';\n }\n\n MEMOIZED.set(path, pm);\n return pm;\n}\n\nexport async function installNodeVersion({ path }: { path: string }) {\n let nvmrcExists = false;\n let nodeVersionExists = false;\n\n try {\n fs.accessSync(join(path, '.nvmrc'));\n nvmrcExists = true;\n } catch {\n // File does not exist\n }\n\n try {\n fs.accessSync(join(path, '.node-version'));\n nodeVersionExists = true;\n } catch {\n // File does not exist\n }\n\n if (nvmrcExists || nodeVersionExists) {\n logger.info('Node version file found, installing specified Node.js version...');\n const { success, error } = await runWithExeca({\n cmd: 'n',\n args: ['auto'],\n cwd: path,\n });\n if (!success) {\n throw new MastraError(\n {\n id: 'NODE_FAIL_INSTALL_SPECIFIED_VERSION',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n }\n}\n\nexport async function installDeps({ path, pm }: { path: string; pm?: string }) {\n pm = pm ?? detectPm({ path });\n logger.info(`Installing dependencies with ${pm} in ${path}`);\n const args = ['install'];\n const { success, error } = await runWithExeca({ cmd: pm, args, cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_INSTALL_DEPS',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runInstallCommand({ path, installCommand }: { path: string; installCommand: string }) {\n logger.info(`Running install command ${installCommand} in workspace with ${path}`);\n const { success, error } = await runWithExeca({ cmd: 'sh', args: ['-c', installCommand], cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_CUSTOM_INSTALL_COMMAND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runScript({ scriptName, path, args }: { scriptName: string; path: string; args?: string[] }) {\n const pm = detectPm({ path });\n logger.info(`Running script ${scriptName} in workspace with ${pm}`);\n const { success, error } = await runWithExeca({\n cmd: pm,\n args: pm === 'npm' ? ['run', scriptName, ...(args ?? [])] : [scriptName, ...(args ?? [])],\n cwd: path,\n });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_BUILD_SCRIPT',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n\nexport async function runBuildCommand({ command, path }: { command: string; path: string }) {\n logger.info(`Running build command ${command}`);\n const { success, error } = await runWithExeca({ cmd: 'sh', args: ['-c', command], cwd: path });\n if (!success) {\n throw new MastraError(\n {\n id: 'FAIL_BUILD_COMMAND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n","import { join } from 'path';\nimport { MastraError } from '@mastra/core/error';\nimport { FileService } from '@mastra/deployer';\n\nimport { MASTRA_DIRECTORY } from './constants.js';\n\nexport function getMastraEntryFile(mastraDir: string) {\n try {\n const fileService = new FileService();\n return fileService.getFirstExistingFile([\n join(mastraDir, MASTRA_DIRECTORY, 'index.ts'),\n join(mastraDir, MASTRA_DIRECTORY, 'index.js'),\n ]);\n } catch (error) {\n throw new MastraError(\n {\n id: 'MASTRA_ENTRY_FILE_NOT_FOUND',\n category: 'USER',\n domain: 'DEPLOYER',\n },\n error,\n );\n }\n}\n","import { PROJECT_ID, BUILD_ID, BUILD_URL, USER_IP_ADDRESS } from './constants.js';\n\nexport function successEntrypoint() {\n return `\n if (process.env.CI !== 'true') {\n await fetch('${process.env.REPORTER_API_URL}', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer ${process.env.REPORTER_API_URL_AUTH_TOKEN}',\n },\n body: JSON.stringify(${JSON.stringify({\n projectId: PROJECT_ID,\n buildId: BUILD_ID,\n status: 'success',\n url: BUILD_URL,\n userIpAddress: USER_IP_ADDRESS,\n })}),\n }).catch(err => {\n console.error('Failed to report build status to monitoring service', {\n error: err,\n });\n })\n }\n `;\n}\n","import { fileURLToPath } from 'node:url';\nimport { join, dirname } from 'path';\nimport { Deployer } from '@mastra/deployer';\nimport { copy, readJSON } from 'fs-extra/esm';\n\nimport { getAuthEntrypoint } from './utils/auth.js';\nimport { MASTRA_DIRECTORY, BUILD_ID, PROJECT_ID, TEAM_ID } from './utils/constants.js';\nimport { installDeps } from './utils/deps.js';\nimport { getMastraEntryFile } from './utils/file.js';\nimport { successEntrypoint } from './utils/report.js';\n\nexport class CloudDeployer extends Deployer {\n constructor() {\n super({ name: 'cloud' });\n }\n\n async deploy(_outputDirectory: string): Promise<void> {}\n async writeInstrumentationFile(outputDirectory: string) {\n const instrumentationFile = join(outputDirectory, 'instrumentation.mjs');\n const __dirname = dirname(fileURLToPath(import.meta.url));\n\n await copy(join(__dirname, '../templates', 'instrumentation-template.js'), instrumentationFile);\n }\n async writePackageJson(outputDirectory: string, dependencies: Map<string, string>) {\n const versions = (await readJSON(join(dirname(fileURLToPath(import.meta.url)), '../versions.json'))) as\n | Record<string, string>\n | undefined;\n for (const [pkgName, version] of Object.entries(versions || {})) {\n dependencies.set(pkgName, version);\n }\n\n return super.writePackageJson(outputDirectory, dependencies);\n }\n\n async lint() {}\n\n protected async installDependencies(outputDirectory: string, _rootDir = process.cwd()) {\n await installDeps({ path: join(outputDirectory, 'output'), pm: 'npm' });\n }\n\n async bundle(mastraDir: string, outputDirectory: string): Promise<void> {\n const currentCwd = process.cwd();\n process.chdir(mastraDir);\n\n const mastraEntryFile = getMastraEntryFile(mastraDir);\n\n const defaultToolsPath = join(mastraDir, MASTRA_DIRECTORY, 'tools');\n\n await this._bundle(\n this.getEntry(),\n mastraEntryFile,\n {\n outputDirectory,\n projectRoot: mastraDir,\n },\n [defaultToolsPath],\n );\n process.chdir(currentCwd);\n }\n\n getAuthEntrypoint() {\n return getAuthEntrypoint();\n }\n\n private getEntry(): string {\n return `\nimport { createNodeServer, getToolExports } from '#server';\nimport { tools } from '#tools';\nimport { mastra } from '#mastra';\nimport { MultiLogger } from '@mastra/core/logger';\nimport { PinoLogger } from '@mastra/loggers';\nimport { HttpTransport } from '@mastra/loggers/http';\nimport { evaluate } from '@mastra/core/eval';\nimport { AvailableHooks, registerHook } from '@mastra/core/hooks';\nimport { LibSQLStore, LibSQLVector } from '@mastra/libsql';\nimport { scoreTracesWorkflow } from '@mastra/core/scores/scoreTraces';\nconst startTime = process.env.RUNNER_START_TIME ? new Date(process.env.RUNNER_START_TIME).getTime() : Date.now();\nconst createNodeServerStartTime = Date.now();\n\nconsole.log(JSON.stringify({\n message: \"Server starting\",\n operation: 'builder.createNodeServer',\n operation_startTime: createNodeServerStartTime,\n type: \"READINESS\",\n startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n\nconst transports = {}\nif (process.env.CI !== 'true') {\n if (process.env.BUSINESS_API_RUNNER_LOGS_ENDPOINT) {\n transports.default = new HttpTransport({\n url: process.env.BUSINESS_API_RUNNER_LOGS_ENDPOINT,\n headers: {\n Authorization: 'Bearer ' + process.env.BUSINESS_JWT_TOKEN,\n },\n });\n }\n}\n\nconst logger = new PinoLogger({\n name: 'MastraCloud',\n transports,\n level: 'debug',\n});\nconst existingLogger = mastra?.getLogger();\nconst combinedLogger = existingLogger ? new MultiLogger([logger, existingLogger]) : logger;\n\nmastra.setLogger({ logger: combinedLogger });\n\nif (mastra?.storage) {\n mastra.storage.init()\n}\n\nif (process.env.MASTRA_STORAGE_URL && process.env.MASTRA_STORAGE_AUTH_TOKEN) {\n const { MastraStorage } = await import('@mastra/core/storage');\n logger.info('Using Mastra Cloud Storage: ' + process.env.MASTRA_STORAGE_URL)\n const storage = new LibSQLStore({\n url: process.env.MASTRA_STORAGE_URL,\n authToken: process.env.MASTRA_STORAGE_AUTH_TOKEN,\n })\n const vector = new LibSQLVector({\n connectionUrl: process.env.MASTRA_STORAGE_URL,\n authToken: process.env.MASTRA_STORAGE_AUTH_TOKEN,\n })\n\n await storage.init()\n mastra?.setStorage(storage)\n\n mastra?.memory?.setStorage(storage)\n mastra?.memory?.setVector(vector)\n\n registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {\n evaluate({\n agentName,\n input,\n metric,\n output,\n runId,\n globalRunId: runId,\n instructions,\n });\n });\n registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {\n if (mastra?.storage) {\n await mastra.storage.insert({\n tableName: MastraStorage.TABLE_EVALS,\n record: {\n input: traceObject.input,\n output: traceObject.output,\n result: JSON.stringify(traceObject.result),\n agent_name: traceObject.agentName,\n metric_name: traceObject.metricName,\n instructions: traceObject.instructions,\n test_info: null,\n global_run_id: traceObject.globalRunId,\n run_id: traceObject.runId,\n created_at: new Date().toISOString(),\n },\n });\n }\n });\n}\n\nif (mastra?.getStorage()) {\n mastra.__registerInternalWorkflow(scoreTracesWorkflow);\n}\n\n${getAuthEntrypoint()}\n\nawait createNodeServer(mastra, { playground: false, swaggerUI: false, tools: getToolExports(tools) });\n\n${successEntrypoint()}\n\nconsole.log(JSON.stringify({\n message: \"Server started\",\n operation: 'builder.createNodeServer',\n operation_startTime: createNodeServerStartTime,\n operation_durationMs: Date.now() - createNodeServerStartTime,\n type: \"READINESS\",\n startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n\n\nconsole.log(JSON.stringify({\n message: \"Runner Initialized\",\n type: \"READINESS\",\n startTime,\n durationMs: Date.now() - startTime,\n metadata: {\n teamId: \"${TEAM_ID}\",\n projectId: \"${PROJECT_ID}\",\n buildId: \"${BUILD_ID}\",\n },\n}));\n`;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,WAkChC"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,WAyChC"}
@@ -5,6 +5,7 @@ export declare const BUILD_ID: string;
5
5
  export declare const BUILD_URL: string;
6
6
  export declare const LOG_REDIS_URL: string;
7
7
  export declare const BUSINESS_JWT_TOKEN: string;
8
+ export declare const PLAYGROUND_JWT_TOKEN: string;
8
9
  export declare const USER_IP_ADDRESS: string;
9
10
  export declare const MASTRA_DIRECTORY: string;
10
11
  export declare const PROJECT_ENV_VARS: Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,SAA+B,CAAC;AAClD,eAAO,MAAM,OAAO,EAAE,MAAkC,CAAC;AACzD,eAAO,MAAM,UAAU,EAAE,MAAqC,CAAC;AAC/D,eAAO,MAAM,QAAQ,EAAE,MAAmC,CAAC;AAC3D,eAAO,MAAM,SAAS,EAAE,MAAoC,CAAC;AAC7D,eAAO,MAAM,aAAa,EAAE,MAA8D,CAAC;AAC3F,eAAO,MAAM,kBAAkB,EAAE,MAA6C,CAAC;AAC/E,eAAO,MAAM,eAAe,EAAE,MAA0C,CAAC;AACzE,eAAO,MAAM,gBAAgB,EAAE,MAAqD,CAAC;AACrF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAyD,CAAC;AAE9G,eAAO,MAAM,YAAY,QAA8E,CAAC;AAExG,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,OAM3C"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,SAA+B,CAAC;AAClD,eAAO,MAAM,OAAO,EAAE,MAAkC,CAAC;AACzD,eAAO,MAAM,UAAU,EAAE,MAAqC,CAAC;AAC/D,eAAO,MAAM,QAAQ,EAAE,MAAmC,CAAC;AAC3D,eAAO,MAAM,SAAS,EAAE,MAAoC,CAAC;AAC7D,eAAO,MAAM,aAAa,EAAE,MAA8D,CAAC;AAC3F,eAAO,MAAM,kBAAkB,EAAE,MAA6C,CAAC;AAC/E,eAAO,MAAM,oBAAoB,EAAE,MAA+C,CAAC;AACnF,eAAO,MAAM,eAAe,EAAE,MAA0C,CAAC;AACzE,eAAO,MAAM,gBAAgB,EAAE,MAAqD,CAAC;AACrF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAyD,CAAC;AAE9G,eAAO,MAAM,YAAY,QAA8E,CAAC;AAExG,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,OAM3C"}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@mastra/deployer-cloud",
3
- "version": "0.0.0-toolOptionTypes-20250917085558",
3
+ "version": "0.0.0-usechat-duplicate-20251016110554",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
8
8
  "CHANGELOG.md",
9
- "templates"
9
+ "templates",
10
+ "versions.json"
10
11
  ],
11
12
  "main": "dist/index.js",
12
13
  "types": "dist/index.d.ts",
@@ -27,24 +28,25 @@
27
28
  "license": "Apache-2.0",
28
29
  "dependencies": {
29
30
  "execa": "^9.6.0",
30
- "fs-extra": "^11.3.1",
31
+ "fs-extra": "^11.3.2",
31
32
  "pino": "^9.7.0",
32
- "redis": "^5.8.2",
33
- "@mastra/loggers": "0.0.0-toolOptionTypes-20250917085558",
34
- "@mastra/deployer": "0.0.0-toolOptionTypes-20250917085558"
33
+ "redis": "^5.8.3",
34
+ "@mastra/deployer": "0.0.0-usechat-duplicate-20251016110554",
35
+ "@mastra/loggers": "0.0.0-usechat-duplicate-20251016110554"
35
36
  },
36
37
  "devDependencies": {
38
+ "@manypkg/get-packages": "^3.1.0",
37
39
  "@types/fs-extra": "^11.0.4",
38
40
  "@types/node": "^20.19.0",
39
- "eslint": "^9.30.1",
41
+ "eslint": "^9.36.0",
40
42
  "tsup": "^8.5.0",
41
43
  "typescript": "^5.8.3",
42
44
  "vitest": "^3.2.4",
43
- "@internal/lint": "0.0.0-toolOptionTypes-20250917085558",
44
- "@internal/types-builder": "0.0.0-toolOptionTypes-20250917085558"
45
+ "@internal/lint": "0.0.0-usechat-duplicate-20251016110554",
46
+ "@internal/types-builder": "0.0.0-usechat-duplicate-20251016110554"
45
47
  },
46
48
  "peerDependencies": {
47
- "@mastra/core": "0.15.3-alpha.6"
49
+ "@mastra/core": "0.20.1-alpha.0"
48
50
  },
49
51
  "repository": {
50
52
  "type": "git",
package/versions.json ADDED
@@ -0,0 +1 @@
1
+ {"@mastra/cloud":"0.0.0-usechat-duplicate-20251016110554","@mastra/loggers":"0.0.0-usechat-duplicate-20251016110554","@mastra/libsql":"0.0.0-usechat-duplicate-20251016110554"}