@mastra/core 1.16.1-alpha.1 → 1.17.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 +85 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/{chunk-OEOHECI4.cjs → chunk-3H34KWBU.cjs} +9 -9
- package/dist/{chunk-OEOHECI4.cjs.map → chunk-3H34KWBU.cjs.map} +1 -1
- package/dist/{chunk-Y5EGGY3M.js → chunk-62GLEYP6.js} +3 -3
- package/dist/{chunk-Y5EGGY3M.js.map → chunk-62GLEYP6.js.map} +1 -1
- package/dist/{chunk-J3NJXIJ4.js → chunk-ABA3KD3X.js} +524 -246
- package/dist/chunk-ABA3KD3X.js.map +1 -0
- package/dist/{chunk-NHYQRELK.cjs → chunk-BKXCVT72.cjs} +3 -3
- package/dist/chunk-BKXCVT72.cjs.map +1 -0
- package/dist/{chunk-P7HTEQ33.js → chunk-CVG4K4O3.js} +4 -4
- package/dist/{chunk-P7HTEQ33.js.map → chunk-CVG4K4O3.js.map} +1 -1
- package/dist/{chunk-RGOEP34Y.js → chunk-CYQ2TNSK.js} +3 -3
- package/dist/{chunk-RGOEP34Y.js.map → chunk-CYQ2TNSK.js.map} +1 -1
- package/dist/{chunk-4DFZ553O.js → chunk-DGBPIUTG.js} +3 -3
- package/dist/{chunk-4DFZ553O.js.map → chunk-DGBPIUTG.js.map} +1 -1
- package/dist/{chunk-PSJRMLRB.js → chunk-DIWGRQZT.js} +3 -3
- package/dist/chunk-DIWGRQZT.js.map +1 -0
- package/dist/{chunk-EBPV22NT.cjs → chunk-EWGUU5QC.cjs} +6 -6
- package/dist/{chunk-EBPV22NT.cjs.map → chunk-EWGUU5QC.cjs.map} +1 -1
- package/dist/{chunk-6ZT4MY74.cjs → chunk-FQMFXIUQ.cjs} +185 -185
- package/dist/{chunk-6ZT4MY74.cjs.map → chunk-FQMFXIUQ.cjs.map} +1 -1
- package/dist/{chunk-ZJMETLCP.js → chunk-FWDG2WUV.js} +29 -27
- package/dist/chunk-FWDG2WUV.js.map +1 -0
- package/dist/{chunk-KDT3Y3ME.cjs → chunk-I7S3ZFOU.cjs} +82 -82
- package/dist/{chunk-KDT3Y3ME.cjs.map → chunk-I7S3ZFOU.cjs.map} +1 -1
- package/dist/{chunk-TOPTRKIX.js → chunk-IOKPS5RD.js} +14 -4
- package/dist/chunk-IOKPS5RD.js.map +1 -0
- package/dist/{chunk-YB77ED7R.js → chunk-IPINMJOH.js} +3 -3
- package/dist/{chunk-YB77ED7R.js.map → chunk-IPINMJOH.js.map} +1 -1
- package/dist/{chunk-WJWWFBKT.js → chunk-IYSW4VN7.js} +476 -27
- package/dist/chunk-IYSW4VN7.js.map +1 -0
- package/dist/{chunk-ESKXIAWT.js → chunk-J2BSGWLR.js} +9 -9
- package/dist/{chunk-ESKXIAWT.js.map → chunk-J2BSGWLR.js.map} +1 -1
- package/dist/{chunk-X672Z4KM.js → chunk-KFYDUUVH.js} +7 -7
- package/dist/{chunk-X672Z4KM.js.map → chunk-KFYDUUVH.js.map} +1 -1
- package/dist/{chunk-7L2ICIDI.cjs → chunk-MBJ6IAKF.cjs} +6 -6
- package/dist/{chunk-7L2ICIDI.cjs.map → chunk-MBJ6IAKF.cjs.map} +1 -1
- package/dist/{chunk-7O2GO5ZA.cjs → chunk-O2BVR6WC.cjs} +16 -16
- package/dist/{chunk-7O2GO5ZA.cjs.map → chunk-O2BVR6WC.cjs.map} +1 -1
- package/dist/{chunk-GKUIFIWB.cjs → chunk-OXH67SS4.cjs} +9 -9
- package/dist/{chunk-GKUIFIWB.cjs.map → chunk-OXH67SS4.cjs.map} +1 -1
- package/dist/{chunk-JWTPUJWM.cjs → chunk-QLC3UBDY.cjs} +512 -61
- package/dist/chunk-QLC3UBDY.cjs.map +1 -0
- package/dist/{chunk-XW4B2RAG.cjs → chunk-QVVWKMFM.cjs} +525 -248
- package/dist/chunk-QVVWKMFM.cjs.map +1 -0
- package/dist/{chunk-RQBBPR64.cjs → chunk-R2V6BCYX.cjs} +29 -27
- package/dist/chunk-R2V6BCYX.cjs.map +1 -0
- package/dist/{chunk-YKW2LXON.js → chunk-RUUHBB7U.js} +4 -4
- package/dist/{chunk-YKW2LXON.js.map → chunk-RUUHBB7U.js.map} +1 -1
- package/dist/{chunk-HFGULJ4Q.js → chunk-RX5ZKTWD.js} +4 -4
- package/dist/{chunk-HFGULJ4Q.js.map → chunk-RX5ZKTWD.js.map} +1 -1
- package/dist/{chunk-UCKOC22J.cjs → chunk-TPJSYHLC.cjs} +15 -5
- package/dist/chunk-TPJSYHLC.cjs.map +1 -0
- package/dist/{chunk-AM2AF362.cjs → chunk-XWGZAY4F.cjs} +5 -5
- package/dist/{chunk-AM2AF362.cjs.map → chunk-XWGZAY4F.cjs.map} +1 -1
- package/dist/{chunk-LPCQ6RYF.cjs → chunk-YE2NPWVL.cjs} +50 -50
- package/dist/{chunk-LPCQ6RYF.cjs.map → chunk-YE2NPWVL.cjs.map} +1 -1
- package/dist/{chunk-XKOCRXCP.js → chunk-ZOJZL62I.js} +3 -3
- package/dist/{chunk-XKOCRXCP.js.map → chunk-ZOJZL62I.js.map} +1 -1
- package/dist/{chunk-QJGJEX2X.cjs → chunk-ZOZHH547.cjs} +7 -7
- package/dist/{chunk-QJGJEX2X.cjs.map → chunk-ZOZHH547.cjs.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +3 -1
- package/dist/docs/assets/SOURCE_MAP.json +265 -255
- package/dist/docs/references/docs-workspace-lsp.md +116 -0
- package/dist/docs/references/docs-workspace-overview.md +15 -1
- package/dist/docs/references/reference-harness-harness-class.md +2 -0
- package/dist/docs/references/reference-processors-skill-search-processor.md +93 -0
- package/dist/docs/references/reference.md +1 -0
- 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/harness.d.ts +4 -5
- package/dist/harness/harness.d.ts.map +1 -1
- package/dist/harness/index.cjs +44 -12
- package/dist/harness/index.cjs.map +1 -1
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +39 -7
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/types.d.ts +18 -4
- package/dist/harness/types.d.ts.map +1 -1
- 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 +5 -0
- 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-3UNU47HO.cjs +12 -0
- package/dist/{models-dev-KMQOE3SL.cjs.map → models-dev-3UNU47HO.cjs.map} +1 -1
- package/dist/models-dev-U3LBEE4O.js +3 -0
- package/dist/{models-dev-7F53M5Y6.js.map → models-dev-U3LBEE4O.js.map} +1 -1
- package/dist/netlify-ET5JT5FX.cjs +12 -0
- package/dist/{netlify-MBDMAHGO.cjs.map → netlify-ET5JT5FX.cjs.map} +1 -1
- package/dist/netlify-QVXFSZJQ.js +3 -0
- package/dist/{netlify-KUZQYG5K.js.map → netlify-QVXFSZJQ.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 +50 -42
- package/dist/processors/index.js +1 -1
- package/dist/processors/processors/index.d.ts +2 -0
- package/dist/processors/processors/index.d.ts.map +1 -1
- package/dist/processors/processors/skill-search.d.ts +111 -0
- package/dist/processors/processors/skill-search.d.ts.map +1 -0
- package/dist/processors/tool-result-reminder.d.ts +32 -0
- package/dist/processors/tool-result-reminder.d.ts.map +1 -0
- package/dist/provider-registry-IP3K4FE4.js +3 -0
- package/dist/{provider-registry-EB75EFT7.js.map → provider-registry-IP3K4FE4.js.map} +1 -1
- package/dist/provider-registry-S6VYJ3GX.cjs +40 -0
- package/dist/{provider-registry-3B6CFW7R.cjs.map → provider-registry-S6VYJ3GX.cjs.map} +1 -1
- package/dist/provider-registry.json +10 -0
- 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 +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/tool-builder/builder.d.ts.map +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/constants/index.d.ts +4 -1
- package/dist/workspace/constants/index.d.ts.map +1 -1
- package/dist/workspace/index.cjs +68 -68
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/lsp/client.d.ts +30 -0
- package/dist/workspace/lsp/client.d.ts.map +1 -1
- package/dist/workspace/lsp/manager.d.ts +11 -0
- package/dist/workspace/lsp/manager.d.ts.map +1 -1
- package/dist/workspace/tools/index.d.ts +1 -0
- package/dist/workspace/tools/index.d.ts.map +1 -1
- package/dist/workspace/tools/lsp-inspect.d.ts +13 -0
- package/dist/workspace/tools/lsp-inspect.d.ts.map +1 -0
- package/dist/workspace/tools/tools.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/llm/model/provider-types.generated.d.ts +5 -0
- package/test-utils/llm-mock.d.ts +1 -0
- package/dist/chunk-J3NJXIJ4.js.map +0 -1
- package/dist/chunk-JWTPUJWM.cjs.map +0 -1
- package/dist/chunk-NHYQRELK.cjs.map +0 -1
- package/dist/chunk-PSJRMLRB.js.map +0 -1
- package/dist/chunk-RQBBPR64.cjs.map +0 -1
- package/dist/chunk-TOPTRKIX.js.map +0 -1
- package/dist/chunk-UCKOC22J.cjs.map +0 -1
- package/dist/chunk-WJWWFBKT.js.map +0 -1
- package/dist/chunk-XW4B2RAG.cjs.map +0 -1
- package/dist/chunk-ZJMETLCP.js.map +0 -1
- package/dist/models-dev-7F53M5Y6.js +0 -3
- package/dist/models-dev-KMQOE3SL.cjs +0 -12
- package/dist/netlify-KUZQYG5K.js +0 -3
- package/dist/netlify-MBDMAHGO.cjs +0 -12
- package/dist/provider-registry-3B6CFW7R.cjs +0 -40
- package/dist/provider-registry-EB75EFT7.js +0 -3
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { DefaultVoice } from './chunk-YDLGEJ7W.js';
|
|
2
2
|
import { PUBSUB_SYMBOL, STREAM_FORMAT_SYMBOL } from './chunk-2QXNHEDL.js';
|
|
3
|
-
import { createWorkspaceTools, createSkillTools, getTiktoken, BM25Index } from './chunk-
|
|
4
|
-
import { InMemoryStore } from './chunk-
|
|
3
|
+
import { createWorkspaceTools, createSkillTools, getTiktoken, BM25Index } from './chunk-ABA3KD3X.js';
|
|
4
|
+
import { InMemoryStore } from './chunk-CYQ2TNSK.js';
|
|
5
5
|
import { MessageList, coreContentToString, DefaultGeneratedFile, DefaultGeneratedFileWithType, sanitizeToolName } from './chunk-SLZ3WO42.js';
|
|
6
6
|
import { parsePartialJson, isDeepEqualData, stepCountIs } from './chunk-2PHG443D.js';
|
|
7
7
|
import { generateId, APICallError, tool, asSchema } from './chunk-6PALJNKG.js';
|
|
8
|
+
import { EventEmitterPubSub } from './chunk-X2HAI3OX.js';
|
|
8
9
|
import { executeHook } from './chunk-L54GIUCB.js';
|
|
9
|
-
import { resolveModelConfig, ModelRouterEmbeddingModel, ModelRouterLanguageModel } from './chunk-
|
|
10
|
-
import { MastraLLMV1 } from './chunk-
|
|
10
|
+
import { resolveModelConfig, ModelRouterEmbeddingModel, ModelRouterLanguageModel } from './chunk-KFYDUUVH.js';
|
|
11
|
+
import { MastraLLMV1 } from './chunk-ZOJZL62I.js';
|
|
11
12
|
import { noopLogger } from './chunk-PSCMWPLC.js';
|
|
12
|
-
import {
|
|
13
|
-
import { removeUndefinedValues, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, generateEmptyFromSchema, selectFields, delay } from './chunk-ZJMETLCP.js';
|
|
13
|
+
import { removeUndefinedValues, ensureToolProperties, makeCoreTool, createMastraProxy, deepMerge, generateEmptyFromSchema, selectFields, delay } from './chunk-FWDG2WUV.js';
|
|
14
14
|
import { resolveObservabilityContext, EntityType, createObservabilityContext, getRootExportSpan, getOrCreateSpan, wrapMastra, executeWithContext, executeWithContextSync } from './chunk-CT4YYQI3.js';
|
|
15
15
|
import { ToolStream } from './chunk-DD2VNRQM.js';
|
|
16
16
|
import { Tool, createTool, isMastraTool, isProviderTool, getProviderToolName, isProviderDefinedTool } from './chunk-GRMC2OYN.js';
|
|
@@ -28,6 +28,8 @@ import EventEmitter2, { EventEmitter } from 'events';
|
|
|
28
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
|
+
import { existsSync, statSync, readFileSync } from 'fs';
|
|
32
|
+
import { normalize, isAbsolute, resolve, basename, dirname, join } from 'path';
|
|
31
33
|
import xxhash from 'xxhash-wasm';
|
|
32
34
|
import { LRUCache } from 'lru-cache';
|
|
33
35
|
|
|
@@ -214,8 +216,8 @@ var MastraAgentNetworkStream = class extends ReadableStream$1 {
|
|
|
214
216
|
resolve: null,
|
|
215
217
|
reject: null
|
|
216
218
|
};
|
|
217
|
-
deferredPromise.promise = new Promise((
|
|
218
|
-
deferredPromise.resolve =
|
|
219
|
+
deferredPromise.promise = new Promise((resolve2, reject) => {
|
|
220
|
+
deferredPromise.resolve = resolve2;
|
|
219
221
|
deferredPromise.reject = reject;
|
|
220
222
|
});
|
|
221
223
|
const objectDeferredPromise = {
|
|
@@ -223,8 +225,8 @@ var MastraAgentNetworkStream = class extends ReadableStream$1 {
|
|
|
223
225
|
resolve: null,
|
|
224
226
|
reject: null
|
|
225
227
|
};
|
|
226
|
-
objectDeferredPromise.promise = new Promise((
|
|
227
|
-
objectDeferredPromise.resolve =
|
|
228
|
+
objectDeferredPromise.promise = new Promise((resolve2, reject) => {
|
|
229
|
+
objectDeferredPromise.resolve = resolve2;
|
|
228
230
|
objectDeferredPromise.reject = reject;
|
|
229
231
|
});
|
|
230
232
|
let objectStreamController = null;
|
|
@@ -551,13 +553,13 @@ var DelayedPromise = class {
|
|
|
551
553
|
if (this._promise) {
|
|
552
554
|
return this._promise;
|
|
553
555
|
}
|
|
554
|
-
this._promise = new Promise((
|
|
556
|
+
this._promise = new Promise((resolve2, reject) => {
|
|
555
557
|
if (this.status.type === "resolved") {
|
|
556
|
-
|
|
558
|
+
resolve2(this.status.value);
|
|
557
559
|
} else if (this.status.type === "rejected") {
|
|
558
560
|
reject(this.status.error);
|
|
559
561
|
}
|
|
560
|
-
this._resolve =
|
|
562
|
+
this._resolve = resolve2;
|
|
561
563
|
this._reject = reject;
|
|
562
564
|
});
|
|
563
565
|
return this._promise;
|
|
@@ -7612,7 +7614,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
7612
7614
|
* @param _workflowId - The workflow ID (for constructing platform-specific IDs)
|
|
7613
7615
|
*/
|
|
7614
7616
|
async executeSleepDuration(duration, _sleepId, _workflowId) {
|
|
7615
|
-
await new Promise((
|
|
7617
|
+
await new Promise((resolve2) => setTimeout(resolve2, duration < 0 ? 0 : duration));
|
|
7616
7618
|
}
|
|
7617
7619
|
/**
|
|
7618
7620
|
* Execute sleep until a specific date. Override to use platform-specific sleep primitives.
|
|
@@ -7623,7 +7625,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
7623
7625
|
*/
|
|
7624
7626
|
async executeSleepUntilDate(date, _sleepUntilId, _workflowId) {
|
|
7625
7627
|
const time = date.getTime() - Date.now();
|
|
7626
|
-
await new Promise((
|
|
7628
|
+
await new Promise((resolve2) => setTimeout(resolve2, time < 0 ? 0 : time));
|
|
7627
7629
|
}
|
|
7628
7630
|
/**
|
|
7629
7631
|
* Wrap a durable operation (like dynamic sleep function evaluation).
|
|
@@ -7787,7 +7789,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
7787
7789
|
async executeStepWithRetry(stepId, runStep, params) {
|
|
7788
7790
|
for (let i = 0; i < params.retries + 1; i++) {
|
|
7789
7791
|
if (i > 0 && params.delay) {
|
|
7790
|
-
await new Promise((
|
|
7792
|
+
await new Promise((resolve2) => setTimeout(resolve2, params.delay));
|
|
7791
7793
|
}
|
|
7792
7794
|
try {
|
|
7793
7795
|
const result = await this.wrapDurableOperation(stepId, runStep);
|
|
@@ -8365,8 +8367,8 @@ function createStepFromAgent(params, agentOrToolOptions) {
|
|
|
8365
8367
|
}) => {
|
|
8366
8368
|
const observabilityContext = resolveObservabilityContext(rest);
|
|
8367
8369
|
let streamPromise = {};
|
|
8368
|
-
streamPromise.promise = new Promise((
|
|
8369
|
-
streamPromise.resolve =
|
|
8370
|
+
streamPromise.promise = new Promise((resolve2, reject) => {
|
|
8371
|
+
streamPromise.resolve = resolve2;
|
|
8370
8372
|
streamPromise.reject = reject;
|
|
8371
8373
|
});
|
|
8372
8374
|
let structuredResult = null;
|
|
@@ -11453,8 +11455,8 @@ async function runCompletionScorers(scorers, context, options) {
|
|
|
11453
11455
|
const startTime = Date.now();
|
|
11454
11456
|
const results = [];
|
|
11455
11457
|
let timedOut = false;
|
|
11456
|
-
const timeoutPromise = new Promise((
|
|
11457
|
-
setTimeout(() =>
|
|
11458
|
+
const timeoutPromise = new Promise((resolve2) => {
|
|
11459
|
+
setTimeout(() => resolve2("timeout"), timeout);
|
|
11458
11460
|
});
|
|
11459
11461
|
if (parallel) {
|
|
11460
11462
|
const scorerPromises = scorers.map((scorer) => runSingleScorer(scorer, context));
|
|
@@ -16772,7 +16774,7 @@ async function networkLoop({
|
|
|
16772
16774
|
processorRunner,
|
|
16773
16775
|
{ requestContext }
|
|
16774
16776
|
);
|
|
16775
|
-
await new Promise((
|
|
16777
|
+
await new Promise((resolve2) => setTimeout(resolve2, 10));
|
|
16776
16778
|
if (isComplete) {
|
|
16777
16779
|
return {
|
|
16778
16780
|
...inputData,
|
|
@@ -18134,14 +18136,14 @@ var SaveQueueManager = class _SaveQueueManager {
|
|
|
18134
18136
|
* @returns A promise that resolves when the debounced save completes.
|
|
18135
18137
|
*/
|
|
18136
18138
|
debounceSave(threadId, messageList, memoryConfig) {
|
|
18137
|
-
return new Promise((
|
|
18139
|
+
return new Promise((resolve2, reject) => {
|
|
18138
18140
|
if (this.saveDebounceTimers.has(threadId)) {
|
|
18139
18141
|
clearTimeout(this.saveDebounceTimers.get(threadId));
|
|
18140
18142
|
}
|
|
18141
18143
|
this.saveDebounceTimers.set(
|
|
18142
18144
|
threadId,
|
|
18143
18145
|
setTimeout(() => {
|
|
18144
|
-
this.enqueueSave(threadId, messageList, memoryConfig).then(
|
|
18146
|
+
this.enqueueSave(threadId, messageList, memoryConfig).then(resolve2).catch((err) => {
|
|
18145
18147
|
this.logger?.error?.("Error in debounceSave", { err, threadId });
|
|
18146
18148
|
reject(err);
|
|
18147
18149
|
}).finally(() => {
|
|
@@ -24833,6 +24835,200 @@ var ToolCallFilter = class {
|
|
|
24833
24835
|
return messages;
|
|
24834
24836
|
}
|
|
24835
24837
|
};
|
|
24838
|
+
var INSTRUCTION_FILE_NAMES = ["AGENTS.md", "CLAUDE.md", "CONTEXT.md"];
|
|
24839
|
+
var PATH_FIELDS = ["path", "file", "filePath", "target", "targetPath", "dest", "destination"];
|
|
24840
|
+
var REMINDER_TYPE = "dynamic-agents-md";
|
|
24841
|
+
function isRecord(value) {
|
|
24842
|
+
return typeof value === "object" && value !== null;
|
|
24843
|
+
}
|
|
24844
|
+
function isInstructionFileName(name) {
|
|
24845
|
+
return INSTRUCTION_FILE_NAMES.some((instructionFileName) => instructionFileName.toLowerCase() === name.toLowerCase());
|
|
24846
|
+
}
|
|
24847
|
+
function toAbsolutePath(candidatePath) {
|
|
24848
|
+
return normalize(isAbsolute(candidatePath) ? candidatePath : resolve(process.cwd(), candidatePath));
|
|
24849
|
+
}
|
|
24850
|
+
function findInstructionFileForPath(candidatePath, pathExists, isDirectory) {
|
|
24851
|
+
const absoluteCandidatePath = toAbsolutePath(candidatePath);
|
|
24852
|
+
const candidateName = basename(absoluteCandidatePath);
|
|
24853
|
+
if (isInstructionFileName(candidateName)) {
|
|
24854
|
+
return absoluteCandidatePath;
|
|
24855
|
+
}
|
|
24856
|
+
let currentDir = absoluteCandidatePath;
|
|
24857
|
+
if (!pathExists(currentDir) || !isDirectory(currentDir)) {
|
|
24858
|
+
currentDir = dirname(currentDir);
|
|
24859
|
+
}
|
|
24860
|
+
let previousDir;
|
|
24861
|
+
while (currentDir && currentDir !== previousDir) {
|
|
24862
|
+
for (const instructionFileName of INSTRUCTION_FILE_NAMES) {
|
|
24863
|
+
const instructionFilePath = join(currentDir, instructionFileName);
|
|
24864
|
+
if (pathExists(instructionFilePath)) {
|
|
24865
|
+
return instructionFilePath;
|
|
24866
|
+
}
|
|
24867
|
+
}
|
|
24868
|
+
previousDir = currentDir;
|
|
24869
|
+
currentDir = dirname(currentDir);
|
|
24870
|
+
}
|
|
24871
|
+
return void 0;
|
|
24872
|
+
}
|
|
24873
|
+
function escapeXml(value) {
|
|
24874
|
+
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
24875
|
+
}
|
|
24876
|
+
function escapeXmlAttribute(value) {
|
|
24877
|
+
return escapeXml(value).replaceAll('"', """);
|
|
24878
|
+
}
|
|
24879
|
+
function getMessageText(message) {
|
|
24880
|
+
const parts = isRecord(message.content) ? message.content.parts : void 0;
|
|
24881
|
+
if (!Array.isArray(parts)) {
|
|
24882
|
+
return "";
|
|
24883
|
+
}
|
|
24884
|
+
return parts.filter((part) => isRecord(part) && part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n");
|
|
24885
|
+
}
|
|
24886
|
+
function getReminderMarkup(reminderText, instructionPath) {
|
|
24887
|
+
return `<system-reminder type="${REMINDER_TYPE}" path="${escapeXmlAttribute(instructionPath)}">${escapeXml(reminderText)}</system-reminder>`;
|
|
24888
|
+
}
|
|
24889
|
+
function getCompletedToolCalls(messageList) {
|
|
24890
|
+
const completed = [];
|
|
24891
|
+
for (const message of messageList.get.all.db()) {
|
|
24892
|
+
const parts = isRecord(message.content) ? message.content.parts : void 0;
|
|
24893
|
+
if (!Array.isArray(parts)) {
|
|
24894
|
+
continue;
|
|
24895
|
+
}
|
|
24896
|
+
for (const part of parts) {
|
|
24897
|
+
if (!isRecord(part) || part.type !== "tool-invocation") {
|
|
24898
|
+
continue;
|
|
24899
|
+
}
|
|
24900
|
+
const invocation = part.toolInvocation;
|
|
24901
|
+
if (!invocation || invocation.state !== "result" || typeof invocation.toolCallId !== "string") {
|
|
24902
|
+
continue;
|
|
24903
|
+
}
|
|
24904
|
+
completed.push({
|
|
24905
|
+
toolCallId: invocation.toolCallId,
|
|
24906
|
+
args: invocation.args
|
|
24907
|
+
});
|
|
24908
|
+
}
|
|
24909
|
+
}
|
|
24910
|
+
return completed;
|
|
24911
|
+
}
|
|
24912
|
+
function parseInvocationArgs(args) {
|
|
24913
|
+
if (isRecord(args)) {
|
|
24914
|
+
return args;
|
|
24915
|
+
}
|
|
24916
|
+
if (typeof args !== "string") {
|
|
24917
|
+
return void 0;
|
|
24918
|
+
}
|
|
24919
|
+
try {
|
|
24920
|
+
const parsed = JSON.parse(args);
|
|
24921
|
+
return isRecord(parsed) ? parsed : void 0;
|
|
24922
|
+
} catch {
|
|
24923
|
+
return void 0;
|
|
24924
|
+
}
|
|
24925
|
+
}
|
|
24926
|
+
var AgentsMDInjector = class {
|
|
24927
|
+
id = "agents-md-injector";
|
|
24928
|
+
name = "Agents.md Injector";
|
|
24929
|
+
description = "Injects AGENTS.md reminders when instruction file operations are detected";
|
|
24930
|
+
processorIndex = 0;
|
|
24931
|
+
reminderText;
|
|
24932
|
+
pathExists;
|
|
24933
|
+
isDirectory;
|
|
24934
|
+
readFile;
|
|
24935
|
+
getIgnoredInstructionPaths;
|
|
24936
|
+
constructor(options) {
|
|
24937
|
+
this.reminderText = options.reminderText;
|
|
24938
|
+
this.pathExists = options.pathExists ?? existsSync;
|
|
24939
|
+
this.isDirectory = options.isDirectory ?? ((path) => {
|
|
24940
|
+
try {
|
|
24941
|
+
return statSync(path).isDirectory();
|
|
24942
|
+
} catch {
|
|
24943
|
+
return false;
|
|
24944
|
+
}
|
|
24945
|
+
});
|
|
24946
|
+
this.readFile = options.readFile ?? ((path) => readFileSync(path, "utf-8"));
|
|
24947
|
+
this.getIgnoredInstructionPaths = options.getIgnoredInstructionPaths;
|
|
24948
|
+
}
|
|
24949
|
+
async processInputStep(args) {
|
|
24950
|
+
const { messageList, rotateResponseMessageId } = args;
|
|
24951
|
+
const messages = messageList.get.all.db();
|
|
24952
|
+
const completedToolCalls = getCompletedToolCalls(messageList);
|
|
24953
|
+
const instructionPath = this.findReferencedInstructionPath(completedToolCalls);
|
|
24954
|
+
if (!instructionPath || this.isIgnoredInstructionPath(args, instructionPath)) {
|
|
24955
|
+
return messageList;
|
|
24956
|
+
}
|
|
24957
|
+
const reminderText = this.getReminderText(instructionPath);
|
|
24958
|
+
if (!reminderText) {
|
|
24959
|
+
return messageList;
|
|
24960
|
+
}
|
|
24961
|
+
const reminderMarkup = getReminderMarkup(reminderText, instructionPath);
|
|
24962
|
+
if (this.hasReminderAlready(messages, reminderMarkup)) {
|
|
24963
|
+
return messageList;
|
|
24964
|
+
}
|
|
24965
|
+
if (args.writer) {
|
|
24966
|
+
const chunk = {
|
|
24967
|
+
type: "data-system-reminder",
|
|
24968
|
+
data: {
|
|
24969
|
+
message: reminderText,
|
|
24970
|
+
reminderType: REMINDER_TYPE,
|
|
24971
|
+
path: instructionPath
|
|
24972
|
+
},
|
|
24973
|
+
transient: true
|
|
24974
|
+
};
|
|
24975
|
+
await args.writer.custom(chunk);
|
|
24976
|
+
}
|
|
24977
|
+
messageList.add(reminderMarkup, "user");
|
|
24978
|
+
rotateResponseMessageId?.();
|
|
24979
|
+
return messageList;
|
|
24980
|
+
}
|
|
24981
|
+
getReminderText(instructionPath) {
|
|
24982
|
+
try {
|
|
24983
|
+
const content = this.readFile(instructionPath).trim();
|
|
24984
|
+
if (content.length > 0) {
|
|
24985
|
+
return content;
|
|
24986
|
+
}
|
|
24987
|
+
} catch {
|
|
24988
|
+
}
|
|
24989
|
+
return this.reminderText?.trim() || void 0;
|
|
24990
|
+
}
|
|
24991
|
+
isIgnoredInstructionPath(args, instructionPath) {
|
|
24992
|
+
const ignoredPaths = this.getIgnoredInstructionPaths?.(args) ?? [];
|
|
24993
|
+
const normalizedInstructionPath = toAbsolutePath(instructionPath);
|
|
24994
|
+
return ignoredPaths.some((path) => toAbsolutePath(path) === normalizedInstructionPath);
|
|
24995
|
+
}
|
|
24996
|
+
findReferencedInstructionPath(toolCalls) {
|
|
24997
|
+
if (!Array.isArray(toolCalls)) {
|
|
24998
|
+
return void 0;
|
|
24999
|
+
}
|
|
25000
|
+
for (const toolCall of toolCalls) {
|
|
25001
|
+
const path = this.findInstructionPathInInvocation(toolCall);
|
|
25002
|
+
if (path) {
|
|
25003
|
+
return path;
|
|
25004
|
+
}
|
|
25005
|
+
}
|
|
25006
|
+
return void 0;
|
|
25007
|
+
}
|
|
25008
|
+
findInstructionPathInInvocation(invocation) {
|
|
25009
|
+
if (!isRecord(invocation)) {
|
|
25010
|
+
return void 0;
|
|
25011
|
+
}
|
|
25012
|
+
const args = parseInvocationArgs(invocation.args);
|
|
25013
|
+
if (!args) {
|
|
25014
|
+
return void 0;
|
|
25015
|
+
}
|
|
25016
|
+
for (const field of PATH_FIELDS) {
|
|
25017
|
+
const value = args[field];
|
|
25018
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
25019
|
+
continue;
|
|
25020
|
+
}
|
|
25021
|
+
const instructionPath = findInstructionFileForPath(value, this.pathExists, this.isDirectory);
|
|
25022
|
+
if (instructionPath) {
|
|
25023
|
+
return instructionPath;
|
|
25024
|
+
}
|
|
25025
|
+
}
|
|
25026
|
+
return void 0;
|
|
25027
|
+
}
|
|
25028
|
+
hasReminderAlready(messages, reminderMarkup) {
|
|
25029
|
+
return messages.some((message) => message.role === "user" && getMessageText(message).includes(reminderMarkup));
|
|
25030
|
+
}
|
|
25031
|
+
};
|
|
24836
25032
|
var TOOL_SEARCH_TOKENIZE_OPTIONS = {
|
|
24837
25033
|
lowercase: true,
|
|
24838
25034
|
removePunctuation: false,
|
|
@@ -25116,6 +25312,259 @@ var ToolSearchProcessor = class {
|
|
|
25116
25312
|
};
|
|
25117
25313
|
}
|
|
25118
25314
|
};
|
|
25315
|
+
var SkillSearchProcessor = class {
|
|
25316
|
+
id = "skill-search";
|
|
25317
|
+
name = "Skill Search Processor";
|
|
25318
|
+
description = "Enables on-demand skill discovery and loading via search";
|
|
25319
|
+
workspace;
|
|
25320
|
+
searchConfig;
|
|
25321
|
+
ttl;
|
|
25322
|
+
cleanupIntervalId;
|
|
25323
|
+
/**
|
|
25324
|
+
* Thread-scoped state management for loaded skills with TTL support.
|
|
25325
|
+
* Maps threadId -> ThreadState (skills + timestamp)
|
|
25326
|
+
*/
|
|
25327
|
+
threadLoadedSkills = /* @__PURE__ */ new Map();
|
|
25328
|
+
constructor(options) {
|
|
25329
|
+
this.workspace = options.workspace;
|
|
25330
|
+
this.searchConfig = {
|
|
25331
|
+
topK: options.search?.topK ?? 5,
|
|
25332
|
+
minScore: options.search?.minScore ?? 0
|
|
25333
|
+
};
|
|
25334
|
+
this.ttl = options.ttl ?? 36e5;
|
|
25335
|
+
if (this.ttl > 0) {
|
|
25336
|
+
this.scheduleCleanup();
|
|
25337
|
+
}
|
|
25338
|
+
}
|
|
25339
|
+
/**
|
|
25340
|
+
* Dispose of this processor, clearing the cleanup interval and all thread state.
|
|
25341
|
+
* Call this when the processor is no longer needed to prevent timer leaks.
|
|
25342
|
+
*/
|
|
25343
|
+
dispose() {
|
|
25344
|
+
if (this.cleanupIntervalId) {
|
|
25345
|
+
clearInterval(this.cleanupIntervalId);
|
|
25346
|
+
this.cleanupIntervalId = void 0;
|
|
25347
|
+
}
|
|
25348
|
+
this.clearAllState();
|
|
25349
|
+
}
|
|
25350
|
+
/**
|
|
25351
|
+
* Get the workspace skills interface
|
|
25352
|
+
*/
|
|
25353
|
+
get skills() {
|
|
25354
|
+
return this.workspace.skills;
|
|
25355
|
+
}
|
|
25356
|
+
/**
|
|
25357
|
+
* Get the thread ID from the request context, or use 'default' as fallback.
|
|
25358
|
+
*/
|
|
25359
|
+
getThreadId(args) {
|
|
25360
|
+
return args.requestContext?.get(MASTRA_THREAD_ID_KEY) || "default";
|
|
25361
|
+
}
|
|
25362
|
+
/**
|
|
25363
|
+
* Get or create thread state for the given thread.
|
|
25364
|
+
* Updates the lastAccessed timestamp for TTL management.
|
|
25365
|
+
*/
|
|
25366
|
+
getThreadState(threadId) {
|
|
25367
|
+
if (!this.threadLoadedSkills.has(threadId)) {
|
|
25368
|
+
this.threadLoadedSkills.set(threadId, {
|
|
25369
|
+
skills: /* @__PURE__ */ new Map(),
|
|
25370
|
+
lastAccessed: Date.now()
|
|
25371
|
+
});
|
|
25372
|
+
}
|
|
25373
|
+
const state = this.threadLoadedSkills.get(threadId);
|
|
25374
|
+
state.lastAccessed = Date.now();
|
|
25375
|
+
return state;
|
|
25376
|
+
}
|
|
25377
|
+
/**
|
|
25378
|
+
* Clear loaded skills for a specific thread.
|
|
25379
|
+
*/
|
|
25380
|
+
clearState(threadId = "default") {
|
|
25381
|
+
this.threadLoadedSkills.delete(threadId);
|
|
25382
|
+
}
|
|
25383
|
+
/**
|
|
25384
|
+
* Clear all thread state for this processor instance.
|
|
25385
|
+
*/
|
|
25386
|
+
clearAllState() {
|
|
25387
|
+
this.threadLoadedSkills.clear();
|
|
25388
|
+
}
|
|
25389
|
+
/**
|
|
25390
|
+
* Clean up stale thread state based on TTL.
|
|
25391
|
+
* @returns Number of threads cleaned up
|
|
25392
|
+
*/
|
|
25393
|
+
cleanupStaleState() {
|
|
25394
|
+
if (this.ttl <= 0) return 0;
|
|
25395
|
+
const now = Date.now();
|
|
25396
|
+
let cleanedCount = 0;
|
|
25397
|
+
for (const [threadId, state] of this.threadLoadedSkills.entries()) {
|
|
25398
|
+
if (now - state.lastAccessed > this.ttl) {
|
|
25399
|
+
this.threadLoadedSkills.delete(threadId);
|
|
25400
|
+
cleanedCount++;
|
|
25401
|
+
}
|
|
25402
|
+
}
|
|
25403
|
+
return cleanedCount;
|
|
25404
|
+
}
|
|
25405
|
+
/**
|
|
25406
|
+
* Schedule periodic cleanup of stale thread state.
|
|
25407
|
+
*/
|
|
25408
|
+
scheduleCleanup() {
|
|
25409
|
+
const cleanupInterval = Math.max(this.ttl / 2, 6e4);
|
|
25410
|
+
this.cleanupIntervalId = setInterval(() => {
|
|
25411
|
+
this.cleanupStaleState();
|
|
25412
|
+
}, cleanupInterval);
|
|
25413
|
+
if (this.cleanupIntervalId.unref) {
|
|
25414
|
+
this.cleanupIntervalId.unref();
|
|
25415
|
+
}
|
|
25416
|
+
}
|
|
25417
|
+
/**
|
|
25418
|
+
* Get statistics about current thread state.
|
|
25419
|
+
*/
|
|
25420
|
+
getStateStats() {
|
|
25421
|
+
if (this.threadLoadedSkills.size === 0) {
|
|
25422
|
+
return { threadCount: 0, oldestAccessTime: null };
|
|
25423
|
+
}
|
|
25424
|
+
let oldest = Date.now();
|
|
25425
|
+
for (const state of this.threadLoadedSkills.values()) {
|
|
25426
|
+
if (state.lastAccessed < oldest) {
|
|
25427
|
+
oldest = state.lastAccessed;
|
|
25428
|
+
}
|
|
25429
|
+
}
|
|
25430
|
+
return {
|
|
25431
|
+
threadCount: this.threadLoadedSkills.size,
|
|
25432
|
+
oldestAccessTime: oldest
|
|
25433
|
+
};
|
|
25434
|
+
}
|
|
25435
|
+
/**
|
|
25436
|
+
* Manually trigger cleanup of stale state.
|
|
25437
|
+
* @returns Number of threads cleaned up
|
|
25438
|
+
*/
|
|
25439
|
+
cleanupNow() {
|
|
25440
|
+
return this.cleanupStaleState();
|
|
25441
|
+
}
|
|
25442
|
+
async processInputStep(args) {
|
|
25443
|
+
const { tools, messageList } = args;
|
|
25444
|
+
const threadId = this.getThreadId(args);
|
|
25445
|
+
const threadState = this.getThreadState(threadId);
|
|
25446
|
+
const skills = this.skills;
|
|
25447
|
+
if (!skills) {
|
|
25448
|
+
return { tools };
|
|
25449
|
+
}
|
|
25450
|
+
if (args.stepNumber === 0) {
|
|
25451
|
+
await skills.maybeRefresh({ requestContext: args.requestContext });
|
|
25452
|
+
}
|
|
25453
|
+
messageList.addSystem(
|
|
25454
|
+
"To discover available skills, call search_skills with a keyword query. To load a skill's instructions, call load_skill with the skill name. Loaded skills provide context and instructions for the conversation."
|
|
25455
|
+
);
|
|
25456
|
+
const searchSkillTool = createTool({
|
|
25457
|
+
id: "search_skills",
|
|
25458
|
+
description: "Search for available skills by keyword. Returns a list of matching skills with their names and descriptions. After finding a useful skill, use load_skill to load its instructions.",
|
|
25459
|
+
inputSchema: z.object({
|
|
25460
|
+
query: z.string().describe('Search keywords (e.g., "api design", "testing", "deployment")')
|
|
25461
|
+
}),
|
|
25462
|
+
outputSchema: z.object({
|
|
25463
|
+
results: z.array(
|
|
25464
|
+
z.object({
|
|
25465
|
+
name: z.string(),
|
|
25466
|
+
description: z.string(),
|
|
25467
|
+
score: z.number()
|
|
25468
|
+
})
|
|
25469
|
+
),
|
|
25470
|
+
message: z.string()
|
|
25471
|
+
}),
|
|
25472
|
+
execute: async ({ query }) => {
|
|
25473
|
+
const searchResults = await skills.search(query, {
|
|
25474
|
+
topK: this.searchConfig.topK,
|
|
25475
|
+
minScore: this.searchConfig.minScore
|
|
25476
|
+
});
|
|
25477
|
+
if (searchResults.length === 0) {
|
|
25478
|
+
return {
|
|
25479
|
+
results: [],
|
|
25480
|
+
message: `No skills found matching "${query}". Try different keywords.`
|
|
25481
|
+
};
|
|
25482
|
+
}
|
|
25483
|
+
const seen = /* @__PURE__ */ new Set();
|
|
25484
|
+
const uniqueResults = searchResults.filter((r) => {
|
|
25485
|
+
if (seen.has(r.skillName)) return false;
|
|
25486
|
+
seen.add(r.skillName);
|
|
25487
|
+
return true;
|
|
25488
|
+
});
|
|
25489
|
+
const skillList = await skills.list();
|
|
25490
|
+
const metaMap = new Map(skillList.map((s) => [s.name, s]));
|
|
25491
|
+
const results = uniqueResults.map((r) => {
|
|
25492
|
+
const meta = metaMap.get(r.skillName);
|
|
25493
|
+
const description = meta?.description ?? "";
|
|
25494
|
+
return {
|
|
25495
|
+
name: r.skillName,
|
|
25496
|
+
description: description.length > 150 ? description.slice(0, 147) + "..." : description,
|
|
25497
|
+
score: Math.round(r.score * 100) / 100
|
|
25498
|
+
};
|
|
25499
|
+
});
|
|
25500
|
+
return {
|
|
25501
|
+
results,
|
|
25502
|
+
message: `Found ${results.length} skill(s). Use load_skill with the exact skill name to load its instructions.`
|
|
25503
|
+
};
|
|
25504
|
+
}
|
|
25505
|
+
});
|
|
25506
|
+
const loadSkillTool = createTool({
|
|
25507
|
+
id: "load_skill",
|
|
25508
|
+
description: "Load a skill's full instructions into the conversation. Call this after finding a skill with search_skills. The skill's instructions will be available as context.",
|
|
25509
|
+
inputSchema: z.object({
|
|
25510
|
+
skillName: z.string().describe("The exact name of the skill to load (from search results)")
|
|
25511
|
+
}),
|
|
25512
|
+
outputSchema: z.object({
|
|
25513
|
+
success: z.boolean(),
|
|
25514
|
+
message: z.string(),
|
|
25515
|
+
skillName: z.string().optional()
|
|
25516
|
+
}),
|
|
25517
|
+
execute: async ({ skillName }) => {
|
|
25518
|
+
if (threadState.skills.has(skillName)) {
|
|
25519
|
+
return {
|
|
25520
|
+
success: true,
|
|
25521
|
+
message: `Skill "${skillName}" is already loaded.`,
|
|
25522
|
+
skillName
|
|
25523
|
+
};
|
|
25524
|
+
}
|
|
25525
|
+
const skill = await skills.get(skillName);
|
|
25526
|
+
if (!skill) {
|
|
25527
|
+
const allSkills = await skills.list();
|
|
25528
|
+
const suggestions = allSkills.filter(
|
|
25529
|
+
(s) => s.name.toLowerCase().includes(skillName.toLowerCase()) || skillName.toLowerCase().includes(s.name.toLowerCase())
|
|
25530
|
+
).slice(0, 3);
|
|
25531
|
+
let message = `Skill "${skillName}" not found.`;
|
|
25532
|
+
if (suggestions.length > 0) {
|
|
25533
|
+
message += ` Did you mean: ${suggestions.map((s) => s.name).join(", ")}?`;
|
|
25534
|
+
} else {
|
|
25535
|
+
message += " Use search_skills to find available skills.";
|
|
25536
|
+
}
|
|
25537
|
+
return { success: false, message };
|
|
25538
|
+
}
|
|
25539
|
+
threadState.skills.set(skillName, skill.instructions);
|
|
25540
|
+
return {
|
|
25541
|
+
success: true,
|
|
25542
|
+
message: `Skill "${skillName}" loaded. Its instructions are now available as context.`,
|
|
25543
|
+
skillName
|
|
25544
|
+
};
|
|
25545
|
+
}
|
|
25546
|
+
});
|
|
25547
|
+
for (const [skillName, instructions] of threadState.skills) {
|
|
25548
|
+
messageList.addSystem(`[Skill: ${skillName}]
|
|
25549
|
+
|
|
25550
|
+
${instructions}`);
|
|
25551
|
+
}
|
|
25552
|
+
const metaTools = { search_skills: searchSkillTool, load_skill: loadSkillTool };
|
|
25553
|
+
if (tools) {
|
|
25554
|
+
for (const key of Object.keys(tools)) {
|
|
25555
|
+
if (key in metaTools) {
|
|
25556
|
+
console.warn(`[SkillSearchProcessor] User tool "${key}" conflicts with meta-tool and will be shadowed.`);
|
|
25557
|
+
}
|
|
25558
|
+
}
|
|
25559
|
+
}
|
|
25560
|
+
return {
|
|
25561
|
+
tools: {
|
|
25562
|
+
...tools ?? {},
|
|
25563
|
+
...metaTools
|
|
25564
|
+
}
|
|
25565
|
+
};
|
|
25566
|
+
}
|
|
25567
|
+
};
|
|
25119
25568
|
|
|
25120
25569
|
// src/memory/working-memory-utils.ts
|
|
25121
25570
|
var WORKING_MEMORY_START_TAG = "<working_memory>";
|
|
@@ -25283,7 +25732,7 @@ var MessageHistory = class {
|
|
|
25283
25732
|
return messageList;
|
|
25284
25733
|
}
|
|
25285
25734
|
await this.persistMessages({ messages: messagesToSave, threadId, resourceId });
|
|
25286
|
-
await new Promise((
|
|
25735
|
+
await new Promise((resolve2) => setTimeout(resolve2, 10));
|
|
25287
25736
|
return messageList;
|
|
25288
25737
|
}
|
|
25289
25738
|
/**
|
|
@@ -26729,6 +27178,6 @@ var MockMemory = class extends MastraMemory {
|
|
|
26729
27178
|
}
|
|
26730
27179
|
};
|
|
26731
27180
|
|
|
26732
|
-
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 };
|
|
26733
|
-
//# sourceMappingURL=chunk-
|
|
26734
|
-
//# sourceMappingURL=chunk-
|
|
27181
|
+
export { Agent, AgentsMDInjector, 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, SkillSearchProcessor, 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 };
|
|
27182
|
+
//# sourceMappingURL=chunk-IYSW4VN7.js.map
|
|
27183
|
+
//# sourceMappingURL=chunk-IYSW4VN7.js.map
|