@mastra/core 1.16.0-alpha.2 → 1.16.0-alpha.4
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 +78 -0
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +13 -13
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/conversion/output-converter.d.ts.map +1 -1
- package/dist/agent/message-list/index.cjs +18 -18
- package/dist/agent/message-list/index.js +1 -1
- package/dist/{chunk-4DW75LWG.js → chunk-3HRPHNFN.js} +4 -4
- package/dist/{chunk-4DW75LWG.js.map → chunk-3HRPHNFN.js.map} +1 -1
- package/dist/{chunk-TQTUU6QD.cjs → chunk-4THMANGC.cjs} +82 -82
- package/dist/{chunk-TQTUU6QD.cjs.map → chunk-4THMANGC.cjs.map} +1 -1
- package/dist/{chunk-4R7XCDYZ.js → chunk-5SWCNP2L.js} +3 -3
- package/dist/{chunk-4R7XCDYZ.js.map → chunk-5SWCNP2L.js.map} +1 -1
- package/dist/{chunk-Q7EDK6IW.cjs → chunk-6VYFRSNT.cjs} +13 -13
- package/dist/{chunk-Q7EDK6IW.cjs.map → chunk-6VYFRSNT.cjs.map} +1 -1
- package/dist/{chunk-KWQ4YIWP.cjs → chunk-7L2ICIDI.cjs} +6 -6
- package/dist/{chunk-KWQ4YIWP.cjs.map → chunk-7L2ICIDI.cjs.map} +1 -1
- package/dist/{chunk-PLWEBAHH.cjs → chunk-BQA45RHN.cjs} +5 -5
- package/dist/{chunk-PLWEBAHH.cjs.map → chunk-BQA45RHN.cjs.map} +1 -1
- package/dist/{chunk-55W2K42G.js → chunk-GRMC2OYN.js} +32 -4
- package/dist/chunk-GRMC2OYN.js.map +1 -0
- package/dist/{chunk-CJVTGET7.js → chunk-IWIO6OOO.js} +3 -3
- package/dist/{chunk-CJVTGET7.js.map → chunk-IWIO6OOO.js.map} +1 -1
- package/dist/{chunk-L53XY7WT.js → chunk-J3NJXIJ4.js} +161 -63
- package/dist/chunk-J3NJXIJ4.js.map +1 -0
- package/dist/{chunk-GYLHNAH7.cjs → chunk-K4NN2KQQ.cjs} +32 -4
- package/dist/chunk-K4NN2KQQ.cjs.map +1 -0
- package/dist/{chunk-4MG6J5RS.cjs → chunk-LY7WIAF5.cjs} +3 -3
- package/dist/{chunk-4MG6J5RS.cjs.map → chunk-LY7WIAF5.cjs.map} +1 -1
- package/dist/{chunk-L4AQYWBK.cjs → chunk-M6632FUT.cjs} +7 -7
- package/dist/{chunk-L4AQYWBK.cjs.map → chunk-M6632FUT.cjs.map} +1 -1
- package/dist/{chunk-GXAKTLZ3.cjs → chunk-MDEWERCK.cjs} +185 -185
- package/dist/{chunk-GXAKTLZ3.cjs.map → chunk-MDEWERCK.cjs.map} +1 -1
- package/dist/{chunk-373WBBIV.js → chunk-MXISDFVM.js} +3 -3
- package/dist/{chunk-373WBBIV.js.map → chunk-MXISDFVM.js.map} +1 -1
- package/dist/{chunk-6FFPNMST.cjs → chunk-NEWK2BT5.cjs} +15 -15
- package/dist/{chunk-6FFPNMST.cjs.map → chunk-NEWK2BT5.cjs.map} +1 -1
- package/dist/{chunk-2DPHD6NF.cjs → chunk-NTF7UIBI.cjs} +95 -86
- package/dist/chunk-NTF7UIBI.cjs.map +1 -0
- package/dist/{chunk-O3WTNJXV.js → chunk-OPRJPAB7.js} +3 -3
- package/dist/{chunk-O3WTNJXV.js.map → chunk-OPRJPAB7.js.map} +1 -1
- package/dist/{chunk-GZ2ZPBMU.js → chunk-OYAS35A6.js} +21 -12
- package/dist/chunk-OYAS35A6.js.map +1 -0
- package/dist/{chunk-O6O5MD7Q.cjs → chunk-PCQBJ3NP.cjs} +5 -2
- package/dist/chunk-PCQBJ3NP.cjs.map +1 -0
- package/dist/{chunk-4B2CHAMZ.cjs → chunk-PNSY2ZGF.cjs} +9 -9
- package/dist/{chunk-4B2CHAMZ.cjs.map → chunk-PNSY2ZGF.cjs.map} +1 -1
- package/dist/{chunk-3XWXW2YI.cjs → chunk-RQBBPR64.cjs} +16 -15
- package/dist/chunk-RQBBPR64.cjs.map +1 -0
- package/dist/{chunk-YPJ5V2S5.js → chunk-S6VT4LMH.js} +5 -2
- package/dist/chunk-S6VT4LMH.js.map +1 -0
- package/dist/{chunk-HQKKB3UP.js → chunk-SVE7QF2W.js} +8 -8
- package/dist/{chunk-HQKKB3UP.js.map → chunk-SVE7QF2W.js.map} +1 -1
- package/dist/{chunk-DJLBGTUV.cjs → chunk-SXVV5X4E.cjs} +13 -13
- package/dist/chunk-SXVV5X4E.cjs.map +1 -0
- package/dist/{chunk-UA5AY2ES.js → chunk-UQ5BWWRH.js} +4 -4
- package/dist/{chunk-UA5AY2ES.js.map → chunk-UQ5BWWRH.js.map} +1 -1
- package/dist/{chunk-325Q6NH6.cjs → chunk-V2XNSBIT.cjs} +6 -6
- package/dist/{chunk-325Q6NH6.cjs.map → chunk-V2XNSBIT.cjs.map} +1 -1
- package/dist/{chunk-4TMCYZ72.cjs → chunk-XGTV24L5.cjs} +57 -57
- package/dist/{chunk-4TMCYZ72.cjs.map → chunk-XGTV24L5.cjs.map} +1 -1
- package/dist/{chunk-JY32HS2J.js → chunk-XKOCRXCP.js} +3 -3
- package/dist/{chunk-JY32HS2J.js.map → chunk-XKOCRXCP.js.map} +1 -1
- package/dist/{chunk-FQJZIBZ2.js → chunk-XU4ZIJEV.js} +6 -6
- package/dist/{chunk-FQJZIBZ2.js.map → chunk-XU4ZIJEV.js.map} +1 -1
- package/dist/{chunk-KQ3SJZG5.cjs → chunk-XW4B2RAG.cjs} +182 -84
- package/dist/chunk-XW4B2RAG.cjs.map +1 -0
- package/dist/{chunk-563KV7S2.js → chunk-YE4J2QEX.js} +4 -4
- package/dist/{chunk-563KV7S2.js.map → chunk-YE4J2QEX.js.map} +1 -1
- package/dist/{chunk-3OZVV5J7.js → chunk-YIUXBYAI.js} +12 -12
- package/dist/chunk-YIUXBYAI.js.map +1 -0
- package/dist/{chunk-P7KTLFJM.js → chunk-YXBNQTAA.js} +7 -7
- package/dist/{chunk-P7KTLFJM.js.map → chunk-YXBNQTAA.js.map} +1 -1
- package/dist/{chunk-D5DBRZH3.js → chunk-ZJMETLCP.js} +4 -3
- package/dist/chunk-ZJMETLCP.js.map +1 -0
- 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 +239 -239
- package/dist/docs/references/docs-memory-observational-memory.md +36 -0
- package/dist/docs/references/docs-observability-tracing-exporters-datadog.md +132 -2
- package/dist/docs/references/docs-workspace-skills.md +23 -0
- package/dist/docs/references/reference-memory-observational-memory.md +42 -3
- package/dist/docs/references/reference-tools-create-tool.md +1 -1
- package/dist/docs/references/reference-workspace-workspace-class.md +13 -1
- package/dist/evals/index.cjs +5 -5
- 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 +17 -17
- package/dist/harness/index.js +7 -7
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +16 -16
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/provider-types.generated.d.ts +3 -3
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-JCB4Q53F.js +3 -0
- package/dist/{models-dev-OU3ACSEQ.js.map → models-dev-JCB4Q53F.js.map} +1 -1
- package/dist/models-dev-SV7R75OF.cjs +12 -0
- package/dist/{models-dev-OFI5OSM7.cjs.map → models-dev-SV7R75OF.cjs.map} +1 -1
- package/dist/netlify-KG6ZIIC5.js +3 -0
- package/dist/{netlify-OPNSZBGQ.js.map → netlify-KG6ZIIC5.js.map} +1 -1
- package/dist/netlify-SGAVTHDG.cjs +12 -0
- package/dist/{netlify-YVCTG2Z3.cjs.map → netlify-SGAVTHDG.cjs.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +42 -42
- package/dist/processors/index.js +1 -1
- package/dist/processors/processors/skills.d.ts.map +1 -1
- package/dist/provider-registry-INQUWPG6.js +3 -0
- package/dist/{provider-registry-KYR3I44P.js.map → provider-registry-INQUWPG6.js.map} +1 -1
- package/dist/provider-registry-UIDQJHBI.cjs +40 -0
- package/dist/{provider-registry-73NPBVKH.cjs.map → provider-registry-UIDQJHBI.cjs.map} +1 -1
- package/dist/provider-registry.json +8 -8
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/index.cjs +74 -74
- package/dist/storage/index.js +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/tools/index.cjs +7 -7
- package/dist/tools/index.js +1 -1
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/utils.cjs +23 -23
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/index.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/dist/workspace/index.cjs +68 -68
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/skills/tools.d.ts.map +1 -1
- package/dist/workspace/skills/types.d.ts +9 -5
- package/dist/workspace/skills/types.d.ts.map +1 -1
- package/dist/workspace/skills/workspace-skills.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +1 -1
- package/package.json +6 -6
- package/src/llm/model/provider-types.generated.d.ts +3 -3
- package/dist/chunk-2DPHD6NF.cjs.map +0 -1
- package/dist/chunk-3OZVV5J7.js.map +0 -1
- package/dist/chunk-3XWXW2YI.cjs.map +0 -1
- package/dist/chunk-55W2K42G.js.map +0 -1
- package/dist/chunk-D5DBRZH3.js.map +0 -1
- package/dist/chunk-DJLBGTUV.cjs.map +0 -1
- package/dist/chunk-GYLHNAH7.cjs.map +0 -1
- package/dist/chunk-GZ2ZPBMU.js.map +0 -1
- package/dist/chunk-KQ3SJZG5.cjs.map +0 -1
- package/dist/chunk-L53XY7WT.js.map +0 -1
- package/dist/chunk-O6O5MD7Q.cjs.map +0 -1
- package/dist/chunk-YPJ5V2S5.js.map +0 -1
- package/dist/models-dev-OFI5OSM7.cjs +0 -12
- package/dist/models-dev-OU3ACSEQ.js +0 -3
- package/dist/netlify-OPNSZBGQ.js +0 -3
- package/dist/netlify-YVCTG2Z3.cjs +0 -12
- package/dist/provider-registry-73NPBVKH.cjs +0 -40
- package/dist/provider-registry-KYR3I44P.js +0 -3
|
@@ -137,6 +137,42 @@ const memory = new Memory({
|
|
|
137
137
|
|
|
138
138
|
See [model configuration](https://mastra.ai/reference/memory/observational-memory) for using different models per agent.
|
|
139
139
|
|
|
140
|
+
### Token-tiered model selection
|
|
141
|
+
|
|
142
|
+
You can use `ModelByInputTokens` to specify different Observer or Reflector models based on input token count. OM selects the matching model tier at runtime from the configured `upTo` thresholds.
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
import { Memory, ModelByInputTokens } from '@mastra/memory'
|
|
146
|
+
|
|
147
|
+
const memory = new Memory({
|
|
148
|
+
options: {
|
|
149
|
+
observationalMemory: {
|
|
150
|
+
observation: {
|
|
151
|
+
model: new ModelByInputTokens({
|
|
152
|
+
upTo: {
|
|
153
|
+
10_000: 'google/gemini-2.5-flash', // Fast and cheap for small inputs
|
|
154
|
+
40_000: 'openai/gpt-4o', // Stronger for medium inputs
|
|
155
|
+
1_000_000: 'openai/gpt-4.5', // Most capable for very large inputs
|
|
156
|
+
},
|
|
157
|
+
}),
|
|
158
|
+
},
|
|
159
|
+
reflection: {
|
|
160
|
+
model: new ModelByInputTokens({
|
|
161
|
+
upTo: {
|
|
162
|
+
20_000: 'google/gemini-2.5-flash',
|
|
163
|
+
80_000: 'openai/gpt-4o',
|
|
164
|
+
},
|
|
165
|
+
}),
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
})
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The `upTo` keys are inclusive upper bounds. OM computes the actual input token count for the Observer or Reflector call, resolves the matching tier directly, and uses that concrete model for the run.
|
|
173
|
+
|
|
174
|
+
If the input exceeds the largest configured threshold, an error is thrown — ensure your thresholds cover the full range of possible input sizes, or use a model with a sufficiently large context window at the highest tier.
|
|
175
|
+
|
|
140
176
|
## Scopes
|
|
141
177
|
|
|
142
178
|
### Thread scope (default)
|
|
@@ -145,6 +145,135 @@ Mastra span types are automatically mapped to Datadog LLMObs span kinds:
|
|
|
145
145
|
|
|
146
146
|
Other/future Mastra span types will default to 'task' when mapped unless specified.
|
|
147
147
|
|
|
148
|
+
## Application Performance Monitoring
|
|
149
|
+
|
|
150
|
+
The sections above cover Mastra's [LLM Observability](https://docs.datadoghq.com/llm_observability/) integration. To trace your Mastra HTTP server routes (request latency, error tracking, service maps), use `dd-trace` directly for Datadog Application Performance Monitoring (APM).
|
|
151
|
+
|
|
152
|
+
### Prerequisites
|
|
153
|
+
|
|
154
|
+
1. **Datadog Agent**: Install a [Datadog Agent](https://docs.datadoghq.com/agent/) on the same host or accessible via network. The agent receives traces from `dd-trace` on `localhost:8126` and forwards them to Datadog. Follow the [agent installation guide](https://docs.datadoghq.com/agent/) to set it up.
|
|
155
|
+
|
|
156
|
+
2. **dd-trace package**: Install the tracing library in your project:
|
|
157
|
+
|
|
158
|
+
**npm**:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npm install dd-trace
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**pnpm**:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
pnpm add dd-trace
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Yarn**:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
yarn add dd-trace
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Bun**:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
bun add dd-trace
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
> **Note:** APM traces always route through the Datadog Agent. This is different from LLM Observability, which supports agentless mode (direct HTTPS to Datadog).
|
|
183
|
+
|
|
184
|
+
### APM only
|
|
185
|
+
|
|
186
|
+
Import and initialize `dd-trace` at the top of your entry file, before any other imports:
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import tracer from 'dd-trace'
|
|
190
|
+
|
|
191
|
+
tracer.init({
|
|
192
|
+
service: process.env.DD_SERVICE || 'my-mastra-app',
|
|
193
|
+
env: process.env.DD_ENV || 'production',
|
|
194
|
+
version: process.env.DD_VERSION,
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
import { Mastra } from '@mastra/core'
|
|
198
|
+
|
|
199
|
+
export const mastra = new Mastra({
|
|
200
|
+
bundler: {
|
|
201
|
+
externals: [
|
|
202
|
+
'dd-trace',
|
|
203
|
+
'@datadog/native-metrics',
|
|
204
|
+
'@datadog/native-appsec',
|
|
205
|
+
'@datadog/native-iast-taint-tracking',
|
|
206
|
+
'@datadog/pprof',
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
})
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Set the tracer metadata environment variables:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
DD_SERVICE=my-mastra-app
|
|
216
|
+
DD_ENV=production
|
|
217
|
+
DD_VERSION=1.0.0
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
`dd-trace` auto-instruments popular HTTP frameworks, including those supported by Mastra's [server adapters](https://mastra.ai/docs/server/server-adapters). Inbound requests, outbound HTTP calls, and database queries appear as APM traces in Datadog.
|
|
221
|
+
|
|
222
|
+
### APM and LLM Observability
|
|
223
|
+
|
|
224
|
+
Import and initialize `dd-trace` before creating the Mastra instance. The `DatadogExporter` detects the existing tracer and skips re-initialization, adding LLM Observability on top of your APM setup:
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
import tracer from 'dd-trace'
|
|
228
|
+
|
|
229
|
+
tracer.init({
|
|
230
|
+
service: process.env.DD_SERVICE || 'my-mastra-app',
|
|
231
|
+
env: process.env.DD_ENV || 'production',
|
|
232
|
+
version: process.env.DD_VERSION,
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
import { Mastra } from '@mastra/core'
|
|
236
|
+
import { Observability } from '@mastra/observability'
|
|
237
|
+
import { DatadogExporter } from '@mastra/datadog'
|
|
238
|
+
|
|
239
|
+
export const mastra = new Mastra({
|
|
240
|
+
observability: new Observability({
|
|
241
|
+
configs: {
|
|
242
|
+
datadog: {
|
|
243
|
+
serviceName: 'my-mastra-app',
|
|
244
|
+
exporters: [
|
|
245
|
+
new DatadogExporter({
|
|
246
|
+
mlApp: process.env.DD_LLMOBS_ML_APP!,
|
|
247
|
+
apiKey: process.env.DD_API_KEY!,
|
|
248
|
+
}),
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
}),
|
|
253
|
+
bundler: {
|
|
254
|
+
externals: [
|
|
255
|
+
'dd-trace',
|
|
256
|
+
'@datadog/native-metrics',
|
|
257
|
+
'@datadog/native-appsec',
|
|
258
|
+
'@datadog/native-iast-taint-tracking',
|
|
259
|
+
'@datadog/pprof',
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
})
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
DD_SERVICE=my-mastra-app
|
|
267
|
+
DD_ENV=production
|
|
268
|
+
DD_VERSION=1.0.0
|
|
269
|
+
DD_API_KEY=your-datadog-api-key
|
|
270
|
+
DD_LLMOBS_ML_APP=my-llm-app
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Server routes appear as APM traces and LLM calls appear as LLM Observability spans, all under the same service in Datadog.
|
|
274
|
+
|
|
275
|
+
> **Note:** Import and initialize `dd-trace` before all other modules. This allows its auto-instrumentation to patch HTTP, database, and framework libraries at load time.
|
|
276
|
+
|
|
148
277
|
## Troubleshooting
|
|
149
278
|
|
|
150
279
|
### Native module ABI mismatch
|
|
@@ -183,5 +312,6 @@ export const mastra = new Mastra({
|
|
|
183
312
|
|
|
184
313
|
## Related
|
|
185
314
|
|
|
186
|
-
- [Tracing
|
|
187
|
-
- [Datadog LLM Observability
|
|
315
|
+
- [Tracing overview](https://mastra.ai/docs/observability/tracing/overview)
|
|
316
|
+
- [Datadog LLM Observability documentation](https://docs.datadoghq.com/llm_observability/)
|
|
317
|
+
- [Datadog APM documentation](https://docs.datadoghq.com/tracing/)
|
|
@@ -127,6 +127,29 @@ The agent has three skill tools:
|
|
|
127
127
|
|
|
128
128
|
This design is stateless — there is no activation state to track. If the skill instructions leave the conversation context (due to context window limits or compaction), the agent can call `skill` again to reload them.
|
|
129
129
|
|
|
130
|
+
## Same-named skills
|
|
131
|
+
|
|
132
|
+
When multiple skill directories contain a skill with the same name, all of them are discovered and listed. The agent sees every skill in its system message, along with each skill's path and source type, so it can tell them apart.
|
|
133
|
+
|
|
134
|
+
When the agent activates a skill by name, tie-breaking determines which one is returned:
|
|
135
|
+
|
|
136
|
+
1. **Source-type priority**: local skills take precedence over managed (`.mastra/`) skills, which take precedence over external (`node_modules/`) skills.
|
|
137
|
+
2. **Unresolvable conflicts throw**: if two skills share the same name _and_ the same source type (for example, two local skills both named `brand-guidelines`), `get()` throws an error. Rename one or move it to a different source type to resolve the conflict.
|
|
138
|
+
3. **Path escape hatch**: the agent can pass a skill's full path instead of its name to activate a specific skill, bypassing tie-breaking entirely.
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
const workspace = new Workspace({
|
|
142
|
+
filesystem: new LocalFilesystem({ basePath: './workspace' }),
|
|
143
|
+
skills: [
|
|
144
|
+
'node_modules/@myorg/skills', // external: provides "brand-guidelines"
|
|
145
|
+
'/skills', // local: also provides "brand-guidelines"
|
|
146
|
+
],
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
// get('brand-guidelines') returns the local copy (local > external)
|
|
150
|
+
// get('node_modules/@myorg/skills/brand-guidelines') returns the external copy
|
|
151
|
+
```
|
|
152
|
+
|
|
130
153
|
## Skill search
|
|
131
154
|
|
|
132
155
|
If BM25 or vector search is enabled on the workspace, skills are automatically indexed. Agents can search across skill content to find relevant instructions.
|
|
@@ -32,7 +32,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
32
32
|
|
|
33
33
|
**enabled** (`boolean`): Enable or disable Observational Memory. When omitted from a config object, defaults to \`true\`. Only \`enabled: false\` explicitly disables it. (Default: `true`)
|
|
34
34
|
|
|
35
|
-
**model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model for both the Observer and Reflector agents. Sets the model for both at once. Cannot be used together with \`observation.model\` or \`reflection.model\` — an error will be thrown if both are set. When using \`observationalMemory: true\`, defaults to \`google/gemini-2.5-flash\`. When passing a config object, this or \`observation.model\`/\`reflection.model\` must be set. Use \`"default"\` to explicitly use the default model (\`google/gemini-2.5-flash\`). (Default: `'google/gemini-2.5-flash' (when using observationalMemory: true)`)
|
|
35
|
+
**model** (`string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for both the Observer and Reflector agents. Sets the model for both at once. Cannot be used together with \`observation.model\` or \`reflection.model\` — an error will be thrown if both are set. When using \`observationalMemory: true\`, defaults to \`google/gemini-2.5-flash\`. When passing a config object, this or \`observation.model\`/\`reflection.model\` must be set. Use \`"default"\` to explicitly use the default model (\`google/gemini-2.5-flash\`). (Default: `'google/gemini-2.5-flash' (when using observationalMemory: true)`)
|
|
36
36
|
|
|
37
37
|
**scope** (`'resource' | 'thread'`): Memory scope for observations. \`'thread'\` keeps observations per-thread. \`'resource'\` (experimental) shares observations across all threads for a resource, enabling cross-conversation memory. (Default: `'thread'`)
|
|
38
38
|
|
|
@@ -42,7 +42,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
42
42
|
|
|
43
43
|
**observation** (`ObservationalMemoryObservationConfig`): Configuration for the observation step. Controls when the Observer agent runs and how it behaves.
|
|
44
44
|
|
|
45
|
-
**observation.model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model for the Observer agent. Cannot be set if a top-level \`model\` is also provided. If neither this nor the top-level \`model\` is set, falls back to \`reflection.model\`.
|
|
45
|
+
**observation.model** (`string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for the Observer agent. Cannot be set if a top-level \`model\` is also provided. If neither this nor the top-level \`model\` is set, falls back to \`reflection.model\`.
|
|
46
46
|
|
|
47
47
|
**observation.instruction** (`string`): Custom instruction appended to the Observer's system prompt. Use this to customize what the Observer focuses on, such as domain-specific preferences or priorities.
|
|
48
48
|
|
|
@@ -68,7 +68,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
68
68
|
|
|
69
69
|
**reflection** (`ObservationalMemoryReflectionConfig`): Configuration for the reflection step. Controls when the Reflector agent runs and how it behaves.
|
|
70
70
|
|
|
71
|
-
**reflection.model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model for the Reflector agent. Cannot be set if a top-level \`model\` is also provided. If neither this nor the top-level \`model\` is set, falls back to \`observation.model\`.
|
|
71
|
+
**reflection.model** (`string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for the Reflector agent. Cannot be set if a top-level \`model\` is also provided. If neither this nor the top-level \`model\` is set, falls back to \`observation.model\`.
|
|
72
72
|
|
|
73
73
|
**reflection.instruction** (`string`): Custom instruction appended to the Reflector's system prompt. Use this to customize how the Reflector consolidates observations, such as prioritizing certain types of information.
|
|
74
74
|
|
|
@@ -612,6 +612,45 @@ When `retrieval: true` is set with `scope: 'thread'`, OM registers a `recall` to
|
|
|
612
612
|
|
|
613
613
|
**tokenOffset** (`number`): Approximate number of tokens that were trimmed when \`truncated\` is true.
|
|
614
614
|
|
|
615
|
+
### ModelByInputTokens
|
|
616
|
+
|
|
617
|
+
`ModelByInputTokens` selects a model based on the input token count. It chooses the model for the smallest threshold that covers the actual input size.
|
|
618
|
+
|
|
619
|
+
#### Constructor
|
|
620
|
+
|
|
621
|
+
```typescript
|
|
622
|
+
new ModelByInputTokens(config)
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
Where `config` is an object with `upTo` keys that map token thresholds (numbers) to model targets.
|
|
626
|
+
|
|
627
|
+
#### Example
|
|
628
|
+
|
|
629
|
+
```typescript
|
|
630
|
+
import { ModelByInputTokens } from '@mastra/memory'
|
|
631
|
+
|
|
632
|
+
const selector = new ModelByInputTokens({
|
|
633
|
+
upTo: {
|
|
634
|
+
10_000: 'google/gemini-2.5-flash', // Fast for small inputs
|
|
635
|
+
40_000: 'openai/gpt-4o', // Stronger for medium inputs
|
|
636
|
+
1_000_000: 'openai/gpt-4.5', // Most capable for large inputs
|
|
637
|
+
},
|
|
638
|
+
})
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
#### Behavior
|
|
642
|
+
|
|
643
|
+
- Thresholds are sorted internally, so the order in the config object does not matter.
|
|
644
|
+
- `inputTokens ≤ smallest threshold` → uses that threshold's model
|
|
645
|
+
- `inputTokens > largest threshold` → `resolve()` throws an error. If this happens during an OM Observer or Reflector run, OM aborts via TripWire, so callers receive an empty `text` result or streamed `tripwire` instead of a normal assistant response.
|
|
646
|
+
- OM computes the input token count for the Observer or Reflector call and resolves the matching model tier directly
|
|
647
|
+
|
|
648
|
+
#### Methods
|
|
649
|
+
|
|
650
|
+
**resolve** (`(inputTokens: number) => MastraModelConfig`): Returns the model for the given input token count. Throws if inputTokens exceeds the largest configured threshold. When this happens during an OM run, callers receive a TripWire/empty-text outcome instead of a normal assistant response.
|
|
651
|
+
|
|
652
|
+
**getThresholds** (`() => number[]`): Returns the configured thresholds in ascending order. Useful for introspection.
|
|
653
|
+
|
|
615
654
|
### Related
|
|
616
655
|
|
|
617
656
|
- [Observational Memory](https://mastra.ai/docs/memory/observational-memory)
|
|
@@ -144,7 +144,7 @@ export const weatherTool = createTool({
|
|
|
144
144
|
|
|
145
145
|
**execute.context.abortSignal** (`AbortSignal`): Signal for aborting the tool execution
|
|
146
146
|
|
|
147
|
-
**execute.context.agent** (`AgentToolExecutionContext`): Agent-specific context
|
|
147
|
+
**execute.context.agent** (`AgentToolExecutionContext`): Agent-specific context, available when the tool is executed by an agent.
|
|
148
148
|
|
|
149
149
|
**execute.context.workflow** (`WorkflowToolExecutionContext`): Workflow-specific context (state, setState, suspend, etc.)
|
|
150
150
|
|
|
@@ -305,4 +305,16 @@ Added when BM25 or vector search is configured:
|
|
|
305
305
|
| `mastra_workspace_search` | Search indexed content using keyword (BM25), semantic (vector), or hybrid search. Returns ranked results with scores. |
|
|
306
306
|
| `mastra_workspace_index` | Index content for search. Associates content with a path for later retrieval. |
|
|
307
307
|
|
|
308
|
-
The `index` tool is excluded when the filesystem is in read-only mode.
|
|
308
|
+
The `index` tool is excluded when the filesystem is in read-only mode.
|
|
309
|
+
|
|
310
|
+
### Skill tools
|
|
311
|
+
|
|
312
|
+
Added when skills are configured:
|
|
313
|
+
|
|
314
|
+
| Tool | Description |
|
|
315
|
+
| -------------- | --------------------------------------------------------------------------------------------------------- |
|
|
316
|
+
| `skill` | Activate a skill by name or path. Returns the skill's full instructions, references, scripts, and assets. |
|
|
317
|
+
| `skill_search` | Search across skill content. Accepts an optional list of skill names to filter and a `topK` parameter. |
|
|
318
|
+
| `skill_read` | Read a specific file (reference, script, or asset) from a skill directory. |
|
|
319
|
+
|
|
320
|
+
When multiple skills share the same name, `list()` returns all of them. `get()` with a name applies tie-breaking (local > managed > external). If two skills share the same name _and_ source type, `get()` throws an error. Pass a skill's full path to `get()` to bypass tie-breaking. See [Same-named skills](https://mastra.ai/docs/workspace/skills) for details.
|
package/dist/evals/index.cjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkBQA45RHN_cjs = require('../chunk-BQA45RHN.cjs');
|
|
4
|
+
var chunkNTF7UIBI_cjs = require('../chunk-NTF7UIBI.cjs');
|
|
5
5
|
var chunkSQACXTWK_cjs = require('../chunk-SQACXTWK.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "runEvals", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkBQA45RHN_cjs.runEvals; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "MastraScorer", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkNTF7UIBI_cjs.MastraScorer; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createScorer", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkNTF7UIBI_cjs.createScorer; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "listScoresResponseSchema", {
|
|
22
22
|
enumerable: true,
|
package/dist/evals/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { runEvals } from '../chunk-
|
|
2
|
-
export { MastraScorer, createScorer } from '../chunk-
|
|
1
|
+
export { runEvals } from '../chunk-5SWCNP2L.js';
|
|
2
|
+
export { MastraScorer, createScorer } from '../chunk-OYAS35A6.js';
|
|
3
3
|
export { listScoresResponseSchema, saveScorePayloadSchema, scoreResultSchema, scoreRowDataSchema, scoringEntityTypeSchema, scoringExtractStepResultSchema, scoringHookInputSchema, scoringInputSchema, scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, scoringInputWithExtractStepResultAndScoreAndReasonSchema, scoringInputWithExtractStepResultSchema, scoringPromptsSchema, scoringSourceSchema, scoringValueSchema } from '../chunk-SNASZNHI.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXGTV24L5_cjs = require('../../chunk-XGTV24L5.cjs');
|
|
4
4
|
var chunkSQACXTWK_cjs = require('../../chunk-SQACXTWK.cjs');
|
|
5
5
|
var chunkG5HKDGNT_cjs = require('../../chunk-G5HKDGNT.cjs');
|
|
6
6
|
var chunk4U7ZLI36_cjs = require('../../chunk-4U7ZLI36.cjs');
|
|
@@ -235,7 +235,7 @@ function transformTraceToScorerInputAndOutput(trace) {
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
// src/evals/scoreTraces/scoreTracesWorkflow.ts
|
|
238
|
-
var getTraceStep =
|
|
238
|
+
var getTraceStep = chunkXGTV24L5_cjs.createStep({
|
|
239
239
|
id: "__process-trace-scoring",
|
|
240
240
|
inputSchema: v4.z.object({
|
|
241
241
|
targets: v4.z.array(
|
|
@@ -446,7 +446,7 @@ async function attachScoreToSpan({
|
|
|
446
446
|
} catch {
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
var scoreTracesWorkflow =
|
|
449
|
+
var scoreTracesWorkflow = chunkXGTV24L5_cjs.createWorkflow({
|
|
450
450
|
id: "__batch-scoring-traces",
|
|
451
451
|
inputSchema: v4.z.object({
|
|
452
452
|
targets: v4.z.array(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createStep, createWorkflow } from '../../chunk-
|
|
1
|
+
import { createStep, createWorkflow } from '../../chunk-XU4ZIJEV.js';
|
|
2
2
|
import { saveScorePayloadSchema } from '../../chunk-SNASZNHI.js';
|
|
3
3
|
import { resolveObservabilityContext } from '../../chunk-CT4YYQI3.js';
|
|
4
4
|
import { MastraError } from '../../chunk-FJEVLHJT.js';
|
package/dist/harness/index.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkNEWK2BT5_cjs = require('../chunk-NEWK2BT5.cjs');
|
|
4
|
+
var chunkNTF7UIBI_cjs = require('../chunk-NTF7UIBI.cjs');
|
|
5
|
+
var chunkXW4B2RAG_cjs = require('../chunk-XW4B2RAG.cjs');
|
|
6
|
+
var chunkK4NN2KQQ_cjs = require('../chunk-K4NN2KQQ.cjs');
|
|
7
7
|
var chunkXB4FLS7A_cjs = require('../chunk-XB4FLS7A.cjs');
|
|
8
8
|
var chunk5WBEMKE2_cjs = require('../chunk-5WBEMKE2.cjs');
|
|
9
9
|
var v4 = require('zod/v4');
|
|
10
10
|
|
|
11
11
|
var questionCounter = 0;
|
|
12
12
|
var planCounter = 0;
|
|
13
|
-
var askUserTool =
|
|
13
|
+
var askUserTool = chunkK4NN2KQQ_cjs.createTool({
|
|
14
14
|
id: "ask_user",
|
|
15
15
|
description: "Ask the user a question and wait for their response. Use this when you need clarification, want to validate assumptions, or need the user to make a decision between options. Provide options for structured choices (2-4 options), or omit them for open-ended questions.",
|
|
16
16
|
inputSchema: v4.z.object({
|
|
@@ -61,7 +61,7 @@ var askUserTool = chunkGYLHNAH7_cjs.createTool({
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
var submitPlanTool =
|
|
64
|
+
var submitPlanTool = chunkK4NN2KQQ_cjs.createTool({
|
|
65
65
|
id: "submit_plan",
|
|
66
66
|
description: "Submit a completed implementation plan for user review. The plan will be rendered as markdown and the user can approve, reject, or request changes. Use this when your exploration is complete and you have a concrete plan ready for review. On approval, the system automatically switches to the default mode so you can implement.",
|
|
67
67
|
inputSchema: v4.z.object({
|
|
@@ -130,7 +130,7 @@ var taskItemSchema = v4.z.object({
|
|
|
130
130
|
status: v4.z.enum(["pending", "in_progress", "completed"]).describe("Current task status"),
|
|
131
131
|
activeForm: v4.z.string().min(1).describe("Present continuous form shown during execution (e.g., 'Fixing authentication bug')")
|
|
132
132
|
});
|
|
133
|
-
var taskWriteTool =
|
|
133
|
+
var taskWriteTool = chunkK4NN2KQQ_cjs.createTool({
|
|
134
134
|
id: "task_write",
|
|
135
135
|
description: `Create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
|
|
136
136
|
|
|
@@ -179,7 +179,7 @@ Currently: ${inProgress.activeForm}`;
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
|
-
var taskCheckTool =
|
|
182
|
+
var taskCheckTool = chunkK4NN2KQQ_cjs.createTool({
|
|
183
183
|
id: "task_check",
|
|
184
184
|
description: `Check the completion status of your current task list. Use this before deciding to end work on a task to ensure all tasks are completed.
|
|
185
185
|
|
|
@@ -258,7 +258,7 @@ function createSubagentTool(opts) {
|
|
|
258
258
|
const { subagents, resolveModel, harnessTools, fallbackModelId } = opts;
|
|
259
259
|
const subagentIds = subagents.map((s) => s.id);
|
|
260
260
|
const typeDescriptions = subagents.map((s) => `- **${s.id}** (${s.name}): ${s.description}`).join("\n");
|
|
261
|
-
return
|
|
261
|
+
return chunkK4NN2KQQ_cjs.createTool({
|
|
262
262
|
id: "subagent",
|
|
263
263
|
description: `Delegate a focused task to a specialized subagent. The subagent runs independently with a constrained toolset, then returns its findings as text.
|
|
264
264
|
|
|
@@ -312,7 +312,7 @@ Use this tool when:
|
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
314
|
const workspace = context?.workspace;
|
|
315
|
-
const subagent = new
|
|
315
|
+
const subagent = new chunkNTF7UIBI_cjs.Agent({
|
|
316
316
|
id: `subagent-${definition.id}`,
|
|
317
317
|
name: `${definition.name} Subagent`,
|
|
318
318
|
instructions: definition.instructions,
|
|
@@ -320,7 +320,7 @@ Use this tool when:
|
|
|
320
320
|
tools: mergedTools,
|
|
321
321
|
workspace
|
|
322
322
|
});
|
|
323
|
-
const allWorkspaceToolNames = workspace ? new Set(Object.keys(
|
|
323
|
+
const allWorkspaceToolNames = workspace ? new Set(Object.keys(chunkXW4B2RAG_cjs.createWorkspaceTools(workspace))) : void 0;
|
|
324
324
|
const allowedWs = definition.allowedWorkspaceTools ? new Set(definition.allowedWorkspaceTools) : void 0;
|
|
325
325
|
const startTime = Date.now();
|
|
326
326
|
emitEvent?.({
|
|
@@ -542,7 +542,7 @@ var Harness = class {
|
|
|
542
542
|
throw new Error("Harness requires at least one agent mode");
|
|
543
543
|
}
|
|
544
544
|
this.currentModeId = defaultMode.id;
|
|
545
|
-
if (config.workspace instanceof
|
|
545
|
+
if (config.workspace instanceof chunkXW4B2RAG_cjs.Workspace) {
|
|
546
546
|
this.workspace = config.workspace;
|
|
547
547
|
} else if (typeof config.workspace === "function") {
|
|
548
548
|
this.workspaceFn = config.workspace;
|
|
@@ -561,13 +561,13 @@ var Harness = class {
|
|
|
561
561
|
*/
|
|
562
562
|
async init() {
|
|
563
563
|
if (this.config.storage) {
|
|
564
|
-
this.#internalMastra = new
|
|
564
|
+
this.#internalMastra = new chunkNEWK2BT5_cjs.Mastra({ logger: false, storage: this.config.storage });
|
|
565
565
|
await this.#internalMastra.getStorage().init();
|
|
566
566
|
}
|
|
567
567
|
if (this.config.workspace && !this.workspaceInitialized && !this.workspaceFn) {
|
|
568
568
|
try {
|
|
569
569
|
if (!this.workspace) {
|
|
570
|
-
this.workspace = new
|
|
570
|
+
this.workspace = new chunkXW4B2RAG_cjs.Workspace(this.config.workspace);
|
|
571
571
|
}
|
|
572
572
|
this.emit({ type: "workspace_status_changed", status: "initializing" });
|
|
573
573
|
await this.workspace.init();
|
|
@@ -813,7 +813,7 @@ var Harness = class {
|
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
815
|
try {
|
|
816
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
816
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-UIDQJHBI.cjs');
|
|
817
817
|
const registry = PROVIDER_REGISTRY;
|
|
818
818
|
const providerConfig = registry[provider];
|
|
819
819
|
const envVars = providerConfig?.apiKeyEnvVar;
|
|
@@ -833,7 +833,7 @@ var Harness = class {
|
|
|
833
833
|
*/
|
|
834
834
|
async listAvailableModels() {
|
|
835
835
|
try {
|
|
836
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
836
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-UIDQJHBI.cjs');
|
|
837
837
|
if (!PROVIDER_REGISTRY) return [];
|
|
838
838
|
const registry = PROVIDER_REGISTRY;
|
|
839
839
|
const providers = Object.keys(registry);
|
|
@@ -892,7 +892,7 @@ var Harness = class {
|
|
|
892
892
|
}
|
|
893
893
|
async getProviderApiKeyEnvVar(provider) {
|
|
894
894
|
try {
|
|
895
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
895
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-UIDQJHBI.cjs');
|
|
896
896
|
const registry = PROVIDER_REGISTRY;
|
|
897
897
|
const envVars = registry[provider]?.apiKeyEnvVar;
|
|
898
898
|
return Array.isArray(envVars) ? envVars[0] : envVars;
|
package/dist/harness/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Mastra } from '../chunk-
|
|
2
|
-
import { Agent } from '../chunk-
|
|
3
|
-
import { Workspace, createWorkspaceTools } from '../chunk-
|
|
4
|
-
import { createTool } from '../chunk-
|
|
1
|
+
import { Mastra } from '../chunk-SVE7QF2W.js';
|
|
2
|
+
import { Agent } from '../chunk-OYAS35A6.js';
|
|
3
|
+
import { Workspace, createWorkspaceTools } from '../chunk-J3NJXIJ4.js';
|
|
4
|
+
import { createTool } from '../chunk-GRMC2OYN.js';
|
|
5
5
|
import { toStandardSchema } from '../chunk-6SRTDZ7S.js';
|
|
6
6
|
import { RequestContext } from '../chunk-JGOH7RWL.js';
|
|
7
7
|
import { z } from 'zod/v4';
|
|
@@ -811,7 +811,7 @@ var Harness = class {
|
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
813
|
try {
|
|
814
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
814
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-INQUWPG6.js');
|
|
815
815
|
const registry = PROVIDER_REGISTRY;
|
|
816
816
|
const providerConfig = registry[provider];
|
|
817
817
|
const envVars = providerConfig?.apiKeyEnvVar;
|
|
@@ -831,7 +831,7 @@ var Harness = class {
|
|
|
831
831
|
*/
|
|
832
832
|
async listAvailableModels() {
|
|
833
833
|
try {
|
|
834
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
834
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-INQUWPG6.js');
|
|
835
835
|
if (!PROVIDER_REGISTRY) return [];
|
|
836
836
|
const registry = PROVIDER_REGISTRY;
|
|
837
837
|
const providers = Object.keys(registry);
|
|
@@ -890,7 +890,7 @@ var Harness = class {
|
|
|
890
890
|
}
|
|
891
891
|
async getProviderApiKeyEnvVar(provider) {
|
|
892
892
|
try {
|
|
893
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
893
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-INQUWPG6.js');
|
|
894
894
|
const registry = PROVIDER_REGISTRY;
|
|
895
895
|
const envVars = registry[provider]?.apiKeyEnvVar;
|
|
896
896
|
return Array.isArray(envVars) ? envVars[0] : envVars;
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNEWK2BT5_cjs = require('./chunk-NEWK2BT5.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Mastra", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkNEWK2BT5_cjs.Mastra; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkK4NN2KQQ_cjs = require('../chunk-K4NN2KQQ.cjs');
|
|
4
4
|
var v4 = require('zod/v4');
|
|
5
5
|
|
|
6
6
|
// src/integration/integration.ts
|
|
@@ -68,7 +68,7 @@ var OpenAPIToolset = class {
|
|
|
68
68
|
const tools = Object.keys(clientMethods).reduce((acc, key) => {
|
|
69
69
|
const comment = documentations[key]?.comment;
|
|
70
70
|
const fallbackComment = `Execute ${key}`;
|
|
71
|
-
const tool =
|
|
71
|
+
const tool = chunkK4NN2KQQ_cjs.createTool({
|
|
72
72
|
id: key,
|
|
73
73
|
inputSchema: schemas[key] || v4.z.object({}),
|
|
74
74
|
description: comment || fallbackComment,
|