@mastra/core 1.14.0-alpha.2 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/dist/agent/agent.d.ts +1 -1
- 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/index.cjs +18 -18
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/message-list.d.ts.map +1 -1
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/{chunk-5WKCTOYN.js → chunk-42TT3VF3.js} +5 -5
- package/dist/{chunk-5WKCTOYN.js.map → chunk-42TT3VF3.js.map} +1 -1
- package/dist/{chunk-UHO57W6H.cjs → chunk-5INB3RBA.cjs} +7 -7
- package/dist/{chunk-UHO57W6H.cjs.map → chunk-5INB3RBA.cjs.map} +1 -1
- package/dist/{chunk-OGR427FH.js → chunk-A4GHYWQL.js} +3 -3
- package/dist/{chunk-OGR427FH.js.map → chunk-A4GHYWQL.js.map} +1 -1
- package/dist/{chunk-PV2DBPYF.js → chunk-BO4B4IUE.js} +3 -3
- package/dist/{chunk-PV2DBPYF.js.map → chunk-BO4B4IUE.js.map} +1 -1
- package/dist/{chunk-2FDGDAJQ.cjs → chunk-CSDJRUU5.cjs} +3 -3
- package/dist/chunk-CSDJRUU5.cjs.map +1 -0
- package/dist/{chunk-ZSFSSMFT.cjs → chunk-D2F3AOQO.cjs} +75 -75
- package/dist/{chunk-ZSFSSMFT.cjs.map → chunk-D2F3AOQO.cjs.map} +1 -1
- package/dist/{chunk-B3KIJAOJ.cjs → chunk-EI2DWLXJ.cjs} +185 -185
- package/dist/{chunk-B3KIJAOJ.cjs.map → chunk-EI2DWLXJ.cjs.map} +1 -1
- package/dist/{chunk-LAFTYVLN.cjs → chunk-EQ7RFQAH.cjs} +55 -55
- package/dist/{chunk-LAFTYVLN.cjs.map → chunk-EQ7RFQAH.cjs.map} +1 -1
- package/dist/{chunk-FZNKE4DK.js → chunk-FBA74DL3.js} +3 -3
- package/dist/{chunk-FZNKE4DK.js.map → chunk-FBA74DL3.js.map} +1 -1
- package/dist/{chunk-QROAUTDP.js → chunk-FL2ZHQ5X.js} +3 -3
- package/dist/chunk-FL2ZHQ5X.js.map +1 -0
- package/dist/{chunk-YSQC2LEG.cjs → chunk-FS4I22PV.cjs} +9 -9
- package/dist/{chunk-YSQC2LEG.cjs.map → chunk-FS4I22PV.cjs.map} +1 -1
- package/dist/{chunk-445B4SO3.cjs → chunk-FSGRQN2S.cjs} +54 -51
- package/dist/chunk-FSGRQN2S.cjs.map +1 -0
- package/dist/{chunk-KKNT7W4Q.js → chunk-HRRDSSQ6.js} +4 -4
- package/dist/{chunk-KKNT7W4Q.js.map → chunk-HRRDSSQ6.js.map} +1 -1
- package/dist/{chunk-3TECGW34.js → chunk-I3T64TQT.js} +3 -3
- package/dist/{chunk-3TECGW34.js.map → chunk-I3T64TQT.js.map} +1 -1
- package/dist/{chunk-SRVR5Z2F.js → chunk-ICEYRAGL.js} +4 -4
- package/dist/{chunk-SRVR5Z2F.js.map → chunk-ICEYRAGL.js.map} +1 -1
- package/dist/{chunk-EAKNCJKL.cjs → chunk-K5H3MT3B.cjs} +6 -6
- package/dist/{chunk-EAKNCJKL.cjs.map → chunk-K5H3MT3B.cjs.map} +1 -1
- package/dist/{chunk-5UAF67E3.js → chunk-KJWK6VLB.js} +6 -6
- package/dist/{chunk-5UAF67E3.js.map → chunk-KJWK6VLB.js.map} +1 -1
- package/dist/{chunk-TFV75T4H.js → chunk-KWTXKBSU.js} +8 -8
- package/dist/{chunk-TFV75T4H.js.map → chunk-KWTXKBSU.js.map} +1 -1
- package/dist/{chunk-UWTB4U2X.js → chunk-MXKJEOAC.js} +19 -16
- package/dist/chunk-MXKJEOAC.js.map +1 -0
- package/dist/{chunk-W2LUCUUP.cjs → chunk-NN4C4AVA.cjs} +9 -3
- package/dist/chunk-NN4C4AVA.cjs.map +1 -0
- package/dist/{chunk-BMKSUZBT.cjs → chunk-NWC75FLU.cjs} +7 -6
- package/dist/chunk-NWC75FLU.cjs.map +1 -0
- package/dist/{chunk-XVH7SCZN.cjs → chunk-P7FGMAQE.cjs} +5 -5
- package/dist/{chunk-XVH7SCZN.cjs.map → chunk-P7FGMAQE.cjs.map} +1 -1
- package/dist/{chunk-SRNRUDZ2.cjs → chunk-PEPNSYRB.cjs} +15 -15
- package/dist/{chunk-SRNRUDZ2.cjs.map → chunk-PEPNSYRB.cjs.map} +1 -1
- package/dist/{chunk-5LHPEIQQ.js → chunk-S45RT6BL.js} +60 -8
- package/dist/chunk-S45RT6BL.js.map +1 -0
- package/dist/{chunk-II3LKO2G.js → chunk-SHQKQEG2.js} +4 -3
- package/dist/chunk-SHQKQEG2.js.map +1 -0
- package/dist/{chunk-MCAE3D3S.js → chunk-ULOKD3QT.js} +9 -3
- package/dist/chunk-ULOKD3QT.js.map +1 -0
- package/dist/{chunk-EH5D56XV.cjs → chunk-XYDSWAZO.cjs} +6 -6
- package/dist/{chunk-EH5D56XV.cjs.map → chunk-XYDSWAZO.cjs.map} +1 -1
- package/dist/{chunk-RQFAL5VW.cjs → chunk-ZLM2DHS7.cjs} +61 -9
- package/dist/chunk-ZLM2DHS7.cjs.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 +224 -224
- package/dist/docs/references/docs-memory-working-memory.md +1 -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 +11 -11
- package/dist/harness/index.js +6 -6
- package/dist/index.cjs +2 -2
- package/dist/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 +19 -1
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/memory/types.d.ts +3 -7
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-BNMQK7PL.cjs +12 -0
- package/dist/{models-dev-E24MAXL2.cjs.map → models-dev-BNMQK7PL.cjs.map} +1 -1
- package/dist/models-dev-H2QAY2CM.js +3 -0
- package/dist/{models-dev-F65PLXGJ.js.map → models-dev-H2QAY2CM.js.map} +1 -1
- package/dist/netlify-3U3NAGJ3.cjs +12 -0
- package/dist/{netlify-FT3VYX27.cjs.map → netlify-3U3NAGJ3.cjs.map} +1 -1
- package/dist/netlify-NLIEE7PE.js +3 -0
- package/dist/{netlify-NYUZ5ZTO.js.map → netlify-NLIEE7PE.js.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +42 -42
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-5OHGZ3GP.js +3 -0
- package/dist/{provider-registry-5R2TUINW.js.map → provider-registry-5OHGZ3GP.js.map} +1 -1
- package/dist/provider-registry-MKHIXI4D.cjs +40 -0
- package/dist/{provider-registry-TVYED7F2.cjs.map → provider-registry-MKHIXI4D.cjs.map} +1 -1
- package/dist/provider-registry.json +56 -4
- 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/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +24 -24
- package/dist/workflows/index.js +1 -1
- package/dist/workspace/index.cjs +67 -67
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/line-utils.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/llm/model/provider-types.generated.d.ts +19 -1
- package/dist/chunk-2FDGDAJQ.cjs.map +0 -1
- package/dist/chunk-445B4SO3.cjs.map +0 -1
- package/dist/chunk-5LHPEIQQ.js.map +0 -1
- package/dist/chunk-BMKSUZBT.cjs.map +0 -1
- package/dist/chunk-II3LKO2G.js.map +0 -1
- package/dist/chunk-MCAE3D3S.js.map +0 -1
- package/dist/chunk-QROAUTDP.js.map +0 -1
- package/dist/chunk-RQFAL5VW.cjs.map +0 -1
- package/dist/chunk-UWTB4U2X.js.map +0 -1
- package/dist/chunk-W2LUCUUP.cjs.map +0 -1
- package/dist/models-dev-E24MAXL2.cjs +0 -12
- package/dist/models-dev-F65PLXGJ.js +0 -3
- package/dist/netlify-FT3VYX27.cjs +0 -12
- package/dist/netlify-NYUZ5ZTO.js +0 -3
- package/dist/provider-registry-5R2TUINW.js +0 -3
- package/dist/provider-registry-TVYED7F2.cjs +0 -40
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { DefaultVoice } from './chunk-ZU7M6YE4.js';
|
|
2
1
|
import { PUBSUB_SYMBOL, STREAM_FORMAT_SYMBOL } from './chunk-2QXNHEDL.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { DefaultVoice } from './chunk-ZU7M6YE4.js';
|
|
3
|
+
import { createWorkspaceTools, createSkillTools, getTiktoken, BM25Index } from './chunk-SHQKQEG2.js';
|
|
4
|
+
import { InMemoryStore } from './chunk-A4GHYWQL.js';
|
|
5
|
+
import { MessageList, coreContentToString, DefaultGeneratedFile, DefaultGeneratedFileWithType, sanitizeToolName } from './chunk-ULOKD3QT.js';
|
|
6
6
|
import { parsePartialJson, isDeepEqualData, stepCountIs } from './chunk-MMLX7TES.js';
|
|
7
7
|
import { generateId, APICallError, tool, asSchema } from './chunk-6PALJNKG.js';
|
|
8
8
|
import { executeHook } from './chunk-L54GIUCB.js';
|
|
9
|
-
import { resolveModelConfig, ModelRouterEmbeddingModel, ModelRouterLanguageModel } from './chunk-
|
|
9
|
+
import { resolveModelConfig, ModelRouterEmbeddingModel, ModelRouterLanguageModel } from './chunk-KJWK6VLB.js';
|
|
10
10
|
import { MastraLLMV1 } from './chunk-7V4HN5NK.js';
|
|
11
11
|
import { noopLogger } from './chunk-PSCMWPLC.js';
|
|
12
12
|
import { EventEmitterPubSub } from './chunk-X2HAI3OX.js';
|
|
13
|
-
import { removeUndefinedValues,
|
|
13
|
+
import { removeUndefinedValues, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, generateEmptyFromSchema, selectFields, delay } from './chunk-KJUHI5QK.js';
|
|
14
14
|
import { resolveObservabilityContext, EntityType, createObservabilityContext, getOrCreateSpan, wrapMastra, executeWithContextSync } from './chunk-GVQJCS5O.js';
|
|
15
15
|
import { ToolStream } from './chunk-DD2VNRQM.js';
|
|
16
16
|
import { Tool, createTool, isMastraTool, isProviderTool, getProviderToolName, isProviderDefinedTool } from './chunk-UPXPPD5L.js';
|
|
@@ -25,7 +25,7 @@ import * as crypto2 from 'crypto';
|
|
|
25
25
|
import { randomUUID } from 'crypto';
|
|
26
26
|
import { ReadableStream as ReadableStream$1, TransformStream, WritableStream as WritableStream$1 } from 'stream/web';
|
|
27
27
|
import EventEmitter2, { EventEmitter } from 'events';
|
|
28
|
-
import { wrapSchemaWithNullTransform, isZodType
|
|
28
|
+
import { wrapSchemaWithNullTransform, isZodType, prepareJsonSchemaForOpenAIStrictMode } from '@mastra/schema-compat';
|
|
29
29
|
import { isEmpty } from 'radash';
|
|
30
30
|
import { isAbortError, injectJsonInstructionIntoMessages } from '@ai-sdk/provider-utils-v5';
|
|
31
31
|
import xxhash from 'xxhash-wasm';
|
|
@@ -2245,7 +2245,7 @@ var BaseFormatHandler = class {
|
|
|
2245
2245
|
* Checks if the original schema is a Zod schema with safeParse method.
|
|
2246
2246
|
*/
|
|
2247
2247
|
isZodSchema(schema) {
|
|
2248
|
-
return isZodType
|
|
2248
|
+
return isZodType(schema);
|
|
2249
2249
|
}
|
|
2250
2250
|
/**
|
|
2251
2251
|
* Validates a value against the schema using StandardSchemaWithJSON's validate method.
|
|
@@ -18962,7 +18962,7 @@ var Agent = class extends MastraBase {
|
|
|
18962
18962
|
this.#maxProcessorRetries = config.maxProcessorRetries;
|
|
18963
18963
|
}
|
|
18964
18964
|
if (config.requestContextSchema) {
|
|
18965
|
-
this.#requestContextSchema = config.requestContextSchema;
|
|
18965
|
+
this.#requestContextSchema = toStandardSchema(config.requestContextSchema);
|
|
18966
18966
|
}
|
|
18967
18967
|
this._agentNetworkAppend = config._agentNetworkAppend || false;
|
|
18968
18968
|
}
|
|
@@ -19006,12 +19006,15 @@ var Agent = class extends MastraBase {
|
|
|
19006
19006
|
* Throws an error if validation fails.
|
|
19007
19007
|
*/
|
|
19008
19008
|
async #validateRequestContext(requestContext) {
|
|
19009
|
-
if (this.#requestContextSchema
|
|
19009
|
+
if (this.#requestContextSchema) {
|
|
19010
19010
|
const contextValues = requestContext?.all ?? {};
|
|
19011
|
-
const
|
|
19012
|
-
if (
|
|
19013
|
-
const errors =
|
|
19014
|
-
const errorMessages = errors.map((e) =>
|
|
19011
|
+
const validation = await this.#requestContextSchema["~standard"].validate(contextValues);
|
|
19012
|
+
if (validation.issues) {
|
|
19013
|
+
const errors = validation.issues;
|
|
19014
|
+
const errorMessages = errors.map((e) => {
|
|
19015
|
+
const pathStr = e.path?.map((p) => typeof p === "object" ? p.key : p).join(".");
|
|
19016
|
+
return `- ${pathStr}: ${e.message}`;
|
|
19017
|
+
}).join("\n");
|
|
19015
19018
|
throw new MastraError({
|
|
19016
19019
|
id: "AGENT_REQUEST_CONTEXT_VALIDATION_FAILED",
|
|
19017
19020
|
domain: "AGENT" /* AGENT */,
|
|
@@ -26699,5 +26702,5 @@ var MockMemory = class extends MastraMemory {
|
|
|
26699
26702
|
};
|
|
26700
26703
|
|
|
26701
26704
|
export { Agent, BaseProcessor, BatchPartsProcessor, ChunkFrom, DefaultExecutionEngine, ExecutionEngine, FilePartSchema, ImagePartSchema, LanguageDetector, MastraAgentNetworkStream, MastraMemory, MastraModelOutput, MastraScorer, MemoryProcessor, MessageContentSchema, MessageHistory, MessagePartSchema, MockMemory, ModerationProcessor, PIIDetector, ProcessorInputPhaseSchema, ProcessorInputStepPhaseSchema, ProcessorMessageContentSchema, ProcessorMessageSchema, ProcessorOutputResultPhaseSchema, ProcessorOutputStepPhaseSchema, ProcessorOutputStreamPhaseSchema, ProcessorRunner, ProcessorState, ProcessorStepInputSchema, ProcessorStepOutputSchema, ProcessorStepSchema, PromptInjectionDetector, ReasoningPartSchema, Run, SemanticRecall, SkillsProcessor, SourcePartSchema, StepStartPartSchema, StructuredOutputProcessor, SystemPromptScrubber, TextPartSchema, TokenLimiterProcessor, ToolCallFilter, ToolInvocationPartSchema, ToolSearchProcessor, TripWire, UnicodeNormalizer, WORKING_MEMORY_END_TAG, WORKING_MEMORY_START_TAG, Workflow, WorkflowRunOutput, WorkingMemory, WorkspaceInstructionsProcessor, augmentWithInit, cleanStepResult, cloneStep, cloneWorkflow, convertFullStreamChunkToMastra, convertFullStreamChunkToUIMessageStream, convertMastraChunkToAISDKv5, createDeprecationProxy, createScorer, createStep, createTimeTravelExecutionParams, createWorkflow, extractWorkingMemoryContent, extractWorkingMemoryTags, formatCheckFeedback, formatCompletionFeedback, formatStreamCompletionFeedback, formatValidationFeedback, forwardAgentStreamChunk, generateFinalResult, generateStructuredFinalResult, getResumeLabelsByStepId, getStepIds, getStepResult, getThreadOMMetadata, globalEmbeddingCache, hydrateSerializedStepErrors, isObservationalMemoryEnabled, isProcessor, isProcessorWorkflow, isSupportedLanguageModel, loop, mapVariable, memoryDefaultOptions, parseMemoryRequestContext, removeWorkingMemoryTags, resolveThreadIdFromArgs, runChecks, runCompletionScorers, runCountDeprecationMessage, runDefaultCompletionCheck, runStreamCompletionScorers, runValidation, setThreadOMMetadata, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback, validateStepInput, validateStepRequestContext, validateStepResumeData, validateStepStateData, validateStepSuspendData };
|
|
26702
|
-
//# sourceMappingURL=chunk-
|
|
26703
|
-
//# sourceMappingURL=chunk-
|
|
26705
|
+
//# sourceMappingURL=chunk-MXKJEOAC.js.map
|
|
26706
|
+
//# sourceMappingURL=chunk-MXKJEOAC.js.map
|