@mastra/core 0.0.0-storage-20250225005900
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/LICENSE +21 -0
- package/README.md +180 -0
- package/dist/agent/index.d.ts +15 -0
- package/dist/agent/index.js +1 -0
- package/dist/base-CHNzbTDj.d.ts +894 -0
- package/dist/base-eWkcLLSb.d.ts +139 -0
- package/dist/base.d.ts +6 -0
- package/dist/base.js +1 -0
- package/dist/bundler/index.d.ts +28 -0
- package/dist/bundler/index.js +1 -0
- package/dist/chunk-4IIE6KIC.js +10 -0
- package/dist/chunk-4ZNSY7J7.js +215 -0
- package/dist/chunk-4ZRHVG25.js +402 -0
- package/dist/chunk-5275WBGX.js +318 -0
- package/dist/chunk-6RDA4JYW.js +49 -0
- package/dist/chunk-BB4KXGBU.js +83 -0
- package/dist/chunk-C6A6W6XS.js +77 -0
- package/dist/chunk-FEBWYMJQ.js +416 -0
- package/dist/chunk-KP5SHTKA.js +145 -0
- package/dist/chunk-N7KZVQDK.js +61 -0
- package/dist/chunk-NDQR6IPC.js +37 -0
- package/dist/chunk-NUDAZEOG.js +35 -0
- package/dist/chunk-ORM3OCHX.js +1367 -0
- package/dist/chunk-PNZK456O.js +88 -0
- package/dist/chunk-QXPUH6PK.js +620 -0
- package/dist/chunk-RG66XEJT.js +8 -0
- package/dist/chunk-SIFBBGY6.js +190 -0
- package/dist/chunk-TCMOYQ74.js +1204 -0
- package/dist/chunk-WIBGG4X6.js +173 -0
- package/dist/chunk-YKDBP67T.js +346 -0
- package/dist/chunk-YUOADWSP.js +22 -0
- package/dist/chunk-Z735LDV7.js +10 -0
- package/dist/chunk-ZDWFBE5L.js +1 -0
- package/dist/chunk-ZINPRHAN.js +22 -0
- package/dist/deployer/index.d.ts +19 -0
- package/dist/deployer/index.js +1 -0
- package/dist/eval/index.d.ts +28 -0
- package/dist/eval/index.js +1 -0
- package/dist/filter/index.d.ts +90 -0
- package/dist/filter/index.js +1 -0
- package/dist/hooks/index.d.ts +33 -0
- package/dist/hooks/index.js +1 -0
- package/dist/index-C5uPdbs4.d.ts +90 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.js +119 -0
- package/dist/integration/index.d.ts +53 -0
- package/dist/integration/index.js +1 -0
- package/dist/llm/index.d.ts +15 -0
- package/dist/llm/index.js +1 -0
- package/dist/logger/index.d.ts +3 -0
- package/dist/logger/index.js +1 -0
- package/dist/mastra/index.d.ts +68 -0
- package/dist/mastra/index.js +1 -0
- package/dist/memory/index.d.ts +15 -0
- package/dist/memory/index.js +1 -0
- package/dist/relevance/index.d.ts +21 -0
- package/dist/relevance/index.js +1 -0
- package/dist/storage/index.d.ts +15 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/libsql/index.d.ts +81 -0
- package/dist/storage/libsql/index.js +1 -0
- package/dist/telemetry/index.d.ts +51 -0
- package/dist/telemetry/index.js +1 -0
- package/dist/telemetry/otel-vendor.d.ts +7 -0
- package/dist/telemetry/otel-vendor.js +7 -0
- package/dist/tools/index.d.ts +29 -0
- package/dist/tools/index.js +1 -0
- package/dist/tts/index.d.ts +28 -0
- package/dist/tts/index.js +1 -0
- package/dist/types-m9RryK9a.d.ts +14 -0
- package/dist/utils.d.ts +26 -0
- package/dist/utils.js +1 -0
- package/dist/vector/index.d.ts +29 -0
- package/dist/vector/index.js +1 -0
- package/dist/vector/libsql/index.d.ts +29 -0
- package/dist/vector/libsql/index.js +1 -0
- package/dist/voice/index.d.ts +67 -0
- package/dist/voice/index.js +76 -0
- package/dist/workflow-CddifUps.d.ts +92 -0
- package/dist/workflows/index.d.ts +31 -0
- package/dist/workflows/index.js +1 -0
- package/package.json +134 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
type BasicOperator = '$eq' | '$ne';
|
|
2
|
+
type NumericOperator = '$gt' | '$gte' | '$lt' | '$lte';
|
|
3
|
+
type LogicalOperator = '$and' | '$not' | '$nor' | '$or';
|
|
4
|
+
type ArrayOperator = '$all' | '$in' | '$nin' | '$elemMatch';
|
|
5
|
+
type ElementOperator = '$exists';
|
|
6
|
+
type RegexOperator = '$regex' | '$options';
|
|
7
|
+
type QueryOperator = BasicOperator | NumericOperator | LogicalOperator | ArrayOperator | ElementOperator | RegexOperator;
|
|
8
|
+
type OperatorCondition = {
|
|
9
|
+
[K in QueryOperator]?: any;
|
|
10
|
+
};
|
|
11
|
+
type FieldCondition = OperatorCondition | any;
|
|
12
|
+
type Filter = {
|
|
13
|
+
[field: string]: FieldCondition | Filter;
|
|
14
|
+
};
|
|
15
|
+
type OperatorSupport = {
|
|
16
|
+
logical?: LogicalOperator[];
|
|
17
|
+
array?: ArrayOperator[];
|
|
18
|
+
basic?: BasicOperator[];
|
|
19
|
+
numeric?: NumericOperator[];
|
|
20
|
+
element?: ElementOperator[];
|
|
21
|
+
regex?: RegexOperator[];
|
|
22
|
+
custom?: string[];
|
|
23
|
+
};
|
|
24
|
+
declare abstract class BaseFilterTranslator {
|
|
25
|
+
abstract translate(filter: Filter): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Operator type checks
|
|
28
|
+
*/
|
|
29
|
+
protected isOperator(key: string): key is QueryOperator;
|
|
30
|
+
protected static readonly BASIC_OPERATORS: BasicOperator[];
|
|
31
|
+
protected static readonly NUMERIC_OPERATORS: NumericOperator[];
|
|
32
|
+
protected static readonly ARRAY_OPERATORS: ArrayOperator[];
|
|
33
|
+
protected static readonly LOGICAL_OPERATORS: LogicalOperator[];
|
|
34
|
+
protected static readonly ELEMENT_OPERATORS: ElementOperator[];
|
|
35
|
+
protected static readonly REGEX_OPERATORS: RegexOperator[];
|
|
36
|
+
static readonly DEFAULT_OPERATORS: {
|
|
37
|
+
logical: LogicalOperator[];
|
|
38
|
+
basic: BasicOperator[];
|
|
39
|
+
numeric: NumericOperator[];
|
|
40
|
+
array: ArrayOperator[];
|
|
41
|
+
element: "$exists"[];
|
|
42
|
+
regex: RegexOperator[];
|
|
43
|
+
};
|
|
44
|
+
protected isLogicalOperator(key: string): key is LogicalOperator;
|
|
45
|
+
protected isBasicOperator(key: string): key is BasicOperator;
|
|
46
|
+
protected isNumericOperator(key: string): key is NumericOperator;
|
|
47
|
+
protected isArrayOperator(key: string): key is ArrayOperator;
|
|
48
|
+
protected isElementOperator(key: string): key is ElementOperator;
|
|
49
|
+
protected isRegexOperator(key: string): key is RegexOperator;
|
|
50
|
+
protected isFieldOperator(key: string): key is QueryOperator;
|
|
51
|
+
protected isCustomOperator(key: string): boolean;
|
|
52
|
+
protected getSupportedOperators(): OperatorSupport;
|
|
53
|
+
protected isValidOperator(key: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Value normalization for comparison operators
|
|
56
|
+
*/
|
|
57
|
+
protected normalizeComparisonValue(value: any): any;
|
|
58
|
+
/**
|
|
59
|
+
* Helper method to simulate $all operator using $and + $eq when needed.
|
|
60
|
+
* Some vector stores don't support $all natively.
|
|
61
|
+
*/
|
|
62
|
+
protected simulateAllOperator(field: string, values: any[]): Filter;
|
|
63
|
+
/**
|
|
64
|
+
* Utility functions for type checking
|
|
65
|
+
*/
|
|
66
|
+
protected isPrimitive(value: any): boolean;
|
|
67
|
+
protected isRegex(value: any): boolean;
|
|
68
|
+
protected isEmpty(obj: any): boolean;
|
|
69
|
+
protected static readonly ErrorMessages: {
|
|
70
|
+
readonly UNSUPPORTED_OPERATOR: (op: string) => string;
|
|
71
|
+
readonly INVALID_LOGICAL_OPERATOR_LOCATION: (op: string, path: string) => string;
|
|
72
|
+
readonly NOT_REQUIRES_OBJECT: "$not operator requires an object";
|
|
73
|
+
readonly NOT_CANNOT_BE_EMPTY: "$not operator cannot be empty";
|
|
74
|
+
readonly INVALID_LOGICAL_OPERATOR_CONTENT: (path: string) => string;
|
|
75
|
+
readonly INVALID_TOP_LEVEL_OPERATOR: (op: string) => string;
|
|
76
|
+
readonly ELEM_MATCH_REQUIRES_OBJECT: "$elemMatch requires an object with conditions";
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Helper to handle array value normalization consistently
|
|
80
|
+
*/
|
|
81
|
+
protected normalizeArrayValues(values: any[]): any[];
|
|
82
|
+
protected validateFilter(filter: Filter): void;
|
|
83
|
+
/**
|
|
84
|
+
* Validates if a filter structure is supported by the specific vector DB
|
|
85
|
+
* and returns detailed validation information.
|
|
86
|
+
*/
|
|
87
|
+
private validateFilterSupport;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { type ArrayOperator, BaseFilterTranslator, type BasicOperator, type ElementOperator, type FieldCondition, type Filter, type LogicalOperator, type NumericOperator, type OperatorCondition, type OperatorSupport, type QueryOperator, type RegexOperator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BaseFilterTranslator } from '../chunk-SIFBBGY6.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { M as MetricResult, T as TestInfo, a as Metric } from '../types-m9RryK9a.js';
|
|
2
|
+
|
|
3
|
+
type Handler<T = unknown> = (event: T) => void;
|
|
4
|
+
|
|
5
|
+
declare enum AvailableHooks {
|
|
6
|
+
ON_EVALUATION = "onEvaluation",
|
|
7
|
+
ON_GENERATION = "onGeneration"
|
|
8
|
+
}
|
|
9
|
+
type EvaluationHookData = {
|
|
10
|
+
input: string;
|
|
11
|
+
output: string;
|
|
12
|
+
result: MetricResult;
|
|
13
|
+
agentName: string;
|
|
14
|
+
metricName: string;
|
|
15
|
+
instructions: string;
|
|
16
|
+
runId: string;
|
|
17
|
+
globalRunId: string;
|
|
18
|
+
testInfo?: TestInfo;
|
|
19
|
+
};
|
|
20
|
+
type GenerationHookData = {
|
|
21
|
+
input: string;
|
|
22
|
+
output: string;
|
|
23
|
+
metric: Metric;
|
|
24
|
+
runId: string;
|
|
25
|
+
agentName: string;
|
|
26
|
+
instructions: string;
|
|
27
|
+
};
|
|
28
|
+
declare function registerHook(hook: AvailableHooks.ON_EVALUATION, action: Handler<EvaluationHookData>): void;
|
|
29
|
+
declare function registerHook(hook: AvailableHooks.ON_GENERATION, action: Handler<GenerationHookData>): void;
|
|
30
|
+
declare function executeHook(hook: AvailableHooks.ON_EVALUATION, action: EvaluationHookData): void;
|
|
31
|
+
declare function executeHook(hook: AvailableHooks.ON_GENERATION, action: GenerationHookData): void;
|
|
32
|
+
|
|
33
|
+
export { AvailableHooks, executeHook, registerHook };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AvailableHooks, executeHook, registerHook } from '../chunk-BB4KXGBU.js';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import pino from 'pino';
|
|
2
|
+
import { Transform } from 'stream';
|
|
3
|
+
|
|
4
|
+
type RunStatus = 'created' | 'running' | 'completed' | 'failed';
|
|
5
|
+
type Run = {
|
|
6
|
+
runId?: string;
|
|
7
|
+
runStatus?: RunStatus;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare const RegisteredLogger: {
|
|
11
|
+
readonly AGENT: "AGENT";
|
|
12
|
+
readonly WORKFLOW: "WORKFLOW";
|
|
13
|
+
readonly LLM: "LLM";
|
|
14
|
+
readonly TTS: "TTS";
|
|
15
|
+
readonly VOICE: "VOICE";
|
|
16
|
+
readonly VECTOR: "VECTOR";
|
|
17
|
+
readonly BUNDLER: "BUNDLER";
|
|
18
|
+
readonly DEPLOYER: "DEPLOYER";
|
|
19
|
+
readonly MEMORY: "MEMORY";
|
|
20
|
+
readonly STORAGE: "STORAGE";
|
|
21
|
+
readonly EMBEDDINGS: "EMBEDDINGS";
|
|
22
|
+
};
|
|
23
|
+
type RegisteredLogger = (typeof RegisteredLogger)[keyof typeof RegisteredLogger];
|
|
24
|
+
declare const LogLevel: {
|
|
25
|
+
readonly DEBUG: "debug";
|
|
26
|
+
readonly INFO: "info";
|
|
27
|
+
readonly WARN: "warn";
|
|
28
|
+
readonly ERROR: "error";
|
|
29
|
+
readonly NONE: "silent";
|
|
30
|
+
};
|
|
31
|
+
type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
32
|
+
interface BaseLogMessage extends Run {
|
|
33
|
+
msg: string;
|
|
34
|
+
level: number;
|
|
35
|
+
time: Date;
|
|
36
|
+
pid: number;
|
|
37
|
+
hostname: string;
|
|
38
|
+
name: string;
|
|
39
|
+
}
|
|
40
|
+
declare class LoggerTransport extends Transform {
|
|
41
|
+
constructor(opts?: any);
|
|
42
|
+
getLogsByRunId({ runId }: {
|
|
43
|
+
runId: string;
|
|
44
|
+
}): Promise<BaseLogMessage[]>;
|
|
45
|
+
getLogs(): Promise<BaseLogMessage[]>;
|
|
46
|
+
}
|
|
47
|
+
type TransportMap = Record<string, LoggerTransport>;
|
|
48
|
+
declare class Logger {
|
|
49
|
+
protected logger: pino.Logger;
|
|
50
|
+
transports: TransportMap;
|
|
51
|
+
constructor(options?: {
|
|
52
|
+
name?: string;
|
|
53
|
+
level?: LogLevel;
|
|
54
|
+
transports?: TransportMap;
|
|
55
|
+
overrideDefaultTransports?: boolean;
|
|
56
|
+
});
|
|
57
|
+
debug(message: string, args?: Record<string, any>): void;
|
|
58
|
+
info(message: string, args?: Record<string, any>): void;
|
|
59
|
+
warn(message: string, args?: Record<string, any>): void;
|
|
60
|
+
error(message: string, args?: Record<string, any>): void;
|
|
61
|
+
createStream(): Transform;
|
|
62
|
+
getLogs(transportId: string): Promise<BaseLogMessage[]>;
|
|
63
|
+
getLogsByRunId({ runId, transportId }: {
|
|
64
|
+
transportId: string;
|
|
65
|
+
runId: string;
|
|
66
|
+
}): Promise<BaseLogMessage[] | undefined>;
|
|
67
|
+
}
|
|
68
|
+
declare function createLogger(options: {
|
|
69
|
+
name?: string;
|
|
70
|
+
level?: LogLevel;
|
|
71
|
+
transports?: TransportMap;
|
|
72
|
+
}): Logger;
|
|
73
|
+
declare class MultiLogger {
|
|
74
|
+
private loggers;
|
|
75
|
+
constructor(loggers: Logger[]);
|
|
76
|
+
debug(message: string, ...args: any[]): void;
|
|
77
|
+
info(message: string, ...args: any[]): void;
|
|
78
|
+
warn(message: string, ...args: any[]): void;
|
|
79
|
+
error(message: string, ...args: any[]): void;
|
|
80
|
+
}
|
|
81
|
+
declare function combineLoggers(loggers: Logger[]): MultiLogger;
|
|
82
|
+
declare const noopLogger: {
|
|
83
|
+
debug: () => void;
|
|
84
|
+
info: () => void;
|
|
85
|
+
warn: () => void;
|
|
86
|
+
error: () => void;
|
|
87
|
+
cleanup: () => Promise<void>;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { type BaseLogMessage as B, Logger as L, MultiLogger as M, RegisteredLogger as R, type TransportMap as T, LogLevel as a, LoggerTransport as b, combineLoggers as c, type Run as d, createLogger as e, noopLogger as n };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { a as Metric } from './types-m9RryK9a.js';
|
|
2
|
+
export { M as MetricResult, T as TestInfo } from './types-m9RryK9a.js';
|
|
3
|
+
import { m as ToolAction, A as Agent$1, n as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, o as ToolExecutionContext, W as WorkflowOptions } from './base-CHNzbTDj.js';
|
|
4
|
+
export { Z as ActionContext, Y as BaseCondition, B as BaseStructuredOutputType, r as CoreAssistantMessage, C as CoreMessage, q as CoreSystemMessage, U as CoreTool, t as CoreToolMessage, s as CoreUserMessage, a6 as DependencyCheckOutput, v as EmbedManyResult, u as EmbedResult, E as EvalRow, ac as ExtractSchemaFromStep, af as ExtractSchemaType, ad as ExtractStepResult, G as GenerateReturn, J as LLMInnerStreamOptions, K as LLMStreamObjectOptions, D as LLMStreamOptions, H as LLMTextObjectOptions, F as LLMTextOptions, L as LanguageModel, P as MemoryConfig, N as MessageResponse, c as MessageType, O as OutputType, ag as PathsToStringProps, a3 as ResolverFunctionInput, a4 as ResolverFunctionOutput, R as RetryConfig, Q as SharedMemoryConfig, f as StepAction, $ as StepCondition, i as StepConfig, _ as StepDef, e as StepExecutionContext, l as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, j as StepResult, h as StepVariableType, S as StorageColumn, d as StorageGetMessagesArg, b as StorageThreadType, z as StreamReturn, y as StructuredOutput, x as StructuredOutputArrayItem, w as StructuredOutputType, a5 as SubscriberFunctionOutput, X as VariableReference, a8 as WorkflowActionParams, a9 as WorkflowActions, a7 as WorkflowActors, a0 as WorkflowContext, a2 as WorkflowEvent, a1 as WorkflowLogMessage, p as WorkflowRow, k as WorkflowRunState, aa as WorkflowState } from './base-CHNzbTDj.js';
|
|
5
|
+
import { M as MastraBase$1 } from './base-eWkcLLSb.js';
|
|
6
|
+
export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from './base-eWkcLLSb.js';
|
|
7
|
+
import { R as RegisteredLogger, a as LogLevel, T as TransportMap, L as Logger } from './index-C5uPdbs4.js';
|
|
8
|
+
export { B as BaseLogMessage, b as LoggerTransport, M as MultiLogger, c as combineLoggers, n as noopLogger } from './index-C5uPdbs4.js';
|
|
9
|
+
import { MastraDeployer as MastraDeployer$1 } from './deployer/index.js';
|
|
10
|
+
export { evaluate } from './eval/index.js';
|
|
11
|
+
import { Integration as Integration$1, OpenAPIToolset as OpenAPIToolset$1 } from './integration/index.js';
|
|
12
|
+
export { Config, Mastra } from './mastra/index.js';
|
|
13
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, RelevanceScoreProvider, createSimilarityPrompt } from './relevance/index.js';
|
|
14
|
+
export { InstrumentClass, OTLPStorageExporter, hasActiveTelemetry, withSpan } from './telemetry/index.js';
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
import { Tool as Tool$1 } from './tools/index.js';
|
|
17
|
+
export { createTool } from './tools/index.js';
|
|
18
|
+
import { MastraTTS as MastraTTS$1, TTSConfig } from './tts/index.js';
|
|
19
|
+
export { TagMaskOptions, deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './utils.js';
|
|
20
|
+
import { MastraVector as MastraVector$1 } from './vector/index.js';
|
|
21
|
+
export { IndexStats, QueryResult } from './vector/index.js';
|
|
22
|
+
import { S as Step, W as Workflow$1 } from './workflow-CddifUps.js';
|
|
23
|
+
export { c as createStep } from './workflow-CddifUps.js';
|
|
24
|
+
export { getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './workflows/index.js';
|
|
25
|
+
export { AvailableHooks, executeHook, registerHook } from './hooks/index.js';
|
|
26
|
+
export { ArrayOperator, BaseFilterTranslator, BasicOperator, ElementOperator, FieldCondition, Filter, LogicalOperator, NumericOperator, OperatorCondition, OperatorSupport, QueryOperator, RegexOperator } from './filter/index.js';
|
|
27
|
+
export { Message as AiMessageType } from 'ai';
|
|
28
|
+
import 'sift';
|
|
29
|
+
import 'json-schema';
|
|
30
|
+
import './voice/index.js';
|
|
31
|
+
import '@opentelemetry/api';
|
|
32
|
+
import '@opentelemetry/sdk-trace-base';
|
|
33
|
+
import 'pino';
|
|
34
|
+
import 'stream';
|
|
35
|
+
import './bundler/index.js';
|
|
36
|
+
import 'xstate';
|
|
37
|
+
import '@opentelemetry/core';
|
|
38
|
+
|
|
39
|
+
declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>> = Record<string, ToolAction<any, any, any, any>>, TMetrics extends Record<string, Metric> = Record<string, Metric>> extends Agent$1<TTools, TMetrics> {
|
|
40
|
+
constructor(config: AgentConfig<TTools, TMetrics>);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class MastraBase extends MastraBase$1 {
|
|
44
|
+
constructor(args: {
|
|
45
|
+
component?: RegisteredLogger;
|
|
46
|
+
name?: string;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare abstract class MastraDeployer extends MastraDeployer$1 {
|
|
51
|
+
constructor(args: {
|
|
52
|
+
name: string;
|
|
53
|
+
mastraDir: string;
|
|
54
|
+
outputDirectory: string;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare abstract class MastraStorage extends MastraStorage$1 {
|
|
59
|
+
constructor({ name }: {
|
|
60
|
+
name: string;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class Integration<ToolsParams = void, ApiClient = void> extends Integration$1<ToolsParams, ApiClient> {
|
|
65
|
+
constructor();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare abstract class OpenAPIToolset extends OpenAPIToolset$1 {
|
|
69
|
+
constructor();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare function createLogger(options: {
|
|
73
|
+
name?: string;
|
|
74
|
+
level?: LogLevel;
|
|
75
|
+
transports?: TransportMap;
|
|
76
|
+
}): Logger;
|
|
77
|
+
|
|
78
|
+
declare abstract class MastraMemory extends MastraMemory$1 {
|
|
79
|
+
constructor(_arg?: any);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare class Tool<TId extends string, TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined, TContext extends ToolExecutionContext<TSchemaIn> = ToolExecutionContext<TSchemaIn>> extends Tool$1<TId, TSchemaIn, TSchemaOut, TContext> {
|
|
83
|
+
constructor(opts: ToolAction<TId, TSchemaIn, TSchemaOut, TContext>);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare abstract class MastraTTS extends MastraTTS$1 {
|
|
87
|
+
constructor(args: TTSConfig);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare abstract class MastraVector extends MastraVector$1 {
|
|
91
|
+
constructor();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare class Workflow<TSteps extends Step<any, any, any>[] = any, TTriggerSchema extends z.ZodType<any> = any> extends Workflow$1<TSteps, TTriggerSchema> {
|
|
95
|
+
constructor(args: WorkflowOptions<TTriggerSchema>);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { Agent, Integration, LogLevel, Logger, MastraBase, MastraDeployer, MastraMemory, MastraStorage, MastraTTS, MastraVector, Metric, OpenAPIToolset, RegisteredLogger, Step, TTSConfig, Tool, ToolAction, ToolExecutionContext, TransportMap, Workflow, WorkflowOptions, createLogger };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { MastraTTS } from './chunk-NDQR6IPC.js';
|
|
2
|
+
import { Workflow } from './chunk-TCMOYQ74.js';
|
|
3
|
+
export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-TCMOYQ74.js';
|
|
4
|
+
import { Integration, OpenAPIToolset } from './chunk-PNZK456O.js';
|
|
5
|
+
import { Tool } from './chunk-ZINPRHAN.js';
|
|
6
|
+
export { createTool } from './chunk-ZINPRHAN.js';
|
|
7
|
+
export { Mastra } from './chunk-YKDBP67T.js';
|
|
8
|
+
import { MastraMemory } from './chunk-5275WBGX.js';
|
|
9
|
+
import { MastraVector } from './chunk-4IIE6KIC.js';
|
|
10
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-N7KZVQDK.js';
|
|
11
|
+
import { MastraStorage } from './chunk-4ZNSY7J7.js';
|
|
12
|
+
import { Agent } from './chunk-ORM3OCHX.js';
|
|
13
|
+
export { InstrumentClass, OTLPTraceExporter as OTLPStorageExporter, Telemetry, hasActiveTelemetry, withSpan } from './chunk-4ZRHVG25.js';
|
|
14
|
+
export { deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './chunk-WIBGG4X6.js';
|
|
15
|
+
import { MastraDeployer } from './chunk-Z735LDV7.js';
|
|
16
|
+
import { MastraBase } from './chunk-6RDA4JYW.js';
|
|
17
|
+
import { createLogger } from './chunk-KP5SHTKA.js';
|
|
18
|
+
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-KP5SHTKA.js';
|
|
19
|
+
export { Metric, evaluate } from './chunk-NUDAZEOG.js';
|
|
20
|
+
export { AvailableHooks, executeHook, registerHook } from './chunk-BB4KXGBU.js';
|
|
21
|
+
export { BaseFilterTranslator } from './chunk-SIFBBGY6.js';
|
|
22
|
+
|
|
23
|
+
// src/agent/index.warning.ts
|
|
24
|
+
var Agent2 = class extends Agent {
|
|
25
|
+
constructor(config) {
|
|
26
|
+
super(config);
|
|
27
|
+
this.logger.warn('Please import "Agent from "@mastra/core/agent" instead of "@mastra/core"');
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/base.warning.ts
|
|
32
|
+
var MastraBase2 = class extends MastraBase {
|
|
33
|
+
constructor(args) {
|
|
34
|
+
super(args);
|
|
35
|
+
this.logger.warn('Please import "MastraBase" from "@mastra/core/base" instead of "@mastra/core"');
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/deployer/index.warning.ts
|
|
40
|
+
var MastraDeployer2 = class extends MastraDeployer {
|
|
41
|
+
constructor(args) {
|
|
42
|
+
super(args);
|
|
43
|
+
this.logger.warn('Please import "MastraDeployer" from "@mastra/core/deployer" instead of "@mastra/core"');
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/storage/base.warning.ts
|
|
48
|
+
var MastraStorage2 = class extends MastraStorage {
|
|
49
|
+
constructor({ name }) {
|
|
50
|
+
super({
|
|
51
|
+
name
|
|
52
|
+
});
|
|
53
|
+
this.logger.warn('Please import "MastraStorage" from "@mastra/core/storage" instead of "@mastra/core"');
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/integration/integration.warning.ts
|
|
58
|
+
var Integration2 = class extends Integration {
|
|
59
|
+
constructor() {
|
|
60
|
+
super();
|
|
61
|
+
console.warn('Please import "Integration" from "@mastra/core/integration" instead of "@mastra/core"');
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/integration/openapi-toolset.warning.ts
|
|
66
|
+
var OpenAPIToolset2 = class extends OpenAPIToolset {
|
|
67
|
+
constructor() {
|
|
68
|
+
super();
|
|
69
|
+
console.warn('Please import "OpenAPIToolset" from "@mastra/core/integration" instead of "@mastra/core"');
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// src/logger/index.warning.ts
|
|
74
|
+
function createLogger2(options) {
|
|
75
|
+
console.warn('Please import "createLogger" from "@mastra/core/logger" instead of "@mastra/core"');
|
|
76
|
+
return createLogger(options);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/memory/index.warning.ts
|
|
80
|
+
var MastraMemory2 = class extends MastraMemory {
|
|
81
|
+
constructor(_arg) {
|
|
82
|
+
super({ name: `Deprecated memory` });
|
|
83
|
+
this.logger.warn('Please import "MastraMemory" from "@mastra/core/memory" instead of "@mastra/core"');
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// src/tools/index.warning.ts
|
|
88
|
+
var Tool2 = class extends Tool {
|
|
89
|
+
constructor(opts) {
|
|
90
|
+
super(opts);
|
|
91
|
+
console.warn('Please import "Tool" from "@mastra/core/tools" instead of "@mastra/core"');
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/tts/index.warning.ts
|
|
96
|
+
var MastraTTS2 = class extends MastraTTS {
|
|
97
|
+
constructor(args) {
|
|
98
|
+
super(args);
|
|
99
|
+
this.logger.warn('Please import "MastraTTS" from "@mastra/core/tts" instead of "@mastra/core"');
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// src/vector/index.warning.ts
|
|
104
|
+
var MastraVector2 = class extends MastraVector {
|
|
105
|
+
constructor() {
|
|
106
|
+
super();
|
|
107
|
+
this.logger.warn('Please import "MastraVector" from "@mastra/core/vector" instead of "@mastra/core"');
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// src/workflows/workflow.warning.ts
|
|
112
|
+
var Workflow2 = class extends Workflow {
|
|
113
|
+
constructor(args) {
|
|
114
|
+
super(args);
|
|
115
|
+
this.logger.warn('Please import "Workflow" from "@mastra/core/workflows" instead of "@mastra/core"');
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { Agent2 as Agent, Integration2 as Integration, MastraBase2 as MastraBase, MastraDeployer2 as MastraDeployer, MastraMemory2 as MastraMemory, MastraStorage2 as MastraStorage, MastraTTS2 as MastraTTS, MastraVector2 as MastraVector, OpenAPIToolset2 as OpenAPIToolset, Tool2 as Tool, Workflow2 as Workflow, createLogger2 as createLogger };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { W as Workflow } from '../workflow-CddifUps.js';
|
|
2
|
+
import '../base-eWkcLLSb.js';
|
|
3
|
+
import { m as ToolAction } from '../base-CHNzbTDj.js';
|
|
4
|
+
import 'xstate';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '@opentelemetry/api';
|
|
7
|
+
import '../index-C5uPdbs4.js';
|
|
8
|
+
import 'pino';
|
|
9
|
+
import 'stream';
|
|
10
|
+
import '@opentelemetry/sdk-trace-base';
|
|
11
|
+
import 'ai';
|
|
12
|
+
import '../types-m9RryK9a.js';
|
|
13
|
+
import 'sift';
|
|
14
|
+
import 'json-schema';
|
|
15
|
+
import '../vector/index.js';
|
|
16
|
+
import '../voice/index.js';
|
|
17
|
+
import '../tts/index.js';
|
|
18
|
+
|
|
19
|
+
declare class Integration<ToolsParams = void, ApiClient = void> {
|
|
20
|
+
name: string;
|
|
21
|
+
private workflows;
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Workflows
|
|
25
|
+
*/
|
|
26
|
+
registerWorkflow(name: string, fn: Workflow): void;
|
|
27
|
+
getWorkflows({ serialized }: {
|
|
28
|
+
serialized?: boolean;
|
|
29
|
+
}): Record<string, Workflow>;
|
|
30
|
+
/**
|
|
31
|
+
* TOOLS
|
|
32
|
+
*/
|
|
33
|
+
getStaticTools(_params?: ToolsParams): Record<string, ToolAction<any, any, any, any>>;
|
|
34
|
+
getTools(_params?: ToolsParams): Promise<Record<string, ToolAction<any, any, any, any>>>;
|
|
35
|
+
getApiClient(): Promise<ApiClient>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare abstract class OpenAPIToolset {
|
|
39
|
+
abstract readonly name: string;
|
|
40
|
+
abstract readonly tools: Record<string, ToolAction<any, any, any, any>>;
|
|
41
|
+
authType: string;
|
|
42
|
+
constructor();
|
|
43
|
+
protected get toolSchemas(): any;
|
|
44
|
+
protected get toolDocumentations(): Record<string, {
|
|
45
|
+
comment: string;
|
|
46
|
+
doc?: string;
|
|
47
|
+
}>;
|
|
48
|
+
protected get baseClient(): any;
|
|
49
|
+
getApiClient(): Promise<any>;
|
|
50
|
+
protected _generateIntegrationTools<T>(): T;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { Integration, OpenAPIToolset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Integration, OpenAPIToolset } from '../chunk-PNZK456O.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import 'ai';
|
|
2
|
+
import 'json-schema';
|
|
3
|
+
import 'zod';
|
|
4
|
+
export { B as BaseStructuredOutputType, r as CoreAssistantMessage, C as CoreMessage, q as CoreSystemMessage, t as CoreToolMessage, s as CoreUserMessage, v as EmbedManyResult, u as EmbedResult, G as GenerateReturn, J as LLMInnerStreamOptions, K as LLMStreamObjectOptions, D as LLMStreamOptions, H as LLMTextObjectOptions, F as LLMTextOptions, L as LanguageModel, O as OutputType, z as StreamReturn, y as StructuredOutput, x as StructuredOutputArrayItem, w as StructuredOutputType } from '../base-CHNzbTDj.js';
|
|
5
|
+
import '../index-C5uPdbs4.js';
|
|
6
|
+
import '../base-eWkcLLSb.js';
|
|
7
|
+
import '@opentelemetry/api';
|
|
8
|
+
import '@opentelemetry/sdk-trace-base';
|
|
9
|
+
import '../types-m9RryK9a.js';
|
|
10
|
+
import 'sift';
|
|
11
|
+
import '../vector/index.js';
|
|
12
|
+
import 'pino';
|
|
13
|
+
import 'stream';
|
|
14
|
+
import '../voice/index.js';
|
|
15
|
+
import '../tts/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, createLogger, noopLogger } from '../chunk-KP5SHTKA.js';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { A as Agent, M as MastraStorage, a as MastraMemory } from '../base-CHNzbTDj.js';
|
|
2
|
+
import { L as Logger, B as BaseLogMessage } from '../index-C5uPdbs4.js';
|
|
3
|
+
import { W as Workflow } from '../workflow-CddifUps.js';
|
|
4
|
+
import { MastraVector } from '../vector/index.js';
|
|
5
|
+
import { O as OtelConfig, T as Telemetry } from '../base-eWkcLLSb.js';
|
|
6
|
+
import { MastraTTS } from '../tts/index.js';
|
|
7
|
+
import { MastraDeployer } from '../deployer/index.js';
|
|
8
|
+
import 'ai';
|
|
9
|
+
import '../types-m9RryK9a.js';
|
|
10
|
+
import 'sift';
|
|
11
|
+
import 'zod';
|
|
12
|
+
import 'json-schema';
|
|
13
|
+
import '../voice/index.js';
|
|
14
|
+
import 'pino';
|
|
15
|
+
import 'stream';
|
|
16
|
+
import 'xstate';
|
|
17
|
+
import '@opentelemetry/api';
|
|
18
|
+
import '@opentelemetry/sdk-trace-base';
|
|
19
|
+
import '../bundler/index.js';
|
|
20
|
+
|
|
21
|
+
interface Config<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TWorkflows extends Record<string, Workflow> = Record<string, Workflow>, TVectors extends Record<string, MastraVector> = Record<string, MastraVector>, TTTS extends Record<string, MastraTTS> = Record<string, MastraTTS>, TLogger extends Logger = Logger> {
|
|
22
|
+
agents?: TAgents;
|
|
23
|
+
storage?: MastraStorage;
|
|
24
|
+
vectors?: TVectors;
|
|
25
|
+
logger?: TLogger | false;
|
|
26
|
+
workflows?: TWorkflows;
|
|
27
|
+
tts?: TTTS;
|
|
28
|
+
telemetry?: OtelConfig;
|
|
29
|
+
deployer?: MastraDeployer;
|
|
30
|
+
memory?: MastraMemory;
|
|
31
|
+
}
|
|
32
|
+
declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TWorkflows extends Record<string, Workflow> = Record<string, Workflow>, TVectors extends Record<string, MastraVector> = Record<string, MastraVector>, TTTS extends Record<string, MastraTTS> = Record<string, MastraTTS>, TLogger extends Logger = Logger> {
|
|
33
|
+
private vectors?;
|
|
34
|
+
private agents;
|
|
35
|
+
private logger;
|
|
36
|
+
private workflows;
|
|
37
|
+
private telemetry?;
|
|
38
|
+
private tts?;
|
|
39
|
+
private deployer?;
|
|
40
|
+
storage?: MastraStorage;
|
|
41
|
+
memory?: MastraMemory;
|
|
42
|
+
constructor(config?: Config<TAgents, TWorkflows, TVectors, TTTS, TLogger>);
|
|
43
|
+
getAgent<TAgentName extends keyof TAgents>(name: TAgentName): TAgents[TAgentName];
|
|
44
|
+
getAgents(): TAgents;
|
|
45
|
+
getVector<TVectorName extends keyof TVectors>(name: TVectorName): TVectors[TVectorName];
|
|
46
|
+
getVectors(): TVectors | undefined;
|
|
47
|
+
getDeployer(): MastraDeployer | undefined;
|
|
48
|
+
getWorkflow<TWorkflowId extends keyof TWorkflows>(id: TWorkflowId, { serialized }?: {
|
|
49
|
+
serialized?: boolean;
|
|
50
|
+
}): TWorkflows[TWorkflowId];
|
|
51
|
+
getWorkflows(props?: {
|
|
52
|
+
serialized?: boolean;
|
|
53
|
+
}): Record<string, Workflow>;
|
|
54
|
+
setStorage(storage: MastraStorage): void;
|
|
55
|
+
setLogger({ logger }: {
|
|
56
|
+
logger: TLogger;
|
|
57
|
+
}): void;
|
|
58
|
+
setTelemetry(telemetry: OtelConfig): void;
|
|
59
|
+
getLogger(): TLogger;
|
|
60
|
+
getTelemetry(): Telemetry | undefined;
|
|
61
|
+
getLogsByRunId({ runId, transportId }: {
|
|
62
|
+
runId: string;
|
|
63
|
+
transportId: string;
|
|
64
|
+
}): Promise<BaseLogMessage[] | undefined>;
|
|
65
|
+
getLogs(transportId: string): Promise<BaseLogMessage[]>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { type Config, Mastra };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Mastra } from '../chunk-YKDBP67T.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { a as MastraMemory, P as MemoryConfig, N as MessageResponse, c as MessageType, Q as SharedMemoryConfig, b as StorageThreadType } from '../base-CHNzbTDj.js';
|
|
2
|
+
export { Message as AiMessageType } from 'ai';
|
|
3
|
+
import '../base-eWkcLLSb.js';
|
|
4
|
+
import '@opentelemetry/api';
|
|
5
|
+
import '../index-C5uPdbs4.js';
|
|
6
|
+
import 'pino';
|
|
7
|
+
import 'stream';
|
|
8
|
+
import '@opentelemetry/sdk-trace-base';
|
|
9
|
+
import '../types-m9RryK9a.js';
|
|
10
|
+
import 'sift';
|
|
11
|
+
import 'zod';
|
|
12
|
+
import 'json-schema';
|
|
13
|
+
import '../vector/index.js';
|
|
14
|
+
import '../voice/index.js';
|
|
15
|
+
import '../tts/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MastraMemory } from '../chunk-5275WBGX.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LanguageModelV1 } from 'ai';
|
|
2
|
+
|
|
3
|
+
interface RelevanceScoreProvider {
|
|
4
|
+
getRelevanceScore(text1: string, text2: string): Promise<number>;
|
|
5
|
+
}
|
|
6
|
+
declare function createSimilarityPrompt(query: string, text: string): string;
|
|
7
|
+
|
|
8
|
+
declare class CohereRelevanceScorer implements RelevanceScoreProvider {
|
|
9
|
+
private client;
|
|
10
|
+
private model;
|
|
11
|
+
constructor(model: string, apiKey?: string);
|
|
12
|
+
getRelevanceScore(query: string, text: string): Promise<number>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare class MastraAgentRelevanceScorer implements RelevanceScoreProvider {
|
|
16
|
+
private agent;
|
|
17
|
+
constructor(name: string, model: LanguageModelV1);
|
|
18
|
+
getRelevanceScore(query: string, text: string): Promise<number>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, type RelevanceScoreProvider, createSimilarityPrompt };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-N7KZVQDK.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { E as EvalRow, M as MastraStorage, S as StorageColumn, d as StorageGetMessagesArg, ai as TABLE_EVALS, aj as TABLE_MESSAGES, T as TABLE_NAMES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, p as WorkflowRow } from '../base-CHNzbTDj.js';
|
|
2
|
+
import 'ai';
|
|
3
|
+
import '../base-eWkcLLSb.js';
|
|
4
|
+
import '@opentelemetry/api';
|
|
5
|
+
import '../index-C5uPdbs4.js';
|
|
6
|
+
import 'pino';
|
|
7
|
+
import 'stream';
|
|
8
|
+
import '@opentelemetry/sdk-trace-base';
|
|
9
|
+
import '../types-m9RryK9a.js';
|
|
10
|
+
import 'sift';
|
|
11
|
+
import 'zod';
|
|
12
|
+
import 'json-schema';
|
|
13
|
+
import '../vector/index.js';
|
|
14
|
+
import '../voice/index.js';
|
|
15
|
+
import '../tts/index.js';
|