@mastra/core 1.0.0-beta.6 → 1.0.0-beta.7
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 +175 -0
- package/dist/agent/agent-legacy.d.ts.map +1 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +9 -9
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts +2 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts.map +1 -1
- package/dist/{chunk-LDWBLENZ.cjs → chunk-26YAGTXK.cjs} +23 -23
- package/dist/{chunk-LDWBLENZ.cjs.map → chunk-26YAGTXK.cjs.map} +1 -1
- package/dist/{chunk-NHNXIYDG.cjs → chunk-3EYBRHB2.cjs} +2 -2
- package/dist/chunk-3EYBRHB2.cjs.map +1 -0
- package/dist/{chunk-AQAIS7FH.cjs → chunk-3JA6VPNM.cjs} +2 -2
- package/dist/chunk-3JA6VPNM.cjs.map +1 -0
- package/dist/{chunk-IWTMMUQY.cjs → chunk-4AP234N6.cjs} +4 -4
- package/dist/{chunk-IWTMMUQY.cjs.map → chunk-4AP234N6.cjs.map} +1 -1
- package/dist/{chunk-WDRA4WKG.js → chunk-4GTU7MB2.js} +5 -5
- package/dist/{chunk-WDRA4WKG.js.map → chunk-4GTU7MB2.js.map} +1 -1
- package/dist/{chunk-XY337TTF.js → chunk-5T53HHNP.js} +4 -4
- package/dist/{chunk-XY337TTF.js.map → chunk-5T53HHNP.js.map} +1 -1
- package/dist/{chunk-RTROJFEU.cjs → chunk-6C2PU6J4.cjs} +8 -8
- package/dist/{chunk-RTROJFEU.cjs.map → chunk-6C2PU6J4.cjs.map} +1 -1
- package/dist/chunk-AZQMPE7G.cjs +4981 -0
- package/dist/chunk-AZQMPE7G.cjs.map +1 -0
- package/dist/{chunk-HNHZGFZY.cjs → chunk-CZEJQSWB.cjs} +10 -2
- package/dist/chunk-CZEJQSWB.cjs.map +1 -0
- package/dist/{chunk-APMPOYPI.js → chunk-DMPHPHMU.js} +3 -3
- package/dist/{chunk-APMPOYPI.js.map → chunk-DMPHPHMU.js.map} +1 -1
- package/dist/{chunk-TS7B26US.js → chunk-EE5NIGJ4.js} +3 -3
- package/dist/{chunk-TS7B26US.js.map → chunk-EE5NIGJ4.js.map} +1 -1
- package/dist/{chunk-NIUEWICQ.js → chunk-EPMSC67U.js} +8 -8
- package/dist/{chunk-NIUEWICQ.js.map → chunk-EPMSC67U.js.map} +1 -1
- package/dist/{chunk-LEZIKVRQ.js → chunk-F54IK3GJ.js} +2 -2
- package/dist/chunk-F54IK3GJ.js.map +1 -0
- package/dist/{chunk-FYP3AT6W.js → chunk-FNSFXWDN.js} +2 -2
- package/dist/chunk-FNSFXWDN.js.map +1 -0
- package/dist/{chunk-OPALPWAM.js → chunk-G32WDDGV.js} +42 -5
- package/dist/chunk-G32WDDGV.js.map +1 -0
- package/dist/{chunk-DXMSVGJ6.js → chunk-GZ6MCDK2.js} +20 -59
- package/dist/chunk-GZ6MCDK2.js.map +1 -0
- package/dist/{chunk-S5FPOCQF.cjs → chunk-HJNEZRI4.cjs} +24 -24
- package/dist/{chunk-S5FPOCQF.cjs.map → chunk-HJNEZRI4.cjs.map} +1 -1
- package/dist/{chunk-3TKNXJES.cjs → chunk-M7CQULF7.cjs} +46 -6
- package/dist/chunk-M7CQULF7.cjs.map +1 -0
- package/dist/{chunk-TARWUQG6.js → chunk-NAKPEQEQ.js} +8 -8
- package/dist/{chunk-TARWUQG6.js.map → chunk-NAKPEQEQ.js.map} +1 -1
- package/dist/{chunk-OIMB2SNZ.cjs → chunk-PJ7AYWAX.cjs} +14 -14
- package/dist/{chunk-OIMB2SNZ.cjs.map → chunk-PJ7AYWAX.cjs.map} +1 -1
- package/dist/{chunk-7ZADRRDW.js → chunk-PK2A5WBG.js} +3 -3
- package/dist/chunk-PK2A5WBG.js.map +1 -0
- package/dist/{chunk-45NA5ZD3.js → chunk-POM7FCH5.js} +87 -22
- package/dist/chunk-POM7FCH5.js.map +1 -0
- package/dist/{chunk-NN3NOFRU.cjs → chunk-RBBEMTMA.cjs} +134 -69
- package/dist/chunk-RBBEMTMA.cjs.map +1 -0
- package/dist/chunk-TLLXRG2Z.js +4959 -0
- package/dist/chunk-TLLXRG2Z.js.map +1 -0
- package/dist/{chunk-SVLMF4UZ.cjs → chunk-TQB2HMEC.cjs} +45 -44
- package/dist/chunk-TQB2HMEC.cjs.map +1 -0
- package/dist/{chunk-KZLP6TPJ.js → chunk-URBPEE67.js} +4 -4
- package/dist/{chunk-KZLP6TPJ.js.map → chunk-URBPEE67.js.map} +1 -1
- package/dist/{chunk-6J4NRNT2.cjs → chunk-URMN7TTH.cjs} +21 -60
- package/dist/chunk-URMN7TTH.cjs.map +1 -0
- package/dist/{chunk-4KUOSXJ7.cjs → chunk-VBKMNIWK.cjs} +11 -11
- package/dist/{chunk-4KUOSXJ7.cjs.map → chunk-VBKMNIWK.cjs.map} +1 -1
- package/dist/{chunk-VRFSEZBA.cjs → chunk-YBEW5YWC.cjs} +6 -6
- package/dist/{chunk-VRFSEZBA.cjs.map → chunk-YBEW5YWC.cjs.map} +1 -1
- package/dist/{chunk-SQAX4OW6.cjs → chunk-YUXTDKYN.cjs} +15 -15
- package/dist/{chunk-SQAX4OW6.cjs.map → chunk-YUXTDKYN.cjs.map} +1 -1
- package/dist/{chunk-RHTV5C5D.cjs → chunk-YWMMBIOM.cjs} +9 -9
- package/dist/{chunk-RHTV5C5D.cjs.map → chunk-YWMMBIOM.cjs.map} +1 -1
- package/dist/{chunk-6GOLI2EY.js → chunk-Z4Y554NX.js} +3 -3
- package/dist/{chunk-6GOLI2EY.js.map → chunk-Z4Y554NX.js.map} +1 -1
- package/dist/{chunk-WMAMOYRR.js → chunk-Z57R5WS4.js} +4 -4
- package/dist/{chunk-WMAMOYRR.js.map → chunk-Z57R5WS4.js.map} +1 -1
- package/dist/{chunk-QM5SRDJX.js → chunk-ZUWJCGLM.js} +5 -4
- package/dist/chunk-ZUWJCGLM.js.map +1 -0
- package/dist/evals/index.cjs +9 -9
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +15 -15
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/gateways/constants.d.ts.map +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/provider-options.d.ts +4 -1
- package/dist/llm/model/provider-options.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +8 -22
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +6 -6
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-6GD3644V.js +3 -0
- package/dist/{models-dev-F6MTIYTO.js.map → models-dev-6GD3644V.js.map} +1 -1
- package/dist/models-dev-IUQBXJSS.cjs +12 -0
- package/dist/{models-dev-XIVR5EJV.cjs.map → models-dev-IUQBXJSS.cjs.map} +1 -1
- package/dist/netlify-GXJ5D5DD.js +3 -0
- package/dist/{netlify-C2YBIK7A.js.map → netlify-GXJ5D5DD.js.map} +1 -1
- package/dist/netlify-KJLY3GFS.cjs +12 -0
- package/dist/{netlify-XWROOTP4.cjs.map → netlify-KJLY3GFS.cjs.map} +1 -1
- package/dist/observability/index.cjs +10 -10
- package/dist/observability/index.js +1 -1
- package/dist/observability/types/tracing.d.ts +18 -0
- package/dist/observability/types/tracing.d.ts.map +1 -1
- package/dist/processors/index.cjs +17 -17
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-7IFOXWPR.cjs +40 -0
- package/dist/{provider-registry-BXX7CA3H.cjs.map → provider-registry-7IFOXWPR.cjs.map} +1 -1
- package/dist/provider-registry-ZTMZMTVV.js +3 -0
- package/dist/{provider-registry-GRYJWVEM.js.map → provider-registry-ZTMZMTVV.js.map} +1 -1
- package/dist/provider-registry.json +16 -55
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +1 -1
- package/dist/storage/base.d.ts +22 -1
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/index.cjs +43 -31
- package/dist/storage/index.js +1 -1
- package/dist/storage/storageWithInit.d.ts.map +1 -1
- package/dist/storage/utils.d.ts +38 -0
- package/dist/storage/utils.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +3 -2
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/input.d.ts +4 -1
- package/dist/stream/aisdk/v5/input.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/test-utils/llm-mock.cjs +13 -13
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.js +6 -6
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/tools/index.cjs +2 -2
- package/dist/tools/index.js +1 -1
- package/dist/tools/stream.d.ts +17 -1
- package/dist/tools/stream.d.ts.map +1 -1
- package/dist/tools/types.d.ts +2 -2
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils.cjs +22 -22
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.js +1 -1
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +20 -20
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/step.d.ts +1 -2
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +1 -0
- package/dist/workflows/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/llm/model/provider-types.generated.d.ts +8 -22
- package/dist/chunk-3TKNXJES.cjs.map +0 -1
- package/dist/chunk-45NA5ZD3.js.map +0 -1
- package/dist/chunk-6J4NRNT2.cjs.map +0 -1
- package/dist/chunk-7ZADRRDW.js.map +0 -1
- package/dist/chunk-AQAIS7FH.cjs.map +0 -1
- package/dist/chunk-DXMSVGJ6.js.map +0 -1
- package/dist/chunk-FYP3AT6W.js.map +0 -1
- package/dist/chunk-HNHZGFZY.cjs.map +0 -1
- package/dist/chunk-LEZIKVRQ.js.map +0 -1
- package/dist/chunk-NHNXIYDG.cjs.map +0 -1
- package/dist/chunk-NN3NOFRU.cjs.map +0 -1
- package/dist/chunk-OPALPWAM.js.map +0 -1
- package/dist/chunk-QGWNF2QJ.cjs +0 -1697
- package/dist/chunk-QGWNF2QJ.cjs.map +0 -1
- package/dist/chunk-QM5SRDJX.js.map +0 -1
- package/dist/chunk-SVLMF4UZ.cjs.map +0 -1
- package/dist/chunk-T2UNO766.js +0 -1694
- package/dist/chunk-T2UNO766.js.map +0 -1
- package/dist/models-dev-F6MTIYTO.js +0 -3
- package/dist/models-dev-XIVR5EJV.cjs +0 -12
- package/dist/netlify-C2YBIK7A.js +0 -3
- package/dist/netlify-XWROOTP4.cjs +0 -12
- package/dist/provider-registry-BXX7CA3H.cjs +0 -40
- package/dist/provider-registry-GRYJWVEM.js +0 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DefaultVoice } from './chunk-F2GAJSBI.js';
|
|
2
2
|
import { EMITTER_SYMBOL, STREAM_FORMAT_SYMBOL } from './chunk-NLNKQD2T.js';
|
|
3
|
-
import { InMemoryStore } from './chunk-
|
|
4
|
-
import { MessageList, DefaultGeneratedFile, DefaultGeneratedFileWithType } from './chunk-
|
|
5
|
-
import { ModelRouterEmbeddingModel, resolveModelConfig } from './chunk-
|
|
6
|
-
import { MastraLLMV1 } from './chunk-
|
|
3
|
+
import { InMemoryStore } from './chunk-G32WDDGV.js';
|
|
4
|
+
import { MessageList, DefaultGeneratedFile, DefaultGeneratedFileWithType } from './chunk-DMPHPHMU.js';
|
|
5
|
+
import { ModelRouterEmbeddingModel, resolveModelConfig } from './chunk-NAKPEQEQ.js';
|
|
6
|
+
import { MastraLLMV1 } from './chunk-4GTU7MB2.js';
|
|
7
7
|
import { executeHook } from './chunk-L54GIUCB.js';
|
|
8
|
-
import { removeUndefinedValues, deepMerge, ensureToolProperties, makeCoreTool, createMastraProxy, isZodType, selectFields, delay } from './chunk-
|
|
9
|
-
import { getOrCreateSpan, wrapMastra, executeWithContextSync } from './chunk-
|
|
8
|
+
import { removeUndefinedValues, deepMerge, ensureToolProperties, makeCoreTool, createMastraProxy, isZodType, selectFields, delay } from './chunk-URBPEE67.js';
|
|
9
|
+
import { getOrCreateSpan, wrapMastra, executeWithContextSync } from './chunk-FNSFXWDN.js';
|
|
10
10
|
import { MastraError, getErrorFromUnknown } from './chunk-JJ5O45LH.js';
|
|
11
|
-
import { ToolStream } from './chunk-
|
|
11
|
+
import { ToolStream } from './chunk-F54IK3GJ.js';
|
|
12
12
|
import { Tool, createTool } from './chunk-4F6RAJFU.js';
|
|
13
13
|
import { RequestContext, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY } from './chunk-6TBWJV35.js';
|
|
14
14
|
import { zodToJsonSchema as zodToJsonSchema$1 } from './chunk-PJKCPRYF.js';
|
|
@@ -3203,10 +3203,11 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
3203
3203
|
}
|
|
3204
3204
|
});
|
|
3205
3205
|
}
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3206
|
+
return {
|
|
3207
|
+
...result2,
|
|
3208
|
+
...lastOutput.result.status === "suspended" && params.outputOptions?.includeResumeLabels ? { resumeLabels: lastOutput.mutableContext.resumeLabels } : {},
|
|
3209
|
+
...params.outputOptions?.includeState ? { state: lastState } : {}
|
|
3210
|
+
};
|
|
3210
3211
|
}
|
|
3211
3212
|
}
|
|
3212
3213
|
const result = await this.fmtReturnValue(params.emitter, stepResults, lastOutput.result);
|
|
@@ -6250,18 +6251,39 @@ function convertMastraChunkToAISDKv5({
|
|
|
6250
6251
|
}
|
|
6251
6252
|
|
|
6252
6253
|
// src/stream/aisdk/v5/input.ts
|
|
6254
|
+
function isNumericId(id) {
|
|
6255
|
+
return /^\d+$/.test(id);
|
|
6256
|
+
}
|
|
6253
6257
|
var AISDKV5InputStream = class extends MastraModelInput {
|
|
6254
|
-
|
|
6258
|
+
#generateId;
|
|
6259
|
+
constructor({
|
|
6260
|
+
component,
|
|
6261
|
+
name,
|
|
6262
|
+
generateId: generateId3
|
|
6263
|
+
}) {
|
|
6255
6264
|
super({ component, name });
|
|
6265
|
+
this.#generateId = generateId3 ?? generateId;
|
|
6256
6266
|
}
|
|
6257
6267
|
async transform({
|
|
6258
6268
|
runId,
|
|
6259
6269
|
stream,
|
|
6260
6270
|
controller
|
|
6261
6271
|
}) {
|
|
6272
|
+
const idMap = /* @__PURE__ */ new Map();
|
|
6262
6273
|
for await (const chunk of stream) {
|
|
6263
|
-
const
|
|
6274
|
+
const rawChunk = chunk;
|
|
6275
|
+
if (rawChunk.type === "stream-start") {
|
|
6276
|
+
idMap.clear();
|
|
6277
|
+
}
|
|
6278
|
+
const transformedChunk = convertFullStreamChunkToMastra(rawChunk, { runId });
|
|
6264
6279
|
if (transformedChunk) {
|
|
6280
|
+
if ((transformedChunk.type === "text-start" || transformedChunk.type === "text-delta" || transformedChunk.type === "text-end") && transformedChunk.payload?.id && isNumericId(transformedChunk.payload.id)) {
|
|
6281
|
+
const originalId = transformedChunk.payload.id;
|
|
6282
|
+
if (!idMap.has(originalId)) {
|
|
6283
|
+
idMap.set(originalId, this.#generateId());
|
|
6284
|
+
}
|
|
6285
|
+
transformedChunk.payload.id = idMap.get(originalId);
|
|
6286
|
+
}
|
|
6265
6287
|
controller.enqueue(transformedChunk);
|
|
6266
6288
|
}
|
|
6267
6289
|
}
|
|
@@ -6290,11 +6312,13 @@ function execute({
|
|
|
6290
6312
|
structuredOutput,
|
|
6291
6313
|
headers,
|
|
6292
6314
|
shouldThrowError,
|
|
6293
|
-
methodType
|
|
6315
|
+
methodType,
|
|
6316
|
+
generateId: generateId3
|
|
6294
6317
|
}) {
|
|
6295
6318
|
const v5 = new AISDKV5InputStream({
|
|
6296
6319
|
component: "LLM",
|
|
6297
|
-
name: model.modelId
|
|
6320
|
+
name: model.modelId,
|
|
6321
|
+
generateId: generateId3
|
|
6298
6322
|
});
|
|
6299
6323
|
const toolsAndToolChoice = prepareToolsAndToolChoice({
|
|
6300
6324
|
tools,
|
|
@@ -6952,6 +6976,7 @@ function createLLMExecutionStep({
|
|
|
6952
6976
|
structuredOutput,
|
|
6953
6977
|
headers,
|
|
6954
6978
|
methodType,
|
|
6979
|
+
generateId: _internal?.generateId,
|
|
6955
6980
|
onResult: ({
|
|
6956
6981
|
warnings: warningsFromStream,
|
|
6957
6982
|
request: requestFromStream,
|
|
@@ -7767,6 +7792,31 @@ function workflowLoopStream({
|
|
|
7767
7792
|
requestContext
|
|
7768
7793
|
});
|
|
7769
7794
|
if (executionResult.status !== "success") {
|
|
7795
|
+
if (executionResult.status === "failed") {
|
|
7796
|
+
let executionResultError = executionResult.error;
|
|
7797
|
+
if (typeof executionResult.error === "string") {
|
|
7798
|
+
const prependedErrorString = "Error: ";
|
|
7799
|
+
if (executionResult.error.startsWith(`${prependedErrorString}${prependedErrorString}`)) {
|
|
7800
|
+
executionResultError = executionResult.error.substring(
|
|
7801
|
+
`${prependedErrorString}${prependedErrorString}`.length
|
|
7802
|
+
);
|
|
7803
|
+
} else if (executionResult.error.startsWith(prependedErrorString)) {
|
|
7804
|
+
executionResultError = executionResult.error.substring(prependedErrorString.length);
|
|
7805
|
+
}
|
|
7806
|
+
}
|
|
7807
|
+
const error = getErrorFromUnknown(executionResultError, {
|
|
7808
|
+
fallbackMessage: "Unknown error in agent workflow stream"
|
|
7809
|
+
});
|
|
7810
|
+
controller.enqueue({
|
|
7811
|
+
type: "error",
|
|
7812
|
+
runId,
|
|
7813
|
+
from: "AGENT" /* AGENT */,
|
|
7814
|
+
payload: { error }
|
|
7815
|
+
});
|
|
7816
|
+
if (rest.options?.onError) {
|
|
7817
|
+
await rest.options?.onError?.({ error });
|
|
7818
|
+
}
|
|
7819
|
+
}
|
|
7770
7820
|
controller.close();
|
|
7771
7821
|
return;
|
|
7772
7822
|
}
|
|
@@ -8015,6 +8065,7 @@ var MastraLLMVNext = class extends MastraBase {
|
|
|
8015
8065
|
resourceId,
|
|
8016
8066
|
structuredOutput,
|
|
8017
8067
|
options,
|
|
8068
|
+
inputProcessors,
|
|
8018
8069
|
outputProcessors,
|
|
8019
8070
|
returnScorerData,
|
|
8020
8071
|
providerOptions,
|
|
@@ -8078,6 +8129,7 @@ var MastraLLMVNext = class extends MastraBase {
|
|
|
8078
8129
|
providerOptions,
|
|
8079
8130
|
_internal,
|
|
8080
8131
|
structuredOutput,
|
|
8132
|
+
inputProcessors,
|
|
8081
8133
|
outputProcessors,
|
|
8082
8134
|
returnScorerData,
|
|
8083
8135
|
modelSpanTracker,
|
|
@@ -8148,7 +8200,9 @@ var MastraLLMVNext = class extends MastraBase {
|
|
|
8148
8200
|
totalTokens: props?.totalUsage?.totalTokens,
|
|
8149
8201
|
reasoningTokens: props?.totalUsage?.reasoningTokens,
|
|
8150
8202
|
cachedInputTokens: props?.totalUsage?.cachedInputTokens
|
|
8151
|
-
}
|
|
8203
|
+
},
|
|
8204
|
+
responseId: props?.response.id,
|
|
8205
|
+
responseModel: props?.response.modelId
|
|
8152
8206
|
}
|
|
8153
8207
|
});
|
|
8154
8208
|
try {
|
|
@@ -9506,6 +9560,7 @@ var AgentLegacyHandler = class {
|
|
|
9506
9560
|
},
|
|
9507
9561
|
attributes: {
|
|
9508
9562
|
agentId: this.capabilities.id,
|
|
9563
|
+
agentName: this.capabilities.name,
|
|
9509
9564
|
instructions: this.capabilities.convertInstructionsToString(instructions),
|
|
9510
9565
|
availableTools: [
|
|
9511
9566
|
...toolsets ? Object.keys(toolsets) : [],
|
|
@@ -12073,7 +12128,7 @@ var BatchPartsProcessor = class {
|
|
|
12073
12128
|
const combinedText = textChunks.map((part) => part.type === "text-delta" ? part.payload.text : "").join("");
|
|
12074
12129
|
const combinedChunk = {
|
|
12075
12130
|
type: "text-delta",
|
|
12076
|
-
payload: { text: combinedText, id: "1" },
|
|
12131
|
+
payload: { text: combinedText, id: "text-1" },
|
|
12077
12132
|
runId: "1",
|
|
12078
12133
|
from: "AGENT" /* AGENT */
|
|
12079
12134
|
};
|
|
@@ -12760,6 +12815,9 @@ var isAugmentedSymbol = Symbol("isAugmented");
|
|
|
12760
12815
|
function augmentWithInit(storage) {
|
|
12761
12816
|
let hasInitialized = null;
|
|
12762
12817
|
const ensureInit = async () => {
|
|
12818
|
+
if (storage.disableInit) {
|
|
12819
|
+
return;
|
|
12820
|
+
}
|
|
12763
12821
|
if (!hasInitialized) {
|
|
12764
12822
|
hasInitialized = storage.init();
|
|
12765
12823
|
}
|
|
@@ -14063,6 +14121,9 @@ function createMapResultsStep({
|
|
|
14063
14121
|
const structuredProcessor = new StructuredOutputProcessor(options.structuredOutput);
|
|
14064
14122
|
effectiveOutputProcessors = effectiveOutputProcessors ? [...effectiveOutputProcessors, structuredProcessor] : [structuredProcessor];
|
|
14065
14123
|
}
|
|
14124
|
+
const effectiveInputProcessors = options.inputProcessors || (capabilities.inputProcessors ? typeof capabilities.inputProcessors === "function" ? await capabilities.inputProcessors({
|
|
14125
|
+
requestContext: result.requestContext
|
|
14126
|
+
}) : capabilities.inputProcessors : []);
|
|
14066
14127
|
const messageList = memoryData.messageList;
|
|
14067
14128
|
const modelMethodType = getModelMethodFromAgentMethod(methodType);
|
|
14068
14129
|
const loopOptions = {
|
|
@@ -14129,6 +14190,7 @@ function createMapResultsStep({
|
|
|
14129
14190
|
abortSignal: options.abortSignal
|
|
14130
14191
|
},
|
|
14131
14192
|
structuredOutput: options.structuredOutput,
|
|
14193
|
+
inputProcessors: effectiveInputProcessors,
|
|
14132
14194
|
outputProcessors: effectiveOutputProcessors,
|
|
14133
14195
|
modelSettings: {
|
|
14134
14196
|
temperature: 0,
|
|
@@ -14275,7 +14337,7 @@ function createPrepareMemoryStep({
|
|
|
14275
14337
|
title: thread.title,
|
|
14276
14338
|
memoryConfig,
|
|
14277
14339
|
resourceId,
|
|
14278
|
-
saveThread:
|
|
14340
|
+
saveThread: true
|
|
14279
14341
|
});
|
|
14280
14342
|
}
|
|
14281
14343
|
requestContext.set("MastraMemory", {
|
|
@@ -15774,10 +15836,10 @@ var Agent = class extends MastraBase {
|
|
|
15774
15836
|
subAgentThreadId: z.string().describe("The thread ID of the agent").optional(),
|
|
15775
15837
|
subAgentResourceId: z.string().describe("The resource ID of the agent").optional()
|
|
15776
15838
|
});
|
|
15777
|
-
const modelVersion = (await agent.getModel()).specificationVersion;
|
|
15839
|
+
const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
|
|
15778
15840
|
const toolObj = createTool({
|
|
15779
15841
|
id: `agent-${agentName}`,
|
|
15780
|
-
description: `Agent: ${agentName}`,
|
|
15842
|
+
description: agent.getDescription() || `Agent: ${agentName}`,
|
|
15781
15843
|
inputSchema: agentInputSchema,
|
|
15782
15844
|
outputSchema: agentOutputSchema,
|
|
15783
15845
|
mastra: this.#mastra,
|
|
@@ -16423,6 +16485,8 @@ var Agent = class extends MastraBase {
|
|
|
16423
16485
|
input: options.messages,
|
|
16424
16486
|
attributes: {
|
|
16425
16487
|
agentId: this.id,
|
|
16488
|
+
agentName: this.name,
|
|
16489
|
+
conversationId: threadFromArgs?.id,
|
|
16426
16490
|
instructions: this.#convertInstructionsToString(instructions)
|
|
16427
16491
|
},
|
|
16428
16492
|
metadata: {
|
|
@@ -16456,6 +16520,7 @@ var Agent = class extends MastraBase {
|
|
|
16456
16520
|
getMemoryMessages: this.getMemoryMessages.bind(this),
|
|
16457
16521
|
runInputProcessors: this.__runInputProcessors.bind(this),
|
|
16458
16522
|
executeOnFinish: this.#executeOnFinish.bind(this),
|
|
16523
|
+
inputProcessors: async ({ requestContext: requestContext2 }) => this.listResolvedInputProcessors(requestContext2),
|
|
16459
16524
|
outputProcessors: async ({ requestContext: requestContext2 }) => this.listResolvedOutputProcessors(requestContext2),
|
|
16460
16525
|
llm
|
|
16461
16526
|
};
|
|
@@ -18731,5 +18796,5 @@ var MastraModelOutput = class extends MastraBase {
|
|
|
18731
18796
|
};
|
|
18732
18797
|
|
|
18733
18798
|
export { AISDKV5OutputStream, Agent, BatchPartsProcessor, ChunkFrom, DefaultExecutionEngine, ExecutionEngine, LanguageDetector, MastraAgentNetworkStream, MastraMemory, MastraModelOutput, MemoryProcessor, MessageHistory, MockMemory, ModerationProcessor, PIIDetector, ProcessorRunner, ProcessorState, PromptInjectionDetector, Run, SemanticRecall, StructuredOutputProcessor, SystemPromptScrubber, TokenLimiterProcessor, ToolCallFilter, TripWire, UnicodeNormalizer, Workflow, WorkflowRunOutput, WorkingMemory, augmentWithInit, cloneStep, cloneWorkflow, convertFullStreamChunkToUIMessageStream, convertMastraChunkToAISDKv5, createDeprecationProxy, createStep, createTimeTravelExecutionParams, createWorkflow, getResumeLabelsByStepId, getStepIds, getStepResult, getZodErrors, loop, mapVariable, memoryDefaultOptions, parseMemoryRuntimeContext, resolveThreadIdFromArgs, runCountDeprecationMessage, tryGenerateWithJsonFallback, tryStreamWithJsonFallback, validateStepInput, validateStepResumeData, validateStepSuspendData };
|
|
18734
|
-
//# sourceMappingURL=chunk-
|
|
18735
|
-
//# sourceMappingURL=chunk-
|
|
18799
|
+
//# sourceMappingURL=chunk-POM7FCH5.js.map
|
|
18800
|
+
//# sourceMappingURL=chunk-POM7FCH5.js.map
|