@mastra/core 1.32.0-alpha.4 → 1.32.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +176 -0
  2. package/dist/agent/durable/index.cjs +22 -22
  3. package/dist/agent/durable/index.js +4 -4
  4. package/dist/agent/index.cjs +9 -9
  5. package/dist/agent/index.js +1 -1
  6. package/dist/browser/index.cjs +2 -2
  7. package/dist/browser/index.js +1 -1
  8. package/dist/channels/index.cjs +4 -4
  9. package/dist/channels/index.js +1 -1
  10. package/dist/{chunk-FLIEIN4W.js → chunk-2RXMQLX7.js} +4 -4
  11. package/dist/{chunk-FLIEIN4W.js.map → chunk-2RXMQLX7.js.map} +1 -1
  12. package/dist/{chunk-Y7Y7XTC3.cjs → chunk-3DIJ3TQS.cjs} +12 -12
  13. package/dist/{chunk-Y7Y7XTC3.cjs.map → chunk-3DIJ3TQS.cjs.map} +1 -1
  14. package/dist/{chunk-75EPJWR4.js → chunk-4FQ5HEEG.js} +3 -3
  15. package/dist/{chunk-75EPJWR4.js.map → chunk-4FQ5HEEG.js.map} +1 -1
  16. package/dist/{chunk-5LFEKTKW.js → chunk-5VJTKVXF.js} +3 -3
  17. package/dist/chunk-5VJTKVXF.js.map +1 -0
  18. package/dist/{chunk-RHIJ2KER.js → chunk-AF3BGEBT.js} +8 -8
  19. package/dist/{chunk-RHIJ2KER.js.map → chunk-AF3BGEBT.js.map} +1 -1
  20. package/dist/{chunk-ADRMFY6S.cjs → chunk-CTWPJGFQ.cjs} +9 -9
  21. package/dist/{chunk-ADRMFY6S.cjs.map → chunk-CTWPJGFQ.cjs.map} +1 -1
  22. package/dist/{chunk-OQGVZ27D.cjs → chunk-F3PTR2CN.cjs} +7 -7
  23. package/dist/{chunk-OQGVZ27D.cjs.map → chunk-F3PTR2CN.cjs.map} +1 -1
  24. package/dist/{chunk-5J57XXWT.cjs → chunk-K6PAVEJM.cjs} +22 -22
  25. package/dist/{chunk-5J57XXWT.cjs.map → chunk-K6PAVEJM.cjs.map} +1 -1
  26. package/dist/{chunk-RSSSVR6V.cjs → chunk-NNV6BI2Y.cjs} +7 -7
  27. package/dist/{chunk-RSSSVR6V.cjs.map → chunk-NNV6BI2Y.cjs.map} +1 -1
  28. package/dist/{chunk-74VWZNIJ.js → chunk-PQYP7GQ5.js} +3 -3
  29. package/dist/{chunk-74VWZNIJ.js.map → chunk-PQYP7GQ5.js.map} +1 -1
  30. package/dist/{chunk-CXLJMMNS.js → chunk-PX7T4PC6.js} +3 -3
  31. package/dist/{chunk-CXLJMMNS.js.map → chunk-PX7T4PC6.js.map} +1 -1
  32. package/dist/{chunk-CVUG676Y.cjs → chunk-RSDFW5HF.cjs} +389 -389
  33. package/dist/{chunk-CVUG676Y.cjs.map → chunk-RSDFW5HF.cjs.map} +1 -1
  34. package/dist/{chunk-IQVOBTY4.js → chunk-RVIBAGE6.js} +3 -3
  35. package/dist/{chunk-IQVOBTY4.js.map → chunk-RVIBAGE6.js.map} +1 -1
  36. package/dist/{chunk-HO6VPMZN.js → chunk-SHGUKDQZ.js} +6 -6
  37. package/dist/{chunk-HO6VPMZN.js.map → chunk-SHGUKDQZ.js.map} +1 -1
  38. package/dist/{chunk-LBIDF2YJ.js → chunk-UDNQPUQT.js} +9 -9
  39. package/dist/{chunk-LBIDF2YJ.js.map → chunk-UDNQPUQT.js.map} +1 -1
  40. package/dist/{chunk-AQ76QTTR.cjs → chunk-UHNI2YJT.cjs} +59 -59
  41. package/dist/{chunk-AQ76QTTR.cjs.map → chunk-UHNI2YJT.cjs.map} +1 -1
  42. package/dist/{chunk-S55ONBEL.cjs → chunk-W6CUCCSU.cjs} +224 -224
  43. package/dist/{chunk-S55ONBEL.cjs.map → chunk-W6CUCCSU.cjs.map} +1 -1
  44. package/dist/{chunk-K3JQID5H.cjs → chunk-X3QQBZTZ.cjs} +3 -3
  45. package/dist/chunk-X3QQBZTZ.cjs.map +1 -0
  46. package/dist/{chunk-IUE5KFHI.cjs → chunk-X6QCOFLV.cjs} +5 -5
  47. package/dist/{chunk-IUE5KFHI.cjs.map → chunk-X6QCOFLV.cjs.map} +1 -1
  48. package/dist/{chunk-V2WXYYBV.cjs → chunk-XCHWDKHQ.cjs} +20 -20
  49. package/dist/{chunk-V2WXYYBV.cjs.map → chunk-XCHWDKHQ.cjs.map} +1 -1
  50. package/dist/{chunk-OQIQB4L5.js → chunk-Y54HBV7I.js} +4 -4
  51. package/dist/{chunk-OQIQB4L5.js.map → chunk-Y54HBV7I.js.map} +1 -1
  52. package/dist/{chunk-NWF3HQEM.js → chunk-ZJC3HACG.js} +3 -3
  53. package/dist/{chunk-NWF3HQEM.js.map → chunk-ZJC3HACG.js.map} +1 -1
  54. package/dist/datasets/index.cjs +11 -11
  55. package/dist/datasets/index.js +1 -1
  56. package/dist/docs/SKILL.md +1 -1
  57. package/dist/docs/assets/SOURCE_MAP.json +146 -146
  58. package/dist/evals/index.cjs +6 -6
  59. package/dist/evals/index.js +2 -2
  60. package/dist/evals/scoreTraces/index.cjs +3 -3
  61. package/dist/evals/scoreTraces/index.js +1 -1
  62. package/dist/harness/index.cjs +7 -7
  63. package/dist/harness/index.js +5 -5
  64. package/dist/index.cjs +2 -2
  65. package/dist/index.js +1 -1
  66. package/dist/llm/index.cjs +20 -20
  67. package/dist/llm/index.js +5 -5
  68. package/dist/loop/index.cjs +14 -14
  69. package/dist/loop/index.js +1 -1
  70. package/dist/mastra/index.cjs +2 -2
  71. package/dist/mastra/index.js +1 -1
  72. package/dist/mastra-CENQLMA6.js +3 -0
  73. package/dist/{mastra-4NMQMNJS.js.map → mastra-CENQLMA6.js.map} +1 -1
  74. package/dist/mastra-PJ7PYLZ6.cjs +12 -0
  75. package/dist/{mastra-VJJNUFUS.cjs.map → mastra-PJ7PYLZ6.cjs.map} +1 -1
  76. package/dist/memory/index.cjs +19 -19
  77. package/dist/memory/index.js +1 -1
  78. package/dist/models-dev-5SC3L3PB.js +3 -0
  79. package/dist/{models-dev-TDWFZOD4.js.map → models-dev-5SC3L3PB.js.map} +1 -1
  80. package/dist/models-dev-WOAKARBQ.cjs +12 -0
  81. package/dist/{models-dev-FGWYMB42.cjs.map → models-dev-WOAKARBQ.cjs.map} +1 -1
  82. package/dist/netlify-ILOH4ELW.cjs +12 -0
  83. package/dist/{netlify-BMUCSHX6.cjs.map → netlify-ILOH4ELW.cjs.map} +1 -1
  84. package/dist/netlify-MWWN7KT6.js +3 -0
  85. package/dist/{netlify-2WCEQODZ.js.map → netlify-MWWN7KT6.js.map} +1 -1
  86. package/dist/processor-provider/index.cjs +10 -10
  87. package/dist/processor-provider/index.js +1 -1
  88. package/dist/processors/index.cjs +51 -51
  89. package/dist/processors/index.js +1 -1
  90. package/dist/provider-registry-4SRAXFDR.cjs +44 -0
  91. package/dist/{provider-registry-Z2KJ2LEC.cjs.map → provider-registry-4SRAXFDR.cjs.map} +1 -1
  92. package/dist/provider-registry-F6SO6FHQ.js +3 -0
  93. package/dist/{provider-registry-PV3SULLN.js.map → provider-registry-F6SO6FHQ.js.map} +1 -1
  94. package/dist/relevance/index.cjs +3 -3
  95. package/dist/relevance/index.js +1 -1
  96. package/dist/runner-AUMIO4LP.cjs +16 -0
  97. package/dist/{runner-4LIHTAFO.cjs.map → runner-AUMIO4LP.cjs.map} +1 -1
  98. package/dist/runner-XMNVMZFT.js +3 -0
  99. package/dist/{runner-PHF7QBVS.js.map → runner-XMNVMZFT.js.map} +1 -1
  100. package/dist/stream/index.cjs +11 -11
  101. package/dist/stream/index.js +1 -1
  102. package/dist/tool-loop-agent/index.cjs +4 -4
  103. package/dist/tool-loop-agent/index.js +1 -1
  104. package/dist/workflows/evented/index.cjs +10 -10
  105. package/dist/workflows/evented/index.js +1 -1
  106. package/dist/workflows/index.cjs +28 -28
  107. package/dist/workflows/index.js +1 -1
  108. package/package.json +9 -9
  109. package/dist/chunk-5LFEKTKW.js.map +0 -1
  110. package/dist/chunk-K3JQID5H.cjs.map +0 -1
  111. package/dist/mastra-4NMQMNJS.js +0 -3
  112. package/dist/mastra-VJJNUFUS.cjs +0 -12
  113. package/dist/models-dev-FGWYMB42.cjs +0 -12
  114. package/dist/models-dev-TDWFZOD4.js +0 -3
  115. package/dist/netlify-2WCEQODZ.js +0 -3
  116. package/dist/netlify-BMUCSHX6.cjs +0 -12
  117. package/dist/provider-registry-PV3SULLN.js +0 -3
  118. package/dist/provider-registry-Z2KJ2LEC.cjs +0 -44
  119. package/dist/runner-4LIHTAFO.cjs +0 -16
  120. package/dist/runner-PHF7QBVS.js +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,181 @@
1
1
  # @mastra/core
2
2
 
3
+ ## 1.32.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added Fine-Grained Authorization (FGA) support for relationship-based, resource-level access control. FGA answers "can this user perform this action on this specific resource?" — enabling multi-tenant isolation and per-resource permissions. ([#15410](https://github.com/mastra-ai/mastra/pull/15410))
8
+
9
+ **New interfaces:** `IFGAProvider` (read-only checks) and `IFGAManager` (read + write operations) with types for access checks, resources, and role assignments.
10
+
11
+ **Enforcement at all execution points:** FGA checks are automatically enforced before agent execution (`generate()`, `stream()`), tool execution, workflow execution, and memory thread access. When no FGA provider is configured, all checks are skipped (backward compatible).
12
+
13
+ **New utility:** `checkFGA()` provides centralized FGA enforcement with `FGADeniedError` for denied checks. `MastraMemory.checkThreadFGA()` adds thread-level access control.
14
+
15
+ **Request-aware authorization:** Resource ID resolvers receive request context so route-level FGA checks can derive tenant- or request-scoped resource IDs.
16
+
17
+ **Typed permission constants:** Strongly-typed permission identifiers (e.g. `'agents:execute'`, `'workflows:execute'`, `'memory:threads:read'`) for use in authorization config and `permissionMapping`.
18
+
19
+ ```typescript
20
+ const mastra = new Mastra({
21
+ server: {
22
+ fga: new MastraFGAWorkos({ apiKey, clientId }),
23
+ },
24
+ });
25
+ ```
26
+
27
+ - Extend the schedules storage schema to support owned schedules and richer trigger audit. This is a breaking schema change to `mastra_schedules` and `mastra_schedule_triggers`; scheduled workflows are still in alpha so no compat shim is provided. ([#16166](https://github.com/mastra-ai/mastra/pull/16166))
28
+ - `Schedule` gains optional `ownerType` / `ownerId` so a schedule row can be attributed to an owning subsystem (e.g. an agent that owns a heartbeat schedule). Workflow schedules leave both fields unset.
29
+ - `ScheduleTrigger.status` is renamed to `outcome` and the type is widened to `ScheduleTriggerOutcome` so future outcome values can be added without another rename.
30
+ - `ScheduleTrigger` gains a stable `id` primary key and new `triggerKind`, `parentTriggerId`, and `metadata` fields. `triggerKind` distinguishes `schedule-fire` rows from later `queue-drain` rows (used by upcoming heartbeat work); `parentTriggerId` links related rows; `metadata` carries outcome-specific context.
31
+ - The libsql, pg, and mongodb adapters all add the new columns/indexes. Their `@mastra/core` peer dependency is tightened to `>=1.32.0-0 <2.0.0-0` so installing a new storage adapter against an older core (or vice-versa) surfaces a peer-dependency warning at install time instead of silently writing/reading the wrong field.
32
+ - Scheduler producer, server schemas/handler, and client SDK types are updated to use the new fields. The `triggers` response on `GET /api/schedules/:id/triggers` now returns `outcome` instead of `status`.
33
+ - The bundled Studio (Mastra CLI) is updated to read `outcome` so the schedule detail page keeps polling and rendering publish-failure rows correctly.
34
+
35
+ - Added `listResources()` and `readResource()` abstract methods to `MCPServerBase`, enabling MCP servers to expose app resources. These resources power interactive UI rendering (MCP Apps) in Studio and other consumers. ([#16004](https://github.com/mastra-ai/mastra/pull/16004))
36
+
37
+ - Added `count_distinct` aggregation and server-side TopK to the metrics storage API so dashboards built on high-cardinality fields (like `threadId` or `resourceId`) stay fast and bounded. ([#16137](https://github.com/mastra-ai/mastra/pull/16137))
38
+
39
+ **New aggregation**
40
+
41
+ `getMetricAggregate`, `getMetricBreakdown`, and `getMetricTimeSeries` accept `aggregation: 'count_distinct'` with a `distinctColumn`. Backends pick the most efficient native implementation — `uniq` on ClickHouse, `approx_count_distinct` on DuckDB.
42
+
43
+ `distinctColumn` is restricted to a low/medium-cardinality categorical allowlist (`entityType`, `entityName`, `parentEntityType`, `parentEntityName`, `rootEntityType`, `rootEntityName`, `name`, `provider`, `model`, `environment`, `executionSource`, `serviceName`). ID columns are not allowed — distinct counts over near-unique values converge to the row count and are rarely useful.
44
+
45
+ ```ts
46
+ await store.getMetricAggregate({
47
+ name: ['mastra_llm_tokens_total'],
48
+ aggregation: 'count_distinct',
49
+ distinctColumn: 'model',
50
+ filters: { timestamp: { start, end } },
51
+ });
52
+ ```
53
+
54
+ **Server-side TopK**
55
+
56
+ `getMetricBreakdown` accepts `limit` and `orderDirection`, so breakdowns never return the full cardinality of a column from the database. Ordering is always by the aggregated `value`; `orderDirection` flips between top-N (`DESC`, default) and bottom-N (`ASC`).
57
+
58
+ ```ts
59
+ await store.getMetricBreakdown({
60
+ name: ['mastra_agent_duration_ms'],
61
+ aggregation: 'sum',
62
+ groupBy: ['threadId'],
63
+ limit: 20,
64
+ orderDirection: 'DESC',
65
+ });
66
+ ```
67
+
68
+ - Added RegexFilterProcessor — a zero-cost regex-based content filter for blocking, redacting, or warning on pattern matches in agent messages. Includes built-in presets for PII, secrets, URLs, and prompt injection patterns. Supports input, output, and streaming phases. ([#16058](https://github.com/mastra-ai/mastra/pull/16058))
69
+
70
+ - Added scheduled workflows. Declare a `schedule` on `createWorkflow` and Mastra fires the workflow on cron with no extra wiring. ([#15830](https://github.com/mastra-ai/mastra/pull/15830))
71
+
72
+ ```typescript
73
+ import { createWorkflow } from '@mastra/core/workflows';
74
+
75
+ const dailyReport = createWorkflow({
76
+ id: 'daily-report',
77
+ inputSchema: z.object({ date: z.string() }),
78
+ outputSchema: z.object({ summary: z.string() }),
79
+ schedule: {
80
+ cron: '0 9 * * *',
81
+ timezone: 'America/Los_Angeles',
82
+ inputData: { date: 'today' },
83
+ },
84
+ })
85
+ .then(/* steps */)
86
+ .commit();
87
+ ```
88
+
89
+ A workflow with a `schedule` is auto-promoted to the evented engine, so scheduled fires share the same execution path as manual `start()` calls. `inputData`, `initialState`, and `requestContext` on the schedule are type-checked against the workflow's schemas at definition time. Pass an array of schedules with stable `id`s to fire one workflow on multiple crons.
90
+
91
+ Mastra auto-instantiates a `WorkflowScheduler` when any registered workflow declares a `schedule`. The scheduler claims due schedules via compare-and-swap, so multiple instances polling the same storage cannot double-fire. Projects with no scheduled workflows pay zero cost. Configure with `new Mastra({ scheduler: { tickIntervalMs, batchSize, enabled, onError } })`.
92
+
93
+ Requires a storage adapter that implements the new `schedules` domain (`@mastra/libsql` and `@mastra/pg` ship adapters; `InMemorySchedulesStorage` is included for tests). Adds a `croner` dependency.
94
+
95
+ - Added MCP Apps extension support (SEP-1865). MCPServer now accepts an `appResources` config to register interactive `ui://` HTML resources. MCPClient preserves full tool `_meta` (including `ui.resourceUri`) when converting MCP tools to Mastra tools. Both advertise the `io.modelcontextprotocol/ui` extension capability. ([#16004](https://github.com/mastra-ai/mastra/pull/16004))
96
+
97
+ **Example — MCPServer with app resources:**
98
+
99
+ ```typescript
100
+ const server = new MCPServer({
101
+ name: 'my-server',
102
+ tools: { myTool },
103
+ appResources: {
104
+ dashboard: {
105
+ name: 'Dashboard',
106
+ description: 'Interactive dashboard UI',
107
+ html: '<html>...</html>',
108
+ },
109
+ },
110
+ });
111
+ ```
112
+
113
+ - Added `CostGuardProcessor`, a built-in processor for enforcing monetary cost limits across agent runs. Supports run, resource, and thread scopes with configurable time windows (default 7 days), blocking or warning when limits are reached. Also added `onViolation` callback to the base `Processor` interface for generalized violation handling across all processors. ([#16057](https://github.com/mastra-ai/mastra/pull/16057))
114
+
115
+ ```typescript
116
+ import { Agent } from '@mastra/core/agent';
117
+ import { CostGuardProcessor } from '@mastra/core/processors';
118
+
119
+ const costGuard = new CostGuardProcessor({
120
+ maxCost: 5.0,
121
+ scope: 'resource',
122
+ window: '24h',
123
+ strategy: 'block',
124
+ });
125
+
126
+ costGuard.onViolation = ({ processorId, message, detail }) => {
127
+ console.log(`[${processorId}] ${message}`, detail);
128
+ };
129
+
130
+ const agent = new Agent({
131
+ name: 'my-agent',
132
+ model: 'openai/gpt-5-nano',
133
+ inputProcessors: [costGuard],
134
+ });
135
+ ```
136
+
137
+ - **Added** `listBranches` and `getBranch` for querying named-entity invocations across traces, including nested ones. `listTraces` only returns root-rooted traces, so an entity that always runs as a child (e.g., an `Observer` agent inside a workflow) wasn't queryable before. ([#16154](https://github.com/mastra-ai/mastra/pull/16154))
138
+
139
+ ```ts
140
+ // Before: nested-only entities returned nothing
141
+ await store.listTraces({ filters: { entityName: 'Observer' } }); // []
142
+
143
+ // After: one row per AGENT_RUN, WORKFLOW_RUN, PROCESSOR_RUN, SCORER_RUN,
144
+ // RAG_INGESTION, TOOL_CALL, or MCP_TOOL_CALL span
145
+ await store.listBranches({ filters: { entityName: 'Observer' } });
146
+
147
+ // Plus: fetch the subtree at any span, with optional depth
148
+ const branch = await store.getBranch({ traceId, spanId, depth: 1 });
149
+ ```
150
+
151
+ **Added** `getStructure({ traceId })` (canonical name for the lightweight trace skeleton; `getTraceLight` retained as a deprecated alias) and `getSpans({ traceId, spanIds })` (batch-fetch spans by id, used internally by `getBranch` to avoid pulling whole traces).
152
+
153
+ ### Patch Changes
154
+
155
+ - Update provider registry and model documentation with latest models and providers ([`6dcd65f`](https://github.com/mastra-ai/mastra/commit/6dcd65f2a34069e6dc43ba35f1d11119b9b40bef))
156
+
157
+ - Fixed Harness token usage so provider-reported totals, reasoning tokens, and cache token fields are preserved. Fixes https://github.com/mastra-ai/mastra/issues/16055 ([#16072](https://github.com/mastra-ai/mastra/pull/16072))
158
+
159
+ - Fixed supervisor output processors so they can filter streamed chunks from delegated sub-agents. ([#16071](https://github.com/mastra-ai/mastra/pull/16071))
160
+
161
+ - Fixed Observational Memory model resolution for user-defined gateways. Models such as `cloudflare/google/gemini-2.5-flash-lite` now resolve through registered gateways instead of failing with provider-config errors. Closes #13841. ([#16083](https://github.com/mastra-ai/mastra/pull/16083))
162
+
163
+ - Fixed model step traces to show the final prompt sent to the model, including memory-injected system messages. ([#16029](https://github.com/mastra-ai/mastra/pull/16029))
164
+
165
+ - Fixed tool results dropping provider metadata from the original tool call. ([#16078](https://github.com/mastra-ai/mastra/pull/16078))
166
+
167
+ - Fixed workflow request context serialization to skip values that cannot be safely stored as JSON. Fixes #16043. ([#16061](https://github.com/mastra-ai/mastra/pull/16061))
168
+
169
+ - Fix buildResumedBlockResult returning suspended instead of failed when a step throws after resume in a parallel or conditional block ([#14410](https://github.com/mastra-ai/mastra/pull/14410))
170
+
171
+ - Fixed serializeRequestContext to handle plain Map instances passed as requestContext, restoring backward compatibility broken in #16061 ([#16081](https://github.com/mastra-ai/mastra/pull/16081))
172
+
173
+ - Added direct score lookup support to observability storage so score records can be fetched by `scoreId` without scanning paginated score lists, including DuckDB and ClickHouse vNext observability stores. ([#16162](https://github.com/mastra-ai/mastra/pull/16162))
174
+
175
+ - fix(harness): use type 'image' and mimeType for image parts in convertToHarnessMessage to fix Gemini image recognition ([#13917](https://github.com/mastra-ai/mastra/pull/13917))
176
+
177
+ - Fixed TokenLimiterProcessor failing silently when no input messages fit the token budget. ([#16063](https://github.com/mastra-ai/mastra/pull/16063))
178
+
3
179
  ## 1.32.0-alpha.4
4
180
 
5
181
  ### Minor Changes
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkW7D53JMX_cjs = require('../../chunk-W7D53JMX.cjs');
4
- var chunkY7Y7XTC3_cjs = require('../../chunk-Y7Y7XTC3.cjs');
4
+ var chunk3DIJ3TQS_cjs = require('../../chunk-3DIJ3TQS.cjs');
5
5
  var chunkZCBG4ZQT_cjs = require('../../chunk-ZCBG4ZQT.cjs');
6
6
  var chunkNAOSC6FH_cjs = require('../../chunk-NAOSC6FH.cjs');
7
7
  var chunkHM6XXOV2_cjs = require('../../chunk-HM6XXOV2.cjs');
8
- var chunkCVUG676Y_cjs = require('../../chunk-CVUG676Y.cjs');
8
+ var chunkRSDFW5HF_cjs = require('../../chunk-RSDFW5HF.cjs');
9
9
  var chunkGLBBBSS5_cjs = require('../../chunk-GLBBBSS5.cjs');
10
10
  var chunkRJK2C4PL_cjs = require('../../chunk-RJK2C4PL.cjs');
11
11
  var chunkCDN65CUN_cjs = require('../../chunk-CDN65CUN.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-4LIHTAFO.cjs');
548
+ const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-AUMIO4LP.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 chunkY7Y7XTC3_cjs.SaveQueueManager({
598
+ const saveQueueManager = memory ? new chunk3DIJ3TQS_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 chunkY7Y7XTC3_cjs.MastraModelOutput({
959
+ const output = new chunk3DIJ3TQS_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 chunkY7Y7XTC3_cjs.createStep({
1191
+ return chunk3DIJ3TQS_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 chunkY7Y7XTC3_cjs.SaveQueueManager({
1320
+ saveQueueManager = new chunk3DIJ3TQS_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 chunkCVUG676Y_cjs.resolveModelConfig(modelConfigString, requestContext, mastra);
1400
+ return await chunkRSDFW5HF_cjs.resolveModelConfig(modelConfigString, requestContext, mastra);
1401
1401
  }
1402
- return await chunkCVUG676Y_cjs.resolveModelConfig(
1402
+ return await chunkRSDFW5HF_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 chunkY7Y7XTC3_cjs.createStep({
1475
+ return chunk3DIJ3TQS_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 (!chunkY7Y7XTC3_cjs.isSupportedLanguageModel(model)) {
1513
+ if (!chunk3DIJ3TQS_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 chunkY7Y7XTC3_cjs.ProcessorRunner({
1543
+ const runner = new chunk3DIJ3TQS_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 = chunkY7Y7XTC3_cjs.execute({
1591
+ const modelResult = chunk3DIJ3TQS_cjs.execute({
1592
1592
  runId,
1593
1593
  model: currentModel,
1594
1594
  inputMessages,
@@ -1616,7 +1616,7 @@ function createDurableLLMExecutionStep(_options) {
1616
1616
  }
1617
1617
  }
1618
1618
  });
1619
- const outputStream = new chunkY7Y7XTC3_cjs.MastraModelOutput({
1619
+ const outputStream = new chunk3DIJ3TQS_cjs.MastraModelOutput({
1620
1620
  model: {
1621
1621
  modelId: currentModel.modelId,
1622
1622
  provider: currentModel.provider,
@@ -1797,7 +1797,7 @@ function createDurableLLMExecutionStep(_options) {
1797
1797
  const registryEntry = globalRunRegistry.get(runId);
1798
1798
  if (registryEntry?.errorProcessors?.length) {
1799
1799
  try {
1800
- const runner = new chunkY7Y7XTC3_cjs.ProcessorRunner({
1800
+ const runner = new chunk3DIJ3TQS_cjs.ProcessorRunner({
1801
1801
  inputProcessors: registryEntry.inputProcessors ?? [],
1802
1802
  outputProcessors: registryEntry.outputProcessors ?? [],
1803
1803
  errorProcessors: registryEntry.errorProcessors,
@@ -1883,7 +1883,7 @@ async function flushMessagesBeforeSuspension({
1883
1883
  }
1884
1884
  }
1885
1885
  function createDurableToolCallStep() {
1886
- return chunkY7Y7XTC3_cjs.createStep({
1886
+ return chunk3DIJ3TQS_cjs.createStep({
1887
1887
  id: DurableStepIds.TOOL_CALL,
1888
1888
  inputSchema: durableToolCallInputSchema,
1889
1889
  outputSchema: durableToolCallOutputSchema,
@@ -2348,7 +2348,7 @@ var durableLLMMappingOutputSchema = zod.z.object({
2348
2348
  processorRetryFeedback: zod.z.string().optional()
2349
2349
  });
2350
2350
  function createDurableLLMMappingStep() {
2351
- return chunkY7Y7XTC3_cjs.createStep({
2351
+ return chunk3DIJ3TQS_cjs.createStep({
2352
2352
  id: DurableStepIds.LLM_MAPPING,
2353
2353
  inputSchema: durableLLMMappingInputSchema,
2354
2354
  outputSchema: durableLLMMappingOutputSchema,
@@ -2455,7 +2455,7 @@ function createDurableAgenticWorkflow(options) {
2455
2455
  const toolCallStep = createDurableToolCallStep();
2456
2456
  const llmMappingStep = createDurableLLMMappingStep();
2457
2457
  const backgroundTaskCheckStep = createDurableBackgroundTaskCheckStep();
2458
- const singleIterationWorkflow = chunkY7Y7XTC3_cjs.createWorkflow({
2458
+ const singleIterationWorkflow = chunk3DIJ3TQS_cjs.createWorkflow({
2459
2459
  id: DurableStepIds.AGENTIC_EXECUTION,
2460
2460
  inputSchema: iterationStateSchema,
2461
2461
  outputSchema: iterationStateSchema,
@@ -2518,7 +2518,7 @@ function createDurableAgenticWorkflow(options) {
2518
2518
  },
2519
2519
  { id: "update-iteration-state" }
2520
2520
  ).commit();
2521
- return chunkY7Y7XTC3_cjs.createWorkflow({
2521
+ return chunk3DIJ3TQS_cjs.createWorkflow({
2522
2522
  id: DurableStepIds.AGENTIC_LOOP,
2523
2523
  inputSchema: durableAgenticInputSchema,
2524
2524
  outputSchema: durableAgenticOutputSchema,
@@ -2561,7 +2561,7 @@ function createDurableAgenticWorkflow(options) {
2561
2561
  const registryEntry = globalRunRegistry.get(state.runId);
2562
2562
  if (registryEntry?.outputProcessors?.length) {
2563
2563
  try {
2564
- const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-4LIHTAFO.cjs');
2564
+ const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-AUMIO4LP.cjs');
2565
2565
  const runner = new ProcessorRunner2({
2566
2566
  inputProcessors: registryEntry.inputProcessors ?? [],
2567
2567
  outputProcessors: registryEntry.outputProcessors,
@@ -2659,7 +2659,7 @@ function createDurableAgenticWorkflow(options) {
2659
2659
  scorer,
2660
2660
  sampling
2661
2661
  };
2662
- chunkY7Y7XTC3_cjs.runScorer({
2662
+ chunk3DIJ3TQS_cjs.runScorer({
2663
2663
  runId: initData.runId,
2664
2664
  scorerId: scorerKey,
2665
2665
  scorerObject,
@@ -2692,7 +2692,7 @@ function createDurableAgenticWorkflow(options) {
2692
2692
  }
2693
2693
 
2694
2694
  // src/agent/durable/durable-agent.ts
2695
- var DurableAgent = class extends chunkY7Y7XTC3_cjs.Agent {
2695
+ var DurableAgent = class extends chunk3DIJ3TQS_cjs.Agent {
2696
2696
  /** The wrapped agent */
2697
2697
  #wrappedAgent;
2698
2698
  /** 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-75EPJWR4.js';
2
+ import { SaveQueueManager, MastraModelOutput, createStep, isSupportedLanguageModel, ProcessorRunner, execute, createWorkflow, runScorer, Agent } from '../../chunk-4FQ5HEEG.js';
3
3
  import { PUBSUB_SYMBOL } from '../../chunk-2QXNHEDL.js';
4
4
  import { MessageList } from '../../chunk-4ROHEPMI.js';
5
5
  import { EventEmitterPubSub } from '../../chunk-4E5FOY4E.js';
6
- import { resolveModelConfig } from '../../chunk-HO6VPMZN.js';
6
+ import { resolveModelConfig } from '../../chunk-SHGUKDQZ.js';
7
7
  import { InMemoryServerCache } from '../../chunk-CH66BRBG.js';
8
8
  import { deepMerge } from '../../chunk-T7UICTBA.js';
9
9
  import { createObservabilityContext } from '../../chunk-2NDJVX5U.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-PHF7QBVS.js');
546
+ const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-XMNVMZFT.js');
547
547
  const runner = new ProcessorRunner2({
548
548
  inputProcessors,
549
549
  outputProcessors,
@@ -2559,7 +2559,7 @@ function createDurableAgenticWorkflow(options) {
2559
2559
  const registryEntry = globalRunRegistry.get(state.runId);
2560
2560
  if (registryEntry?.outputProcessors?.length) {
2561
2561
  try {
2562
- const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-PHF7QBVS.js');
2562
+ const { ProcessorRunner: ProcessorRunner2 } = await import('../../runner-XMNVMZFT.js');
2563
2563
  const runner = new ProcessorRunner2({
2564
2564
  inputProcessors: registryEntry.inputProcessors ?? [],
2565
2565
  outputProcessors: registryEntry.outputProcessors,
@@ -1,41 +1,41 @@
1
1
  'use strict';
2
2
 
3
- var chunkY7Y7XTC3_cjs = require('../chunk-Y7Y7XTC3.cjs');
3
+ var chunk3DIJ3TQS_cjs = require('../chunk-3DIJ3TQS.cjs');
4
4
  var chunkNAOSC6FH_cjs = require('../chunk-NAOSC6FH.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Agent", {
9
9
  enumerable: true,
10
- get: function () { return chunkY7Y7XTC3_cjs.Agent; }
10
+ get: function () { return chunk3DIJ3TQS_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "TripWire", {
13
13
  enumerable: true,
14
- get: function () { return chunkY7Y7XTC3_cjs.TripWire; }
14
+ get: function () { return chunk3DIJ3TQS_cjs.TripWire; }
15
15
  });
16
16
  Object.defineProperty(exports, "isDurableAgentLike", {
17
17
  enumerable: true,
18
- get: function () { return chunkY7Y7XTC3_cjs.isDurableAgentLike; }
18
+ get: function () { return chunk3DIJ3TQS_cjs.isDurableAgentLike; }
19
19
  });
20
20
  Object.defineProperty(exports, "isSupportedLanguageModel", {
21
21
  enumerable: true,
22
- get: function () { return chunkY7Y7XTC3_cjs.isSupportedLanguageModel; }
22
+ get: function () { return chunk3DIJ3TQS_cjs.isSupportedLanguageModel; }
23
23
  });
24
24
  Object.defineProperty(exports, "resolveThreadIdFromArgs", {
25
25
  enumerable: true,
26
- get: function () { return chunkY7Y7XTC3_cjs.resolveThreadIdFromArgs; }
26
+ get: function () { return chunk3DIJ3TQS_cjs.resolveThreadIdFromArgs; }
27
27
  });
28
28
  Object.defineProperty(exports, "supportedLanguageModelSpecifications", {
29
29
  enumerable: true,
30
- get: function () { return chunkY7Y7XTC3_cjs.supportedLanguageModelSpecifications; }
30
+ get: function () { return chunk3DIJ3TQS_cjs.supportedLanguageModelSpecifications; }
31
31
  });
32
32
  Object.defineProperty(exports, "tryGenerateWithJsonFallback", {
33
33
  enumerable: true,
34
- get: function () { return chunkY7Y7XTC3_cjs.tryGenerateWithJsonFallback; }
34
+ get: function () { return chunk3DIJ3TQS_cjs.tryGenerateWithJsonFallback; }
35
35
  });
36
36
  Object.defineProperty(exports, "tryStreamWithJsonFallback", {
37
37
  enumerable: true,
38
- get: function () { return chunkY7Y7XTC3_cjs.tryStreamWithJsonFallback; }
38
+ get: function () { return chunk3DIJ3TQS_cjs.tryStreamWithJsonFallback; }
39
39
  });
40
40
  Object.defineProperty(exports, "MessageList", {
41
41
  enumerable: true,
@@ -1,4 +1,4 @@
1
- export { Agent, TripWire, isDurableAgentLike, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-75EPJWR4.js';
1
+ export { Agent, TripWire, isDurableAgentLike, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-4FQ5HEEG.js';
2
2
  export { MessageList, TypeDetector, aiV5ModelMessageToV2PromptMessage, convertMessages } from '../chunk-4ROHEPMI.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkY7Y7XTC3_cjs = require('../chunk-Y7Y7XTC3.cjs');
3
+ var chunk3DIJ3TQS_cjs = require('../chunk-3DIJ3TQS.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) => !chunkY7Y7XTC3_cjs.isProcessorWorkflow(p) && "id" in p && p.id === "browser-context"
1194
+ (p) => !chunk3DIJ3TQS_cjs.isProcessorWorkflow(p) && "id" in p && p.id === "browser-context"
1195
1195
  );
1196
1196
  if (hasProcessor) return [];
1197
1197
  return [new BrowserContextProcessor()];
@@ -1,4 +1,4 @@
1
- import { isProcessorWorkflow } from '../chunk-75EPJWR4.js';
1
+ import { isProcessorWorkflow } from '../chunk-4FQ5HEEG.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';
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var chunkY7Y7XTC3_cjs = require('../chunk-Y7Y7XTC3.cjs');
3
+ var chunk3DIJ3TQS_cjs = require('../chunk-3DIJ3TQS.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "AgentChannels", {
8
8
  enumerable: true,
9
- get: function () { return chunkY7Y7XTC3_cjs.AgentChannels; }
9
+ get: function () { return chunk3DIJ3TQS_cjs.AgentChannels; }
10
10
  });
11
11
  Object.defineProperty(exports, "ChatChannelProcessor", {
12
12
  enumerable: true,
13
- get: function () { return chunkY7Y7XTC3_cjs.ChatChannelProcessor; }
13
+ get: function () { return chunk3DIJ3TQS_cjs.ChatChannelProcessor; }
14
14
  });
15
15
  Object.defineProperty(exports, "MastraStateAdapter", {
16
16
  enumerable: true,
17
- get: function () { return chunkY7Y7XTC3_cjs.MastraStateAdapter; }
17
+ get: function () { return chunk3DIJ3TQS_cjs.MastraStateAdapter; }
18
18
  });
19
19
  //# sourceMappingURL=index.cjs.map
20
20
  //# sourceMappingURL=index.cjs.map
@@ -1,3 +1,3 @@
1
- export { AgentChannels, ChatChannelProcessor, MastraStateAdapter } from '../chunk-75EPJWR4.js';
1
+ export { AgentChannels, ChatChannelProcessor, MastraStateAdapter } from '../chunk-4FQ5HEEG.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import { validateAndSaveScore } from './chunk-NWF3HQEM.js';
2
- import { isSupportedLanguageModel } from './chunk-75EPJWR4.js';
1
+ import { validateAndSaveScore } from './chunk-ZJC3HACG.js';
2
+ import { isSupportedLanguageModel } from './chunk-4FQ5HEEG.js';
3
3
  import { extractTrajectory, extractTrajectoryFromTrace } from './chunk-6HX3NKCA.js';
4
4
  import { resolveObservabilityContext } from './chunk-2NDJVX5U.js';
5
5
  import { EntityType } from './chunk-PQSMKIRG.js';
@@ -1633,5 +1633,5 @@ var DatasetsManager = class {
1633
1633
  };
1634
1634
 
1635
1635
  export { Dataset, DatasetsManager, compareExperiments, computeMean, computeScorerStats, executeTarget, isRegression, resolveScorers, runExperiment, runScorersForItem };
1636
- //# sourceMappingURL=chunk-FLIEIN4W.js.map
1637
- //# sourceMappingURL=chunk-FLIEIN4W.js.map
1636
+ //# sourceMappingURL=chunk-2RXMQLX7.js.map
1637
+ //# sourceMappingURL=chunk-2RXMQLX7.js.map