@mastra/voice-google 0.14.0 → 0.14.1

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.
@@ -0,0 +1,218 @@
1
+ import { Transform } from "stream";
2
+ //#region src/logger/index.d.ts
3
+ declare const RegisteredLogger: {
4
+ readonly AGENT: "AGENT";
5
+ readonly OBSERVABILITY: "OBSERVABILITY";
6
+ readonly AUTH: "AUTH";
7
+ readonly BROWSER: "BROWSER";
8
+ readonly NETWORK: "NETWORK";
9
+ readonly WORKFLOW: "WORKFLOW";
10
+ readonly LLM: "LLM";
11
+ readonly TTS: "TTS";
12
+ readonly VOICE: "VOICE";
13
+ readonly VECTOR: "VECTOR";
14
+ readonly BUNDLER: "BUNDLER";
15
+ readonly DEPLOYER: "DEPLOYER";
16
+ readonly MEMORY: "MEMORY";
17
+ readonly STORAGE: "STORAGE";
18
+ readonly EMBEDDINGS: "EMBEDDINGS";
19
+ readonly MCP_SERVER: "MCP_SERVER";
20
+ readonly SERVER_CACHE: "SERVER_CACHE";
21
+ readonly SERVER: "SERVER";
22
+ readonly WORKSPACE: "WORKSPACE";
23
+ readonly CHANNEL: "CHANNEL";
24
+ };
25
+ type RegisteredLogger = (typeof RegisteredLogger)[keyof typeof RegisteredLogger];
26
+ declare const LogLevel: {
27
+ readonly DEBUG: "debug";
28
+ readonly INFO: "info";
29
+ readonly WARN: "warn";
30
+ readonly ERROR: "error";
31
+ readonly NONE: "silent";
32
+ };
33
+ type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
34
+ interface BaseLogMessage {
35
+ runId?: string;
36
+ msg: string;
37
+ level: LogLevel;
38
+ time: Date;
39
+ pid: number;
40
+ hostname: string;
41
+ name: string;
42
+ }
43
+ declare abstract class LoggerTransport extends Transform {
44
+ constructor(opts?: any);
45
+ listLogsByRunId(_args: {
46
+ runId: string;
47
+ fromDate?: Date;
48
+ toDate?: Date;
49
+ logLevel?: LogLevel;
50
+ filters?: Record<string, any>;
51
+ page?: number;
52
+ perPage?: number;
53
+ }): Promise<{
54
+ logs: BaseLogMessage[];
55
+ total: number;
56
+ page: number;
57
+ perPage: number;
58
+ hasMore: boolean;
59
+ }>;
60
+ listLogs(_args?: {
61
+ fromDate?: Date;
62
+ toDate?: Date;
63
+ logLevel?: LogLevel;
64
+ filters?: Record<string, any>;
65
+ returnPaginationResults?: boolean;
66
+ page?: number;
67
+ perPage?: number;
68
+ }): Promise<{
69
+ logs: BaseLogMessage[];
70
+ total: number;
71
+ page: number;
72
+ perPage: number;
73
+ hasMore: boolean;
74
+ }>;
75
+ }
76
+ declare const createCustomTransport: (stream: Transform, listLogs?: LoggerTransport["listLogs"], listLogsByRunId?: LoggerTransport["listLogsByRunId"]) => LoggerTransport;
77
+ interface IMastraLogger {
78
+ debug(message: string, ...args: any[]): void;
79
+ info(message: string, ...args: any[]): void;
80
+ warn(message: string, ...args: any[]): void;
81
+ error(message: string, ...args: any[]): void;
82
+ trackException(error: Error, metadata?: Record<string, unknown>): void;
83
+ getTransports(): Map<string, LoggerTransport>;
84
+ listLogs(_transportId: string, _params?: {
85
+ fromDate?: Date;
86
+ toDate?: Date;
87
+ logLevel?: LogLevel;
88
+ filters?: Record<string, any>;
89
+ page?: number;
90
+ perPage?: number;
91
+ }): Promise<{
92
+ logs: BaseLogMessage[];
93
+ total: number;
94
+ page: number;
95
+ perPage: number;
96
+ hasMore: boolean;
97
+ }>;
98
+ listLogsByRunId(_args: {
99
+ transportId: string;
100
+ runId: string;
101
+ fromDate?: Date;
102
+ toDate?: Date;
103
+ logLevel?: LogLevel;
104
+ filters?: Record<string, any>;
105
+ page?: number;
106
+ perPage?: number;
107
+ }): Promise<{
108
+ logs: BaseLogMessage[];
109
+ total: number;
110
+ page: number;
111
+ perPage: number;
112
+ hasMore: boolean;
113
+ }>;
114
+ }
115
+ declare abstract class MastraLogger implements IMastraLogger {
116
+ protected name: string;
117
+ protected level: LogLevel;
118
+ protected transports: Map<string, LoggerTransport>;
119
+ constructor(options?: {
120
+ name?: string;
121
+ level?: LogLevel;
122
+ transports?: Record<string, LoggerTransport>;
123
+ });
124
+ abstract debug(message: string, ...args: any[]): void;
125
+ abstract info(message: string, ...args: any[]): void;
126
+ abstract warn(message: string, ...args: any[]): void;
127
+ abstract error(message: string, ...args: any[]): void;
128
+ getTransports(): Map<string, LoggerTransport>;
129
+ trackException(_error: Error, _metadata?: Record<string, unknown>): void;
130
+ listLogs(transportId: string, params?: {
131
+ fromDate?: Date;
132
+ toDate?: Date;
133
+ logLevel?: LogLevel;
134
+ filters?: Record<string, any>;
135
+ page?: number;
136
+ perPage?: number;
137
+ }): Promise<{
138
+ logs: BaseLogMessage[];
139
+ total: number;
140
+ page: number;
141
+ perPage: number;
142
+ hasMore: boolean;
143
+ }>;
144
+ listLogsByRunId({ transportId, runId, fromDate, toDate, logLevel, filters, page, perPage }: {
145
+ transportId: string;
146
+ runId: string;
147
+ fromDate?: Date;
148
+ toDate?: Date;
149
+ logLevel?: LogLevel;
150
+ filters?: Record<string, any>;
151
+ page?: number;
152
+ perPage?: number;
153
+ }): Promise<{
154
+ logs: BaseLogMessage[];
155
+ total: number;
156
+ page: number;
157
+ perPage: number;
158
+ hasMore: boolean;
159
+ }>;
160
+ }
161
+ type LogFilterContext = {
162
+ component?: RegisteredLogger;
163
+ level: LogLevel;
164
+ message: string;
165
+ args: unknown[];
166
+ };
167
+ type LogFilter = (ctx: LogFilterContext) => boolean;
168
+ interface ConsoleLoggerOptions {
169
+ name?: string;
170
+ level?: LogLevel;
171
+ component?: RegisteredLogger;
172
+ filter?: LogFilter;
173
+ }
174
+ declare class ConsoleLogger extends MastraLogger {
175
+ protected component?: RegisteredLogger;
176
+ protected filter?: LogFilter;
177
+ constructor(options?: ConsoleLoggerOptions);
178
+ child(componentOrBindings: RegisteredLogger | Record<string, unknown>): ConsoleLogger;
179
+ private shouldLog;
180
+ private prefix;
181
+ debug(message: string, ...args: any[]): void;
182
+ info(message: string, ...args: any[]): void;
183
+ warn(message: string, ...args: any[]): void;
184
+ error(message: string, ...args: any[]): void;
185
+ listLogs(_transportId: string, _params?: {
186
+ fromDate?: Date;
187
+ toDate?: Date;
188
+ logLevel?: LogLevel;
189
+ filters?: Record<string, any>;
190
+ page?: number;
191
+ perPage?: number;
192
+ }): Promise<{
193
+ logs: never[];
194
+ total: number;
195
+ page: number;
196
+ perPage: number;
197
+ hasMore: boolean;
198
+ }>;
199
+ listLogsByRunId(_args: {
200
+ transportId: string;
201
+ runId: string;
202
+ fromDate?: Date;
203
+ toDate?: Date;
204
+ logLevel?: LogLevel;
205
+ filters?: Record<string, any>;
206
+ page?: number;
207
+ perPage?: number;
208
+ }): Promise<{
209
+ logs: never[];
210
+ total: number;
211
+ page: number;
212
+ perPage: number;
213
+ hasMore: boolean;
214
+ }>;
215
+ }
216
+ //#endregion
217
+ export { LogFilter as a, LoggerTransport as c, createCustomTransport as d, IMastraLogger as i, MastraLogger as l, ConsoleLogger as n, LogFilterContext as o, ConsoleLoggerOptions as r, LogLevel as s, BaseLogMessage as t, RegisteredLogger as u };
218
+ //# sourceMappingURL=index-S1lgaKO7.d.ts.map
@@ -1,6 +1,5 @@
1
- type RecordToTuple<T> = {
2
- [K in keyof T]: [K, T[K]];
3
- }[keyof T][];
1
+ //#region src/request-context/index.d.ts
2
+ type RecordToTuple<T> = { [K in keyof T]: [K, T[K]]; }[keyof T][];
4
3
  /**
5
4
  * Reserved key for setting resourceId from middleware.
6
5
  * When set in RequestContext, this takes precedence over client-provided values
@@ -46,112 +45,130 @@ declare const MASTRA_VERSIONS_KEY = "mastra__versions";
46
45
  */
47
46
  declare const MASTRA_AUTH_TOKEN_KEY = "mastra__authToken";
48
47
  type VersionSelector = {
49
- versionId: string;
48
+ versionId: string;
50
49
  } | {
51
- status: 'draft' | 'published';
50
+ status: 'draft' | 'published';
52
51
  };
53
52
  type VersionOverrides = {
54
- agents?: Record<string, VersionSelector>;
55
- /** Fallback status for sub-agents (and future primitives) without an explicit entry. */
56
- defaultStatus?: 'draft' | 'published';
53
+ agents?: Record<string, VersionSelector>;
54
+ /** Fallback status for sub-agents (and future primitives) without an explicit entry. */
55
+ defaultStatus?: 'draft' | 'published';
57
56
  };
58
57
  declare function mergeVersionOverrides(base?: VersionOverrides, overrides?: VersionOverrides): VersionOverrides | undefined;
59
58
  declare class RequestContext<Values extends Record<string, any> | unknown = unknown> {
60
- private registry;
61
- constructor(iterable?: Values extends Record<string, any> ? RecordToTuple<Partial<Values>> : Iterable<readonly [string, unknown]>);
62
- /**
63
- * set a value with strict typing if `Values` is a Record and the key exists in it.
64
- */
65
- set<K extends Values extends Record<string, any> ? keyof Values : string>(key: K, value: Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : never) : unknown): void;
66
- /**
67
- * Get a value with its type
68
- */
69
- get<K extends Values extends Record<string, any> ? keyof Values : string, R = Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : never) : unknown>(key: K): R;
70
- /**
71
- * Check if a key exists in the container
72
- */
73
- has<K extends Values extends Record<string, any> ? keyof Values : string>(key: K): boolean;
74
- /**
75
- * Delete a value by key
76
- */
77
- delete<K extends Values extends Record<string, any> ? keyof Values : string>(key: K): boolean;
78
- /**
79
- * Clear all values from the container
80
- */
81
- clear(): void;
82
- /**
83
- * Get all keys in the container
84
- */
85
- keys(): IterableIterator<Values extends Record<string, any> ? keyof Values : string>;
86
- /**
87
- * Get all values in the container
88
- */
89
- values(): IterableIterator<Values extends Record<string, any> ? Values[keyof Values] : unknown>;
90
- /**
91
- * Get all entries in the container.
92
- * Returns a discriminated union of tuples for proper type narrowing when iterating.
93
- */
94
- entries(): IterableIterator<Values extends Record<string, any> ? {
95
- [K in keyof Values]: [K, Values[K]];
96
- }[keyof Values] : [string, unknown]>;
97
- /**
98
- * Get the size of the container
99
- */
100
- size(): number;
101
- /**
102
- * Execute a function for each entry in the container.
103
- * The callback receives properly typed key-value pairs.
104
- */
105
- forEach<K extends Values extends Record<string, any> ? keyof Values : string>(callbackfn: (value: Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : unknown) : unknown, key: K, map: Map<string, unknown>) => void): void;
106
- /**
107
- * Custom JSON serialization method.
108
- * Converts the internal Map to a plain object for proper JSON serialization.
109
- * Non-serializable values (functions, symbols, RPC proxies, in-value
110
- * circular references, and values whose serialization re-enters this
111
- * `toJSON` via cross-context back-references) are skipped to prevent
112
- * serialization errors when storing to database.
113
- *
114
- * Reentry safety: if a stored value's `isSerializable` probe re-enters
115
- * `toJSON()` on this same instance (through a chain of RequestContexts
116
- * holding references to each other), we throw `CyclicRequestContextToJSONError`.
117
- * Inner `isSerializable` calls re-throw the marker; the outermost
118
- * `isSerializable` swallows it and filters the offending key, the same
119
- * way it filters in-value circular references today.
120
- */
121
- toJSON(): Record<string, any>;
122
- /**
123
- * Check if a value can be safely serialized to JSON.
124
- *
125
- * Re-throws `CyclicRequestContextToJSONError` when called from a nested
126
- * `toJSON()` (`_toJSONDepth > 1`), so the marker propagates up to the
127
- * outermost `toJSON()`'s `isSerializable`, which then swallows it and
128
- * filters the offending key. This is what lets the outermost call return
129
- * a clean JSON-safe dict for cross-context cycles.
130
- */
131
- private isSerializable;
132
- /**
133
- * Custom span serialization to prevent leaking internal state (like auth
134
- * tokens stored in the private `registry` Map) into observability spans.
135
- *
136
- * `deepClean` in `@mastra/observability` calls this method before falling
137
- * back to `Object.keys()` — which would walk the runtime-enumerable
138
- * `registry` field and serialize its raw Map entries (including any
139
- * bearer tokens) into exported spans.
140
- */
141
- serializeForSpan(): Record<string, unknown>;
142
- /**
143
- * Get all values as a typed object for destructuring.
144
- * Returns Record<string, any> when untyped, or the Values type when typed.
145
- *
146
- * @example
147
- * ```typescript
148
- * const ctx = new RequestContext<{ userId: string; apiKey: string }>();
149
- * ctx.set('userId', 'user-123');
150
- * ctx.set('apiKey', 'key-456');
151
- * const { userId, apiKey } = ctx.all;
152
- * ```
153
- */
154
- get all(): Values extends Record<string, any> ? Values : Record<string, any>;
59
+ private registry;
60
+ constructor(iterable?: Values extends Record<string, any> ? RecordToTuple<Partial<Values>> : Iterable<readonly [string, unknown]>);
61
+ /**
62
+ * set a value with strict typing if `Values` is a Record and the key exists in it.
63
+ */
64
+ set<K extends (Values extends Record<string, any> ? keyof Values : string)>(key: K, value: Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : never) : unknown): void;
65
+ /**
66
+ * Get a value with its type
67
+ */
68
+ get<K extends (Values extends Record<string, any> ? keyof Values : string), R = Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : never) : unknown>(key: K): R;
69
+ /**
70
+ * Check if a key exists in the container
71
+ */
72
+ has<K extends (Values extends Record<string, any> ? keyof Values : string)>(key: K): boolean;
73
+ /**
74
+ * Delete a value by key
75
+ */
76
+ delete<K extends (Values extends Record<string, any> ? keyof Values : string)>(key: K): boolean;
77
+ /**
78
+ * Clear all values from the container
79
+ */
80
+ clear(): void;
81
+ /**
82
+ * Get all keys in the container
83
+ */
84
+ keys(): IterableIterator<Values extends Record<string, any> ? keyof Values : string>;
85
+ /**
86
+ * Get all values in the container
87
+ */
88
+ values(): IterableIterator<Values extends Record<string, any> ? Values[keyof Values] : unknown>;
89
+ /**
90
+ * Get all entries in the container.
91
+ * Returns a discriminated union of tuples for proper type narrowing when iterating.
92
+ */
93
+ entries(): IterableIterator<Values extends Record<string, any> ? { [K in keyof Values]: [K, Values[K]]; }[keyof Values] : [string, unknown]>;
94
+ /**
95
+ * Get the size of the container
96
+ */
97
+ size(): number;
98
+ /**
99
+ * Execute a function for each entry in the container.
100
+ * The callback receives properly typed key-value pairs.
101
+ */
102
+ forEach<K extends (Values extends Record<string, any> ? keyof Values : string)>(callbackfn: (value: Values extends Record<string, any> ? (K extends keyof Values ? Values[K] : unknown) : unknown, key: K, map: Map<string, unknown>) => void): void;
103
+ /**
104
+ * Custom JSON serialization method.
105
+ * Converts the internal Map to a plain object for proper JSON serialization.
106
+ * Non-serializable values (functions, symbols, RPC proxies, in-value
107
+ * circular references, and values whose serialization re-enters this
108
+ * `toJSON` via cross-context back-references) are skipped to prevent
109
+ * serialization errors when storing to database.
110
+ *
111
+ * Reentry safety: if a stored value's `isSerializable` probe re-enters
112
+ * `toJSON()` on this same instance (through a chain of RequestContexts
113
+ * holding references to each other), we throw `CyclicRequestContextToJSONError`.
114
+ * Inner `isSerializable` calls re-throw the marker; the outermost
115
+ * `isSerializable` swallows it and filters the offending key, the same
116
+ * way it filters in-value circular references today.
117
+ */
118
+ toJSON(): Record<string, any>;
119
+ /**
120
+ * Check if a value can be safely serialized to JSON.
121
+ *
122
+ * The probe is budgeted (see `SERIALIZATION_PROBE_BUDGET`): a value whose
123
+ * serialization would visit an unbounded number of nodes — an acyclic
124
+ * graph with layered shared references expands as 2^depth — is treated as
125
+ * non-serializable and filtered instead of blocking the event loop for
126
+ * the full expansion. The budget is shared across nested `RequestContext`
127
+ * probes within one outermost probe (a nested `toJSON()` runs before the
128
+ * replacer sees its result), so the bound holds even when the graph reaches
129
+ * nested contexts through many shared paths.
130
+ *
131
+ * Re-throws `CyclicRequestContextToJSONError` when called from a nested
132
+ * `toJSON()` (`_toJSONDepth > 1`), so the marker propagates up to the
133
+ * outermost `toJSON()`'s `isSerializable`, which then swallows it and
134
+ * filters the offending key. This is what lets the outermost call return
135
+ * a clean JSON-safe dict for cross-context cycles.
136
+ */
137
+ private isSerializable;
138
+ /**
139
+ * Custom span serialization. Exposes the registry *entries* (never the
140
+ * instance's own private fields) so `deepClean` in `@mastra/observability`
141
+ * doesn't walk the runtime-enumerable `registry` Map — which would
142
+ * serialize its raw entries (including bearer tokens) into exported spans.
143
+ *
144
+ * Per stored value:
145
+ * - The framework-managed auth token is redacted by key.
146
+ * - Primitives are returned as-is.
147
+ * - Plain objects and arrays are returned by reference so the downstream
148
+ * `deepClean` walks and bounds them — this keeps nested request-context
149
+ * data visible in traces instead of collapsing it to `[object]`.
150
+ * - Every other type (class instances, functions, Map/Set, Date, etc.) is
151
+ * collapsed to `[${typeof value}]` rather than walked, so a class's
152
+ * internals never reach the trace serializer.
153
+ *
154
+ * The plain objects/arrays passed through here MUST still be bounded by a
155
+ * downstream `deepClean` before export.
156
+ */
157
+ serializeForSpan(): Record<string, unknown>;
158
+ /**
159
+ * Get all values as a typed object for destructuring.
160
+ * Returns Record<string, any> when untyped, or the Values type when typed.
161
+ *
162
+ * @example
163
+ * ```typescript
164
+ * const ctx = new RequestContext<{ userId: string; apiKey: string }>();
165
+ * ctx.set('userId', 'user-123');
166
+ * ctx.set('apiKey', 'key-456');
167
+ * const { userId, apiKey } = ctx.all;
168
+ * ```
169
+ */
170
+ get all(): Values extends Record<string, any> ? Values : Record<string, any>;
155
171
  }
156
-
157
- export { MASTRA_AUTH_TOKEN_KEY, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, MASTRA_VERSIONS_KEY, RequestContext, type VersionOverrides, type VersionSelector, mergeVersionOverrides };
172
+ //#endregion
173
+ export { MASTRA_AUTH_TOKEN_KEY, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, MASTRA_VERSIONS_KEY, RequestContext, VersionOverrides, VersionSelector, mergeVersionOverrides };
174
+ //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,5 @@
1
+ //#region src/types/index.d.ts
1
2
  type ToolsInput = Record<string, any>;
2
-
3
- export type { ToolsInput };
3
+ //#endregion
4
+ export { ToolsInput };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -3,7 +3,7 @@ name: mastra-voice-google
3
3
  description: Documentation for @mastra/voice-google. Use when working with @mastra/voice-google APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/voice-google"
6
- version: "0.14.0"
6
+ version: "0.14.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -14,13 +14,13 @@ Use this skill whenever you are working with @mastra/voice-google to obtain the
14
14
 
15
15
  Read the individual reference documents for detailed explanations and code examples.
16
16
 
17
- ### Docs
17
+ ### Guides
18
18
 
19
- - [Voice in Mastra](references/docs-voice-overview.md) - Overview of voice capabilities in Mastra, including text-to-speech, speech-to-text, and real-time speech-to-speech interactions.
19
+ - [Voice in Mastra](references/guides-voice-overview.md) - Overview of voice capabilities in Mastra, including text-to-speech, speech-to-text, and real-time speech-to-speech interactions.
20
20
 
21
- ### Reference
21
+ ### Integrations
22
22
 
23
- - [Reference: Google](references/reference-voice-google.md) - Documentation for the Google Voice implementation, providing text-to-speech and speech-to-text capabilities with support for both API key and Vertex AI authentication.
23
+ - [Google](references/integrations-voice-google.md) - Documentation for the Google Voice implementation, providing text-to-speech and speech-to-text capabilities with support for both API key and Vertex AI authentication.
24
24
 
25
25
 
26
26
  Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.14.0",
2
+ "version": "0.14.1",
3
3
  "package": "@mastra/voice-google",
4
4
  "exports": {},
5
5
  "modules": {}