@mastra/core 0.10.2-alpha.4 → 0.10.2-alpha.5
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/dist/agent/index.cjs +4 -4
- package/dist/agent/index.d.cts +3 -3
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +2 -2
- package/dist/{base-aPYtPBT2.d.cts → base-BY9WFI65.d.cts} +1 -1
- package/dist/{base-tc5kgDTD.d.ts → base-C0yUw8BC.d.ts} +1 -1
- package/dist/{base-CJfljebX.d.ts → base-Cgbao62E.d.ts} +32 -5
- package/dist/{base-D3nqrhQw.d.cts → base-CirJSyr2.d.cts} +32 -5
- package/dist/base.cjs +2 -2
- package/dist/base.d.cts +2 -2
- package/dist/base.d.ts +2 -2
- package/dist/base.js +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.d.cts +2 -2
- package/dist/bundler/index.d.ts +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-4YCQPROE.js → chunk-24D3CMWO.js} +4 -4
- package/dist/{chunk-EQTIDVPN.js → chunk-26WUL725.js} +1 -1
- package/dist/{chunk-WCGRF63O.js → chunk-2AFAKGJ4.js} +6 -6
- package/dist/{chunk-E4PVJAEL.cjs → chunk-3JGO7S6X.cjs} +2 -2
- package/dist/{chunk-3YEDPVNU.js → chunk-6NJLWXMZ.js} +1 -1
- package/dist/{chunk-MSJ24XNY.js → chunk-7MWWPVCE.js} +1 -1
- package/dist/{chunk-TMPFLJLG.cjs → chunk-CYJF6U6B.cjs} +2 -2
- package/dist/{chunk-JW5TMK2L.js → chunk-DTJ4KVHM.js} +1 -1
- package/dist/{chunk-ZJYHZO6Y.js → chunk-DXK4HYTL.js} +3 -3
- package/dist/{chunk-KSJGZAMN.js → chunk-FLPSXJWQ.js} +1 -1
- package/dist/{chunk-RMTG7VWR.js → chunk-GNJ7CAHY.js} +1 -1
- package/dist/{chunk-4ETGZJWF.cjs → chunk-HZ7ME4LD.cjs} +2 -2
- package/dist/{chunk-BCFBT6AN.cjs → chunk-II7UBNGM.cjs} +2 -2
- package/dist/{chunk-EZDS6FFZ.cjs → chunk-IJWOVA22.cjs} +23 -23
- package/dist/{chunk-FI7R232B.js → chunk-JOCKZ2US.js} +1 -1
- package/dist/{chunk-Q5L522HN.js → chunk-LKO4XMRH.js} +3 -3
- package/dist/{chunk-U47X2EYV.js → chunk-MWU2UKZI.js} +56 -41
- package/dist/{chunk-SE4RJNUA.cjs → chunk-P5XIIDTT.cjs} +10 -10
- package/dist/{chunk-OB2PB6SX.cjs → chunk-PBHXIWAK.cjs} +58 -43
- package/dist/{chunk-CWSFP2HS.cjs → chunk-PKYG5CWB.cjs} +2 -2
- package/dist/{chunk-LHRZV5VG.js → chunk-PMAVDBJY.js} +1 -1
- package/dist/{chunk-I5OLBJ26.cjs → chunk-PNPMKRS2.cjs} +9 -9
- package/dist/{chunk-SWW4EBUZ.cjs → chunk-RFAN7FAT.cjs} +1 -0
- package/dist/{chunk-PD6WZC42.cjs → chunk-SH2C4VTJ.cjs} +3 -3
- package/dist/{chunk-52MCT5OL.cjs → chunk-SMPHOXU3.cjs} +7 -7
- package/dist/{chunk-PIZM25KI.cjs → chunk-TAHSAZUN.cjs} +2 -2
- package/dist/{chunk-L5ADXH5Q.js → chunk-TIPFGQCO.js} +1 -1
- package/dist/{chunk-DXLVS7ML.cjs → chunk-TN3TNMXO.cjs} +3 -3
- package/dist/{chunk-YEULQPUY.cjs → chunk-VHZPWE5L.cjs} +6 -6
- package/dist/{chunk-U3XKEE2T.cjs → chunk-X6VHQCYN.cjs} +2 -2
- package/dist/{chunk-2NTUAUGH.js → chunk-XJCP3SLA.js} +1 -1
- package/dist/{chunk-VHLL4AZK.js → chunk-XXVGT7SJ.js} +1 -0
- package/dist/{chunk-RK6DHZUA.cjs → chunk-YZB2YQ63.cjs} +2 -2
- package/dist/{chunk-JU3LCRM2.js → chunk-ZPOETARN.js} +1 -1
- package/dist/deployer/index.cjs +2 -2
- package/dist/deployer/index.d.cts +2 -2
- package/dist/deployer/index.d.ts +2 -2
- package/dist/deployer/index.js +1 -1
- package/dist/eval/index.d.cts +3 -3
- package/dist/eval/index.d.ts +3 -3
- package/dist/index.cjs +51 -51
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +15 -15
- package/dist/integration/index.cjs +3 -3
- package/dist/integration/index.d.cts +3 -3
- package/dist/integration/index.d.ts +3 -3
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.d.cts +3 -3
- package/dist/llm/index.d.ts +3 -3
- package/dist/logger/index.cjs +6 -6
- package/dist/logger/index.d.cts +2 -2
- package/dist/logger/index.d.ts +2 -2
- package/dist/logger/index.js +1 -1
- package/dist/{logger-EhZkzZOr.d.cts → logger-BF2Sn7JX.d.cts} +1 -0
- package/dist/{logger-EhZkzZOr.d.ts → logger-BF2Sn7JX.d.ts} +1 -0
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.cts +3 -3
- package/dist/mastra/index.d.ts +3 -3
- package/dist/mastra/index.js +1 -1
- package/dist/mcp/index.cjs +4 -4
- package/dist/mcp/index.d.cts +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +2 -2
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.d.cts +3 -3
- package/dist/memory/index.d.ts +3 -3
- package/dist/memory/index.js +1 -1
- package/dist/network/index.cjs +8 -8
- package/dist/network/index.d.cts +3 -3
- package/dist/network/index.d.ts +3 -3
- package/dist/network/index.js +4 -4
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.d.cts +3 -3
- package/dist/relevance/index.d.ts +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.cjs +34 -0
- package/dist/server/index.d.cts +4 -4
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +35 -1
- package/dist/storage/index.cjs +5 -5
- package/dist/storage/index.d.cts +4 -4
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.js +3 -3
- package/dist/telemetry/index.d.cts +3 -3
- package/dist/telemetry/index.d.ts +3 -3
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.d.cts +3 -3
- package/dist/tools/index.d.ts +3 -3
- package/dist/tools/index.js +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.d.cts +2 -2
- package/dist/tts/index.d.ts +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/utils.cjs +15 -15
- package/dist/utils.d.cts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.d.cts +2 -2
- package/dist/vector/index.d.ts +2 -2
- package/dist/vector/index.js +1 -1
- package/dist/voice/index.cjs +4 -4
- package/dist/voice/index.d.cts +3 -3
- package/dist/voice/index.d.ts +3 -3
- package/dist/voice/index.js +1 -1
- package/dist/workflows/index.cjs +9 -9
- package/dist/workflows/index.d.cts +4 -4
- package/dist/workflows/index.d.ts +4 -4
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/legacy/index.cjs +22 -22
- package/dist/workflows/legacy/index.d.cts +4 -4
- package/dist/workflows/legacy/index.d.ts +4 -4
- package/dist/workflows/legacy/index.js +1 -1
- package/package.json +1 -1
package/dist/agent/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkIJWOVA22_cjs = require('../chunk-IJWOVA22.cjs');
|
|
4
|
+
var chunkPBHXIWAK_cjs = require('../chunk-PBHXIWAK.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 chunkIJWOVA22_cjs.Agent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "MessageList", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkPBHXIWAK_cjs.MessageList; }
|
|
15
15
|
});
|
package/dist/agent/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { Message as AiMessageType } from 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export {
|
|
5
|
-
import '../base-
|
|
4
|
+
export { u as Agent, ad as AgentConfig, bP as AgentGenerateOptions, bQ as AgentStreamOptions, bO as DynamicArgument, bj as MastraLanguageModel, bR as MastraMessageContentV2, g as MastraMessageV2, bM as MessageList, w as ToolsInput, bN as ToolsetsInput } from '../base-CirJSyr2.cjs';
|
|
5
|
+
import '../base-BY9WFI65.cjs';
|
|
6
6
|
import '../types-Bo1uigWx.cjs';
|
|
7
7
|
import '../runtime-context/index.cjs';
|
|
8
|
-
import '../logger-
|
|
8
|
+
import '../logger-BF2Sn7JX.cjs';
|
|
9
9
|
import 'stream';
|
|
10
10
|
import '../tts/index.cjs';
|
|
11
11
|
import '@opentelemetry/api';
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { Message as AiMessageType } from 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export {
|
|
5
|
-
import '../base-
|
|
4
|
+
export { u as Agent, ad as AgentConfig, bP as AgentGenerateOptions, bQ as AgentStreamOptions, bO as DynamicArgument, bj as MastraLanguageModel, bR as MastraMessageContentV2, g as MastraMessageV2, bM as MessageList, w as ToolsInput, bN as ToolsetsInput } from '../base-Cgbao62E.js';
|
|
5
|
+
import '../base-C0yUw8BC.js';
|
|
6
6
|
import '../types-Bo1uigWx.js';
|
|
7
7
|
import '../runtime-context/index.js';
|
|
8
|
-
import '../logger-
|
|
8
|
+
import '../logger-BF2Sn7JX.js';
|
|
9
9
|
import 'stream';
|
|
10
10
|
import '../tts/index.js';
|
|
11
11
|
import '@opentelemetry/api';
|
package/dist/agent/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Agent } from '../chunk-
|
|
2
|
-
export { MessageList } from '../chunk-
|
|
1
|
+
export { Agent } from '../chunk-2AFAKGJ4.js';
|
|
2
|
+
export { MessageList } from '../chunk-MWU2UKZI.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
2
|
import { Tracer, Span, BaggageEntry, Context } from '@opentelemetry/api';
|
|
3
|
-
import { R as RegisteredLogger, I as IMastraLogger } from './logger-
|
|
3
|
+
import { R as RegisteredLogger, I as IMastraLogger } from './logger-BF2Sn7JX.cjs';
|
|
4
4
|
import { SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
|
|
6
6
|
/** Sampling strategy configuration for OpenTelemetry */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
2
|
import { Tracer, Span, BaggageEntry, Context } from '@opentelemetry/api';
|
|
3
|
-
import { R as RegisteredLogger, I as IMastraLogger } from './logger-
|
|
3
|
+
import { R as RegisteredLogger, I as IMastraLogger } from './logger-BF2Sn7JX.js';
|
|
4
4
|
import { SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
|
|
6
6
|
/** Sampling strategy configuration for OpenTelemetry */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
2
|
import { Tool as Tool$1, Schema, ToolExecutionOptions, UserContent, AssistantContent, ToolContent, EmbeddingModel, CoreMessage as CoreMessage$1, UIMessage, IDGenerator as IDGenerator$1, Message, CoreSystemMessage as CoreSystemMessage$1, LanguageModel as LanguageModel$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, LanguageModelV1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback } from 'ai';
|
|
3
|
-
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-
|
|
3
|
+
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-C0yUw8BC.js';
|
|
4
4
|
import { z, ZodSchema } from 'zod';
|
|
5
5
|
import { JSONSchema7Type, JSONSchema7 } from 'json-schema';
|
|
6
|
-
import { B as BaseLogMessage, R as RegisteredLogger, I as IMastraLogger } from './logger-
|
|
6
|
+
import { B as BaseLogMessage, R as RegisteredLogger, I as IMastraLogger } from './logger-BF2Sn7JX.js';
|
|
7
7
|
import { MastraTTS } from './tts/index.js';
|
|
8
8
|
import { MastraVector } from './vector/index.js';
|
|
9
9
|
import { M as Metric, a as MetricResult, T as TestInfo } from './types-Bo1uigWx.js';
|
|
@@ -14,7 +14,7 @@ import * as xstate from 'xstate';
|
|
|
14
14
|
import { Snapshot } from 'xstate';
|
|
15
15
|
import EventEmitter from 'node:events';
|
|
16
16
|
import * as http from 'node:http';
|
|
17
|
-
import { Context, Handler, MiddlewareHandler
|
|
17
|
+
import { Context, HonoRequest, Handler, MiddlewareHandler } from 'hono';
|
|
18
18
|
import EventEmitter$1 from 'events';
|
|
19
19
|
import { EMITTER_SYMBOL } from './workflows/constants.js';
|
|
20
20
|
import { MockLanguageModelV1 } from 'ai/test';
|
|
@@ -2861,6 +2861,29 @@ declare abstract class MCPServerBase extends MastraBase {
|
|
|
2861
2861
|
}): Promise<any>;
|
|
2862
2862
|
}
|
|
2863
2863
|
|
|
2864
|
+
interface MastraAuthProviderOptions<TUser = unknown> {
|
|
2865
|
+
name?: string;
|
|
2866
|
+
authorizeUser?: (user: TUser, request: HonoRequest) => Promise<boolean> | boolean;
|
|
2867
|
+
}
|
|
2868
|
+
declare abstract class MastraAuthProvider<TUser = unknown> extends MastraBase {
|
|
2869
|
+
constructor(options?: MastraAuthProviderOptions<TUser>);
|
|
2870
|
+
/**
|
|
2871
|
+
* Authenticate a token and return the payload
|
|
2872
|
+
* @param token - The token to authenticate
|
|
2873
|
+
* @param request - The request
|
|
2874
|
+
* @returns The payload
|
|
2875
|
+
*/
|
|
2876
|
+
abstract authenticateToken(token: string, request: HonoRequest): Promise<TUser | null>;
|
|
2877
|
+
/**
|
|
2878
|
+
* Authorize a user for a path and method
|
|
2879
|
+
* @param user - The user to authorize
|
|
2880
|
+
* @param request - The request
|
|
2881
|
+
* @returns The authorization result
|
|
2882
|
+
*/
|
|
2883
|
+
abstract authorizeUser(user: TUser, request: HonoRequest): Promise<boolean> | boolean;
|
|
2884
|
+
protected registerOptions(opts?: MastraAuthProviderOptions<TUser>): void;
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2864
2887
|
type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'ALL';
|
|
2865
2888
|
type ApiRoute = {
|
|
2866
2889
|
path: string;
|
|
@@ -2888,6 +2911,10 @@ type ContextWithMastra = Context<{
|
|
|
2888
2911
|
};
|
|
2889
2912
|
}>;
|
|
2890
2913
|
type MastraAuthConfig<TUser = unknown> = {
|
|
2914
|
+
/**
|
|
2915
|
+
* Protected paths for the server
|
|
2916
|
+
*/
|
|
2917
|
+
protected?: (RegExp | string | [string, Methods | Methods[]])[];
|
|
2891
2918
|
/**
|
|
2892
2919
|
* Public paths for the server
|
|
2893
2920
|
*/
|
|
@@ -2978,7 +3005,7 @@ type ServerConfig = {
|
|
|
2978
3005
|
/**
|
|
2979
3006
|
* Authentication configuration for the server
|
|
2980
3007
|
*/
|
|
2981
|
-
experimental_auth?: MastraAuthConfig<any>;
|
|
3008
|
+
experimental_auth?: MastraAuthConfig<any> | MastraAuthProvider<any>;
|
|
2982
3009
|
};
|
|
2983
3010
|
|
|
2984
3011
|
interface Config<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TLegacyWorkflows extends Record<string, LegacyWorkflow> = Record<string, LegacyWorkflow>, 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 IMastraLogger = IMastraLogger, TNetworks extends Record<string, AgentNetwork> = Record<string, AgentNetwork>, TMCPServers extends Record<string, MCPServerBase> = Record<string, MCPServerBase>> {
|
|
@@ -3402,4 +3429,4 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
3402
3429
|
}): Promise<WorkflowRun | null>;
|
|
3403
3430
|
}
|
|
3404
3431
|
|
|
3405
|
-
export { type
|
|
3432
|
+
export { type StepResolverOutput as $, type ApiRoute as A, type StepExecutionContext as B, type ContextWithMastra as C, type StepVariableType as D, type EvalRow as E, type StepNode as F, type StepGraph as G, type BaseCondition as H, type ActionContext as I, WhenConditionReturnValue as J, type StepDef as K, type LegacyWorkflowRuns as L, type Methods as M, type StepCondition as N, type StepConfig as O, type StepsRecord$1 as P, type WorkflowLogMessage as Q, type RetryConfig as R, type StorageColumn as S, type TABLE_NAMES as T, type WorkflowEvent as U, type VariableReference$1 as V, type WorkflowRuns as W, type ResolverFunctionInput as X, type ResolverFunctionOutput as Y, type SubscriberFunctionOutput as Z, type DependencyCheckOutput as _, Mastra as a, cloneWorkflow as a$, type WorkflowActors as a0, type WorkflowActionParams as a1, type WorkflowActions as a2, type LegacyWorkflowState as a3, type StepId as a4, type ExtractSchemaFromStep$1 as a5, type ExtractStepResult as a6, type StepInputType as a7, type ExtractSchemaType$1 as a8, type PathsToStringProps$1 as a9, type DefaultLLMTextObjectOptions as aA, type DefaultLLMStreamOptions as aB, type DefaultLLMStreamObjectOptions as aC, type LLMTextOptions as aD, type LLMTextObjectOptions as aE, type LLMStreamOptions as aF, type LLMInnerStreamOptions as aG, type LLMStreamObjectOptions as aH, createMockModel as aI, type Config as aJ, type MessageType as aK, type MessageResponse as aL, type MemoryConfig as aM, type SharedMemoryConfig as aN, type MemoryProcessorOpts as aO, MemoryProcessor as aP, memoryDefaultOptions as aQ, createTool as aR, type VercelTool as aS, type CoreTool as aT, type InternalCoreTool as aU, type StepFlowEntry as aV, type SerializedStep as aW, type SerializedStepFlowEntry as aX, createStep as aY, cloneStep as aZ, createWorkflow as a_, type LegacyWorkflowRunState as aa, type WorkflowResumeResult as ab, type ToolAction as ac, type AgentConfig as ad, MastraMemory as ae, type ToolExecutionContext as af, Tool as ag, type Step as ah, Workflow as ai, type WorkflowConfig as aj, type LanguageModel as ak, type CoreMessage as al, type CoreSystemMessage as am, type CoreAssistantMessage as an, type CoreUserMessage as ao, type CoreToolMessage as ap, type EmbedResult as aq, type EmbedManyResult as ar, type BaseStructuredOutputType as as, type StructuredOutputType as at, type StructuredOutputArrayItem as au, type StructuredOutput as av, type GenerateReturn as aw, type StreamReturn as ax, type OutputType as ay, type DefaultLLMTextOptions as az, type MastraAuthConfig as b, type WorkflowResult as b0, Run as b1, type ExecutionGraph as b2, ExecutionEngine as b3, type ExecuteFunction as b4, type StepSuccess as b5, type StepFailure as b6, type StepSuspended as b7, type StepRunning as b8, type StepResult as b9, type ArgumentInfo as bA, type PositionalArgumentInfo as bB, type NamedArgumentInfo as bC, type SubcommandInfo as bD, type CommandInfo as bE, type EnvironmentVariableInfo as bF, type PackageInfo as bG, type RemoteInfo as bH, type MCPServerConfig as bI, type ServerInfo as bJ, type ServerDetailInfo as bK, type MCPToolType as bL, MessageList as bM, type ToolsetsInput as bN, type DynamicArgument as bO, type AgentGenerateOptions as bP, type AgentStreamOptions as bQ, type MastraMessageContentV2 as bR, type StepsRecord as ba, type DynamicMapping as bb, type PathsToStringProps as bc, type ExtractSchemaType as bd, type ExtractSchemaFromStep as be, type VariableReference as bf, type WatchEvent as bg, type ZodPathType as bh, type WorkflowRunState as bi, type MastraLanguageModel as bj, type MastraPrimitives as bk, AgentNetwork as bl, MCPServerBase as bm, type VoiceEventType as bn, type VoiceEventMap as bo, type VoiceConfig as bp, MastraVoice as bq, CompositeVoice as br, DefaultVoice as bs, type AgentNetworkConfig as bt, type ConvertedTool as bu, type MCPServerSSEOptions as bv, type MCPServerHonoSSEOptions as bw, type MCPServerHTTPOptions as bx, type Repository as by, type VersionDetail as bz, MastraAuthProvider as c, type MastraAuthProviderOptions as d, MastraStorage as e, type StorageThreadType as f, type MastraMessageV2 as g, type StorageGetMessagesArg as h, type MastraMessageV1 as i, type WorkflowRun as j, type LegacyWorkflowRun as k, TABLE_WORKFLOW_SNAPSHOT as l, TABLE_EVALS as m, TABLE_MESSAGES as n, TABLE_THREADS as o, TABLE_TRACES as p, TABLE_SCHEMAS as q, type StepResult$1 as r, LegacyStep as s, LegacyWorkflow as t, Agent as u, type WorkflowContext as v, type ToolsInput as w, type StepAction as x, type LegacyWorkflowRunResult as y, type WorkflowOptions as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
2
|
import { Tool as Tool$1, Schema, ToolExecutionOptions, UserContent, AssistantContent, ToolContent, EmbeddingModel, CoreMessage as CoreMessage$1, UIMessage, IDGenerator as IDGenerator$1, Message, CoreSystemMessage as CoreSystemMessage$1, LanguageModel as LanguageModel$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, LanguageModelV1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback } from 'ai';
|
|
3
|
-
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-
|
|
3
|
+
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-BY9WFI65.cjs';
|
|
4
4
|
import { z, ZodSchema } from 'zod';
|
|
5
5
|
import { JSONSchema7Type, JSONSchema7 } from 'json-schema';
|
|
6
|
-
import { B as BaseLogMessage, R as RegisteredLogger, I as IMastraLogger } from './logger-
|
|
6
|
+
import { B as BaseLogMessage, R as RegisteredLogger, I as IMastraLogger } from './logger-BF2Sn7JX.cjs';
|
|
7
7
|
import { MastraTTS } from './tts/index.cjs';
|
|
8
8
|
import { MastraVector } from './vector/index.cjs';
|
|
9
9
|
import { M as Metric, a as MetricResult, T as TestInfo } from './types-Bo1uigWx.cjs';
|
|
@@ -14,7 +14,7 @@ import * as xstate from 'xstate';
|
|
|
14
14
|
import { Snapshot } from 'xstate';
|
|
15
15
|
import EventEmitter from 'node:events';
|
|
16
16
|
import * as http from 'node:http';
|
|
17
|
-
import { Context, Handler, MiddlewareHandler
|
|
17
|
+
import { Context, HonoRequest, Handler, MiddlewareHandler } from 'hono';
|
|
18
18
|
import EventEmitter$1 from 'events';
|
|
19
19
|
import { EMITTER_SYMBOL } from './workflows/constants.cjs';
|
|
20
20
|
import { MockLanguageModelV1 } from 'ai/test';
|
|
@@ -2861,6 +2861,29 @@ declare abstract class MCPServerBase extends MastraBase {
|
|
|
2861
2861
|
}): Promise<any>;
|
|
2862
2862
|
}
|
|
2863
2863
|
|
|
2864
|
+
interface MastraAuthProviderOptions<TUser = unknown> {
|
|
2865
|
+
name?: string;
|
|
2866
|
+
authorizeUser?: (user: TUser, request: HonoRequest) => Promise<boolean> | boolean;
|
|
2867
|
+
}
|
|
2868
|
+
declare abstract class MastraAuthProvider<TUser = unknown> extends MastraBase {
|
|
2869
|
+
constructor(options?: MastraAuthProviderOptions<TUser>);
|
|
2870
|
+
/**
|
|
2871
|
+
* Authenticate a token and return the payload
|
|
2872
|
+
* @param token - The token to authenticate
|
|
2873
|
+
* @param request - The request
|
|
2874
|
+
* @returns The payload
|
|
2875
|
+
*/
|
|
2876
|
+
abstract authenticateToken(token: string, request: HonoRequest): Promise<TUser | null>;
|
|
2877
|
+
/**
|
|
2878
|
+
* Authorize a user for a path and method
|
|
2879
|
+
* @param user - The user to authorize
|
|
2880
|
+
* @param request - The request
|
|
2881
|
+
* @returns The authorization result
|
|
2882
|
+
*/
|
|
2883
|
+
abstract authorizeUser(user: TUser, request: HonoRequest): Promise<boolean> | boolean;
|
|
2884
|
+
protected registerOptions(opts?: MastraAuthProviderOptions<TUser>): void;
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2864
2887
|
type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'ALL';
|
|
2865
2888
|
type ApiRoute = {
|
|
2866
2889
|
path: string;
|
|
@@ -2888,6 +2911,10 @@ type ContextWithMastra = Context<{
|
|
|
2888
2911
|
};
|
|
2889
2912
|
}>;
|
|
2890
2913
|
type MastraAuthConfig<TUser = unknown> = {
|
|
2914
|
+
/**
|
|
2915
|
+
* Protected paths for the server
|
|
2916
|
+
*/
|
|
2917
|
+
protected?: (RegExp | string | [string, Methods | Methods[]])[];
|
|
2891
2918
|
/**
|
|
2892
2919
|
* Public paths for the server
|
|
2893
2920
|
*/
|
|
@@ -2978,7 +3005,7 @@ type ServerConfig = {
|
|
|
2978
3005
|
/**
|
|
2979
3006
|
* Authentication configuration for the server
|
|
2980
3007
|
*/
|
|
2981
|
-
experimental_auth?: MastraAuthConfig<any>;
|
|
3008
|
+
experimental_auth?: MastraAuthConfig<any> | MastraAuthProvider<any>;
|
|
2982
3009
|
};
|
|
2983
3010
|
|
|
2984
3011
|
interface Config<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TLegacyWorkflows extends Record<string, LegacyWorkflow> = Record<string, LegacyWorkflow>, 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 IMastraLogger = IMastraLogger, TNetworks extends Record<string, AgentNetwork> = Record<string, AgentNetwork>, TMCPServers extends Record<string, MCPServerBase> = Record<string, MCPServerBase>> {
|
|
@@ -3402,4 +3429,4 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
3402
3429
|
}): Promise<WorkflowRun | null>;
|
|
3403
3430
|
}
|
|
3404
3431
|
|
|
3405
|
-
export { type
|
|
3432
|
+
export { type StepResolverOutput as $, type ApiRoute as A, type StepExecutionContext as B, type ContextWithMastra as C, type StepVariableType as D, type EvalRow as E, type StepNode as F, type StepGraph as G, type BaseCondition as H, type ActionContext as I, WhenConditionReturnValue as J, type StepDef as K, type LegacyWorkflowRuns as L, type Methods as M, type StepCondition as N, type StepConfig as O, type StepsRecord$1 as P, type WorkflowLogMessage as Q, type RetryConfig as R, type StorageColumn as S, type TABLE_NAMES as T, type WorkflowEvent as U, type VariableReference$1 as V, type WorkflowRuns as W, type ResolverFunctionInput as X, type ResolverFunctionOutput as Y, type SubscriberFunctionOutput as Z, type DependencyCheckOutput as _, Mastra as a, cloneWorkflow as a$, type WorkflowActors as a0, type WorkflowActionParams as a1, type WorkflowActions as a2, type LegacyWorkflowState as a3, type StepId as a4, type ExtractSchemaFromStep$1 as a5, type ExtractStepResult as a6, type StepInputType as a7, type ExtractSchemaType$1 as a8, type PathsToStringProps$1 as a9, type DefaultLLMTextObjectOptions as aA, type DefaultLLMStreamOptions as aB, type DefaultLLMStreamObjectOptions as aC, type LLMTextOptions as aD, type LLMTextObjectOptions as aE, type LLMStreamOptions as aF, type LLMInnerStreamOptions as aG, type LLMStreamObjectOptions as aH, createMockModel as aI, type Config as aJ, type MessageType as aK, type MessageResponse as aL, type MemoryConfig as aM, type SharedMemoryConfig as aN, type MemoryProcessorOpts as aO, MemoryProcessor as aP, memoryDefaultOptions as aQ, createTool as aR, type VercelTool as aS, type CoreTool as aT, type InternalCoreTool as aU, type StepFlowEntry as aV, type SerializedStep as aW, type SerializedStepFlowEntry as aX, createStep as aY, cloneStep as aZ, createWorkflow as a_, type LegacyWorkflowRunState as aa, type WorkflowResumeResult as ab, type ToolAction as ac, type AgentConfig as ad, MastraMemory as ae, type ToolExecutionContext as af, Tool as ag, type Step as ah, Workflow as ai, type WorkflowConfig as aj, type LanguageModel as ak, type CoreMessage as al, type CoreSystemMessage as am, type CoreAssistantMessage as an, type CoreUserMessage as ao, type CoreToolMessage as ap, type EmbedResult as aq, type EmbedManyResult as ar, type BaseStructuredOutputType as as, type StructuredOutputType as at, type StructuredOutputArrayItem as au, type StructuredOutput as av, type GenerateReturn as aw, type StreamReturn as ax, type OutputType as ay, type DefaultLLMTextOptions as az, type MastraAuthConfig as b, type WorkflowResult as b0, Run as b1, type ExecutionGraph as b2, ExecutionEngine as b3, type ExecuteFunction as b4, type StepSuccess as b5, type StepFailure as b6, type StepSuspended as b7, type StepRunning as b8, type StepResult as b9, type ArgumentInfo as bA, type PositionalArgumentInfo as bB, type NamedArgumentInfo as bC, type SubcommandInfo as bD, type CommandInfo as bE, type EnvironmentVariableInfo as bF, type PackageInfo as bG, type RemoteInfo as bH, type MCPServerConfig as bI, type ServerInfo as bJ, type ServerDetailInfo as bK, type MCPToolType as bL, MessageList as bM, type ToolsetsInput as bN, type DynamicArgument as bO, type AgentGenerateOptions as bP, type AgentStreamOptions as bQ, type MastraMessageContentV2 as bR, type StepsRecord as ba, type DynamicMapping as bb, type PathsToStringProps as bc, type ExtractSchemaType as bd, type ExtractSchemaFromStep as be, type VariableReference as bf, type WatchEvent as bg, type ZodPathType as bh, type WorkflowRunState as bi, type MastraLanguageModel as bj, type MastraPrimitives as bk, AgentNetwork as bl, MCPServerBase as bm, type VoiceEventType as bn, type VoiceEventMap as bo, type VoiceConfig as bp, MastraVoice as bq, CompositeVoice as br, DefaultVoice as bs, type AgentNetworkConfig as bt, type ConvertedTool as bu, type MCPServerSSEOptions as bv, type MCPServerHonoSSEOptions as bw, type MCPServerHTTPOptions as bx, type Repository as by, type VersionDetail as bz, MastraAuthProvider as c, type MastraAuthProviderOptions as d, MastraStorage as e, type StorageThreadType as f, type MastraMessageV2 as g, type StorageGetMessagesArg as h, type MastraMessageV1 as i, type WorkflowRun as j, type LegacyWorkflowRun as k, TABLE_WORKFLOW_SNAPSHOT as l, TABLE_EVALS as m, TABLE_MESSAGES as n, TABLE_THREADS as o, TABLE_TRACES as p, TABLE_SCHEMAS as q, type StepResult$1 as r, LegacyStep as s, LegacyWorkflow as t, Agent as u, type WorkflowContext as v, type ToolsInput as w, type StepAction as x, type LegacyWorkflowRunResult as y, type WorkflowOptions as z };
|
package/dist/base.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVHZPWE5L_cjs = require('./chunk-VHZPWE5L.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 chunkVHZPWE5L_cjs.MastraBase; }
|
|
10
10
|
});
|
package/dist/base.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@opentelemetry/api';
|
|
2
|
-
import './logger-
|
|
3
|
-
export { M as MastraBase } from './base-
|
|
2
|
+
import './logger-BF2Sn7JX.cjs';
|
|
3
|
+
export { M as MastraBase } from './base-BY9WFI65.cjs';
|
|
4
4
|
import 'stream';
|
|
5
5
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/base.d.ts
CHANGED
package/dist/base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraBase } from './chunk-
|
|
1
|
+
export { MastraBase } from './chunk-JOCKZ2US.js';
|
package/dist/bundler/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCYJF6U6B_cjs = require('../chunk-CYJF6U6B.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 chunkCYJF6U6B_cjs.MastraBundler; }
|
|
10
10
|
});
|
package/dist/bundler/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MastraBase } from '../base-
|
|
1
|
+
import { M as MastraBase } from '../base-BY9WFI65.cjs';
|
|
2
2
|
import '@opentelemetry/api';
|
|
3
|
-
import '../logger-
|
|
3
|
+
import '../logger-BF2Sn7JX.cjs';
|
|
4
4
|
import 'stream';
|
|
5
5
|
import '@opentelemetry/sdk-trace-base';
|
|
6
6
|
|
package/dist/bundler/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MastraBase } from '../base-
|
|
1
|
+
import { M as MastraBase } from '../base-C0yUw8BC.js';
|
|
2
2
|
import '@opentelemetry/api';
|
|
3
|
-
import '../logger-
|
|
3
|
+
import '../logger-BF2Sn7JX.js';
|
|
4
4
|
import 'stream';
|
|
5
5
|
import '@opentelemetry/sdk-trace-base';
|
|
6
6
|
|
package/dist/bundler/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraBundler } from '../chunk-
|
|
1
|
+
export { MastraBundler } from '../chunk-DTJ4KVHM.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EMITTER_SYMBOL } from './chunk-Y7D2JLKS.js';
|
|
2
|
-
import { Agent } from './chunk-
|
|
3
|
-
import { Tool } from './chunk-
|
|
4
|
-
import { MastraBase } from './chunk-
|
|
5
|
-
import { RegisteredLogger } from './chunk-
|
|
2
|
+
import { Agent } from './chunk-2AFAKGJ4.js';
|
|
3
|
+
import { Tool } from './chunk-26WUL725.js';
|
|
4
|
+
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
5
|
+
import { RegisteredLogger } from './chunk-XXVGT7SJ.js';
|
|
6
6
|
import { RuntimeContext } from './chunk-SGGPJWRQ.js';
|
|
7
7
|
import { randomUUID } from 'crypto';
|
|
8
8
|
import EventEmitter from 'events';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DefaultVoice } from './chunk-
|
|
1
|
+
import { DefaultVoice } from './chunk-FLPSXJWQ.js';
|
|
2
2
|
import { executeHook } from './chunk-BB4KXGBU.js';
|
|
3
|
-
import { MastraLLM } from './chunk-
|
|
3
|
+
import { MastraLLM } from './chunk-DXK4HYTL.js';
|
|
4
4
|
import { InstrumentClass } from './chunk-EWDGXKOQ.js';
|
|
5
|
-
import { MessageList } from './chunk-
|
|
6
|
-
import { ensureToolProperties, makeCoreTool, createMastraProxy } from './chunk-
|
|
7
|
-
import { MastraBase } from './chunk-
|
|
8
|
-
import { RegisteredLogger } from './chunk-
|
|
5
|
+
import { MessageList } from './chunk-MWU2UKZI.js';
|
|
6
|
+
import { ensureToolProperties, makeCoreTool, createMastraProxy } from './chunk-26WUL725.js';
|
|
7
|
+
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
8
|
+
import { RegisteredLogger } from './chunk-XXVGT7SJ.js';
|
|
9
9
|
import { RuntimeContext } from './chunk-SGGPJWRQ.js';
|
|
10
10
|
import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
|
|
11
11
|
import { context, trace } from '@opentelemetry/api';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkTICDQWVJ_cjs = require('./chunk-TICDQWVJ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkVHZPWE5L_cjs = require('./chunk-VHZPWE5L.cjs');
|
|
5
5
|
var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
|
|
6
6
|
|
|
7
7
|
// src/voice/voice.ts
|
|
@@ -10,7 +10,7 @@ _MastraVoice_decorators = [chunkTICDQWVJ_cjs.InstrumentClass({
|
|
|
10
10
|
prefix: "voice",
|
|
11
11
|
excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
|
|
12
12
|
})];
|
|
13
|
-
exports.MastraVoice = class MastraVoice extends (_a =
|
|
13
|
+
exports.MastraVoice = class MastraVoice extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
14
14
|
listeningModel;
|
|
15
15
|
speechModel;
|
|
16
16
|
speaker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_SCHEMAS } from './chunk-EWDGXKOQ.js';
|
|
2
|
-
import { MastraBase } from './chunk-
|
|
2
|
+
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
3
3
|
|
|
4
4
|
// src/storage/base.ts
|
|
5
5
|
var MastraStorage = class extends MastraBase {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVHZPWE5L_cjs = require('./chunk-VHZPWE5L.cjs');
|
|
4
4
|
var promises = require('fs/promises');
|
|
5
5
|
var dotenv = require('dotenv');
|
|
6
6
|
|
|
7
|
-
var MastraBundler = class extends
|
|
7
|
+
var MastraBundler = class extends chunkVHZPWE5L_cjs.MastraBase {
|
|
8
8
|
constructor({ name, component = "BUNDLER" }) {
|
|
9
9
|
super({ component, name });
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { delay } from './chunk-
|
|
2
|
-
import { MastraBase } from './chunk-
|
|
3
|
-
import { RegisteredLogger } from './chunk-
|
|
1
|
+
import { delay } from './chunk-26WUL725.js';
|
|
2
|
+
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
3
|
+
import { RegisteredLogger } from './chunk-XXVGT7SJ.js';
|
|
4
4
|
import { jsonSchema, generateText, Output, generateObject, streamText, streamObject } from 'ai';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InstrumentClass } from './chunk-EWDGXKOQ.js';
|
|
2
|
-
import { MastraBase } from './chunk-
|
|
2
|
+
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
3
3
|
import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
|
|
4
4
|
|
|
5
5
|
// src/voice/voice.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkTICDQWVJ_cjs = require('./chunk-TICDQWVJ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkVHZPWE5L_cjs = require('./chunk-VHZPWE5L.cjs');
|
|
5
5
|
var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
|
|
6
6
|
|
|
7
7
|
// src/tts/index.ts
|
|
@@ -10,7 +10,7 @@ _MastraTTS_decorators = [chunkTICDQWVJ_cjs.InstrumentClass({
|
|
|
10
10
|
prefix: "tts",
|
|
11
11
|
excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
|
|
12
12
|
})];
|
|
13
|
-
exports.MastraTTS = class MastraTTS extends (_a =
|
|
13
|
+
exports.MastraTTS = class MastraTTS extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
14
14
|
model;
|
|
15
15
|
constructor({
|
|
16
16
|
model
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkIJWOVA22_cjs = require('./chunk-IJWOVA22.cjs');
|
|
4
4
|
var cohereAi = require('cohere-ai');
|
|
5
5
|
|
|
6
6
|
var CohereRelevanceScorer = class {
|
|
@@ -38,7 +38,7 @@ Relevance score (0-1):`;
|
|
|
38
38
|
var MastraAgentRelevanceScorer = class {
|
|
39
39
|
agent;
|
|
40
40
|
constructor(name, model) {
|
|
41
|
-
this.agent = new
|
|
41
|
+
this.agent = new chunkIJWOVA22_cjs.Agent({
|
|
42
42
|
name: `Relevance Scorer ${name}`,
|
|
43
43
|
instructions: `You are a specialized agent for evaluating the relevance of text to queries.
|
|
44
44
|
Your task is to rate how well a text passage answers a given query.
|