@mastra/core 1.31.0-alpha.4 → 1.31.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 +118 -0
- package/dist/agent/durable/index.cjs +22 -22
- package/dist/agent/durable/index.js +4 -4
- package/dist/agent/index.cjs +9 -9
- package/dist/agent/index.js +1 -1
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/channels/index.cjs +4 -4
- package/dist/channels/index.js +1 -1
- package/dist/{chunk-2J3YSWHO.cjs → chunk-3LHTPHZP.cjs} +59 -59
- package/dist/{chunk-2J3YSWHO.cjs.map → chunk-3LHTPHZP.cjs.map} +1 -1
- package/dist/{chunk-UADG5CCD.js → chunk-43WNQPFP.js} +4 -4
- package/dist/{chunk-UADG5CCD.js.map → chunk-43WNQPFP.js.map} +1 -1
- package/dist/{chunk-W6E5CCSB.js → chunk-53NCBZKI.js} +4 -4
- package/dist/{chunk-W6E5CCSB.js.map → chunk-53NCBZKI.js.map} +1 -1
- package/dist/{chunk-WRJUVUIZ.cjs → chunk-5B6LXG5O.cjs} +389 -389
- package/dist/{chunk-WRJUVUIZ.cjs.map → chunk-5B6LXG5O.cjs.map} +1 -1
- package/dist/{chunk-GB2U2Y3P.js → chunk-5QMK4T3X.js} +3 -3
- package/dist/{chunk-GB2U2Y3P.js.map → chunk-5QMK4T3X.js.map} +1 -1
- package/dist/{chunk-BLU4IC6F.cjs → chunk-6MVINWPK.cjs} +14 -14
- package/dist/{chunk-BLU4IC6F.cjs.map → chunk-6MVINWPK.cjs.map} +1 -1
- package/dist/{chunk-7LKPZXDM.js → chunk-7AX25YLX.js} +4 -4
- package/dist/{chunk-7LKPZXDM.js.map → chunk-7AX25YLX.js.map} +1 -1
- package/dist/{chunk-QABIZQB7.js → chunk-BME3IGZD.js} +3 -3
- package/dist/{chunk-QABIZQB7.js.map → chunk-BME3IGZD.js.map} +1 -1
- package/dist/{chunk-CDS2VUE2.cjs → chunk-DNNICOYK.cjs} +20 -20
- package/dist/{chunk-CDS2VUE2.cjs.map → chunk-DNNICOYK.cjs.map} +1 -1
- package/dist/{chunk-VR5VNHNZ.js → chunk-FAPA556P.js} +8 -8
- package/dist/{chunk-VR5VNHNZ.js.map → chunk-FAPA556P.js.map} +1 -1
- package/dist/{chunk-AUQH3O4N.js → chunk-HAU2MDSW.js} +4 -4
- package/dist/{chunk-AUQH3O4N.js.map → chunk-HAU2MDSW.js.map} +1 -1
- package/dist/{chunk-3734AUDT.js → chunk-J72QZMTT.js} +6 -6
- package/dist/{chunk-3734AUDT.js.map → chunk-J72QZMTT.js.map} +1 -1
- package/dist/{chunk-IFC3YAVV.cjs → chunk-JH7D3XKB.cjs} +19 -19
- package/dist/{chunk-IFC3YAVV.cjs.map → chunk-JH7D3XKB.cjs.map} +1 -1
- package/dist/{chunk-XBCX5E3N.js → chunk-KXI7J3FZ.js} +3 -3
- package/dist/chunk-KXI7J3FZ.js.map +1 -0
- package/dist/{chunk-UCSM3GWM.js → chunk-LD7UCH6D.js} +3 -3
- package/dist/{chunk-UCSM3GWM.js.map → chunk-LD7UCH6D.js.map} +1 -1
- package/dist/{chunk-YBNPB36J.cjs → chunk-OSMMAURN.cjs} +9 -9
- package/dist/{chunk-YBNPB36J.cjs.map → chunk-OSMMAURN.cjs.map} +1 -1
- package/dist/{chunk-WDCXTDRR.cjs → chunk-SI6NWTR2.cjs} +7 -7
- package/dist/{chunk-WDCXTDRR.cjs.map → chunk-SI6NWTR2.cjs.map} +1 -1
- package/dist/{chunk-EE2UB4VX.js → chunk-TRVPCCVP.js} +3 -3
- package/dist/{chunk-EE2UB4VX.js.map → chunk-TRVPCCVP.js.map} +1 -1
- package/dist/{chunk-PBKTHAF5.cjs → chunk-TSGU2S4P.cjs} +5 -5
- package/dist/{chunk-PBKTHAF5.cjs.map → chunk-TSGU2S4P.cjs.map} +1 -1
- package/dist/{chunk-HTAWEZ7M.cjs → chunk-TUZTUFQO.cjs} +3 -3
- package/dist/{chunk-HTAWEZ7M.cjs.map → chunk-TUZTUFQO.cjs.map} +1 -1
- package/dist/{chunk-2CAB6LW3.cjs → chunk-V4RZ4FO4.cjs} +224 -224
- package/dist/{chunk-2CAB6LW3.cjs.map → chunk-V4RZ4FO4.cjs.map} +1 -1
- package/dist/{chunk-GUYKZ5U2.cjs → chunk-VWZ44FD3.cjs} +7 -7
- package/dist/{chunk-GUYKZ5U2.cjs.map → chunk-VWZ44FD3.cjs.map} +1 -1
- package/dist/{chunk-AVBQJTYL.cjs → chunk-W7C7RY6I.cjs} +3 -3
- package/dist/chunk-W7C7RY6I.cjs.map +1 -0
- package/dist/{chunk-JS344OAI.js → chunk-X6ETALRU.js} +9 -9
- package/dist/{chunk-JS344OAI.js.map → chunk-X6ETALRU.js.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +203 -203
- package/dist/docs/references/docs-agents-adding-voice.md +14 -13
- package/dist/docs/references/docs-voice-overview.md +66 -0
- package/dist/docs/references/docs-voice-speech-to-speech.md +45 -1
- package/dist/docs/references/reference.md +1 -0
- package/dist/evals/index.cjs +6 -6
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +3 -3
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/harness/index.cjs +7 -7
- package/dist/harness/index.js +5 -5
- 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/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-JCF3EDEH.js +3 -0
- package/dist/{mastra-4ITVIM3P.js.map → mastra-JCF3EDEH.js.map} +1 -1
- package/dist/mastra-R4MQZGKL.cjs +12 -0
- package/dist/{mastra-AJ5FVVJV.cjs.map → mastra-R4MQZGKL.cjs.map} +1 -1
- package/dist/memory/index.cjs +19 -19
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-KZS6GJRC.js +3 -0
- package/dist/{models-dev-IPZ3ZBDT.js.map → models-dev-KZS6GJRC.js.map} +1 -1
- package/dist/models-dev-QVOQXYGC.cjs +12 -0
- package/dist/{models-dev-26D6O63V.cjs.map → models-dev-QVOQXYGC.cjs.map} +1 -1
- package/dist/netlify-2O6B3H7A.cjs +12 -0
- package/dist/{netlify-PK7PYQ7D.cjs.map → netlify-2O6B3H7A.cjs.map} +1 -1
- package/dist/netlify-IWBQ6YNZ.js +3 -0
- package/dist/{netlify-HN66KZY4.js.map → netlify-IWBQ6YNZ.js.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +49 -49
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-2OT653BC.cjs +44 -0
- package/dist/{provider-registry-43OJC4SQ.cjs.map → provider-registry-2OT653BC.cjs.map} +1 -1
- package/dist/provider-registry-Z7LJZZQR.js +3 -0
- package/dist/{provider-registry-5SZ7C4YH.js.map → provider-registry-Z7LJZZQR.js.map} +1 -1
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/runner-2MI65OOJ.js +3 -0
- package/dist/{runner-OHTFIP4Q.js.map → runner-2MI65OOJ.js.map} +1 -1
- package/dist/runner-CDSZZZQS.cjs +16 -0
- package/dist/{runner-2UOLTUSW.cjs.map → runner-CDSZZZQS.cjs.map} +1 -1
- package/dist/storage/index.cjs +61 -61
- package/dist/storage/index.js +2 -2
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/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/package.json +9 -9
- package/dist/chunk-AVBQJTYL.cjs.map +0 -1
- package/dist/chunk-XBCX5E3N.js.map +0 -1
- package/dist/mastra-4ITVIM3P.js +0 -3
- package/dist/mastra-AJ5FVVJV.cjs +0 -12
- package/dist/models-dev-26D6O63V.cjs +0 -12
- package/dist/models-dev-IPZ3ZBDT.js +0 -3
- package/dist/netlify-HN66KZY4.js +0 -3
- package/dist/netlify-PK7PYQ7D.cjs +0 -12
- package/dist/provider-registry-43OJC4SQ.cjs +0 -44
- package/dist/provider-registry-5SZ7C4YH.js +0 -3
- package/dist/runner-2UOLTUSW.cjs +0 -16
- package/dist/runner-OHTFIP4Q.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,123 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
+
## 1.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Enhanced load_tool to accept an array of tool names, enabling bulk tool loading in a single call. Returns 'loaded', 'notFound', and 'alreadyLoaded' arrays for clearer response shape. ([#15472](https://github.com/mastra-ai/mastra/pull/15472))
|
|
8
|
+
|
|
9
|
+
- Added Microsoft Entra ID authentication support for Azure OpenAI gateways, so Azure deployments can call models without API keys when using Azure SDK credentials. ([#15983](https://github.com/mastra-ai/mastra/pull/15983))
|
|
10
|
+
|
|
11
|
+
- Added platform channels framework with ChannelProvider interface, ChannelsStorage domain, and ChannelConnectResult discriminated union supporting OAuth, deep link, and immediate connection flows. Channels can be registered on the Mastra instance and expose connect/disconnect/list APIs for platform integrations. ([#15876](https://github.com/mastra-ai/mastra/pull/15876))
|
|
12
|
+
|
|
13
|
+
- Added top-level `environment` config on `Mastra` to tag observability signals with the deployment environment. ([#15956](https://github.com/mastra-ai/mastra/pull/15956))
|
|
14
|
+
|
|
15
|
+
Set it once on the `Mastra` instance and it will be attached to all observability signals automatically. Falls back to `process.env.NODE_ENV` when unset; per-call `tracingOptions.metadata.environment` still takes precedence.
|
|
16
|
+
|
|
17
|
+
**Before**
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
await agent.generate('hello', {
|
|
21
|
+
tracingOptions: { metadata: { environment: process.env.NODE_ENV } },
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**After**
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
new Mastra({
|
|
29
|
+
environment: 'production',
|
|
30
|
+
observability: new Observability({ ... }),
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`mastra.getEnvironment()` returns the resolved value.
|
|
35
|
+
|
|
36
|
+
- Fixed trajectory scorers in dataset.startExperiment receiving raw agent messages instead of a Trajectory object, which caused a crash when accessing run.output.steps. Trajectory scorers now receive the same pre-extracted Trajectory that runEvals provides. ([#15693](https://github.com/mastra-ai/mastra/pull/15693))
|
|
37
|
+
|
|
38
|
+
The scorers option now also accepts the same categorised shape as runEvals (AgentScorerConfig / WorkflowScorerConfig), so you no longer need to rewrite your scorer config when moving from runEvals to dataset.startExperiment.
|
|
39
|
+
|
|
40
|
+
**Before (trajectory scorer crashed at runtime):**
|
|
41
|
+
|
|
42
|
+
await dataset.startExperiment({ scorers: [orderScorer] }) // run.output.steps was undefined
|
|
43
|
+
|
|
44
|
+
**After (works correctly, both flat and categorised forms accepted):**
|
|
45
|
+
|
|
46
|
+
await dataset.startExperiment({ scorers: [orderScorer] })
|
|
47
|
+
await dataset.startExperiment({ scorers: { agent: [accuracyScorer], trajectory: [orderScorer] } })
|
|
48
|
+
|
|
49
|
+
Per-step scorers are now also supported for workflow targets, matching `runEvals`. Pass `scorers: { workflow: [...], steps: { stepId: [...] }, trajectory: [...] }` to score individual workflow steps with their own scorers; results carry the originating `stepId` and keep `targetScope: 'span'` (with `targetEntityType: WORKFLOW_STEP` on the underlying scorer run), matching how `runEvals` encodes step identity.
|
|
50
|
+
|
|
51
|
+
- Workspace search now supports batch-capable embedders. Pass an embedder branded with `batch: true` (and an optional `maxBatchSize`) to embed all pending chunks for a flush in a single provider call instead of one call per chunk. This dramatically reduces index-rebuild time on large workspaces when using providers that support batch embedding (e.g. OpenAI's `embedMany`). Existing single-text embedders continue to work unchanged. ([#14735](https://github.com/mastra-ai/mastra/pull/14735))
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { embedMany } from 'ai';
|
|
55
|
+
import { openai } from '@ai-sdk/openai';
|
|
56
|
+
|
|
57
|
+
const model = openai.embedding('text-embedding-3-small');
|
|
58
|
+
|
|
59
|
+
const workspace = new Workspace({
|
|
60
|
+
// ...
|
|
61
|
+
embedder: Object.assign(
|
|
62
|
+
async (texts: string[]) => {
|
|
63
|
+
const { embeddings } = await embedMany({ model, values: texts });
|
|
64
|
+
return embeddings;
|
|
65
|
+
},
|
|
66
|
+
{ batch: true as const, maxBatchSize: 2048 },
|
|
67
|
+
),
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Update provider registry and model documentation with latest models and providers ([`1723e09`](https://github.com/mastra-ai/mastra/commit/1723e099829892419ddbfe49287acfeac2522724))
|
|
74
|
+
|
|
75
|
+
- Fixed workflow runs not being cancellable when steps or conditions ignored the abort signal. Cancelling a run now correctly stops `dountil`, `dowhile`, and `foreach` loops at every cancellation boundary — between iterations, after a step returns, after the loop condition is evaluated, and (for `foreach`) between concurrency chunks and after the final chunk. Previously, long-running loops (e.g. a `dountil` with a `setTimeout` inside the step) would keep running and eventually emit `success` even after the run was cancelled. Closes #15990. ([#15994](https://github.com/mastra-ai/mastra/pull/15994))
|
|
76
|
+
|
|
77
|
+
- Fixed type inference on workflow loop helpers (`foreach`, `dowhile`, `dountil`) so a step's `requestContextSchema` correctly aligns with the workflow's `requestContextSchema`. Previously these methods dropped the workflow's `TRequestContext` from the step parameter, causing TypeScript to reject typed-context steps even when the workflow declared a matching schema. Steps without a `requestContextSchema` are still accepted; steps whose schema does not match the workflow's now produce a type error. Fixes [#15989](https://github.com/mastra-ai/mastra/issues/15989). ([#15995](https://github.com/mastra-ai/mastra/pull/15995))
|
|
78
|
+
|
|
79
|
+
- Fixed sub-agent delegation so nested tool results stay out of the parent model context by default while remaining available to application code. Set `delegation.includeSubAgentToolResultsInModelContext` to include the full subagent result in the parent model context. ([#15832](https://github.com/mastra-ai/mastra/pull/15832))
|
|
80
|
+
|
|
81
|
+
- Added a coalesced display state subscription API for Harness. ([#15974](https://github.com/mastra-ai/mastra/pull/15974))
|
|
82
|
+
|
|
83
|
+
This helps UI clients render fewer updates while still receiving the latest state. The example below renders the initial state, then subscribes to coalesced updates with the default `windowMs` and `maxWaitMs` timing options.
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
render(harness.getDisplayState());
|
|
87
|
+
|
|
88
|
+
const unsubscribe = harness.subscribeDisplayState(render, {
|
|
89
|
+
windowMs: 250,
|
|
90
|
+
maxWaitMs: 500,
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- Fixed BatchPartsProcessor using a hardcoded id in batched text-delta chunks. The real message id and runId are now preserved from the original chunks, preventing AI SDK UIMessage stream from dropping batched deltas. ([#14974](https://github.com/mastra-ai/mastra/pull/14974))
|
|
95
|
+
|
|
96
|
+
- Add `filterAfterToolSteps` to `ToolCallFilter` so tool calls can be filtered during agentic loops after they are no longer recent. By default, `ToolCallFilter` keeps its previous behavior and only filters the initial input. ([#15795](https://github.com/mastra-ai/mastra/pull/15795))
|
|
97
|
+
|
|
98
|
+
- Workspace search no longer throws when requesting hybrid or vector mode if the configuration does not support it. The search tool now gracefully falls back to the best available mode instead of throwing an error. ([#14533](https://github.com/mastra-ai/mastra/pull/14533))
|
|
99
|
+
|
|
100
|
+
- Workspace file tools no longer use misleading absolute-path examples (e.g. `/data/output.txt`) that caused weaker LLMs to attempt writes at the actual filesystem root. The example paths in `read_file` and `write_file` are now relative. ([#14544](https://github.com/mastra-ai/mastra/pull/14544))
|
|
101
|
+
|
|
102
|
+
Additionally, when a contained workspace rejects an absolute path that escapes its boundary, the resulting `PermissionError` now guides the agent toward a relative path so it can self-correct on the next turn. When the path's first segment names a real directory in the workspace (e.g. `/src/app.ts` with an existing `src/`), the error suggests the exact relative form. Otherwise it falls back to a generic hint instead of inventing a misleading suggestion for genuinely out-of-workspace paths like `/etc/passwd`.
|
|
103
|
+
|
|
104
|
+
Fixes #14542
|
|
105
|
+
|
|
106
|
+
- Fixed `SkillSearchProcessor` so agents use it as the on-demand skill discovery path without also adding eager skill context. ([#15916](https://github.com/mastra-ai/mastra/pull/15916))
|
|
107
|
+
|
|
108
|
+
When `SkillSearchProcessor` is configured, agents no longer auto-add the eager `SkillsProcessor`, and they hide the overlapping `skill` and `skill_search` tools while keeping `skill_read` available for supporting skill files. Workspace file tools can still read `SKILL.md` files during explicit file inspection or editing workflows.
|
|
109
|
+
|
|
110
|
+
- Fixed tool calls to run in parallel when active tools exclude approval or suspending tools. ([#15978](https://github.com/mastra-ai/mastra/pull/15978))
|
|
111
|
+
|
|
112
|
+
- - **SearchEngine**: `indexMany` uses `p-map` with a default concurrency of 8 when vector embedding runs, with optional `concurrency` and `stopOnError` (same semantics as `p-map`). Lazy vector indexing flushes pending documents at the same concurrency, drains the queue before awaiting so concurrent `index` calls are not dropped, loops until the queue is empty before search, dedupes by document id (last wins), and re-queues the batch if a flush throws. ([#14735](https://github.com/mastra-ai/mastra/pull/14735))
|
|
113
|
+
- **Workspace**: Search auto-indexing reads files in parallel with a bounded concurrency, skips unreadable paths, awaits batch indexing, and falls back to per-file indexing when the batch path throws. Successful single-file indexing returns the path so callers can track what was indexed.
|
|
114
|
+
|
|
115
|
+
- Fix semantic recall indexing to honor read-only memory mode. ([#15949](https://github.com/mastra-ai/mastra/pull/15949))
|
|
116
|
+
|
|
117
|
+
- Fixed Linux bubblewrap failing when Workspace mounts use symlinks under LocalSandbox by resolving mount paths to real directories for isolation allowlists. ([#15498](https://github.com/mastra-ai/mastra/pull/15498))
|
|
118
|
+
|
|
119
|
+
## 1.31.0-alpha.5
|
|
120
|
+
|
|
3
121
|
## 1.31.0-alpha.4
|
|
4
122
|
|
|
5
123
|
### Minor Changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkW7D53JMX_cjs = require('../../chunk-W7D53JMX.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk6MVINWPK_cjs = require('../../chunk-6MVINWPK.cjs');
|
|
5
5
|
var chunkZCBG4ZQT_cjs = require('../../chunk-ZCBG4ZQT.cjs');
|
|
6
6
|
var chunk6K4BQ2JS_cjs = require('../../chunk-6K4BQ2JS.cjs');
|
|
7
7
|
var chunkHM6XXOV2_cjs = require('../../chunk-HM6XXOV2.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunk5B6LXG5O_cjs = require('../../chunk-5B6LXG5O.cjs');
|
|
9
9
|
var chunkGLBBBSS5_cjs = require('../../chunk-GLBBBSS5.cjs');
|
|
10
10
|
var chunkYNE3ZCU5_cjs = require('../../chunk-YNE3ZCU5.cjs');
|
|
11
11
|
var chunkIBQB7RSW_cjs = require('../../chunk-IBQB7RSW.cjs');
|
|
@@ -545,7 +545,7 @@ async function prepareForDurableExecution(options) {
|
|
|
545
545
|
threadExists = true;
|
|
546
546
|
requestContext.set("MastraMemory", { thread: threadObject, resourceId, memoryConfig: memoryConfig2 });
|
|
547
547
|
}
|
|
548
|
-
const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-
|
|
548
|
+
const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-CDSZZZQS.cjs');
|
|
549
549
|
const runner = new ProcessorRunner2({
|
|
550
550
|
inputProcessors,
|
|
551
551
|
outputProcessors,
|
|
@@ -595,7 +595,7 @@ async function prepareForDurableExecution(options) {
|
|
|
595
595
|
}
|
|
596
596
|
const memory = await typedAgent.getMemory({ requestContext });
|
|
597
597
|
const memoryConfig = execOptions?.memory?.options;
|
|
598
|
-
const saveQueueManager = memory ? new
|
|
598
|
+
const saveQueueManager = memory ? new chunk6MVINWPK_cjs.SaveQueueManager({
|
|
599
599
|
logger,
|
|
600
600
|
memory
|
|
601
601
|
}) : void 0;
|
|
@@ -956,7 +956,7 @@ function createDurableAgentStream(options) {
|
|
|
956
956
|
}
|
|
957
957
|
controller = null;
|
|
958
958
|
};
|
|
959
|
-
const output = new
|
|
959
|
+
const output = new chunk6MVINWPK_cjs.MastraModelOutput({
|
|
960
960
|
model,
|
|
961
961
|
stream,
|
|
962
962
|
messageList,
|
|
@@ -1188,7 +1188,7 @@ var BG_CHECK_STEP_ID = `${DurableStepIds.AGENTIC_EXECUTION}-bg-task-check`;
|
|
|
1188
1188
|
var bgCheckInputSchema = zod.z.any();
|
|
1189
1189
|
var bgCheckOutputSchema = zod.z.any();
|
|
1190
1190
|
function createDurableBackgroundTaskCheckStep() {
|
|
1191
|
-
return
|
|
1191
|
+
return chunk6MVINWPK_cjs.createStep({
|
|
1192
1192
|
id: BG_CHECK_STEP_ID,
|
|
1193
1193
|
inputSchema: bgCheckInputSchema,
|
|
1194
1194
|
outputSchema: bgCheckOutputSchema,
|
|
@@ -1317,7 +1317,7 @@ async function resolveRuntimeDependencies(options) {
|
|
|
1317
1317
|
}
|
|
1318
1318
|
let saveQueueManager;
|
|
1319
1319
|
if (memory) {
|
|
1320
|
-
saveQueueManager = new
|
|
1320
|
+
saveQueueManager = new chunk6MVINWPK_cjs.SaveQueueManager({
|
|
1321
1321
|
logger: mastra?.getLogger?.(),
|
|
1322
1322
|
memory
|
|
1323
1323
|
});
|
|
@@ -1397,9 +1397,9 @@ async function resolveModelFromConfig(config, mastra) {
|
|
|
1397
1397
|
const requestContext = new chunkKF4FCWWL_cjs.RequestContext();
|
|
1398
1398
|
const modelConfigString = config.originalConfig ?? `${config.provider}/${config.modelId}`;
|
|
1399
1399
|
if (typeof modelConfigString === "string") {
|
|
1400
|
-
return await
|
|
1400
|
+
return await chunk5B6LXG5O_cjs.resolveModelConfig(modelConfigString, requestContext, mastra);
|
|
1401
1401
|
}
|
|
1402
|
-
return await
|
|
1402
|
+
return await chunk5B6LXG5O_cjs.resolveModelConfig(
|
|
1403
1403
|
modelConfigString,
|
|
1404
1404
|
requestContext,
|
|
1405
1405
|
mastra
|
|
@@ -1472,7 +1472,7 @@ var durableLLMOutputSchema = zod.z.object({
|
|
|
1472
1472
|
stepIndex: zod.z.number().optional()
|
|
1473
1473
|
});
|
|
1474
1474
|
function createDurableLLMExecutionStep(_options) {
|
|
1475
|
-
return
|
|
1475
|
+
return chunk6MVINWPK_cjs.createStep({
|
|
1476
1476
|
id: DurableStepIds.LLM_EXECUTION,
|
|
1477
1477
|
inputSchema: durableLLMInputSchema,
|
|
1478
1478
|
outputSchema: durableLLMOutputSchema,
|
|
@@ -1510,7 +1510,7 @@ function createDurableLLMExecutionStep(_options) {
|
|
|
1510
1510
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
1511
1511
|
try {
|
|
1512
1512
|
const model = !hasModelList ? resolvedModel : resolvedModelList?.find((m) => m.id === modelEntry.id)?.model ?? await resolveModelFromListEntry(modelEntry, mastra);
|
|
1513
|
-
if (!
|
|
1513
|
+
if (!chunk6MVINWPK_cjs.isSupportedLanguageModel(model)) {
|
|
1514
1514
|
const hint = model.__metadataOnly ? " The model could not be resolved from the run registry or Mastra instance." : "";
|
|
1515
1515
|
throw new Error(
|
|
1516
1516
|
`Unsupported model version: ${model.specificationVersion}. Model must implement doStream.${hint}`
|
|
@@ -1540,7 +1540,7 @@ function createDurableLLMExecutionStep(_options) {
|
|
|
1540
1540
|
await emitChunkEvent(pubsub, runId, data);
|
|
1541
1541
|
}
|
|
1542
1542
|
} : void 0;
|
|
1543
|
-
const runner = new
|
|
1543
|
+
const runner = new chunk6MVINWPK_cjs.ProcessorRunner({
|
|
1544
1544
|
inputProcessors: registryEntry.inputProcessors,
|
|
1545
1545
|
outputProcessors: registryEntry.outputProcessors ?? [],
|
|
1546
1546
|
errorProcessors: registryEntry.errorProcessors ?? [],
|
|
@@ -1588,7 +1588,7 @@ function createDurableLLMExecutionStep(_options) {
|
|
|
1588
1588
|
let usage = { inputTokens: 0, outputTokens: 0, totalTokens: 0 };
|
|
1589
1589
|
let responseMetadata = {};
|
|
1590
1590
|
modelSpanTracker?.startStep();
|
|
1591
|
-
const modelResult =
|
|
1591
|
+
const modelResult = chunk6MVINWPK_cjs.execute({
|
|
1592
1592
|
runId,
|
|
1593
1593
|
model: currentModel,
|
|
1594
1594
|
inputMessages,
|
|
@@ -1615,7 +1615,7 @@ function createDurableLLMExecutionStep(_options) {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
1617
|
});
|
|
1618
|
-
const outputStream = new
|
|
1618
|
+
const outputStream = new chunk6MVINWPK_cjs.MastraModelOutput({
|
|
1619
1619
|
model: {
|
|
1620
1620
|
modelId: currentModel.modelId,
|
|
1621
1621
|
provider: currentModel.provider,
|
|
@@ -1796,7 +1796,7 @@ function createDurableLLMExecutionStep(_options) {
|
|
|
1796
1796
|
const registryEntry = globalRunRegistry.get(runId);
|
|
1797
1797
|
if (registryEntry?.errorProcessors?.length) {
|
|
1798
1798
|
try {
|
|
1799
|
-
const runner = new
|
|
1799
|
+
const runner = new chunk6MVINWPK_cjs.ProcessorRunner({
|
|
1800
1800
|
inputProcessors: registryEntry.inputProcessors ?? [],
|
|
1801
1801
|
outputProcessors: registryEntry.outputProcessors ?? [],
|
|
1802
1802
|
errorProcessors: registryEntry.errorProcessors,
|
|
@@ -1882,7 +1882,7 @@ async function flushMessagesBeforeSuspension({
|
|
|
1882
1882
|
}
|
|
1883
1883
|
}
|
|
1884
1884
|
function createDurableToolCallStep() {
|
|
1885
|
-
return
|
|
1885
|
+
return chunk6MVINWPK_cjs.createStep({
|
|
1886
1886
|
id: DurableStepIds.TOOL_CALL,
|
|
1887
1887
|
inputSchema: durableToolCallInputSchema,
|
|
1888
1888
|
outputSchema: durableToolCallOutputSchema,
|
|
@@ -2347,7 +2347,7 @@ var durableLLMMappingOutputSchema = zod.z.object({
|
|
|
2347
2347
|
processorRetryFeedback: zod.z.string().optional()
|
|
2348
2348
|
});
|
|
2349
2349
|
function createDurableLLMMappingStep() {
|
|
2350
|
-
return
|
|
2350
|
+
return chunk6MVINWPK_cjs.createStep({
|
|
2351
2351
|
id: DurableStepIds.LLM_MAPPING,
|
|
2352
2352
|
inputSchema: durableLLMMappingInputSchema,
|
|
2353
2353
|
outputSchema: durableLLMMappingOutputSchema,
|
|
@@ -2454,7 +2454,7 @@ function createDurableAgenticWorkflow(options) {
|
|
|
2454
2454
|
const toolCallStep = createDurableToolCallStep();
|
|
2455
2455
|
const llmMappingStep = createDurableLLMMappingStep();
|
|
2456
2456
|
const backgroundTaskCheckStep = createDurableBackgroundTaskCheckStep();
|
|
2457
|
-
const singleIterationWorkflow =
|
|
2457
|
+
const singleIterationWorkflow = chunk6MVINWPK_cjs.createWorkflow({
|
|
2458
2458
|
id: DurableStepIds.AGENTIC_EXECUTION,
|
|
2459
2459
|
inputSchema: iterationStateSchema,
|
|
2460
2460
|
outputSchema: iterationStateSchema,
|
|
@@ -2517,7 +2517,7 @@ function createDurableAgenticWorkflow(options) {
|
|
|
2517
2517
|
},
|
|
2518
2518
|
{ id: "update-iteration-state" }
|
|
2519
2519
|
).commit();
|
|
2520
|
-
return
|
|
2520
|
+
return chunk6MVINWPK_cjs.createWorkflow({
|
|
2521
2521
|
id: DurableStepIds.AGENTIC_LOOP,
|
|
2522
2522
|
inputSchema: durableAgenticInputSchema,
|
|
2523
2523
|
outputSchema: durableAgenticOutputSchema,
|
|
@@ -2560,7 +2560,7 @@ function createDurableAgenticWorkflow(options) {
|
|
|
2560
2560
|
const registryEntry = globalRunRegistry.get(state.runId);
|
|
2561
2561
|
if (registryEntry?.outputProcessors?.length) {
|
|
2562
2562
|
try {
|
|
2563
|
-
const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-
|
|
2563
|
+
const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-CDSZZZQS.cjs');
|
|
2564
2564
|
const runner = new ProcessorRunner2({
|
|
2565
2565
|
inputProcessors: registryEntry.inputProcessors ?? [],
|
|
2566
2566
|
outputProcessors: registryEntry.outputProcessors,
|
|
@@ -2658,7 +2658,7 @@ function createDurableAgenticWorkflow(options) {
|
|
|
2658
2658
|
scorer,
|
|
2659
2659
|
sampling
|
|
2660
2660
|
};
|
|
2661
|
-
|
|
2661
|
+
chunk6MVINWPK_cjs.runScorer({
|
|
2662
2662
|
runId: initData.runId,
|
|
2663
2663
|
scorerId: scorerKey,
|
|
2664
2664
|
scorerObject,
|
|
@@ -2691,7 +2691,7 @@ function createDurableAgenticWorkflow(options) {
|
|
|
2691
2691
|
}
|
|
2692
2692
|
|
|
2693
2693
|
// src/agent/durable/durable-agent.ts
|
|
2694
|
-
var DurableAgent = class extends
|
|
2694
|
+
var DurableAgent = class extends chunk6MVINWPK_cjs.Agent {
|
|
2695
2695
|
/** The wrapped agent */
|
|
2696
2696
|
#wrappedAgent;
|
|
2697
2697
|
/** Registry for per-run non-serializable state */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CachingPubSub } from '../../chunk-RRJNDPUT.js';
|
|
2
|
-
import { SaveQueueManager, MastraModelOutput, createStep, isSupportedLanguageModel, ProcessorRunner, execute, createWorkflow, runScorer, Agent } from '../../chunk-
|
|
2
|
+
import { SaveQueueManager, MastraModelOutput, createStep, isSupportedLanguageModel, ProcessorRunner, execute, createWorkflow, runScorer, Agent } from '../../chunk-53NCBZKI.js';
|
|
3
3
|
import { PUBSUB_SYMBOL } from '../../chunk-2QXNHEDL.js';
|
|
4
4
|
import { MessageList } from '../../chunk-MXMVYCCO.js';
|
|
5
5
|
import { EventEmitterPubSub } from '../../chunk-4E5FOY4E.js';
|
|
6
|
-
import { resolveModelConfig } from '../../chunk-
|
|
6
|
+
import { resolveModelConfig } from '../../chunk-J72QZMTT.js';
|
|
7
7
|
import { InMemoryServerCache } from '../../chunk-CH66BRBG.js';
|
|
8
8
|
import { deepMerge } from '../../chunk-ARNDQ2SQ.js';
|
|
9
9
|
import { createObservabilityContext } from '../../chunk-SR7NB44E.js';
|
|
@@ -543,7 +543,7 @@ async function prepareForDurableExecution(options) {
|
|
|
543
543
|
threadExists = true;
|
|
544
544
|
requestContext.set("MastraMemory", { thread: threadObject, resourceId, memoryConfig: memoryConfig2 });
|
|
545
545
|
}
|
|
546
|
-
const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-
|
|
546
|
+
const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-2MI65OOJ.js');
|
|
547
547
|
const runner = new ProcessorRunner2({
|
|
548
548
|
inputProcessors,
|
|
549
549
|
outputProcessors,
|
|
@@ -2558,7 +2558,7 @@ function createDurableAgenticWorkflow(options) {
|
|
|
2558
2558
|
const registryEntry = globalRunRegistry.get(state.runId);
|
|
2559
2559
|
if (registryEntry?.outputProcessors?.length) {
|
|
2560
2560
|
try {
|
|
2561
|
-
const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-
|
|
2561
|
+
const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-2MI65OOJ.js');
|
|
2562
2562
|
const runner = new ProcessorRunner2({
|
|
2563
2563
|
inputProcessors: registryEntry.inputProcessors ?? [],
|
|
2564
2564
|
outputProcessors: registryEntry.outputProcessors,
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6MVINWPK_cjs = require('../chunk-6MVINWPK.cjs');
|
|
4
4
|
var chunk6K4BQ2JS_cjs = require('../chunk-6K4BQ2JS.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 chunk6MVINWPK_cjs.Agent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TripWire", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk6MVINWPK_cjs.TripWire; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "isDurableAgentLike", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk6MVINWPK_cjs.isDurableAgentLike; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "isSupportedLanguageModel", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk6MVINWPK_cjs.isSupportedLanguageModel; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "resolveThreadIdFromArgs", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunk6MVINWPK_cjs.resolveThreadIdFromArgs; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "supportedLanguageModelSpecifications", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunk6MVINWPK_cjs.supportedLanguageModelSpecifications; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "tryGenerateWithJsonFallback", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunk6MVINWPK_cjs.tryGenerateWithJsonFallback; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "tryStreamWithJsonFallback", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunk6MVINWPK_cjs.tryStreamWithJsonFallback; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "MessageList", {
|
|
41
41
|
enumerable: true,
|
package/dist/agent/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Agent, TripWire, isDurableAgentLike, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-
|
|
1
|
+
export { Agent, TripWire, isDurableAgentLike, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-53NCBZKI.js';
|
|
2
2
|
export { MessageList, TypeDetector, aiV5ModelMessageToV2PromptMessage, convertMessages } from '../chunk-MXMVYCCO.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/browser/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6MVINWPK_cjs = require('../chunk-6MVINWPK.cjs');
|
|
4
4
|
var chunk5ANWVE3P_cjs = require('../chunk-5ANWVE3P.cjs');
|
|
5
5
|
var chunkFCQNDFEW_cjs = require('../chunk-FCQNDFEW.cjs');
|
|
6
6
|
var chunk7GW2TQXP_cjs = require('../chunk-7GW2TQXP.cjs');
|
|
@@ -1191,7 +1191,7 @@ To fix this, either:
|
|
|
1191
1191
|
*/
|
|
1192
1192
|
getInputProcessors(configuredProcessors = []) {
|
|
1193
1193
|
const hasProcessor = configuredProcessors.some(
|
|
1194
|
-
(p) => !
|
|
1194
|
+
(p) => !chunk6MVINWPK_cjs.isProcessorWorkflow(p) && "id" in p && p.id === "browser-context"
|
|
1195
1195
|
);
|
|
1196
1196
|
if (hasProcessor) return [];
|
|
1197
1197
|
return [new BrowserContextProcessor()];
|
package/dist/browser/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isProcessorWorkflow } from '../chunk-
|
|
1
|
+
import { isProcessorWorkflow } from '../chunk-53NCBZKI.js';
|
|
2
2
|
export { BrowserCliHandler, browserCliHandler } from '../chunk-F4PWGVHW.js';
|
|
3
3
|
import { MastraBase } from '../chunk-WENZPAHS.js';
|
|
4
4
|
import { RegisteredLogger } from '../chunk-DBBWTK24.js';
|
package/dist/channels/index.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6MVINWPK_cjs = require('../chunk-6MVINWPK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "AgentChannels", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk6MVINWPK_cjs.AgentChannels; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "ChatChannelProcessor", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk6MVINWPK_cjs.ChatChannelProcessor; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "MastraStateAdapter", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk6MVINWPK_cjs.MastraStateAdapter; }
|
|
18
18
|
});
|
|
19
19
|
//# sourceMappingURL=index.cjs.map
|
|
20
20
|
//# sourceMappingURL=index.cjs.map
|
package/dist/channels/index.js
CHANGED