@mastra/server 0.0.0-main-test-20251105183450 → 0.0.0-main-test-05-11-2025-2-20251105223343
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -3
- package/dist/{chunk-46Z2KDQL.js → chunk-3AMNUUZF.js} +11 -11
- package/dist/chunk-3AMNUUZF.js.map +1 -0
- package/dist/{chunk-GTZOYEAU.cjs → chunk-A24TSVEZ.cjs} +12 -12
- package/dist/chunk-A24TSVEZ.cjs.map +1 -0
- package/dist/{chunk-MMQIJZ2Q.cjs → chunk-M6KNPIZZ.cjs} +20 -26
- package/dist/chunk-M6KNPIZZ.cjs.map +1 -0
- package/dist/{chunk-UU7MMOP5.js → chunk-QXWWLCTQ.js} +4 -9
- package/dist/chunk-QXWWLCTQ.js.map +1 -0
- package/dist/{chunk-AEVI2HIU.cjs → chunk-SRAPUMPM.cjs} +2 -33
- package/dist/chunk-SRAPUMPM.cjs.map +1 -0
- package/dist/{chunk-R6OQFR47.js → chunk-TWHS6DKL.js} +3 -33
- package/dist/{chunk-AEVI2HIU.cjs.map → chunk-TWHS6DKL.js.map} +1 -1
- package/dist/server/handlers/agent-builder.cjs +19 -23
- package/dist/server/handlers/agent-builder.d.ts +0 -6
- package/dist/server/handlers/agent-builder.d.ts.map +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/observability.cjs +7 -7
- package/dist/server/handlers/observability.d.ts +7 -7
- package/dist/server/handlers/observability.d.ts.map +1 -1
- package/dist/server/handlers/observability.js +1 -1
- package/dist/server/handlers/workflows.cjs +19 -23
- package/dist/server/handlers/workflows.d.ts +0 -6
- package/dist/server/handlers/workflows.d.ts.map +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +6 -6
- package/dist/server/handlers.js +3 -3
- package/package.json +7 -7
- package/dist/chunk-46Z2KDQL.js.map +0 -1
- package/dist/chunk-GTZOYEAU.cjs.map +0 -1
- package/dist/chunk-MMQIJZ2Q.cjs.map +0 -1
- package/dist/chunk-R6OQFR47.js.map +0 -1
- package/dist/chunk-UU7MMOP5.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mastra/server
|
|
2
2
|
|
|
3
|
-
## 0.0.0-main-test-
|
|
3
|
+
## 0.0.0-main-test-05-11-2025-2-20251105223343
|
|
4
4
|
|
|
5
5
|
### Major Changes
|
|
6
6
|
|
|
@@ -142,6 +142,8 @@
|
|
|
142
142
|
|
|
143
143
|
- Remove `getThreadsByResourceId` and `getThreadsByResourceIdPaginated` methods from storage interfaces in favor of `listThreadsByResourceId`. The new method uses `offset`/`limit` pagination and a nested `orderBy` object structure (`{ field, direction }`). ([#9536](https://github.com/mastra-ai/mastra/pull/9536))
|
|
144
144
|
|
|
145
|
+
- Renamed a bunch of observability/tracing-related things to drop the AI prefix. ([#9744](https://github.com/mastra-ai/mastra/pull/9744))
|
|
146
|
+
|
|
145
147
|
- **Breaking Change**: Remove legacy v1 watch events and consolidate on v2 implementation. ([#9252](https://github.com/mastra-ai/mastra/pull/9252))
|
|
146
148
|
|
|
147
149
|
This change simplifies the workflow watching API by removing the legacy v1 event system and promoting v2 as the standard (renamed to just `watch`).
|
|
@@ -335,12 +337,14 @@
|
|
|
335
337
|
|
|
336
338
|
- Make step optional in resumeStreamVNext API ([#9453](https://github.com/mastra-ai/mastra/pull/9453))
|
|
337
339
|
|
|
340
|
+
- Remove `waitForEvent` from workflows. `waitForEvent` is now removed, please use suspend & resume flow instead. See https://mastra.ai/en/docs/workflows/suspend-and-resume for more details on suspend & resume flow. ([#9214](https://github.com/mastra-ai/mastra/pull/9214))
|
|
341
|
+
|
|
338
342
|
- Use memory mock in server tests ([#9486](https://github.com/mastra-ai/mastra/pull/9486))
|
|
339
343
|
|
|
340
344
|
- Remove format from stream/generate ([#9577](https://github.com/mastra-ai/mastra/pull/9577))
|
|
341
345
|
|
|
342
|
-
- Updated dependencies [[`f743dbb`](https://github.com/mastra-ai/mastra/commit/f743dbb8b40d1627b5c10c0e6fc154f4ebb6e394), [`fec5129`](https://github.com/mastra-ai/mastra/commit/fec5129de7fc64423ea03661a56cef31dc747a0d), [`0491e7c`](https://github.com/mastra-ai/mastra/commit/0491e7c9b714cb0ba22187ee062147ec2dd7c712), [`0e8ed46`](https://github.com/mastra-ai/mastra/commit/0e8ed467c54d6901a6a365f270ec15d6faadb36c), [`6c049d9`](https://github.com/mastra-ai/mastra/commit/6c049d94063fdcbd5b81c4912a2bf82a92c9cc0b), [`3443770`](https://github.com/mastra-ai/mastra/commit/3443770662df8eb24c9df3589b2792d78cfcb811), [`f0a07e0`](https://github.com/mastra-ai/mastra/commit/f0a07e0111b3307c5fabfa4094c5c2cfb734fbe6), [`aaa40e7`](https://github.com/mastra-ai/mastra/commit/aaa40e788628b319baa8e889407d11ad626547fa), [`1521d71`](https://github.com/mastra-ai/mastra/commit/1521d716e5daedc74690c983fbd961123c56756b), [`9e1911d`](https://github.com/mastra-ai/mastra/commit/9e1911db2b4db85e0e768c3f15e0d61e319869f6), [`ebac155`](https://github.com/mastra-ai/mastra/commit/ebac15564a590117db7078233f927a7e28a85106), [`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`5948e6a`](https://github.com/mastra-ai/mastra/commit/5948e6a5146c83666ba3f294b2be576c82a513fb), [`8940859`](https://github.com/mastra-ai/mastra/commit/89408593658199b4ad67f7b65e888f344e64a442), [`e629310`](https://github.com/mastra-ai/mastra/commit/e629310f1a73fa236d49ec7a1d1cceb6229dc7cc), [`4c6b492`](https://github.com/mastra-ai/mastra/commit/4c6b492c4dd591c6a592520c1f6855d6e936d71f), [`dff01d8`](https://github.com/mastra-ai/mastra/commit/dff01d81ce1f4e4087cfac20fa868e6db138dd14), [`9d819d5`](https://github.com/mastra-ai/mastra/commit/9d819d54b61481639f4008e4694791bddf187edd), [`71c8d6c`](https://github.com/mastra-ai/mastra/commit/71c8d6c161253207b2b9588bdadb7eed604f7253), [`6179a9b`](https://github.com/mastra-ai/mastra/commit/6179a9ba36ffac326de3cc3c43cdc8028d37c251), [`00f4921`](https://github.com/mastra-ai/mastra/commit/00f4921dd2c91a1e5446799599ef7116a8214a1a), [`ca8041c`](https://github.com/mastra-ai/mastra/commit/ca8041cce0379fda22ed293a565bcb5b6ddca68a), [`7051bf3`](https://github.com/mastra-ai/mastra/commit/7051bf38b3b122a069008f861f7bfc004a6d9f6e), [`a8f1494`](https://github.com/mastra-ai/mastra/commit/a8f1494f4bbdc2770bcf327d4c7d869e332183f1), [`0793497`](https://github.com/mastra-ai/mastra/commit/079349753620c40246ffd673e3f9d7d9820beff3), [`5df9cce`](https://github.com/mastra-ai/mastra/commit/5df9cce1a753438413f64c11eeef8f845745c2a8), [`a854ede`](https://github.com/mastra-ai/mastra/commit/a854ede62bf5ac0945a624ac48913dd69c73aabf), [`c576fc0`](https://github.com/mastra-ai/mastra/commit/c576fc0b100b2085afded91a37c97a0ea0ec09c7), [`3defc80`](https://github.com/mastra-ai/mastra/commit/3defc80cf2b88a1b7fc1cc4ddcb91e982a614609), [`16153fe`](https://github.com/mastra-ai/mastra/commit/16153fe7eb13c99401f48e6ca32707c965ee28b9), [`9f4a683`](https://github.com/mastra-ai/mastra/commit/9f4a6833e88b52574665c028fd5508ad5c2f6004), [`bc94344`](https://github.com/mastra-ai/mastra/commit/bc943444a1342d8a662151b7bce1df7dae32f59c), [`57d157f`](https://github.com/mastra-ai/mastra/commit/57d157f0b163a95c3e6c9eae31bdb11d1bfc64f9), [`2a90c55`](https://github.com/mastra-ai/mastra/commit/2a90c55a86a9210697d5adaab5ee94584b079adc), [`96d35f6`](https://github.com/mastra-ai/mastra/commit/96d35f61376bc2b1bf148648a2c1985bd51bef55), [`5cbe88a`](https://github.com/mastra-ai/mastra/commit/5cbe88aefbd9f933bca669fd371ea36bf939ac6d), [`a1bd7b8`](https://github.com/mastra-ai/mastra/commit/a1bd7b8571db16b94eb01588f451a74758c96d65), [`d78b38d`](https://github.com/mastra-ai/mastra/commit/d78b38d898fce285260d3bbb4befade54331617f), [`0633100`](https://github.com/mastra-ai/mastra/commit/0633100a911ad22f5256471bdf753da21c104742), [`c710c16`](https://github.com/mastra-ai/mastra/commit/c710c1652dccfdc4111c8412bca7a6bb1d48b441), [`354ad0b`](https://github.com/mastra-ai/mastra/commit/354ad0b7b1b8183ac567f236a884fc7ede6d7138), [`cfae733`](https://github.com/mastra-ai/mastra/commit/cfae73394f4920635e6c919c8e95ff9a0788e2e5), [`e3dfda7`](https://github.com/mastra-ai/mastra/commit/e3dfda7b11bf3b8c4bb55637028befb5f387fc74), [`844ea5d`](https://github.com/mastra-ai/mastra/commit/844ea5dc0c248961e7bf73629ae7dcff503e853c), [`f0f8f12`](https://github.com/mastra-ai/mastra/commit/f0f8f125c308f2d0fd36942ef652fd852df7522f), [`0d7618b`](https://github.com/mastra-ai/mastra/commit/0d7618bc650bf2800934b243eca5648f4aeed9c2), [`7b763e5`](https://github.com/mastra-ai/mastra/commit/7b763e52fc3eaf699c2a99f2adf418dd46e4e9a5), [`d36cfbb`](https://github.com/mastra-ai/mastra/commit/d36cfbbb6565ba5f827883cc9bb648eb14befdc1), [`3697853`](https://github.com/mastra-ai/mastra/commit/3697853deeb72017d90e0f38a93c1e29221aeca0), [`a534e95`](https://github.com/mastra-ai/mastra/commit/a534e9591f83b3cc1ebff99c67edf4cda7bf81d3), [`9d0e7fe`](https://github.com/mastra-ai/mastra/commit/9d0e7feca8ed98de959f53476ee1456073673348), [`53d927c`](https://github.com/mastra-ai/mastra/commit/53d927cc6f03bff33655b7e2b788da445a08731d), [`22f64bc`](https://github.com/mastra-ai/mastra/commit/22f64bc1d37149480b58bf2fefe35b79a1e3e7d5), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc), [`bda6370`](https://github.com/mastra-ai/mastra/commit/bda637009360649aaf579919e7873e33553c273e), [`d7acd8e`](https://github.com/mastra-ai/mastra/commit/d7acd8e987b5d7eff4fd98b0906c17c06a2e83d5), [`c7f1f7d`](https://github.com/mastra-ai/mastra/commit/c7f1f7d24f61f247f018cc2d1f33bf63212959a7), [`0bddc6d`](https://github.com/mastra-ai/mastra/commit/0bddc6d8dbd6f6008c0cba2e4960a2da75a55af1), [`735d8c1`](https://github.com/mastra-ai/mastra/commit/735d8c1c0d19fbc09e6f8b66cf41bc7655993838), [`acf322e`](https://github.com/mastra-ai/mastra/commit/acf322e0f1fd0189684cf529d91c694bea918a45), [`c942802`](https://github.com/mastra-ai/mastra/commit/c942802a477a925b01859a7b8688d4355715caaa), [`a0c8c1b`](https://github.com/mastra-ai/mastra/commit/a0c8c1b87d4fee252aebda73e8637fbe01d761c9), [`cc34739`](https://github.com/mastra-ai/mastra/commit/cc34739c34b6266a91bea561119240a7acf47887), [`c218bd3`](https://github.com/mastra-ai/mastra/commit/c218bd3759e32423735b04843a09404572631014), [`2c4438b`](https://github.com/mastra-ai/mastra/commit/2c4438b87817ab7eed818c7990fef010475af1a3), [`2b8893c`](https://github.com/mastra-ai/mastra/commit/2b8893cb108ef9acb72ee7835cd625610d2c1a4a), [`8e5c75b`](https://github.com/mastra-ai/mastra/commit/8e5c75bdb1d08a42d45309a4c72def4b6890230f), [`fa8409b`](https://github.com/mastra-ai/mastra/commit/fa8409bc39cfd8ba6643b9db5269b90b22e2a2f7), [`173c535`](https://github.com/mastra-ai/mastra/commit/173c535c0645b0da404fe09f003778f0b0d4e019)]:
|
|
343
|
-
- @mastra/core@0.0.0-main-test-
|
|
346
|
+
- Updated dependencies [[`f743dbb`](https://github.com/mastra-ai/mastra/commit/f743dbb8b40d1627b5c10c0e6fc154f4ebb6e394), [`fec5129`](https://github.com/mastra-ai/mastra/commit/fec5129de7fc64423ea03661a56cef31dc747a0d), [`0491e7c`](https://github.com/mastra-ai/mastra/commit/0491e7c9b714cb0ba22187ee062147ec2dd7c712), [`0e8ed46`](https://github.com/mastra-ai/mastra/commit/0e8ed467c54d6901a6a365f270ec15d6faadb36c), [`6c049d9`](https://github.com/mastra-ai/mastra/commit/6c049d94063fdcbd5b81c4912a2bf82a92c9cc0b), [`3443770`](https://github.com/mastra-ai/mastra/commit/3443770662df8eb24c9df3589b2792d78cfcb811), [`f0a07e0`](https://github.com/mastra-ai/mastra/commit/f0a07e0111b3307c5fabfa4094c5c2cfb734fbe6), [`aaa40e7`](https://github.com/mastra-ai/mastra/commit/aaa40e788628b319baa8e889407d11ad626547fa), [`1521d71`](https://github.com/mastra-ai/mastra/commit/1521d716e5daedc74690c983fbd961123c56756b), [`9e1911d`](https://github.com/mastra-ai/mastra/commit/9e1911db2b4db85e0e768c3f15e0d61e319869f6), [`ebac155`](https://github.com/mastra-ai/mastra/commit/ebac15564a590117db7078233f927a7e28a85106), [`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`5948e6a`](https://github.com/mastra-ai/mastra/commit/5948e6a5146c83666ba3f294b2be576c82a513fb), [`8940859`](https://github.com/mastra-ai/mastra/commit/89408593658199b4ad67f7b65e888f344e64a442), [`e629310`](https://github.com/mastra-ai/mastra/commit/e629310f1a73fa236d49ec7a1d1cceb6229dc7cc), [`4c6b492`](https://github.com/mastra-ai/mastra/commit/4c6b492c4dd591c6a592520c1f6855d6e936d71f), [`dff01d8`](https://github.com/mastra-ai/mastra/commit/dff01d81ce1f4e4087cfac20fa868e6db138dd14), [`9d819d5`](https://github.com/mastra-ai/mastra/commit/9d819d54b61481639f4008e4694791bddf187edd), [`71c8d6c`](https://github.com/mastra-ai/mastra/commit/71c8d6c161253207b2b9588bdadb7eed604f7253), [`6179a9b`](https://github.com/mastra-ai/mastra/commit/6179a9ba36ffac326de3cc3c43cdc8028d37c251), [`00f4921`](https://github.com/mastra-ai/mastra/commit/00f4921dd2c91a1e5446799599ef7116a8214a1a), [`ca8041c`](https://github.com/mastra-ai/mastra/commit/ca8041cce0379fda22ed293a565bcb5b6ddca68a), [`7051bf3`](https://github.com/mastra-ai/mastra/commit/7051bf38b3b122a069008f861f7bfc004a6d9f6e), [`a8f1494`](https://github.com/mastra-ai/mastra/commit/a8f1494f4bbdc2770bcf327d4c7d869e332183f1), [`0793497`](https://github.com/mastra-ai/mastra/commit/079349753620c40246ffd673e3f9d7d9820beff3), [`5df9cce`](https://github.com/mastra-ai/mastra/commit/5df9cce1a753438413f64c11eeef8f845745c2a8), [`a854ede`](https://github.com/mastra-ai/mastra/commit/a854ede62bf5ac0945a624ac48913dd69c73aabf), [`c576fc0`](https://github.com/mastra-ai/mastra/commit/c576fc0b100b2085afded91a37c97a0ea0ec09c7), [`3defc80`](https://github.com/mastra-ai/mastra/commit/3defc80cf2b88a1b7fc1cc4ddcb91e982a614609), [`16153fe`](https://github.com/mastra-ai/mastra/commit/16153fe7eb13c99401f48e6ca32707c965ee28b9), [`9f4a683`](https://github.com/mastra-ai/mastra/commit/9f4a6833e88b52574665c028fd5508ad5c2f6004), [`bc94344`](https://github.com/mastra-ai/mastra/commit/bc943444a1342d8a662151b7bce1df7dae32f59c), [`57d157f`](https://github.com/mastra-ai/mastra/commit/57d157f0b163a95c3e6c9eae31bdb11d1bfc64f9), [`2a90c55`](https://github.com/mastra-ai/mastra/commit/2a90c55a86a9210697d5adaab5ee94584b079adc), [`eb09742`](https://github.com/mastra-ai/mastra/commit/eb09742197f66c4c38154c3beec78313e69760b2), [`96d35f6`](https://github.com/mastra-ai/mastra/commit/96d35f61376bc2b1bf148648a2c1985bd51bef55), [`5cbe88a`](https://github.com/mastra-ai/mastra/commit/5cbe88aefbd9f933bca669fd371ea36bf939ac6d), [`a1bd7b8`](https://github.com/mastra-ai/mastra/commit/a1bd7b8571db16b94eb01588f451a74758c96d65), [`d78b38d`](https://github.com/mastra-ai/mastra/commit/d78b38d898fce285260d3bbb4befade54331617f), [`0633100`](https://github.com/mastra-ai/mastra/commit/0633100a911ad22f5256471bdf753da21c104742), [`c710c16`](https://github.com/mastra-ai/mastra/commit/c710c1652dccfdc4111c8412bca7a6bb1d48b441), [`354ad0b`](https://github.com/mastra-ai/mastra/commit/354ad0b7b1b8183ac567f236a884fc7ede6d7138), [`cfae733`](https://github.com/mastra-ai/mastra/commit/cfae73394f4920635e6c919c8e95ff9a0788e2e5), [`e3dfda7`](https://github.com/mastra-ai/mastra/commit/e3dfda7b11bf3b8c4bb55637028befb5f387fc74), [`844ea5d`](https://github.com/mastra-ai/mastra/commit/844ea5dc0c248961e7bf73629ae7dcff503e853c), [`f0f8f12`](https://github.com/mastra-ai/mastra/commit/f0f8f125c308f2d0fd36942ef652fd852df7522f), [`0d7618b`](https://github.com/mastra-ai/mastra/commit/0d7618bc650bf2800934b243eca5648f4aeed9c2), [`7b763e5`](https://github.com/mastra-ai/mastra/commit/7b763e52fc3eaf699c2a99f2adf418dd46e4e9a5), [`d36cfbb`](https://github.com/mastra-ai/mastra/commit/d36cfbbb6565ba5f827883cc9bb648eb14befdc1), [`3697853`](https://github.com/mastra-ai/mastra/commit/3697853deeb72017d90e0f38a93c1e29221aeca0), [`a534e95`](https://github.com/mastra-ai/mastra/commit/a534e9591f83b3cc1ebff99c67edf4cda7bf81d3), [`9d0e7fe`](https://github.com/mastra-ai/mastra/commit/9d0e7feca8ed98de959f53476ee1456073673348), [`53d927c`](https://github.com/mastra-ai/mastra/commit/53d927cc6f03bff33655b7e2b788da445a08731d), [`22f64bc`](https://github.com/mastra-ai/mastra/commit/22f64bc1d37149480b58bf2fefe35b79a1e3e7d5), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc), [`b7959e6`](https://github.com/mastra-ai/mastra/commit/b7959e6e25a46b480f9ea2217c4c6c588c423791), [`bda6370`](https://github.com/mastra-ai/mastra/commit/bda637009360649aaf579919e7873e33553c273e), [`d7acd8e`](https://github.com/mastra-ai/mastra/commit/d7acd8e987b5d7eff4fd98b0906c17c06a2e83d5), [`c7f1f7d`](https://github.com/mastra-ai/mastra/commit/c7f1f7d24f61f247f018cc2d1f33bf63212959a7), [`0bddc6d`](https://github.com/mastra-ai/mastra/commit/0bddc6d8dbd6f6008c0cba2e4960a2da75a55af1), [`735d8c1`](https://github.com/mastra-ai/mastra/commit/735d8c1c0d19fbc09e6f8b66cf41bc7655993838), [`acf322e`](https://github.com/mastra-ai/mastra/commit/acf322e0f1fd0189684cf529d91c694bea918a45), [`c942802`](https://github.com/mastra-ai/mastra/commit/c942802a477a925b01859a7b8688d4355715caaa), [`a0c8c1b`](https://github.com/mastra-ai/mastra/commit/a0c8c1b87d4fee252aebda73e8637fbe01d761c9), [`cc34739`](https://github.com/mastra-ai/mastra/commit/cc34739c34b6266a91bea561119240a7acf47887), [`c218bd3`](https://github.com/mastra-ai/mastra/commit/c218bd3759e32423735b04843a09404572631014), [`2c4438b`](https://github.com/mastra-ai/mastra/commit/2c4438b87817ab7eed818c7990fef010475af1a3), [`2b8893c`](https://github.com/mastra-ai/mastra/commit/2b8893cb108ef9acb72ee7835cd625610d2c1a4a), [`8e5c75b`](https://github.com/mastra-ai/mastra/commit/8e5c75bdb1d08a42d45309a4c72def4b6890230f), [`e59e0d3`](https://github.com/mastra-ai/mastra/commit/e59e0d32afb5fcf2c9f3c00c8f81f6c21d3a63fa), [`fa8409b`](https://github.com/mastra-ai/mastra/commit/fa8409bc39cfd8ba6643b9db5269b90b22e2a2f7), [`173c535`](https://github.com/mastra-ai/mastra/commit/173c535c0645b0da404fe09f003778f0b0d4e019)]:
|
|
347
|
+
- @mastra/core@0.0.0-main-test-05-11-2025-2-20251105223343
|
|
344
348
|
|
|
345
349
|
## 0.22.2
|
|
346
350
|
|
|
@@ -6,12 +6,12 @@ import { scoreTraces } from '@mastra/core/evals/scoreTraces';
|
|
|
6
6
|
// src/server/handlers/observability.ts
|
|
7
7
|
var observability_exports = {};
|
|
8
8
|
__export(observability_exports, {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
getTraceHandler: () => getTraceHandler,
|
|
10
|
+
getTracesPaginatedHandler: () => getTracesPaginatedHandler,
|
|
11
11
|
listScoresBySpan: () => listScoresBySpan,
|
|
12
12
|
scoreTracesHandler: () => scoreTracesHandler
|
|
13
13
|
});
|
|
14
|
-
async function
|
|
14
|
+
async function getTraceHandler({ mastra, traceId }) {
|
|
15
15
|
try {
|
|
16
16
|
if (!traceId) {
|
|
17
17
|
throw new HTTPException(400, { message: "Trace ID is required" });
|
|
@@ -20,16 +20,16 @@ async function getAITraceHandler({ mastra, traceId }) {
|
|
|
20
20
|
if (!storage) {
|
|
21
21
|
throw new HTTPException(500, { message: "Storage is not available" });
|
|
22
22
|
}
|
|
23
|
-
const trace = await storage.
|
|
23
|
+
const trace = await storage.getTrace(traceId);
|
|
24
24
|
if (!trace) {
|
|
25
25
|
throw new HTTPException(404, { message: `Trace with ID '${traceId}' not found` });
|
|
26
26
|
}
|
|
27
27
|
return trace;
|
|
28
28
|
} catch (error) {
|
|
29
|
-
handleError(error, "Error getting
|
|
29
|
+
handleError(error, "Error getting trace");
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
32
|
+
async function getTracesPaginatedHandler({ mastra, body }) {
|
|
33
33
|
try {
|
|
34
34
|
const storage = mastra.getStorage();
|
|
35
35
|
if (!storage) {
|
|
@@ -54,12 +54,12 @@ async function getAITracesPaginatedHandler({ mastra, body }) {
|
|
|
54
54
|
throw new HTTPException(400, { message: "Invalid date format in date range" });
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
return storage.
|
|
57
|
+
return storage.getTracesPaginated({
|
|
58
58
|
pagination,
|
|
59
59
|
filters
|
|
60
60
|
});
|
|
61
61
|
} catch (error) {
|
|
62
|
-
handleError(error, "Error getting
|
|
62
|
+
handleError(error, "Error getting traces paginated");
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
async function scoreTracesHandler({ mastra, body }) {
|
|
@@ -119,6 +119,6 @@ async function listScoresBySpan({
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export {
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
export { getTraceHandler, getTracesPaginatedHandler, listScoresBySpan, observability_exports, scoreTracesHandler };
|
|
123
|
+
//# sourceMappingURL=chunk-3AMNUUZF.js.map
|
|
124
|
+
//# sourceMappingURL=chunk-3AMNUUZF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server/handlers/observability.ts"],"names":[],"mappings":";;;;;;AAAA,IAAA,qBAAA,GAAA;AAAA,QAAA,CAAA,qBAAA,EAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,yBAAA,EAAA,MAAA,yBAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,kBAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AA0BA,eAAsB,eAAA,CAAgB,EAAE,MAAA,EAAQ,OAAA,EAAQ,EAA+C;AACrG,EAAA,IAAI;AACF,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,MAAM,IAAI,aAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,wBAAwB,CAAA;AAAA,IAClE;AAEA,IAAA,MAAM,OAAA,GAAU,OAAO,UAAA,EAAW;AAClC,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,MAAM,IAAI,aAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,4BAA4B,CAAA;AAAA,IACtE;AAEA,IAAA,MAAM,KAAA,GAAQ,MAAM,OAAA,CAAQ,QAAA,CAAS,OAAO,CAAA;AAE5C,IAAA,IAAI,CAAC,KAAA,EAAO;AACV,MAAA,MAAM,IAAI,cAAc,GAAA,EAAK,EAAE,SAAS,CAAA,eAAA,EAAkB,OAAO,eAAe,CAAA;AAAA,IAClF;AAEA,IAAA,OAAO,KAAA;AAAA,EACT,SAAS,KAAA,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AY,OAAO,8BAA8B,CAAA;AAAA,EAC1D;AACF","file":"chunk-3AMNUUZF.js","sourcesContent":["import { scoreTraces } from '@mastra/core/evals/scoreTraces';\nimport type { TracesPaginatedArg, StoragePagination } from '@mastra/core/storage';\nimport { HTTPException } from '../http-exception';\nimport type { Context } from '../types';\nimport { handleError } from './error';\n\ninterface ObservabilityContext extends Context {\n traceId?: string;\n body?: TracesPaginatedArg;\n}\n\ninterface ScoreTracesContext extends Context {\n body?: {\n // scorer.id\n scorerName: string;\n targets: Array<{\n traceId: string;\n spanId?: string;\n }>;\n };\n}\n\n/**\n * Get a complete trace by trace ID\n * Returns all spans in the trace with their parent-child relationships\n */\nexport async function getTraceHandler({ mastra, traceId }: ObservabilityContext & { traceId: string }) {\n try {\n if (!traceId) {\n throw new HTTPException(400, { message: 'Trace ID is required' });\n }\n\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n const trace = await storage.getTrace(traceId);\n\n if (!trace) {\n throw new HTTPException(404, { message: `Trace with ID '${traceId}' not found` });\n }\n\n return trace;\n } catch (error) {\n handleError(error, 'Error getting trace');\n }\n}\n\n/**\n * Get paginated traces with filtering and pagination\n * Returns only root spans (parent spans) for pagination, not child spans\n */\nexport async function getTracesPaginatedHandler({ mastra, body }: ObservabilityContext) {\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n if (!body) {\n throw new HTTPException(400, { message: 'Request body is required' });\n }\n\n const { filters, pagination } = body;\n\n if (pagination?.page && pagination.page < 0) {\n throw new HTTPException(400, { message: 'Page must be a non-negative integer' });\n }\n\n if (pagination?.perPage && pagination.perPage < 0) {\n throw new HTTPException(400, { message: 'Per page must be a non-negative integer' });\n }\n\n if (pagination?.dateRange) {\n const { start, end } = pagination.dateRange;\n\n if (start && !(start instanceof Date)) {\n throw new HTTPException(400, { message: 'Invalid date format in date range' });\n }\n\n if (end && !(end instanceof Date)) {\n throw new HTTPException(400, { message: 'Invalid date format in date range' });\n }\n }\n\n return storage.getTracesPaginated({\n pagination,\n filters,\n });\n } catch (error) {\n handleError(error, 'Error getting traces paginated');\n }\n}\n\n/**\n * Score traces using a specified scorer\n * Fire-and-forget approach - returns immediately while scoring runs in background\n */\nexport async function scoreTracesHandler({ mastra, body }: ScoreTracesContext) {\n try {\n if (!body) {\n throw new HTTPException(400, { message: 'Request body is required' });\n }\n\n const { scorerName, targets } = body;\n\n if (!scorerName) {\n throw new HTTPException(400, { message: 'Scorer ID is required' });\n }\n\n if (!targets || targets.length === 0) {\n throw new HTTPException(400, { message: 'At least one target is required' });\n }\n\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n const scorer = mastra.getScorerById(scorerName);\n if (!scorer) {\n throw new HTTPException(404, { message: `Scorer '${scorerName}' not found` });\n }\n\n const logger = mastra.getLogger();\n\n scoreTraces({\n scorerId: scorer.config.id || scorer.config.name,\n targets,\n mastra,\n }).catch(error => {\n logger?.error(`Background trace scoring failed: ${error.message}`, error);\n });\n\n // Return immediate response\n return {\n status: 'success',\n message: `Scoring started for ${targets.length} ${targets.length === 1 ? 'trace' : 'traces'}`,\n traceCount: targets.length,\n };\n } catch (error) {\n handleError(error, 'Error processing trace scoring');\n }\n}\n\nexport async function listScoresBySpan({\n mastra,\n traceId,\n spanId,\n pagination,\n}: Context & { traceId: string; spanId: string; pagination: StoragePagination }) {\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n if (!traceId || !spanId) {\n throw new HTTPException(400, { message: 'Trace ID and span ID are required' });\n }\n\n return await storage.listScoresBySpan({ traceId, spanId, pagination });\n } catch (error) {\n return handleError(error, 'Error getting scores by span');\n }\n}\n"]}
|
|
@@ -8,12 +8,12 @@ var scoreTraces = require('@mastra/core/evals/scoreTraces');
|
|
|
8
8
|
// src/server/handlers/observability.ts
|
|
9
9
|
var observability_exports = {};
|
|
10
10
|
chunkO7I5CWRX_cjs.__export(observability_exports, {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
getTraceHandler: () => getTraceHandler,
|
|
12
|
+
getTracesPaginatedHandler: () => getTracesPaginatedHandler,
|
|
13
13
|
listScoresBySpan: () => listScoresBySpan,
|
|
14
14
|
scoreTracesHandler: () => scoreTracesHandler
|
|
15
15
|
});
|
|
16
|
-
async function
|
|
16
|
+
async function getTraceHandler({ mastra, traceId }) {
|
|
17
17
|
try {
|
|
18
18
|
if (!traceId) {
|
|
19
19
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Trace ID is required" });
|
|
@@ -22,16 +22,16 @@ async function getAITraceHandler({ mastra, traceId }) {
|
|
|
22
22
|
if (!storage) {
|
|
23
23
|
throw new chunk64ITUOXI_cjs.HTTPException(500, { message: "Storage is not available" });
|
|
24
24
|
}
|
|
25
|
-
const trace = await storage.
|
|
25
|
+
const trace = await storage.getTrace(traceId);
|
|
26
26
|
if (!trace) {
|
|
27
27
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: `Trace with ID '${traceId}' not found` });
|
|
28
28
|
}
|
|
29
29
|
return trace;
|
|
30
30
|
} catch (error) {
|
|
31
|
-
chunkV5WWQN7P_cjs.handleError(error, "Error getting
|
|
31
|
+
chunkV5WWQN7P_cjs.handleError(error, "Error getting trace");
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
async function
|
|
34
|
+
async function getTracesPaginatedHandler({ mastra, body }) {
|
|
35
35
|
try {
|
|
36
36
|
const storage = mastra.getStorage();
|
|
37
37
|
if (!storage) {
|
|
@@ -56,12 +56,12 @@ async function getAITracesPaginatedHandler({ mastra, body }) {
|
|
|
56
56
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Invalid date format in date range" });
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
return storage.
|
|
59
|
+
return storage.getTracesPaginated({
|
|
60
60
|
pagination,
|
|
61
61
|
filters
|
|
62
62
|
});
|
|
63
63
|
} catch (error) {
|
|
64
|
-
chunkV5WWQN7P_cjs.handleError(error, "Error getting
|
|
64
|
+
chunkV5WWQN7P_cjs.handleError(error, "Error getting traces paginated");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
async function scoreTracesHandler({ mastra, body }) {
|
|
@@ -121,10 +121,10 @@ async function listScoresBySpan({
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
exports.
|
|
125
|
-
exports.
|
|
124
|
+
exports.getTraceHandler = getTraceHandler;
|
|
125
|
+
exports.getTracesPaginatedHandler = getTracesPaginatedHandler;
|
|
126
126
|
exports.listScoresBySpan = listScoresBySpan;
|
|
127
127
|
exports.observability_exports = observability_exports;
|
|
128
128
|
exports.scoreTracesHandler = scoreTracesHandler;
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
129
|
+
//# sourceMappingURL=chunk-A24TSVEZ.cjs.map
|
|
130
|
+
//# sourceMappingURL=chunk-A24TSVEZ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server/handlers/observability.ts"],"names":["__export","HTTPException","handleError","scoreTraces"],"mappings":";;;;;;;;AAAA,IAAA,qBAAA,GAAA;AAAAA,0BAAA,CAAA,qBAAA,EAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,yBAAA,EAAA,MAAA,yBAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,kBAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AA0BA,eAAsB,eAAA,CAAgB,EAAE,MAAA,EAAQ,OAAA,EAAQ,EAA+C;AACrG,EAAA,IAAI;AACF,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,MAAM,IAAIC,+BAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,wBAAwB,CAAA;AAAA,IAClE;AAEA,IAAA,MA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AM,OAAA,GAAU,OAAO,UAAA,EAAW;AAClC,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,MAAM,IAAID,+BAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,4BAA4B,CAAA;AAAA,IACtE;AAEA,IAAA,IAAI,CAAC,OAAA,IAAW,CAAC,MAAA,EAAQ;AACvB,MAAA,MAAM,IAAIA,+BAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,qCAAqC,CAAA;AAAA,IAC/E;AAEA,IAAA,OAAO,MAAM,OAAA,CAAQ,gBAAA,CAAiB,EAAE,OAAA,EAAS,MAAA,EAAQ,YAAY,CAAA;AAAA,EACvE,SAAS,KAAA,EAAO;AACd,IAAA,OAAOC,6BAAA,CAAY,OAAO,8BAA8B,CAAA;AAAA,EAC1D;AACF","file":"chunk-A24TSVEZ.cjs","sourcesContent":["import { scoreTraces } from '@mastra/core/evals/scoreTraces';\nimport type { TracesPaginatedArg, StoragePagination } from '@mastra/core/storage';\nimport { HTTPException } from '../http-exception';\nimport type { Context } from '../types';\nimport { handleError } from './error';\n\ninterface ObservabilityContext extends Context {\n traceId?: string;\n body?: TracesPaginatedArg;\n}\n\ninterface ScoreTracesContext extends Context {\n body?: {\n // scorer.id\n scorerName: string;\n targets: Array<{\n traceId: string;\n spanId?: string;\n }>;\n };\n}\n\n/**\n * Get a complete trace by trace ID\n * Returns all spans in the trace with their parent-child relationships\n */\nexport async function getTraceHandler({ mastra, traceId }: ObservabilityContext & { traceId: string }) {\n try {\n if (!traceId) {\n throw new HTTPException(400, { message: 'Trace ID is required' });\n }\n\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n const trace = await storage.getTrace(traceId);\n\n if (!trace) {\n throw new HTTPException(404, { message: `Trace with ID '${traceId}' not found` });\n }\n\n return trace;\n } catch (error) {\n handleError(error, 'Error getting trace');\n }\n}\n\n/**\n * Get paginated traces with filtering and pagination\n * Returns only root spans (parent spans) for pagination, not child spans\n */\nexport async function getTracesPaginatedHandler({ mastra, body }: ObservabilityContext) {\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n if (!body) {\n throw new HTTPException(400, { message: 'Request body is required' });\n }\n\n const { filters, pagination } = body;\n\n if (pagination?.page && pagination.page < 0) {\n throw new HTTPException(400, { message: 'Page must be a non-negative integer' });\n }\n\n if (pagination?.perPage && pagination.perPage < 0) {\n throw new HTTPException(400, { message: 'Per page must be a non-negative integer' });\n }\n\n if (pagination?.dateRange) {\n const { start, end } = pagination.dateRange;\n\n if (start && !(start instanceof Date)) {\n throw new HTTPException(400, { message: 'Invalid date format in date range' });\n }\n\n if (end && !(end instanceof Date)) {\n throw new HTTPException(400, { message: 'Invalid date format in date range' });\n }\n }\n\n return storage.getTracesPaginated({\n pagination,\n filters,\n });\n } catch (error) {\n handleError(error, 'Error getting traces paginated');\n }\n}\n\n/**\n * Score traces using a specified scorer\n * Fire-and-forget approach - returns immediately while scoring runs in background\n */\nexport async function scoreTracesHandler({ mastra, body }: ScoreTracesContext) {\n try {\n if (!body) {\n throw new HTTPException(400, { message: 'Request body is required' });\n }\n\n const { scorerName, targets } = body;\n\n if (!scorerName) {\n throw new HTTPException(400, { message: 'Scorer ID is required' });\n }\n\n if (!targets || targets.length === 0) {\n throw new HTTPException(400, { message: 'At least one target is required' });\n }\n\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n const scorer = mastra.getScorerById(scorerName);\n if (!scorer) {\n throw new HTTPException(404, { message: `Scorer '${scorerName}' not found` });\n }\n\n const logger = mastra.getLogger();\n\n scoreTraces({\n scorerId: scorer.config.id || scorer.config.name,\n targets,\n mastra,\n }).catch(error => {\n logger?.error(`Background trace scoring failed: ${error.message}`, error);\n });\n\n // Return immediate response\n return {\n status: 'success',\n message: `Scoring started for ${targets.length} ${targets.length === 1 ? 'trace' : 'traces'}`,\n traceCount: targets.length,\n };\n } catch (error) {\n handleError(error, 'Error processing trace scoring');\n }\n}\n\nexport async function listScoresBySpan({\n mastra,\n traceId,\n spanId,\n pagination,\n}: Context & { traceId: string; spanId: string; pagination: StoragePagination }) {\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n if (!traceId || !spanId) {\n throw new HTTPException(400, { message: 'Trace ID and span ID are required' });\n }\n\n return await storage.listScoresBySpan({ traceId, spanId, pagination });\n } catch (error) {\n return handleError(error, 'Error getting scores by span');\n }\n}\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunkX6C7BUWN_cjs = require('./chunk-X6C7BUWN.cjs');
|
|
4
4
|
var chunk2PLXW4ZX_cjs = require('./chunk-2PLXW4ZX.cjs');
|
|
5
5
|
var chunkLPM6BBAX_cjs = require('./chunk-LPM6BBAX.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkSRAPUMPM_cjs = require('./chunk-SRAPUMPM.cjs');
|
|
7
7
|
var chunkLWLSQ2W4_cjs = require('./chunk-LWLSQ2W4.cjs');
|
|
8
8
|
var chunkV5WWQN7P_cjs = require('./chunk-V5WWQN7P.cjs');
|
|
9
9
|
var chunk64ITUOXI_cjs = require('./chunk-64ITUOXI.cjs');
|
|
@@ -750,7 +750,6 @@ chunkO7I5CWRX_cjs.__export(agent_builder_exports, {
|
|
|
750
750
|
resumeAgentBuilderActionHandler: () => resumeAgentBuilderActionHandler,
|
|
751
751
|
resumeAsyncAgentBuilderActionHandler: () => resumeAsyncAgentBuilderActionHandler,
|
|
752
752
|
resumeStreamAgentBuilderActionHandler: () => resumeStreamAgentBuilderActionHandler,
|
|
753
|
-
sendAgentBuilderActionRunEventHandler: () => sendAgentBuilderActionRunEventHandler,
|
|
754
753
|
startAgentBuilderActionRunHandler: () => startAgentBuilderActionRunHandler,
|
|
755
754
|
startAsyncAgentBuilderActionHandler: () => startAsyncAgentBuilderActionHandler,
|
|
756
755
|
streamAgentBuilderActionHandler: () => streamAgentBuilderActionHandler,
|
|
@@ -22983,77 +22982,73 @@ var getAgentBuilderActionsHandler = createAgentBuilderWorkflowHandler(async () =
|
|
|
22983
22982
|
}
|
|
22984
22983
|
}, "Getting agent builder actions");
|
|
22985
22984
|
var getAgentBuilderActionByIdHandler = createAgentBuilderWorkflowHandler(
|
|
22986
|
-
|
|
22985
|
+
chunkSRAPUMPM_cjs.getWorkflowByIdHandler,
|
|
22987
22986
|
"Getting agent builder action by ID"
|
|
22988
22987
|
);
|
|
22989
22988
|
var getAgentBuilderActionRunByIdHandler = createAgentBuilderWorkflowHandler(
|
|
22990
|
-
|
|
22989
|
+
chunkSRAPUMPM_cjs.getWorkflowRunByIdHandler,
|
|
22991
22990
|
"Getting agent builder action run by ID"
|
|
22992
22991
|
);
|
|
22993
22992
|
var getAgentBuilderActionRunExecutionResultHandler = createAgentBuilderWorkflowHandler(
|
|
22994
|
-
|
|
22993
|
+
chunkSRAPUMPM_cjs.getWorkflowRunExecutionResultHandler,
|
|
22995
22994
|
"Getting agent builder action run execution result"
|
|
22996
22995
|
);
|
|
22997
22996
|
var createAgentBuilderActionRunHandler = createAgentBuilderWorkflowHandler(
|
|
22998
|
-
|
|
22997
|
+
chunkSRAPUMPM_cjs.createWorkflowRunHandler,
|
|
22999
22998
|
"Creating agent builder action run"
|
|
23000
22999
|
);
|
|
23001
23000
|
var startAsyncAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23002
|
-
|
|
23001
|
+
chunkSRAPUMPM_cjs.startAsyncWorkflowHandler,
|
|
23003
23002
|
"Starting async agent builder action"
|
|
23004
23003
|
);
|
|
23005
23004
|
var startAgentBuilderActionRunHandler = createAgentBuilderWorkflowHandler(
|
|
23006
|
-
|
|
23005
|
+
chunkSRAPUMPM_cjs.startWorkflowRunHandler,
|
|
23007
23006
|
"Starting agent builder action run"
|
|
23008
23007
|
);
|
|
23009
23008
|
var streamAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23010
|
-
|
|
23009
|
+
chunkSRAPUMPM_cjs.streamWorkflowHandler,
|
|
23011
23010
|
"Streaming agent builder action"
|
|
23012
23011
|
);
|
|
23013
23012
|
var streamLegacyAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23014
|
-
|
|
23013
|
+
chunkSRAPUMPM_cjs.streamLegacyWorkflowHandler,
|
|
23015
23014
|
"Streaming legacy agent builder action"
|
|
23016
23015
|
);
|
|
23017
23016
|
var streamVNextAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23018
|
-
|
|
23017
|
+
chunkSRAPUMPM_cjs.streamVNextWorkflowHandler,
|
|
23019
23018
|
"Streaming VNext agent builder action"
|
|
23020
23019
|
);
|
|
23021
23020
|
var observeStreamLegacyAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23022
|
-
|
|
23021
|
+
chunkSRAPUMPM_cjs.observeStreamLegacyWorkflowHandler,
|
|
23023
23022
|
"Observing legacy stream for agent builder action"
|
|
23024
23023
|
);
|
|
23025
23024
|
var observeStreamAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23026
|
-
|
|
23025
|
+
chunkSRAPUMPM_cjs.observeStreamWorkflowHandler,
|
|
23027
23026
|
"Observing stream for agent builder action"
|
|
23028
23027
|
);
|
|
23029
23028
|
var observeStreamVNextAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23030
|
-
|
|
23029
|
+
chunkSRAPUMPM_cjs.observeStreamVNextWorkflowHandler,
|
|
23031
23030
|
"Observing VNext stream for agent builder action"
|
|
23032
23031
|
);
|
|
23033
23032
|
var resumeAsyncAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23034
|
-
|
|
23033
|
+
chunkSRAPUMPM_cjs.resumeAsyncWorkflowHandler,
|
|
23035
23034
|
"Resuming async agent builder action"
|
|
23036
23035
|
);
|
|
23037
23036
|
var resumeAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23038
|
-
|
|
23037
|
+
chunkSRAPUMPM_cjs.resumeWorkflowHandler,
|
|
23039
23038
|
"Resuming agent builder action"
|
|
23040
23039
|
);
|
|
23041
23040
|
var resumeStreamAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
|
|
23042
|
-
|
|
23041
|
+
chunkSRAPUMPM_cjs.resumeStreamWorkflowHandler,
|
|
23043
23042
|
"Resuming stream for agent builder action"
|
|
23044
23043
|
);
|
|
23045
23044
|
var getAgentBuilderActionRunsHandler = createAgentBuilderWorkflowHandler(
|
|
23046
|
-
|
|
23045
|
+
chunkSRAPUMPM_cjs.listWorkflowRunsHandler,
|
|
23047
23046
|
"Getting agent builder action runs"
|
|
23048
23047
|
);
|
|
23049
23048
|
var cancelAgentBuilderActionRunHandler = createAgentBuilderWorkflowHandler(
|
|
23050
|
-
|
|
23049
|
+
chunkSRAPUMPM_cjs.cancelWorkflowRunHandler,
|
|
23051
23050
|
"Cancelling agent builder action run"
|
|
23052
23051
|
);
|
|
23053
|
-
var sendAgentBuilderActionRunEventHandler = createAgentBuilderWorkflowHandler(
|
|
23054
|
-
chunkAEVI2HIU_cjs.sendWorkflowRunEventHandler,
|
|
23055
|
-
"Sending agent builder action run event"
|
|
23056
|
-
);
|
|
23057
23052
|
|
|
23058
23053
|
exports.agent_builder_exports = agent_builder_exports;
|
|
23059
23054
|
exports.cancelAgentBuilderActionRunHandler = cancelAgentBuilderActionRunHandler;
|
|
@@ -23069,11 +23064,10 @@ exports.observeStreamVNextAgentBuilderActionHandler = observeStreamVNextAgentBui
|
|
|
23069
23064
|
exports.resumeAgentBuilderActionHandler = resumeAgentBuilderActionHandler;
|
|
23070
23065
|
exports.resumeAsyncAgentBuilderActionHandler = resumeAsyncAgentBuilderActionHandler;
|
|
23071
23066
|
exports.resumeStreamAgentBuilderActionHandler = resumeStreamAgentBuilderActionHandler;
|
|
23072
|
-
exports.sendAgentBuilderActionRunEventHandler = sendAgentBuilderActionRunEventHandler;
|
|
23073
23067
|
exports.startAgentBuilderActionRunHandler = startAgentBuilderActionRunHandler;
|
|
23074
23068
|
exports.startAsyncAgentBuilderActionHandler = startAsyncAgentBuilderActionHandler;
|
|
23075
23069
|
exports.streamAgentBuilderActionHandler = streamAgentBuilderActionHandler;
|
|
23076
23070
|
exports.streamLegacyAgentBuilderActionHandler = streamLegacyAgentBuilderActionHandler;
|
|
23077
23071
|
exports.streamVNextAgentBuilderActionHandler = streamVNextAgentBuilderActionHandler;
|
|
23078
|
-
//# sourceMappingURL=chunk-
|
|
23079
|
-
//# sourceMappingURL=chunk-
|
|
23072
|
+
//# sourceMappingURL=chunk-M6KNPIZZ.cjs.map
|
|
23073
|
+
//# sourceMappingURL=chunk-M6KNPIZZ.cjs.map
|