@mastra/server 1.86.0-alpha.7 → 1.86.0-alpha.9
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/dist/{a2a-WPGF38fX.js → a2a-CY7rgzPe.js} +1 -1
- package/dist/{a2a-vSZkdSRE.cjs → a2a-DwjvHqcb.cjs} +1 -1
- package/dist/{agent-builder-C4AIqOxt.js → agent-builder-DHnNRROR.js} +2 -2
- package/dist/{agent-builder-dZlRNj1k.cjs → agent-builder-anRH1X35.cjs} +2 -2
- package/dist/{agent-controller-BHJDvCaS.cjs → agent-controller-BP-CFfsg.cjs} +9 -9
- package/dist/{agent-controller-NRR6SK66.js → agent-controller-CzKnfKkw.js} +9 -9
- package/dist/{agent-versions-CwWhEoU5.cjs → agent-versions-0q4KKmLv.cjs} +12 -12
- package/dist/{agent-versions-DfcKpYNW.js → agent-versions-Pml6WNbA.js} +12 -12
- package/dist/{agents-272TP94y.js → agents-CAXsXenf.js} +32 -3
- package/dist/{agents-mjQZV5tv.cjs → agents-GHhuyz5x.cjs} +32 -3
- package/dist/{api-schema-manifest-BjhiTdNv.js → api-schema-manifest-4PK1dBWt.js} +1 -1
- package/dist/{api-schema-manifest-DVkepK_s.cjs → api-schema-manifest-CX16hC7V.cjs} +1 -1
- package/dist/{auth-CM5AgF9l.cjs → auth-BR7vRIrY.cjs} +5 -3
- package/dist/{auth-CjT_a76k.js → auth-ChZ3dUvo.js} +5 -3
- package/dist/{catalogue-DH64Duv-.js → catalogue-BOzHZ1xt.js} +11 -11
- package/dist/{catalogue-BTE9b_mr.cjs → catalogue-DNy7Fog6.cjs} +11 -11
- package/dist/{conversations-CXyaNjLR.js → conversations-BjD8wOc3.js} +1 -1
- package/dist/{conversations-BWA_---j.cjs → conversations-CgogBOHO.cjs} +1 -1
- package/dist/{datasets-C1XJLHN8.js → datasets-CYdtUF8e.js} +4 -1
- package/dist/{datasets-hqDd4IUN.cjs → datasets-CZRqni0N.cjs} +4 -1
- package/dist/dist-BWVxgpEw.js +1 -0
- package/dist/{dist-DGwsCtT4.cjs → dist-Brw_H26B.cjs} +521 -286
- package/dist/{dist-CSffo32A.cjs → dist-C5_WGwU1.cjs} +1 -1
- package/dist/{dist-Bp1bObAq.js → dist-NBGkHBIE.js} +521 -286
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-knowledge-overview.md +1 -1
- package/dist/docs/references/reference-observability-tracing-advanced-queries.md +20 -0
- package/dist/{dynamic-workflows-DPgV6qtS.cjs → dynamic-workflows-CEKdGcSr.cjs} +4 -4
- package/dist/{dynamic-workflows-DmkCJ4Lp.js → dynamic-workflows-DF9X_oDG.js} +4 -4
- package/dist/{editor-builder-BayzCprJ.js → editor-builder-BRzXnsRW.js} +1 -1
- package/dist/{editor-builder-BS2xogE_.cjs → editor-builder-G1ub9j0s.cjs} +1 -1
- package/dist/{knowledge-DL03nbSW.cjs → knowledge-B3768ERP.cjs} +1 -0
- package/dist/{knowledge-DAqUHFK5.js → knowledge-wqC0nrmu.js} +1 -0
- package/dist/{observability-zr7LDCQG.js → observability-URaJnI_U.js} +1 -1
- package/dist/{observability-Cn4P60P4.cjs → observability-zNA_CVaz.cjs} +1 -1
- package/dist/{plans-xGwuiZUd.js → plans-DGC1grMp.js} +1 -1
- package/dist/{plans-Bes_LVgv.cjs → plans-kA8E3Auv.cjs} +1 -1
- package/dist/probe-image-size-ntJyQKKB.cjs +13304 -0
- package/dist/probe-image-size-zXQBlFaQ.js +13297 -0
- package/dist/{responses-CwQO5y2X.js → responses--nGf7l3O.js} +1 -1
- package/dist/{responses-BH567IZf.cjs → responses-B4GDz-Nm.cjs} +1 -1
- package/dist/{routes-CrBCJmjc.js → routes-BZVlqLly.js} +17 -17
- package/dist/{routes-6p-xrUIq.cjs → routes-vuZLexcc.cjs} +17 -17
- package/dist/{schedules-0ceTSdBB.cjs → schedules-CwL28Eca.cjs} +4 -4
- package/dist/{schedules-D_VfFdAH.js → schedules-RWgPeypN.js} +4 -4
- package/dist/{scorer-versions-Bhdvt-cX.cjs → scorer-versions-DK-PGj7-.cjs} +1 -1
- package/dist/{scorer-versions-DhT7Lj33.js → scorer-versions-oJoK2Exw.js} +1 -1
- package/dist/{scores-ksmJiJnJ.js → scores-Biv7XGW_.js} +1 -1
- package/dist/{scores-CXNkN7Bn.cjs → scores-D0Qq7TfU.cjs} +1 -1
- package/dist/server/handlers/a2a.cjs +1 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agent-controller.cjs +1 -1
- package/dist/server/handlers/agent-controller.js +1 -1
- package/dist/server/handlers/agent-versions.cjs +1 -1
- package/dist/server/handlers/agent-versions.js +1 -1
- package/dist/server/handlers/agents.cjs +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/auth.cjs +7 -3
- package/dist/server/handlers/auth.d.ts +12 -4
- package/dist/server/handlers/auth.js +7 -3
- package/dist/server/handlers/conversations.cjs +1 -1
- package/dist/server/handlers/conversations.js +1 -1
- package/dist/server/handlers/datasets.cjs +16 -11
- package/dist/server/handlers/datasets.d.ts +6 -0
- package/dist/server/handlers/datasets.js +16 -11
- package/dist/server/handlers/dynamic-workflows.cjs +1 -1
- package/dist/server/handlers/dynamic-workflows.js +1 -1
- package/dist/server/handlers/editor-builder.cjs +1 -1
- package/dist/server/handlers/editor-builder.js +1 -1
- package/dist/server/handlers/error.cjs +1 -1
- package/dist/server/handlers/error.js +1 -1
- package/dist/server/handlers/favorites-enrichment.cjs +1 -1
- package/dist/server/handlers/favorites-enrichment.js +1 -1
- package/dist/server/handlers/knowledge.cjs +1 -1
- package/dist/server/handlers/knowledge.js +1 -1
- package/dist/server/handlers/observability.cjs +1 -1
- package/dist/server/handlers/observability.js +1 -1
- package/dist/server/handlers/plans.cjs +1 -1
- package/dist/server/handlers/plans.js +1 -1
- package/dist/server/handlers/responses.cjs +1 -1
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers/schedules.cjs +1 -1
- package/dist/server/handlers/schedules.js +1 -1
- package/dist/server/handlers/scorer-versions.cjs +1 -1
- package/dist/server/handlers/scorer-versions.js +1 -1
- package/dist/server/handlers/scores.cjs +1 -1
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/stored-agent-favorites.cjs +3 -3
- package/dist/server/handlers/stored-agent-favorites.js +3 -3
- package/dist/server/handlers/stored-agents.cjs +2 -2
- package/dist/server/handlers/stored-agents.js +2 -2
- package/dist/server/handlers/stored-scorers.cjs +1 -1
- package/dist/server/handlers/stored-scorers.js +1 -1
- package/dist/server/handlers/stored-skill-favorites.cjs +2 -2
- package/dist/server/handlers/stored-skill-favorites.js +2 -2
- package/dist/server/handlers/stored-skills.cjs +1 -1
- package/dist/server/handlers/stored-skills.js +1 -1
- package/dist/server/handlers/system.cjs +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/handlers/tool-providers.cjs +2 -2
- package/dist/server/handlers/tool-providers.js +2 -2
- package/dist/server/handlers/tools.cjs +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/voice.cjs +1 -1
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +12 -12
- package/dist/server/handlers.js +12 -12
- package/dist/server/schemas/auth.d.ts +3 -1
- package/dist/server/schemas/datasets.d.ts +3 -0
- package/dist/server/schemas/index.cjs +7 -7
- package/dist/server/schemas/index.js +7 -7
- package/dist/server/server-adapter/index.cjs +3 -3
- package/dist/server/server-adapter/index.js +3 -3
- package/dist/server/server-adapter/routes/datasets.d.ts +6 -0
- package/dist/{server-adapter-Ceag3til.cjs → server-adapter-CurME3ch.cjs} +4 -4
- package/dist/{server-adapter-BGOi-s7x.js → server-adapter-h8YRQXAC.js} +4 -4
- package/dist/{stored-agents-m0Knvv29.cjs → stored-agents-BS4_LGSs.cjs} +32 -32
- package/dist/{stored-agents-DmN_pIIl.js → stored-agents-DcyDMKP2.js} +32 -32
- package/dist/{stored-scorers-2F2k6XSx.js → stored-scorers-Bdz_5k57.js} +1 -1
- package/dist/{stored-scorers-iM2Qq9Nh.cjs → stored-scorers-D8YYszOj.cjs} +1 -1
- package/dist/{tool-providers-Cq3vFqgE.js → tool-providers-BN2Ni06Z.js} +2 -2
- package/dist/{tool-providers-BVwRJTtB.cjs → tool-providers-BeiSkVHu.cjs} +2 -2
- package/dist/{tools-DLZ7go-n.cjs → tools-By0RVh_O.cjs} +1 -1
- package/dist/{tools-CY44YtDW.js → tools-C3KBdlil.js} +1 -1
- package/dist/{voice-NaerSeVQ.cjs → voice-CESew8Fc.cjs} +1 -1
- package/dist/{voice-DTjrAgqg.js → voice-PfxY_vQg.js} +1 -1
- package/dist/{workflows-gIKukZ1O.cjs → workflows-CHKSHV4f.cjs} +33 -0
- package/dist/{workflows-D3QrUMfm.js → workflows-D5bfbang.js} +33 -0
- package/package.json +3 -3
- package/dist/dist-Bn0zFASI.js +0 -1
- package/dist/probe-image-size-BR5MlnnJ.cjs +0 -13304
- package/dist/probe-image-size-DBCcUUw_.js +0 -13297
|
@@ -3,7 +3,7 @@ import { t as defaultOptionsSchema } from "./default-options-Dir6CKnE.js";
|
|
|
3
3
|
import { n as messageHistorySchema, t as lastMessagesSchema } from "./message-history-BBVH-ORZ.js";
|
|
4
4
|
import { t as ruleGroupSchema } from "./rule-group-4pWeG61q.js";
|
|
5
5
|
import { s as snapshotConfigSchema$1 } from "./stored-workspaces-Bswuz00o.js";
|
|
6
|
-
import { E as toolProvidersSchema } from "./tool-providers-
|
|
6
|
+
import { E as toolProvidersSchema } from "./tool-providers-BN2Ni06Z.js";
|
|
7
7
|
import { z } from "zod/v4";
|
|
8
8
|
// src/server/schemas/memory-config.ts
|
|
9
9
|
/**
|
|
@@ -357,26 +357,26 @@ const snapshotConfigSchema = z.object({
|
|
|
357
357
|
name: z.string().describe("Name of the agent"),
|
|
358
358
|
description: z.string().optional().describe("Description of the agent"),
|
|
359
359
|
instructions: instructionsSchema,
|
|
360
|
-
model: conditionalFieldSchema(modelConfigSchema).describe("Model configuration
|
|
360
|
+
model: conditionalFieldSchema(modelConfigSchema).describe("Model configuration \u2014 static value or array of conditional variants"),
|
|
361
361
|
modelList: z.array(modelListEntrySchema).optional().describe("Ordered model fallback list owned by Studio"),
|
|
362
|
-
tools: conditionalFieldSchema(toolsConfigSchema).optional().describe("Tool keys mapped to per-tool config
|
|
363
|
-
defaultOptions: conditionalFieldSchema(defaultOptionsSchema).optional().describe("Default options for generate/stream calls
|
|
364
|
-
workflows: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Workflow keys with optional per-workflow config
|
|
365
|
-
agents: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Agent keys with optional per-agent config
|
|
366
|
-
integrationTools: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of tool provider IDs to their tool configurations
|
|
362
|
+
tools: conditionalFieldSchema(toolsConfigSchema).optional().describe("Tool keys mapped to per-tool config \u2014 static or conditional"),
|
|
363
|
+
defaultOptions: conditionalFieldSchema(defaultOptionsSchema).optional().describe("Default options for generate/stream calls \u2014 static or conditional"),
|
|
364
|
+
workflows: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Workflow keys with optional per-workflow config \u2014 static or conditional"),
|
|
365
|
+
agents: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Agent keys with optional per-agent config \u2014 static or conditional"),
|
|
366
|
+
integrationTools: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of tool provider IDs to their tool configurations \u2014 static or conditional"),
|
|
367
367
|
toolProviders: conditionalFieldSchema(toolProvidersSchema).optional().describe("Tool provider connections and per-tool config (provider-agnostic). Coexists with the deprecated `integrationTools` field."),
|
|
368
|
-
mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations
|
|
369
|
-
inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph
|
|
370
|
-
outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph
|
|
371
|
-
memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config
|
|
372
|
-
scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config
|
|
373
|
-
skills: conditionalFieldSchema(skillsConfigSchema).optional().describe("Skill IDs mapped to per-skill config
|
|
374
|
-
workspace: conditionalFieldSchema(workspaceRefSchema).optional().describe("Workspace reference (stored ID or inline config)
|
|
368
|
+
mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations \u2014 static or conditional"),
|
|
369
|
+
inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph \u2014 static or conditional"),
|
|
370
|
+
outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph \u2014 static or conditional"),
|
|
371
|
+
memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config \u2014 static or conditional"),
|
|
372
|
+
scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config \u2014 static or conditional"),
|
|
373
|
+
skills: conditionalFieldSchema(skillsConfigSchema).optional().describe("Skill IDs mapped to per-skill config \u2014 static or conditional"),
|
|
374
|
+
workspace: conditionalFieldSchema(workspaceRefSchema).optional().describe("Workspace reference (stored ID or inline config) \u2014 static or conditional"),
|
|
375
375
|
browser: z.union([
|
|
376
376
|
conditionalFieldSchema(browserRefSchema),
|
|
377
377
|
z.boolean(),
|
|
378
378
|
z.null()
|
|
379
|
-
]).optional().describe("Browser configuration
|
|
379
|
+
]).optional().describe("Browser configuration \u2014 object config, true (apply default), false/null (disable)"),
|
|
380
380
|
requestContextSchema: z.record(z.string(), z.unknown()).optional().describe("JSON Schema defining valid request context variables for conditional rule evaluation"),
|
|
381
381
|
durable: durableConfigSchema.optional().describe("Enable resumable streams when this agent is hydrated. Does not enable durable execution or checkpoint recovery.")
|
|
382
382
|
});
|
|
@@ -392,7 +392,7 @@ const agentMetadataSchema = z.object({
|
|
|
392
392
|
* Snapshot config schema for create where `model` is optional. When omitted, the
|
|
393
393
|
* builder applies `defaults.model` from `/editor/builder/settings` server-side.
|
|
394
394
|
*/
|
|
395
|
-
const snapshotConfigCreateSchema = snapshotConfigSchema.extend({ model: conditionalFieldSchema(modelConfigSchema).optional().describe("Model configuration
|
|
395
|
+
const snapshotConfigCreateSchema = snapshotConfigSchema.extend({ model: conditionalFieldSchema(modelConfigSchema).optional().describe("Model configuration \u2014 static value or array of conditional variants. When omitted, the builder default model is applied server-side.") });
|
|
396
396
|
/**
|
|
397
397
|
* POST /stored/agents - Create stored agent body
|
|
398
398
|
* Flat union of agent-record fields + config fields
|
|
@@ -403,12 +403,12 @@ const createStoredAgentBodySchema = z.object({
|
|
|
403
403
|
authorId: z.string().optional().describe("Author identifier for multi-tenant filtering"),
|
|
404
404
|
metadata: z.record(z.string(), z.unknown()).optional().describe("Additional metadata for the agent"),
|
|
405
405
|
visibility: z.enum(["private", "public"]).optional().describe("Agent visibility: private (owner/admin only) or public (any reader)"),
|
|
406
|
-
autoPublish: z.boolean().optional().describe("Publish the initial version so the agent resolves at status=\"published\". Defaults to true when omitted. Pass false to stage the agent as an unpublished draft
|
|
406
|
+
autoPublish: z.boolean().optional().describe("Publish the initial version so the agent resolves at status=\"published\". Defaults to true when omitted. Pass false to stage the agent as an unpublished draft \u2014 useful when overriding a code-defined agent, whose code definition keeps serving traffic until the override is published.")
|
|
407
407
|
}).merge(snapshotConfigCreateSchema);
|
|
408
408
|
/**
|
|
409
409
|
* Snapshot config schema for updates where nullable fields (like memory) can be set to null to clear them.
|
|
410
410
|
*/
|
|
411
|
-
const snapshotConfigUpdateSchema = snapshotConfigSchema.extend({ memory: z.union([conditionalFieldSchema(storedMemoryRefSchema), z.null()]).optional().describe("Memory: registered memory reference or inline config
|
|
411
|
+
const snapshotConfigUpdateSchema = snapshotConfigSchema.extend({ memory: z.union([conditionalFieldSchema(storedMemoryRefSchema), z.null()]).optional().describe("Memory: registered memory reference or inline config \u2014 static, conditional, or null to disable memory") });
|
|
412
412
|
/**
|
|
413
413
|
* PATCH /stored/agents/:storedAgentId - Update stored agent body
|
|
414
414
|
* Optional metadata-level fields + optional config fields
|
|
@@ -454,26 +454,26 @@ const storedAgentSchema = z.object({
|
|
|
454
454
|
name: z.string().describe("Name of the agent"),
|
|
455
455
|
description: z.string().optional().describe("Description of the agent"),
|
|
456
456
|
instructions: instructionsSchema,
|
|
457
|
-
model: conditionalFieldSchema(modelConfigSchema).describe("Model configuration
|
|
457
|
+
model: conditionalFieldSchema(modelConfigSchema).describe("Model configuration \u2014 static value or array of conditional variants"),
|
|
458
458
|
modelList: z.array(modelListEntrySchema).optional().describe("Ordered model fallback list owned by Studio"),
|
|
459
|
-
tools: conditionalFieldSchema(toolsConfigSchema).optional().describe("Tool keys mapped to per-tool config
|
|
460
|
-
defaultOptions: conditionalFieldSchema(defaultOptionsSchema).optional().describe("Default options for generate/stream calls
|
|
461
|
-
workflows: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Workflow keys with optional per-workflow config
|
|
462
|
-
agents: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Agent keys with optional per-agent config
|
|
463
|
-
integrationTools: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of tool provider IDs to their tool configurations
|
|
459
|
+
tools: conditionalFieldSchema(toolsConfigSchema).optional().describe("Tool keys mapped to per-tool config \u2014 static or conditional"),
|
|
460
|
+
defaultOptions: conditionalFieldSchema(defaultOptionsSchema).optional().describe("Default options for generate/stream calls \u2014 static or conditional"),
|
|
461
|
+
workflows: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Workflow keys with optional per-workflow config \u2014 static or conditional"),
|
|
462
|
+
agents: conditionalFieldSchema(z.record(z.string(), toolConfigSchema)).optional().describe("Agent keys with optional per-agent config \u2014 static or conditional"),
|
|
463
|
+
integrationTools: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of tool provider IDs to their tool configurations \u2014 static or conditional"),
|
|
464
464
|
toolProviders: conditionalFieldSchema(toolProvidersSchema).optional().describe("Tool provider connections and per-tool config (provider-agnostic). Coexists with the deprecated `integrationTools` field."),
|
|
465
|
-
mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations
|
|
466
|
-
inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph
|
|
467
|
-
outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph
|
|
468
|
-
memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config
|
|
469
|
-
scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config
|
|
470
|
-
skills: conditionalFieldSchema(skillsConfigSchema).optional().describe("Skill IDs mapped to per-skill config
|
|
471
|
-
workspace: conditionalFieldSchema(workspaceRefSchema).optional().describe("Workspace reference (stored ID or inline config)
|
|
465
|
+
mcpClients: conditionalFieldSchema(z.record(z.string(), mcpClientToolsConfigSchema)).optional().describe("Map of stored MCP client IDs to their tool configurations \u2014 static or conditional"),
|
|
466
|
+
inputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Input processor graph \u2014 static or conditional"),
|
|
467
|
+
outputProcessors: conditionalFieldSchema(storedProcessorGraphSchema).optional().describe("Output processor graph \u2014 static or conditional"),
|
|
468
|
+
memory: conditionalFieldSchema(storedMemoryRefSchema).optional().describe("Memory: registered memory reference or inline config \u2014 static or conditional"),
|
|
469
|
+
scorers: conditionalFieldSchema(z.record(z.string(), scorerConfigSchema)).optional().describe("Scorer keys with optional sampling config \u2014 static or conditional"),
|
|
470
|
+
skills: conditionalFieldSchema(skillsConfigSchema).optional().describe("Skill IDs mapped to per-skill config \u2014 static or conditional"),
|
|
471
|
+
workspace: conditionalFieldSchema(workspaceRefSchema).optional().describe("Workspace reference (stored ID or inline config) \u2014 static or conditional"),
|
|
472
472
|
browser: z.union([
|
|
473
473
|
conditionalFieldSchema(browserRefSchema),
|
|
474
474
|
z.boolean(),
|
|
475
475
|
z.null()
|
|
476
|
-
]).optional().describe("Browser configuration
|
|
476
|
+
]).optional().describe("Browser configuration \u2014 object config, true (apply default), false/null (disable)"),
|
|
477
477
|
requestContextSchema: z.record(z.string(), z.unknown()).optional().describe("JSON Schema defining valid request context variables"),
|
|
478
478
|
durable: z.union([z.boolean(), z.object({
|
|
479
479
|
maxSteps: z.number().int().positive().optional(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as createPagePaginationSchema, s as paginationInfoSchema } from "./common-J-yUnHk9.js";
|
|
2
|
-
import { f as modelConfigSchema } from "./stored-agents-
|
|
2
|
+
import { f as modelConfigSchema } from "./stored-agents-DcyDMKP2.js";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
4
|
// src/server/schemas/stored-scorers.ts
|
|
5
5
|
const storedScorerIdPathParams = z.object({ storedScorerId: z.string().describe("Unique identifier for the stored scorer definition") });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_common = require("./common-D5XxSuvu.cjs");
|
|
2
|
-
const require_stored_agents = require("./stored-agents-
|
|
2
|
+
const require_stored_agents = require("./stored-agents-BS4_LGSs.cjs");
|
|
3
3
|
let zod_v4 = require("zod/v4");
|
|
4
4
|
// src/server/schemas/stored-scorers.ts
|
|
5
5
|
const storedScorerIdPathParams = zod_v4.z.object({ storedScorerId: zod_v4.z.string().describe("Unique identifier for the stored scorer definition") });
|
|
@@ -13,7 +13,7 @@ import { z } from "zod/v4";
|
|
|
13
13
|
* - `kind` accepts all three values for forward-compat; v1 only writes
|
|
14
14
|
* `'author'`.
|
|
15
15
|
*/
|
|
16
|
-
const labelSchema = z.string().min(1, "Connection label is required").max(32, "Connection label must be
|
|
16
|
+
const labelSchema = z.string().min(1, "Connection label is required").max(32, "Connection label must be \u2264 32 characters").regex(/^[A-Za-z0-9 _-]+$/, "Connection label may only contain letters, digits, spaces, _ and -");
|
|
17
17
|
/**
|
|
18
18
|
* Per-pin identity bucketing.
|
|
19
19
|
*
|
|
@@ -119,7 +119,7 @@ const authorizeToolProviderBodySchema = z.object({
|
|
|
119
119
|
connectionId: z.string().optional().describe("Existing connection bucket id when re-authorizing; omit for a brand-new connection"),
|
|
120
120
|
toolName: z.string().optional().describe("Optional tool slug for tool-scoped authorization"),
|
|
121
121
|
config: z.record(z.string(), z.unknown()).optional().describe("Provider-specific user-supplied connection fields (e.g. subdomain)"),
|
|
122
|
-
label: z.string().min(1, "Connection label is required").max(32, "Connection label must be
|
|
122
|
+
label: z.string().min(1, "Connection label is required").max(32, "Connection label must be \u2264 32 characters").regex(/^[A-Za-z0-9 _-]+$/, "Connection label may only contain letters, digits, spaces, _ and -").nullish().describe("Optional human label to persist on the resulting tool_provider_connections row. Must match the stored connection label rules (\u2264 32 chars, [A-Za-z0-9 _-]+)."),
|
|
123
123
|
scope: connectionScopeSchema.optional().describe("Identity bucket. \"shared\" pins under SHARED_BUCKET_ID. \"caller-supplied\" pins under the request-context resourceId (returns 400 when missing). Defaults to \"per-author\".")
|
|
124
124
|
});
|
|
125
125
|
const connectionStatusToolProviderBodySchema = z.object({ items: z.array(z.object({
|
|
@@ -13,7 +13,7 @@ let zod_v4 = require("zod/v4");
|
|
|
13
13
|
* - `kind` accepts all three values for forward-compat; v1 only writes
|
|
14
14
|
* `'author'`.
|
|
15
15
|
*/
|
|
16
|
-
const labelSchema = zod_v4.z.string().min(1, "Connection label is required").max(32, "Connection label must be
|
|
16
|
+
const labelSchema = zod_v4.z.string().min(1, "Connection label is required").max(32, "Connection label must be \u2264 32 characters").regex(/^[A-Za-z0-9 _-]+$/, "Connection label may only contain letters, digits, spaces, _ and -");
|
|
17
17
|
/**
|
|
18
18
|
* Per-pin identity bucketing.
|
|
19
19
|
*
|
|
@@ -119,7 +119,7 @@ const authorizeToolProviderBodySchema = zod_v4.z.object({
|
|
|
119
119
|
connectionId: zod_v4.z.string().optional().describe("Existing connection bucket id when re-authorizing; omit for a brand-new connection"),
|
|
120
120
|
toolName: zod_v4.z.string().optional().describe("Optional tool slug for tool-scoped authorization"),
|
|
121
121
|
config: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).optional().describe("Provider-specific user-supplied connection fields (e.g. subdomain)"),
|
|
122
|
-
label: zod_v4.z.string().min(1, "Connection label is required").max(32, "Connection label must be
|
|
122
|
+
label: zod_v4.z.string().min(1, "Connection label is required").max(32, "Connection label must be \u2264 32 characters").regex(/^[A-Za-z0-9 _-]+$/, "Connection label may only contain letters, digits, spaces, _ and -").nullish().describe("Optional human label to persist on the resulting tool_provider_connections row. Must match the stored connection label rules (\u2264 32 chars, [A-Za-z0-9 _-]+)."),
|
|
123
123
|
scope: connectionScopeSchema.optional().describe("Identity bucket. \"shared\" pins under SHARED_BUCKET_ID. \"caller-supplied\" pins under the request-context resourceId (returns 400 when missing). Defaults to \"per-author\".")
|
|
124
124
|
});
|
|
125
125
|
const connectionStatusToolProviderBodySchema = zod_v4.z.object({ items: zod_v4.z.array(zod_v4.z.object({
|
|
@@ -7,7 +7,7 @@ const require_agents = require("./agents-CH_G37hG.cjs");
|
|
|
7
7
|
const require_common = require("./common-D5XxSuvu.cjs");
|
|
8
8
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
9
9
|
const require_server_handlers_agent_access = require("./server/handlers/agent-access.cjs");
|
|
10
|
-
const require_agents$1 = require("./agents-
|
|
10
|
+
const require_agents$1 = require("./agents-GHhuyz5x.cjs");
|
|
11
11
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
12
12
|
const require_server_handlers_tool_schema_overrides = require("./server/handlers/tool-schema-overrides.cjs");
|
|
13
13
|
let _mastra_core_tools = require("@mastra/core/tools");
|
|
@@ -7,7 +7,7 @@ import { D as listToolsResponseSchema, J as serializedToolSchema, S as executeTo
|
|
|
7
7
|
import { o as optionalRunIdSchema } from "./common-J-yUnHk9.js";
|
|
8
8
|
import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
9
9
|
import { listAgentsVisibleTo } from "./server/handlers/agent-access.js";
|
|
10
|
-
import { G as getAgentFromSystem } from "./agents-
|
|
10
|
+
import { G as getAgentFromSystem } from "./agents-CAXsXenf.js";
|
|
11
11
|
import { handleError } from "./server/handlers/error.js";
|
|
12
12
|
import { stripInjectedToolOverrideFields } from "./server/handlers/tool-schema-overrides.js";
|
|
13
13
|
import { isProviderDefinedTool, isVercelTool } from "@mastra/core/tools";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-10nMEhjP.cjs");
|
|
2
2
|
const require_agents = require("./agents-CH_G37hG.cjs");
|
|
3
|
-
const require_agents$1 = require("./agents-
|
|
3
|
+
const require_agents$1 = require("./agents-GHhuyz5x.cjs");
|
|
4
4
|
// src/server/handlers/voice.ts
|
|
5
5
|
var voice_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
6
6
|
GENERATE_SPEECH_DEPRECATED_ROUTE: () => GENERATE_SPEECH_DEPRECATED_ROUTE,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __exportAll } from "./rolldown-runtime-CQI-hT2b.js";
|
|
2
2
|
import { at as GET_LISTENER_ROUTE$1, ct as TRANSCRIBE_SPEECH_DEPRECATED_ROUTE$1, it as GENERATE_SPEECH_ROUTE$1, lt as TRANSCRIBE_SPEECH_ROUTE$1, ot as GET_SPEAKERS_DEPRECATED_ROUTE$1, rt as GENERATE_SPEECH_DEPRECATED_ROUTE$1, st as GET_SPEAKERS_ROUTE$1 } from "./agents-B0OpLdbp.js";
|
|
3
|
-
import { G as getAgentFromSystem } from "./agents-
|
|
3
|
+
import { G as getAgentFromSystem } from "./agents-CAXsXenf.js";
|
|
4
4
|
// src/server/handlers/voice.ts
|
|
5
5
|
var voice_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
GENERATE_SPEECH_DEPRECATED_ROUTE: () => GENERATE_SPEECH_DEPRECATED_ROUTE,
|
|
@@ -8,6 +8,7 @@ const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
|
8
8
|
const require_utils$1 = require("./utils-DQJOBnMo.cjs");
|
|
9
9
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
10
10
|
let zod_v4 = require("zod/v4");
|
|
11
|
+
let util = require("util");
|
|
11
12
|
let _mastra_core_stream = require("@mastra/core/stream");
|
|
12
13
|
// src/server/handlers/workflows.ts
|
|
13
14
|
var workflows_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
@@ -1259,6 +1260,37 @@ const workflowEventSchema = zod_v4.z.object({
|
|
|
1259
1260
|
index: zod_v4.z.number().optional(),
|
|
1260
1261
|
deliveryAttempt: zod_v4.z.number().optional()
|
|
1261
1262
|
});
|
|
1263
|
+
/** Core's internal durable-experiment workflow (`EXPERIMENT_WORKFLOW_ID`, not exported from `@mastra/core`). */
|
|
1264
|
+
const EXPERIMENT_WORKFLOW_ID = "__mastra-experiment";
|
|
1265
|
+
/** The only events a durable experiment run sends. It never suspends, resumes or time travels. */
|
|
1266
|
+
const EXPERIMENT_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
1267
|
+
"workflow.start",
|
|
1268
|
+
"workflow.step.run",
|
|
1269
|
+
"workflow.step.end",
|
|
1270
|
+
"workflow.end",
|
|
1271
|
+
"workflow.fail",
|
|
1272
|
+
"workflow.cancel"
|
|
1273
|
+
]);
|
|
1274
|
+
/**
|
|
1275
|
+
* The experiment workflow's steps read the dataset, experiment and request context from the run
|
|
1276
|
+
* input, so a pushed event must belong to a run Mastra started, be an event such a run sends, and
|
|
1277
|
+
* carry that run's stored input wherever it carries one. Starting a durable experiment saves the
|
|
1278
|
+
* run before publishing its start event.
|
|
1279
|
+
*/
|
|
1280
|
+
function assertExperimentEventMatchesRun(event, run) {
|
|
1281
|
+
if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
|
|
1282
|
+
const data = event.data;
|
|
1283
|
+
const storedInput = asJson((typeof run.snapshot === "string" ? JSON.parse(run.snapshot) : run.snapshot).context?.input);
|
|
1284
|
+
const carriedInputs = [
|
|
1285
|
+
...event.type === "workflow.start" ? [data.prevResult?.output] : [],
|
|
1286
|
+
...data.stepResults && "input" in data.stepResults ? [data.stepResults.input] : [],
|
|
1287
|
+
...data.restart?.stepResults && "input" in data.restart.stepResults ? [data.restart.stepResults.input] : []
|
|
1288
|
+
];
|
|
1289
|
+
if (!EXPERIMENT_EVENT_TYPES.has(event.type) || data.timeTravel !== void 0 || data.runId !== event.runId || carriedInputs.some((input) => !(0, util.isDeepStrictEqual)(asJson(input), storedInput))) throw new require_http_exception.HTTPException(400, { message: "Workflow event does not match its run" });
|
|
1290
|
+
}
|
|
1291
|
+
function asJson(value) {
|
|
1292
|
+
return value === void 0 ? void 0 : JSON.parse(JSON.stringify(value));
|
|
1293
|
+
}
|
|
1262
1294
|
const receiveWorkflowEventBodySchema = zod_v4.z.object({ event: workflowEventSchema.passthrough() });
|
|
1263
1295
|
const receiveWorkflowEventResponseSchema = zod_v4.z.object({
|
|
1264
1296
|
ok: zod_v4.z.boolean(),
|
|
@@ -1298,6 +1330,7 @@ const RECEIVE_WORKFLOW_EVENT_ROUTE = require_route_builder.createRoute({
|
|
|
1298
1330
|
runId: event.runId,
|
|
1299
1331
|
...typeof workflowName === "string" ? { workflowName } : {}
|
|
1300
1332
|
});
|
|
1333
|
+
if (workflowName === EXPERIMENT_WORKFLOW_ID) assertExperimentEventMatchesRun(event, existingRun);
|
|
1301
1334
|
await require_utils.validateRunOwnership(existingRun, require_utils.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
|
|
1302
1335
|
const rawCreatedAt = event.createdAt;
|
|
1303
1336
|
const createdAt = rawCreatedAt instanceof Date ? rawCreatedAt : new Date(rawCreatedAt);
|
|
@@ -8,6 +8,7 @@ import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
|
8
8
|
import { a as getWorkflowInfo, t as WorkflowRegistry } from "./utils-C2VRtQjI.js";
|
|
9
9
|
import { handleError } from "./server/handlers/error.js";
|
|
10
10
|
import { z } from "zod/v4";
|
|
11
|
+
import { isDeepStrictEqual } from "util";
|
|
11
12
|
import { createReplayStream } from "@mastra/core/stream";
|
|
12
13
|
// src/server/handlers/workflows.ts
|
|
13
14
|
var workflows_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1259,6 +1260,37 @@ const workflowEventSchema = z.object({
|
|
|
1259
1260
|
index: z.number().optional(),
|
|
1260
1261
|
deliveryAttempt: z.number().optional()
|
|
1261
1262
|
});
|
|
1263
|
+
/** Core's internal durable-experiment workflow (`EXPERIMENT_WORKFLOW_ID`, not exported from `@mastra/core`). */
|
|
1264
|
+
const EXPERIMENT_WORKFLOW_ID = "__mastra-experiment";
|
|
1265
|
+
/** The only events a durable experiment run sends. It never suspends, resumes or time travels. */
|
|
1266
|
+
const EXPERIMENT_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
1267
|
+
"workflow.start",
|
|
1268
|
+
"workflow.step.run",
|
|
1269
|
+
"workflow.step.end",
|
|
1270
|
+
"workflow.end",
|
|
1271
|
+
"workflow.fail",
|
|
1272
|
+
"workflow.cancel"
|
|
1273
|
+
]);
|
|
1274
|
+
/**
|
|
1275
|
+
* The experiment workflow's steps read the dataset, experiment and request context from the run
|
|
1276
|
+
* input, so a pushed event must belong to a run Mastra started, be an event such a run sends, and
|
|
1277
|
+
* carry that run's stored input wherever it carries one. Starting a durable experiment saves the
|
|
1278
|
+
* run before publishing its start event.
|
|
1279
|
+
*/
|
|
1280
|
+
function assertExperimentEventMatchesRun(event, run) {
|
|
1281
|
+
if (!run) throw new HTTPException(404, { message: "Workflow run not found" });
|
|
1282
|
+
const data = event.data;
|
|
1283
|
+
const storedInput = asJson((typeof run.snapshot === "string" ? JSON.parse(run.snapshot) : run.snapshot).context?.input);
|
|
1284
|
+
const carriedInputs = [
|
|
1285
|
+
...event.type === "workflow.start" ? [data.prevResult?.output] : [],
|
|
1286
|
+
...data.stepResults && "input" in data.stepResults ? [data.stepResults.input] : [],
|
|
1287
|
+
...data.restart?.stepResults && "input" in data.restart.stepResults ? [data.restart.stepResults.input] : []
|
|
1288
|
+
];
|
|
1289
|
+
if (!EXPERIMENT_EVENT_TYPES.has(event.type) || data.timeTravel !== void 0 || data.runId !== event.runId || carriedInputs.some((input) => !isDeepStrictEqual(asJson(input), storedInput))) throw new HTTPException(400, { message: "Workflow event does not match its run" });
|
|
1290
|
+
}
|
|
1291
|
+
function asJson(value) {
|
|
1292
|
+
return value === void 0 ? void 0 : JSON.parse(JSON.stringify(value));
|
|
1293
|
+
}
|
|
1262
1294
|
const receiveWorkflowEventBodySchema = z.object({ event: workflowEventSchema.passthrough() });
|
|
1263
1295
|
const receiveWorkflowEventResponseSchema = z.object({
|
|
1264
1296
|
ok: z.boolean(),
|
|
@@ -1298,6 +1330,7 @@ const RECEIVE_WORKFLOW_EVENT_ROUTE = createRoute({
|
|
|
1298
1330
|
runId: event.runId,
|
|
1299
1331
|
...typeof workflowName === "string" ? { workflowName } : {}
|
|
1300
1332
|
});
|
|
1333
|
+
if (workflowName === EXPERIMENT_WORKFLOW_ID) assertExperimentEventMatchesRun(event, existingRun);
|
|
1301
1334
|
await validateRunOwnership(existingRun, getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
|
|
1302
1335
|
const rawCreatedAt = event.createdAt;
|
|
1303
1336
|
const createdAt = rawCreatedAt instanceof Date ? rawCreatedAt : new Date(rawCreatedAt);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/server",
|
|
3
|
-
"version": "1.86.0-alpha.
|
|
3
|
+
"version": "1.86.0-alpha.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
"@internal/test-utils": "0.0.87",
|
|
133
133
|
"@internal/types-builder": "0.0.126",
|
|
134
134
|
"@internal/voice": "0.0.47",
|
|
135
|
-
"@mastra/agent-builder": "1.2.3-alpha.
|
|
136
|
-
"@mastra/core": "1.86.0-alpha.
|
|
135
|
+
"@mastra/agent-builder": "1.2.3-alpha.5",
|
|
136
|
+
"@mastra/core": "1.86.0-alpha.9",
|
|
137
137
|
"@mastra/mcp": "^2.11.0-alpha.1",
|
|
138
138
|
"@mastra/schema-compat": "1.4.1-alpha.0"
|
|
139
139
|
},
|
package/dist/dist-Bn0zFASI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { n as openai } from "./dist-Bp1bObAq.js";
|