@mastra/core 0.4.0 → 0.4.2-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/dist/agent/index.d.ts +4 -3
- package/dist/agent/index.js +1 -1
- package/dist/{base-BTUaTXvc.d.ts → base-BdNHFjqH.d.ts} +34 -3
- package/dist/{base-CmtknnDz.d.ts → base-eWkcLLSb.d.ts} +1 -8
- package/dist/base.d.ts +2 -2
- package/dist/base.js +1 -1
- package/dist/bundler/index.d.ts +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-SYZAQCKZ.js → chunk-6RDA4JYW.js} +1 -18
- package/dist/{chunk-VIJVUFTB.js → chunk-7NPRQT5A.js} +9 -1
- package/dist/{chunk-DAWQ5R4C.js → chunk-HPIB5X7E.js} +2 -2
- package/dist/{chunk-6CWY2XAM.js → chunk-JIV6PDIN.js} +1 -1
- package/dist/{chunk-XS2VY7YW.js → chunk-KP5SHTKA.js} +3 -1
- package/dist/{chunk-KDUL7NPA.js → chunk-LKOVXFLE.js} +1 -1
- package/dist/{chunk-ILKS57KK.js → chunk-N7KZVQDK.js} +1 -1
- package/dist/{chunk-WVNTGARP.js → chunk-NDQR6IPC.js} +1 -1
- package/dist/{chunk-63KLSI2Y.js → chunk-ORM3OCHX.js} +72 -24
- package/dist/{chunk-PI5YQB75.js → chunk-TCMOYQ74.js} +1 -1
- package/dist/{chunk-KMVLZUIO.js → chunk-XD7K4XPP.js} +4 -4
- package/dist/{chunk-DIMNBNEX.js → chunk-YUOADWSP.js} +1 -1
- package/dist/{chunk-COG5YSSN.js → chunk-Z735LDV7.js} +1 -1
- package/dist/deployer/index.d.ts +2 -2
- package/dist/deployer/index.js +1 -1
- package/dist/eval/index.d.ts +4 -3
- package/dist/{index-BIpeWPEO.d.ts → index-C5uPdbs4.d.ts} +7 -3
- package/dist/index.d.ts +9 -8
- package/dist/index.js +16 -16
- package/dist/integration/index.d.ts +5 -4
- package/dist/llm/index.d.ts +4 -3
- package/dist/logger/index.d.ts +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/mastra/index.d.ts +5 -4
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.d.ts +4 -3
- package/dist/memory/index.js +1 -1
- package/dist/relevance/index.js +1 -1
- package/dist/storage/index.d.ts +5 -4
- package/dist/storage/index.js +2 -2
- package/dist/telemetry/index.d.ts +4 -3
- package/dist/tools/index.d.ts +5 -4
- package/dist/tts/index.d.ts +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/vector/index.d.ts +2 -2
- package/dist/vector/index.js +1 -1
- package/dist/vector/libsql/index.d.ts +2 -2
- package/dist/vector/libsql/index.js +1 -1
- package/dist/voice/index.d.ts +19 -4
- package/dist/voice/index.js +37 -4
- package/dist/{workflow-CwuYLcTS.d.ts → workflow-CbKcJz7a.d.ts} +2 -2
- package/dist/workflows/index.d.ts +6 -5
- package/dist/workflows/index.js +1 -1
- package/package.json +1 -1
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export { A as Agent } from '../base-
|
|
5
|
-
import '../base-
|
|
4
|
+
export { A as Agent } from '../base-BdNHFjqH.js';
|
|
5
|
+
import '../base-eWkcLLSb.js';
|
|
6
6
|
import '../types-m9RryK9a.js';
|
|
7
|
+
import '../voice/index.js';
|
|
7
8
|
import 'sift';
|
|
8
9
|
import '../vector/index.js';
|
|
9
10
|
import '@opentelemetry/api';
|
|
10
|
-
import '../index-
|
|
11
|
+
import '../index-C5uPdbs4.js';
|
|
11
12
|
import 'pino';
|
|
12
13
|
import 'stream';
|
|
13
14
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/agent/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Agent } from '../chunk-
|
|
1
|
+
export { Agent } from '../chunk-ORM3OCHX.js';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
2
|
import { EmbeddingModel, CoreMessage as CoreMessage$1, Message, UserContent, AssistantContent, LanguageModelV1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, LanguageModel as LanguageModel$1, DeepPartial, ToolContent } from 'ai';
|
|
3
|
-
import { M as MastraBase, T as Telemetry } from './base-
|
|
3
|
+
import { M as MastraBase, T as Telemetry } from './base-eWkcLLSb.js';
|
|
4
4
|
import { a as Metric, M as MetricResult, T as TestInfo } from './types-m9RryK9a.js';
|
|
5
5
|
import { Query } from 'sift';
|
|
6
6
|
import { z, ZodSchema } from 'zod';
|
|
7
7
|
import { JSONSchema7 } from 'json-schema';
|
|
8
8
|
import { MastraVector } from './vector/index.js';
|
|
9
|
-
import {
|
|
9
|
+
import { CompositeVoice } from './voice/index.js';
|
|
10
|
+
import { B as BaseLogMessage, R as RegisteredLogger, L as Logger, d as Run } from './index-C5uPdbs4.js';
|
|
10
11
|
import { MastraTTS } from './tts/index.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -460,6 +461,7 @@ interface AgentConfig<TTools extends Record<string, ToolAction<any, any, any, an
|
|
|
460
461
|
metrics?: TMetrics;
|
|
461
462
|
evals?: TMetrics;
|
|
462
463
|
memory?: MastraMemory;
|
|
464
|
+
voice?: CompositeVoice;
|
|
463
465
|
}
|
|
464
466
|
interface AgentGenerateOptions<Z extends ZodSchema | JSONSchema7 | undefined = undefined> {
|
|
465
467
|
toolsets?: ToolsetsInput;
|
|
@@ -584,6 +586,7 @@ declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>
|
|
|
584
586
|
/** @deprecated This property is deprecated. Use evals instead. */
|
|
585
587
|
metrics: TMetrics;
|
|
586
588
|
evals: TMetrics;
|
|
589
|
+
voice?: CompositeVoice;
|
|
587
590
|
constructor(config: AgentConfig<TTools, TMetrics>);
|
|
588
591
|
hasOwnMemory(): boolean;
|
|
589
592
|
getMemory(): MastraMemory | undefined;
|
|
@@ -609,7 +612,7 @@ declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>
|
|
|
609
612
|
runId?: string;
|
|
610
613
|
}): Promise<{
|
|
611
614
|
threadId: string;
|
|
612
|
-
messages:
|
|
615
|
+
messages: NonNullable<CoreMessage$1 | null>[];
|
|
613
616
|
}>;
|
|
614
617
|
saveResponse({ result, threadId, resourceId, runId, memoryConfig, }: {
|
|
615
618
|
runId: string;
|
|
@@ -658,6 +661,34 @@ declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>
|
|
|
658
661
|
};
|
|
659
662
|
generate<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], { context, threadId: threadIdInFn, memoryOptions, resourceId, maxSteps, onStepFinish, runId, toolsets, output, temperature, toolChoice, }?: AgentGenerateOptions<Z>): Promise<GenerateReturn<Z>>;
|
|
660
663
|
stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], { context, threadId: threadIdInFn, memoryOptions, resourceId, maxSteps, onFinish, onStepFinish, runId, toolsets, output, temperature, toolChoice, }?: AgentStreamOptions<Z>): Promise<StreamReturn<Z>>;
|
|
664
|
+
/**
|
|
665
|
+
* Convert text to speech using the configured voice provider
|
|
666
|
+
* @param input Text or text stream to convert to speech
|
|
667
|
+
* @param options Speech options including speaker and provider-specific options
|
|
668
|
+
* @returns Audio stream
|
|
669
|
+
*/
|
|
670
|
+
speak(input: string | NodeJS.ReadableStream, options?: {
|
|
671
|
+
speaker?: string;
|
|
672
|
+
[key: string]: any;
|
|
673
|
+
}): Promise<NodeJS.ReadableStream>;
|
|
674
|
+
/**
|
|
675
|
+
* Convert speech to text using the configured voice provider
|
|
676
|
+
* @param audioStream Audio stream to transcribe
|
|
677
|
+
* @param options Provider-specific transcription options
|
|
678
|
+
* @returns Text or text stream
|
|
679
|
+
*/
|
|
680
|
+
listen(audioStream: NodeJS.ReadableStream, options?: {
|
|
681
|
+
[key: string]: any;
|
|
682
|
+
}): Promise<string | NodeJS.ReadableStream>;
|
|
683
|
+
/**
|
|
684
|
+
* Get a list of available speakers from the configured voice provider
|
|
685
|
+
* @throws {Error} If no voice provider is configured
|
|
686
|
+
* @returns {Promise<Array<{voiceId: string}>>} List of available speakers
|
|
687
|
+
*/
|
|
688
|
+
getSpeakers(): Promise<{
|
|
689
|
+
[key: string]: any;
|
|
690
|
+
voiceId: string;
|
|
691
|
+
}[]>;
|
|
661
692
|
}
|
|
662
693
|
|
|
663
694
|
interface StorageColumn {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
2
|
import { Tracer, Span } from '@opentelemetry/api';
|
|
3
|
-
import { R as RegisteredLogger, L as Logger
|
|
3
|
+
import { R as RegisteredLogger, L as Logger } from './index-C5uPdbs4.js';
|
|
4
4
|
import { SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
|
|
6
6
|
/** Sampling strategy configuration for OpenTelemetry */
|
|
@@ -120,13 +120,6 @@ declare class MastraBase {
|
|
|
120
120
|
* @param logger
|
|
121
121
|
*/
|
|
122
122
|
__setLogger(logger: Logger): void;
|
|
123
|
-
/**
|
|
124
|
-
* Internal logging helper that formats and sends logs to the configured logger
|
|
125
|
-
* @param level - Severity level of the log
|
|
126
|
-
* @param message - Main log message
|
|
127
|
-
* @param opts - Optional object for the log
|
|
128
|
-
*/
|
|
129
|
-
log(level: LogLevel, message: string, opts?: Record<string, any>): void;
|
|
130
123
|
/**
|
|
131
124
|
* Set the telemetry for the
|
|
132
125
|
* @param telemetry
|
package/dist/base.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@opentelemetry/api';
|
|
2
|
-
import './index-
|
|
3
|
-
export { M as MastraBase } from './base-
|
|
2
|
+
import './index-C5uPdbs4.js';
|
|
3
|
+
export { M as MastraBase } from './base-eWkcLLSb.js';
|
|
4
4
|
import 'pino';
|
|
5
5
|
import 'stream';
|
|
6
6
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraBase } from './chunk-
|
|
1
|
+
export { MastraBase } from './chunk-6RDA4JYW.js';
|
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-eWkcLLSb.js';
|
|
2
2
|
import '@opentelemetry/api';
|
|
3
|
-
import '../index-
|
|
3
|
+
import '../index-C5uPdbs4.js';
|
|
4
4
|
import 'pino';
|
|
5
5
|
import 'stream';
|
|
6
6
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/bundler/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraBundler } from '../chunk-
|
|
1
|
+
export { MastraBundler } from '../chunk-YUOADWSP.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegisteredLogger, createLogger } from './chunk-
|
|
1
|
+
import { RegisteredLogger, createLogger } from './chunk-KP5SHTKA.js';
|
|
2
2
|
|
|
3
3
|
// src/base.ts
|
|
4
4
|
var MastraBase = class {
|
|
@@ -19,23 +19,6 @@ var MastraBase = class {
|
|
|
19
19
|
this.logger = logger;
|
|
20
20
|
this.logger.debug(`Logger updated [component=${this.component}] [name=${this.name}]`);
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Internal logging helper that formats and sends logs to the configured logger
|
|
24
|
-
* @param level - Severity level of the log
|
|
25
|
-
* @param message - Main log message
|
|
26
|
-
* @param opts - Optional object for the log
|
|
27
|
-
*/
|
|
28
|
-
log(level, message, opts) {
|
|
29
|
-
if (!this.logger) return;
|
|
30
|
-
const logMessage = {
|
|
31
|
-
type: this.component,
|
|
32
|
-
message,
|
|
33
|
-
destinationPath: this.name ? `${this.component}/${this.name}` : this.component,
|
|
34
|
-
...opts || {}
|
|
35
|
-
};
|
|
36
|
-
const logMethod = level.toLowerCase();
|
|
37
|
-
this.logger[logMethod]?.(logMessage);
|
|
38
|
-
}
|
|
39
22
|
/**
|
|
40
23
|
* Set the telemetry for the
|
|
41
24
|
* @param telemetry
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MastraBase } from './chunk-
|
|
1
|
+
import { MastraBase } from './chunk-6RDA4JYW.js';
|
|
2
2
|
import { experimental_customProvider } from 'ai';
|
|
3
3
|
import node_modulesPath from 'node_modules-path';
|
|
4
4
|
import path from 'path';
|
|
@@ -46,6 +46,14 @@ const memory = new Memory({
|
|
|
46
46
|
})
|
|
47
47
|
|
|
48
48
|
Visit https://sdk.vercel.ai/docs/foundations/overview#embedding-models to find an alternate embedding provider
|
|
49
|
+
|
|
50
|
+
If you do not want to use the Memory semantic recall feature, you can disable it entirely and this error will go away.
|
|
51
|
+
|
|
52
|
+
const memory = new Memory({
|
|
53
|
+
options: {
|
|
54
|
+
semanticRecall: false // <- an embedder will not be required with this set to false
|
|
55
|
+
}
|
|
56
|
+
})
|
|
49
57
|
`);
|
|
50
58
|
}
|
|
51
59
|
const { FlagEmbedding, EmbeddingModel } = mod;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DefaultStorage } from './chunk-
|
|
1
|
+
import { DefaultStorage } from './chunk-JIV6PDIN.js';
|
|
2
2
|
import { InstrumentClass, OTLPTraceExporter, Telemetry } from './chunk-4ZRHVG25.js';
|
|
3
|
-
import { createLogger, LogLevel, noopLogger } from './chunk-
|
|
3
|
+
import { createLogger, LogLevel, noopLogger } from './chunk-KP5SHTKA.js';
|
|
4
4
|
import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
|
|
5
5
|
|
|
6
6
|
// src/mastra/index.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES } from './chunk-RG66XEJT.js';
|
|
2
|
-
import { MastraBase } from './chunk-
|
|
2
|
+
import { MastraBase } from './chunk-6RDA4JYW.js';
|
|
3
3
|
import { createClient } from '@libsql/client';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
|
|
@@ -24,8 +24,10 @@ var LogLevel = {
|
|
|
24
24
|
NONE: "silent"
|
|
25
25
|
};
|
|
26
26
|
var LoggerTransport = class extends Transform {
|
|
27
|
+
constructor(opts = {}) {
|
|
28
|
+
super({ ...opts, objectMode: true });
|
|
29
|
+
}
|
|
27
30
|
async getLogsByRunId({ runId }) {
|
|
28
|
-
console.log(runId);
|
|
29
31
|
return [];
|
|
30
32
|
}
|
|
31
33
|
async getLogs() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InstrumentClass } from './chunk-4ZRHVG25.js';
|
|
2
|
-
import { MastraBase } from './chunk-
|
|
2
|
+
import { MastraBase } from './chunk-6RDA4JYW.js';
|
|
3
3
|
import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
|
|
4
4
|
|
|
5
5
|
// src/tts/index.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InstrumentClass } from './chunk-4ZRHVG25.js';
|
|
2
2
|
import { delay } from './chunk-WIBGG4X6.js';
|
|
3
|
+
import { MastraBase } from './chunk-6RDA4JYW.js';
|
|
4
|
+
import { RegisteredLogger } from './chunk-KP5SHTKA.js';
|
|
3
5
|
import { executeHook } from './chunk-BB4KXGBU.js';
|
|
4
|
-
import { MastraBase } from './chunk-SYZAQCKZ.js';
|
|
5
|
-
import { RegisteredLogger, LogLevel } from './chunk-XS2VY7YW.js';
|
|
6
6
|
import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
|
|
7
7
|
import { randomUUID } from 'crypto';
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -517,6 +517,7 @@ var Agent = class extends (_a = MastraBase) {
|
|
|
517
517
|
/** @deprecated This property is deprecated. Use evals instead. */
|
|
518
518
|
metrics;
|
|
519
519
|
evals;
|
|
520
|
+
voice;
|
|
520
521
|
constructor(config) {
|
|
521
522
|
super({
|
|
522
523
|
component: RegisteredLogger.AGENT
|
|
@@ -549,6 +550,9 @@ var Agent = class extends (_a = MastraBase) {
|
|
|
549
550
|
if (config.memory) {
|
|
550
551
|
this.#memory = config.memory;
|
|
551
552
|
}
|
|
553
|
+
if (config.voice) {
|
|
554
|
+
this.voice = config.voice;
|
|
555
|
+
}
|
|
552
556
|
}
|
|
553
557
|
hasOwnMemory() {
|
|
554
558
|
return Boolean(this.#memory);
|
|
@@ -698,7 +702,7 @@ var Agent = class extends (_a = MastraBase) {
|
|
|
698
702
|
memoryConfig
|
|
699
703
|
});
|
|
700
704
|
}
|
|
701
|
-
this.
|
|
705
|
+
this.logger.debug("Saved messages to memory", {
|
|
702
706
|
threadId: thread.id,
|
|
703
707
|
runId
|
|
704
708
|
});
|
|
@@ -708,24 +712,10 @@ var Agent = class extends (_a = MastraBase) {
|
|
|
708
712
|
}) : null;
|
|
709
713
|
return {
|
|
710
714
|
threadId: thread.id,
|
|
711
|
-
messages: [{
|
|
715
|
+
messages: [memorySystemMessage ? {
|
|
712
716
|
role: "system",
|
|
713
|
-
content:
|
|
714
|
-
|
|
715
|
-
Analyze this message to determine if the user is referring to a previous conversation with the LLM.
|
|
716
|
-
Specifically, identify if the user wants to reference specific information from that chat or if they want the LLM to use the previous chat messages as context for the current conversation.
|
|
717
|
-
Extract any date ranges mentioned in the user message that could help identify the previous chat.
|
|
718
|
-
Return dates in ISO format.
|
|
719
|
-
If no specific dates are mentioned but time periods are (like "last week" or "past month"), calculate the appropriate date range.
|
|
720
|
-
For the end date, return the date 1 day after the end of the time period.
|
|
721
|
-
Today's date is ${(/* @__PURE__ */new Date()).toISOString()} and the time is ${(/* @__PURE__ */new Date()).toLocaleTimeString("en-US", {
|
|
722
|
-
hour: "numeric",
|
|
723
|
-
minute: "numeric",
|
|
724
|
-
hour12: true
|
|
725
|
-
})} ${memorySystemMessage ? `
|
|
726
|
-
|
|
727
|
-
${memorySystemMessage}` : ""}`
|
|
728
|
-
}, ...this.sanitizeResponseMessages(memoryMessages), ...newMessages]
|
|
717
|
+
content: memorySystemMessage
|
|
718
|
+
} : null, ...this.sanitizeResponseMessages(memoryMessages), ...newMessages].filter(message => Boolean(message))
|
|
729
719
|
};
|
|
730
720
|
}
|
|
731
721
|
return {
|
|
@@ -887,7 +877,8 @@ ${memorySystemMessage}` : ""}`
|
|
|
887
877
|
this.logger.debug(`[Agent:${this.name}] - Executing tool ${k}`, {
|
|
888
878
|
name: k,
|
|
889
879
|
description: tool.description,
|
|
890
|
-
args
|
|
880
|
+
args,
|
|
881
|
+
runId
|
|
891
882
|
});
|
|
892
883
|
return tool.execute({
|
|
893
884
|
context: args,
|
|
@@ -925,7 +916,8 @@ ${memorySystemMessage}` : ""}`
|
|
|
925
916
|
this.logger.debug(`[Agent:${this.name}] - Executing tool ${toolName}`, {
|
|
926
917
|
name: toolName,
|
|
927
918
|
description: toolObj.description,
|
|
928
|
-
args
|
|
919
|
+
args,
|
|
920
|
+
runId
|
|
929
921
|
});
|
|
930
922
|
return toolObj.execute({
|
|
931
923
|
context: args,
|
|
@@ -954,7 +946,7 @@ ${memorySystemMessage}` : ""}`
|
|
|
954
946
|
}) {
|
|
955
947
|
let coreMessages = [];
|
|
956
948
|
let threadIdToUse = threadId;
|
|
957
|
-
this.
|
|
949
|
+
this.logger.debug(`Saving user messages in memory for agent ${this.name}`, {
|
|
958
950
|
runId
|
|
959
951
|
});
|
|
960
952
|
const saveMessageResponse = await this.saveMemory({
|
|
@@ -988,7 +980,7 @@ ${memorySystemMessage}` : ""}`
|
|
|
988
980
|
}
|
|
989
981
|
const systemMessage = {
|
|
990
982
|
role: "system",
|
|
991
|
-
content: `${this.instructions}
|
|
983
|
+
content: `${this.instructions}.`
|
|
992
984
|
};
|
|
993
985
|
let coreMessages = messages;
|
|
994
986
|
let threadIdToUse = threadId;
|
|
@@ -1308,6 +1300,62 @@ ${memorySystemMessage}` : ""}`
|
|
|
1308
1300
|
toolChoice
|
|
1309
1301
|
});
|
|
1310
1302
|
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Convert text to speech using the configured voice provider
|
|
1305
|
+
* @param input Text or text stream to convert to speech
|
|
1306
|
+
* @param options Speech options including speaker and provider-specific options
|
|
1307
|
+
* @returns Audio stream
|
|
1308
|
+
*/
|
|
1309
|
+
async speak(input, options) {
|
|
1310
|
+
if (!this.voice) {
|
|
1311
|
+
throw new Error("No voice provider configured");
|
|
1312
|
+
}
|
|
1313
|
+
try {
|
|
1314
|
+
return this.voice.speak(input, options);
|
|
1315
|
+
} catch (e) {
|
|
1316
|
+
this.logger.error("Error during agent speak", {
|
|
1317
|
+
error: e
|
|
1318
|
+
});
|
|
1319
|
+
throw e;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Convert speech to text using the configured voice provider
|
|
1324
|
+
* @param audioStream Audio stream to transcribe
|
|
1325
|
+
* @param options Provider-specific transcription options
|
|
1326
|
+
* @returns Text or text stream
|
|
1327
|
+
*/
|
|
1328
|
+
async listen(audioStream, options) {
|
|
1329
|
+
if (!this.voice) {
|
|
1330
|
+
throw new Error("No voice provider configured");
|
|
1331
|
+
}
|
|
1332
|
+
try {
|
|
1333
|
+
return this.voice.listen(audioStream, options);
|
|
1334
|
+
} catch (e) {
|
|
1335
|
+
this.logger.error("Error during agent listen", {
|
|
1336
|
+
error: e
|
|
1337
|
+
});
|
|
1338
|
+
throw e;
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Get a list of available speakers from the configured voice provider
|
|
1343
|
+
* @throws {Error} If no voice provider is configured
|
|
1344
|
+
* @returns {Promise<Array<{voiceId: string}>>} List of available speakers
|
|
1345
|
+
*/
|
|
1346
|
+
async getSpeakers() {
|
|
1347
|
+
if (!this.voice) {
|
|
1348
|
+
throw new Error("No voice provider configured");
|
|
1349
|
+
}
|
|
1350
|
+
try {
|
|
1351
|
+
return await this.voice.getSpeakers();
|
|
1352
|
+
} catch (e) {
|
|
1353
|
+
this.logger.error("Error during agent getSpeakers", {
|
|
1354
|
+
error: e
|
|
1355
|
+
});
|
|
1356
|
+
throw e;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1311
1359
|
};
|
|
1312
1360
|
Agent = /*@__PURE__*/(_ => {
|
|
1313
1361
|
_init = __decoratorStart(_a);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DefaultStorage } from './chunk-
|
|
2
|
-
import { DefaultVectorDB } from './chunk-
|
|
3
|
-
import { defaultEmbedder } from './chunk-
|
|
1
|
+
import { DefaultStorage } from './chunk-JIV6PDIN.js';
|
|
2
|
+
import { DefaultVectorDB } from './chunk-LKOVXFLE.js';
|
|
3
|
+
import { defaultEmbedder } from './chunk-7NPRQT5A.js';
|
|
4
4
|
import { deepMerge } from './chunk-WIBGG4X6.js';
|
|
5
|
-
import { MastraBase } from './chunk-
|
|
5
|
+
import { MastraBase } from './chunk-6RDA4JYW.js';
|
|
6
6
|
|
|
7
7
|
// src/memory/memory.ts
|
|
8
8
|
var MastraMemory = class extends MastraBase {
|
package/dist/deployer/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MastraBundler, IBundler } from '../bundler/index.js';
|
|
2
|
-
import '../base-
|
|
2
|
+
import '../base-eWkcLLSb.js';
|
|
3
3
|
import '@opentelemetry/api';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-C5uPdbs4.js';
|
|
5
5
|
import 'pino';
|
|
6
6
|
import 'stream';
|
|
7
7
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/deployer/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraDeployer } from '../chunk-
|
|
1
|
+
export { MastraDeployer } from '../chunk-Z735LDV7.js';
|
package/dist/eval/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as Metric, T as TestInfo, M as MetricResult } from '../types-m9RryK9a.js';
|
|
2
|
-
import { A as Agent } from '../base-
|
|
2
|
+
import { A as Agent } from '../base-BdNHFjqH.js';
|
|
3
3
|
import 'ai';
|
|
4
|
-
import '../base-
|
|
4
|
+
import '../base-eWkcLLSb.js';
|
|
5
5
|
import '@opentelemetry/api';
|
|
6
|
-
import '../index-
|
|
6
|
+
import '../index-C5uPdbs4.js';
|
|
7
7
|
import 'pino';
|
|
8
8
|
import 'stream';
|
|
9
9
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -11,6 +11,7 @@ import 'sift';
|
|
|
11
11
|
import 'zod';
|
|
12
12
|
import 'json-schema';
|
|
13
13
|
import '../vector/index.js';
|
|
14
|
+
import '../voice/index.js';
|
|
14
15
|
import '../tts/index.js';
|
|
15
16
|
|
|
16
17
|
declare function evaluate<T extends Agent>({ agentName, input, metric, output, runId, globalRunId, testInfo, instructions, }: {
|
|
@@ -30,11 +30,15 @@ declare const LogLevel: {
|
|
|
30
30
|
};
|
|
31
31
|
type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
32
32
|
interface BaseLogMessage extends Run {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
msg: string;
|
|
34
|
+
level: number;
|
|
35
|
+
time: Date;
|
|
36
|
+
pid: number;
|
|
37
|
+
hostname: string;
|
|
38
|
+
name: string;
|
|
36
39
|
}
|
|
37
40
|
declare class LoggerTransport extends Transform {
|
|
41
|
+
constructor(opts?: any);
|
|
38
42
|
getLogsByRunId({ runId }: {
|
|
39
43
|
runId: string;
|
|
40
44
|
}): Promise<BaseLogMessage[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as Metric } from './types-m9RryK9a.js';
|
|
2
2
|
export { M as MetricResult, T as TestInfo } from './types-m9RryK9a.js';
|
|
3
|
-
import { T as ToolAction, A as Agent$1, i as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, j as ToolExecutionContext, W as WorkflowOptions } from './base-
|
|
4
|
-
export { Y as ActionContext, X as BaseCondition, B as BaseStructuredOutputType, o as CoreAssistantMessage, C as CoreMessage, n as CoreSystemMessage, Q as CoreTool, q as CoreToolMessage, p as CoreUserMessage, a5 as DependencyCheckOutput, s as EmbedManyResult, r as EmbedResult, E as EvalRow, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, N as MemoryConfig, K as MessageResponse, H as MessageType, O as OutputType, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, P as SharedMemoryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, f as StepResult, d as StepVariableType, k as StorageColumn, m as StorageGetMessagesArg, J as StorageThreadType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType, a4 as SubscriberFunctionOutput, V as VariableReference, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, l as WorkflowRow, g as WorkflowRunState, a9 as WorkflowState } from './base-
|
|
5
|
-
import { M as MastraBase$1 } from './base-
|
|
6
|
-
export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from './base-
|
|
7
|
-
import { R as RegisteredLogger, a as LogLevel, T as TransportMap, L as Logger } from './index-
|
|
8
|
-
export { B as BaseLogMessage, b as LoggerTransport, M as MultiLogger, c as combineLoggers, n as noopLogger } from './index-
|
|
3
|
+
import { T as ToolAction, A as Agent$1, i as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, j as ToolExecutionContext, W as WorkflowOptions } from './base-BdNHFjqH.js';
|
|
4
|
+
export { Y as ActionContext, X as BaseCondition, B as BaseStructuredOutputType, o as CoreAssistantMessage, C as CoreMessage, n as CoreSystemMessage, Q as CoreTool, q as CoreToolMessage, p as CoreUserMessage, a5 as DependencyCheckOutput, s as EmbedManyResult, r as EmbedResult, E as EvalRow, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, N as MemoryConfig, K as MessageResponse, H as MessageType, O as OutputType, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, P as SharedMemoryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, f as StepResult, d as StepVariableType, k as StorageColumn, m as StorageGetMessagesArg, J as StorageThreadType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType, a4 as SubscriberFunctionOutput, V as VariableReference, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, l as WorkflowRow, g as WorkflowRunState, a9 as WorkflowState } from './base-BdNHFjqH.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
9
|
import { MastraDeployer as MastraDeployer$1 } from './deployer/index.js';
|
|
10
10
|
import { MastraStorageLibSql as DefaultStorage, LibSQLConfig } from './storage/index.js';
|
|
11
11
|
export { evaluate } from './eval/index.js';
|
|
@@ -20,8 +20,8 @@ import { MastraTTS as MastraTTS$1, TTSConfig } from './tts/index.js';
|
|
|
20
20
|
export { TagMaskOptions, deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './utils.js';
|
|
21
21
|
import { MastraVector as MastraVector$1 } from './vector/index.js';
|
|
22
22
|
export { IndexStats, QueryResult, defaultEmbedder } from './vector/index.js';
|
|
23
|
-
import { S as Step, W as Workflow$1 } from './workflow-
|
|
24
|
-
export { c as createStep } from './workflow-
|
|
23
|
+
import { S as Step, W as Workflow$1 } from './workflow-CbKcJz7a.js';
|
|
24
|
+
export { c as createStep } from './workflow-CbKcJz7a.js';
|
|
25
25
|
export { getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './workflows/index.js';
|
|
26
26
|
export { AvailableHooks, executeHook, registerHook } from './hooks/index.js';
|
|
27
27
|
export { ArrayOperator, BaseFilterTranslator, BasicOperator, ElementOperator, FieldCondition, Filter, LogicalOperator, NumericOperator, OperatorCondition, OperatorSupport, QueryOperator, RegexOperator } from './filter/index.js';
|
|
@@ -29,6 +29,7 @@ export { LibSQLVector as DefaultVectorDB, LibSQLVector } from './vector/libsql/i
|
|
|
29
29
|
export { Message as AiMessageType } from 'ai';
|
|
30
30
|
import 'sift';
|
|
31
31
|
import 'json-schema';
|
|
32
|
+
import './voice/index.js';
|
|
32
33
|
import '@opentelemetry/api';
|
|
33
34
|
import '@opentelemetry/sdk-trace-base';
|
|
34
35
|
import 'pino';
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { MastraTTS } from './chunk-
|
|
2
|
-
import { Workflow } from './chunk-
|
|
3
|
-
export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-
|
|
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
4
|
import { Integration, OpenAPIToolset } from './chunk-PNZK456O.js';
|
|
5
5
|
import { Tool } from './chunk-ZINPRHAN.js';
|
|
6
6
|
export { createTool } from './chunk-ZINPRHAN.js';
|
|
7
|
-
export { Mastra } from './chunk-
|
|
8
|
-
import { MastraMemory } from './chunk-
|
|
9
|
-
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-
|
|
10
|
-
import { MastraStorage, DefaultStorage } from './chunk-
|
|
11
|
-
export { DefaultStorage } from './chunk-
|
|
12
|
-
export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from './chunk-
|
|
13
|
-
import { MastraVector } from './chunk-
|
|
14
|
-
export { defaultEmbedder } from './chunk-
|
|
15
|
-
import { Agent } from './chunk-
|
|
7
|
+
export { Mastra } from './chunk-HPIB5X7E.js';
|
|
8
|
+
import { MastraMemory } from './chunk-XD7K4XPP.js';
|
|
9
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-N7KZVQDK.js';
|
|
10
|
+
import { MastraStorage, DefaultStorage } from './chunk-JIV6PDIN.js';
|
|
11
|
+
export { DefaultStorage } from './chunk-JIV6PDIN.js';
|
|
12
|
+
export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from './chunk-LKOVXFLE.js';
|
|
13
|
+
import { MastraVector } from './chunk-7NPRQT5A.js';
|
|
14
|
+
export { defaultEmbedder } from './chunk-7NPRQT5A.js';
|
|
15
|
+
import { Agent } from './chunk-ORM3OCHX.js';
|
|
16
16
|
export { InstrumentClass, OTLPTraceExporter as OTLPStorageExporter, Telemetry, hasActiveTelemetry, withSpan } from './chunk-4ZRHVG25.js';
|
|
17
17
|
export { deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './chunk-WIBGG4X6.js';
|
|
18
|
-
import { MastraDeployer } from './chunk-
|
|
18
|
+
import { MastraDeployer } from './chunk-Z735LDV7.js';
|
|
19
|
+
import { MastraBase } from './chunk-6RDA4JYW.js';
|
|
20
|
+
import { createLogger } from './chunk-KP5SHTKA.js';
|
|
21
|
+
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-KP5SHTKA.js';
|
|
19
22
|
export { Metric, evaluate } from './chunk-NUDAZEOG.js';
|
|
20
23
|
export { AvailableHooks, executeHook, registerHook } from './chunk-BB4KXGBU.js';
|
|
21
|
-
import { MastraBase } from './chunk-SYZAQCKZ.js';
|
|
22
|
-
import { createLogger } from './chunk-XS2VY7YW.js';
|
|
23
|
-
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-XS2VY7YW.js';
|
|
24
24
|
export { BaseFilterTranslator } from './chunk-SIFBBGY6.js';
|
|
25
25
|
|
|
26
26
|
// src/agent/index.warning.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { W as Workflow } from '../workflow-
|
|
2
|
-
import '../base-
|
|
3
|
-
import { T as ToolAction } from '../base-
|
|
1
|
+
import { W as Workflow } from '../workflow-CbKcJz7a.js';
|
|
2
|
+
import '../base-eWkcLLSb.js';
|
|
3
|
+
import { T as ToolAction } from '../base-BdNHFjqH.js';
|
|
4
4
|
import 'xstate';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import '@opentelemetry/api';
|
|
7
|
-
import '../index-
|
|
7
|
+
import '../index-C5uPdbs4.js';
|
|
8
8
|
import 'pino';
|
|
9
9
|
import 'stream';
|
|
10
10
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -13,6 +13,7 @@ import '../types-m9RryK9a.js';
|
|
|
13
13
|
import 'sift';
|
|
14
14
|
import 'json-schema';
|
|
15
15
|
import '../vector/index.js';
|
|
16
|
+
import '../voice/index.js';
|
|
16
17
|
import '../tts/index.js';
|
|
17
18
|
|
|
18
19
|
declare class Integration<ToolsParams = void, ApiClient = void> {
|
package/dist/llm/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export { B as BaseStructuredOutputType, o as CoreAssistantMessage, C as CoreMessage, n as CoreSystemMessage, q as CoreToolMessage, p as CoreUserMessage, s as EmbedManyResult, r as EmbedResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, O as OutputType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType } from '../base-
|
|
5
|
-
import '../index-
|
|
6
|
-
import '../base-
|
|
4
|
+
export { B as BaseStructuredOutputType, o as CoreAssistantMessage, C as CoreMessage, n as CoreSystemMessage, q as CoreToolMessage, p as CoreUserMessage, s as EmbedManyResult, r as EmbedResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, O as OutputType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType } from '../base-BdNHFjqH.js';
|
|
5
|
+
import '../index-C5uPdbs4.js';
|
|
6
|
+
import '../base-eWkcLLSb.js';
|
|
7
7
|
import '@opentelemetry/api';
|
|
8
8
|
import '@opentelemetry/sdk-trace-base';
|
|
9
9
|
import '../types-m9RryK9a.js';
|
|
@@ -11,4 +11,5 @@ import 'sift';
|
|
|
11
11
|
import '../vector/index.js';
|
|
12
12
|
import 'pino';
|
|
13
13
|
import 'stream';
|
|
14
|
+
import '../voice/index.js';
|
|
14
15
|
import '../tts/index.js';
|
package/dist/logger/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'pino';
|
|
2
2
|
import 'stream';
|
|
3
|
-
export { B as BaseLogMessage, a as LogLevel, L as Logger, b as LoggerTransport, M as MultiLogger, R as RegisteredLogger, T as TransportMap, c as combineLoggers, e as createLogger, n as noopLogger } from '../index-
|
|
3
|
+
export { B as BaseLogMessage, a as LogLevel, L as Logger, b as LoggerTransport, M as MultiLogger, R as RegisteredLogger, T as TransportMap, c as combineLoggers, e as createLogger, n as noopLogger } from '../index-C5uPdbs4.js';
|
package/dist/logger/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, createLogger, noopLogger } from '../chunk-
|
|
1
|
+
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, createLogger, noopLogger } from '../chunk-KP5SHTKA.js';
|
package/dist/mastra/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as Agent, M as MastraStorage, a as MastraMemory } from '../base-
|
|
2
|
-
import { L as Logger, B as BaseLogMessage } from '../index-
|
|
3
|
-
import { W as Workflow } from '../workflow-
|
|
1
|
+
import { A as Agent, M as MastraStorage, a as MastraMemory } from '../base-BdNHFjqH.js';
|
|
2
|
+
import { L as Logger, B as BaseLogMessage } from '../index-C5uPdbs4.js';
|
|
3
|
+
import { W as Workflow } from '../workflow-CbKcJz7a.js';
|
|
4
4
|
import { MastraVector } from '../vector/index.js';
|
|
5
|
-
import { O as OtelConfig, T as Telemetry } from '../base-
|
|
5
|
+
import { O as OtelConfig, T as Telemetry } from '../base-eWkcLLSb.js';
|
|
6
6
|
import { MastraTTS } from '../tts/index.js';
|
|
7
7
|
import { MastraDeployer } from '../deployer/index.js';
|
|
8
8
|
import 'ai';
|
|
@@ -10,6 +10,7 @@ import '../types-m9RryK9a.js';
|
|
|
10
10
|
import 'sift';
|
|
11
11
|
import 'zod';
|
|
12
12
|
import 'json-schema';
|
|
13
|
+
import '../voice/index.js';
|
|
13
14
|
import 'pino';
|
|
14
15
|
import 'stream';
|
|
15
16
|
import 'xstate';
|
package/dist/mastra/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Mastra } from '../chunk-
|
|
1
|
+
export { Mastra } from '../chunk-HPIB5X7E.js';
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { a as MastraMemory, N as MemoryConfig, K as MessageResponse, H as MessageType, P as SharedMemoryConfig, J as StorageThreadType } from '../base-
|
|
1
|
+
export { a as MastraMemory, N as MemoryConfig, K as MessageResponse, H as MessageType, P as SharedMemoryConfig, J as StorageThreadType } from '../base-BdNHFjqH.js';
|
|
2
2
|
export { Message as AiMessageType } from 'ai';
|
|
3
|
-
import '../base-
|
|
3
|
+
import '../base-eWkcLLSb.js';
|
|
4
4
|
import '@opentelemetry/api';
|
|
5
|
-
import '../index-
|
|
5
|
+
import '../index-C5uPdbs4.js';
|
|
6
6
|
import 'pino';
|
|
7
7
|
import 'stream';
|
|
8
8
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -11,4 +11,5 @@ import 'sift';
|
|
|
11
11
|
import 'zod';
|
|
12
12
|
import 'json-schema';
|
|
13
13
|
import '../vector/index.js';
|
|
14
|
+
import '../voice/index.js';
|
|
14
15
|
import '../tts/index.js';
|
package/dist/memory/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraMemory } from '../chunk-
|
|
1
|
+
export { MastraMemory } from '../chunk-XD7K4XPP.js';
|
package/dist/relevance/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-
|
|
1
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-N7KZVQDK.js';
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MastraStorage, ag as TABLE_NAMES, k as StorageColumn, J as StorageThreadType, H as MessageType, m as StorageGetMessagesArg, E as EvalRow } from '../base-
|
|
2
|
-
export { ai as TABLE_EVALS, aj as TABLE_MESSAGES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, l as WorkflowRow } from '../base-
|
|
3
|
-
import '../base-
|
|
1
|
+
import { M as MastraStorage, ag as TABLE_NAMES, k as StorageColumn, J as StorageThreadType, H as MessageType, m as StorageGetMessagesArg, E as EvalRow } from '../base-BdNHFjqH.js';
|
|
2
|
+
export { ai as TABLE_EVALS, aj as TABLE_MESSAGES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, l as WorkflowRow } from '../base-BdNHFjqH.js';
|
|
3
|
+
import '../base-eWkcLLSb.js';
|
|
4
4
|
export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../vector/libsql/index.js';
|
|
5
5
|
import 'ai';
|
|
6
6
|
import '../types-m9RryK9a.js';
|
|
@@ -9,10 +9,11 @@ import 'zod';
|
|
|
9
9
|
import 'json-schema';
|
|
10
10
|
import '../vector/index.js';
|
|
11
11
|
import '@opentelemetry/api';
|
|
12
|
-
import '../index-
|
|
12
|
+
import '../index-C5uPdbs4.js';
|
|
13
13
|
import 'pino';
|
|
14
14
|
import 'stream';
|
|
15
15
|
import '@opentelemetry/sdk-trace-base';
|
|
16
|
+
import '../voice/index.js';
|
|
16
17
|
import '../tts/index.js';
|
|
17
18
|
import '../filter/index.js';
|
|
18
19
|
|
package/dist/storage/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DefaultStorage, MastraStorage, DefaultStorage as MastraStorageLibSql } from '../chunk-
|
|
2
|
-
export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../chunk-
|
|
1
|
+
export { DefaultStorage, MastraStorage, DefaultStorage as MastraStorageLibSql } from '../chunk-JIV6PDIN.js';
|
|
2
|
+
export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../chunk-LKOVXFLE.js';
|
|
3
3
|
export { TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT } from '../chunk-RG66XEJT.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from '../base-
|
|
1
|
+
export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from '../base-eWkcLLSb.js';
|
|
2
2
|
import { SpanKind } from '@opentelemetry/api';
|
|
3
3
|
import { ExportResult } from '@opentelemetry/core';
|
|
4
4
|
import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
5
|
-
import { L as Logger } from '../index-
|
|
6
|
-
import { M as MastraStorage } from '../base-
|
|
5
|
+
import { L as Logger } from '../index-C5uPdbs4.js';
|
|
6
|
+
import { M as MastraStorage } from '../base-BdNHFjqH.js';
|
|
7
7
|
import 'pino';
|
|
8
8
|
import 'stream';
|
|
9
9
|
import 'ai';
|
|
@@ -12,6 +12,7 @@ import 'sift';
|
|
|
12
12
|
import 'zod';
|
|
13
13
|
import 'json-schema';
|
|
14
14
|
import '../vector/index.js';
|
|
15
|
+
import '../voice/index.js';
|
|
15
16
|
import '../tts/index.js';
|
|
16
17
|
|
|
17
18
|
declare function withSpan(options: {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../base-
|
|
3
|
-
export { Q as CoreTool } from '../base-
|
|
2
|
+
import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../base-BdNHFjqH.js';
|
|
3
|
+
export { Q as CoreTool } from '../base-BdNHFjqH.js';
|
|
4
4
|
import 'ai';
|
|
5
|
-
import '../base-
|
|
5
|
+
import '../base-eWkcLLSb.js';
|
|
6
6
|
import '@opentelemetry/api';
|
|
7
|
-
import '../index-
|
|
7
|
+
import '../index-C5uPdbs4.js';
|
|
8
8
|
import 'pino';
|
|
9
9
|
import 'stream';
|
|
10
10
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -12,6 +12,7 @@ import '../types-m9RryK9a.js';
|
|
|
12
12
|
import 'sift';
|
|
13
13
|
import 'json-schema';
|
|
14
14
|
import '../vector/index.js';
|
|
15
|
+
import '../voice/index.js';
|
|
15
16
|
import '../tts/index.js';
|
|
16
17
|
|
|
17
18
|
declare class Tool<TId extends string, TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined, TContext extends ToolExecutionContext<TSchemaIn> = ToolExecutionContext<TSchemaIn>> implements ToolAction<TId, TSchemaIn, TSchemaOut, TContext> {
|
package/dist/tts/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MastraBase } from '../base-
|
|
1
|
+
import { M as MastraBase } from '../base-eWkcLLSb.js';
|
|
2
2
|
import '@opentelemetry/api';
|
|
3
|
-
import '../index-
|
|
3
|
+
import '../index-C5uPdbs4.js';
|
|
4
4
|
import 'pino';
|
|
5
5
|
import 'stream';
|
|
6
6
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/tts/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraTTS } from '../chunk-
|
|
1
|
+
export { MastraTTS } from '../chunk-NDQR6IPC.js';
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as MastraBase } from '../base-
|
|
1
|
+
import { M as MastraBase } from '../base-eWkcLLSb.js';
|
|
2
2
|
import * as ai from 'ai';
|
|
3
3
|
import '@opentelemetry/api';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-C5uPdbs4.js';
|
|
5
5
|
import 'pino';
|
|
6
6
|
import 'stream';
|
|
7
7
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/vector/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraVector, defaultEmbedder } from '../chunk-
|
|
1
|
+
export { MastraVector, defaultEmbedder } from '../chunk-7NPRQT5A.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Filter } from '../../filter/index.js';
|
|
2
2
|
import { MastraVector, QueryResult, IndexStats } from '../index.js';
|
|
3
|
-
import '../../base-
|
|
3
|
+
import '../../base-eWkcLLSb.js';
|
|
4
4
|
import '@opentelemetry/api';
|
|
5
|
-
import '../../index-
|
|
5
|
+
import '../../index-C5uPdbs4.js';
|
|
6
6
|
import 'pino';
|
|
7
7
|
import 'stream';
|
|
8
8
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../../chunk-
|
|
1
|
+
export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../../chunk-LKOVXFLE.js';
|
package/dist/voice/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MastraBase } from '../base-
|
|
1
|
+
import { M as MastraBase } from '../base-eWkcLLSb.js';
|
|
2
2
|
import '@opentelemetry/api';
|
|
3
|
-
import '../index-
|
|
3
|
+
import '../index-C5uPdbs4.js';
|
|
4
4
|
import 'pino';
|
|
5
5
|
import 'stream';
|
|
6
6
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -18,7 +18,7 @@ declare abstract class MastraVoice extends MastraBase {
|
|
|
18
18
|
protected listeningModel?: BuiltInModelConfig;
|
|
19
19
|
protected speechModel?: BuiltInModelConfig;
|
|
20
20
|
protected speaker?: string;
|
|
21
|
-
constructor({ listeningModel, speechModel, speaker }
|
|
21
|
+
constructor({ listeningModel, speechModel, speaker }?: VoiceConfig);
|
|
22
22
|
traced<T extends Function>(method: T, methodName: string): T;
|
|
23
23
|
/**
|
|
24
24
|
* Convert text to speech
|
|
@@ -49,4 +49,19 @@ declare abstract class MastraVoice extends MastraBase {
|
|
|
49
49
|
}>>;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
declare class CompositeVoice extends MastraVoice {
|
|
53
|
+
protected speakProvider?: MastraVoice;
|
|
54
|
+
protected listenProvider?: MastraVoice;
|
|
55
|
+
constructor({ speakProvider, listenProvider }: {
|
|
56
|
+
speakProvider?: MastraVoice;
|
|
57
|
+
listenProvider?: MastraVoice;
|
|
58
|
+
});
|
|
59
|
+
speak(input: string | NodeJS.ReadableStream, options?: any): Promise<NodeJS.ReadableStream>;
|
|
60
|
+
listen(audioStream: NodeJS.ReadableStream, options?: any): Promise<string | NodeJS.ReadableStream>;
|
|
61
|
+
getSpeakers(): Promise<{
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
voiceId: string;
|
|
64
|
+
}[]>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { CompositeVoice, MastraVoice, type VoiceConfig };
|
package/dist/voice/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InstrumentClass } from '../chunk-4ZRHVG25.js';
|
|
2
|
-
import { MastraBase } from '../chunk-
|
|
2
|
+
import { MastraBase } from '../chunk-6RDA4JYW.js';
|
|
3
3
|
import { __decoratorStart, __decorateElement, __runInitializers } from '../chunk-C6A6W6XS.js';
|
|
4
4
|
|
|
5
|
-
// src/voice/
|
|
5
|
+
// src/voice/voice.ts
|
|
6
6
|
var _MastraVoice_decorators, _init, _a;
|
|
7
7
|
_MastraVoice_decorators = [InstrumentClass({
|
|
8
8
|
prefix: "voice",
|
|
@@ -16,7 +16,7 @@ var MastraVoice = class extends (_a = MastraBase) {
|
|
|
16
16
|
listeningModel,
|
|
17
17
|
speechModel,
|
|
18
18
|
speaker
|
|
19
|
-
}) {
|
|
19
|
+
} = {}) {
|
|
20
20
|
super({
|
|
21
21
|
component: "VOICE"
|
|
22
22
|
});
|
|
@@ -37,7 +37,40 @@ MastraVoice = /*@__PURE__*/(_ => {
|
|
|
37
37
|
_init = __decoratorStart(_a);
|
|
38
38
|
MastraVoice = __decorateElement(_init, 0, "MastraVoice", _MastraVoice_decorators, MastraVoice);
|
|
39
39
|
__runInitializers(_init, 1, MastraVoice);
|
|
40
|
+
|
|
41
|
+
// src/voice/composite-voice.ts
|
|
40
42
|
return MastraVoice;
|
|
41
43
|
})();
|
|
44
|
+
// src/voice/composite-voice.ts
|
|
45
|
+
var CompositeVoice = class extends MastraVoice {
|
|
46
|
+
speakProvider;
|
|
47
|
+
listenProvider;
|
|
48
|
+
constructor({
|
|
49
|
+
speakProvider,
|
|
50
|
+
listenProvider
|
|
51
|
+
}) {
|
|
52
|
+
super();
|
|
53
|
+
this.speakProvider = speakProvider;
|
|
54
|
+
this.listenProvider = listenProvider;
|
|
55
|
+
}
|
|
56
|
+
async speak(input, options) {
|
|
57
|
+
if (!this.speakProvider) {
|
|
58
|
+
throw new Error("No speak provider configured");
|
|
59
|
+
}
|
|
60
|
+
return this.speakProvider.speak(input, options);
|
|
61
|
+
}
|
|
62
|
+
async listen(audioStream, options) {
|
|
63
|
+
if (!this.listenProvider) {
|
|
64
|
+
throw new Error("No listen provider configured");
|
|
65
|
+
}
|
|
66
|
+
return this.listenProvider.listen(audioStream, options);
|
|
67
|
+
}
|
|
68
|
+
async getSpeakers() {
|
|
69
|
+
if (!this.speakProvider) {
|
|
70
|
+
throw new Error("No speak provider configured");
|
|
71
|
+
}
|
|
72
|
+
return this.speakProvider.getSpeakers();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
42
75
|
|
|
43
|
-
export { MastraVoice };
|
|
76
|
+
export { CompositeVoice, MastraVoice };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Snapshot } from 'xstate';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { S as StepExecutionContext, b as StepAction, R as RetryConfig, c as MastraPrimitives, W as WorkflowOptions, I as IAction, d as StepVariableType, e as StepConfig, f as StepResult, g as WorkflowRunState, h as StepGraph } from './base-
|
|
4
|
-
import { M as MastraBase } from './base-
|
|
3
|
+
import { S as StepExecutionContext, b as StepAction, R as RetryConfig, c as MastraPrimitives, W as WorkflowOptions, I as IAction, d as StepVariableType, e as StepConfig, f as StepResult, g as WorkflowRunState, h as StepGraph } from './base-BdNHFjqH.js';
|
|
4
|
+
import { M as MastraBase } from './base-eWkcLLSb.js';
|
|
5
5
|
|
|
6
6
|
declare class Step<TStepId extends string = any, TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined, TContext extends StepExecutionContext<TSchemaIn> = StepExecutionContext<TSchemaIn>> implements StepAction<TStepId, TSchemaIn, TSchemaOut, TContext> {
|
|
7
7
|
id: TStepId;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { S as Step, W as Workflow, c as createStep } from '../workflow-
|
|
2
|
-
import { V as VariableReference, f as StepResult } from '../base-
|
|
3
|
-
export { Y as ActionContext, X as BaseCondition, a5 as DependencyCheckOutput, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, d as StepVariableType, a4 as SubscriberFunctionOutput, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, a9 as WorkflowState } from '../base-
|
|
1
|
+
export { S as Step, W as Workflow, c as createStep } from '../workflow-CbKcJz7a.js';
|
|
2
|
+
import { V as VariableReference, f as StepResult } from '../base-BdNHFjqH.js';
|
|
3
|
+
export { Y as ActionContext, X as BaseCondition, a5 as DependencyCheckOutput, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, d as StepVariableType, a4 as SubscriberFunctionOutput, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, a9 as WorkflowState } from '../base-BdNHFjqH.js';
|
|
4
4
|
import 'xstate';
|
|
5
5
|
import 'zod';
|
|
6
|
-
import '../base-
|
|
6
|
+
import '../base-eWkcLLSb.js';
|
|
7
7
|
import '@opentelemetry/api';
|
|
8
|
-
import '../index-
|
|
8
|
+
import '../index-C5uPdbs4.js';
|
|
9
9
|
import 'pino';
|
|
10
10
|
import 'stream';
|
|
11
11
|
import '@opentelemetry/sdk-trace-base';
|
|
@@ -14,6 +14,7 @@ import '../types-m9RryK9a.js';
|
|
|
14
14
|
import 'sift';
|
|
15
15
|
import 'json-schema';
|
|
16
16
|
import '../vector/index.js';
|
|
17
|
+
import '../voice/index.js';
|
|
17
18
|
import '../tts/index.js';
|
|
18
19
|
|
|
19
20
|
declare function isErrorEvent(stateEvent: any): stateEvent is {
|
package/dist/workflows/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-
|
|
1
|
+
export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-TCMOYQ74.js';
|