@mastra/mcp-docs-server 1.2.7-alpha.19 → 1.2.7-alpha.21

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.
@@ -101,6 +101,16 @@ Waits for any in-flight deliveries to settle. Call this before shutdown to avoid
101
101
  await pubsub.flush()
102
102
  ```
103
103
 
104
+ #### `clearTopic(topic)`
105
+
106
+ Deletes all retained state for a topic — cached history, persistent stream entries, and consumer groups — once no more events will be published to it. Mastra's run lifecycles (durable agents and the evented workflow engine) call this automatically when a run reaches a terminal state, so per-run topics don't accumulate on transports that retain messages.
107
+
108
+ The default implementation is a no-op: transports that retain nothing per topic (such as `EventEmitterPubSub`) have nothing to clear. Backends that persist messages, like [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams), override it. The contract is best-effort — implementations log failures rather than throwing, because callers invoke it fire-and-forget at cleanup boundaries.
109
+
110
+ ```typescript
111
+ await pubsub.clearTopic('workflow.events.v2.run-123')
112
+ ```
113
+
104
114
  ### Replay methods
105
115
 
106
116
  These methods support resuming a stream after a disconnect. The default implementations fall back to a regular `subscribe`, so backends without history support behave as live-only. [`CachingPubSub`](https://mastra.ai/reference/pubsub/caching-pubsub) overrides them to replay cached events.
@@ -92,6 +92,14 @@ const events = await pubsub.getHistory('my-topic', 0)
92
92
 
93
93
  Returns: `Promise<Event[]>`
94
94
 
95
+ ### `clearTopic(topic)`
96
+
97
+ Removes the topic's cached events and offset counter, and forwards the call to the inner pub/sub so persistent transports (such as [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams)) can delete their retained state too. Mastra's run lifecycles call this automatically when a run finishes.
98
+
99
+ ```typescript
100
+ await pubsub.clearTopic('my-topic')
101
+ ```
102
+
95
103
  ## Functions
96
104
 
97
105
  ### `withCaching(pubsub, cache, options?)`
@@ -63,6 +63,8 @@ export const mastra = new Mastra({
63
63
 
64
64
  **maxStreamLength** (`number`): Approximate maximum number of entries kept per stream. Set to 0 to disable trimming. (Default: `10000`)
65
65
 
66
+ **streamIdleTtlMs** (`number`): Idle expiry in milliseconds: a sliding TTL refreshed on every write (publish, nack retry, group re-creation). Each write resets it, so an actively-written stream never expires mid-flight; a stream left idle for the full duration is deleted by Redis automatically. Note that only writes refresh the TTL — a consumer slowly draining a backlog does not — so set it well above the longest expected gap between writes on a live topic. This is a backstop, not the primary cleanup — clearTopic handles normal end-of-lifecycle deletion; this only bounds memory for streams that never reach a clearTopic call (e.g. a crashed run). Must be a non-negative integer. Defaults to 0 (disabled). (Default: `0`)
67
+
66
68
  **reclaimIntervalMs** (`number`): How often, in milliseconds, a subscription reclaims events that an earlier consumer read but never acknowledged. Set to 0 to disable. (Default: `30000`)
67
69
 
68
70
  **reclaimIdleMs** (`number`): Minimum idle time, in milliseconds, before a pending event is eligible for reclaim. Keep this well above typical processing time to avoid double delivery. (Default: `60000`)
@@ -97,6 +99,16 @@ Waits for in-flight publishes to complete.
97
99
  await pubsub.flush()
98
100
  ```
99
101
 
102
+ ### `clearTopic(topic)`
103
+
104
+ Deletes a topic's stream and every consumer group on it, freeing the memory a finished topic would otherwise hold. Mastra's run lifecycles — durable agents and the evented workflow engine — call this automatically when a run reaches a terminal state; call it yourself only once nothing will read the topic again. It's best-effort and never throws — failures are logged at warn level. A subscriber still attached when the stream is deleted recovers on its own but misses the deleted entries.
105
+
106
+ Automatic cleanup requires `@mastra/core` and `@mastra/redis-streams` versions that both support `clearTopic`: the runtime routes the call through its caching layer, so upgrade the two packages together to get end-of-run stream deletion.
107
+
108
+ ```typescript
109
+ await pubsub.clearTopic('workflow.events.run-123')
110
+ ```
111
+
100
112
  ### `close()`
101
113
 
102
114
  Closes the Redis connections and stops all subscriptions. Call this during graceful shutdown.
@@ -12,7 +12,7 @@ import { GoogleVoice } from '@mastra/voice-google'
12
12
  // Initialize with default configuration (uses GOOGLE_API_KEY environment variable)
13
13
  const voice = new GoogleVoice()
14
14
 
15
- // Text-to-Speech
15
+ // Text-to-Speech (plain text)
16
16
  const audioStream = await voice.speak('Hello, world!', {
17
17
  languageCode: 'en-US',
18
18
  audioConfig: {
@@ -20,6 +20,19 @@ const audioStream = await voice.speak('Hello, world!', {
20
20
  },
21
21
  })
22
22
 
23
+ // Text-to-Speech with SSML
24
+ const ssmlStream = await voice.speak('ignored', {
25
+ input: {
26
+ ssml: '<speak>Take <say-as interpret-as="unit">5 mg</say-as> daily.</speak>',
27
+ },
28
+ })
29
+
30
+ // Text-to-Speech with Gemini-TTS model
31
+ const geminiStream = await voice.speak('Hello from Gemini TTS!', {
32
+ voice: { name: 'Kore', modelName: 'gemini-2.5-flash-preview-tts' },
33
+ input: { prompt: 'Warm, calm tone.' },
34
+ })
35
+
23
36
  // Speech-to-Text
24
37
  const transcript = await voice.listen(audioStream, {
25
38
  config: {
@@ -68,25 +81,52 @@ Converts text to speech using Google Cloud Text-to-Speech service.
68
81
 
69
82
  **options** (`object`): Speech synthesis options
70
83
 
71
- **options.speaker** (`string`): Voice ID to use for this request
84
+ **options.speaker** (`string`): Voice ID to use for this request.
85
+
86
+ **options.languageCode** (`string`): Language code for the voice (e.g., 'en-US'). Defaults to the language code derived from the speaker ID, or 'en-US'.
72
87
 
73
- **options.languageCode** (`string`): Language code for the voice (e.g., 'en-US'). Defaults to the language code from the speaker ID or 'en-US'
88
+ **options.input** (`ISynthesizeSpeechRequest['input']`): Rich input object passed through to the Google Cloud TTS API. Supports ssml, markup, prompt (Gemini-TTS style steering), customPronunciations, and multiSpeakerMarkup. When provided without text, ssml, markup, or multiSpeakerMarkup, the positional input argument is used as the text field automatically.
74
89
 
75
- **options.audioConfig** (`ISynthesizeSpeechRequest['audioConfig']`): Audio configuration options from Google Cloud Text-to-Speech API
90
+ **options.voice** (`ISynthesizeSpeechRequest['voice']`): Voice configuration merged on top of defaults (name and languageCode). Supports modelName (e.g., 'gemini-2.5-flash-preview-tts') and multiSpeakerVoiceConfig.
91
+
92
+ **options.audioConfig** (`ISynthesizeSpeechRequest['audioConfig']`): Audio configuration options from Google Cloud Text-to-Speech API.
76
93
 
77
94
  Returns: `Promise<NodeJS.ReadableStream>`
78
95
 
79
96
  ### `listen()`
80
97
 
81
- Converts speech to text using Google Cloud Speech-to-Text service.
98
+ Converts speech to text using Google Cloud Speech-to-Text service. Supports both v1 (default) and v2 APIs. The v2 API adds support for AAC-in-MP4 audio (iOS Safari) via auto-decoding.
99
+
100
+ #### v1 (default)
82
101
 
83
102
  **audioStream** (`NodeJS.ReadableStream`): Audio stream to transcribe
84
103
 
85
- **options** (`object`): Recognition options
104
+ **options** (`GoogleListenOptionsV1`): v1 recognition options
105
+
106
+ **options.config** (`IRecognitionConfig`): v1 recognition configuration from Google Cloud Speech-to-Text API
107
+
108
+ #### v2
109
+
110
+ Pass `v2: true` to use the Cloud Speech-to-Text v2 API, which supports additional audio formats like AAC-in-MP4 (iOS Safari).
111
+
112
+ ```typescript
113
+ const transcript = await voice.listen(iosSafariAacStream, {
114
+ v2: true,
115
+ config: {
116
+ autoDecodingConfig: {},
117
+ },
118
+ })
119
+ ```
120
+
121
+ **audioStream** (`NodeJS.ReadableStream`): Audio stream to transcribe
122
+
123
+ **options** (`GoogleListenOptionsV2`): v2 recognition options
124
+
125
+ **options.v2** (`true`): Enables the v2 API path
86
126
 
87
- **options.stream** (`boolean`): Whether to use streaming recognition
127
+ **options.config** (`v2.IRecognitionConfig`): v2 recognition configuration. Defaults to auto-decoding with languageCodes: \['en-US'] and model: 'long'. Set autoDecodingConfig: {} to auto-detect the audio format, or use explicitDecodingConfig to specify an encoding like MP4\_AAC, M4A\_AAC, or MOV\_AAC.
88
128
 
89
- **options.config** (`IRecognitionConfig`): Recognition configuration from Google Cloud Speech-to-Text API
129
+ **options.recognizer** (`string`): v2 recognizer resource path. Defaults to projects/{project}/locations/global/recognizers/\_ where {project} is resolved from the constructor project option, GOOGLE\_CLOUD\_PROJECT, or the client's default project.
90
130
 
91
131
  Returns: `Promise<string>`
92
132
 
@@ -15,15 +15,15 @@ const voice = new SpeechifyVoice()
15
15
  // Initialize with custom configuration
16
16
  const voice = new SpeechifyVoice({
17
17
  speechModel: {
18
- name: 'simba-english',
18
+ name: 'simba-3.2',
19
19
  apiKey: 'your-api-key',
20
20
  },
21
- speaker: 'george', // Default voice
21
+ speaker: 'harper_32', // Default voice (simba-3.2 serves the curated Simba 3 voices only)
22
22
  })
23
23
 
24
24
  // Convert text to speech
25
25
  const audioStream = await voice.speak('Hello, world!', {
26
- speaker: 'henry', // Override default voice
26
+ speaker: 'imogen_32', // Override default voice
27
27
  })
28
28
  ```
29
29
 
@@ -31,11 +31,11 @@ const audioStream = await voice.speak('Hello, world!', {
31
31
 
32
32
  **speechModel** (`SpeechifyConfig`): Configuration for text-to-speech functionality (Default: `{ name: 'simba-english' }`)
33
33
 
34
- **speechModel.name** (`VoiceModelName`): The Speechify model to use
34
+ **speechModel.name** (`SpeechifyModel`): The Speechify model to use ('simba-3.2', 'simba-3.0', 'simba-english', or 'simba-multilingual')
35
35
 
36
36
  **speechModel.apiKey** (`string`): Speechify API key. Falls back to SPEECHIFY\_API\_KEY environment variable
37
37
 
38
- **speaker** (`SpeechifyVoiceId`): Default voice ID to use for speech synthesis (Default: `'george'`)
38
+ **speaker** (`SpeechifyVoiceId`): Default voice ID to use for speech synthesis. The Simba 3 models serve a curated voice set only (harper\_32, imogen\_32, ...); the classic catalog voices (george, henry, ...) work with simba-english and simba-multilingual (Default: `'harper_32' for Simba 3 models, otherwise 'george'`)
39
39
 
40
40
  ## Methods
41
41
 
@@ -49,7 +49,7 @@ Converts text to speech using the configured speech model and voice.
49
49
 
50
50
  **options.speaker** (`string`): Override the default speaker for this request
51
51
 
52
- **options.model** (`VoiceModelName`): Override the default model for this request
52
+ **options.model** (`SpeechifyModel`): Override the default model for this request
53
53
 
54
54
  Returns: `Promise<NodeJS.ReadableStream>`
55
55
 
@@ -73,5 +73,9 @@ This method isn't supported by Speechify and will throw an error. Speechify does
73
73
 
74
74
  - Speechify requires an API key for authentication
75
75
  - The default model is 'simba-english'
76
+ - 'simba-3.2' is Speechify's latest streaming model with the lowest latency and richest expressivity, and the recommended model for English
77
+ - 'simba-3.2' and 'simba-3.0' are currently English only; use 'simba-multilingual' for non-English or mixed-language input
78
+ - 'simba-3.2' and 'simba-3.0' serve a curated voice set only: 'beatrice\_32', 'dominic\_32', 'edmund\_32', 'geffen\_32', 'harper\_32', 'hugh\_32', 'imogen\_32', 'wyatt\_32'. Classic catalog voices such as 'george' return an error on these models
79
+ - The default speaker follows the configured model: 'harper\_32' for the Simba 3 models, otherwise 'george'
76
80
  - Speech-to-text functionality isn't supported
77
81
  - Additional audio stream options can be passed through the speak() method's options parameter
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.7-alpha.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`45a8e65`](https://github.com/mastra-ai/mastra/commit/45a8e65e1556d1362cb3f25187023c36de26661d), [`c8ed116`](https://github.com/mastra-ai/mastra/commit/c8ed11699f62bcac70102ab4ec84d80d20541da6), [`33f2b88`](https://github.com/mastra-ai/mastra/commit/33f2b88842c09a567f906fac4cb61cd5277ced59)]:
8
+ - @mastra/core@1.51.0-alpha.11
9
+
10
+ ## 1.2.7-alpha.20
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`4adc391`](https://github.com/mastra-ai/mastra/commit/4adc3911075249c352bb4832d2471922826344de), [`b486abf`](https://github.com/mastra-ai/mastra/commit/b486abfa2a7528c6f527e4015c819ea9fa54aaad)]:
15
+ - @mastra/core@1.51.0-alpha.10
16
+
3
17
  ## 1.2.7-alpha.19
4
18
 
5
19
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.2.7-alpha.19",
3
+ "version": "1.2.7-alpha.21",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "jsdom": "^26.1.0",
29
29
  "local-pkg": "^1.1.2",
30
30
  "zod": "^4.4.3",
31
- "@mastra/core": "1.51.0-alpha.9",
31
+ "@mastra/core": "1.51.0-alpha.11",
32
32
  "@mastra/mcp": "^1.14.0-alpha.0"
33
33
  },
34
34
  "devDependencies": {
@@ -47,7 +47,7 @@
47
47
  "vitest": "4.1.10",
48
48
  "@internal/lint": "0.0.113",
49
49
  "@internal/types-builder": "0.0.88",
50
- "@mastra/core": "1.51.0-alpha.9"
50
+ "@mastra/core": "1.51.0-alpha.11"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {