@mastra/core 0.17.0-alpha.8 → 0.17.0
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 +122 -0
- package/dist/agent/index.cjs +11 -11
- package/dist/agent/index.js +2 -2
- package/dist/agent/input-processor/index.cjs +6 -6
- package/dist/agent/input-processor/index.js +1 -1
- package/dist/ai-tracing/index.cjs +32 -32
- package/dist/ai-tracing/index.js +1 -1
- package/dist/{chunk-PPDAGFR2.cjs → chunk-5OH5VHX5.cjs} +4 -4
- package/dist/{chunk-PPDAGFR2.cjs.map → chunk-5OH5VHX5.cjs.map} +1 -1
- package/dist/{chunk-BBI6HIN2.cjs → chunk-6TQSVAUZ.cjs} +7 -7
- package/dist/{chunk-BBI6HIN2.cjs.map → chunk-6TQSVAUZ.cjs.map} +1 -1
- package/dist/{chunk-MTJXEZUV.cjs → chunk-B2ZNJ7EW.cjs} +6 -6
- package/dist/{chunk-MTJXEZUV.cjs.map → chunk-B2ZNJ7EW.cjs.map} +1 -1
- package/dist/{chunk-H272TL2F.js → chunk-B6WB5A6U.js} +4 -4
- package/dist/{chunk-H272TL2F.js.map → chunk-B6WB5A6U.js.map} +1 -1
- package/dist/{chunk-BZ4AOVOL.cjs → chunk-BL44ZRZT.cjs} +6 -6
- package/dist/{chunk-BZ4AOVOL.cjs.map → chunk-BL44ZRZT.cjs.map} +1 -1
- package/dist/{chunk-GWSHTBQY.js → chunk-CD4WDS4V.js} +4 -4
- package/dist/{chunk-GWSHTBQY.js.map → chunk-CD4WDS4V.js.map} +1 -1
- package/dist/{chunk-WQEATYNS.cjs → chunk-DOARUBVA.cjs} +35 -35
- package/dist/{chunk-WQEATYNS.cjs.map → chunk-DOARUBVA.cjs.map} +1 -1
- package/dist/{chunk-BJLIYOUK.js → chunk-EMPBDL5C.js} +3 -3
- package/dist/{chunk-BJLIYOUK.js.map → chunk-EMPBDL5C.js.map} +1 -1
- package/dist/{chunk-DDINE7CK.js → chunk-GS2TSJOZ.js} +3 -3
- package/dist/{chunk-DDINE7CK.js.map → chunk-GS2TSJOZ.js.map} +1 -1
- package/dist/{chunk-N4YXCARN.cjs → chunk-HQFRMWRB.cjs} +4 -4
- package/dist/{chunk-N4YXCARN.cjs.map → chunk-HQFRMWRB.cjs.map} +1 -1
- package/dist/{chunk-WYBYCVS3.cjs → chunk-ICE3AMTD.cjs} +4 -4
- package/dist/{chunk-WYBYCVS3.cjs.map → chunk-ICE3AMTD.cjs.map} +1 -1
- package/dist/{chunk-VRRY6NGC.js → chunk-ISQ7LHV6.js} +4 -4
- package/dist/{chunk-VRRY6NGC.js.map → chunk-ISQ7LHV6.js.map} +1 -1
- package/dist/{chunk-AWH4VWOH.js → chunk-K4ROJXAQ.js} +3 -3
- package/dist/{chunk-AWH4VWOH.js.map → chunk-K4ROJXAQ.js.map} +1 -1
- package/dist/{chunk-CWG4ACYX.js → chunk-KE5KVIPQ.js} +5 -5
- package/dist/{chunk-CWG4ACYX.js.map → chunk-KE5KVIPQ.js.map} +1 -1
- package/dist/{chunk-2LYMBKNF.cjs → chunk-LIVKDHYX.cjs} +8 -8
- package/dist/{chunk-2LYMBKNF.cjs.map → chunk-LIVKDHYX.cjs.map} +1 -1
- package/dist/{chunk-QSDYWMXU.js → chunk-M65NZ6EW.js} +7 -7
- package/dist/{chunk-QSDYWMXU.js.map → chunk-M65NZ6EW.js.map} +1 -1
- package/dist/{chunk-CIPXOPLS.js → chunk-PUQCQUH7.js} +3 -3
- package/dist/{chunk-CIPXOPLS.js.map → chunk-PUQCQUH7.js.map} +1 -1
- package/dist/{chunk-E42ZTCWN.cjs → chunk-RUZBKNXG.cjs} +12 -12
- package/dist/{chunk-E42ZTCWN.cjs.map → chunk-RUZBKNXG.cjs.map} +1 -1
- package/dist/index.cjs +39 -39
- package/dist/index.js +8 -8
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.js +1 -1
- package/dist/network/vNext/index.cjs +29 -29
- package/dist/network/vNext/index.js +2 -2
- package/dist/processors/index.cjs +8 -8
- package/dist/processors/index.js +2 -2
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.js +1 -1
- package/dist/scores/index.cjs +8 -8
- package/dist/scores/index.js +1 -1
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.js +1 -1
- package/dist/stream/index.cjs +4 -4
- package/dist/stream/index.js +1 -1
- package/dist/test-utils/llm-mock.cjs +2 -2
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/utils.cjs +17 -17
- package/dist/utils.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +10 -10
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/legacy/index.cjs +22 -22
- package/dist/workflows/legacy/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,127 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
|
|
8
|
+
|
|
9
|
+
- Fully deprecated createRun (now throws an error) in favour of createRunAsync ([#7897](https://github.com/mastra-ai/mastra/pull/7897))
|
|
10
|
+
|
|
11
|
+
- Improved workspace dependency resolution during development and builds. This makes the build process more reliable when working with monorepos and workspace packages, reducing potential bundling errors and improving development experience. ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- dependencies updates: ([#7861](https://github.com/mastra-ai/mastra/pull/7861))
|
|
16
|
+
- Updated dependency [`hono@^4.9.7` ↗︎](https://www.npmjs.com/package/hono/v/4.9.7) (from `^4.9.6`, in `dependencies`)
|
|
17
|
+
|
|
18
|
+
- Updated SensitiveDataFilter to be less greedy in its redacting ([#7840](https://github.com/mastra-ai/mastra/pull/7840))
|
|
19
|
+
|
|
20
|
+
- clean up console logs in monorepo ([#7926](https://github.com/mastra-ai/mastra/pull/7926))
|
|
21
|
+
|
|
22
|
+
- Update dependencies ai-v5 and @ai-sdk/provider-utils-v5 to latest ([#7884](https://github.com/mastra-ai/mastra/pull/7884))
|
|
23
|
+
|
|
24
|
+
- Added the ability to hide internal ai tracing spans (enabled by default) ([#7764](https://github.com/mastra-ai/mastra/pull/7764))
|
|
25
|
+
|
|
26
|
+
- "refactored ai tracing to commonize types" ([#7744](https://github.com/mastra-ai/mastra/pull/7744))
|
|
27
|
+
|
|
28
|
+
- Register server cache in Mastra ([#7946](https://github.com/mastra-ai/mastra/pull/7946))
|
|
29
|
+
|
|
30
|
+
- feat: add requiresAuth option for custom API routes ([#7703](https://github.com/mastra-ai/mastra/pull/7703))
|
|
31
|
+
|
|
32
|
+
Added a new `requiresAuth` option to the `ApiRoute` type that allows users to explicitly control authentication requirements for custom endpoints.
|
|
33
|
+
- By default, all custom routes require authentication (`requiresAuth: true`)
|
|
34
|
+
- Set `requiresAuth: false` to make a route publicly accessible without authentication
|
|
35
|
+
- The auth middleware now checks this configuration before applying authentication
|
|
36
|
+
|
|
37
|
+
Example usage:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
const customRoutes: ApiRoute[] = [
|
|
41
|
+
{
|
|
42
|
+
path: '/api/public-endpoint',
|
|
43
|
+
method: 'GET',
|
|
44
|
+
requiresAuth: false, // No authentication required
|
|
45
|
+
handler: async c => c.json({ message: 'Public access' }),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
path: '/api/protected-endpoint',
|
|
49
|
+
method: 'GET',
|
|
50
|
+
requiresAuth: true, // Authentication required (default)
|
|
51
|
+
handler: async c => c.json({ message: 'Protected access' }),
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This addresses issue #7674 where custom endpoints were not being protected by the authentication system.
|
|
57
|
+
|
|
58
|
+
- Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
|
|
59
|
+
|
|
60
|
+
- Only log stream/generate deprecation warning once ([#7905](https://github.com/mastra-ai/mastra/pull/7905))
|
|
61
|
+
|
|
62
|
+
- Add support for running the Mastra dev server over HTTPS for local development. ([#7871](https://github.com/mastra-ai/mastra/pull/7871))
|
|
63
|
+
- Add `--https` flag for `mastra dev`. This automatically creates a local key and certificate for you.
|
|
64
|
+
- Alternatively, you can provide your own key and cert through `server.https`:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
// src/mastra/index.ts
|
|
68
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
69
|
+
import fs from 'node:fs';
|
|
70
|
+
|
|
71
|
+
export const mastra = new Mastra({
|
|
72
|
+
server: {
|
|
73
|
+
https: {
|
|
74
|
+
key: fs.readFileSync('path/to/key.pem'),
|
|
75
|
+
cert: fs.readFileSync('path/to/cert.pem'),
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- refactored handling of internal ai spans to be more intelligent ([#7876](https://github.com/mastra-ai/mastra/pull/7876))
|
|
82
|
+
|
|
83
|
+
- Improve error message when using V1 model with streamVNext ([#7948](https://github.com/mastra-ai/mastra/pull/7948))
|
|
84
|
+
|
|
85
|
+
- prevent out-of-order span errors in ai-tracing DefaultExporter ([#7895](https://github.com/mastra-ai/mastra/pull/7895))
|
|
86
|
+
|
|
87
|
+
- move ToolExecutionOptions and ToolCallOptions to a union type (ToolInvocationOptions) for use in createTool, Tool, and ToolAction ([#7914](https://github.com/mastra-ai/mastra/pull/7914))
|
|
88
|
+
|
|
89
|
+
- avoid refetching on error when resolving a workflow in cloud ([#7842](https://github.com/mastra-ai/mastra/pull/7842))
|
|
90
|
+
|
|
91
|
+
- fix scorers table link full row ([#7915](https://github.com/mastra-ai/mastra/pull/7915))
|
|
92
|
+
|
|
93
|
+
- fix(core): handle JSON code blocks in structured output streaming ([#7864](https://github.com/mastra-ai/mastra/pull/7864))
|
|
94
|
+
|
|
95
|
+
- Postgresql Storage Query Index Performance: Adds index operations and automatic indexing for Postgresql ([#7757](https://github.com/mastra-ai/mastra/pull/7757))
|
|
96
|
+
|
|
97
|
+
- adjust the way we display scorers in agent metadata ([#7910](https://github.com/mastra-ai/mastra/pull/7910))
|
|
98
|
+
|
|
99
|
+
- fix: support destructuring of streamVNext return values ([#7920](https://github.com/mastra-ai/mastra/pull/7920))
|
|
100
|
+
|
|
101
|
+
- Fix VNext generate/stream usage tokens. They used to be undefined, now we are receiving the proper values. ([#7901](https://github.com/mastra-ai/mastra/pull/7901))
|
|
102
|
+
|
|
103
|
+
- Add model fallbacks ([#7126](https://github.com/mastra-ai/mastra/pull/7126))
|
|
104
|
+
|
|
105
|
+
- Add resource id to workflow run snapshots ([#7740](https://github.com/mastra-ai/mastra/pull/7740))
|
|
106
|
+
|
|
107
|
+
- Fixes assistant message ids when using toUIMessageStream, preserves the original messageId rather than creating a new id for this message. ([#7783](https://github.com/mastra-ai/mastra/pull/7783))
|
|
108
|
+
|
|
109
|
+
- Fixes multiple issues with stopWhen and step results. ([#7862](https://github.com/mastra-ai/mastra/pull/7862))
|
|
110
|
+
|
|
111
|
+
- fix error message when fetching observability things ([#7956](https://github.com/mastra-ai/mastra/pull/7956))
|
|
112
|
+
|
|
113
|
+
- Network stream class when calling agent.network() ([#7763](https://github.com/mastra-ai/mastra/pull/7763))
|
|
114
|
+
|
|
115
|
+
- fix workflows runs fetching and displaying ([#7852](https://github.com/mastra-ai/mastra/pull/7852))
|
|
116
|
+
|
|
117
|
+
- fix empty state for scorers on agent page ([#7846](https://github.com/mastra-ai/mastra/pull/7846))
|
|
118
|
+
|
|
119
|
+
- Remove extraneous console.log ([#7916](https://github.com/mastra-ai/mastra/pull/7916))
|
|
120
|
+
|
|
121
|
+
- Deprecate "output" in generate and stream VNext in favour of structuredOutput. When structuredOutput is used in tandem with maxSteps = 1, the structuredOutput processor won't run, it'll generate the output using the main agent, similar to how "output" used to work. ([#7750](https://github.com/mastra-ai/mastra/pull/7750))
|
|
122
|
+
|
|
123
|
+
- Fix switch in prompt-injection ([#7951](https://github.com/mastra-ai/mastra/pull/7951))
|
|
124
|
+
|
|
3
125
|
## 0.17.0-alpha.8
|
|
4
126
|
|
|
5
127
|
### Patch Changes
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkDOARUBVA_cjs = require('../chunk-DOARUBVA.cjs');
|
|
4
|
+
var chunkICE3AMTD_cjs = require('../chunk-ICE3AMTD.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Agent", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkDOARUBVA_cjs.Agent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "LanguageDetectorInputProcessor", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkDOARUBVA_cjs.LanguageDetectorInputProcessor; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "ModerationInputProcessor", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkDOARUBVA_cjs.ModerationInputProcessor; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "PIIDetectorInputProcessor", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkDOARUBVA_cjs.PIIDetectorInputProcessor; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "PromptInjectionDetectorInputProcessor", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkDOARUBVA_cjs.PromptInjectionDetectorInputProcessor; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "TripWire", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkDOARUBVA_cjs.TripWire; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "UnicodeNormalizerInputProcessor", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkDOARUBVA_cjs.UnicodeNormalizerInputProcessor; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "MessageList", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkICE3AMTD_cjs.MessageList; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "convertMessages", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkICE3AMTD_cjs.convertMessages; }
|
|
43
43
|
});
|
|
44
44
|
//# sourceMappingURL=index.cjs.map
|
|
45
45
|
//# sourceMappingURL=index.cjs.map
|
package/dist/agent/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Agent, LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, TripWire, UnicodeNormalizerInputProcessor } from '../chunk-
|
|
2
|
-
export { MessageList, convertMessages } from '../chunk-
|
|
1
|
+
export { Agent, LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, TripWire, UnicodeNormalizerInputProcessor } from '../chunk-M65NZ6EW.js';
|
|
2
|
+
export { MessageList, convertMessages } from '../chunk-PUQCQUH7.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDOARUBVA_cjs = require('../../chunk-DOARUBVA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "LanguageDetectorInputProcessor", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkDOARUBVA_cjs.LanguageDetectorInputProcessor; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "ModerationInputProcessor", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkDOARUBVA_cjs.ModerationInputProcessor; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "PIIDetectorInputProcessor", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkDOARUBVA_cjs.PIIDetectorInputProcessor; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "PromptInjectionDetectorInputProcessor", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkDOARUBVA_cjs.PromptInjectionDetectorInputProcessor; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "UnicodeNormalizerInputProcessor", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkDOARUBVA_cjs.UnicodeNormalizerInputProcessor; }
|
|
26
26
|
});
|
|
27
27
|
//# sourceMappingURL=index.cjs.map
|
|
28
28
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, UnicodeNormalizerInputProcessor } from '../../chunk-
|
|
1
|
+
export { LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, UnicodeNormalizerInputProcessor } from '../../chunk-M65NZ6EW.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,132 +1,132 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHQFRMWRB_cjs = require('../chunk-HQFRMWRB.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "AISpanType", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkHQFRMWRB_cjs.AISpanType; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "AITracingEventType", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkHQFRMWRB_cjs.AITracingEventType; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "BaseAISpan", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkHQFRMWRB_cjs.BaseAISpan; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "BaseAITracing", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkHQFRMWRB_cjs.BaseAITracing; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "CloudExporter", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkHQFRMWRB_cjs.CloudExporter; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "ConsoleExporter", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkHQFRMWRB_cjs.ConsoleExporter; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "DefaultAISpan", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkHQFRMWRB_cjs.DefaultAISpan; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "DefaultAITracing", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkHQFRMWRB_cjs.DefaultAITracing; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "DefaultExporter", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkHQFRMWRB_cjs.DefaultExporter; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "InternalSpans", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkHQFRMWRB_cjs.InternalSpans; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "NoOpAISpan", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkHQFRMWRB_cjs.NoOpAISpan; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "SamplingStrategyType", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkHQFRMWRB_cjs.SamplingStrategyType; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "SensitiveDataFilter", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkHQFRMWRB_cjs.SensitiveDataFilter; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "clearAITracingRegistry", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkHQFRMWRB_cjs.clearAITracingRegistry; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "deepClean", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkHQFRMWRB_cjs.deepClean; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "getAITracing", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkHQFRMWRB_cjs.getAITracing; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "getAllAITracing", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkHQFRMWRB_cjs.getAllAITracing; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "getDefaultAITracing", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkHQFRMWRB_cjs.getDefaultAITracing; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "getOrCreateSpan", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkHQFRMWRB_cjs.getOrCreateSpan; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "getSelectedAITracing", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkHQFRMWRB_cjs.getSelectedAITracing; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "getValidTraceId", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkHQFRMWRB_cjs.getValidTraceId; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "hasAITracing", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkHQFRMWRB_cjs.hasAITracing; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "isMastra", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkHQFRMWRB_cjs.isMastra; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "omitKeys", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkHQFRMWRB_cjs.omitKeys; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "registerAITracing", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkHQFRMWRB_cjs.registerAITracing; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "selectFields", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkHQFRMWRB_cjs.selectFields; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "setSelector", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkHQFRMWRB_cjs.setSelector; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "setupAITracing", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkHQFRMWRB_cjs.setupAITracing; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "shutdownAITracingRegistry", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkHQFRMWRB_cjs.shutdownAITracingRegistry; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "unregisterAITracing", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkHQFRMWRB_cjs.unregisterAITracing; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "wrapMastra", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkHQFRMWRB_cjs.wrapMastra; }
|
|
130
130
|
});
|
|
131
131
|
//# sourceMappingURL=index.cjs.map
|
|
132
132
|
//# sourceMappingURL=index.cjs.map
|
package/dist/ai-tracing/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, clearAITracingRegistry, deepClean, getAITracing, getAllAITracing, getDefaultAITracing, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isMastra, omitKeys, registerAITracing, selectFields, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra } from '../chunk-
|
|
1
|
+
export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, clearAITracingRegistry, deepClean, getAITracing, getAllAITracing, getDefaultAITracing, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isMastra, omitKeys, registerAITracing, selectFields, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra } from '../chunk-ISQ7LHV6.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDOARUBVA_cjs = require('./chunk-DOARUBVA.cjs');
|
|
4
4
|
|
|
5
5
|
// src/relevance/cohere/index.ts
|
|
6
6
|
var CohereRelevanceScorer = class {
|
|
@@ -54,7 +54,7 @@ Relevance score (0-1):`;
|
|
|
54
54
|
var MastraAgentRelevanceScorer = class {
|
|
55
55
|
agent;
|
|
56
56
|
constructor(name, model) {
|
|
57
|
-
this.agent = new
|
|
57
|
+
this.agent = new chunkDOARUBVA_cjs.Agent({
|
|
58
58
|
name: `Relevance Scorer ${name}`,
|
|
59
59
|
instructions: `You are a specialized agent for evaluating the relevance of text to queries.
|
|
60
60
|
Your task is to rate how well a text passage answers a given query.
|
|
@@ -87,5 +87,5 @@ Always return just the number, no explanation.`,
|
|
|
87
87
|
exports.CohereRelevanceScorer = CohereRelevanceScorer;
|
|
88
88
|
exports.MastraAgentRelevanceScorer = MastraAgentRelevanceScorer;
|
|
89
89
|
exports.createSimilarityPrompt = createSimilarityPrompt;
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-5OH5VHX5.cjs.map
|
|
91
|
+
//# sourceMappingURL=chunk-5OH5VHX5.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/relevance/cohere/index.ts","../src/relevance/relevance-score-provider.ts","../src/relevance/mastra-agent/index.ts"],"names":["Agent"],"mappings":";;;;;AAoBO,IAAM,wBAAN,MAA8D;AAAA,EAC3D,KAAA;AAAA,EACA,MAAA;AAAA,EACR,WAAA,CAAY,OAAe,MAAA,EAAiB;AAC1C,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN;AAAA,KACF;AACA,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AAAA,EACA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,QAAA,GAAW,MAAM,KAAA,CAAM,CAAA,gCAAA,CAAA,EAAoC;AAAA,MAC/D,MAAA,EAAQ,MAAA;AAAA,MACR,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB,kBAAA;AAAA,QAChB,aAAA,EAAe,CAAA,OAAA,EAAU,IAAA,CAAK,MAAM,CAAA;AAAA,OACtC;AAAA,MACA,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,QACnB,KAAA;AAAA,QACA,SAAA,EAAW,CAAC,IAAI,CAAA;AAAA,QAChB,OAAO,IAAA,CAAK,KAAA;AAAA,QACZ,KAAA,EAAO;AAAA,OACR;AAAA,KACF,CAAA;AAED,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,kBAAA,EAAqB,QAAA,CAAS,MAAM,IAAI,MAAM,QAAA,CAAS,IAAA,EAAM,CAAA,CAAE,CAAA;AAAA,IACjF;AAEA,IAAA,MAAM,IAAA,GAAQ,MAAM,QAAA,CAAS,IAAA,EAAK;AAClC,IAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,OAAA,CAAQ,CAAC,CAAA,EAAG,eAAA;AAExC,IAAA,IAAI,CAAC,cAAA,EAAgB;AACnB,MAAA,MAAM,IAAI,MAAM,6CAA6C,CAAA;AAAA,IAC/D;AAEA,IAAA,OAAO,cAAA;AAAA,EACT;AACF;;;ACpDO,SAAS,sBAAA,CAAuB,OAAe,IAAA,EAAsB;AAC1E,EAAA,OAAO,CAAA;;AAAA,OAAA,EAEA,KAAK;;AAAA,MAAA,EAEN,IAAI;;AAAA,sBAAA,CAAA;AAGZ;;;ACRO,IAAM,6BAAN,MAAmE;AAAA,EAChE,KAAA;AAAA,EAER,WAAA,CAAY,MAAc,KAAA,EAA4B;AACpD,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAIA,uBAAA,CAAM;AAAA,MACrB,IAAA,EAAM,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC9B,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAAA,CAAA;AAAA,MAUd;AAAA,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,KAAA,CAAM,QAAA,EAAS;AAExC,IAAA,IAAI,QAAA;AACJ,IAAA,IAAI,KAAA,CAAM,yBAAyB,IAAA,EAAM;AACvC,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,cAAc,MAAM,CAAA;AAC1D,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B,CAAA,MAAO;AACL,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,SAAS,MAAM,CAAA;AACrD,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B;AACA,IAAA,OAAO,WAAW,QAAQ,CAAA;AAAA,EAC5B;AACF","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/relevance/cohere/index.ts","../src/relevance/relevance-score-provider.ts","../src/relevance/mastra-agent/index.ts"],"names":["Agent"],"mappings":";;;;;AAoBO,IAAM,wBAAN,MAA8D;AAAA,EAC3D,KAAA;AAAA,EACA,MAAA;AAAA,EACR,WAAA,CAAY,OAAe,MAAA,EAAiB;AAC1C,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN;AAAA,KACF;AACA,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AAAA,EACA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,QAAA,GAAW,MAAM,KAAA,CAAM,CAAA,gCAAA,CAAA,EAAoC;AAAA,MAC/D,MAAA,EAAQ,MAAA;AAAA,MACR,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB,kBAAA;AAAA,QAChB,aAAA,EAAe,CAAA,OAAA,EAAU,IAAA,CAAK,MAAM,CAAA;AAAA,OACtC;AAAA,MACA,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,QACnB,KAAA;AAAA,QACA,SAAA,EAAW,CAAC,IAAI,CAAA;AAAA,QAChB,OAAO,IAAA,CAAK,KAAA;AAAA,QACZ,KAAA,EAAO;AAAA,OACR;AAAA,KACF,CAAA;AAED,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,kBAAA,EAAqB,QAAA,CAAS,MAAM,IAAI,MAAM,QAAA,CAAS,IAAA,EAAM,CAAA,CAAE,CAAA;AAAA,IACjF;AAEA,IAAA,MAAM,IAAA,GAAQ,MAAM,QAAA,CAAS,IAAA,EAAK;AAClC,IAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,OAAA,CAAQ,CAAC,CAAA,EAAG,eAAA;AAExC,IAAA,IAAI,CAAC,cAAA,EAAgB;AACnB,MAAA,MAAM,IAAI,MAAM,6CAA6C,CAAA;AAAA,IAC/D;AAEA,IAAA,OAAO,cAAA;AAAA,EACT;AACF;;;ACpDO,SAAS,sBAAA,CAAuB,OAAe,IAAA,EAAsB;AAC1E,EAAA,OAAO,CAAA;;AAAA,OAAA,EAEA,KAAK;;AAAA,MAAA,EAEN,IAAI;;AAAA,sBAAA,CAAA;AAGZ;;;ACRO,IAAM,6BAAN,MAAmE;AAAA,EAChE,KAAA;AAAA,EAER,WAAA,CAAY,MAAc,KAAA,EAA4B;AACpD,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAIA,uBAAA,CAAM;AAAA,MACrB,IAAA,EAAM,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC9B,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAAA,CAAA;AAAA,MAUd;AAAA,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,KAAA,CAAM,QAAA,EAAS;AAExC,IAAA,IAAI,QAAA;AACJ,IAAA,IAAI,KAAA,CAAM,yBAAyB,IAAA,EAAM;AACvC,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,cAAc,MAAM,CAAA;AAC1D,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B,CAAA,MAAO;AACL,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,SAAS,MAAM,CAAA;AACrD,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B;AACA,IAAA,OAAO,WAAW,QAAQ,CAAA;AAAA,EAC5B;AACF","file":"chunk-5OH5VHX5.cjs","sourcesContent":["import type { RelevanceScoreProvider } from '../relevance-score-provider';\n\ninterface CohereRerankingResponse {\n results: Array<{\n index: number;\n relevance_score: number;\n }>;\n id: string;\n meta: {\n api_version: {\n version: string;\n is_experimental: boolean;\n };\n billed_units: {\n search_units: number;\n };\n };\n}\n\n/** @deprecated Import from `@mastra/rag` instead */\nexport class CohereRelevanceScorer implements RelevanceScoreProvider {\n private model: string;\n private apiKey?: string;\n constructor(model: string, apiKey?: string) {\n console.warn(\n 'CohereRelevanceScorer exported from @mastra/core is deprecated. Please import from \"@mastra/rag\" instead.',\n );\n this.apiKey = apiKey;\n this.model = model;\n }\n async getRelevanceScore(query: string, text: string): Promise<number> {\n const response = await fetch(`https://api.cohere.com/v2/rerank`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${this.apiKey}`,\n },\n body: JSON.stringify({\n query,\n documents: [text],\n model: this.model,\n top_n: 1,\n }),\n });\n\n if (!response.ok) {\n throw new Error(`Cohere API error: ${response.status} ${await response.text()}`);\n }\n\n const data = (await response.json()) as CohereRerankingResponse;\n const relevanceScore = data.results[0]?.relevance_score;\n\n if (!relevanceScore) {\n throw new Error('No relevance score found on Cohere response');\n }\n\n return relevanceScore;\n }\n}\n","// Provider interfaces\nexport interface RelevanceScoreProvider {\n getRelevanceScore(text1: string, text2: string): Promise<number>;\n}\n\n// Helper function used by providers\nexport function createSimilarityPrompt(query: string, text: string): string {\n return `Rate the semantic similarity between the following the query and the text on a scale from 0 to 1 (decimals allowed), where 1 means exactly the same meaning and 0 means completely different:\n\nQuery: ${query}\n\nText: ${text}\n\nRelevance score (0-1):`;\n}\n","import { Agent } from '../../agent';\nimport type { MastraLanguageModel } from '../../llm/model/shared.types';\nimport { createSimilarityPrompt } from '../relevance-score-provider';\nimport type { RelevanceScoreProvider } from '../relevance-score-provider';\n\n// Mastra Agent implementation\nexport class MastraAgentRelevanceScorer implements RelevanceScoreProvider {\n private agent: Agent;\n\n constructor(name: string, model: MastraLanguageModel) {\n this.agent = new Agent({\n name: `Relevance Scorer ${name}`,\n instructions: `You are a specialized agent for evaluating the relevance of text to queries.\nYour task is to rate how well a text passage answers a given query.\nOutput only a number between 0 and 1, where:\n1.0 = Perfectly relevant, directly answers the query\n0.0 = Completely irrelevant\nConsider:\n- Direct relevance to the question\n- Completeness of information\n- Quality and specificity\nAlways return just the number, no explanation.`,\n model,\n });\n }\n\n async getRelevanceScore(query: string, text: string): Promise<number> {\n const prompt = createSimilarityPrompt(query, text);\n\n const model = await this.agent.getModel();\n\n let response: string;\n if (model.specificationVersion === 'v2') {\n const responseText = await this.agent.generateVNext(prompt);\n response = responseText.text;\n } else {\n const responseText = await this.agent.generate(prompt);\n response = responseText.text;\n }\n return parseFloat(response);\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDOARUBVA_cjs = require('./chunk-DOARUBVA.cjs');
|
|
4
4
|
var chunkC73WLCY3_cjs = require('./chunk-C73WLCY3.cjs');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
var crypto = require('crypto');
|
|
@@ -190,7 +190,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
190
190
|
}
|
|
191
191
|
toMastraWorkflow() {
|
|
192
192
|
const workflowSteps = this.steps.map((scorerStep) => {
|
|
193
|
-
return
|
|
193
|
+
return chunkDOARUBVA_cjs.createStep({
|
|
194
194
|
id: scorerStep.name,
|
|
195
195
|
description: `Scorer step: ${scorerStep.name}`,
|
|
196
196
|
inputSchema: zod.z.any(),
|
|
@@ -223,7 +223,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
|
-
const workflow =
|
|
226
|
+
const workflow = chunkDOARUBVA_cjs.createWorkflow({
|
|
227
227
|
id: `scorer-${this.config.name}`,
|
|
228
228
|
description: this.config.description,
|
|
229
229
|
inputSchema: zod.z.object({
|
|
@@ -284,7 +284,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
const judge = new
|
|
287
|
+
const judge = new chunkDOARUBVA_cjs.Agent({
|
|
288
288
|
name: "judge",
|
|
289
289
|
model,
|
|
290
290
|
instructions,
|
|
@@ -477,7 +477,7 @@ async function runExperiment(config) {
|
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
479
|
function isWorkflow(target) {
|
|
480
|
-
return target instanceof
|
|
480
|
+
return target instanceof chunkDOARUBVA_cjs.Workflow;
|
|
481
481
|
}
|
|
482
482
|
function isWorkflowScorerConfig(scorers) {
|
|
483
483
|
return typeof scorers === "object" && !Array.isArray(scorers) && ("workflow" in scorers || "steps" in scorers);
|
|
@@ -680,5 +680,5 @@ exports.saveScorePayloadSchema = saveScorePayloadSchema;
|
|
|
680
680
|
exports.scoreResultSchema = scoreResultSchema;
|
|
681
681
|
exports.scoringExtractStepResultSchema = scoringExtractStepResultSchema;
|
|
682
682
|
exports.scoringValueSchema = scoringValueSchema;
|
|
683
|
-
//# sourceMappingURL=chunk-
|
|
684
|
-
//# sourceMappingURL=chunk-
|
|
683
|
+
//# sourceMappingURL=chunk-6TQSVAUZ.cjs.map
|
|
684
|
+
//# sourceMappingURL=chunk-6TQSVAUZ.cjs.map
|