@mastra/voice-speechify 0.14.0 → 0.14.1-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/LICENSE.md +6 -4
- package/dist/_types/@internal_voice/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +19 -220
- package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/base/index.d.ts +27 -27
- package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/index-Biaf3BmX.d.ts +319 -0
- package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts +167 -105
- package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/types/index.d.ts +4 -2
- package/dist/_types/@internal_voice/dist/voice/composite-voice.d.ts +1 -1
- package/dist/docs/SKILL.md +4 -4
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/{reference-voice-speechify.md → integrations-voice-speechify.md} +2 -0
- package/dist/docs/references/{docs-voice-overview.md → reference-voice-overview.md} +88 -132
- package/dist/index.cjs +1160 -1060
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1159 -1058
- package/dist/index.js.map +1 -1
- package/dist/voices.d.ts +2 -2
- package/dist/voices.d.ts.map +1 -1
- package/package.json +13 -13
- package/CHANGELOG.md +0 -1866
- package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/logger/index.d.ts +0 -217
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { Transform } from "stream";
|
|
2
|
+
//#region src/logger/adapter.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* OpenTelemetry-compatible trace correlation fields, injected at the top
|
|
5
|
+
* level of a logger's native record.
|
|
6
|
+
*
|
|
7
|
+
* Field names are part of the platform contract (snake_case, W3C formats):
|
|
8
|
+
* external consumers (e.g. the Studio logs view reading Railway stdout)
|
|
9
|
+
* parse structured log lines and look for exactly these keys.
|
|
10
|
+
*/
|
|
11
|
+
interface TraceFields {
|
|
12
|
+
/** 32-char lowercase hex W3C trace id */
|
|
13
|
+
trace_id: string;
|
|
14
|
+
/**
|
|
15
|
+
* 16-char lowercase hex W3C span id.
|
|
16
|
+
*
|
|
17
|
+
* Optional, and omitted rather than emitted empty: the active span may be
|
|
18
|
+
* one observability never exports (an internal span, or one dropped by
|
|
19
|
+
* `excludeSpanTypes`), leaving no span id a consumer could look up. The
|
|
20
|
+
* trace is still addressable in that case, so the line keeps `trace_id` and
|
|
21
|
+
* drops only this field. Consumers must treat `span_id` as possibly absent.
|
|
22
|
+
*/
|
|
23
|
+
span_id?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Destination for log records derived from the logger's native record,
|
|
27
|
+
* exported to Mastra observability. Structurally compatible with
|
|
28
|
+
* `LoggerContext` from `@mastra/core/observability`.
|
|
29
|
+
*/
|
|
30
|
+
interface AdapterLogSink {
|
|
31
|
+
debug(message: string, data?: Record<string, unknown>): void;
|
|
32
|
+
info(message: string, data?: Record<string, unknown>): void;
|
|
33
|
+
warn(message: string, data?: Record<string, unknown>): void;
|
|
34
|
+
error(message: string, data?: Record<string, unknown>): void;
|
|
35
|
+
}
|
|
36
|
+
interface LoggerAdapterOptions {
|
|
37
|
+
/** Inject trace_id/span_id into the logger's native records. */
|
|
38
|
+
correlation: boolean;
|
|
39
|
+
/** Export records derived from the native record to Mastra observability. */
|
|
40
|
+
export: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Context handed to an adaptable logger by Mastra when observability is
|
|
44
|
+
* wired up. All members are safe to call on every log call (synchronous,
|
|
45
|
+
* never throw).
|
|
46
|
+
*/
|
|
47
|
+
interface LoggerAdapterContext {
|
|
48
|
+
/**
|
|
49
|
+
* Resolve correlation fields for the currently active span, or undefined
|
|
50
|
+
* when no span is active (in which case no trace fields are added).
|
|
51
|
+
*/
|
|
52
|
+
resolveTraceFields: () => TraceFields | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the observability log sink at call time. Returns the
|
|
55
|
+
* span-correlated sink when a span is active, the global sink otherwise,
|
|
56
|
+
* and undefined when export is disabled or observability is not
|
|
57
|
+
* initialized. Records must still be written to the native destination
|
|
58
|
+
* regardless.
|
|
59
|
+
*/
|
|
60
|
+
getLogSink: () => AdapterLogSink | undefined;
|
|
61
|
+
options: LoggerAdapterOptions;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Capability marker a logger implements to opt into native trace
|
|
65
|
+
* correlation and observability export. When a configured logger implements
|
|
66
|
+
* this, Mastra attaches observability directly instead of wrapping the
|
|
67
|
+
* logger in the deprecated `DualLogger`.
|
|
68
|
+
*/
|
|
69
|
+
interface AdaptableLogger extends IMastraLogger {
|
|
70
|
+
__attachObservability(ctx: LoggerAdapterContext): void;
|
|
71
|
+
/**
|
|
72
|
+
* Stable identity for the attachment target. Loggers whose adapter context
|
|
73
|
+
* lives in state shared across a root/child family (e.g. PinoLogger's
|
|
74
|
+
* mixin ref cell) return that shared object, so attaching any family
|
|
75
|
+
* member is recognized as re-attaching the whole family. Defaults to the
|
|
76
|
+
* logger instance itself when absent.
|
|
77
|
+
*/
|
|
78
|
+
__observabilityAttachmentKey?(): object;
|
|
79
|
+
}
|
|
80
|
+
declare function isAdaptableLogger(logger: IMastraLogger): logger is AdaptableLogger;
|
|
81
|
+
/**
|
|
82
|
+
* Export a tracked exception through the adapter sink, mirroring the
|
|
83
|
+
* DualLogger dual-write shape (`errorId`/`domain`/`category`/`details`/`cause`
|
|
84
|
+
* when present on a MastraError-like value). Never throws into the caller.
|
|
85
|
+
*/
|
|
86
|
+
declare function exportTrackedException(ctx: LoggerAdapterContext | undefined, error: Error, metadata?: Record<string, unknown>): void;
|
|
87
|
+
/**
|
|
88
|
+
* Adapt IMastraLogger's variadic args into the structured `data` payload of
|
|
89
|
+
* an exported log record. Extracts the first plain object as data,
|
|
90
|
+
* serializes an Error arg, and collects remaining primitives under `args`
|
|
91
|
+
* so the derived record preserves all context from the native call.
|
|
92
|
+
*/
|
|
93
|
+
declare function buildLogRecordData(args: unknown[]): Record<string, unknown> | undefined;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/logger/index.d.ts
|
|
96
|
+
declare const RegisteredLogger: {
|
|
97
|
+
readonly AGENT: 'AGENT';
|
|
98
|
+
readonly OBSERVABILITY: 'OBSERVABILITY';
|
|
99
|
+
readonly AUTH: 'AUTH';
|
|
100
|
+
readonly BROWSER: 'BROWSER';
|
|
101
|
+
readonly NETWORK: 'NETWORK';
|
|
102
|
+
readonly WORKFLOW: 'WORKFLOW';
|
|
103
|
+
readonly LLM: 'LLM';
|
|
104
|
+
readonly TTS: 'TTS';
|
|
105
|
+
readonly VOICE: 'VOICE';
|
|
106
|
+
readonly VECTOR: 'VECTOR';
|
|
107
|
+
readonly BUNDLER: 'BUNDLER';
|
|
108
|
+
readonly DEPLOYER: 'DEPLOYER';
|
|
109
|
+
readonly MEMORY: 'MEMORY';
|
|
110
|
+
readonly STORAGE: 'STORAGE';
|
|
111
|
+
readonly EMBEDDINGS: 'EMBEDDINGS';
|
|
112
|
+
readonly MCP_SERVER: 'MCP_SERVER';
|
|
113
|
+
readonly SERVER_CACHE: 'SERVER_CACHE';
|
|
114
|
+
readonly SERVER: 'SERVER';
|
|
115
|
+
readonly WORKSPACE: 'WORKSPACE';
|
|
116
|
+
readonly CHANNEL: 'CHANNEL';
|
|
117
|
+
};
|
|
118
|
+
type RegisteredLogger = (typeof RegisteredLogger)[keyof typeof RegisteredLogger];
|
|
119
|
+
declare const LogLevel: {
|
|
120
|
+
readonly DEBUG: 'debug';
|
|
121
|
+
readonly INFO: 'info';
|
|
122
|
+
readonly WARN: 'warn';
|
|
123
|
+
readonly ERROR: 'error';
|
|
124
|
+
readonly NONE: 'silent';
|
|
125
|
+
};
|
|
126
|
+
type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
127
|
+
interface BaseLogMessage {
|
|
128
|
+
runId?: string;
|
|
129
|
+
msg: string;
|
|
130
|
+
level: LogLevel;
|
|
131
|
+
time: Date;
|
|
132
|
+
pid: number;
|
|
133
|
+
hostname: string;
|
|
134
|
+
name: string;
|
|
135
|
+
}
|
|
136
|
+
declare abstract class LoggerTransport extends Transform {
|
|
137
|
+
constructor(opts?: any);
|
|
138
|
+
listLogsByRunId(_args: {
|
|
139
|
+
runId: string;
|
|
140
|
+
fromDate?: Date;
|
|
141
|
+
toDate?: Date;
|
|
142
|
+
logLevel?: LogLevel;
|
|
143
|
+
filters?: Record<string, any>;
|
|
144
|
+
page?: number;
|
|
145
|
+
perPage?: number;
|
|
146
|
+
}): Promise<{
|
|
147
|
+
logs: BaseLogMessage[];
|
|
148
|
+
total: number;
|
|
149
|
+
page: number;
|
|
150
|
+
perPage: number;
|
|
151
|
+
hasMore: boolean;
|
|
152
|
+
}>;
|
|
153
|
+
listLogs(_args?: {
|
|
154
|
+
fromDate?: Date;
|
|
155
|
+
toDate?: Date;
|
|
156
|
+
logLevel?: LogLevel;
|
|
157
|
+
filters?: Record<string, any>;
|
|
158
|
+
returnPaginationResults?: boolean;
|
|
159
|
+
page?: number;
|
|
160
|
+
perPage?: number;
|
|
161
|
+
}): Promise<{
|
|
162
|
+
logs: BaseLogMessage[];
|
|
163
|
+
total: number;
|
|
164
|
+
page: number;
|
|
165
|
+
perPage: number;
|
|
166
|
+
hasMore: boolean;
|
|
167
|
+
}>;
|
|
168
|
+
}
|
|
169
|
+
declare const createCustomTransport: (stream: Transform, listLogs?: LoggerTransport['listLogs'], listLogsByRunId?: LoggerTransport['listLogsByRunId']) => LoggerTransport;
|
|
170
|
+
interface IMastraLogger {
|
|
171
|
+
debug(message: string, ...args: any[]): void;
|
|
172
|
+
info(message: string, ...args: any[]): void;
|
|
173
|
+
warn(message: string, ...args: any[]): void;
|
|
174
|
+
error(message: string, ...args: any[]): void;
|
|
175
|
+
trackException(error: Error, metadata?: Record<string, unknown>): void;
|
|
176
|
+
getTransports(): Map<string, LoggerTransport>;
|
|
177
|
+
listLogs(_transportId: string, _params?: {
|
|
178
|
+
fromDate?: Date;
|
|
179
|
+
toDate?: Date;
|
|
180
|
+
logLevel?: LogLevel;
|
|
181
|
+
filters?: Record<string, any>;
|
|
182
|
+
page?: number;
|
|
183
|
+
perPage?: number;
|
|
184
|
+
}): Promise<{
|
|
185
|
+
logs: BaseLogMessage[];
|
|
186
|
+
total: number;
|
|
187
|
+
page: number;
|
|
188
|
+
perPage: number;
|
|
189
|
+
hasMore: boolean;
|
|
190
|
+
}>;
|
|
191
|
+
listLogsByRunId(_args: {
|
|
192
|
+
transportId: string;
|
|
193
|
+
runId: string;
|
|
194
|
+
fromDate?: Date;
|
|
195
|
+
toDate?: Date;
|
|
196
|
+
logLevel?: LogLevel;
|
|
197
|
+
filters?: Record<string, any>;
|
|
198
|
+
page?: number;
|
|
199
|
+
perPage?: number;
|
|
200
|
+
}): Promise<{
|
|
201
|
+
logs: BaseLogMessage[];
|
|
202
|
+
total: number;
|
|
203
|
+
page: number;
|
|
204
|
+
perPage: number;
|
|
205
|
+
hasMore: boolean;
|
|
206
|
+
}>;
|
|
207
|
+
}
|
|
208
|
+
declare abstract class MastraLogger implements IMastraLogger {
|
|
209
|
+
protected name: string;
|
|
210
|
+
protected level: LogLevel;
|
|
211
|
+
protected transports: Map<string, LoggerTransport>;
|
|
212
|
+
constructor(options?: {
|
|
213
|
+
name?: string;
|
|
214
|
+
level?: LogLevel;
|
|
215
|
+
transports?: Record<string, LoggerTransport>;
|
|
216
|
+
});
|
|
217
|
+
abstract debug(message: string, ...args: any[]): void;
|
|
218
|
+
abstract info(message: string, ...args: any[]): void;
|
|
219
|
+
abstract warn(message: string, ...args: any[]): void;
|
|
220
|
+
abstract error(message: string, ...args: any[]): void;
|
|
221
|
+
getTransports(): Map<string, LoggerTransport>;
|
|
222
|
+
trackException(_error: Error, _metadata?: Record<string, unknown>): void;
|
|
223
|
+
listLogs(transportId: string, params?: {
|
|
224
|
+
fromDate?: Date;
|
|
225
|
+
toDate?: Date;
|
|
226
|
+
logLevel?: LogLevel;
|
|
227
|
+
filters?: Record<string, any>;
|
|
228
|
+
page?: number;
|
|
229
|
+
perPage?: number;
|
|
230
|
+
}): Promise<{
|
|
231
|
+
logs: BaseLogMessage[];
|
|
232
|
+
total: number;
|
|
233
|
+
page: number;
|
|
234
|
+
perPage: number;
|
|
235
|
+
hasMore: boolean;
|
|
236
|
+
}>;
|
|
237
|
+
listLogsByRunId({ transportId, runId, fromDate, toDate, logLevel, filters, page, perPage }: {
|
|
238
|
+
transportId: string;
|
|
239
|
+
runId: string;
|
|
240
|
+
fromDate?: Date;
|
|
241
|
+
toDate?: Date;
|
|
242
|
+
logLevel?: LogLevel;
|
|
243
|
+
filters?: Record<string, any>;
|
|
244
|
+
page?: number;
|
|
245
|
+
perPage?: number;
|
|
246
|
+
}): Promise<{
|
|
247
|
+
logs: BaseLogMessage[];
|
|
248
|
+
total: number;
|
|
249
|
+
page: number;
|
|
250
|
+
perPage: number;
|
|
251
|
+
hasMore: boolean;
|
|
252
|
+
}>;
|
|
253
|
+
}
|
|
254
|
+
type LogFilterContext = {
|
|
255
|
+
component?: RegisteredLogger;
|
|
256
|
+
level: LogLevel;
|
|
257
|
+
message: string;
|
|
258
|
+
args: unknown[];
|
|
259
|
+
};
|
|
260
|
+
type LogFilter = (ctx: LogFilterContext) => boolean;
|
|
261
|
+
interface ConsoleLoggerOptions {
|
|
262
|
+
name?: string;
|
|
263
|
+
level?: LogLevel;
|
|
264
|
+
component?: RegisteredLogger;
|
|
265
|
+
filter?: LogFilter;
|
|
266
|
+
}
|
|
267
|
+
declare class ConsoleLogger extends MastraLogger {
|
|
268
|
+
#private;
|
|
269
|
+
protected component?: RegisteredLogger;
|
|
270
|
+
protected filter?: LogFilter;
|
|
271
|
+
constructor(options?: ConsoleLoggerOptions);
|
|
272
|
+
/**
|
|
273
|
+
* Adapter hook (see `AdaptableLogger`): enables native trace correlation
|
|
274
|
+
* (trace_id/span_id appended to console output) and observability export
|
|
275
|
+
* derived from the same record. Called by Mastra during setup.
|
|
276
|
+
*/
|
|
277
|
+
__attachObservability(ctx: LoggerAdapterContext): void;
|
|
278
|
+
child(componentOrBindings: RegisteredLogger | Record<string, unknown>): ConsoleLogger;
|
|
279
|
+
private shouldLog;
|
|
280
|
+
private prefix;
|
|
281
|
+
debug(message: string, ...args: any[]): void;
|
|
282
|
+
info(message: string, ...args: any[]): void;
|
|
283
|
+
warn(message: string, ...args: any[]): void;
|
|
284
|
+
error(message: string, ...args: any[]): void;
|
|
285
|
+
trackException(error: Error, metadata?: Record<string, unknown>): void;
|
|
286
|
+
listLogs(_transportId: string, _params?: {
|
|
287
|
+
fromDate?: Date;
|
|
288
|
+
toDate?: Date;
|
|
289
|
+
logLevel?: LogLevel;
|
|
290
|
+
filters?: Record<string, any>;
|
|
291
|
+
page?: number;
|
|
292
|
+
perPage?: number;
|
|
293
|
+
}): Promise<{
|
|
294
|
+
logs: never[];
|
|
295
|
+
total: number;
|
|
296
|
+
page: number;
|
|
297
|
+
perPage: number;
|
|
298
|
+
hasMore: boolean;
|
|
299
|
+
}>;
|
|
300
|
+
listLogsByRunId(_args: {
|
|
301
|
+
transportId: string;
|
|
302
|
+
runId: string;
|
|
303
|
+
fromDate?: Date;
|
|
304
|
+
toDate?: Date;
|
|
305
|
+
logLevel?: LogLevel;
|
|
306
|
+
filters?: Record<string, any>;
|
|
307
|
+
page?: number;
|
|
308
|
+
perPage?: number;
|
|
309
|
+
}): Promise<{
|
|
310
|
+
logs: never[];
|
|
311
|
+
total: number;
|
|
312
|
+
page: number;
|
|
313
|
+
perPage: number;
|
|
314
|
+
hasMore: boolean;
|
|
315
|
+
}>;
|
|
316
|
+
}
|
|
317
|
+
//#endregion
|
|
318
|
+
export { buildLogRecordData as _, LogFilter as a, LoggerTransport as c, createCustomTransport as d, AdaptableLogger as f, TraceFields as g, LoggerAdapterOptions as h, IMastraLogger as i, MastraLogger as l, LoggerAdapterContext as m, ConsoleLogger as n, LogFilterContext as o, AdapterLogSink as p, ConsoleLoggerOptions as r, LogLevel as s, BaseLogMessage as t, RegisteredLogger as u, exportTrackedException as v, isAdaptableLogger as y };
|
|
319
|
+
//# sourceMappingURL=index-Biaf3BmX.d.ts.map
|
package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
@@ -45,113 +44,176 @@ declare const MASTRA_VERSIONS_KEY = "mastra__versions";
|
|
|
45
44
|
* that require the same auth as the Mastra server itself.
|
|
46
45
|
*/
|
|
47
46
|
declare const MASTRA_AUTH_TOKEN_KEY = "mastra__authToken";
|
|
47
|
+
/**
|
|
48
|
+
* Reserved key carrying a delegating agent's `MastraMemory` into a delegated
|
|
49
|
+
* run, so a sub-agent without its own memory can persist that run's transcript
|
|
50
|
+
* without the shared sub-agent instance being modified. The value is
|
|
51
|
+
* `{ agentId, memory }` and only the named agent reads it.
|
|
52
|
+
*
|
|
53
|
+
* Holds a live class instance, so it is deliberately run-scoped: it is excluded
|
|
54
|
+
* from the durable request-context snapshot and is not copied into further
|
|
55
|
+
* nested delegated runs. Internal to delegation — do not set it yourself.
|
|
56
|
+
*/
|
|
57
|
+
declare const MASTRA_INHERITED_MEMORY_KEY = "mastra__inheritedMemory";
|
|
48
58
|
type VersionSelector = {
|
|
49
|
-
|
|
59
|
+
versionId: string;
|
|
50
60
|
} | {
|
|
51
|
-
|
|
61
|
+
status: 'draft' | 'published';
|
|
52
62
|
};
|
|
53
63
|
type VersionOverrides = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
agents?: Record<string, VersionSelector>;
|
|
65
|
+
/** Fallback status for sub-agents (and future primitives) without an explicit entry. */
|
|
66
|
+
defaultStatus?: 'draft' | 'published';
|
|
57
67
|
};
|
|
58
68
|
declare function mergeVersionOverrides(base?: VersionOverrides, overrides?: VersionOverrides): VersionOverrides | undefined;
|
|
59
69
|
declare class RequestContext<Values extends Record<string, any> | unknown = unknown> {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
70
|
+
private registry;
|
|
71
|
+
constructor(iterable?: Values extends Record<string, any> ? RecordToTuple<Partial<Values>> : Iterable<readonly [string, unknown]>);
|
|
72
|
+
/**
|
|
73
|
+
* set a value with strict typing if `Values` is a Record and the key exists in it.
|
|
74
|
+
*
|
|
75
|
+
* Declared schema keys stay strictly typed. For runtime-only keys that are not part of
|
|
76
|
+
* `Values` (for example reserved middleware keys), use {@link setRaw}.
|
|
77
|
+
*/
|
|
78
|
+
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;
|
|
79
|
+
/**
|
|
80
|
+
* Set a runtime-only key that is not part of the declared `Values` schema.
|
|
81
|
+
*
|
|
82
|
+
* The runtime store is an open map: schema validation checks declared keys and
|
|
83
|
+
* passes undeclared keys through. Use this when writing infrastructure keys
|
|
84
|
+
* (for example `mastra__resourceId`) or other values that intentionally omit
|
|
85
|
+
* from `requestContextSchema`.
|
|
86
|
+
*/
|
|
87
|
+
setRaw(key: string, value: unknown): void;
|
|
88
|
+
/**
|
|
89
|
+
* Get a value with its type
|
|
90
|
+
*
|
|
91
|
+
* Declared schema keys stay strictly typed. For runtime-only keys that are not part of
|
|
92
|
+
* `Values` (for example reserved middleware keys), use {@link getRaw}.
|
|
93
|
+
*/
|
|
94
|
+
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;
|
|
95
|
+
/**
|
|
96
|
+
* Get a runtime-only key that is not part of the declared `Values` schema.
|
|
97
|
+
*
|
|
98
|
+
* Returns `unknown` because the schema does not describe these keys — narrow
|
|
99
|
+
* the result at the call site.
|
|
100
|
+
*/
|
|
101
|
+
getRaw(key: string): unknown;
|
|
102
|
+
/**
|
|
103
|
+
* Check if a key exists in the container
|
|
104
|
+
*
|
|
105
|
+
* Declared schema keys stay strictly typed. For runtime-only keys, use {@link hasRaw}.
|
|
106
|
+
*/
|
|
107
|
+
has<K extends (Values extends Record<string, any> ? keyof Values : string)>(key: K): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Check whether a runtime-only key exists in the open map.
|
|
110
|
+
*/
|
|
111
|
+
hasRaw(key: string): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Delete a value by key
|
|
114
|
+
*
|
|
115
|
+
* Declared schema keys stay strictly typed. For runtime-only keys, use {@link deleteRaw}.
|
|
116
|
+
*/
|
|
117
|
+
delete<K extends (Values extends Record<string, any> ? keyof Values : string)>(key: K): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Delete a runtime-only key from the open map.
|
|
120
|
+
*/
|
|
121
|
+
deleteRaw(key: string): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Clear all values from the container
|
|
124
|
+
*/
|
|
125
|
+
clear(): void;
|
|
126
|
+
/**
|
|
127
|
+
* Get all keys in the container
|
|
128
|
+
*/
|
|
129
|
+
keys(): IterableIterator<Values extends Record<string, any> ? keyof Values : string>;
|
|
130
|
+
/**
|
|
131
|
+
* Get all values in the container
|
|
132
|
+
*/
|
|
133
|
+
values(): IterableIterator<Values extends Record<string, any> ? Values[keyof Values] : unknown>;
|
|
134
|
+
/**
|
|
135
|
+
* Get all entries in the container.
|
|
136
|
+
* Returns a discriminated union of tuples for proper type narrowing when iterating.
|
|
137
|
+
*/
|
|
138
|
+
entries(): IterableIterator<Values extends Record<string, any> ? { [K in keyof Values]: [K, Values[K]]; }[keyof Values] : [string, unknown]>;
|
|
139
|
+
/**
|
|
140
|
+
* Get the size of the container
|
|
141
|
+
*/
|
|
142
|
+
size(): number;
|
|
143
|
+
/**
|
|
144
|
+
* Execute a function for each entry in the container.
|
|
145
|
+
* The callback receives properly typed key-value pairs.
|
|
146
|
+
*/
|
|
147
|
+
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;
|
|
148
|
+
/**
|
|
149
|
+
* Custom JSON serialization method.
|
|
150
|
+
* Converts the internal Map to a plain object for proper JSON serialization.
|
|
151
|
+
* Non-serializable values (functions, symbols, RPC proxies, in-value
|
|
152
|
+
* circular references, and values whose serialization re-enters this
|
|
153
|
+
* `toJSON` via cross-context back-references) are skipped to prevent
|
|
154
|
+
* serialization errors when storing to database.
|
|
155
|
+
*
|
|
156
|
+
* Reentry safety: if a stored value's `isSerializable` probe re-enters
|
|
157
|
+
* `toJSON()` on this same instance (through a chain of RequestContexts
|
|
158
|
+
* holding references to each other), we throw `CyclicRequestContextToJSONError`.
|
|
159
|
+
* Inner `isSerializable` calls re-throw the marker; the outermost
|
|
160
|
+
* `isSerializable` swallows it and filters the offending key, the same
|
|
161
|
+
* way it filters in-value circular references today.
|
|
162
|
+
*/
|
|
163
|
+
toJSON(): Record<string, any>;
|
|
164
|
+
/**
|
|
165
|
+
* Check if a value can be safely serialized to JSON.
|
|
166
|
+
*
|
|
167
|
+
* The probe is budgeted (see `SERIALIZATION_PROBE_BUDGET`): a value whose
|
|
168
|
+
* serialization would visit an unbounded number of nodes — an acyclic
|
|
169
|
+
* graph with layered shared references expands as 2^depth — is treated as
|
|
170
|
+
* non-serializable and filtered instead of blocking the event loop for
|
|
171
|
+
* the full expansion. The budget is shared across nested `RequestContext`
|
|
172
|
+
* probes within one outermost probe (a nested `toJSON()` runs before the
|
|
173
|
+
* replacer sees its result), so the bound holds even when the graph reaches
|
|
174
|
+
* nested contexts through many shared paths.
|
|
175
|
+
*
|
|
176
|
+
* Re-throws `CyclicRequestContextToJSONError` when called from a nested
|
|
177
|
+
* `toJSON()` (`_toJSONDepth > 1`), so the marker propagates up to the
|
|
178
|
+
* outermost `toJSON()`'s `isSerializable`, which then swallows it and
|
|
179
|
+
* filters the offending key. This is what lets the outermost call return
|
|
180
|
+
* a clean JSON-safe dict for cross-context cycles.
|
|
181
|
+
*/
|
|
182
|
+
private isSerializable;
|
|
183
|
+
/**
|
|
184
|
+
* Custom span serialization. Exposes the registry *entries* (never the
|
|
185
|
+
* instance's own private fields) so `deepClean` in `@mastra/observability`
|
|
186
|
+
* doesn't walk the runtime-enumerable `registry` Map — which would
|
|
187
|
+
* serialize its raw entries (including bearer tokens) into exported spans.
|
|
188
|
+
*
|
|
189
|
+
* Per stored value:
|
|
190
|
+
* - The framework-managed auth token is redacted by key.
|
|
191
|
+
* - Primitives are returned as-is.
|
|
192
|
+
* - Plain objects and arrays are returned by reference so the downstream
|
|
193
|
+
* `deepClean` walks and bounds them — this keeps nested request-context
|
|
194
|
+
* data visible in traces instead of collapsing it to `[object]`.
|
|
195
|
+
* - Every other type (class instances, functions, Map/Set, Date, etc.) is
|
|
196
|
+
* collapsed to `[${typeof value}]` rather than walked, so a class's
|
|
197
|
+
* internals never reach the trace serializer.
|
|
198
|
+
*
|
|
199
|
+
* The plain objects/arrays passed through here MUST still be bounded by a
|
|
200
|
+
* downstream `deepClean` before export.
|
|
201
|
+
*/
|
|
202
|
+
serializeForSpan(): Record<string, unknown>;
|
|
203
|
+
/**
|
|
204
|
+
* Get all values as a typed object for destructuring.
|
|
205
|
+
* Returns Record<string, any> when untyped, or the Values type when typed.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* const ctx = new RequestContext<{ userId: string; apiKey: string }>();
|
|
210
|
+
* ctx.set('userId', 'user-123');
|
|
211
|
+
* ctx.set('apiKey', 'key-456');
|
|
212
|
+
* const { userId, apiKey } = ctx.all;
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
get all(): Values extends Record<string, any> ? Values : Record<string, any>;
|
|
155
216
|
}
|
|
156
|
-
|
|
157
|
-
export { MASTRA_AUTH_TOKEN_KEY, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, MASTRA_VERSIONS_KEY, RequestContext,
|
|
217
|
+
//#endregion
|
|
218
|
+
export { MASTRA_AUTH_TOKEN_KEY, MASTRA_INHERITED_MEMORY_KEY, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, MASTRA_VERSIONS_KEY, RequestContext, VersionOverrides, VersionSelector, mergeVersionOverrides };
|
|
219
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -20,7 +20,7 @@ export declare class CompositeVoice extends MastraVoice<unknown, unknown, unknow
|
|
|
20
20
|
speak(input: string | NodeJS.ReadableStream, options?: {
|
|
21
21
|
speaker?: string;
|
|
22
22
|
} & any): Promise<NodeJS.ReadableStream | void>;
|
|
23
|
-
listen(audioStream: NodeJS.ReadableStream, options?: any): Promise<
|
|
23
|
+
listen(audioStream: NodeJS.ReadableStream, options?: any): Promise<void | string | NodeJS.ReadableStream>;
|
|
24
24
|
getSpeakers(): Promise<{
|
|
25
25
|
voiceId: string;
|
|
26
26
|
}[]>;
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-voice-speechify
|
|
|
3
3
|
description: Documentation for @mastra/voice-speechify. Use when working with @mastra/voice-speechify APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/voice-speechify"
|
|
6
|
-
version: "0.14.0"
|
|
6
|
+
version: "0.14.1-alpha.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -14,13 +14,13 @@ Use this skill whenever you are working with @mastra/voice-speechify to obtain t
|
|
|
14
14
|
|
|
15
15
|
Read the individual reference documents for detailed explanations and code examples.
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### Integrations
|
|
18
18
|
|
|
19
|
-
- [
|
|
19
|
+
- [Speechify](references/integrations-voice-speechify.md) - Add Speechify text-to-speech to Mastra with configurable voices, languages, audio formats, synthesis controls, and speaker discovery.
|
|
20
20
|
|
|
21
21
|
### Reference
|
|
22
22
|
|
|
23
|
-
- [
|
|
23
|
+
- [Voice in Mastra](references/reference-voice-overview.md) - Use Mastra Voice for text-to-speech, speech-to-text, and real-time speech-to-speech interactions through a unified provider interface.
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.
|