@mastra/mcp-docs-server 1.3.15-alpha.1 → 1.3.15-alpha.2
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.
|
@@ -516,6 +516,8 @@ subscription.unsubscribe()
|
|
|
516
516
|
|
|
517
517
|
The server doesn't replay events missed while the stream was down, so read `session.state()` from `onReconnect` for the current mode, model, and thread. The client surface has no `session.displayState.get()`.
|
|
518
518
|
|
|
519
|
+
A client that reads slower than the session emits, for example on a poor network, gets every event in order but only the newest `display_state_changed` snapshot, because each snapshot holds the full display state. When 5,000 events are waiting for the client, or one has waited more than 60 seconds, the server closes the stream. With `reconnect: true` the client reconnects and receives the current display state first. Mastra reports both through `mastra.metrics` as `mastra_agent_controller_sse_snapshots_dropped_total` and `mastra_agent_controller_sse_slow_client_closes_total`, which has a `reason` label set to `max_pending` or `max_wait`.
|
|
520
|
+
|
|
519
521
|
Send work with `session.sendMessage(content)`, or `session.sendMessage({ content, files })` to attach base64-encoded files. The reply arrives as `message_*` events on the subscription, not as the return value of the call. Answer a `tool_approval_required` event with `session.approveTool(toolCallId, approved)`, and a `tool_suspended` event with `session.respondToToolSuspension(toolCallId, resumeData)`.
|
|
520
522
|
|
|
521
523
|
`onEvent` receives every event the session emits. See the [Agent Controller API](https://mastra.ai/reference/client-js/agent-controller) reference for the event types and how to narrow them.
|
|
@@ -341,6 +341,12 @@ await mastra.backgroundTaskManager?.resume(taskId, {
|
|
|
341
341
|
|
|
342
342
|
On the resumed run, `context.agent.suspendPayload` holds the `data` the tool suspended with. Use it to tell which request an answer belongs to without encoding that in `resumeData`.
|
|
343
343
|
|
|
344
|
+
### Suspend after a durable agent's run finished
|
|
345
|
+
|
|
346
|
+
On a [durable agent](https://mastra.ai/docs/harness/durable-agents), a background tool can call `suspend()` after the agent has replied and its run has finished. The task is marked `suspended` and resumes as usual when the storage adapter supports [run fencing](https://mastra.ai/docs/harness/durable-agents), for example `InMemoryStore`, `@mastra/libsql`, or `@mastra/pg`. These adapters record each claim on the run, so Mastra can check that no other execution claimed the run in the meantime.
|
|
347
|
+
|
|
348
|
+
The task still fails with a storage adapter that lacks run fencing, because run ownership is then only a PubSub lease, and a released lease can't show whether another execution claimed and finished the run since. On an agent from `createEventedAgent()`, the task also fails when an approval for another tool call resumed the run in the same turn, because the resume's claim counts as another execution.
|
|
349
|
+
|
|
344
350
|
### Answer a suspended task from a client
|
|
345
351
|
|
|
346
352
|
While an agent's background tool call is suspended, the assistant message that holds the call records the open request under `metadata.suspendedTools[toolCallId]`. The entry carries `toolName`, `args`, `suspendPayload`, `taskId`, `runId`, and `suspendedAt`, so a chat that reloads the thread can still show the request. The entry is removed when the task resumes or is cancelled.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.3.15-alpha.
|
|
3
|
+
"version": "1.3.15-alpha.2",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
|
|
27
27
|
"local-pkg": "^1.2.1",
|
|
28
28
|
"zod": "^4.6.7",
|
|
29
|
-
"@mastra/core": "1.85.0-alpha.
|
|
29
|
+
"@mastra/core": "1.85.0-alpha.2",
|
|
30
30
|
"@mastra/mcp": "^2.10.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|