@mastra/core 1.30.0-alpha.1 → 1.30.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 +117 -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-KL73E6QK.js → chunk-2UGZF32K.js} +6 -6
- package/dist/{chunk-KL73E6QK.js.map → chunk-2UGZF32K.js.map} +1 -1
- package/dist/{chunk-RQUGR73M.cjs → chunk-36SQPELR.cjs} +59 -59
- package/dist/{chunk-RQUGR73M.cjs.map → chunk-36SQPELR.cjs.map} +1 -1
- package/dist/{chunk-JFHZ6ZSE.cjs → chunk-3DW73O5A.cjs} +18 -18
- package/dist/{chunk-JFHZ6ZSE.cjs.map → chunk-3DW73O5A.cjs.map} +1 -1
- package/dist/{chunk-UBAE2LKC.js → chunk-3ZNPHDSY.js} +3 -3
- package/dist/{chunk-UBAE2LKC.js.map → chunk-3ZNPHDSY.js.map} +1 -1
- package/dist/{chunk-XPZUMGBT.cjs → chunk-4CXGZ7PZ.cjs} +6 -6
- package/dist/{chunk-XPZUMGBT.cjs.map → chunk-4CXGZ7PZ.cjs.map} +1 -1
- package/dist/{chunk-WKVOUMIY.js → chunk-54B23CPR.js} +3 -3
- package/dist/{chunk-WKVOUMIY.js.map → chunk-54B23CPR.js.map} +1 -1
- package/dist/{chunk-2CJAA244.js → chunk-CIE4UPHM.js} +3 -3
- package/dist/{chunk-2CJAA244.js.map → chunk-CIE4UPHM.js.map} +1 -1
- package/dist/{chunk-JPTP5VH4.js → chunk-ESRIWSIA.js} +4 -4
- package/dist/{chunk-JPTP5VH4.js.map → chunk-ESRIWSIA.js.map} +1 -1
- package/dist/{chunk-7JM7UHFE.cjs → chunk-F6ZJ6PMP.cjs} +3 -3
- package/dist/chunk-F6ZJ6PMP.cjs.map +1 -0
- package/dist/{chunk-Z4SWV2ZC.cjs → chunk-FAHETYAI.cjs} +14 -14
- package/dist/{chunk-Z4SWV2ZC.cjs.map → chunk-FAHETYAI.cjs.map} +1 -1
- package/dist/{chunk-OWG4YA2G.cjs → chunk-GCVSTCZ7.cjs} +4 -4
- package/dist/{chunk-OWG4YA2G.cjs.map → chunk-GCVSTCZ7.cjs.map} +1 -1
- package/dist/{chunk-6MHTL3F2.cjs → chunk-JAL5PN6F.cjs} +5 -5
- package/dist/{chunk-6MHTL3F2.cjs.map → chunk-JAL5PN6F.cjs.map} +1 -1
- package/dist/{chunk-RBRVVKHA.cjs → chunk-KGMUYIZN.cjs} +7 -7
- package/dist/{chunk-RBRVVKHA.cjs.map → chunk-KGMUYIZN.cjs.map} +1 -1
- package/dist/{chunk-G7A2HVQC.js → chunk-MHTNREIQ.js} +3 -3
- package/dist/chunk-MHTNREIQ.js.map +1 -0
- package/dist/{chunk-SYPXPX2B.js → chunk-OS3XEPVO.js} +4 -4
- package/dist/{chunk-SYPXPX2B.js.map → chunk-OS3XEPVO.js.map} +1 -1
- package/dist/{chunk-UNTMYRPU.js → chunk-OWO4JJNR.js} +9 -9
- package/dist/{chunk-UNTMYRPU.js.map → chunk-OWO4JJNR.js.map} +1 -1
- package/dist/{chunk-CCRG7RQX.js → chunk-TBGHF2UC.js} +4 -4
- package/dist/{chunk-CCRG7RQX.js.map → chunk-TBGHF2UC.js.map} +1 -1
- package/dist/{chunk-P2N3N22H.cjs → chunk-TOCDOYTX.cjs} +224 -224
- package/dist/{chunk-P2N3N22H.cjs.map → chunk-TOCDOYTX.cjs.map} +1 -1
- package/dist/{chunk-RVDDKJFA.js → chunk-U3IFSZTQ.js} +8 -8
- package/dist/{chunk-RVDDKJFA.js.map → chunk-U3IFSZTQ.js.map} +1 -1
- package/dist/{chunk-QN5MTCJK.cjs → chunk-UZ6ONJMX.cjs} +9 -9
- package/dist/{chunk-QN5MTCJK.cjs.map → chunk-UZ6ONJMX.cjs.map} +1 -1
- package/dist/{chunk-SHRPNMLE.cjs → chunk-WA4G4MJC.cjs} +389 -389
- package/dist/{chunk-SHRPNMLE.cjs.map → chunk-WA4G4MJC.cjs.map} +1 -1
- package/dist/{chunk-D6TN663R.js → chunk-WAHKXJC6.js} +4 -4
- package/dist/{chunk-D6TN663R.js.map → chunk-WAHKXJC6.js.map} +1 -1
- package/dist/{chunk-OKAHBYIU.js → chunk-X2PAQJZT.js} +4 -4
- package/dist/{chunk-OKAHBYIU.js.map → chunk-X2PAQJZT.js.map} +1 -1
- package/dist/{chunk-IQBFEGDE.cjs → chunk-YA6EYERE.cjs} +20 -20
- package/dist/{chunk-IQBFEGDE.cjs.map → chunk-YA6EYERE.cjs.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +2 -1
- package/dist/docs/assets/SOURCE_MAP.json +215 -215
- package/dist/docs/references/reference-storage-clickhouse.md +24 -18
- package/dist/docs/references/reference-storage-duckdb.md +150 -0
- 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-DJUZZMNG.cjs +12 -0
- package/dist/{mastra-BAFUPFGB.cjs.map → mastra-DJUZZMNG.cjs.map} +1 -1
- package/dist/mastra-VWDGYZDW.js +3 -0
- package/dist/{mastra-5EFMIVHA.js.map → mastra-VWDGYZDW.js.map} +1 -1
- package/dist/memory/index.cjs +19 -19
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-K5B2DUKV.js +3 -0
- package/dist/{models-dev-JPGUFR4T.js.map → models-dev-K5B2DUKV.js.map} +1 -1
- package/dist/models-dev-VDEV47JP.cjs +12 -0
- package/dist/{models-dev-RBI2SKEN.cjs.map → models-dev-VDEV47JP.cjs.map} +1 -1
- package/dist/netlify-7VI4LKAU.cjs +12 -0
- package/dist/{netlify-WHNPHSNE.cjs.map → netlify-7VI4LKAU.cjs.map} +1 -1
- package/dist/netlify-UL5XNQ7Y.js +3 -0
- package/dist/{netlify-YBQ6ABL3.js.map → netlify-UL5XNQ7Y.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-27CRYYRB.js +3 -0
- package/dist/{provider-registry-FU6AHZJL.js.map → provider-registry-27CRYYRB.js.map} +1 -1
- package/dist/provider-registry-GCGWKQD6.cjs +44 -0
- package/dist/{provider-registry-MMLUXVHQ.cjs.map → provider-registry-GCGWKQD6.cjs.map} +1 -1
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/runner-2NS3MIME.js +3 -0
- package/dist/{runner-UWLNDQQV.js.map → runner-2NS3MIME.js.map} +1 -1
- package/dist/runner-UDQYOIEQ.cjs +16 -0
- package/dist/{runner-RWI6TW2Q.cjs.map → runner-UDQYOIEQ.cjs.map} +1 -1
- package/dist/storage/index.cjs +72 -72
- package/dist/storage/index.js +3 -3
- 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-7JM7UHFE.cjs.map +0 -1
- package/dist/chunk-G7A2HVQC.js.map +0 -1
- package/dist/mastra-5EFMIVHA.js +0 -3
- package/dist/mastra-BAFUPFGB.cjs +0 -12
- package/dist/models-dev-JPGUFR4T.js +0 -3
- package/dist/models-dev-RBI2SKEN.cjs +0 -12
- package/dist/netlify-WHNPHSNE.cjs +0 -12
- package/dist/netlify-YBQ6ABL3.js +0 -3
- package/dist/provider-registry-FU6AHZJL.js +0 -3
- package/dist/provider-registry-MMLUXVHQ.cjs +0 -44
- package/dist/runner-RWI6TW2Q.cjs +0 -16
- package/dist/runner-UWLNDQQV.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,122 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
+
## 1.30.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add durable agents with resumable streams ([#12557](https://github.com/mastra-ai/mastra/pull/12557))
|
|
8
|
+
|
|
9
|
+
Durable agents make agent execution resilient to disconnections, crashes, and long-running operations.
|
|
10
|
+
|
|
11
|
+
### The Problem
|
|
12
|
+
|
|
13
|
+
Standard agent streaming has two fragility points:
|
|
14
|
+
1. **Connection drops** - If a client disconnects mid-stream (network blip, browser refresh, mobile app backgrounded), all subsequent events are lost. The client has no way to "catch up" on what they missed.
|
|
15
|
+
2. **Long-running operations** - Agent loops with tool calls can take minutes. Holding an HTTP connection open that long is unreliable. If the server restarts or the connection times out, the work is lost.
|
|
16
|
+
|
|
17
|
+
### The Solution
|
|
18
|
+
|
|
19
|
+
**Resumable streams** solve connection drops. Every event is cached with a sequential index. If a client disconnects at event 5, they can reconnect and request events starting from index 6. They receive cached events immediately, then continue with live events as they arrive.
|
|
20
|
+
|
|
21
|
+
**Durable execution** solves long-running operations. Instead of executing the agent loop directly in the HTTP request, execution happens in a workflow engine (built-in evented engine or Inngest). The HTTP request just subscribes to events. If the connection drops, execution continues. The client can reconnect anytime to observe progress.
|
|
22
|
+
|
|
23
|
+
### Usage
|
|
24
|
+
|
|
25
|
+
Wrap any existing `Agent` with durability using factory functions:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { Agent } from '@mastra/core/agent';
|
|
29
|
+
import { createDurableAgent } from '@mastra/core/agent/durable';
|
|
30
|
+
|
|
31
|
+
const agent = new Agent({
|
|
32
|
+
id: 'my-agent',
|
|
33
|
+
model: openai('gpt-4'),
|
|
34
|
+
instructions: 'You are helpful',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const durableAgent = createDurableAgent({ agent });
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Factory functions for different execution strategies:**
|
|
41
|
+
|
|
42
|
+
| Factory | Execution | Use Case |
|
|
43
|
+
| ---------------------------------------- | ----------------------------------- | ------------------------------- |
|
|
44
|
+
| `createDurableAgent({ agent })` | Local, synchronous | Development, simple deployments |
|
|
45
|
+
| `createEventedAgent({ agent })` | Fire-and-forget via workflow engine | Long-running operations |
|
|
46
|
+
| `createInngestAgent({ agent, inngest })` | Inngest-powered | Production, distributed systems |
|
|
47
|
+
|
|
48
|
+
### Resumable Streams
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// Start streaming
|
|
52
|
+
const { runId, output } = await durableAgent.stream('Analyze this data...');
|
|
53
|
+
|
|
54
|
+
// Client disconnects at event 5...
|
|
55
|
+
|
|
56
|
+
// Reconnect and resume from where we left off
|
|
57
|
+
const { output: resumed } = await durableAgent.observe(runId, { offset: 6 });
|
|
58
|
+
// Receives events 6, 7, 8... from cache, then continues with live events
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### PubSub and Cache
|
|
62
|
+
|
|
63
|
+
Durable agents use two infrastructure components:
|
|
64
|
+
|
|
65
|
+
| Component | Purpose | Default |
|
|
66
|
+
| ---------- | ----------------------------------------- | --------------------- |
|
|
67
|
+
| **PubSub** | Real-time event delivery during streaming | `EventEmitterPubSub` |
|
|
68
|
+
| **Cache** | Stores events for replay on reconnection | `InMemoryServerCache` |
|
|
69
|
+
|
|
70
|
+
When `stream()` is called, events flow through pubsub in real-time. The cache stores each event with a sequential index. When `observe()` is called, missed events replay from cache before continuing with live events.
|
|
71
|
+
|
|
72
|
+
**Configure via Mastra instance (recommended):**
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
const mastra = new Mastra({
|
|
76
|
+
cache: new RedisServerCache({ url: 'redis://...' }),
|
|
77
|
+
pubsub: new RedisPubSub({ url: 'redis://...' }),
|
|
78
|
+
agents: {
|
|
79
|
+
// Inherits cache and pubsub from Mastra
|
|
80
|
+
myAgent: createDurableAgent({ agent }),
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Configure per-agent (overrides Mastra):**
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
const durableAgent = createDurableAgent({
|
|
89
|
+
agent,
|
|
90
|
+
cache: new RedisServerCache({ url: 'redis://...' }),
|
|
91
|
+
pubsub: new RedisPubSub({ url: 'redis://...' }),
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Disable caching (streams won't be resumable):**
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
const durableAgent = createDurableAgent({ agent, cache: false });
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For single-instance deployments, the defaults work fine. For multi-instance deployments (load balancer, horizontal scaling), use Redis-backed implementations so any instance can serve reconnection requests.
|
|
102
|
+
|
|
103
|
+
### Class Hierarchy
|
|
104
|
+
- `DurableAgent` extends `Agent` - base class with resumable streams
|
|
105
|
+
- `EventedAgent` extends `DurableAgent` - fire-and-forget execution
|
|
106
|
+
- `InngestAgent` extends `DurableAgent` - Inngest-powered execution
|
|
107
|
+
|
|
108
|
+
### Patch Changes
|
|
109
|
+
|
|
110
|
+
- Fixed a regression in 1.29.0 where configuring an agent with channel adapters (e.g. `channels.adapters.slack`) caused server startup to crash with a "Custom API route ... must not start with /api" error. The custom-route prefix validation now skips framework-generated webhook routes. ([#15952](https://github.com/mastra-ai/mastra/pull/15952))
|
|
111
|
+
|
|
112
|
+
- Update provider registry and model documentation with latest models and providers ([`d587199`](https://github.com/mastra-ai/mastra/commit/d5871993c0371bde2b0717d6b47194755baa1443))
|
|
113
|
+
|
|
114
|
+
- Fix MCP client support in the agent editor: ([#15945](https://github.com/mastra-ai/mastra/pull/15945))
|
|
115
|
+
- MCP client form dirty state: Save button now enables after adding/removing MCP clients
|
|
116
|
+
- MCP tool name matching: Both bare and namespaced tool names are matched correctly
|
|
117
|
+
- Auth token forwarding: Token from cookie or header is forwarded to auth-protected MCP servers
|
|
118
|
+
- String interpolation: Request context variables in system prompts now resolve correctly
|
|
119
|
+
|
|
3
120
|
## 1.30.0-alpha.1
|
|
4
121
|
|
|
5
122
|
### 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 chunkFAHETYAI_cjs = require('../../chunk-FAHETYAI.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 chunkWA4G4MJC_cjs = require('../../chunk-WA4G4MJC.cjs');
|
|
9
9
|
var chunkGLBBBSS5_cjs = require('../../chunk-GLBBBSS5.cjs');
|
|
10
10
|
var chunkNNRGAKKH_cjs = require('../../chunk-NNRGAKKH.cjs');
|
|
11
11
|
var chunk5RBU72CI_cjs = require('../../chunk-5RBU72CI.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-UDQYOIEQ.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 chunkFAHETYAI_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 chunkFAHETYAI_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 chunkFAHETYAI_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 chunkFAHETYAI_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 chunkWA4G4MJC_cjs.resolveModelConfig(modelConfigString, requestContext, mastra);
|
|
1401
1401
|
}
|
|
1402
|
-
return await
|
|
1402
|
+
return await chunkWA4G4MJC_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 chunkFAHETYAI_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 (!chunkFAHETYAI_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 chunkFAHETYAI_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 = chunkFAHETYAI_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 chunkFAHETYAI_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 chunkFAHETYAI_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 chunkFAHETYAI_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 chunkFAHETYAI_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 = chunkFAHETYAI_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 chunkFAHETYAI_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-UDQYOIEQ.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
|
+
chunkFAHETYAI_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 chunkFAHETYAI_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-WAHKXJC6.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-2UGZF32K.js';
|
|
7
7
|
import { InMemoryServerCache } from '../../chunk-CH66BRBG.js';
|
|
8
8
|
import { deepMerge } from '../../chunk-5A3PCABN.js';
|
|
9
9
|
import { createObservabilityContext } from '../../chunk-WA4XTORK.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-2NS3MIME.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-2NS3MIME.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 chunkFAHETYAI_cjs = require('../chunk-FAHETYAI.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 chunkFAHETYAI_cjs.Agent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TripWire", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkFAHETYAI_cjs.TripWire; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "isDurableAgentLike", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkFAHETYAI_cjs.isDurableAgentLike; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "isSupportedLanguageModel", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkFAHETYAI_cjs.isSupportedLanguageModel; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "resolveThreadIdFromArgs", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkFAHETYAI_cjs.resolveThreadIdFromArgs; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "supportedLanguageModelSpecifications", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkFAHETYAI_cjs.supportedLanguageModelSpecifications; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "tryGenerateWithJsonFallback", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkFAHETYAI_cjs.tryGenerateWithJsonFallback; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "tryStreamWithJsonFallback", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkFAHETYAI_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-WAHKXJC6.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 chunkFAHETYAI_cjs = require('../chunk-FAHETYAI.cjs');
|
|
4
4
|
var chunkYQR772OH_cjs = require('../chunk-YQR772OH.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) => !chunkFAHETYAI_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-WAHKXJC6.js';
|
|
2
2
|
export { BrowserCliHandler, browserCliHandler } from '../chunk-KGL33Q5K.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 chunkFAHETYAI_cjs = require('../chunk-FAHETYAI.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 chunkFAHETYAI_cjs.AgentChannels; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "ChatChannelProcessor", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkFAHETYAI_cjs.ChatChannelProcessor; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "MastraStateAdapter", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkFAHETYAI_cjs.MastraStateAdapter; }
|
|
18
18
|
});
|
|
19
19
|
//# sourceMappingURL=index.cjs.map
|
|
20
20
|
//# sourceMappingURL=index.cjs.map
|
package/dist/channels/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MastraGateway, PROVIDER_REGISTRY, GatewayRegistry } from './chunk-
|
|
2
|
-
import { ModelsDevGateway, parseModelRouterId } from './chunk-
|
|
3
|
-
import { NetlifyGateway } from './chunk-
|
|
4
|
-
import { createJsonErrorResponseHandler, lazyValidator, zodSchema, lazySchema, createProviderDefinedToolFactoryWithOutputSchema, createProviderDefinedToolFactory, withoutTrailingSlash, loadOptionalSetting, generateId, parseProviderOptions, combineHeaders, resolve, postJsonToApi, createJsonResponseHandler, createEventSourceResponseHandler, withUserAgentSuffix, loadApiKey, UnsupportedFunctionalityError, convertToBase64, APICallError, validateTypes, MastraModelGateway, createOpenAICompatible, createOpenAI, TooManyEmbeddingValuesForCallError, InvalidResponseDataError, isParsableJson, convertBase64ToUint8Array, mediaTypeToExtension, postFormDataToApi, createBinaryResponseHandler, InvalidPromptError, loadSetting, MASTRA_USER_AGENT } from './chunk-
|
|
1
|
+
import { MastraGateway, PROVIDER_REGISTRY, GatewayRegistry } from './chunk-U3IFSZTQ.js';
|
|
2
|
+
import { ModelsDevGateway, parseModelRouterId } from './chunk-54B23CPR.js';
|
|
3
|
+
import { NetlifyGateway } from './chunk-3ZNPHDSY.js';
|
|
4
|
+
import { createJsonErrorResponseHandler, lazyValidator, zodSchema, lazySchema, createProviderDefinedToolFactoryWithOutputSchema, createProviderDefinedToolFactory, withoutTrailingSlash, loadOptionalSetting, generateId, parseProviderOptions, combineHeaders, resolve, postJsonToApi, createJsonResponseHandler, createEventSourceResponseHandler, withUserAgentSuffix, loadApiKey, UnsupportedFunctionalityError, convertToBase64, APICallError, validateTypes, MastraModelGateway, createOpenAICompatible, createOpenAI, TooManyEmbeddingValuesForCallError, InvalidResponseDataError, isParsableJson, convertBase64ToUint8Array, mediaTypeToExtension, postFormDataToApi, createBinaryResponseHandler, InvalidPromptError, loadSetting, MASTRA_USER_AGENT } from './chunk-MHTNREIQ.js';
|
|
5
5
|
import { AISDKV5LanguageModel, createStreamFromGenerateResult } from './chunk-45VS53US.js';
|
|
6
6
|
import { InMemoryServerCache } from './chunk-CH66BRBG.js';
|
|
7
7
|
import { MastraError } from './chunk-FJEVLHJT.js';
|
|
@@ -11887,5 +11887,5 @@ var ModelRouterEmbeddingModel = class {
|
|
|
11887
11887
|
};
|
|
11888
11888
|
|
|
11889
11889
|
export { AzureOpenAIGateway, EMBEDDING_MODELS, ModelRouterEmbeddingModel, ModelRouterLanguageModel, defaultGateways, resolveModelConfig };
|
|
11890
|
-
//# sourceMappingURL=chunk-
|
|
11891
|
-
//# sourceMappingURL=chunk-
|
|
11890
|
+
//# sourceMappingURL=chunk-2UGZF32K.js.map
|
|
11891
|
+
//# sourceMappingURL=chunk-2UGZF32K.js.map
|