@mastra/mcp-docs-server 1.2.7-alpha.20 → 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?)`
@@ -101,7 +101,7 @@ await pubsub.flush()
101
101
 
102
102
  ### `clearTopic(topic)`
103
103
 
104
- Deletes a topic's stream and every consumer group on it, freeing the memory a finished topic would otherwise hold. The durable-agent runtime calls this automatically when a run's cleanup fires; 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.
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
105
 
106
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
107
 
@@ -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
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
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
+
3
10
  ## 1.2.7-alpha.20
4
11
 
5
12
  ### 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.20",
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,8 +28,8 @@
28
28
  "jsdom": "^26.1.0",
29
29
  "local-pkg": "^1.1.2",
30
30
  "zod": "^4.4.3",
31
- "@mastra/mcp": "^1.14.0-alpha.0",
32
- "@mastra/core": "1.51.0-alpha.10"
31
+ "@mastra/core": "1.51.0-alpha.11",
32
+ "@mastra/mcp": "^1.14.0-alpha.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^1.19.11",
@@ -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.10"
50
+ "@mastra/core": "1.51.0-alpha.11"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {