@mastra/core 1.23.0-alpha.4 → 1.23.0-alpha.5
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 +8 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/base.cjs +2 -2
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +1 -1
- package/dist/browser/index.cjs +6 -6
- package/dist/browser/index.js +3 -3
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/cache/index.cjs +3 -3
- package/dist/cache/index.js +1 -1
- package/dist/channels/index.cjs +4 -4
- package/dist/channels/index.js +1 -1
- package/dist/{chunk-CIV5MFO6.cjs → chunk-25EDFTQD.cjs} +4 -4
- package/dist/{chunk-CIV5MFO6.cjs.map → chunk-25EDFTQD.cjs.map} +1 -1
- package/dist/{chunk-K6W2C7PA.js → chunk-3APK6ZID.js} +3 -3
- package/dist/{chunk-K6W2C7PA.js.map → chunk-3APK6ZID.js.map} +1 -1
- package/dist/{chunk-YRDMMXBW.cjs → chunk-47RKHZIP.cjs} +34 -2
- package/dist/chunk-47RKHZIP.cjs.map +1 -0
- package/dist/{chunk-JK5YBBUS.cjs → chunk-4W26D7S6.cjs} +13 -13
- package/dist/chunk-4W26D7S6.cjs.map +1 -0
- package/dist/{chunk-7273BIRR.js → chunk-6UQKQBIB.js} +3 -3
- package/dist/{chunk-7273BIRR.js.map → chunk-6UQKQBIB.js.map} +1 -1
- package/dist/{chunk-G5WUD7SF.js → chunk-72EQLBZY.js} +3 -3
- package/dist/{chunk-G5WUD7SF.js.map → chunk-72EQLBZY.js.map} +1 -1
- package/dist/{chunk-C3G6OQ52.cjs → chunk-7DONY7OL.cjs} +10 -11
- package/dist/chunk-7DONY7OL.cjs.map +1 -0
- package/dist/{chunk-HBO2PK7W.cjs → chunk-7GW2TQXP.cjs} +4 -3
- package/dist/chunk-7GW2TQXP.cjs.map +1 -0
- package/dist/{chunk-74IXDLKF.cjs → chunk-7STIIXEL.cjs} +3 -3
- package/dist/{chunk-74IXDLKF.cjs.map → chunk-7STIIXEL.cjs.map} +1 -1
- package/dist/{chunk-44P7C37G.js → chunk-BMS7MLQV.js} +31 -3
- package/dist/chunk-BMS7MLQV.js.map +1 -0
- package/dist/{chunk-GEI2HTYE.js → chunk-C77V6J36.js} +3 -3
- package/dist/{chunk-GEI2HTYE.js.map → chunk-C77V6J36.js.map} +1 -1
- package/dist/{chunk-ANFGVHG2.cjs → chunk-DAQ4JZQA.cjs} +4 -4
- package/dist/{chunk-ANFGVHG2.cjs.map → chunk-DAQ4JZQA.cjs.map} +1 -1
- package/dist/{chunk-M3LRSDLL.js → chunk-DBBWTK24.js} +4 -3
- package/dist/chunk-DBBWTK24.js.map +1 -0
- package/dist/{chunk-JSG6FULW.cjs → chunk-DO4JBKMT.cjs} +109 -110
- package/dist/chunk-DO4JBKMT.cjs.map +1 -0
- package/dist/{chunk-PGXL3YYH.js → chunk-EG3UGEUZ.js} +4 -4
- package/dist/{chunk-PGXL3YYH.js.map → chunk-EG3UGEUZ.js.map} +1 -1
- package/dist/{chunk-KRDAO5BB.js → chunk-EXORPYDN.js} +3 -3
- package/dist/{chunk-KRDAO5BB.js.map → chunk-EXORPYDN.js.map} +1 -1
- package/dist/{chunk-DKK77FIJ.cjs → chunk-FCQNDFEW.cjs} +7 -7
- package/dist/chunk-FCQNDFEW.cjs.map +1 -0
- package/dist/{chunk-SQXNHM6M.cjs → chunk-FSHOQBGF.cjs} +28 -28
- package/dist/{chunk-SQXNHM6M.cjs.map → chunk-FSHOQBGF.cjs.map} +1 -1
- package/dist/{chunk-3EXOZA2Y.js → chunk-HQXVBGBM.js} +3 -3
- package/dist/{chunk-3EXOZA2Y.js.map → chunk-HQXVBGBM.js.map} +1 -1
- package/dist/{chunk-UUVQS3OG.js → chunk-HWAEQSOO.js} +12 -12
- package/dist/{chunk-UUVQS3OG.js.map → chunk-HWAEQSOO.js.map} +1 -1
- package/dist/{chunk-OF675HEC.cjs → chunk-I4YMMVQ3.cjs} +4 -4
- package/dist/{chunk-OF675HEC.cjs.map → chunk-I4YMMVQ3.cjs.map} +1 -1
- package/dist/{chunk-C264FG5X.js → chunk-I6XSSR4Z.js} +8 -8
- package/dist/{chunk-C264FG5X.js.map → chunk-I6XSSR4Z.js.map} +1 -1
- package/dist/{chunk-JAAICSXU.cjs → chunk-JF3WPB75.cjs} +32 -32
- package/dist/{chunk-JAAICSXU.cjs.map → chunk-JF3WPB75.cjs.map} +1 -1
- package/dist/{chunk-R577LMHJ.cjs → chunk-JJFGNYVY.cjs} +7 -7
- package/dist/{chunk-R577LMHJ.cjs.map → chunk-JJFGNYVY.cjs.map} +1 -1
- package/dist/{chunk-MISEF5LK.js → chunk-JNXWDPCZ.js} +6 -6
- package/dist/chunk-JNXWDPCZ.js.map +1 -0
- package/dist/{chunk-AQUKI2MV.js → chunk-L2MCWEEX.js} +6 -6
- package/dist/{chunk-AQUKI2MV.js.map → chunk-L2MCWEEX.js.map} +1 -1
- package/dist/{chunk-6VIWRHC3.js → chunk-QIJFD7ZC.js} +5 -5
- package/dist/{chunk-6VIWRHC3.js.map → chunk-QIJFD7ZC.js.map} +1 -1
- package/dist/{chunk-7QI6WHSE.js → chunk-QRK2HWHI.js} +8 -8
- package/dist/{chunk-7QI6WHSE.js.map → chunk-QRK2HWHI.js.map} +1 -1
- package/dist/{chunk-KCVSVDQ2.js → chunk-QYQSXRFZ.js} +13 -14
- package/dist/chunk-QYQSXRFZ.js.map +1 -0
- package/dist/{chunk-T26CFBWF.cjs → chunk-RAD2NM47.cjs} +4 -4
- package/dist/{chunk-T26CFBWF.cjs.map → chunk-RAD2NM47.cjs.map} +1 -1
- package/dist/{chunk-NBOTSCZC.js → chunk-TG46FM6X.js} +4 -4
- package/dist/{chunk-NBOTSCZC.js.map → chunk-TG46FM6X.js.map} +1 -1
- package/dist/{chunk-Y67VWDR7.cjs → chunk-TKH2A57J.cjs} +185 -185
- package/dist/{chunk-Y67VWDR7.cjs.map → chunk-TKH2A57J.cjs.map} +1 -1
- package/dist/{chunk-DBN5B2LH.cjs → chunk-UENWRQLR.cjs} +18 -18
- package/dist/{chunk-DBN5B2LH.cjs.map → chunk-UENWRQLR.cjs.map} +1 -1
- package/dist/{chunk-ZOLIH66J.cjs → chunk-V7AX2MSJ.cjs} +20 -20
- package/dist/{chunk-ZOLIH66J.cjs.map → chunk-V7AX2MSJ.cjs.map} +1 -1
- package/dist/{chunk-Z2IR7J5I.js → chunk-VO6R5RZT.js} +8 -9
- package/dist/chunk-VO6R5RZT.js.map +1 -0
- package/dist/{chunk-DNW46JHP.js → chunk-WENZPAHS.js} +4 -4
- package/dist/chunk-WENZPAHS.js.map +1 -0
- package/dist/{chunk-HIC3WGQU.cjs → chunk-X6CDTXAM.cjs} +11 -11
- package/dist/{chunk-HIC3WGQU.cjs.map → chunk-X6CDTXAM.cjs.map} +1 -1
- package/dist/{chunk-CHY6AP6N.cjs → chunk-XFLQVMNH.cjs} +26 -26
- package/dist/{chunk-CHY6AP6N.cjs.map → chunk-XFLQVMNH.cjs.map} +1 -1
- package/dist/{chunk-OFABGAOY.cjs → chunk-XZCYFQ4N.cjs} +64 -65
- package/dist/chunk-XZCYFQ4N.cjs.map +1 -0
- package/dist/{chunk-LBL7GNPF.cjs → chunk-YR7XRMDN.cjs} +10 -10
- package/dist/{chunk-LBL7GNPF.cjs.map → chunk-YR7XRMDN.cjs.map} +1 -1
- package/dist/{chunk-XGUUUEE4.js → chunk-Z34TVGNZ.js} +4 -4
- package/dist/{chunk-XGUUUEE4.js.map → chunk-Z34TVGNZ.js.map} +1 -1
- package/dist/{chunk-EHBTASCW.js → chunk-Z63F3XHK.js} +5 -6
- package/dist/chunk-Z63F3XHK.js.map +1 -0
- package/dist/{chunk-KJDRVBAH.cjs → chunk-Z67JQNEH.cjs} +11 -11
- package/dist/{chunk-KJDRVBAH.cjs.map → chunk-Z67JQNEH.cjs.map} +1 -1
- package/dist/{chunk-QVTTP5HC.js → chunk-ZCBMZ24O.js} +3 -3
- package/dist/{chunk-QVTTP5HC.js.map → chunk-ZCBMZ24O.js.map} +1 -1
- package/dist/{chunk-NMO7ITAY.js → chunk-ZHYPWNWS.js} +5 -5
- package/dist/{chunk-NMO7ITAY.js.map → chunk-ZHYPWNWS.js.map} +1 -1
- package/dist/{chunk-B7JN64YW.cjs → chunk-ZUN5CMDY.cjs} +86 -86
- package/dist/{chunk-B7JN64YW.cjs.map → chunk-ZUN5CMDY.cjs.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/deployer/index.cjs +2 -2
- package/dist/deployer/index.js +1 -1
- package/dist/docs/SKILL.md +2 -2
- package/dist/docs/assets/SOURCE_MAP.json +499 -499
- package/dist/docs/references/reference-templates-overview.md +88 -14
- package/dist/evals/index.cjs +23 -23
- package/dist/evals/index.js +3 -3
- package/dist/evals/scoreTraces/index.cjs +7 -7
- package/dist/evals/scoreTraces/index.js +3 -3
- package/dist/harness/index.cjs +13 -13
- package/dist/harness/index.js +7 -7
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +20 -20
- package/dist/llm/index.js +5 -5
- package/dist/logger/default-logger.d.ts +1 -1
- package/dist/logger/default-logger.d.ts.map +1 -1
- package/dist/logger/index.cjs +12 -12
- package/dist/logger/index.js +2 -2
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/mastra-O4WWP6N5.js +3 -0
- package/dist/{mastra-5WYO5ZWG.js.map → mastra-O4WWP6N5.js.map} +1 -1
- package/dist/mastra-VHS7LVQG.cjs +12 -0
- package/dist/{mastra-LIISVKXT.cjs.map → mastra-VHS7LVQG.cjs.map} +1 -1
- package/dist/mcp/index.cjs +4 -4
- package/dist/mcp/index.js +2 -2
- package/dist/memory/index.cjs +17 -17
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-3IPTEPRM.cjs +12 -0
- package/dist/{models-dev-GD4LL56A.cjs.map → models-dev-3IPTEPRM.cjs.map} +1 -1
- package/dist/models-dev-4W7JQVWR.js +3 -0
- package/dist/{models-dev-CJ7IIPNG.js.map → models-dev-4W7JQVWR.js.map} +1 -1
- package/dist/netlify-FZBGNFDI.js +3 -0
- package/dist/{netlify-PMGHRONJ.js.map → netlify-FZBGNFDI.js.map} +1 -1
- package/dist/netlify-XT32D45G.cjs +12 -0
- package/dist/{netlify-6V7UBVTK.cjs.map → netlify-XT32D45G.cjs.map} +1 -1
- package/dist/observability/context-storage.cjs +28 -14
- package/dist/observability/context-storage.cjs.map +1 -1
- package/dist/observability/context-storage.d.ts.map +1 -1
- package/dist/observability/context-storage.js +28 -1
- package/dist/observability/context-storage.js.map +1 -1
- package/dist/observability/index.cjs +26 -10
- package/dist/observability/index.js +1 -1
- package/dist/observability/utils.d.ts +27 -0
- package/dist/observability/utils.d.ts.map +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +44 -44
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-AWL2JDVF.js +3 -0
- package/dist/{provider-registry-JV46DWD7.js.map → provider-registry-AWL2JDVF.js.map} +1 -1
- package/dist/provider-registry-X5PBSJ2G.cjs +40 -0
- package/dist/{provider-registry-U26G7C4O.cjs.map → provider-registry-X5PBSJ2G.cjs.map} +1 -1
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.cjs +5 -5
- package/dist/server/index.js +2 -2
- package/dist/storage/constants.cjs +56 -56
- package/dist/storage/constants.js +1 -1
- package/dist/storage/index.cjs +286 -286
- package/dist/storage/index.js +3 -3
- package/dist/stream/index.cjs +8 -8
- package/dist/stream/index.js +1 -1
- package/dist/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/utils.cjs +25 -25
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +9 -9
- package/dist/vector/index.js +2 -2
- package/dist/voice/index.cjs +6 -6
- package/dist/voice/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +24 -24
- package/dist/workflows/index.js +1 -1
- package/dist/workspace/index.cjs +68 -68
- package/dist/workspace/index.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-2DKOLMVJ.js +0 -28
- package/dist/chunk-2DKOLMVJ.js.map +0 -1
- package/dist/chunk-44P7C37G.js.map +0 -1
- package/dist/chunk-C3G6OQ52.cjs.map +0 -1
- package/dist/chunk-D5FMOLQZ.cjs +0 -32
- package/dist/chunk-D5FMOLQZ.cjs.map +0 -1
- package/dist/chunk-DKK77FIJ.cjs.map +0 -1
- package/dist/chunk-DNW46JHP.js.map +0 -1
- package/dist/chunk-EHBTASCW.js.map +0 -1
- package/dist/chunk-HBO2PK7W.cjs.map +0 -1
- package/dist/chunk-JK5YBBUS.cjs.map +0 -1
- package/dist/chunk-JSG6FULW.cjs.map +0 -1
- package/dist/chunk-KCVSVDQ2.js.map +0 -1
- package/dist/chunk-M3LRSDLL.js.map +0 -1
- package/dist/chunk-MISEF5LK.js.map +0 -1
- package/dist/chunk-OFABGAOY.cjs.map +0 -1
- package/dist/chunk-YRDMMXBW.cjs.map +0 -1
- package/dist/chunk-Z2IR7J5I.js.map +0 -1
- package/dist/mastra-5WYO5ZWG.js +0 -3
- package/dist/mastra-LIISVKXT.cjs +0 -12
- package/dist/models-dev-CJ7IIPNG.js +0 -3
- package/dist/models-dev-GD4LL56A.cjs +0 -12
- package/dist/netlify-6V7UBVTK.cjs +0 -12
- package/dist/netlify-PMGHRONJ.js +0 -3
- package/dist/provider-registry-JV46DWD7.js +0 -3
- package/dist/provider-registry-U26G7C4O.cjs +0 -40
package/dist/workflows/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DefaultExecutionEngine, ExecutionEngine, Run, Workflow, cleanStepResult, cloneStep, cloneWorkflow, createDeprecationProxy, createStep, createTimeTravelExecutionParams, createWorkflow, getResumeLabelsByStepId, getStepIds, getStepResult, hydrateSerializedStepErrors, isProcessor, mapVariable, runCountDeprecationMessage, validateStepInput, validateStepRequestContext, validateStepResumeData, validateStepStateData, validateStepSuspendData } from '../chunk-
|
|
1
|
+
export { DefaultExecutionEngine, ExecutionEngine, Run, Workflow, cleanStepResult, cloneStep, cloneWorkflow, createDeprecationProxy, createStep, createTimeTravelExecutionParams, createWorkflow, getResumeLabelsByStepId, getStepIds, getStepResult, hydrateSerializedStepErrors, isProcessor, mapVariable, runCountDeprecationMessage, validateStepInput, validateStepRequestContext, validateStepResumeData, validateStepStateData, validateStepSuspendData } from '../chunk-QYQSXRFZ.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/workspace/index.cjs
CHANGED
|
@@ -1,276 +1,276 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkX6CDTXAM_cjs = require('../chunk-X6CDTXAM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "CompositeFilesystem", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkX6CDTXAM_cjs.CompositeFilesystem; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "CompositeVersionedSkillSource", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkX6CDTXAM_cjs.CompositeVersionedSkillSource; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "DirectoryNotEmptyError", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkX6CDTXAM_cjs.DirectoryNotEmptyError; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "DirectoryNotFoundError", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkX6CDTXAM_cjs.DirectoryNotFoundError; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FileExistsError", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkX6CDTXAM_cjs.FileExistsError; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FileNotFoundError", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkX6CDTXAM_cjs.FileNotFoundError; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FileReadRequiredError", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkX6CDTXAM_cjs.FileReadRequiredError; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "FilesystemError", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkX6CDTXAM_cjs.FilesystemError; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "FilesystemNotAvailableError", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkX6CDTXAM_cjs.FilesystemNotAvailableError; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "FilesystemNotMountableError", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkX6CDTXAM_cjs.FilesystemNotMountableError; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "FilesystemNotReadyError", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkX6CDTXAM_cjs.FilesystemNotReadyError; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "IsDirectoryError", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkX6CDTXAM_cjs.IsDirectoryError; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "IsolationUnavailableError", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkX6CDTXAM_cjs.IsolationUnavailableError; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "LocalFilesystem", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkX6CDTXAM_cjs.LocalFilesystem; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "LocalSandbox", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkX6CDTXAM_cjs.LocalSandbox; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "LocalSkillSource", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkX6CDTXAM_cjs.LocalSkillSource; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "MastraFilesystem", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkX6CDTXAM_cjs.MastraFilesystem; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "MastraSandbox", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkX6CDTXAM_cjs.MastraSandbox; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "MountError", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkX6CDTXAM_cjs.MountError; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "MountManager", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkX6CDTXAM_cjs.MountManager; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "MountNotSupportedError", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkX6CDTXAM_cjs.MountNotSupportedError; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "NotDirectoryError", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkX6CDTXAM_cjs.NotDirectoryError; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "PermissionError", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkX6CDTXAM_cjs.PermissionError; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "ProcessHandle", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkX6CDTXAM_cjs.ProcessHandle; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "SandboxError", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkX6CDTXAM_cjs.SandboxError; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "SandboxExecutionError", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkX6CDTXAM_cjs.SandboxExecutionError; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "SandboxFeatureNotSupportedError", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkX6CDTXAM_cjs.SandboxFeatureNotSupportedError; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "SandboxNotAvailableError", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkX6CDTXAM_cjs.SandboxNotAvailableError; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "SandboxNotReadyError", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkX6CDTXAM_cjs.SandboxNotReadyError; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "SandboxProcessManager", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkX6CDTXAM_cjs.SandboxProcessManager; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "SandboxTimeoutError", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkX6CDTXAM_cjs.SandboxTimeoutError; }
|
|
130
130
|
});
|
|
131
131
|
Object.defineProperty(exports, "SearchNotAvailableError", {
|
|
132
132
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkX6CDTXAM_cjs.SearchNotAvailableError; }
|
|
134
134
|
});
|
|
135
135
|
Object.defineProperty(exports, "StaleFileError", {
|
|
136
136
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunkX6CDTXAM_cjs.StaleFileError; }
|
|
138
138
|
});
|
|
139
139
|
Object.defineProperty(exports, "VersionedSkillSource", {
|
|
140
140
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkX6CDTXAM_cjs.VersionedSkillSource; }
|
|
142
142
|
});
|
|
143
143
|
Object.defineProperty(exports, "WORKSPACE_TOOLS", {
|
|
144
144
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunkX6CDTXAM_cjs.WORKSPACE_TOOLS; }
|
|
146
146
|
});
|
|
147
147
|
Object.defineProperty(exports, "WORKSPACE_TOOLS_PREFIX", {
|
|
148
148
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
149
|
+
get: function () { return chunkX6CDTXAM_cjs.WORKSPACE_TOOLS_PREFIX; }
|
|
150
150
|
});
|
|
151
151
|
Object.defineProperty(exports, "Workspace", {
|
|
152
152
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunkX6CDTXAM_cjs.Workspace; }
|
|
154
154
|
});
|
|
155
155
|
Object.defineProperty(exports, "WorkspaceError", {
|
|
156
156
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunkX6CDTXAM_cjs.WorkspaceError; }
|
|
158
158
|
});
|
|
159
159
|
Object.defineProperty(exports, "WorkspaceNotAvailableError", {
|
|
160
160
|
enumerable: true,
|
|
161
|
-
get: function () { return
|
|
161
|
+
get: function () { return chunkX6CDTXAM_cjs.WorkspaceNotAvailableError; }
|
|
162
162
|
});
|
|
163
163
|
Object.defineProperty(exports, "WorkspaceNotReadyError", {
|
|
164
164
|
enumerable: true,
|
|
165
|
-
get: function () { return
|
|
165
|
+
get: function () { return chunkX6CDTXAM_cjs.WorkspaceNotReadyError; }
|
|
166
166
|
});
|
|
167
167
|
Object.defineProperty(exports, "WorkspaceReadOnlyError", {
|
|
168
168
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
169
|
+
get: function () { return chunkX6CDTXAM_cjs.WorkspaceReadOnlyError; }
|
|
170
170
|
});
|
|
171
171
|
Object.defineProperty(exports, "callLifecycle", {
|
|
172
172
|
enumerable: true,
|
|
173
|
-
get: function () { return
|
|
173
|
+
get: function () { return chunkX6CDTXAM_cjs.callLifecycle; }
|
|
174
174
|
});
|
|
175
175
|
Object.defineProperty(exports, "collectSkillForPublish", {
|
|
176
176
|
enumerable: true,
|
|
177
|
-
get: function () { return
|
|
177
|
+
get: function () { return chunkX6CDTXAM_cjs.collectSkillForPublish; }
|
|
178
178
|
});
|
|
179
179
|
Object.defineProperty(exports, "createGlobMatcher", {
|
|
180
180
|
enumerable: true,
|
|
181
|
-
get: function () { return
|
|
181
|
+
get: function () { return chunkX6CDTXAM_cjs.createGlobMatcher; }
|
|
182
182
|
});
|
|
183
183
|
Object.defineProperty(exports, "createSkillTools", {
|
|
184
184
|
enumerable: true,
|
|
185
|
-
get: function () { return
|
|
185
|
+
get: function () { return chunkX6CDTXAM_cjs.createSkillTools; }
|
|
186
186
|
});
|
|
187
187
|
Object.defineProperty(exports, "createWorkspaceTools", {
|
|
188
188
|
enumerable: true,
|
|
189
|
-
get: function () { return
|
|
189
|
+
get: function () { return chunkX6CDTXAM_cjs.createWorkspaceTools; }
|
|
190
190
|
});
|
|
191
191
|
Object.defineProperty(exports, "deleteFileTool", {
|
|
192
192
|
enumerable: true,
|
|
193
|
-
get: function () { return
|
|
193
|
+
get: function () { return chunkX6CDTXAM_cjs.deleteFileTool; }
|
|
194
194
|
});
|
|
195
195
|
Object.defineProperty(exports, "detectIsolation", {
|
|
196
196
|
enumerable: true,
|
|
197
|
-
get: function () { return
|
|
197
|
+
get: function () { return chunkX6CDTXAM_cjs.detectIsolation; }
|
|
198
198
|
});
|
|
199
199
|
Object.defineProperty(exports, "editFileTool", {
|
|
200
200
|
enumerable: true,
|
|
201
|
-
get: function () { return
|
|
201
|
+
get: function () { return chunkX6CDTXAM_cjs.editFileTool; }
|
|
202
202
|
});
|
|
203
203
|
Object.defineProperty(exports, "executeCommandTool", {
|
|
204
204
|
enumerable: true,
|
|
205
|
-
get: function () { return
|
|
205
|
+
get: function () { return chunkX6CDTXAM_cjs.executeCommandTool; }
|
|
206
206
|
});
|
|
207
207
|
Object.defineProperty(exports, "extractGlobBase", {
|
|
208
208
|
enumerable: true,
|
|
209
|
-
get: function () { return
|
|
209
|
+
get: function () { return chunkX6CDTXAM_cjs.extractGlobBase; }
|
|
210
210
|
});
|
|
211
211
|
Object.defineProperty(exports, "fileStatTool", {
|
|
212
212
|
enumerable: true,
|
|
213
|
-
get: function () { return
|
|
213
|
+
get: function () { return chunkX6CDTXAM_cjs.fileStatTool; }
|
|
214
214
|
});
|
|
215
215
|
Object.defineProperty(exports, "getRecommendedIsolation", {
|
|
216
216
|
enumerable: true,
|
|
217
|
-
get: function () { return
|
|
217
|
+
get: function () { return chunkX6CDTXAM_cjs.getRecommendedIsolation; }
|
|
218
218
|
});
|
|
219
219
|
Object.defineProperty(exports, "indexContentTool", {
|
|
220
220
|
enumerable: true,
|
|
221
|
-
get: function () { return
|
|
221
|
+
get: function () { return chunkX6CDTXAM_cjs.indexContentTool; }
|
|
222
222
|
});
|
|
223
223
|
Object.defineProperty(exports, "isGlobPattern", {
|
|
224
224
|
enumerable: true,
|
|
225
|
-
get: function () { return
|
|
225
|
+
get: function () { return chunkX6CDTXAM_cjs.isGlobPattern; }
|
|
226
226
|
});
|
|
227
227
|
Object.defineProperty(exports, "isIsolationAvailable", {
|
|
228
228
|
enumerable: true,
|
|
229
|
-
get: function () { return
|
|
229
|
+
get: function () { return chunkX6CDTXAM_cjs.isIsolationAvailable; }
|
|
230
230
|
});
|
|
231
231
|
Object.defineProperty(exports, "listFilesTool", {
|
|
232
232
|
enumerable: true,
|
|
233
|
-
get: function () { return
|
|
233
|
+
get: function () { return chunkX6CDTXAM_cjs.listFilesTool; }
|
|
234
234
|
});
|
|
235
235
|
Object.defineProperty(exports, "matchGlob", {
|
|
236
236
|
enumerable: true,
|
|
237
|
-
get: function () { return
|
|
237
|
+
get: function () { return chunkX6CDTXAM_cjs.matchGlob; }
|
|
238
238
|
});
|
|
239
239
|
Object.defineProperty(exports, "mkdirTool", {
|
|
240
240
|
enumerable: true,
|
|
241
|
-
get: function () { return
|
|
241
|
+
get: function () { return chunkX6CDTXAM_cjs.mkdirTool; }
|
|
242
242
|
});
|
|
243
243
|
Object.defineProperty(exports, "publishSkillFromSource", {
|
|
244
244
|
enumerable: true,
|
|
245
|
-
get: function () { return
|
|
245
|
+
get: function () { return chunkX6CDTXAM_cjs.publishSkillFromSource; }
|
|
246
246
|
});
|
|
247
247
|
Object.defineProperty(exports, "readFileTool", {
|
|
248
248
|
enumerable: true,
|
|
249
|
-
get: function () { return
|
|
249
|
+
get: function () { return chunkX6CDTXAM_cjs.readFileTool; }
|
|
250
250
|
});
|
|
251
251
|
Object.defineProperty(exports, "requireFilesystem", {
|
|
252
252
|
enumerable: true,
|
|
253
|
-
get: function () { return
|
|
253
|
+
get: function () { return chunkX6CDTXAM_cjs.requireFilesystem; }
|
|
254
254
|
});
|
|
255
255
|
Object.defineProperty(exports, "requireSandbox", {
|
|
256
256
|
enumerable: true,
|
|
257
|
-
get: function () { return
|
|
257
|
+
get: function () { return chunkX6CDTXAM_cjs.requireSandbox; }
|
|
258
258
|
});
|
|
259
259
|
Object.defineProperty(exports, "requireWorkspace", {
|
|
260
260
|
enumerable: true,
|
|
261
|
-
get: function () { return
|
|
261
|
+
get: function () { return chunkX6CDTXAM_cjs.requireWorkspace; }
|
|
262
262
|
});
|
|
263
263
|
Object.defineProperty(exports, "resolveToolConfig", {
|
|
264
264
|
enumerable: true,
|
|
265
|
-
get: function () { return
|
|
265
|
+
get: function () { return chunkX6CDTXAM_cjs.resolveToolConfig; }
|
|
266
266
|
});
|
|
267
267
|
Object.defineProperty(exports, "searchTool", {
|
|
268
268
|
enumerable: true,
|
|
269
|
-
get: function () { return
|
|
269
|
+
get: function () { return chunkX6CDTXAM_cjs.searchTool; }
|
|
270
270
|
});
|
|
271
271
|
Object.defineProperty(exports, "writeFileTool", {
|
|
272
272
|
enumerable: true,
|
|
273
|
-
get: function () { return
|
|
273
|
+
get: function () { return chunkX6CDTXAM_cjs.writeFileTool; }
|
|
274
274
|
});
|
|
275
275
|
//# sourceMappingURL=index.cjs.map
|
|
276
276
|
//# sourceMappingURL=index.cjs.map
|
package/dist/workspace/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { CompositeFilesystem, CompositeVersionedSkillSource, DirectoryNotEmptyError, DirectoryNotFoundError, FileExistsError, FileNotFoundError, FileReadRequiredError, FilesystemError, FilesystemNotAvailableError, FilesystemNotMountableError, FilesystemNotReadyError, IsDirectoryError, IsolationUnavailableError, LocalFilesystem, LocalSandbox, LocalSkillSource, MastraFilesystem, MastraSandbox, MountError, MountManager, MountNotSupportedError, NotDirectoryError, PermissionError, ProcessHandle, SandboxError, SandboxExecutionError, SandboxFeatureNotSupportedError, SandboxNotAvailableError, SandboxNotReadyError, SandboxProcessManager, SandboxTimeoutError, SearchNotAvailableError, StaleFileError, VersionedSkillSource, WORKSPACE_TOOLS, WORKSPACE_TOOLS_PREFIX, Workspace, WorkspaceError, WorkspaceNotAvailableError, WorkspaceNotReadyError, WorkspaceReadOnlyError, callLifecycle, collectSkillForPublish, createGlobMatcher, createSkillTools, createWorkspaceTools, deleteFileTool, detectIsolation, editFileTool, executeCommandTool, extractGlobBase, fileStatTool, getRecommendedIsolation, indexContentTool, isGlobPattern, isIsolationAvailable, listFilesTool, matchGlob, mkdirTool, publishSkillFromSource, readFileTool, requireFilesystem, requireSandbox, requireWorkspace, resolveToolConfig, searchTool, writeFileTool } from '../chunk-
|
|
1
|
+
export { CompositeFilesystem, CompositeVersionedSkillSource, DirectoryNotEmptyError, DirectoryNotFoundError, FileExistsError, FileNotFoundError, FileReadRequiredError, FilesystemError, FilesystemNotAvailableError, FilesystemNotMountableError, FilesystemNotReadyError, IsDirectoryError, IsolationUnavailableError, LocalFilesystem, LocalSandbox, LocalSkillSource, MastraFilesystem, MastraSandbox, MountError, MountManager, MountNotSupportedError, NotDirectoryError, PermissionError, ProcessHandle, SandboxError, SandboxExecutionError, SandboxFeatureNotSupportedError, SandboxNotAvailableError, SandboxNotReadyError, SandboxProcessManager, SandboxTimeoutError, SearchNotAvailableError, StaleFileError, VersionedSkillSource, WORKSPACE_TOOLS, WORKSPACE_TOOLS_PREFIX, Workspace, WorkspaceError, WorkspaceNotAvailableError, WorkspaceNotReadyError, WorkspaceReadOnlyError, callLifecycle, collectSkillForPublish, createGlobMatcher, createSkillTools, createWorkspaceTools, deleteFileTool, detectIsolation, editFileTool, executeCommandTool, extractGlobBase, fileStatTool, getRecommendedIsolation, indexContentTool, isGlobPattern, isIsolationAvailable, listFilesTool, matchGlob, mkdirTool, publishSkillFromSource, readFileTool, requireFilesystem, requireSandbox, requireWorkspace, resolveToolConfig, searchTool, writeFileTool } from '../chunk-EG3UGEUZ.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/core",
|
|
3
|
-
"version": "1.23.0-alpha.
|
|
3
|
+
"version": "1.23.0-alpha.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -289,15 +289,15 @@
|
|
|
289
289
|
"vscode-jsonrpc": "^8.2.1",
|
|
290
290
|
"vscode-languageserver-protocol": "^3.17.5",
|
|
291
291
|
"zod": "^4.3.6",
|
|
292
|
-
"@internal/ai-sdk-v5": "0.0.26",
|
|
293
292
|
"@internal/ai-sdk-v4": "0.0.26",
|
|
294
|
-
"@internal/
|
|
293
|
+
"@internal/ai-sdk-v5": "0.0.26",
|
|
295
294
|
"@internal/ai-v6": "0.0.26",
|
|
295
|
+
"@internal/core": "0.0.0",
|
|
296
296
|
"@internal/external-types": "0.0.29",
|
|
297
297
|
"@internal/lint": "0.0.79",
|
|
298
|
+
"@internal/test-utils": "0.0.15",
|
|
298
299
|
"@internal/llm-recorder": "0.0.15",
|
|
299
|
-
"@internal/types-builder": "0.0.54"
|
|
300
|
-
"@internal/test-utils": "0.0.15"
|
|
300
|
+
"@internal/types-builder": "0.0.54"
|
|
301
301
|
},
|
|
302
302
|
"engines": {
|
|
303
303
|
"node": ">=22.13.0"
|
package/dist/chunk-2DKOLMVJ.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { setCurrentSpanResolver } from './chunk-44P7C37G.js';
|
|
2
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
|
-
|
|
4
|
-
var spanContextStorage = new AsyncLocalStorage();
|
|
5
|
-
function getCurrentSpan() {
|
|
6
|
-
return spanContextStorage.getStore();
|
|
7
|
-
}
|
|
8
|
-
setCurrentSpanResolver(getCurrentSpan);
|
|
9
|
-
async function executeWithContext(params) {
|
|
10
|
-
const { span, fn } = params;
|
|
11
|
-
const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;
|
|
12
|
-
if (span?.executeInContext) {
|
|
13
|
-
return span.executeInContext(wrappedFn);
|
|
14
|
-
}
|
|
15
|
-
return wrappedFn();
|
|
16
|
-
}
|
|
17
|
-
function executeWithContextSync(params) {
|
|
18
|
-
const { span, fn } = params;
|
|
19
|
-
const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;
|
|
20
|
-
if (span?.executeInContextSync) {
|
|
21
|
-
return span.executeInContextSync(wrappedFn);
|
|
22
|
-
}
|
|
23
|
-
return wrappedFn();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { executeWithContext, executeWithContextSync, getCurrentSpan };
|
|
27
|
-
//# sourceMappingURL=chunk-2DKOLMVJ.js.map
|
|
28
|
-
//# sourceMappingURL=chunk-2DKOLMVJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/observability/context-storage.ts"],"names":[],"mappings":";;;AAUA,IAAM,kBAAA,GAAqB,IAAI,iBAAA,EAA2B;AAMnD,SAAS,cAAA,GAAsC;AACpD,EAAA,OAAO,mBAAmB,QAAA,EAAS;AACrC;AAEA,sBAAA,CAAuB,cAAc,CAAA;AAqBrC,eAAsB,mBAAsB,MAAA,EAA8D;AACxG,EAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAG,GAAI,MAAA;AAGrB,EAAA,MAAM,YAAY,IAAA,GAAO,MAAM,mBAAmB,GAAA,CAAI,IAAA,EAAM,EAAE,CAAA,GAAI,EAAA;AAElE,EAAA,IAAI,MAAM,gBAAA,EAAkB;AAC1B,IAAA,OAAO,IAAA,CAAK,iBAAiB,SAAS,CAAA;AAAA,EACxC;AAEA,EAAA,OAAO,SAAA,EAAU;AACnB;AAqBO,SAAS,uBAA0B,MAAA,EAA4C;AACpF,EAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAG,GAAI,MAAA;AAGrB,EAAA,MAAM,YAAY,IAAA,GAAO,MAAM,mBAAmB,GAAA,CAAI,IAAA,EAAM,EAAE,CAAA,GAAI,EAAA;AAElE,EAAA,IAAI,MAAM,oBAAA,EAAsB;AAC9B,IAAA,OAAO,IAAA,CAAK,qBAAqB,SAAS,CAAA;AAAA,EAC5C;AAEA,EAAA,OAAO,SAAA,EAAU;AACnB","file":"chunk-2DKOLMVJ.js","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { AnySpan } from './types';\nimport { setCurrentSpanResolver } from './utils';\n\n/**\n * Ambient storage for the current span. Populated by executeWithContext/executeWithContextSync\n * so that infrastructure code (e.g. DualLogger) can resolve the active span without\n * being passed it explicitly.\n */\nconst spanContextStorage = new AsyncLocalStorage<AnySpan>();\n\n/**\n * Returns the current span from AsyncLocalStorage, if one is active.\n * Used by DualLogger to forward logs to a span-correlated loggerVNext.\n */\nexport function getCurrentSpan(): AnySpan | undefined {\n return spanContextStorage.getStore();\n}\n\nsetCurrentSpanResolver(getCurrentSpan);\n\n/**\n * Execute an async function within the span's tracing context if available.\n * Falls back to direct execution if no span exists.\n *\n * When a bridge is configured, this enables auto-instrumented operations\n * (HTTP requests, database queries, etc.) to be properly nested under the\n * current span in the external tracing system.\n *\n * @param span - The span to use as context (or undefined to execute without context)\n * @param fn - The async function to execute\n * @returns The result of the function execution\n *\n * @example\n * ```typescript\n * const result = await executeWithContext(llmSpan, async () =>\n * model.generateText(args)\n * );\n * ```\n */\nexport async function executeWithContext<T>(params: { span?: AnySpan; fn: () => Promise<T> }): Promise<T> {\n const { span, fn } = params;\n\n // Wrap fn so the span is available via getCurrentSpan() inside the async context.\n const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;\n\n if (span?.executeInContext) {\n return span.executeInContext(wrappedFn);\n }\n\n return wrappedFn();\n}\n\n/**\n * Execute a synchronous function within the span's tracing context if available.\n * Falls back to direct execution if no span exists.\n *\n * When a bridge is configured, this enables auto-instrumented operations\n * (HTTP requests, database queries, etc.) to be properly nested under the\n * current span in the external tracing system.\n *\n * @param span - The span to use as context (or undefined to execute without context)\n * @param fn - The synchronous function to execute\n * @returns The result of the function execution\n *\n * @example\n * ```typescript\n * const result = executeWithContextSync(llmSpan, () =>\n * model.streamText(args)\n * );\n * ```\n */\nexport function executeWithContextSync<T>(params: { span?: AnySpan; fn: () => T }): T {\n const { span, fn } = params;\n\n // Wrap fn so the span is available via getCurrentSpan() inside the sync context.\n const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;\n\n if (span?.executeInContextSync) {\n return span.executeInContextSync(wrappedFn);\n }\n\n return wrappedFn();\n}\n"]}
|