@mastra/core 1.2.0-alpha.0 → 1.2.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 +314 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +1 -1
- package/dist/agent/agent.d.ts +17 -2
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +13 -13
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +18 -18
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/merge/MessageMerger.d.ts +5 -0
- package/dist/agent/message-list/merge/MessageMerger.d.ts.map +1 -1
- package/dist/agent/message-list/message-list.d.ts +15 -0
- package/dist/agent/message-list/message-list.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +9 -8
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts +4 -0
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +9 -7
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts +24 -14
- package/dist/agent/workflows/prepare-stream/schema.d.ts.map +1 -1
- package/dist/{chunk-XVHK5IAO.cjs → chunk-3LRUJTH3.cjs} +50 -333
- package/dist/chunk-3LRUJTH3.cjs.map +1 -0
- package/dist/{chunk-2CVY7S66.js → chunk-4XLGMCCQ.js} +18 -21
- package/dist/chunk-4XLGMCCQ.js.map +1 -0
- package/dist/{chunk-HIP5W3LZ.js → chunk-57O4TPB3.js} +60 -4
- package/dist/chunk-57O4TPB3.js.map +1 -0
- package/dist/{chunk-FAJYC6PA.js → chunk-5HDIPOLV.js} +363 -104
- package/dist/chunk-5HDIPOLV.js.map +1 -0
- package/dist/{chunk-OAOMKZXU.cjs → chunk-AP3Z4EAP.cjs} +60 -56
- package/dist/chunk-AP3Z4EAP.cjs.map +1 -0
- package/dist/{chunk-I6PWV32C.cjs → chunk-AQHO4OC2.cjs} +517 -61
- package/dist/chunk-AQHO4OC2.cjs.map +1 -0
- package/dist/{chunk-W57QS6F6.cjs → chunk-ARQG4ZSD.cjs} +430 -168
- package/dist/chunk-ARQG4ZSD.cjs.map +1 -0
- package/dist/{chunk-AC63Y6KP.js → chunk-BP2TSCBW.js} +3 -3
- package/dist/chunk-BP2TSCBW.js.map +1 -0
- package/dist/{chunk-NS33UC72.js → chunk-ENCTSDWC.js} +104 -11
- package/dist/chunk-ENCTSDWC.js.map +1 -0
- package/dist/{chunk-66BWIF4S.js → chunk-EY3WXGUD.js} +43 -326
- package/dist/chunk-EY3WXGUD.js.map +1 -0
- package/dist/{chunk-IUODLQMU.cjs → chunk-G5NRZOPO.cjs} +60 -4
- package/dist/chunk-G5NRZOPO.cjs.map +1 -0
- package/dist/{chunk-22EV7GMK.cjs → chunk-HMCXNOF6.cjs} +105 -10
- package/dist/chunk-HMCXNOF6.cjs.map +1 -0
- package/dist/{chunk-EYUXOOSQ.cjs → chunk-HN2MSTR6.cjs} +130 -9
- package/dist/chunk-HN2MSTR6.cjs.map +1 -0
- package/dist/{chunk-7ALOYTDY.cjs → chunk-I66TMZJ3.cjs} +15 -6
- package/dist/chunk-I66TMZJ3.cjs.map +1 -0
- package/dist/{chunk-Y2SVKUOQ.cjs → chunk-JRJJ5VQE.cjs} +44 -3
- package/dist/chunk-JRJJ5VQE.cjs.map +1 -0
- package/dist/{chunk-CILDTRXD.js → chunk-MNWW2R3U.js} +42 -4
- package/dist/chunk-MNWW2R3U.js.map +1 -0
- package/dist/{chunk-FYMM4PKR.js → chunk-NRMSZFAU.js} +12 -8
- package/dist/chunk-NRMSZFAU.js.map +1 -0
- package/dist/{chunk-SPVI7HCP.js → chunk-NYC6PYZF.js} +6 -6
- package/dist/{chunk-SPVI7HCP.js.map → chunk-NYC6PYZF.js.map} +1 -1
- package/dist/{chunk-XS2MED4Y.js → chunk-P62OJXQ4.js} +129 -8
- package/dist/chunk-P62OJXQ4.js.map +1 -0
- package/dist/{chunk-USHB3SPM.js → chunk-PPAJGWVW.js} +5 -5
- package/dist/chunk-PPAJGWVW.js.map +1 -0
- package/dist/{chunk-DWD5DB6W.js → chunk-RUMXBL6P.js} +4 -4
- package/dist/{chunk-DWD5DB6W.js.map → chunk-RUMXBL6P.js.map} +1 -1
- package/dist/{chunk-KNPIRLQQ.cjs → chunk-SS4AZHZW.cjs} +21 -24
- package/dist/chunk-SS4AZHZW.cjs.map +1 -0
- package/dist/{chunk-4DDIPGB6.js → chunk-T6PRRKMW.js} +15 -6
- package/dist/chunk-T6PRRKMW.js.map +1 -0
- package/dist/{chunk-ODNSWEMV.cjs → chunk-VBOO4F4D.cjs} +8 -8
- package/dist/chunk-VBOO4F4D.cjs.map +1 -0
- package/dist/{chunk-MCI7M6AT.cjs → chunk-YL6ETQ5I.cjs} +7 -7
- package/dist/{chunk-MCI7M6AT.cjs.map → chunk-YL6ETQ5I.cjs.map} +1 -1
- package/dist/{chunk-STNSGW7W.cjs → chunk-YLODOPYM.cjs} +3 -3
- package/dist/chunk-YLODOPYM.cjs.map +1 -0
- package/dist/{chunk-BLXWTBLL.cjs → chunk-Z2OKCLGV.cjs} +18 -18
- package/dist/{chunk-BLXWTBLL.cjs.map → chunk-Z2OKCLGV.cjs.map} +1 -1
- package/dist/{chunk-OQPAOUDS.js → chunk-ZODRDMZ7.js} +508 -52
- package/dist/chunk-ZODRDMZ7.js.map +1 -0
- package/dist/docs/README.md +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/SOURCE_MAP.json +357 -330
- package/dist/docs/agents/01-overview.md +2 -2
- package/dist/docs/configuration.mdx/01-reference.md +20 -0
- package/dist/docs/evals/01-overview.md +5 -5
- package/dist/docs/evals/04-reference.md +84 -10
- package/dist/docs/mcp/01-overview.md +2 -2
- package/dist/docs/memory/02-storage.md +10 -0
- package/dist/docs/observability/01-overview.md +1 -1
- package/dist/docs/observability/03-overview.md +3 -3
- package/dist/docs/rag/01-overview.md +1 -1
- package/dist/docs/tools-mcp/01-mcp-overview.md +2 -2
- package/dist/docs/voice/01-overview.md +1 -1
- package/dist/docs/workflows/01-overview.md +5 -5
- package/dist/docs/workspace/01-overview.md +2 -3
- package/dist/editor/index.cjs +4 -0
- package/dist/editor/index.cjs.map +1 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +3 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/types.d.ts +64 -0
- package/dist/editor/types.d.ts.map +1 -0
- package/dist/evals/index.cjs +20 -20
- package/dist/evals/index.js +3 -3
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/features/index.cjs +1 -1
- package/dist/features/index.cjs.map +1 -1
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +1 -1
- package/dist/features/index.js.map +1 -1
- package/dist/index.cjs +7 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/llm/index.cjs +18 -18
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/embedding-router.d.ts +3 -1
- package/dist/llm/model/embedding-router.d.ts.map +1 -1
- package/dist/llm/model/model.d.ts +2 -2
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +54 -2
- package/dist/loop/index.cjs +12 -12
- package/dist/loop/index.js +1 -1
- package/dist/loop/loop.d.ts.map +1 -1
- package/dist/loop/network/index.d.ts +4 -4
- package/dist/loop/types.d.ts +6 -1
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +22 -22
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +15 -15
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +7 -7
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +22 -22
- package/dist/loop/workflows/schema.d.ts +30 -30
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +30 -132
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +23 -11
- package/dist/memory/index.js +1 -1
- package/dist/memory/memory.d.ts +6 -1
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/mock.d.ts.map +1 -1
- package/dist/memory/types.d.ts +282 -0
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-OQKVMEIT.cjs +12 -0
- package/dist/{models-dev-SOIECXXQ.cjs.map → models-dev-OQKVMEIT.cjs.map} +1 -1
- package/dist/models-dev-Z45JSLWD.js +3 -0
- package/dist/{models-dev-2HBSVUOS.js.map → models-dev-Z45JSLWD.js.map} +1 -1
- package/dist/processors/index.cjs +41 -41
- package/dist/processors/index.d.ts +38 -1
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/memory/message-history.d.ts +16 -0
- package/dist/processors/memory/message-history.d.ts.map +1 -1
- package/dist/processors/processors/skills.d.ts.map +1 -1
- package/dist/processors/runner.d.ts +17 -3
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/processors/step-schema.d.ts +34 -34
- package/dist/provider-registry-NR7FXV2Q.cjs +40 -0
- package/dist/{provider-registry-ML2VWWLB.cjs.map → provider-registry-NR7FXV2Q.cjs.map} +1 -1
- package/dist/provider-registry-RPOTQNHI.js +3 -0
- package/dist/{provider-registry-K5L4DHRK.js.map → provider-registry-RPOTQNHI.js.map} +1 -1
- package/dist/provider-registry.json +126 -5
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/constants.cjs +28 -16
- package/dist/storage/constants.d.ts +13 -1
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/base.d.ts.map +1 -1
- package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +3 -1
- package/dist/storage/domains/inmemory-db.d.ts.map +1 -1
- package/dist/storage/domains/memory/base.d.ts +62 -1
- package/dist/storage/domains/memory/base.d.ts.map +1 -1
- package/dist/storage/domains/memory/inmemory.d.ts +24 -2
- package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/types.d.ts +50 -50
- package/dist/storage/domains/operations/inmemory.d.ts +5 -3
- package/dist/storage/domains/operations/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +113 -101
- package/dist/storage/index.js +2 -2
- package/dist/storage/types.d.ts +203 -16
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- 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/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/utils.cjs +23 -23
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/vector/index.js.map +1 -1
- package/dist/vector/vector.d.ts +3 -1
- package/dist/vector/vector.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/workflow.d.ts.map +1 -1
- package/dist/workflows/index.cjs +25 -25
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/step.d.ts +2 -1
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +2 -2
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/dist/workspace/filesystem/index.d.ts +1 -0
- package/dist/workspace/filesystem/index.d.ts.map +1 -1
- package/dist/workspace/filesystem/local-filesystem.d.ts +3 -2
- package/dist/workspace/filesystem/local-filesystem.d.ts.map +1 -1
- package/dist/workspace/filesystem/mastra-filesystem.d.ts +65 -0
- package/dist/workspace/filesystem/mastra-filesystem.d.ts.map +1 -0
- package/dist/workspace/index.cjs +40 -32
- package/dist/workspace/index.d.ts +2 -0
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/sandbox/index.d.ts +1 -0
- package/dist/workspace/sandbox/index.d.ts.map +1 -1
- package/dist/workspace/sandbox/local-sandbox.d.ts +3 -2
- package/dist/workspace/sandbox/local-sandbox.d.ts.map +1 -1
- package/dist/workspace/sandbox/mastra-sandbox.d.ts +52 -0
- package/dist/workspace/sandbox/mastra-sandbox.d.ts.map +1 -0
- package/dist/workspace/tools/tools.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +21 -0
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/editor.d.ts +1 -0
- package/package.json +8 -8
- package/src/llm/model/provider-types.generated.d.ts +54 -2
- package/dist/chunk-22EV7GMK.cjs.map +0 -1
- package/dist/chunk-2CVY7S66.js.map +0 -1
- package/dist/chunk-4DDIPGB6.js.map +0 -1
- package/dist/chunk-66BWIF4S.js.map +0 -1
- package/dist/chunk-7ALOYTDY.cjs.map +0 -1
- package/dist/chunk-AC63Y6KP.js.map +0 -1
- package/dist/chunk-CILDTRXD.js.map +0 -1
- package/dist/chunk-EYUXOOSQ.cjs.map +0 -1
- package/dist/chunk-FAJYC6PA.js.map +0 -1
- package/dist/chunk-FYMM4PKR.js.map +0 -1
- package/dist/chunk-HIP5W3LZ.js.map +0 -1
- package/dist/chunk-I6PWV32C.cjs.map +0 -1
- package/dist/chunk-IUODLQMU.cjs.map +0 -1
- package/dist/chunk-KNPIRLQQ.cjs.map +0 -1
- package/dist/chunk-NS33UC72.js.map +0 -1
- package/dist/chunk-OAOMKZXU.cjs.map +0 -1
- package/dist/chunk-ODNSWEMV.cjs.map +0 -1
- package/dist/chunk-OQPAOUDS.js.map +0 -1
- package/dist/chunk-STNSGW7W.cjs.map +0 -1
- package/dist/chunk-USHB3SPM.js.map +0 -1
- package/dist/chunk-W57QS6F6.cjs.map +0 -1
- package/dist/chunk-XS2MED4Y.js.map +0 -1
- package/dist/chunk-XVHK5IAO.cjs.map +0 -1
- package/dist/chunk-Y2SVKUOQ.cjs.map +0 -1
- package/dist/models-dev-2HBSVUOS.js +0 -3
- package/dist/models-dev-SOIECXXQ.cjs +0 -12
- package/dist/provider-registry-K5L4DHRK.js +0 -3
- package/dist/provider-registry-ML2VWWLB.cjs +0 -40
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
> Overview of agents in Mastra, detailing their capabilities and how they interact with tools, workflows, and external systems.
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `Agent`: dist/agent/agent.d.ts → dist/chunk-
|
|
5
|
-
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-
|
|
4
|
+
- `Agent`: dist/agent/agent.d.ts → dist/chunk-5HDIPOLV.js:17701
|
|
5
|
+
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-EY3WXGUD.js:24
|
|
6
6
|
|
|
7
7
|
# Using Agents
|
|
8
8
|
|
|
@@ -417,6 +417,26 @@ export const mastra = new Mastra({
|
|
|
417
417
|
});
|
|
418
418
|
```
|
|
419
419
|
|
|
420
|
+
### workspace
|
|
421
|
+
|
|
422
|
+
**Type:** `Workspace`
|
|
423
|
+
|
|
424
|
+
A Mastra workspace gives agents a persistent environment for storing files and executing commands. Agents inherit the global workspace on the `Mastra` class unless they have their own workspace configured.
|
|
425
|
+
|
|
426
|
+
See the [Workspace documentation](https://mastra.ai/docs/workspace/overview) for implementation details.
|
|
427
|
+
```typescript title="src/mastra/index.ts"
|
|
428
|
+
import { Mastra } from '@mastra/core';
|
|
429
|
+
import { Workspace, LocalFilesystem } from '@mastra/core/workspace';
|
|
430
|
+
|
|
431
|
+
const workspace = new Workspace({
|
|
432
|
+
filesystem: new LocalFilesystem({ basePath: './workspace' }),
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
const mastra = new Mastra({
|
|
436
|
+
workspace,
|
|
437
|
+
});
|
|
438
|
+
```
|
|
439
|
+
|
|
420
440
|
## Bundler options
|
|
421
441
|
|
|
422
442
|
### bundler.externals
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
> Overview of scorers in Mastra, detailing their capabilities for evaluating AI outputs and measuring performance.
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `Agent`: dist/agent/agent.d.ts → dist/chunk-
|
|
5
|
-
- `createWorkflow`: dist/workflows/index.d.ts → dist/chunk-
|
|
6
|
-
- `createStep`: dist/workflows/index.d.ts → dist/chunk-
|
|
7
|
-
- `Workflow`: dist/workflows/workflow.d.ts → dist/chunk-
|
|
8
|
-
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-
|
|
4
|
+
- `Agent`: dist/agent/agent.d.ts → dist/chunk-5HDIPOLV.js:17701
|
|
5
|
+
- `createWorkflow`: dist/workflows/index.d.ts → dist/chunk-5HDIPOLV.js:8436
|
|
6
|
+
- `createStep`: dist/workflows/index.d.ts → dist/chunk-5HDIPOLV.js:7750
|
|
7
|
+
- `Workflow`: dist/workflows/workflow.d.ts → dist/chunk-5HDIPOLV.js:8452
|
|
8
|
+
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-EY3WXGUD.js:24
|
|
9
9
|
|
|
10
10
|
# Scorers overview
|
|
11
11
|
|
|
@@ -968,6 +968,10 @@ The `createHallucinationScorer()` function accepts a single options object with
|
|
|
968
968
|
|
|
969
969
|
This function returns an instance of the MastraScorer class. The `.run()` method accepts the same input as other scorers (see the [MastraScorer reference](./mastra-scorer)), but the return value includes LLM-specific fields as documented below.
|
|
970
970
|
|
|
971
|
+
### GetContextParams
|
|
972
|
+
|
|
973
|
+
The `getContext` hook receives the following parameters:
|
|
974
|
+
|
|
971
975
|
## .run() Returns
|
|
972
976
|
|
|
973
977
|
## Scoring Details
|
|
@@ -1017,28 +1021,98 @@ A hallucination score between 0 and 1:
|
|
|
1017
1021
|
|
|
1018
1022
|
**Note:** The score represents the degree of hallucination - lower scores indicate better factual alignment with the provided context
|
|
1019
1023
|
|
|
1020
|
-
##
|
|
1024
|
+
## Examples
|
|
1025
|
+
|
|
1026
|
+
### Static Context
|
|
1027
|
+
|
|
1028
|
+
Use static context when you have known ground truth to compare against:
|
|
1029
|
+
|
|
1030
|
+
```typescript title="src/example-static-context.ts"
|
|
1031
|
+
import { createHallucinationScorer } from "@mastra/evals/scorers/prebuilt";
|
|
1032
|
+
|
|
1033
|
+
const scorer = createHallucinationScorer({
|
|
1034
|
+
model: "openai/gpt-4o",
|
|
1035
|
+
options: {
|
|
1036
|
+
context: [
|
|
1037
|
+
"The first iPhone was announced on January 9, 2007.",
|
|
1038
|
+
"It was released on June 29, 2007.",
|
|
1039
|
+
"Steve Jobs introduced it at Macworld.",
|
|
1040
|
+
],
|
|
1041
|
+
},
|
|
1042
|
+
});
|
|
1043
|
+
```
|
|
1021
1044
|
|
|
1022
|
-
|
|
1045
|
+
### Dynamic Context with getContext
|
|
1046
|
+
|
|
1047
|
+
Use `getContext` for live scoring scenarios where context comes from tool results:
|
|
1048
|
+
|
|
1049
|
+
```typescript title="src/example-dynamic-context.ts"
|
|
1050
|
+
import { createHallucinationScorer } from "@mastra/evals/scorers/prebuilt";
|
|
1051
|
+
import { extractToolResults } from "@mastra/evals/scorers";
|
|
1023
1052
|
|
|
1024
|
-
|
|
1053
|
+
const scorer = createHallucinationScorer({
|
|
1054
|
+
model: "openai/gpt-4o",
|
|
1055
|
+
options: {
|
|
1056
|
+
getContext: ({ run, step }) => {
|
|
1057
|
+
// Extract tool results as context
|
|
1058
|
+
const toolResults = extractToolResults(run.output);
|
|
1059
|
+
return toolResults.map((t) =>
|
|
1060
|
+
JSON.stringify({ tool: t.toolName, result: t.result })
|
|
1061
|
+
);
|
|
1062
|
+
},
|
|
1063
|
+
},
|
|
1064
|
+
});
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
### Live Scoring with Agent
|
|
1068
|
+
|
|
1069
|
+
Attach the scorer to an agent for live evaluation:
|
|
1070
|
+
|
|
1071
|
+
```typescript title="src/example-live-scoring.ts"
|
|
1072
|
+
import { Agent } from "@mastra/core/agent";
|
|
1073
|
+
import { createHallucinationScorer } from "@mastra/evals/scorers/prebuilt";
|
|
1074
|
+
import { extractToolResults } from "@mastra/evals/scorers";
|
|
1075
|
+
|
|
1076
|
+
const hallucinationScorer = createHallucinationScorer({
|
|
1077
|
+
model: "openai/gpt-4o",
|
|
1078
|
+
options: {
|
|
1079
|
+
getContext: ({ run }) => {
|
|
1080
|
+
const toolResults = extractToolResults(run.output);
|
|
1081
|
+
return toolResults.map((t) =>
|
|
1082
|
+
JSON.stringify({ tool: t.toolName, result: t.result })
|
|
1083
|
+
);
|
|
1084
|
+
},
|
|
1085
|
+
},
|
|
1086
|
+
});
|
|
1087
|
+
|
|
1088
|
+
const agent = new Agent({
|
|
1089
|
+
name: "my-agent",
|
|
1090
|
+
model: "openai/gpt-4o",
|
|
1091
|
+
instructions: "You are a helpful assistant.",
|
|
1092
|
+
evals: {
|
|
1093
|
+
scorers: [hallucinationScorer],
|
|
1094
|
+
},
|
|
1095
|
+
});
|
|
1096
|
+
```
|
|
1097
|
+
|
|
1098
|
+
### Batch Evaluation with runEvals
|
|
1099
|
+
|
|
1100
|
+
```typescript title="src/example-batch-evals.ts"
|
|
1025
1101
|
import { runEvals } from "@mastra/core/evals";
|
|
1026
1102
|
import { createHallucinationScorer } from "@mastra/evals/scorers/prebuilt";
|
|
1027
1103
|
import { myAgent } from "./agent";
|
|
1028
1104
|
|
|
1029
|
-
// Context is typically populated from agent tool calls or RAG retrieval
|
|
1030
1105
|
const scorer = createHallucinationScorer({
|
|
1031
1106
|
model: "openai/gpt-4o",
|
|
1107
|
+
options: {
|
|
1108
|
+
context: ["Known fact 1", "Known fact 2"],
|
|
1109
|
+
},
|
|
1032
1110
|
});
|
|
1033
1111
|
|
|
1034
1112
|
const result = await runEvals({
|
|
1035
1113
|
data: [
|
|
1036
|
-
{
|
|
1037
|
-
|
|
1038
|
-
},
|
|
1039
|
-
{
|
|
1040
|
-
input: "Tell me about the original iPhone announcement.",
|
|
1041
|
-
},
|
|
1114
|
+
{ input: "Tell me about topic A" },
|
|
1115
|
+
{ input: "Tell me about topic B" },
|
|
1042
1116
|
],
|
|
1043
1117
|
scorers: [scorer],
|
|
1044
1118
|
target: myAgent,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
> Learn about the Model Context Protocol (MCP), how to use third-party tools via MCPClient, connect to registries, and share your own tools using MCPServer.
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `Agent`: dist/agent/agent.d.ts → dist/chunk-
|
|
5
|
-
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-
|
|
4
|
+
- `Agent`: dist/agent/agent.d.ts → dist/chunk-5HDIPOLV.js:17701
|
|
5
|
+
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-EY3WXGUD.js:24
|
|
6
6
|
|
|
7
7
|
# MCP Overview
|
|
8
8
|
|
|
@@ -15,6 +15,16 @@ export const mastra = new Mastra({
|
|
|
15
15
|
}),
|
|
16
16
|
});
|
|
17
17
|
```
|
|
18
|
+
|
|
19
|
+
> **Sharing the database with Mastra Studio**
|
|
20
|
+
When running `mastra dev` alongside your application (e.g., Next.js), use an absolute path to ensure both processes access the same database:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
url: "file:/absolute/path/to/your/project/mastra.db"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Relative paths like `file:./mastra.db` resolve based on each process's working directory, which may differ.
|
|
27
|
+
|
|
18
28
|
This configures instance-level storage, which all agents share by default. You can also configure [agent-level storage](#agent-level-storage) for isolated data boundaries.
|
|
19
29
|
|
|
20
30
|
Mastra automatically creates the necessary tables on first interaction. See the [core schema](https://mastra.ai/reference/storage/overview#core-schema) for details on what gets created, including tables for messages, threads, resources, workflows, traces, and evaluation datasets.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
> Set up Tracing for Mastra applications
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-
|
|
5
|
-
- `Workflow`: dist/workflows/workflow.d.ts → dist/chunk-
|
|
6
|
-
- `Run`: dist/workflows/index.d.ts → dist/chunk-
|
|
4
|
+
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-EY3WXGUD.js:24
|
|
5
|
+
- `Workflow`: dist/workflows/workflow.d.ts → dist/chunk-5HDIPOLV.js:8452
|
|
6
|
+
- `Run`: dist/workflows/index.d.ts → dist/chunk-5HDIPOLV.js:9289
|
|
7
7
|
|
|
8
8
|
# Tracing
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
> Overview of Retrieval-Augmented Generation (RAG) in Mastra, detailing its capabilities for enhancing LLM outputs with relevant context.
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `ModelRouterEmbeddingModel`: dist/llm/index.d.ts → dist/chunk-
|
|
4
|
+
- `ModelRouterEmbeddingModel`: dist/llm/index.d.ts → dist/chunk-NYC6PYZF.js:4851
|
|
5
5
|
|
|
6
6
|
# RAG (Retrieval-Augmented Generation) in Mastra
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
> Learn about the Model Context Protocol (MCP), how to use third-party tools via MCPClient, connect to registries, and share your own tools using MCPServer.
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `Agent`: dist/agent/agent.d.ts → dist/chunk-
|
|
5
|
-
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-
|
|
4
|
+
- `Agent`: dist/agent/agent.d.ts → dist/chunk-5HDIPOLV.js:17701
|
|
5
|
+
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-EY3WXGUD.js:24
|
|
6
6
|
|
|
7
7
|
# MCP Overview
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
> Overview of voice capabilities in Mastra, including text-to-speech, speech-to-text, and real-time speech-to-speech interactions.
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `Agent`: dist/agent/agent.d.ts → dist/chunk-
|
|
4
|
+
- `Agent`: dist/agent/agent.d.ts → dist/chunk-5HDIPOLV.js:17701
|
|
5
5
|
- `CompositeVoice`: dist/voice/index.d.ts → dist/chunk-MQB7XFXP.js:192
|
|
6
6
|
|
|
7
7
|
# Voice in Mastra
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
> Workflows in Mastra help you orchestrate complex sequences of tasks with features like branching, parallel execution, resource suspension, and more.
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `createStep`: dist/workflows/index.d.ts → dist/chunk-
|
|
5
|
-
- `createWorkflow`: dist/workflows/index.d.ts → dist/chunk-
|
|
6
|
-
- `cloneWorkflow`: dist/workflows/index.d.ts → dist/chunk-
|
|
7
|
-
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-
|
|
8
|
-
- `Workflow`: dist/workflows/workflow.d.ts → dist/chunk-
|
|
4
|
+
- `createStep`: dist/workflows/index.d.ts → dist/chunk-5HDIPOLV.js:7750
|
|
5
|
+
- `createWorkflow`: dist/workflows/index.d.ts → dist/chunk-5HDIPOLV.js:8436
|
|
6
|
+
- `cloneWorkflow`: dist/workflows/index.d.ts → dist/chunk-5HDIPOLV.js:8439
|
|
7
|
+
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-EY3WXGUD.js:24
|
|
8
|
+
- `Workflow`: dist/workflows/workflow.d.ts → dist/chunk-5HDIPOLV.js:8452
|
|
9
9
|
|
|
10
10
|
# Workflows overview
|
|
11
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
> Give agents filesystem access and code execution through workspaces.
|
|
2
2
|
|
|
3
3
|
> **Code References:**
|
|
4
|
-
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-
|
|
5
|
-
- `Agent`: dist/agent/agent.d.ts → dist/chunk-
|
|
4
|
+
- `Mastra`: dist/mastra/index.d.ts → dist/chunk-EY3WXGUD.js:24
|
|
5
|
+
- `Agent`: dist/agent/agent.d.ts → dist/chunk-5HDIPOLV.js:17701
|
|
6
6
|
|
|
7
7
|
# Workspace
|
|
8
8
|
|
|
@@ -57,7 +57,6 @@ const workspace = new Workspace({
|
|
|
57
57
|
|
|
58
58
|
const mastra = new Mastra({
|
|
59
59
|
workspace,
|
|
60
|
-
agents: { myAgent },
|
|
61
60
|
});
|
|
62
61
|
```
|
|
63
62
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Agent } from '../agent/index.js';
|
|
2
|
+
import type { IMastraLogger } from '../logger/index.js';
|
|
3
|
+
import type { Mastra } from '../mastra/index.js';
|
|
4
|
+
import type { StorageResolvedAgentType } from '../storage/types.js';
|
|
5
|
+
export interface MastraEditorConfig {
|
|
6
|
+
logger?: IMastraLogger;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Interface for the Mastra Editor, which handles agent instantiation
|
|
10
|
+
* and configuration from stored data.
|
|
11
|
+
*/
|
|
12
|
+
export interface IMastraEditor {
|
|
13
|
+
/**
|
|
14
|
+
* Register this editor with a Mastra instance.
|
|
15
|
+
* This gives the editor access to Mastra's storage, tools, workflows, etc.
|
|
16
|
+
*/
|
|
17
|
+
registerWithMastra(mastra: Mastra): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get a stored agent by its ID.
|
|
20
|
+
* Returns null when agent is not found. Returns an Agent instance by default,
|
|
21
|
+
* or raw StorageResolvedAgentType when returnRaw option is true.
|
|
22
|
+
*/
|
|
23
|
+
getStoredAgentById(id: string, options?: {
|
|
24
|
+
returnRaw?: false;
|
|
25
|
+
versionId?: string;
|
|
26
|
+
versionNumber?: number;
|
|
27
|
+
}): Promise<Agent | null>;
|
|
28
|
+
getStoredAgentById(id: string, options: {
|
|
29
|
+
returnRaw: true;
|
|
30
|
+
versionId?: string;
|
|
31
|
+
versionNumber?: number;
|
|
32
|
+
}): Promise<StorageResolvedAgentType | null>;
|
|
33
|
+
/**
|
|
34
|
+
* List all stored agents with pagination.
|
|
35
|
+
* Returns Agent instances by default, or raw StorageResolvedAgentType when returnRaw is true.
|
|
36
|
+
*/
|
|
37
|
+
listStoredAgents(options?: {
|
|
38
|
+
returnRaw?: false;
|
|
39
|
+
page?: number;
|
|
40
|
+
pageSize?: number;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
agents: Agent[];
|
|
43
|
+
total: number;
|
|
44
|
+
page: number;
|
|
45
|
+
perPage: number;
|
|
46
|
+
hasMore: boolean;
|
|
47
|
+
}>;
|
|
48
|
+
listStoredAgents(options: {
|
|
49
|
+
returnRaw: true;
|
|
50
|
+
page?: number;
|
|
51
|
+
pageSize?: number;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
agents: StorageResolvedAgentType[];
|
|
54
|
+
total: number;
|
|
55
|
+
page: number;
|
|
56
|
+
perPage: number;
|
|
57
|
+
hasMore: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Clear the stored agent cache for a specific agent ID, or all cached agents.
|
|
61
|
+
*/
|
|
62
|
+
clearStoredAgentCache(agentId?: string): void;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC;;;;OAIG;IACH,kBAAkB,CAChB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,KAAK,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,GACA,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAEzB,kBAAkB,CAChB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE;QACP,SAAS,EAAE,IAAI,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,GACA,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;IAE5C;;;OAGG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,KAAK,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAC3F,MAAM,EAAE,KAAK,EAAE,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC,CAAC;IAEH,gBAAgB,CAAC,OAAO,EAAE;QAAE,SAAS,EAAE,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QACxF,MAAM,EAAE,wBAAwB,EAAE,CAAC;QACnC,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC,CAAC;IAEH;;OAEG;IACH,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/C"}
|
package/dist/evals/index.cjs
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkVBOO4F4D_cjs = require('../chunk-VBOO4F4D.cjs');
|
|
4
|
+
var chunkARQG4ZSD_cjs = require('../chunk-ARQG4ZSD.cjs');
|
|
5
|
+
var chunkJRJJ5VQE_cjs = require('../chunk-JRJJ5VQE.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "runEvals", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkVBOO4F4D_cjs.runEvals; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "MastraScorer", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkARQG4ZSD_cjs.MastraScorer; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createScorer", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkARQG4ZSD_cjs.createScorer; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "listScoresResponseSchema", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkJRJJ5VQE_cjs.listScoresResponseSchema; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "saveScorePayloadSchema", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkJRJJ5VQE_cjs.saveScorePayloadSchema; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "scoreResultSchema", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoreResultSchema; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "scoreRowDataSchema", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoreRowDataSchema; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "scoringEntityTypeSchema", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringEntityTypeSchema; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "scoringExtractStepResultSchema", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringExtractStepResultSchema; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "scoringHookInputSchema", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringHookInputSchema; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "scoringInputSchema", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringInputSchema; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "scoringInputWithExtractStepResultAndAnalyzeStepResultSchema", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringInputWithExtractStepResultAndAnalyzeStepResultSchema; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "scoringInputWithExtractStepResultAndScoreAndReasonSchema", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringInputWithExtractStepResultAndScoreAndReasonSchema; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "scoringInputWithExtractStepResultSchema", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringInputWithExtractStepResultSchema; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "scoringPromptsSchema", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringPromptsSchema; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "scoringSourceSchema", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringSourceSchema; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "scoringValueSchema", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkJRJJ5VQE_cjs.scoringValueSchema; }
|
|
76
76
|
});
|
|
77
77
|
//# sourceMappingURL=index.cjs.map
|
|
78
78
|
//# sourceMappingURL=index.cjs.map
|
package/dist/evals/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { runEvals } from '../chunk-
|
|
2
|
-
export { MastraScorer, createScorer } from '../chunk-
|
|
3
|
-
export { listScoresResponseSchema, saveScorePayloadSchema, scoreResultSchema, scoreRowDataSchema, scoringEntityTypeSchema, scoringExtractStepResultSchema, scoringHookInputSchema, scoringInputSchema, scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, scoringInputWithExtractStepResultAndScoreAndReasonSchema, scoringInputWithExtractStepResultSchema, scoringPromptsSchema, scoringSourceSchema, scoringValueSchema } from '../chunk-
|
|
1
|
+
export { runEvals } from '../chunk-PPAJGWVW.js';
|
|
2
|
+
export { MastraScorer, createScorer } from '../chunk-5HDIPOLV.js';
|
|
3
|
+
export { listScoresResponseSchema, saveScorePayloadSchema, scoreResultSchema, scoreRowDataSchema, scoringEntityTypeSchema, scoringExtractStepResultSchema, scoringHookInputSchema, scoringInputSchema, scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, scoringInputWithExtractStepResultAndScoreAndReasonSchema, scoringInputWithExtractStepResultSchema, scoringPromptsSchema, scoringSourceSchema, scoringValueSchema } from '../chunk-MNWW2R3U.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkAP3Z4EAP_cjs = require('../../chunk-AP3Z4EAP.cjs');
|
|
4
|
+
var chunkJRJJ5VQE_cjs = require('../../chunk-JRJJ5VQE.cjs');
|
|
5
5
|
var chunk4U7ZLI36_cjs = require('../../chunk-4U7ZLI36.cjs');
|
|
6
6
|
var pMap = require('p-map');
|
|
7
7
|
var z = require('zod');
|
|
@@ -235,7 +235,7 @@ function transformTraceToScorerInputAndOutput(trace) {
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
// src/evals/scoreTraces/scoreTracesWorkflow.ts
|
|
238
|
-
var getTraceStep =
|
|
238
|
+
var getTraceStep = chunkAP3Z4EAP_cjs.createStep({
|
|
239
239
|
id: "__process-trace-scoring",
|
|
240
240
|
inputSchema: z__default.default.object({
|
|
241
241
|
targets: z__default.default.array(
|
|
@@ -381,7 +381,7 @@ async function validateAndSaveScore({ storage, scorerResult }) {
|
|
|
381
381
|
text: "Scores storage domain is not available"
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
const payloadToSave =
|
|
384
|
+
const payloadToSave = chunkJRJJ5VQE_cjs.saveScorePayloadSchema.parse(scorerResult);
|
|
385
385
|
const result = await scoresStore.saveScore(payloadToSave);
|
|
386
386
|
return result.score;
|
|
387
387
|
}
|
|
@@ -432,7 +432,7 @@ async function attachScoreToSpan({
|
|
|
432
432
|
updates: { links: [...existingLinks, link] }
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
|
-
var scoreTracesWorkflow =
|
|
435
|
+
var scoreTracesWorkflow = chunkAP3Z4EAP_cjs.createWorkflow({
|
|
436
436
|
id: "__batch-scoring-traces",
|
|
437
437
|
inputSchema: z__default.default.object({
|
|
438
438
|
targets: z__default.default.array(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createStep, createWorkflow } from '../../chunk-
|
|
2
|
-
import { saveScorePayloadSchema } from '../../chunk-
|
|
1
|
+
import { createStep, createWorkflow } from '../../chunk-NRMSZFAU.js';
|
|
2
|
+
import { saveScorePayloadSchema } from '../../chunk-MNWW2R3U.js';
|
|
3
3
|
import { MastraError } from '../../chunk-FJEVLHJT.js';
|
|
4
4
|
import pMap from 'p-map';
|
|
5
5
|
import z from 'zod';
|
package/dist/features/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/features/index.ts
|
|
4
|
-
var coreFeatures = /* @__PURE__ */ new Set(["workspaces-v1"]);
|
|
4
|
+
var coreFeatures = /* @__PURE__ */ new Set(["observationalMemory", "workspaces-v1"]);
|
|
5
5
|
|
|
6
6
|
exports.coreFeatures = coreFeatures;
|
|
7
7
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/features/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../../src/features/index.ts"],"names":[],"mappings":";;;AAgBO,IAAM,+BAAe,IAAI,GAAA,CAAY,CAAC,qBAAA,EAAuB,eAAe,CAAC","file":"index.cjs","sourcesContent":["/**\n * Core feature flags for @mastra/core\n *\n * This set tracks which features are available in the current version of @mastra/core.\n * Dependent packages can check for feature availability to ensure compatibility.\n *\n * @example\n * ```ts\n * import { coreFeatures } from \"@mastra/core/features\"\n *\n * if (coreFeatures.has('workspaces-v1')) {\n * // Workspace features available\n * }\n * ```\n */\n// Add feature flags here as new features are introduced\nexport const coreFeatures = new Set<string>(['observationalMemory', 'workspaces-v1']);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,YAAY,aAA4D,CAAC"}
|
package/dist/features/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/features/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/features/index.ts"],"names":[],"mappings":";AAgBO,IAAM,+BAAe,IAAI,GAAA,CAAY,CAAC,qBAAA,EAAuB,eAAe,CAAC","file":"index.js","sourcesContent":["/**\n * Core feature flags for @mastra/core\n *\n * This set tracks which features are available in the current version of @mastra/core.\n * Dependent packages can check for feature availability to ensure compatibility.\n *\n * @example\n * ```ts\n * import { coreFeatures } from \"@mastra/core/features\"\n *\n * if (coreFeatures.has('workspaces-v1')) {\n * // Workspace features available\n * }\n * ```\n */\n// Add feature flags here as new features are introduced\nexport const coreFeatures = new Set<string>(['observationalMemory', 'workspaces-v1']);\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3LRUJTH3_cjs = require('./chunk-3LRUJTH3.cjs');
|
|
4
|
+
var chunkARQG4ZSD_cjs = require('./chunk-ARQG4ZSD.cjs');
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
Object.defineProperty(exports, "Mastra", {
|
|
8
9
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk3LRUJTH3_cjs.Mastra; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Agent", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkARQG4ZSD_cjs.Agent; }
|
|
10
15
|
});
|
|
11
16
|
//# sourceMappingURL=index.cjs.map
|
|
12
17
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
export { Mastra, type Config } from './mastra/index.js';
|
|
2
|
+
export { Agent } from './agent/index.js';
|
|
3
|
+
export type { SharedMemoryConfig, MemoryConfig, MastraMemory, SerializedMemoryConfig } from './memory/index.js';
|
|
4
|
+
export type { MastraVector as MastraVectorProvider } from './vector/index.js';
|
|
5
|
+
export type { IMastraLogger as Logger } from './logger/index.js';
|
|
6
|
+
export type { ToolAction } from './tools/index.js';
|
|
7
|
+
export type { Workflow } from './workflows/index.js';
|
|
8
|
+
export type { MastraScorers, ScoringSamplingConfig } from './evals/index.js';
|
|
9
|
+
export type { StorageResolvedAgentType, StorageScorerConfig } from './storage/index.js';
|
|
10
|
+
export type { IMastraEditor, MastraEditorConfig } from './editor/index.js';
|
|
2
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvG,YAAY,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrE,YAAY,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACpE,YAAY,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC/E,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED