@mastra/core 0.10.13 → 0.10.15-alpha.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/a2a.d.ts +1 -0
- package/agent.d.ts +1 -0
- package/base.d.ts +1 -0
- package/bundler.d.ts +1 -0
- package/deployer.d.ts +1 -0
- package/di.d.ts +1 -0
- package/dist/a2a/index.cjs +79 -0
- package/dist/a2a/index.d.cts +780 -0
- package/dist/a2a/index.d.ts +780 -0
- package/dist/a2a/index.js +68 -0
- package/dist/agent/index.cjs +15 -0
- package/dist/agent/index.d.cts +29 -0
- package/dist/agent/index.d.ts +29 -0
- package/dist/agent/index.js +2 -0
- package/dist/base-B_y9sMg0.d.cts +162 -0
- package/dist/base-CTj7ESwt.d.cts +4132 -0
- package/dist/base-ClrXcCRx.d.ts +162 -0
- package/dist/base-qVqAnB-c.d.ts +4132 -0
- package/dist/base.cjs +10 -0
- package/dist/base.d.cts +6 -0
- package/dist/base.d.ts +6 -0
- package/dist/base.js +1 -0
- package/dist/bundler/index.cjs +10 -0
- package/dist/bundler/index.d.cts +30 -0
- package/dist/bundler/index.d.ts +30 -0
- package/dist/bundler/index.js +1 -0
- package/dist/chunk-32C7JDIZ.js +1 -0
- package/dist/chunk-4UWPFBC6.js +88 -0
- package/dist/chunk-4Z3OU5RY.cjs +31 -0
- package/dist/chunk-5HTMDAXP.js +359 -0
- package/dist/chunk-5IEKR756.js +53 -0
- package/dist/chunk-5YDTZN2X.js +114 -0
- package/dist/chunk-6UNGH46J.js +75 -0
- package/dist/chunk-6Y4UL5Z6.cjs +94 -0
- package/dist/chunk-7H2GET5Z.cjs +668 -0
- package/dist/chunk-7HZ6NIAF.cjs +2 -0
- package/dist/chunk-7XQIPES3.js +668 -0
- package/dist/chunk-AKYTYALY.js +70 -0
- package/dist/chunk-AOWJUV2N.js +2415 -0
- package/dist/chunk-ATXBSEFT.js +22 -0
- package/dist/chunk-B6TOBUS6.cjs +80 -0
- package/dist/chunk-B7SQOKEC.cjs +91 -0
- package/dist/chunk-BB4KXGBU.js +83 -0
- package/dist/chunk-BB6DPGIV.cjs +6 -0
- package/dist/chunk-BVD7NVAR.cjs +244 -0
- package/dist/chunk-C4LMN2IR.js +27 -0
- package/dist/chunk-DR4JS662.js +989 -0
- package/dist/chunk-F2WMR75C.cjs +183 -0
- package/dist/chunk-FEYYOBBG.cjs +24 -0
- package/dist/chunk-FL5SZ2XU.js +181 -0
- package/dist/chunk-GH2KM66J.js +37 -0
- package/dist/chunk-GWFS5DAR.cjs +37 -0
- package/dist/chunk-HNEE7IF4.js +60 -0
- package/dist/chunk-HSVOEWAM.cjs +2 -0
- package/dist/chunk-IBKM5CLQ.js +428 -0
- package/dist/chunk-ID5LG5CQ.cjs +659 -0
- package/dist/chunk-J52TXHZV.cjs +73 -0
- package/dist/chunk-J62R4M7K.js +240 -0
- package/dist/chunk-JNMQKJH4.js +10 -0
- package/dist/chunk-JQOMTERC.js +89 -0
- package/dist/chunk-LABUWBKX.cjs +71 -0
- package/dist/chunk-LBUQ6YNU.cjs +447 -0
- package/dist/chunk-LXFZUKP3.cjs +34 -0
- package/dist/chunk-MP2QBLUJ.cjs +70 -0
- package/dist/chunk-MUNFCOMB.cjs +62 -0
- package/dist/chunk-MVCHTRVB.js +5038 -0
- package/dist/chunk-NH5WJNNS.js +1 -0
- package/dist/chunk-P3Q73CAW.cjs +55 -0
- package/dist/chunk-Q33INUG2.cjs +81 -0
- package/dist/chunk-QFTBW7ZZ.cjs +2 -0
- package/dist/chunk-QQ5K5TZE.cjs +619 -0
- package/dist/chunk-R4V75T7J.js +1 -0
- package/dist/chunk-RVFWMGGR.js +77 -0
- package/dist/chunk-SGGPJWRQ.js +69 -0
- package/dist/chunk-ST5RMVLG.cjs +87 -0
- package/dist/chunk-TC2SCOTE.js +605 -0
- package/dist/chunk-TTMYHBQM.js +657 -0
- package/dist/chunk-U64IJDC5.cjs +109 -0
- package/dist/chunk-ULZ6MRTN.cjs +5065 -0
- package/dist/chunk-V5D2LIF5.js +68 -0
- package/dist/chunk-WQNOATKB.js +103 -0
- package/dist/chunk-Y7D2JLKS.js +4 -0
- package/dist/chunk-YOQP5T77.js +32 -0
- package/dist/chunk-ZCU3PLIL.cjs +2429 -0
- package/dist/chunk-ZIZ3CVHN.cjs +120 -0
- package/dist/chunk-ZPOUMTTH.cjs +362 -0
- package/dist/chunk-ZTPPDHQK.cjs +991 -0
- package/dist/chunk-ZZLBNB3U.cjs +12 -0
- package/dist/deployer/index.cjs +10 -0
- package/dist/deployer/index.d.cts +19 -0
- package/dist/deployer/index.d.ts +19 -0
- package/dist/deployer/index.js +1 -0
- package/dist/di/index.cjs +10 -0
- package/dist/di/index.d.cts +1 -0
- package/dist/di/index.d.ts +1 -0
- package/dist/di/index.js +1 -0
- package/dist/error/index.cjs +22 -0
- package/dist/error/index.d.cts +86 -0
- package/dist/error/index.d.ts +86 -0
- package/dist/error/index.js +1 -0
- package/dist/eval/index.cjs +14 -0
- package/dist/eval/index.d.cts +43 -0
- package/dist/eval/index.d.ts +43 -0
- package/dist/eval/index.js +1 -0
- package/dist/hooks/index.cjs +18 -0
- package/dist/hooks/index.d.cts +33 -0
- package/dist/hooks/index.d.ts +33 -0
- package/dist/hooks/index.js +1 -0
- package/dist/index.cjs +285 -0
- package/dist/index.d.cts +92 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +112 -0
- package/dist/integration/index.cjs +14 -0
- package/dist/integration/index.d.cts +65 -0
- package/dist/integration/index.d.ts +65 -0
- package/dist/integration/index.js +1 -0
- package/dist/llm/index.cjs +10 -0
- package/dist/llm/index.d.cts +29 -0
- package/dist/llm/index.d.ts +29 -0
- package/dist/llm/index.js +1 -0
- package/dist/logger/index.cjs +43 -0
- package/dist/logger/index.d.cts +96 -0
- package/dist/logger/index.d.ts +96 -0
- package/dist/logger/index.js +2 -0
- package/dist/logger-B8XXh6ya.d.cts +159 -0
- package/dist/logger-Bpa2oLL4.d.ts +159 -0
- package/dist/mastra/index.cjs +10 -0
- package/dist/mastra/index.d.cts +29 -0
- package/dist/mastra/index.d.ts +29 -0
- package/dist/mastra/index.js +1 -0
- package/dist/mcp/index.cjs +106 -0
- package/dist/mcp/index.d.cts +29 -0
- package/dist/mcp/index.d.ts +29 -0
- package/dist/mcp/index.js +100 -0
- package/dist/memory/index.cjs +18 -0
- package/dist/memory/index.d.cts +29 -0
- package/dist/memory/index.d.ts +29 -0
- package/dist/memory/index.js +1 -0
- package/dist/network/index.cjs +311 -0
- package/dist/network/index.d.cts +29 -0
- package/dist/network/index.d.ts +29 -0
- package/dist/network/index.js +309 -0
- package/dist/network/vNext/index.cjs +880 -0
- package/dist/network/vNext/index.d.cts +29 -0
- package/dist/network/vNext/index.d.ts +29 -0
- package/dist/network/vNext/index.js +878 -0
- package/dist/relevance/index.cjs +18 -0
- package/dist/relevance/index.d.cts +50 -0
- package/dist/relevance/index.d.ts +50 -0
- package/dist/relevance/index.js +1 -0
- package/dist/runtime-context/index.cjs +10 -0
- package/dist/runtime-context/index.d.cts +52 -0
- package/dist/runtime-context/index.d.ts +52 -0
- package/dist/runtime-context/index.js +1 -0
- package/dist/server/index.cjs +62 -0
- package/dist/server/index.d.cts +52 -0
- package/dist/server/index.d.ts +52 -0
- package/dist/server/index.js +59 -0
- package/dist/storage/index.cjs +336 -0
- package/dist/storage/index.d.cts +149 -0
- package/dist/storage/index.d.ts +149 -0
- package/dist/storage/index.js +303 -0
- package/dist/telemetry/index.cjs +30 -0
- package/dist/telemetry/index.d.cts +75 -0
- package/dist/telemetry/index.d.ts +75 -0
- package/dist/telemetry/index.js +1 -0
- package/dist/telemetry/otel-vendor.cjs +103 -0
- package/dist/telemetry/otel-vendor.d.cts +20 -0
- package/dist/telemetry/otel-vendor.d.ts +20 -0
- package/dist/telemetry/otel-vendor.js +57 -0
- package/dist/tools/index.cjs +18 -0
- package/dist/tools/index.d.cts +41 -0
- package/dist/tools/index.d.ts +41 -0
- package/dist/tools/index.js +1 -0
- package/dist/tts/index.cjs +10 -0
- package/dist/tts/index.d.cts +28 -0
- package/dist/tts/index.d.ts +28 -0
- package/dist/tts/index.js +1 -0
- package/dist/types-Bo1uigWx.d.cts +17 -0
- package/dist/types-Bo1uigWx.d.ts +17 -0
- package/dist/utils.cjs +62 -0
- package/dist/utils.d.cts +150 -0
- package/dist/utils.d.ts +150 -0
- package/dist/utils.js +1 -0
- package/dist/vector/filter/index.cjs +192 -0
- package/dist/vector/filter/index.d.cts +128 -0
- package/dist/vector/filter/index.d.ts +128 -0
- package/dist/vector/filter/index.js +190 -0
- package/dist/vector/index.cjs +10 -0
- package/dist/vector/index.d.cts +77 -0
- package/dist/vector/index.d.ts +77 -0
- package/dist/vector/index.js +1 -0
- package/dist/voice/index.cjs +18 -0
- package/dist/voice/index.d.cts +29 -0
- package/dist/voice/index.d.ts +29 -0
- package/dist/voice/index.js +1 -0
- package/dist/workflows/constants.cjs +10 -0
- package/dist/workflows/constants.d.cts +3 -0
- package/dist/workflows/constants.d.ts +3 -0
- package/dist/workflows/constants.js +1 -0
- package/dist/workflows/index.cjs +42 -0
- package/dist/workflows/index.d.cts +285 -0
- package/dist/workflows/index.d.ts +285 -0
- package/dist/workflows/index.js +1 -0
- package/dist/workflows/legacy/index.cjs +90 -0
- package/dist/workflows/legacy/index.d.cts +91 -0
- package/dist/workflows/legacy/index.d.ts +91 -0
- package/dist/workflows/legacy/index.js +1 -0
- package/error.d.ts +1 -0
- package/eval.d.ts +1 -0
- package/hooks.d.ts +1 -0
- package/integration.d.ts +1 -0
- package/llm.d.ts +1 -0
- package/logger.d.ts +1 -0
- package/mastra.d.ts +1 -0
- package/mcp.d.ts +1 -0
- package/memory.d.ts +1 -0
- package/network/vNext.d.ts +1 -0
- package/network.d.ts +1 -0
- package/package.json +2 -3
- package/relevance.d.ts +1 -0
- package/runtime-context.d.ts +1 -0
- package/server.d.ts +1 -0
- package/storage.d.ts +1 -0
- package/telemetry/otel-vendor.d.ts +1 -0
- package/telemetry.d.ts +1 -0
- package/tools.d.ts +1 -0
- package/tts.d.ts +1 -0
- package/utils.d.ts +1 -0
- package/vector/filter.d.ts +1 -0
- package/vector.d.ts +1 -0
- package/voice.d.ts +1 -0
- package/workflows/_constants.d.ts +1 -0
- package/workflows/legacy.d.ts +1 -0
- package/workflows.d.ts +1 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQ33INUG2_cjs = require('../chunk-Q33INUG2.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "CohereRelevanceScorer", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkQ33INUG2_cjs.CohereRelevanceScorer; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "MastraAgentRelevanceScorer", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkQ33INUG2_cjs.MastraAgentRelevanceScorer; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "createSimilarityPrompt", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkQ33INUG2_cjs.createSimilarityPrompt; }
|
|
18
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { aY as MastraLanguageModel } from '../base-CTj7ESwt.cjs';
|
|
2
|
+
import '../base-B_y9sMg0.cjs';
|
|
3
|
+
import 'ai';
|
|
4
|
+
import 'json-schema';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../logger-B8XXh6ya.cjs';
|
|
7
|
+
import '../error/index.cjs';
|
|
8
|
+
import 'stream';
|
|
9
|
+
import '../types-Bo1uigWx.cjs';
|
|
10
|
+
import 'sift';
|
|
11
|
+
import '../runtime-context/index.cjs';
|
|
12
|
+
import '@opentelemetry/api';
|
|
13
|
+
import 'xstate';
|
|
14
|
+
import 'node:events';
|
|
15
|
+
import '../vector/index.cjs';
|
|
16
|
+
import '../vector/filter/index.cjs';
|
|
17
|
+
import '../tts/index.cjs';
|
|
18
|
+
import '@opentelemetry/sdk-trace-base';
|
|
19
|
+
import 'node:http';
|
|
20
|
+
import 'hono';
|
|
21
|
+
import 'stream/web';
|
|
22
|
+
import 'events';
|
|
23
|
+
import 'node:stream/web';
|
|
24
|
+
import '../workflows/constants.cjs';
|
|
25
|
+
import 'ai/test';
|
|
26
|
+
import '../deployer/index.cjs';
|
|
27
|
+
import '../bundler/index.cjs';
|
|
28
|
+
import 'hono/cors';
|
|
29
|
+
import 'hono-openapi';
|
|
30
|
+
|
|
31
|
+
interface RelevanceScoreProvider {
|
|
32
|
+
getRelevanceScore(text1: string, text2: string): Promise<number>;
|
|
33
|
+
}
|
|
34
|
+
declare function createSimilarityPrompt(query: string, text: string): string;
|
|
35
|
+
|
|
36
|
+
/** @deprecated Import from `@mastra/rag` instead */
|
|
37
|
+
declare class CohereRelevanceScorer implements RelevanceScoreProvider {
|
|
38
|
+
private model;
|
|
39
|
+
private apiKey?;
|
|
40
|
+
constructor(model: string, apiKey?: string);
|
|
41
|
+
getRelevanceScore(query: string, text: string): Promise<number>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare class MastraAgentRelevanceScorer implements RelevanceScoreProvider {
|
|
45
|
+
private agent;
|
|
46
|
+
constructor(name: string, model: MastraLanguageModel);
|
|
47
|
+
getRelevanceScore(query: string, text: string): Promise<number>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, type RelevanceScoreProvider, createSimilarityPrompt };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { aY as MastraLanguageModel } from '../base-qVqAnB-c.js';
|
|
2
|
+
import '../base-ClrXcCRx.js';
|
|
3
|
+
import 'ai';
|
|
4
|
+
import 'json-schema';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../logger-Bpa2oLL4.js';
|
|
7
|
+
import '../error/index.js';
|
|
8
|
+
import 'stream';
|
|
9
|
+
import '../types-Bo1uigWx.js';
|
|
10
|
+
import 'sift';
|
|
11
|
+
import '../runtime-context/index.js';
|
|
12
|
+
import '@opentelemetry/api';
|
|
13
|
+
import 'xstate';
|
|
14
|
+
import 'node:events';
|
|
15
|
+
import '../vector/index.js';
|
|
16
|
+
import '../vector/filter/index.js';
|
|
17
|
+
import '../tts/index.js';
|
|
18
|
+
import '@opentelemetry/sdk-trace-base';
|
|
19
|
+
import 'node:http';
|
|
20
|
+
import 'hono';
|
|
21
|
+
import 'stream/web';
|
|
22
|
+
import 'events';
|
|
23
|
+
import 'node:stream/web';
|
|
24
|
+
import '../workflows/constants.js';
|
|
25
|
+
import 'ai/test';
|
|
26
|
+
import '../deployer/index.js';
|
|
27
|
+
import '../bundler/index.js';
|
|
28
|
+
import 'hono/cors';
|
|
29
|
+
import 'hono-openapi';
|
|
30
|
+
|
|
31
|
+
interface RelevanceScoreProvider {
|
|
32
|
+
getRelevanceScore(text1: string, text2: string): Promise<number>;
|
|
33
|
+
}
|
|
34
|
+
declare function createSimilarityPrompt(query: string, text: string): string;
|
|
35
|
+
|
|
36
|
+
/** @deprecated Import from `@mastra/rag` instead */
|
|
37
|
+
declare class CohereRelevanceScorer implements RelevanceScoreProvider {
|
|
38
|
+
private model;
|
|
39
|
+
private apiKey?;
|
|
40
|
+
constructor(model: string, apiKey?: string);
|
|
41
|
+
getRelevanceScore(query: string, text: string): Promise<number>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare class MastraAgentRelevanceScorer implements RelevanceScoreProvider {
|
|
45
|
+
private agent;
|
|
46
|
+
constructor(name: string, model: MastraLanguageModel);
|
|
47
|
+
getRelevanceScore(query: string, text: string): Promise<number>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, type RelevanceScoreProvider, createSimilarityPrompt };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-RVFWMGGR.js';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
type RecordToTuple<T> = {
|
|
2
|
+
[K in keyof T]: [K, T[K]];
|
|
3
|
+
}[keyof T][];
|
|
4
|
+
declare class RuntimeContext<Values extends Record<string, any> | unknown = unknown> {
|
|
5
|
+
private registry;
|
|
6
|
+
constructor(iterable?: Values extends Record<string, any> ? RecordToTuple<Partial<Values>> : Iterable<readonly [string, unknown]>);
|
|
7
|
+
/**
|
|
8
|
+
* set a value with strict typing if `Values` is a Record and the key exists in it.
|
|
9
|
+
*/
|
|
10
|
+
set<K extends Values extends Record<string, any> ? keyof Values : string>(key: K, value: Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : never) : unknown): void;
|
|
11
|
+
/**
|
|
12
|
+
* Get a value with its type
|
|
13
|
+
*/
|
|
14
|
+
get<K extends Values extends Record<string, any> ? keyof Values : string, R = Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : never) : unknown>(key: K): R;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a key exists in the container
|
|
17
|
+
*/
|
|
18
|
+
has<K extends Values extends Record<string, any> ? keyof Values : string>(key: K): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Delete a value by key
|
|
21
|
+
*/
|
|
22
|
+
delete<K extends Values extends Record<string, any> ? keyof Values : string>(key: K): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Clear all values from the container
|
|
25
|
+
*/
|
|
26
|
+
clear(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Get all keys in the container
|
|
29
|
+
*/
|
|
30
|
+
keys<R = Values extends Record<string, any> ? keyof Values : string>(): IterableIterator<R>;
|
|
31
|
+
/**
|
|
32
|
+
* Get all values in the container
|
|
33
|
+
*/
|
|
34
|
+
values<R = Values extends Record<string, any> ? Values[keyof Values] : unknown>(): IterableIterator<R>;
|
|
35
|
+
/**
|
|
36
|
+
* Get all entries in the container
|
|
37
|
+
*/
|
|
38
|
+
entries<R = Values extends Record<string, any> ? Values[keyof Values] : unknown>(): IterableIterator<[
|
|
39
|
+
string,
|
|
40
|
+
R
|
|
41
|
+
]>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the size of the container
|
|
44
|
+
*/
|
|
45
|
+
size(): number;
|
|
46
|
+
/**
|
|
47
|
+
* Execute a function for each entry in the container
|
|
48
|
+
*/
|
|
49
|
+
forEach<T = any>(callbackfn: (value: T, key: string, map: Map<string, any>) => void): void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { RuntimeContext };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
type RecordToTuple<T> = {
|
|
2
|
+
[K in keyof T]: [K, T[K]];
|
|
3
|
+
}[keyof T][];
|
|
4
|
+
declare class RuntimeContext<Values extends Record<string, any> | unknown = unknown> {
|
|
5
|
+
private registry;
|
|
6
|
+
constructor(iterable?: Values extends Record<string, any> ? RecordToTuple<Partial<Values>> : Iterable<readonly [string, unknown]>);
|
|
7
|
+
/**
|
|
8
|
+
* set a value with strict typing if `Values` is a Record and the key exists in it.
|
|
9
|
+
*/
|
|
10
|
+
set<K extends Values extends Record<string, any> ? keyof Values : string>(key: K, value: Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : never) : unknown): void;
|
|
11
|
+
/**
|
|
12
|
+
* Get a value with its type
|
|
13
|
+
*/
|
|
14
|
+
get<K extends Values extends Record<string, any> ? keyof Values : string, R = Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : never) : unknown>(key: K): R;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a key exists in the container
|
|
17
|
+
*/
|
|
18
|
+
has<K extends Values extends Record<string, any> ? keyof Values : string>(key: K): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Delete a value by key
|
|
21
|
+
*/
|
|
22
|
+
delete<K extends Values extends Record<string, any> ? keyof Values : string>(key: K): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Clear all values from the container
|
|
25
|
+
*/
|
|
26
|
+
clear(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Get all keys in the container
|
|
29
|
+
*/
|
|
30
|
+
keys<R = Values extends Record<string, any> ? keyof Values : string>(): IterableIterator<R>;
|
|
31
|
+
/**
|
|
32
|
+
* Get all values in the container
|
|
33
|
+
*/
|
|
34
|
+
values<R = Values extends Record<string, any> ? Values[keyof Values] : unknown>(): IterableIterator<R>;
|
|
35
|
+
/**
|
|
36
|
+
* Get all entries in the container
|
|
37
|
+
*/
|
|
38
|
+
entries<R = Values extends Record<string, any> ? Values[keyof Values] : unknown>(): IterableIterator<[
|
|
39
|
+
string,
|
|
40
|
+
R
|
|
41
|
+
]>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the size of the container
|
|
44
|
+
*/
|
|
45
|
+
size(): number;
|
|
46
|
+
/**
|
|
47
|
+
* Execute a function for each entry in the container
|
|
48
|
+
*/
|
|
49
|
+
forEach<T = any>(callbackfn: (value: T, key: string, map: Map<string, any>) => void): void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { RuntimeContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RuntimeContext } from '../chunk-SGGPJWRQ.js';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQQ5K5TZE_cjs = require('../chunk-QQ5K5TZE.cjs');
|
|
4
|
+
var chunkB6TOBUS6_cjs = require('../chunk-B6TOBUS6.cjs');
|
|
5
|
+
var chunkP3Q73CAW_cjs = require('../chunk-P3Q73CAW.cjs');
|
|
6
|
+
var chunkU64IJDC5_cjs = require('../chunk-U64IJDC5.cjs');
|
|
7
|
+
|
|
8
|
+
// src/server/auth.ts
|
|
9
|
+
var _MastraAuthProvider_decorators, _init, _a;
|
|
10
|
+
_MastraAuthProvider_decorators = [chunkQQ5K5TZE_cjs.InstrumentClass({
|
|
11
|
+
prefix: "auth",
|
|
12
|
+
excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
|
|
13
|
+
})];
|
|
14
|
+
exports.MastraAuthProvider = class MastraAuthProvider extends (_a = chunkP3Q73CAW_cjs.MastraBase) {
|
|
15
|
+
constructor(options) {
|
|
16
|
+
super({
|
|
17
|
+
component: "AUTH",
|
|
18
|
+
name: options?.name
|
|
19
|
+
});
|
|
20
|
+
if (options?.authorizeUser) {
|
|
21
|
+
this.authorizeUser = options.authorizeUser.bind(this);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
registerOptions(opts) {
|
|
25
|
+
if (opts?.authorizeUser) {
|
|
26
|
+
this.authorizeUser = opts.authorizeUser.bind(this);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.MastraAuthProvider = /*@__PURE__*/(_ => {
|
|
31
|
+
_init = chunkU64IJDC5_cjs.__decoratorStart(_a);
|
|
32
|
+
exports.MastraAuthProvider = chunkU64IJDC5_cjs.__decorateElement(_init, 0, "MastraAuthProvider", _MastraAuthProvider_decorators, exports.MastraAuthProvider);
|
|
33
|
+
chunkU64IJDC5_cjs.__runInitializers(_init, 1, exports.MastraAuthProvider);
|
|
34
|
+
|
|
35
|
+
// src/server/index.ts
|
|
36
|
+
return exports.MastraAuthProvider;
|
|
37
|
+
})();
|
|
38
|
+
// src/server/index.ts
|
|
39
|
+
function registerApiRoute(path, options) {
|
|
40
|
+
if (path.startsWith("/api/")) {
|
|
41
|
+
throw new chunkB6TOBUS6_cjs.MastraError({
|
|
42
|
+
id: "MASTRA_SERVER_API_PATH_RESERVED",
|
|
43
|
+
text: `Path must not start with "/api", it's reserved for internal API routes`,
|
|
44
|
+
domain: "MASTRA_SERVER" /* MASTRA_SERVER */,
|
|
45
|
+
category: "USER" /* USER */
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
path,
|
|
50
|
+
method: options.method,
|
|
51
|
+
handler: options.handler,
|
|
52
|
+
createHandler: options.createHandler,
|
|
53
|
+
openapi: options.openapi,
|
|
54
|
+
middleware: options.middleware
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function defineAuth(config) {
|
|
58
|
+
return config;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
exports.defineAuth = defineAuth;
|
|
62
|
+
exports.registerApiRoute = registerApiRoute;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Handler, Context, MiddlewareHandler } from 'hono';
|
|
2
|
+
import { DescribeRouteOptions } from 'hono-openapi';
|
|
3
|
+
import { i as Methods, M as Mastra, j as ApiRoute, k as MastraAuthConfig } from '../base-CTj7ESwt.cjs';
|
|
4
|
+
export { l as ContextWithMastra, m as MastraAuthProvider, n as MastraAuthProviderOptions } from '../base-CTj7ESwt.cjs';
|
|
5
|
+
import 'ai';
|
|
6
|
+
import '../base-B_y9sMg0.cjs';
|
|
7
|
+
import '@opentelemetry/api';
|
|
8
|
+
import '../logger-B8XXh6ya.cjs';
|
|
9
|
+
import '../error/index.cjs';
|
|
10
|
+
import 'stream';
|
|
11
|
+
import '@opentelemetry/sdk-trace-base';
|
|
12
|
+
import 'json-schema';
|
|
13
|
+
import 'zod';
|
|
14
|
+
import '../types-Bo1uigWx.cjs';
|
|
15
|
+
import 'sift';
|
|
16
|
+
import '../runtime-context/index.cjs';
|
|
17
|
+
import 'xstate';
|
|
18
|
+
import 'node:events';
|
|
19
|
+
import '../vector/index.cjs';
|
|
20
|
+
import '../vector/filter/index.cjs';
|
|
21
|
+
import '../tts/index.cjs';
|
|
22
|
+
import 'node:http';
|
|
23
|
+
import 'stream/web';
|
|
24
|
+
import 'events';
|
|
25
|
+
import 'node:stream/web';
|
|
26
|
+
import '../workflows/constants.cjs';
|
|
27
|
+
import 'ai/test';
|
|
28
|
+
import '../deployer/index.cjs';
|
|
29
|
+
import '../bundler/index.cjs';
|
|
30
|
+
import 'hono/cors';
|
|
31
|
+
|
|
32
|
+
type ParamsFromPath<P extends string> = {
|
|
33
|
+
[K in P extends `${string}:${infer Param}/${string}` | `${string}:${infer Param}` ? Param : never]: string;
|
|
34
|
+
};
|
|
35
|
+
declare function registerApiRoute<P extends string>(path: P, options: P extends `/api/${string}` ? never : {
|
|
36
|
+
method: Methods;
|
|
37
|
+
openapi?: DescribeRouteOptions;
|
|
38
|
+
handler?: Handler<{
|
|
39
|
+
Variables: {
|
|
40
|
+
mastra: Mastra;
|
|
41
|
+
};
|
|
42
|
+
}, P, ParamsFromPath<P>>;
|
|
43
|
+
createHandler?: (c: Context) => Promise<Handler<{
|
|
44
|
+
Variables: {
|
|
45
|
+
mastra: Mastra;
|
|
46
|
+
};
|
|
47
|
+
}, P, ParamsFromPath<P>>>;
|
|
48
|
+
middleware?: MiddlewareHandler | MiddlewareHandler[];
|
|
49
|
+
}): P extends `/api/${string}` ? never : ApiRoute;
|
|
50
|
+
declare function defineAuth<TUser>(config: MastraAuthConfig<TUser>): MastraAuthConfig<TUser>;
|
|
51
|
+
|
|
52
|
+
export { MastraAuthConfig, defineAuth, registerApiRoute };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Handler, Context, MiddlewareHandler } from 'hono';
|
|
2
|
+
import { DescribeRouteOptions } from 'hono-openapi';
|
|
3
|
+
import { i as Methods, M as Mastra, j as ApiRoute, k as MastraAuthConfig } from '../base-qVqAnB-c.js';
|
|
4
|
+
export { l as ContextWithMastra, m as MastraAuthProvider, n as MastraAuthProviderOptions } from '../base-qVqAnB-c.js';
|
|
5
|
+
import 'ai';
|
|
6
|
+
import '../base-ClrXcCRx.js';
|
|
7
|
+
import '@opentelemetry/api';
|
|
8
|
+
import '../logger-Bpa2oLL4.js';
|
|
9
|
+
import '../error/index.js';
|
|
10
|
+
import 'stream';
|
|
11
|
+
import '@opentelemetry/sdk-trace-base';
|
|
12
|
+
import 'json-schema';
|
|
13
|
+
import 'zod';
|
|
14
|
+
import '../types-Bo1uigWx.js';
|
|
15
|
+
import 'sift';
|
|
16
|
+
import '../runtime-context/index.js';
|
|
17
|
+
import 'xstate';
|
|
18
|
+
import 'node:events';
|
|
19
|
+
import '../vector/index.js';
|
|
20
|
+
import '../vector/filter/index.js';
|
|
21
|
+
import '../tts/index.js';
|
|
22
|
+
import 'node:http';
|
|
23
|
+
import 'stream/web';
|
|
24
|
+
import 'events';
|
|
25
|
+
import 'node:stream/web';
|
|
26
|
+
import '../workflows/constants.js';
|
|
27
|
+
import 'ai/test';
|
|
28
|
+
import '../deployer/index.js';
|
|
29
|
+
import '../bundler/index.js';
|
|
30
|
+
import 'hono/cors';
|
|
31
|
+
|
|
32
|
+
type ParamsFromPath<P extends string> = {
|
|
33
|
+
[K in P extends `${string}:${infer Param}/${string}` | `${string}:${infer Param}` ? Param : never]: string;
|
|
34
|
+
};
|
|
35
|
+
declare function registerApiRoute<P extends string>(path: P, options: P extends `/api/${string}` ? never : {
|
|
36
|
+
method: Methods;
|
|
37
|
+
openapi?: DescribeRouteOptions;
|
|
38
|
+
handler?: Handler<{
|
|
39
|
+
Variables: {
|
|
40
|
+
mastra: Mastra;
|
|
41
|
+
};
|
|
42
|
+
}, P, ParamsFromPath<P>>;
|
|
43
|
+
createHandler?: (c: Context) => Promise<Handler<{
|
|
44
|
+
Variables: {
|
|
45
|
+
mastra: Mastra;
|
|
46
|
+
};
|
|
47
|
+
}, P, ParamsFromPath<P>>>;
|
|
48
|
+
middleware?: MiddlewareHandler | MiddlewareHandler[];
|
|
49
|
+
}): P extends `/api/${string}` ? never : ApiRoute;
|
|
50
|
+
declare function defineAuth<TUser>(config: MastraAuthConfig<TUser>): MastraAuthConfig<TUser>;
|
|
51
|
+
|
|
52
|
+
export { MastraAuthConfig, defineAuth, registerApiRoute };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { InstrumentClass } from '../chunk-TC2SCOTE.js';
|
|
2
|
+
import { MastraError } from '../chunk-6UNGH46J.js';
|
|
3
|
+
import { MastraBase } from '../chunk-5IEKR756.js';
|
|
4
|
+
import { __decoratorStart, __decorateElement, __runInitializers } from '../chunk-WQNOATKB.js';
|
|
5
|
+
|
|
6
|
+
// src/server/auth.ts
|
|
7
|
+
var _MastraAuthProvider_decorators, _init, _a;
|
|
8
|
+
_MastraAuthProvider_decorators = [InstrumentClass({
|
|
9
|
+
prefix: "auth",
|
|
10
|
+
excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
|
|
11
|
+
})];
|
|
12
|
+
var MastraAuthProvider = class extends (_a = MastraBase) {
|
|
13
|
+
constructor(options) {
|
|
14
|
+
super({
|
|
15
|
+
component: "AUTH",
|
|
16
|
+
name: options?.name
|
|
17
|
+
});
|
|
18
|
+
if (options?.authorizeUser) {
|
|
19
|
+
this.authorizeUser = options.authorizeUser.bind(this);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
registerOptions(opts) {
|
|
23
|
+
if (opts?.authorizeUser) {
|
|
24
|
+
this.authorizeUser = opts.authorizeUser.bind(this);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
MastraAuthProvider = /*@__PURE__*/(_ => {
|
|
29
|
+
_init = __decoratorStart(_a);
|
|
30
|
+
MastraAuthProvider = __decorateElement(_init, 0, "MastraAuthProvider", _MastraAuthProvider_decorators, MastraAuthProvider);
|
|
31
|
+
__runInitializers(_init, 1, MastraAuthProvider);
|
|
32
|
+
|
|
33
|
+
// src/server/index.ts
|
|
34
|
+
return MastraAuthProvider;
|
|
35
|
+
})();
|
|
36
|
+
// src/server/index.ts
|
|
37
|
+
function registerApiRoute(path, options) {
|
|
38
|
+
if (path.startsWith("/api/")) {
|
|
39
|
+
throw new MastraError({
|
|
40
|
+
id: "MASTRA_SERVER_API_PATH_RESERVED",
|
|
41
|
+
text: `Path must not start with "/api", it's reserved for internal API routes`,
|
|
42
|
+
domain: "MASTRA_SERVER" /* MASTRA_SERVER */,
|
|
43
|
+
category: "USER" /* USER */
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
path,
|
|
48
|
+
method: options.method,
|
|
49
|
+
handler: options.handler,
|
|
50
|
+
createHandler: options.createHandler,
|
|
51
|
+
openapi: options.openapi,
|
|
52
|
+
middleware: options.middleware
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function defineAuth(config) {
|
|
56
|
+
return config;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { MastraAuthProvider, defineAuth, registerApiRoute };
|