@mastra/core 1.13.0-alpha.0 → 1.13.1
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 +54 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/{chunk-TBJAIP6B.js → chunk-2QU52I7Q.js} +4 -4
- package/dist/{chunk-TBJAIP6B.js.map → chunk-2QU52I7Q.js.map} +1 -1
- package/dist/{chunk-I6VMOC3Y.cjs → chunk-334VHLAR.cjs} +30 -30
- package/dist/{chunk-I6VMOC3Y.cjs.map → chunk-334VHLAR.cjs.map} +1 -1
- package/dist/{chunk-TULJME43.js → chunk-5QTS4EAT.js} +5 -5
- package/dist/{chunk-TULJME43.js.map → chunk-5QTS4EAT.js.map} +1 -1
- package/dist/{chunk-T4XSYZME.cjs → chunk-6IM3BPH2.cjs} +7 -7
- package/dist/{chunk-T4XSYZME.cjs.map → chunk-6IM3BPH2.cjs.map} +1 -1
- package/dist/{chunk-7XUAWSN5.cjs → chunk-6Q3ZFEII.cjs} +3 -3
- package/dist/chunk-6Q3ZFEII.cjs.map +1 -0
- package/dist/{chunk-DUJXXOGE.js → chunk-7UM6FE6A.js} +3 -3
- package/dist/{chunk-DUJXXOGE.js.map → chunk-7UM6FE6A.js.map} +1 -1
- package/dist/{chunk-RF7AUUHZ.cjs → chunk-7XDXDITO.cjs} +7 -7
- package/dist/{chunk-RF7AUUHZ.cjs.map → chunk-7XDXDITO.cjs.map} +1 -1
- package/dist/{chunk-ZS5PC5U5.js → chunk-AMNS5DF2.js} +8 -8
- package/dist/{chunk-ZS5PC5U5.js.map → chunk-AMNS5DF2.js.map} +1 -1
- package/dist/{chunk-AV22GHNZ.js → chunk-B3GKSY42.js} +3 -3
- package/dist/chunk-B3GKSY42.js.map +1 -0
- package/dist/{chunk-KQXXSDJK.cjs → chunk-CVHX5NQY.cjs} +15 -15
- package/dist/{chunk-KQXXSDJK.cjs.map → chunk-CVHX5NQY.cjs.map} +1 -1
- package/dist/{chunk-LNEBCHJZ.cjs → chunk-CYZJ2HT2.cjs} +16 -16
- package/dist/{chunk-LNEBCHJZ.cjs.map → chunk-CYZJ2HT2.cjs.map} +1 -1
- package/dist/{chunk-AIHI4CR3.cjs → chunk-DE2ZO3EV.cjs} +51 -51
- package/dist/{chunk-AIHI4CR3.cjs.map → chunk-DE2ZO3EV.cjs.map} +1 -1
- package/dist/{chunk-ZCIYZUTT.cjs → chunk-E7PW4ZAB.cjs} +3 -3
- package/dist/{chunk-ZCIYZUTT.cjs.map → chunk-E7PW4ZAB.cjs.map} +1 -1
- package/dist/{chunk-QKBTNVET.js → chunk-FERHLP5X.js} +4 -4
- package/dist/{chunk-QKBTNVET.js.map → chunk-FERHLP5X.js.map} +1 -1
- package/dist/{chunk-F57J45BC.js → chunk-FNVUZ3S2.js} +4 -4
- package/dist/{chunk-F57J45BC.js.map → chunk-FNVUZ3S2.js.map} +1 -1
- package/dist/{chunk-UWZSAUOC.js → chunk-GP4MO5B6.js} +9 -8
- package/dist/chunk-GP4MO5B6.js.map +1 -0
- package/dist/{chunk-O4ID5LLN.cjs → chunk-HACNMOMO.cjs} +24 -24
- package/dist/{chunk-O4ID5LLN.cjs.map → chunk-HACNMOMO.cjs.map} +1 -1
- package/dist/{chunk-VLQRMYCU.js → chunk-IBB623FC.js} +7 -7
- package/dist/{chunk-VLQRMYCU.js.map → chunk-IBB623FC.js.map} +1 -1
- package/dist/{chunk-OT4YBOYT.cjs → chunk-J333Z653.cjs} +9 -9
- package/dist/{chunk-OT4YBOYT.cjs.map → chunk-J333Z653.cjs.map} +1 -1
- package/dist/{chunk-MHEZRQTB.js → chunk-LYABHLZT.js} +3 -3
- package/dist/{chunk-MHEZRQTB.js.map → chunk-LYABHLZT.js.map} +1 -1
- package/dist/{chunk-E7EYGTV2.cjs → chunk-P2F6NZPK.cjs} +185 -185
- package/dist/{chunk-E7EYGTV2.cjs.map → chunk-P2F6NZPK.cjs.map} +1 -1
- package/dist/{chunk-MYDWI26N.js → chunk-R5GYOR52.js} +3 -3
- package/dist/{chunk-MYDWI26N.js.map → chunk-R5GYOR52.js.map} +1 -1
- package/dist/{chunk-M3YX6I4U.js → chunk-RGG5FM37.js} +4 -4
- package/dist/{chunk-M3YX6I4U.js.map → chunk-RGG5FM37.js.map} +1 -1
- package/dist/{chunk-D3LPAKB6.js → chunk-RHU25VWO.js} +3 -3
- package/dist/{chunk-D3LPAKB6.js.map → chunk-RHU25VWO.js.map} +1 -1
- package/dist/{chunk-RHKJ6WAK.cjs → chunk-S255NXHH.cjs} +54 -53
- package/dist/chunk-S255NXHH.cjs.map +1 -0
- package/dist/{chunk-CLPYWUCZ.cjs → chunk-SHN25XWN.cjs} +9 -9
- package/dist/{chunk-CLPYWUCZ.cjs.map → chunk-SHN25XWN.cjs.map} +1 -1
- package/dist/{chunk-ED7ICYXC.cjs → chunk-UAVVTLHL.cjs} +5 -5
- package/dist/{chunk-ED7ICYXC.cjs.map → chunk-UAVVTLHL.cjs.map} +1 -1
- package/dist/{chunk-KOIL5ZZE.cjs → chunk-V2NCW7QL.cjs} +5 -5
- package/dist/{chunk-KOIL5ZZE.cjs.map → chunk-V2NCW7QL.cjs.map} +1 -1
- package/dist/{chunk-XEBKZ4YL.js → chunk-YWZ4XNJQ.js} +4 -4
- package/dist/{chunk-XEBKZ4YL.js.map → chunk-YWZ4XNJQ.js.map} +1 -1
- package/dist/{chunk-ELX7FKS6.cjs → chunk-Z7DIN6EF.cjs} +6 -6
- package/dist/{chunk-ELX7FKS6.cjs.map → chunk-Z7DIN6EF.cjs.map} +1 -1
- package/dist/{chunk-M6T2TWG3.js → chunk-ZNIHEZDL.js} +3 -3
- package/dist/{chunk-M6T2TWG3.js.map → chunk-ZNIHEZDL.js.map} +1 -1
- package/dist/{chunk-7IOPLGJX.js → chunk-ZX4VFWA4.js} +3 -3
- package/dist/{chunk-7IOPLGJX.js.map → chunk-ZX4VFWA4.js.map} +1 -1
- 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 +310 -310
- package/dist/docs/references/docs-memory-overview.md +3 -3
- 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/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/models-dev-J6H4MDDS.js +3 -0
- package/dist/{models-dev-WZV7KXO6.js.map → models-dev-J6H4MDDS.js.map} +1 -1
- package/dist/models-dev-NNNX6HMQ.cjs +12 -0
- package/dist/{models-dev-PF6BNK5U.cjs.map → models-dev-NNNX6HMQ.cjs.map} +1 -1
- package/dist/netlify-3DEYXRVR.cjs +12 -0
- package/dist/{netlify-DAYWB6TP.cjs.map → netlify-3DEYXRVR.cjs.map} +1 -1
- package/dist/netlify-45XINYG6.js +3 -0
- package/dist/{netlify-2TIV7DOF.js.map → netlify-45XINYG6.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-LSMHTOLE.cjs +40 -0
- package/dist/{provider-registry-DTJQ3BMU.cjs.map → provider-registry-LSMHTOLE.cjs.map} +1 -1
- package/dist/provider-registry-YCFZ6HTH.js +3 -0
- package/dist/{provider-registry-Z3GQXZ4X.js.map → provider-registry-YCFZ6HTH.js.map} +1 -1
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/index.cjs +140 -140
- package/dist/storage/index.js +1 -1
- package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
- package/dist/stream/index.cjs +8 -8
- package/dist/stream/index.js +1 -1
- 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 +6 -6
- 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/utils.cjs +23 -23
- 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 +67 -67
- package/dist/workspace/index.js +1 -1
- package/package.json +10 -10
- package/dist/chunk-7XUAWSN5.cjs.map +0 -1
- package/dist/chunk-AV22GHNZ.js.map +0 -1
- package/dist/chunk-RHKJ6WAK.cjs.map +0 -1
- package/dist/chunk-UWZSAUOC.js.map +0 -1
- package/dist/models-dev-PF6BNK5U.cjs +0 -12
- package/dist/models-dev-WZV7KXO6.js +0 -3
- package/dist/netlify-2TIV7DOF.js +0 -3
- package/dist/netlify-DAYWB6TP.cjs +0 -12
- package/dist/provider-registry-DTJQ3BMU.cjs +0 -40
- package/dist/provider-registry-Z3GQXZ4X.js +0 -3
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkB67DPK7Q_cjs = require('./chunk-B67DPK7Q.cjs');
|
|
4
4
|
var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkHACNMOMO_cjs = require('./chunk-HACNMOMO.cjs');
|
|
6
|
+
var chunkSHN25XWN_cjs = require('./chunk-SHN25XWN.cjs');
|
|
7
7
|
var chunkCLKMJINC_cjs = require('./chunk-CLKMJINC.cjs');
|
|
8
8
|
var chunkFXGVRQSG_cjs = require('./chunk-FXGVRQSG.cjs');
|
|
9
9
|
var chunkSPDQUG6O_cjs = require('./chunk-SPDQUG6O.cjs');
|
|
10
10
|
var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var chunk334VHLAR_cjs = require('./chunk-334VHLAR.cjs');
|
|
12
|
+
var chunk6IM3BPH2_cjs = require('./chunk-6IM3BPH2.cjs');
|
|
13
13
|
var chunk6BJ7XHRH_cjs = require('./chunk-6BJ7XHRH.cjs');
|
|
14
14
|
var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
|
|
15
|
-
var
|
|
15
|
+
var chunkCYZJ2HT2_cjs = require('./chunk-CYZJ2HT2.cjs');
|
|
16
16
|
var chunkW26XAFT3_cjs = require('./chunk-W26XAFT3.cjs');
|
|
17
17
|
var chunkKJBMTK5B_cjs = require('./chunk-KJBMTK5B.cjs');
|
|
18
|
-
var
|
|
18
|
+
var chunkE7PW4ZAB_cjs = require('./chunk-E7PW4ZAB.cjs');
|
|
19
19
|
var chunkVWJ7H3MJ_cjs = require('./chunk-VWJ7H3MJ.cjs');
|
|
20
20
|
var chunk5WBEMKE2_cjs = require('./chunk-5WBEMKE2.cjs');
|
|
21
21
|
var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
|
|
@@ -2079,7 +2079,7 @@ var ProcessorRunner = class _ProcessorRunner {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
const { model: _model, ...rest } = result;
|
|
2081
2081
|
if (result.model) {
|
|
2082
|
-
const resolvedModel = await
|
|
2082
|
+
const resolvedModel = await chunk334VHLAR_cjs.resolveModelConfig(result.model);
|
|
2083
2083
|
const isSupported = isSupportedLanguageModel(resolvedModel);
|
|
2084
2084
|
if (!isSupported) {
|
|
2085
2085
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
@@ -4347,6 +4347,7 @@ function tryRepairJson(input) {
|
|
|
4347
4347
|
repaired = repaired.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g, '$1"$2":');
|
|
4348
4348
|
repaired = repaired.replace(/'/g, '"');
|
|
4349
4349
|
repaired = repaired.replace(/,(\s*[}\]])/g, "$1");
|
|
4350
|
+
repaired = repaired.replace(/:\s*(\d{4}-\d{2}-\d{2}(?:T[\d:]+)?)\s*([,}])/g, ': "$1"$2');
|
|
4350
4351
|
try {
|
|
4351
4352
|
return JSON.parse(repaired);
|
|
4352
4353
|
} catch {
|
|
@@ -5497,7 +5498,7 @@ var createTimeTravelExecutionParams = (params) => {
|
|
|
5497
5498
|
result = void 0;
|
|
5498
5499
|
}
|
|
5499
5500
|
if (result) {
|
|
5500
|
-
const formattedResult =
|
|
5501
|
+
const formattedResult = chunkCYZJ2HT2_cjs.removeUndefinedValues(result);
|
|
5501
5502
|
stepResults[stepId] = formattedResult;
|
|
5502
5503
|
}
|
|
5503
5504
|
});
|
|
@@ -6055,7 +6056,7 @@ async function executeLoop(engine, params) {
|
|
|
6055
6056
|
options: {
|
|
6056
6057
|
type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
|
|
6057
6058
|
name: `condition: '${entry.loopType}'`,
|
|
6058
|
-
input:
|
|
6059
|
+
input: chunkCYZJ2HT2_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
|
|
6059
6060
|
attributes: {
|
|
6060
6061
|
conditionIndex: iteration
|
|
6061
6062
|
},
|
|
@@ -8321,10 +8322,10 @@ function isAgent(input) {
|
|
|
8321
8322
|
return input instanceof Agent;
|
|
8322
8323
|
}
|
|
8323
8324
|
function isToolStep(input) {
|
|
8324
|
-
return input instanceof
|
|
8325
|
+
return input instanceof chunkE7PW4ZAB_cjs.Tool;
|
|
8325
8326
|
}
|
|
8326
8327
|
function isStepParams(input) {
|
|
8327
|
-
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof Agent) && !(input instanceof
|
|
8328
|
+
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof Agent) && !(input instanceof chunkE7PW4ZAB_cjs.Tool);
|
|
8328
8329
|
}
|
|
8329
8330
|
function createStep(params, agentOrToolOptions) {
|
|
8330
8331
|
if (isAgent(params)) {
|
|
@@ -9054,7 +9055,7 @@ function cloneStep(step, opts) {
|
|
|
9054
9055
|
};
|
|
9055
9056
|
}
|
|
9056
9057
|
function isProcessor(obj) {
|
|
9057
|
-
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof
|
|
9058
|
+
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof chunkE7PW4ZAB_cjs.Tool) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
|
|
9058
9059
|
}
|
|
9059
9060
|
function createWorkflow(params) {
|
|
9060
9061
|
return new Workflow(params);
|
|
@@ -11344,7 +11345,7 @@ var MastraScorer = class _MastraScorer {
|
|
|
11344
11345
|
}
|
|
11345
11346
|
});
|
|
11346
11347
|
}
|
|
11347
|
-
const resolvedModel = await
|
|
11348
|
+
const resolvedModel = await chunk334VHLAR_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
|
|
11348
11349
|
const judge = new Agent({
|
|
11349
11350
|
id: "judge",
|
|
11350
11351
|
name: "judge",
|
|
@@ -12732,8 +12733,8 @@ function createLLMExecutionStep({
|
|
|
12732
12733
|
if (processInputStepResult.tools && currentStep.tools) {
|
|
12733
12734
|
const convertedTools = {};
|
|
12734
12735
|
for (const [name, tool2] of Object.entries(currentStep.tools)) {
|
|
12735
|
-
if (
|
|
12736
|
-
convertedTools[name] =
|
|
12736
|
+
if (chunkE7PW4ZAB_cjs.isMastraTool(tool2)) {
|
|
12737
|
+
convertedTools[name] = chunkCYZJ2HT2_cjs.makeCoreTool(
|
|
12737
12738
|
tool2,
|
|
12738
12739
|
{
|
|
12739
12740
|
name,
|
|
@@ -12940,7 +12941,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
|
|
|
12940
12941
|
}
|
|
12941
12942
|
});
|
|
12942
12943
|
let transportResolver;
|
|
12943
|
-
if (currentStep.model instanceof
|
|
12944
|
+
if (currentStep.model instanceof chunk334VHLAR_cjs.ModelRouterLanguageModel) {
|
|
12944
12945
|
const routerModel = currentStep.model;
|
|
12945
12946
|
transportResolver = () => routerModel._getStreamTransport();
|
|
12946
12947
|
}
|
|
@@ -14808,7 +14809,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
14808
14809
|
const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
|
|
14809
14810
|
if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
|
|
14810
14811
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
14811
|
-
await
|
|
14812
|
+
await chunkCYZJ2HT2_cjs.delay(10 * 1e3);
|
|
14812
14813
|
}
|
|
14813
14814
|
},
|
|
14814
14815
|
onFinish: async (props) => {
|
|
@@ -19076,7 +19077,7 @@ var Agent = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
19076
19077
|
* Throws an error if validation fails.
|
|
19077
19078
|
*/
|
|
19078
19079
|
async #validateRequestContext(requestContext) {
|
|
19079
|
-
if (this.#requestContextSchema &&
|
|
19080
|
+
if (this.#requestContextSchema && chunkCYZJ2HT2_cjs.isZodType(this.#requestContextSchema)) {
|
|
19080
19081
|
const contextValues = requestContext?.all ?? {};
|
|
19081
19082
|
const validatedRequestContext = await this.#requestContextSchema.safeParseAsync(contextValues);
|
|
19082
19083
|
if (!validatedRequestContext.success) {
|
|
@@ -19808,7 +19809,7 @@ ${errorMessages}`,
|
|
|
19808
19809
|
*/
|
|
19809
19810
|
listTools({ requestContext = new chunk5WBEMKE2_cjs.RequestContext() } = {}) {
|
|
19810
19811
|
if (typeof this.#tools !== "function") {
|
|
19811
|
-
return
|
|
19812
|
+
return chunkCYZJ2HT2_cjs.ensureToolProperties(this.#tools);
|
|
19812
19813
|
}
|
|
19813
19814
|
const result = this.#tools({
|
|
19814
19815
|
requestContext,
|
|
@@ -19829,7 +19830,7 @@ ${errorMessages}`,
|
|
|
19829
19830
|
this.logger.error(mastraError.toString());
|
|
19830
19831
|
throw mastraError;
|
|
19831
19832
|
}
|
|
19832
|
-
return
|
|
19833
|
+
return chunkCYZJ2HT2_cjs.ensureToolProperties(tools);
|
|
19833
19834
|
});
|
|
19834
19835
|
}
|
|
19835
19836
|
/**
|
|
@@ -19875,7 +19876,7 @@ ${errorMessages}`,
|
|
|
19875
19876
|
});
|
|
19876
19877
|
});
|
|
19877
19878
|
} else {
|
|
19878
|
-
llm = new
|
|
19879
|
+
llm = new chunk6IM3BPH2_cjs.MastraLLMV1({
|
|
19879
19880
|
model: modelInfo,
|
|
19880
19881
|
mastra: this.#mastra,
|
|
19881
19882
|
options: { tracingPolicy: this.#options?.tracingPolicy }
|
|
@@ -19901,7 +19902,7 @@ ${errorMessages}`,
|
|
|
19901
19902
|
*/
|
|
19902
19903
|
async resolveModelConfig(modelConfig, requestContext) {
|
|
19903
19904
|
try {
|
|
19904
|
-
return await
|
|
19905
|
+
return await chunk334VHLAR_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
|
|
19905
19906
|
} catch (error) {
|
|
19906
19907
|
const mastraError = new chunk4U7ZLI36_cjs.MastraError({
|
|
19907
19908
|
id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
|
|
@@ -20386,7 +20387,7 @@ ${errorMessages}`,
|
|
|
20386
20387
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20387
20388
|
requireApproval: toolObj.requireApproval
|
|
20388
20389
|
};
|
|
20389
|
-
const convertedToCoreTool =
|
|
20390
|
+
const convertedToCoreTool = chunkCYZJ2HT2_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20390
20391
|
convertedMemoryTools[toolName] = convertedToCoreTool;
|
|
20391
20392
|
}
|
|
20392
20393
|
}
|
|
@@ -20415,7 +20416,7 @@ ${errorMessages}`,
|
|
|
20415
20416
|
if (!workspace) {
|
|
20416
20417
|
return convertedWorkspaceTools;
|
|
20417
20418
|
}
|
|
20418
|
-
const workspaceTools =
|
|
20419
|
+
const workspaceTools = chunkHACNMOMO_cjs.createWorkspaceTools(workspace);
|
|
20419
20420
|
if (Object.keys(workspaceTools).length > 0) {
|
|
20420
20421
|
this.logger.debug(`[Agent:${this.name}] - Adding workspace tools: ${Object.keys(workspaceTools).join(", ")}`, {
|
|
20421
20422
|
runId
|
|
@@ -20437,7 +20438,7 @@ ${errorMessages}`,
|
|
|
20437
20438
|
requireApproval: toolObj.requireApproval,
|
|
20438
20439
|
workspace
|
|
20439
20440
|
};
|
|
20440
|
-
const convertedToCoreTool =
|
|
20441
|
+
const convertedToCoreTool = chunkCYZJ2HT2_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20441
20442
|
convertedWorkspaceTools[toolName] = convertedToCoreTool;
|
|
20442
20443
|
}
|
|
20443
20444
|
}
|
|
@@ -20468,7 +20469,7 @@ ${errorMessages}`,
|
|
|
20468
20469
|
if (!workspace?.skills) {
|
|
20469
20470
|
return convertedSkillTools;
|
|
20470
20471
|
}
|
|
20471
|
-
const skillTools =
|
|
20472
|
+
const skillTools = chunkHACNMOMO_cjs.createSkillTools(workspace.skills);
|
|
20472
20473
|
if (Object.keys(skillTools).length > 0) {
|
|
20473
20474
|
this.logger.debug(`[Agent:${this.name}] - Adding skill tools: ${Object.keys(skillTools).join(", ")}`, {
|
|
20474
20475
|
runId
|
|
@@ -20491,7 +20492,7 @@ ${errorMessages}`,
|
|
|
20491
20492
|
// Skill tools never require approval
|
|
20492
20493
|
workspace
|
|
20493
20494
|
};
|
|
20494
|
-
const convertedToCoreTool =
|
|
20495
|
+
const convertedToCoreTool = chunkCYZJ2HT2_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
|
|
20495
20496
|
convertedSkillTools[toolName] = convertedToCoreTool;
|
|
20496
20497
|
}
|
|
20497
20498
|
}
|
|
@@ -20707,7 +20708,7 @@ ${errorMessages}`,
|
|
|
20707
20708
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20708
20709
|
requireApproval: tool2.requireApproval
|
|
20709
20710
|
};
|
|
20710
|
-
return [k,
|
|
20711
|
+
return [k, chunkCYZJ2HT2_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
|
|
20711
20712
|
})
|
|
20712
20713
|
);
|
|
20713
20714
|
const assignedToolEntriesConverted = Object.fromEntries(
|
|
@@ -20758,7 +20759,7 @@ ${errorMessages}`,
|
|
|
20758
20759
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20759
20760
|
requireApproval: toolObj.requireApproval
|
|
20760
20761
|
};
|
|
20761
|
-
const convertedToCoreTool =
|
|
20762
|
+
const convertedToCoreTool = chunkCYZJ2HT2_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
|
|
20762
20763
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20763
20764
|
}
|
|
20764
20765
|
}
|
|
@@ -20804,7 +20805,7 @@ ${errorMessages}`,
|
|
|
20804
20805
|
tracingPolicy: this.#options?.tracingPolicy,
|
|
20805
20806
|
requireApproval: tool2.requireApproval
|
|
20806
20807
|
};
|
|
20807
|
-
const convertedToCoreTool =
|
|
20808
|
+
const convertedToCoreTool = chunkCYZJ2HT2_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
|
|
20808
20809
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
20809
20810
|
}
|
|
20810
20811
|
}
|
|
@@ -20888,7 +20889,7 @@ ${errorMessages}`,
|
|
|
20888
20889
|
).describe("The results from the agent's tool calls").optional()
|
|
20889
20890
|
});
|
|
20890
20891
|
const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
|
|
20891
|
-
const toolObj =
|
|
20892
|
+
const toolObj = chunkE7PW4ZAB_cjs.createTool({
|
|
20892
20893
|
id: `agent-${agentName}`,
|
|
20893
20894
|
description: agent.getDescription() || `Agent: ${agentName}`,
|
|
20894
20895
|
inputSchema: agentInputSchema,
|
|
@@ -21464,7 +21465,7 @@ ${effectiveInstructions}`;
|
|
|
21464
21465
|
...observabilityContext,
|
|
21465
21466
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21466
21467
|
};
|
|
21467
|
-
convertedAgentTools[`agent-${agentName}`] =
|
|
21468
|
+
convertedAgentTools[`agent-${agentName}`] = chunkCYZJ2HT2_cjs.makeCoreTool(
|
|
21468
21469
|
toolObj,
|
|
21469
21470
|
options,
|
|
21470
21471
|
void 0,
|
|
@@ -21529,7 +21530,7 @@ ${effectiveInstructions}`;
|
|
|
21529
21530
|
}
|
|
21530
21531
|
]
|
|
21531
21532
|
};
|
|
21532
|
-
const toolObj =
|
|
21533
|
+
const toolObj = chunkE7PW4ZAB_cjs.createTool({
|
|
21533
21534
|
id: `workflow-${workflowName}`,
|
|
21534
21535
|
description: workflow.description || `Workflow: ${workflowName}`,
|
|
21535
21536
|
inputSchema: extendedInputSchema,
|
|
@@ -21680,7 +21681,7 @@ ${effectiveInstructions}`;
|
|
|
21680
21681
|
...observabilityContext,
|
|
21681
21682
|
tracingPolicy: this.#options?.tracingPolicy
|
|
21682
21683
|
};
|
|
21683
|
-
convertedWorkflowTools[`workflow-${workflowName}`] =
|
|
21684
|
+
convertedWorkflowTools[`workflow-${workflowName}`] = chunkCYZJ2HT2_cjs.makeCoreTool(
|
|
21684
21685
|
toolObj,
|
|
21685
21686
|
options,
|
|
21686
21687
|
void 0,
|
|
@@ -21712,7 +21713,7 @@ ${effectiveInstructions}`;
|
|
|
21712
21713
|
let mastraProxy = void 0;
|
|
21713
21714
|
const logger = this.logger;
|
|
21714
21715
|
if (this.#mastra) {
|
|
21715
|
-
mastraProxy =
|
|
21716
|
+
mastraProxy = chunkCYZJ2HT2_cjs.createMastraProxy({ mastra: this.#mastra, logger });
|
|
21716
21717
|
}
|
|
21717
21718
|
const assignedTools = await this.listAssignedTools({
|
|
21718
21719
|
runId,
|
|
@@ -21964,7 +21965,7 @@ ${effectiveInstructions}`;
|
|
|
21964
21965
|
const resolvedModel = await this.resolveModelConfig(selection, requestContext);
|
|
21965
21966
|
this.assertSupportsPreparedModels(resolvedModel);
|
|
21966
21967
|
let headers;
|
|
21967
|
-
if (resolvedModel instanceof
|
|
21968
|
+
if (resolvedModel instanceof chunk334VHLAR_cjs.ModelRouterLanguageModel) {
|
|
21968
21969
|
headers = resolvedModel.config?.headers;
|
|
21969
21970
|
}
|
|
21970
21971
|
return [
|
|
@@ -21997,7 +21998,7 @@ ${effectiveInstructions}`;
|
|
|
21997
21998
|
throw mastraError;
|
|
21998
21999
|
}
|
|
21999
22000
|
let headers;
|
|
22000
|
-
if (model instanceof
|
|
22001
|
+
if (model instanceof chunk334VHLAR_cjs.ModelRouterLanguageModel) {
|
|
22001
22002
|
headers = model.config?.headers;
|
|
22002
22003
|
}
|
|
22003
22004
|
return {
|
|
@@ -22448,7 +22449,7 @@ ${effectiveInstructions}`;
|
|
|
22448
22449
|
const defaultOptions = await this.getDefaultOptions({
|
|
22449
22450
|
requestContext: options?.requestContext
|
|
22450
22451
|
});
|
|
22451
|
-
const mergedOptions =
|
|
22452
|
+
const mergedOptions = chunkCYZJ2HT2_cjs.deepMerge(
|
|
22452
22453
|
defaultOptions,
|
|
22453
22454
|
options ?? {}
|
|
22454
22455
|
);
|
|
@@ -22518,7 +22519,7 @@ ${effectiveInstructions}`;
|
|
|
22518
22519
|
const defaultOptions = await this.getDefaultOptions({
|
|
22519
22520
|
requestContext: streamOptions?.requestContext
|
|
22520
22521
|
});
|
|
22521
|
-
const mergedOptions =
|
|
22522
|
+
const mergedOptions = chunkCYZJ2HT2_cjs.deepMerge(
|
|
22522
22523
|
defaultOptions,
|
|
22523
22524
|
streamOptions ?? {}
|
|
22524
22525
|
);
|
|
@@ -22582,7 +22583,7 @@ ${effectiveInstructions}`;
|
|
|
22582
22583
|
const defaultOptions = await this.getDefaultOptions({
|
|
22583
22584
|
requestContext: streamOptions?.requestContext
|
|
22584
22585
|
});
|
|
22585
|
-
let mergedStreamOptions =
|
|
22586
|
+
let mergedStreamOptions = chunkCYZJ2HT2_cjs.deepMerge(
|
|
22586
22587
|
defaultOptions,
|
|
22587
22588
|
streamOptions ?? {}
|
|
22588
22589
|
);
|
|
@@ -22647,7 +22648,7 @@ ${effectiveInstructions}`;
|
|
|
22647
22648
|
const defaultOptions = await this.getDefaultOptions({
|
|
22648
22649
|
requestContext: options?.requestContext
|
|
22649
22650
|
});
|
|
22650
|
-
const mergedOptions =
|
|
22651
|
+
const mergedOptions = chunkCYZJ2HT2_cjs.deepMerge(
|
|
22651
22652
|
defaultOptions,
|
|
22652
22653
|
options ?? {}
|
|
22653
22654
|
);
|
|
@@ -24221,7 +24222,7 @@ var TokenLimiterProcessor = class _TokenLimiterProcessor {
|
|
|
24221
24222
|
return new TiktokenClass(this.customEncoding);
|
|
24222
24223
|
});
|
|
24223
24224
|
} else {
|
|
24224
|
-
this.encoderPromise =
|
|
24225
|
+
this.encoderPromise = chunkHACNMOMO_cjs.getTiktoken();
|
|
24225
24226
|
}
|
|
24226
24227
|
}
|
|
24227
24228
|
return this.encoderPromise;
|
|
@@ -24906,7 +24907,7 @@ var ToolSearchProcessor = class {
|
|
|
24906
24907
|
minScore: options.search?.minScore ?? 0
|
|
24907
24908
|
};
|
|
24908
24909
|
this.ttl = options.ttl ?? 36e5;
|
|
24909
|
-
this.bm25Index = new
|
|
24910
|
+
this.bm25Index = new chunkHACNMOMO_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
|
|
24910
24911
|
this.indexTools();
|
|
24911
24912
|
if (this.ttl > 0) {
|
|
24912
24913
|
this.scheduleCleanup();
|
|
@@ -25071,7 +25072,7 @@ var ToolSearchProcessor = class {
|
|
|
25071
25072
|
messageList.addSystem(
|
|
25072
25073
|
"To discover available tools, call search_tools with a keyword query. To add a tool to the conversation, call load_tool with the tool name. Tools must be loaded before they can be used."
|
|
25073
25074
|
);
|
|
25074
|
-
const searchTool =
|
|
25075
|
+
const searchTool = chunkE7PW4ZAB_cjs.createTool({
|
|
25075
25076
|
id: "search_tools",
|
|
25076
25077
|
description: "Search for available tools by keyword. Use this when you need a capability you don't currently have. Returns a list of matching tools with their names and descriptions. After finding a useful tool, use load_tool to make it available.",
|
|
25077
25078
|
inputSchema: z9.z.object({
|
|
@@ -25101,7 +25102,7 @@ var ToolSearchProcessor = class {
|
|
|
25101
25102
|
};
|
|
25102
25103
|
}
|
|
25103
25104
|
});
|
|
25104
|
-
const loadTool =
|
|
25105
|
+
const loadTool = chunkE7PW4ZAB_cjs.createTool({
|
|
25105
25106
|
id: "load_tool",
|
|
25106
25107
|
description: "Load a specific tool into your context. Call this after finding a tool with search_tools. Once loaded, the tool will be available for use. Args: toolName - The exact name of the tool to load (from search results).",
|
|
25107
25108
|
inputSchema: z9.z.object({
|
|
@@ -25449,7 +25450,7 @@ var WorkingMemory = class {
|
|
|
25449
25450
|
}
|
|
25450
25451
|
return empty;
|
|
25451
25452
|
}
|
|
25452
|
-
return
|
|
25453
|
+
return chunkCYZJ2HT2_cjs.generateEmptyFromSchema(schema);
|
|
25453
25454
|
} catch {
|
|
25454
25455
|
return null;
|
|
25455
25456
|
}
|
|
@@ -26096,7 +26097,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
|
|
|
26096
26097
|
);
|
|
26097
26098
|
}
|
|
26098
26099
|
if (typeof config.embedder === "string") {
|
|
26099
|
-
this.embedder = new
|
|
26100
|
+
this.embedder = new chunk334VHLAR_cjs.ModelRouterEmbeddingModel(config.embedder);
|
|
26100
26101
|
} else {
|
|
26101
26102
|
this.embedder = config.embedder;
|
|
26102
26103
|
}
|
|
@@ -26135,7 +26136,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26135
26136
|
}
|
|
26136
26137
|
setEmbedder(embedder, embedderOptions) {
|
|
26137
26138
|
if (typeof embedder === "string") {
|
|
26138
|
-
this.embedder = new
|
|
26139
|
+
this.embedder = new chunk334VHLAR_cjs.ModelRouterEmbeddingModel(embedder);
|
|
26139
26140
|
} else {
|
|
26140
26141
|
this.embedder = embedder;
|
|
26141
26142
|
}
|
|
@@ -26232,7 +26233,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
26232
26233
|
"The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
|
|
26233
26234
|
);
|
|
26234
26235
|
}
|
|
26235
|
-
const mergedConfig =
|
|
26236
|
+
const mergedConfig = chunkCYZJ2HT2_cjs.deepMerge(this.threadConfig, config || {});
|
|
26236
26237
|
if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
|
|
26237
26238
|
mergedConfig.workingMemory.schema = config.workingMemory.schema;
|
|
26238
26239
|
}
|
|
@@ -26582,7 +26583,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
26582
26583
|
} = {}) {
|
|
26583
26584
|
super({
|
|
26584
26585
|
name: "mock",
|
|
26585
|
-
storage: storage || new
|
|
26586
|
+
storage: storage || new chunkSHN25XWN_cjs.InMemoryStore(),
|
|
26586
26587
|
options: {
|
|
26587
26588
|
workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : void 0,
|
|
26588
26589
|
lastMessages: enableMessageHistory ? 10 : void 0
|
|
@@ -26662,7 +26663,7 @@ var MockMemory = class extends MastraMemory {
|
|
|
26662
26663
|
return {};
|
|
26663
26664
|
}
|
|
26664
26665
|
return {
|
|
26665
|
-
updateWorkingMemory:
|
|
26666
|
+
updateWorkingMemory: chunkE7PW4ZAB_cjs.createTool({
|
|
26666
26667
|
id: "update-working-memory",
|
|
26667
26668
|
description: `Update the working memory with new information. Any data not included will be overwritten.`,
|
|
26668
26669
|
inputSchema: z9__default.default.object({ memory: z9__default.default.string() }),
|
|
@@ -26890,5 +26891,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
|
|
|
26890
26891
|
exports.validateStepResumeData = validateStepResumeData;
|
|
26891
26892
|
exports.validateStepStateData = validateStepStateData;
|
|
26892
26893
|
exports.validateStepSuspendData = validateStepSuspendData;
|
|
26893
|
-
//# sourceMappingURL=chunk-
|
|
26894
|
-
//# sourceMappingURL=chunk-
|
|
26894
|
+
//# sourceMappingURL=chunk-S255NXHH.cjs.map
|
|
26895
|
+
//# sourceMappingURL=chunk-S255NXHH.cjs.map
|