@mastra/core 0.17.0-alpha.5 → 0.17.0-alpha.6
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 +29 -0
- package/cache.d.ts +1 -0
- package/dist/agent/agent.d.ts +1 -1
- package/dist/agent/index.cjs +11 -11
- package/dist/agent/index.js +2 -2
- package/dist/agent/input-processor/index.cjs +6 -6
- package/dist/agent/input-processor/index.js +1 -1
- package/dist/ai-tracing/index.cjs +32 -32
- package/dist/ai-tracing/index.js +1 -1
- package/dist/base.cjs +2 -2
- package/dist/base.js +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/cache/base.d.ts +14 -0
- package/dist/cache/base.d.ts.map +1 -0
- package/dist/cache/index.cjs +16 -0
- package/dist/cache/index.cjs.map +1 -0
- package/dist/cache/index.d.ts +3 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +3 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/inmemory.d.ts +13 -0
- package/dist/cache/inmemory.d.ts.map +1 -0
- package/dist/{chunk-KYFRWMTX.js → chunk-2V7YKWZX.js} +3 -3
- package/dist/{chunk-KYFRWMTX.js.map → chunk-2V7YKWZX.js.map} +1 -1
- package/dist/chunk-3PQNUWJM.js +62 -0
- package/dist/chunk-3PQNUWJM.js.map +1 -0
- package/dist/{chunk-CP4TZ4HO.cjs → chunk-3ZWRKJSW.cjs} +15 -15
- package/dist/{chunk-CP4TZ4HO.cjs.map → chunk-3ZWRKJSW.cjs.map} +1 -1
- package/dist/{chunk-QHDT3QQC.cjs → chunk-4HWB6PCC.cjs} +4 -4
- package/dist/{chunk-QHDT3QQC.cjs.map → chunk-4HWB6PCC.cjs.map} +1 -1
- package/dist/{chunk-KXCUCBEI.cjs → chunk-4L3P3PCP.cjs} +8 -8
- package/dist/{chunk-KXCUCBEI.cjs.map → chunk-4L3P3PCP.cjs.map} +1 -1
- package/dist/{chunk-666JQVO5.js → chunk-5GPOS52F.js} +36 -25
- package/dist/chunk-5GPOS52F.js.map +1 -0
- package/dist/{chunk-3DHX2SDR.cjs → chunk-5HQNR726.cjs} +7 -7
- package/dist/{chunk-3DHX2SDR.cjs.map → chunk-5HQNR726.cjs.map} +1 -1
- package/dist/{chunk-TLJPVRO5.js → chunk-5QXPHYHO.js} +2 -3
- package/dist/chunk-5QXPHYHO.js.map +1 -0
- package/dist/{chunk-7NKIBBCV.cjs → chunk-725O36VY.cjs} +6 -6
- package/dist/{chunk-7NKIBBCV.cjs.map → chunk-725O36VY.cjs.map} +1 -1
- package/dist/{chunk-VXJFKEON.js → chunk-B5G6KT7N.js} +5 -5
- package/dist/{chunk-VXJFKEON.js.map → chunk-B5G6KT7N.js.map} +1 -1
- package/dist/{chunk-6GF5M4GX.js → chunk-BMVFEBPE.js} +3 -3
- package/dist/{chunk-6GF5M4GX.js.map → chunk-BMVFEBPE.js.map} +1 -1
- package/dist/{chunk-X3GXU6TZ.js → chunk-BN2M4UK5.js} +5 -4
- package/dist/chunk-BN2M4UK5.js.map +1 -0
- package/dist/{chunk-HBQSSMAD.cjs → chunk-BZ6PR75D.cjs} +8 -8
- package/dist/{chunk-HBQSSMAD.cjs.map → chunk-BZ6PR75D.cjs.map} +1 -1
- package/dist/{chunk-IODUKRQP.js → chunk-C7EN3GVU.js} +3 -3
- package/dist/{chunk-IODUKRQP.js.map → chunk-C7EN3GVU.js.map} +1 -1
- package/dist/{chunk-7UO6UWCO.cjs → chunk-D6AHONH5.cjs} +4 -4
- package/dist/{chunk-7UO6UWCO.cjs.map → chunk-D6AHONH5.cjs.map} +1 -1
- package/dist/{chunk-YFAHGS45.js → chunk-DH34KXOJ.js} +4 -4
- package/dist/{chunk-YFAHGS45.js.map → chunk-DH34KXOJ.js.map} +1 -1
- package/dist/{chunk-IYN65QCO.js → chunk-DLLUCABV.js} +18 -33
- package/dist/chunk-DLLUCABV.js.map +1 -0
- package/dist/{chunk-EXG53YAJ.cjs → chunk-EQHKK6BB.cjs} +71 -59
- package/dist/chunk-EQHKK6BB.cjs.map +1 -0
- package/dist/{chunk-RNJ4GD7U.cjs → chunk-F5DBJ235.cjs} +9 -9
- package/dist/{chunk-RNJ4GD7U.cjs.map → chunk-F5DBJ235.cjs.map} +1 -1
- package/dist/{chunk-SZZPFXZ7.cjs → chunk-F6N4JWKV.cjs} +13 -13
- package/dist/{chunk-SZZPFXZ7.cjs.map → chunk-F6N4JWKV.cjs.map} +1 -1
- package/dist/{chunk-2PQSZI63.js → chunk-GBW5ZDLZ.js} +3 -3
- package/dist/{chunk-2PQSZI63.js.map → chunk-GBW5ZDLZ.js.map} +1 -1
- package/dist/{chunk-K3JIDVC4.js → chunk-ITD7IHN5.js} +3 -3
- package/dist/{chunk-K3JIDVC4.js.map → chunk-ITD7IHN5.js.map} +1 -1
- package/dist/{chunk-MRZHPP3G.cjs → chunk-JAJMFWRT.cjs} +4 -4
- package/dist/{chunk-MRZHPP3G.cjs.map → chunk-JAJMFWRT.cjs.map} +1 -1
- package/dist/chunk-KTCBGNCZ.cjs +69 -0
- package/dist/chunk-KTCBGNCZ.cjs.map +1 -0
- package/dist/{chunk-QQIBOVFQ.js → chunk-NRJQMZLW.js} +4 -4
- package/dist/{chunk-QQIBOVFQ.js.map → chunk-NRJQMZLW.js.map} +1 -1
- package/dist/{chunk-Z73WO76N.js → chunk-NTXNE4YR.js} +3 -3
- package/dist/{chunk-Z73WO76N.js.map → chunk-NTXNE4YR.js.map} +1 -1
- package/dist/{chunk-S5QJEY5X.cjs → chunk-O6PQYYT6.cjs} +4 -4
- package/dist/{chunk-S5QJEY5X.cjs.map → chunk-O6PQYYT6.cjs.map} +1 -1
- package/dist/{chunk-AHJY7RHO.cjs → chunk-OT25QTJ2.cjs} +6 -6
- package/dist/{chunk-AHJY7RHO.cjs.map → chunk-OT25QTJ2.cjs.map} +1 -1
- package/dist/{chunk-ABRPHTOG.cjs → chunk-PRVMPHNQ.cjs} +2 -2
- package/dist/{chunk-ABRPHTOG.cjs.map → chunk-PRVMPHNQ.cjs.map} +1 -1
- package/dist/{chunk-G366B5BY.js → chunk-PYVA36ZV.js} +3 -3
- package/dist/{chunk-G366B5BY.js.map → chunk-PYVA36ZV.js.map} +1 -1
- package/dist/{chunk-NRGXWM6C.js → chunk-Q3KDKDXZ.js} +6 -6
- package/dist/{chunk-NRGXWM6C.js.map → chunk-Q3KDKDXZ.js.map} +1 -1
- package/dist/chunk-QLYANYE2.cjs +14 -0
- package/dist/{chunk-QPOJZU26.cjs.map → chunk-QLYANYE2.cjs.map} +1 -1
- package/dist/{chunk-BJGHUKKM.js → chunk-RAQ4VAQ4.js} +2 -2
- package/dist/{chunk-BJGHUKKM.js.map → chunk-RAQ4VAQ4.js.map} +1 -1
- package/dist/{chunk-PL3B3FZM.js → chunk-SPD7FTTH.js} +5 -5
- package/dist/{chunk-PL3B3FZM.js.map → chunk-SPD7FTTH.js.map} +1 -1
- package/dist/{chunk-XRJDA7BI.js → chunk-SPZSVMEW.js} +3 -3
- package/dist/{chunk-XRJDA7BI.js.map → chunk-SPZSVMEW.js.map} +1 -1
- package/dist/{chunk-VBBMXF7Z.cjs → chunk-WM4KFRLA.cjs} +30 -45
- package/dist/chunk-WM4KFRLA.cjs.map +1 -0
- package/dist/{chunk-F6XWBVVG.cjs → chunk-WOC5SCZF.cjs} +4 -4
- package/dist/{chunk-F6XWBVVG.cjs.map → chunk-WOC5SCZF.cjs.map} +1 -1
- package/dist/{chunk-V5WKCX3G.cjs → chunk-WVCEJBDR.cjs} +5 -4
- package/dist/chunk-WVCEJBDR.cjs.map +1 -0
- package/dist/{chunk-D43ZGJR3.js → chunk-XBBHFBQL.js} +3 -3
- package/dist/{chunk-D43ZGJR3.js.map → chunk-XBBHFBQL.js.map} +1 -1
- package/dist/{chunk-4VHC2F5H.js → chunk-YVLIR34D.js} +4 -4
- package/dist/{chunk-4VHC2F5H.js.map → chunk-YVLIR34D.js.map} +1 -1
- package/dist/{chunk-GEPX327P.cjs → chunk-YWXSGDDO.cjs} +4 -4
- package/dist/{chunk-GEPX327P.cjs.map → chunk-YWXSGDDO.cjs.map} +1 -1
- package/dist/{chunk-BHB4PDNV.cjs → chunk-ZBINIUJL.cjs} +2 -3
- package/dist/chunk-ZBINIUJL.cjs.map +1 -0
- package/dist/deployer/index.cjs +2 -2
- package/dist/deployer/index.js +1 -1
- package/dist/index.cjs +66 -66
- package/dist/index.js +18 -18
- package/dist/integration/index.cjs +3 -3
- package/dist/integration/index.js +1 -1
- package/dist/logger/constants.d.ts +1 -0
- package/dist/logger/constants.d.ts.map +1 -1
- package/dist/logger/index.cjs +6 -6
- package/dist/logger/index.js +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/test-utils/generateText.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +6 -12
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mcp/index.cjs +4 -4
- package/dist/mcp/index.js +2 -2
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.js +1 -1
- package/dist/network/vNext/index.cjs +34 -34
- package/dist/network/vNext/index.cjs.map +1 -1
- package/dist/network/vNext/index.js +5 -5
- package/dist/network/vNext/index.js.map +1 -1
- package/dist/processors/index.cjs +8 -8
- package/dist/processors/index.js +2 -2
- package/dist/processors/processors/prompt-injection-detector.d.ts.map +1 -1
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.js +1 -1
- package/dist/scores/index.cjs +8 -8
- package/dist/scores/index.js +1 -1
- package/dist/server/index.cjs +4 -4
- package/dist/server/index.js +2 -2
- package/dist/storage/index.cjs +17 -17
- package/dist/storage/index.js +4 -4
- package/dist/stream/MastraWorkflowStream.d.ts +5 -4
- package/dist/stream/MastraWorkflowStream.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +7 -3
- package/dist/stream/index.d.ts +1 -0
- package/dist/stream/index.d.ts.map +1 -1
- package/dist/stream/index.js +1 -1
- package/dist/telemetry/index.cjs +7 -7
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/telemetry.decorators.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +2 -2
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tools/index.cjs +4 -4
- 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/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool.d.ts +2 -4
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/types.d.ts +5 -4
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/utils.cjs +17 -17
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +4 -4
- package/dist/vector/index.js +1 -1
- package/dist/voice/index.cjs +4 -4
- package/dist/voice/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 +10 -10
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/legacy/index.cjs +22 -22
- package/dist/workflows/legacy/index.js +1 -1
- package/dist/workflows/workflow.d.ts +44 -4
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/chunk-666JQVO5.js.map +0 -1
- package/dist/chunk-BHB4PDNV.cjs.map +0 -1
- package/dist/chunk-EXG53YAJ.cjs.map +0 -1
- package/dist/chunk-IYN65QCO.js.map +0 -1
- package/dist/chunk-QPOJZU26.cjs +0 -14
- package/dist/chunk-TLJPVRO5.js.map +0 -1
- package/dist/chunk-V5WKCX3G.cjs.map +0 -1
- package/dist/chunk-VBBMXF7Z.cjs.map +0 -1
- package/dist/chunk-X3GXU6TZ.js.map +0 -1
- package/dist/network/index.cjs +0 -316
- package/dist/network/index.cjs.map +0 -1
- package/dist/network/index.d.ts +0 -3
- package/dist/network/index.d.ts.map +0 -1
- package/dist/network/index.js +0 -314
- package/dist/network/index.js.map +0 -1
- package/dist/network/network.d.ts +0 -124
- package/dist/network/network.d.ts.map +0 -1
- package/dist/network/types.d.ts +0 -9
- package/dist/network/types.d.ts.map +0 -1
- package/network.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
+
## 0.17.0-alpha.6
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- dependencies updates: ([#7861](https://github.com/mastra-ai/mastra/pull/7861))
|
|
12
|
+
- Updated dependency [`hono@^4.9.7` ↗︎](https://www.npmjs.com/package/hono/v/4.9.7) (from `^4.9.6`, in `dependencies`)
|
|
13
|
+
|
|
14
|
+
- clean up console logs in monorepo ([#7926](https://github.com/mastra-ai/mastra/pull/7926))
|
|
15
|
+
|
|
16
|
+
- Register server cache in Mastra ([#7946](https://github.com/mastra-ai/mastra/pull/7946))
|
|
17
|
+
|
|
18
|
+
- Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
|
|
19
|
+
|
|
20
|
+
- move ToolExecutionOptions and ToolCallOptions to a union type (ToolInvocationOptions) for use in createTool, Tool, and ToolAction ([#7914](https://github.com/mastra-ai/mastra/pull/7914))
|
|
21
|
+
|
|
22
|
+
- fix scorers table link full row ([#7915](https://github.com/mastra-ai/mastra/pull/7915))
|
|
23
|
+
|
|
24
|
+
- adjust the way we display scorers in agent metadata ([#7910](https://github.com/mastra-ai/mastra/pull/7910))
|
|
25
|
+
|
|
26
|
+
- fix: support destructuring of streamVNext return values ([#7920](https://github.com/mastra-ai/mastra/pull/7920))
|
|
27
|
+
|
|
28
|
+
- Remove extraneous console.log ([#7916](https://github.com/mastra-ai/mastra/pull/7916))
|
|
29
|
+
|
|
30
|
+
- Fix switch in prompt-injection ([#7951](https://github.com/mastra-ai/mastra/pull/7951))
|
|
31
|
+
|
|
3
32
|
## 0.17.0-alpha.5
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
package/cache.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/cache';
|
package/dist/agent/agent.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare class Agent<TAgentId extends string = string, TTools extends Tool
|
|
|
47
47
|
evals: TMetrics;
|
|
48
48
|
private _agentNetworkAppend;
|
|
49
49
|
constructor(config: AgentConfig<TAgentId, TTools, TMetrics>);
|
|
50
|
-
getMastraInstance(): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, import("../workflows/legacy").LegacyWorkflow<Step<string, any, any, import("../workflows/legacy").StepExecutionContext<any, import("../workflows/legacy").WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, Workflow<any, import("..").Step<string, any, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, import("../vector").MastraVector<import("../vector/filter").VectorFilter>>, Record<string, import("../tts").MastraTTS>, import("../logger").IMastraLogger, Record<string, import("../network
|
|
50
|
+
getMastraInstance(): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, import("../workflows/legacy").LegacyWorkflow<Step<string, any, any, import("../workflows/legacy").StepExecutionContext<any, import("../workflows/legacy").WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, Workflow<any, import("..").Step<string, any, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, import("../vector").MastraVector<import("../vector/filter").VectorFilter>>, Record<string, import("../tts").MastraTTS>, import("../logger").IMastraLogger, Record<string, import("../network/vNext").NewAgentNetwork>, Record<string, import("../mcp").MCPServerBase>, Record<string, MastraScorer<any, any, any, any>>> | undefined;
|
|
51
51
|
listAgents({ runtimeContext }?: {
|
|
52
52
|
runtimeContext?: RuntimeContext;
|
|
53
53
|
}): Record<string, Agent<string, ToolsInput, Record<string, Metric>>> | Promise<Record<string, Agent<string, ToolsInput, Record<string, Metric>>>>;
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkEQHKK6BB_cjs = require('../chunk-EQHKK6BB.cjs');
|
|
4
|
+
var chunkJAJMFWRT_cjs = require('../chunk-JAJMFWRT.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Agent", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkEQHKK6BB_cjs.Agent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "LanguageDetectorInputProcessor", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkEQHKK6BB_cjs.LanguageDetectorInputProcessor; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "ModerationInputProcessor", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkEQHKK6BB_cjs.ModerationInputProcessor; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "PIIDetectorInputProcessor", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkEQHKK6BB_cjs.PIIDetectorInputProcessor; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "PromptInjectionDetectorInputProcessor", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkEQHKK6BB_cjs.PromptInjectionDetectorInputProcessor; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "TripWire", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkEQHKK6BB_cjs.TripWire; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "UnicodeNormalizerInputProcessor", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkEQHKK6BB_cjs.UnicodeNormalizerInputProcessor; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "MessageList", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkJAJMFWRT_cjs.MessageList; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "convertMessages", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkJAJMFWRT_cjs.convertMessages; }
|
|
43
43
|
});
|
|
44
44
|
//# sourceMappingURL=index.cjs.map
|
|
45
45
|
//# sourceMappingURL=index.cjs.map
|
package/dist/agent/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Agent, LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, TripWire, UnicodeNormalizerInputProcessor } from '../chunk-
|
|
2
|
-
export { MessageList, convertMessages } from '../chunk-
|
|
1
|
+
export { Agent, LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, TripWire, UnicodeNormalizerInputProcessor } from '../chunk-5GPOS52F.js';
|
|
2
|
+
export { MessageList, convertMessages } from '../chunk-SPZSVMEW.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkEQHKK6BB_cjs = require('../../chunk-EQHKK6BB.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "LanguageDetectorInputProcessor", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkEQHKK6BB_cjs.LanguageDetectorInputProcessor; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "ModerationInputProcessor", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkEQHKK6BB_cjs.ModerationInputProcessor; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "PIIDetectorInputProcessor", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkEQHKK6BB_cjs.PIIDetectorInputProcessor; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "PromptInjectionDetectorInputProcessor", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkEQHKK6BB_cjs.PromptInjectionDetectorInputProcessor; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "UnicodeNormalizerInputProcessor", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkEQHKK6BB_cjs.UnicodeNormalizerInputProcessor; }
|
|
26
26
|
});
|
|
27
27
|
//# sourceMappingURL=index.cjs.map
|
|
28
28
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, UnicodeNormalizerInputProcessor } from '../../chunk-
|
|
1
|
+
export { LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, UnicodeNormalizerInputProcessor } from '../../chunk-5GPOS52F.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,132 +1,132 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3ZWRKJSW_cjs = require('../chunk-3ZWRKJSW.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "AISpanType", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk3ZWRKJSW_cjs.AISpanType; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "AITracingEventType", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk3ZWRKJSW_cjs.AITracingEventType; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "BaseAISpan", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk3ZWRKJSW_cjs.BaseAISpan; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "BaseAITracing", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk3ZWRKJSW_cjs.BaseAITracing; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "CloudExporter", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk3ZWRKJSW_cjs.CloudExporter; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "ConsoleExporter", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk3ZWRKJSW_cjs.ConsoleExporter; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "DefaultAISpan", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunk3ZWRKJSW_cjs.DefaultAISpan; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "DefaultAITracing", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunk3ZWRKJSW_cjs.DefaultAITracing; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "DefaultExporter", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunk3ZWRKJSW_cjs.DefaultExporter; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "InternalSpans", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunk3ZWRKJSW_cjs.InternalSpans; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "NoOpAISpan", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunk3ZWRKJSW_cjs.NoOpAISpan; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "SamplingStrategyType", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunk3ZWRKJSW_cjs.SamplingStrategyType; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "SensitiveDataFilter", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunk3ZWRKJSW_cjs.SensitiveDataFilter; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "clearAITracingRegistry", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunk3ZWRKJSW_cjs.clearAITracingRegistry; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "deepClean", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunk3ZWRKJSW_cjs.deepClean; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "getAITracing", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunk3ZWRKJSW_cjs.getAITracing; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "getAllAITracing", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunk3ZWRKJSW_cjs.getAllAITracing; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "getDefaultAITracing", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunk3ZWRKJSW_cjs.getDefaultAITracing; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "getOrCreateSpan", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunk3ZWRKJSW_cjs.getOrCreateSpan; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "getSelectedAITracing", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunk3ZWRKJSW_cjs.getSelectedAITracing; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "getValidTraceId", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunk3ZWRKJSW_cjs.getValidTraceId; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "hasAITracing", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunk3ZWRKJSW_cjs.hasAITracing; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "isMastra", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunk3ZWRKJSW_cjs.isMastra; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "omitKeys", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunk3ZWRKJSW_cjs.omitKeys; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "registerAITracing", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunk3ZWRKJSW_cjs.registerAITracing; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "selectFields", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunk3ZWRKJSW_cjs.selectFields; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "setSelector", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunk3ZWRKJSW_cjs.setSelector; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "setupAITracing", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunk3ZWRKJSW_cjs.setupAITracing; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "shutdownAITracingRegistry", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunk3ZWRKJSW_cjs.shutdownAITracingRegistry; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "unregisterAITracing", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunk3ZWRKJSW_cjs.unregisterAITracing; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "wrapMastra", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunk3ZWRKJSW_cjs.wrapMastra; }
|
|
130
130
|
});
|
|
131
131
|
//# sourceMappingURL=index.cjs.map
|
|
132
132
|
//# sourceMappingURL=index.cjs.map
|
package/dist/ai-tracing/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, clearAITracingRegistry, deepClean, getAITracing, getAllAITracing, getDefaultAITracing, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isMastra, omitKeys, registerAITracing, selectFields, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra } from '../chunk-
|
|
1
|
+
export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, clearAITracingRegistry, deepClean, getAITracing, getAllAITracing, getDefaultAITracing, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isMastra, omitKeys, registerAITracing, selectFields, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra } from '../chunk-SPD7FTTH.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/base.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4L3P3PCP_cjs = require('./chunk-4L3P3PCP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "MastraBase", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk4L3P3PCP_cjs.MastraBase; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=base.cjs.map
|
|
12
12
|
//# sourceMappingURL=base.cjs.map
|
package/dist/base.js
CHANGED
package/dist/bundler/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4HWB6PCC_cjs = require('../chunk-4HWB6PCC.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "MastraBundler", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk4HWB6PCC_cjs.MastraBundler; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/bundler/index.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MastraBase } from '../base.js';
|
|
2
|
+
export declare abstract class MastraServerCache extends MastraBase {
|
|
3
|
+
constructor({ name }: {
|
|
4
|
+
name: string;
|
|
5
|
+
});
|
|
6
|
+
abstract get(key: string): Promise<unknown>;
|
|
7
|
+
abstract listLength(key: string): Promise<number>;
|
|
8
|
+
abstract set(key: string, value: unknown): Promise<void>;
|
|
9
|
+
abstract listPush(key: string, value: unknown): Promise<void>;
|
|
10
|
+
abstract listFromTo(key: string, from: number, to?: number): Promise<unknown[]>;
|
|
11
|
+
abstract delete(key: string): Promise<void>;
|
|
12
|
+
abstract clear(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/cache/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,8BAAsB,iBAAkB,SAAQ,UAAU;gBAC5C,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;IAOtC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAE3C,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAEjD,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAExD,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAE7D,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAE/E,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3C,QAAQ,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAChC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkKTCBGNCZ_cjs = require('../chunk-KTCBGNCZ.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "InMemoryServerCache", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkKTCBGNCZ_cjs.InMemoryServerCache; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "MastraServerCache", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkKTCBGNCZ_cjs.MastraServerCache; }
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=index.cjs.map
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MastraServerCache } from './base.js';
|
|
2
|
+
export declare class InMemoryServerCache extends MastraServerCache {
|
|
3
|
+
private cache;
|
|
4
|
+
constructor();
|
|
5
|
+
get(key: string): Promise<unknown>;
|
|
6
|
+
set(key: string, value: unknown): Promise<void>;
|
|
7
|
+
listLength(key: string): Promise<number>;
|
|
8
|
+
listPush(key: string, value: unknown): Promise<void>;
|
|
9
|
+
listFromTo(key: string, from: number, to?: number): Promise<unknown[]>;
|
|
10
|
+
delete(key: string): Promise<void>;
|
|
11
|
+
clear(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=inmemory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inmemory.d.ts","sourceRoot":"","sources":["../../src/cache/inmemory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,qBAAa,mBAAoB,SAAQ,iBAAiB;IACxD,OAAO,CAAC,KAAK,CAGV;;IAMG,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQxC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IASpD,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAE,MAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAU1E,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Agent } from './chunk-
|
|
1
|
+
import { Agent } from './chunk-5GPOS52F.js';
|
|
2
2
|
|
|
3
3
|
// src/relevance/cohere/index.ts
|
|
4
4
|
var CohereRelevanceScorer = class {
|
|
@@ -83,5 +83,5 @@ Always return just the number, no explanation.`,
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt };
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-2V7YKWZX.js.map
|
|
87
|
+
//# sourceMappingURL=chunk-2V7YKWZX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/relevance/cohere/index.ts","../src/relevance/relevance-score-provider.ts","../src/relevance/mastra-agent/index.ts"],"names":[],"mappings":";;;AAoBO,IAAM,wBAAN,MAA8D;AAAA,EAC3D,KAAA;AAAA,EACA,MAAA;AAAA,EACR,WAAA,CAAY,OAAe,MAAA,EAAiB;AAC1C,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN;AAAA,KACF;AACA,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AAAA,EACA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,QAAA,GAAW,MAAM,KAAA,CAAM,CAAA,gCAAA,CAAA,EAAoC;AAAA,MAC/D,MAAA,EAAQ,MAAA;AAAA,MACR,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB,kBAAA;AAAA,QAChB,aAAA,EAAe,CAAA,OAAA,EAAU,IAAA,CAAK,MAAM,CAAA;AAAA,OACtC;AAAA,MACA,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,QACnB,KAAA;AAAA,QACA,SAAA,EAAW,CAAC,IAAI,CAAA;AAAA,QAChB,OAAO,IAAA,CAAK,KAAA;AAAA,QACZ,KAAA,EAAO;AAAA,OACR;AAAA,KACF,CAAA;AAED,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,kBAAA,EAAqB,QAAA,CAAS,MAAM,IAAI,MAAM,QAAA,CAAS,IAAA,EAAM,CAAA,CAAE,CAAA;AAAA,IACjF;AAEA,IAAA,MAAM,IAAA,GAAQ,MAAM,QAAA,CAAS,IAAA,EAAK;AAClC,IAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,OAAA,CAAQ,CAAC,CAAA,EAAG,eAAA;AAExC,IAAA,IAAI,CAAC,cAAA,EAAgB;AACnB,MAAA,MAAM,IAAI,MAAM,6CAA6C,CAAA;AAAA,IAC/D;AAEA,IAAA,OAAO,cAAA;AAAA,EACT;AACF;;;ACpDO,SAAS,sBAAA,CAAuB,OAAe,IAAA,EAAsB;AAC1E,EAAA,OAAO,CAAA;;AAAA,OAAA,EAEA,KAAK;;AAAA,MAAA,EAEN,IAAI;;AAAA,sBAAA,CAAA;AAGZ;;;ACRO,IAAM,6BAAN,MAAmE;AAAA,EAChE,KAAA;AAAA,EAER,WAAA,CAAY,MAAc,KAAA,EAA4B;AACpD,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAI,KAAA,CAAM;AAAA,MACrB,IAAA,EAAM,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC9B,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAAA,CAAA;AAAA,MAUd;AAAA,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,KAAA,CAAM,QAAA,EAAS;AAExC,IAAA,IAAI,QAAA;AACJ,IAAA,IAAI,KAAA,CAAM,yBAAyB,IAAA,EAAM;AACvC,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,cAAc,MAAM,CAAA;AAC1D,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B,CAAA,MAAO;AACL,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,SAAS,MAAM,CAAA;AACrD,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B;AACA,IAAA,OAAO,WAAW,QAAQ,CAAA;AAAA,EAC5B;AACF","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/relevance/cohere/index.ts","../src/relevance/relevance-score-provider.ts","../src/relevance/mastra-agent/index.ts"],"names":[],"mappings":";;;AAoBO,IAAM,wBAAN,MAA8D;AAAA,EAC3D,KAAA;AAAA,EACA,MAAA;AAAA,EACR,WAAA,CAAY,OAAe,MAAA,EAAiB;AAC1C,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN;AAAA,KACF;AACA,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AAAA,EACA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,QAAA,GAAW,MAAM,KAAA,CAAM,CAAA,gCAAA,CAAA,EAAoC;AAAA,MAC/D,MAAA,EAAQ,MAAA;AAAA,MACR,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB,kBAAA;AAAA,QAChB,aAAA,EAAe,CAAA,OAAA,EAAU,IAAA,CAAK,MAAM,CAAA;AAAA,OACtC;AAAA,MACA,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,QACnB,KAAA;AAAA,QACA,SAAA,EAAW,CAAC,IAAI,CAAA;AAAA,QAChB,OAAO,IAAA,CAAK,KAAA;AAAA,QACZ,KAAA,EAAO;AAAA,OACR;AAAA,KACF,CAAA;AAED,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,kBAAA,EAAqB,QAAA,CAAS,MAAM,IAAI,MAAM,QAAA,CAAS,IAAA,EAAM,CAAA,CAAE,CAAA;AAAA,IACjF;AAEA,IAAA,MAAM,IAAA,GAAQ,MAAM,QAAA,CAAS,IAAA,EAAK;AAClC,IAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,OAAA,CAAQ,CAAC,CAAA,EAAG,eAAA;AAExC,IAAA,IAAI,CAAC,cAAA,EAAgB;AACnB,MAAA,MAAM,IAAI,MAAM,6CAA6C,CAAA;AAAA,IAC/D;AAEA,IAAA,OAAO,cAAA;AAAA,EACT;AACF;;;ACpDO,SAAS,sBAAA,CAAuB,OAAe,IAAA,EAAsB;AAC1E,EAAA,OAAO,CAAA;;AAAA,OAAA,EAEA,KAAK;;AAAA,MAAA,EAEN,IAAI;;AAAA,sBAAA,CAAA;AAGZ;;;ACRO,IAAM,6BAAN,MAAmE;AAAA,EAChE,KAAA;AAAA,EAER,WAAA,CAAY,MAAc,KAAA,EAA4B;AACpD,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAI,KAAA,CAAM;AAAA,MACrB,IAAA,EAAM,oBAAoB,IAAI,CAAA,CAAA;AAAA,MAC9B,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAAA,CAAA;AAAA,MAUd;AAAA,KACD,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAe,IAAA,EAA+B;AACpE,IAAA,MAAM,MAAA,GAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,KAAA,CAAM,QAAA,EAAS;AAExC,IAAA,IAAI,QAAA;AACJ,IAAA,IAAI,KAAA,CAAM,yBAAyB,IAAA,EAAM;AACvC,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,cAAc,MAAM,CAAA;AAC1D,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B,CAAA,MAAO;AACL,MAAA,MAAM,YAAA,GAAe,MAAM,IAAA,CAAK,KAAA,CAAM,SAAS,MAAM,CAAA;AACrD,MAAA,QAAA,GAAW,YAAA,CAAa,IAAA;AAAA,IAC1B;AACA,IAAA,OAAO,WAAW,QAAQ,CAAA;AAAA,EAC5B;AACF","file":"chunk-2V7YKWZX.js","sourcesContent":["import type { RelevanceScoreProvider } from '../relevance-score-provider';\n\ninterface CohereRerankingResponse {\n results: Array<{\n index: number;\n relevance_score: number;\n }>;\n id: string;\n meta: {\n api_version: {\n version: string;\n is_experimental: boolean;\n };\n billed_units: {\n search_units: number;\n };\n };\n}\n\n/** @deprecated Import from `@mastra/rag` instead */\nexport class CohereRelevanceScorer implements RelevanceScoreProvider {\n private model: string;\n private apiKey?: string;\n constructor(model: string, apiKey?: string) {\n console.warn(\n 'CohereRelevanceScorer exported from @mastra/core is deprecated. Please import from \"@mastra/rag\" instead.',\n );\n this.apiKey = apiKey;\n this.model = model;\n }\n async getRelevanceScore(query: string, text: string): Promise<number> {\n const response = await fetch(`https://api.cohere.com/v2/rerank`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${this.apiKey}`,\n },\n body: JSON.stringify({\n query,\n documents: [text],\n model: this.model,\n top_n: 1,\n }),\n });\n\n if (!response.ok) {\n throw new Error(`Cohere API error: ${response.status} ${await response.text()}`);\n }\n\n const data = (await response.json()) as CohereRerankingResponse;\n const relevanceScore = data.results[0]?.relevance_score;\n\n if (!relevanceScore) {\n throw new Error('No relevance score found on Cohere response');\n }\n\n return relevanceScore;\n }\n}\n","// Provider interfaces\nexport interface RelevanceScoreProvider {\n getRelevanceScore(text1: string, text2: string): Promise<number>;\n}\n\n// Helper function used by providers\nexport function createSimilarityPrompt(query: string, text: string): string {\n return `Rate the semantic similarity between the following the query and the text on a scale from 0 to 1 (decimals allowed), where 1 means exactly the same meaning and 0 means completely different:\n\nQuery: ${query}\n\nText: ${text}\n\nRelevance score (0-1):`;\n}\n","import { Agent } from '../../agent';\nimport type { MastraLanguageModel } from '../../llm/model/shared.types';\nimport { createSimilarityPrompt } from '../relevance-score-provider';\nimport type { RelevanceScoreProvider } from '../relevance-score-provider';\n\n// Mastra Agent implementation\nexport class MastraAgentRelevanceScorer implements RelevanceScoreProvider {\n private agent: Agent;\n\n constructor(name: string, model: MastraLanguageModel) {\n this.agent = new Agent({\n name: `Relevance Scorer ${name}`,\n instructions: `You are a specialized agent for evaluating the relevance of text to queries.\nYour task is to rate how well a text passage answers a given query.\nOutput only a number between 0 and 1, where:\n1.0 = Perfectly relevant, directly answers the query\n0.0 = Completely irrelevant\nConsider:\n- Direct relevance to the question\n- Completeness of information\n- Quality and specificity\nAlways return just the number, no explanation.`,\n model,\n });\n }\n\n async getRelevanceScore(query: string, text: string): Promise<number> {\n const prompt = createSimilarityPrompt(query, text);\n\n const model = await this.agent.getModel();\n\n let response: string;\n if (model.specificationVersion === 'v2') {\n const responseText = await this.agent.generateVNext(prompt);\n response = responseText.text;\n } else {\n const responseText = await this.agent.generate(prompt);\n response = responseText.text;\n }\n return parseFloat(response);\n }\n}\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { MastraBase } from './chunk-BMVFEBPE.js';
|
|
2
|
+
import TTLCache from '@isaacs/ttlcache';
|
|
3
|
+
|
|
4
|
+
// src/cache/base.ts
|
|
5
|
+
var MastraServerCache = class extends MastraBase {
|
|
6
|
+
constructor({ name }) {
|
|
7
|
+
super({
|
|
8
|
+
component: "SERVER_CACHE",
|
|
9
|
+
name
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// src/cache/inmemory.ts
|
|
15
|
+
var InMemoryServerCache = class extends MastraServerCache {
|
|
16
|
+
cache = new TTLCache({
|
|
17
|
+
max: 1e3,
|
|
18
|
+
ttl: 1e3 * 60 * 5
|
|
19
|
+
});
|
|
20
|
+
constructor() {
|
|
21
|
+
super({ name: "InMemoryServerCache" });
|
|
22
|
+
}
|
|
23
|
+
async get(key) {
|
|
24
|
+
return this.cache.get(key);
|
|
25
|
+
}
|
|
26
|
+
async set(key, value) {
|
|
27
|
+
this.cache.set(key, value);
|
|
28
|
+
}
|
|
29
|
+
async listLength(key) {
|
|
30
|
+
const list = this.cache.get(key);
|
|
31
|
+
if (!Array.isArray(list)) {
|
|
32
|
+
throw new Error(`${key} is not an array`);
|
|
33
|
+
}
|
|
34
|
+
return list.length;
|
|
35
|
+
}
|
|
36
|
+
async listPush(key, value) {
|
|
37
|
+
const list = this.cache.get(key);
|
|
38
|
+
if (Array.isArray(list)) {
|
|
39
|
+
list.push(value);
|
|
40
|
+
} else {
|
|
41
|
+
this.cache.set(key, [value]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async listFromTo(key, from, to = -1) {
|
|
45
|
+
const list = this.cache.get(key);
|
|
46
|
+
if (Array.isArray(list)) {
|
|
47
|
+
const endIndex = to === -1 ? void 0 : to + 1;
|
|
48
|
+
return list.slice(from, endIndex);
|
|
49
|
+
}
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
async delete(key) {
|
|
53
|
+
this.cache.delete(key);
|
|
54
|
+
}
|
|
55
|
+
async clear() {
|
|
56
|
+
this.cache.clear();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { InMemoryServerCache, MastraServerCache };
|
|
61
|
+
//# sourceMappingURL=chunk-3PQNUWJM.js.map
|
|
62
|
+
//# sourceMappingURL=chunk-3PQNUWJM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cache/base.ts","../src/cache/inmemory.ts"],"names":[],"mappings":";;;;AAEO,IAAe,iBAAA,GAAf,cAAyC,UAAA,CAAW;AAAA,EACzD,WAAA,CAAY,EAAE,IAAA,EAAK,EAAqB;AACtC,IAAA,KAAA,CAAM;AAAA,MACJ,SAAA,EAAW,cAAA;AAAA,MACX;AAAA,KACD,CAAA;AAAA,EACH;AAeF;;;ACpBO,IAAM,mBAAA,GAAN,cAAkC,iBAAA,CAAkB;AAAA,EACjD,KAAA,GAAmC,IAAI,QAAA,CAAS;AAAA,IACtD,GAAA,EAAK,GAAA;AAAA,IACL,GAAA,EAAK,MAAO,EAAA,GAAK;AAAA,GAClB,CAAA;AAAA,EAED,WAAA,GAAc;AACZ,IAAA,KAAA,CAAM,EAAE,IAAA,EAAM,qBAAA,EAAuB,CAAA;AAAA,EACvC;AAAA,EAEA,MAAM,IAAI,GAAA,EAA+B;AACvC,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,GAAG,CAAA;AAAA,EAC3B;AAAA,EAEA,MAAM,GAAA,CAAI,GAAA,EAAa,KAAA,EAA+B;AACpD,IAAA,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,GAAA,EAAK,KAAK,CAAA;AAAA,EAC3B;AAAA,EAEA,MAAM,WAAW,GAAA,EAA8B;AAC7C,IAAA,MAAM,IAAA,GAAO,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,GAAG,CAAA;AAC/B,IAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,EAAG;AACxB,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,GAAG,CAAA,gBAAA,CAAkB,CAAA;AAAA,IAC1C;AACA,IAAA,OAAO,IAAA,CAAK,MAAA;AAAA,EACd;AAAA,EAEA,MAAM,QAAA,CAAS,GAAA,EAAa,KAAA,EAA+B;AACzD,IAAA,MAAM,IAAA,GAAO,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,GAAG,CAAA;AAC/B,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,EAAG;AACvB,MAAA,IAAA,CAAK,KAAK,KAAK,CAAA;AAAA,IACjB,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,GAAA,EAAK,CAAC,KAAK,CAAC,CAAA;AAAA,IAC7B;AAAA,EACF;AAAA,EAEA,MAAM,UAAA,CAAW,GAAA,EAAa,IAAA,EAAc,KAAa,EAAA,EAAwB;AAC/E,IAAA,MAAM,IAAA,GAAO,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,GAAG,CAAA;AAC/B,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,EAAG;AAEvB,MAAA,MAAM,QAAA,GAAW,EAAA,KAAO,EAAA,GAAK,MAAA,GAAY,EAAA,GAAK,CAAA;AAC9C,MAAA,OAAO,IAAA,CAAK,KAAA,CAAM,IAAA,EAAM,QAAQ,CAAA;AAAA,IAClC;AACA,IAAA,OAAO,EAAC;AAAA,EACV;AAAA,EAEA,MAAM,OAAO,GAAA,EAA4B;AACvC,IAAA,IAAA,CAAK,KAAA,CAAM,OAAO,GAAG,CAAA;AAAA,EACvB;AAAA,EAEA,MAAM,KAAA,GAAuB;AAC3B,IAAA,IAAA,CAAK,MAAM,KAAA,EAAM;AAAA,EACnB;AACF","file":"chunk-3PQNUWJM.js","sourcesContent":["import { MastraBase } from '../base';\n\nexport abstract class MastraServerCache extends MastraBase {\n constructor({ name }: { name: string }) {\n super({\n component: 'SERVER_CACHE',\n name,\n });\n }\n\n abstract get(key: string): Promise<unknown>;\n\n abstract listLength(key: string): Promise<number>;\n\n abstract set(key: string, value: unknown): Promise<void>;\n\n abstract listPush(key: string, value: unknown): Promise<void>;\n\n abstract listFromTo(key: string, from: number, to?: number): Promise<unknown[]>;\n\n abstract delete(key: string): Promise<void>;\n\n abstract clear(): Promise<void>;\n}\n","import TTLCache from '@isaacs/ttlcache';\nimport { MastraServerCache } from './base';\n\nexport class InMemoryServerCache extends MastraServerCache {\n private cache: TTLCache<string, unknown> = new TTLCache({\n max: 1000,\n ttl: 1000 * 60 * 5,\n });\n\n constructor() {\n super({ name: 'InMemoryServerCache' });\n }\n\n async get(key: string): Promise<unknown> {\n return this.cache.get(key);\n }\n\n async set(key: string, value: unknown): Promise<void> {\n this.cache.set(key, value);\n }\n\n async listLength(key: string): Promise<number> {\n const list = this.cache.get(key) as unknown[];\n if (!Array.isArray(list)) {\n throw new Error(`${key} is not an array`);\n }\n return list.length;\n }\n\n async listPush(key: string, value: unknown): Promise<void> {\n const list = this.cache.get(key) as unknown[];\n if (Array.isArray(list)) {\n list.push(value);\n } else {\n this.cache.set(key, [value]);\n }\n }\n\n async listFromTo(key: string, from: number, to: number = -1): Promise<unknown[]> {\n const list = this.cache.get(key) as unknown[];\n if (Array.isArray(list)) {\n // Make 'to' inclusive like Redis LRANGE - add 1 unless it's -1\n const endIndex = to === -1 ? undefined : to + 1;\n return list.slice(from, endIndex);\n }\n return [];\n }\n\n async delete(key: string): Promise<void> {\n this.cache.delete(key);\n }\n\n async clear(): Promise<void> {\n this.cache.clear();\n }\n}\n"]}
|