@mastra/mcp-docs-server 1.2.4 → 1.2.5-alpha.3
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/.docs/docs/agent-builder/deploying.md +1 -1
- package/.docs/docs/agent-controller/overview.md +1 -1
- package/.docs/docs/agent-controller/session.md +1 -1
- package/.docs/docs/agents/overview.md +1 -1
- package/.docs/docs/agents/processors.md +1 -1
- package/.docs/docs/agents/supervisor-agents.md +3 -3
- package/.docs/docs/agents/using-tools.md +1 -1
- package/.docs/docs/{agents → long-running-agents}/background-tasks.md +2 -2
- package/.docs/docs/{agents → long-running-agents}/durable-agents.md +2 -2
- package/.docs/docs/{agents → long-running-agents}/goals.md +1 -1
- package/.docs/docs/{agents → long-running-agents}/heartbeats.md +5 -5
- package/.docs/docs/{agents → long-running-agents}/signal-providers.md +4 -4
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/config.md +1 -2
- package/.docs/docs/server/pubsub.md +2 -2
- package/.docs/docs/voice/overview.md +3 -3
- package/.docs/docs/voice/speech-to-speech.md +81 -1
- package/.docs/docs/voice/speech-to-text.md +19 -1
- package/.docs/docs/voice/text-to-speech.md +21 -1
- package/.docs/docs/workflows/control-flow.md +1 -1
- package/.docs/docs/workflows/error-handling.md +1 -1
- package/.docs/docs/workflows/human-in-the-loop.md +1 -1
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +1 -1
- package/.docs/docs/workflows/time-travel.md +1 -1
- package/.docs/docs/workflows/workflow-state.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/channels.md +76 -0
- package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +174 -0
- package/.docs/guides/build-your-ui/copilotkit/overview.md +411 -0
- package/.docs/guides/concepts/streaming.md +1 -1
- package/.docs/guides/deployment/vercel.md +1 -2
- package/.docs/guides/guide/signal-provider.md +5 -5
- package/.docs/models/environment-variables.md +2 -0
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/alibaba-cn.md +2 -1
- package/.docs/models/providers/friendli.md +1 -2
- package/.docs/models/providers/kenari.md +95 -0
- package/.docs/models/providers/nvidia.md +2 -3
- package/.docs/models/providers/tencent-token-plan.md +7 -7
- package/.docs/models/providers/tencent-tokenhub.md +5 -4
- package/.docs/models/providers.md +2 -0
- package/.docs/reference/acp/acp-agent.md +5 -5
- package/.docs/reference/acp/create-acp-tool.md +5 -5
- package/.docs/reference/agent-controller/agent-controller-class.md +27 -27
- package/.docs/reference/agents/agent.md +34 -34
- package/.docs/reference/agents/channels.md +19 -19
- package/.docs/reference/agents/createSkill.md +2 -2
- package/.docs/reference/agents/durable-agent.md +22 -22
- package/.docs/reference/agents/generate.md +10 -10
- package/.docs/reference/agents/generateLegacy.md +12 -12
- package/.docs/reference/agents/getMetadata.md +1 -1
- package/.docs/reference/agents/getVoice.md +1 -1
- package/.docs/reference/agents/inngest-agent.md +9 -9
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/chat-route.md +4 -4
- package/.docs/reference/ai-sdk/handle-chat-stream.md +6 -6
- package/.docs/reference/ai-sdk/handle-network-stream.md +3 -3
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +4 -4
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +1 -1
- package/.docs/reference/ai-sdk/with-mastra.md +2 -2
- package/.docs/reference/ai-sdk/workflow-route.md +2 -2
- package/.docs/reference/ai-sdk/workflow-snapshot-to-stream.md +1 -1
- package/.docs/reference/auth/google.md +10 -10
- package/.docs/reference/auth/okta.md +11 -11
- package/.docs/reference/auth/workos.md +3 -3
- package/.docs/reference/channels/slack-provider.md +15 -15
- package/.docs/reference/cli/mastra.md +145 -0
- package/.docs/reference/client-js/agents.md +9 -9
- package/.docs/reference/client-js/mastra-client.md +5 -5
- package/.docs/reference/client-js/responses.md +3 -3
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/core/getAgentById.md +3 -3
- package/.docs/reference/core/getWorkflow.md +1 -1
- package/.docs/reference/core/listWorkflows.md +1 -1
- package/.docs/reference/core/mastra-class.md +3 -3
- package/.docs/reference/core/removeWorkspace.md +2 -2
- package/.docs/reference/datasets/compareExperiments.md +1 -1
- package/.docs/reference/datasets/getItemHistory.md +1 -1
- package/.docs/reference/datasets/list.md +5 -5
- package/.docs/reference/datasets/listExperimentResults.md +4 -4
- package/.docs/reference/datasets/listExperiments.md +4 -4
- package/.docs/reference/datasets/listItems.md +5 -5
- package/.docs/reference/datasets/listVersions.md +3 -3
- package/.docs/reference/datasets/startExperiment.md +8 -8
- package/.docs/reference/datasets/startExperimentAsync.md +1 -1
- package/.docs/reference/editor/agent-builder/agent-builder-options.md +4 -4
- package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +7 -7
- package/.docs/reference/editor/agent-builder/builder-models.md +4 -4
- package/.docs/reference/editor/blob-store-provider.md +2 -2
- package/.docs/reference/editor/browser-provider.md +2 -2
- package/.docs/reference/editor/filesystem-provider.md +2 -2
- package/.docs/reference/editor/mastra-editor.md +2 -2
- package/.docs/reference/editor/processor-provider.md +4 -4
- package/.docs/reference/editor/sandbox-provider.md +2 -2
- package/.docs/reference/editor/storage-browser-ref.md +2 -2
- package/.docs/reference/editor/storage-workspace-ref.md +7 -7
- package/.docs/reference/evals/create-scorer.md +8 -8
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/evals/run-evals.md +7 -7
- package/.docs/reference/evals/trajectory-accuracy.md +1 -1
- package/.docs/reference/index.md +2 -2
- package/.docs/reference/logging/pino-logger.md +4 -4
- package/.docs/reference/memory/cloneThread.md +35 -4
- package/.docs/reference/memory/memory-class.md +5 -5
- package/.docs/reference/memory/observational-memory.md +43 -43
- package/.docs/reference/memory/recall.md +4 -4
- package/.docs/reference/memory/serialized-memory-config.md +6 -6
- package/.docs/reference/observability/tracing/configuration.md +4 -4
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/moderation-processor.md +1 -1
- package/.docs/reference/processors/pii-detector.md +1 -1
- package/.docs/reference/processors/processor-interface.md +20 -20
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/response-cache.md +6 -6
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/pubsub/base.md +7 -7
- package/.docs/reference/pubsub/caching-pubsub.md +1 -1
- package/.docs/reference/pubsub/event-emitter.md +2 -2
- package/.docs/reference/pubsub/google-cloud-pubsub.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +3 -3
- package/.docs/reference/pubsub/redis-streams.md +6 -6
- package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
- package/.docs/reference/rag/chunk.md +2 -2
- package/.docs/reference/server/create-route.md +3 -3
- package/.docs/reference/server/express-adapter.md +4 -4
- package/.docs/reference/server/fastify-adapter.md +4 -4
- package/.docs/reference/server/hono-adapter.md +4 -4
- package/.docs/reference/server/koa-adapter.md +4 -4
- package/.docs/reference/server/mastra-server.md +1 -1
- package/.docs/reference/server/nestjs-adapter.md +3 -3
- package/.docs/reference/server/register-api-route.md +3 -3
- package/.docs/reference/signals/create-notification-inbox-tool.md +3 -3
- package/.docs/reference/signals/signal-provider.md +7 -7
- package/.docs/reference/signals/webhook-signal-provider.md +2 -2
- package/.docs/reference/storage/clickhouse.md +7 -7
- package/.docs/reference/storage/composite.md +2 -2
- package/.docs/reference/storage/duckdb.md +1 -1
- package/.docs/reference/storage/dynamodb.md +1 -1
- package/.docs/reference/storage/libsql.md +1 -1
- package/.docs/reference/storage/postgresql.md +2 -2
- package/.docs/reference/storage/redis.md +2 -2
- package/.docs/reference/storage/retention.md +5 -5
- package/.docs/reference/storage/spanner.md +6 -6
- package/.docs/reference/streaming/ChunkType.md +3 -3
- package/.docs/reference/streaming/agents/stream.md +14 -14
- package/.docs/reference/streaming/agents/streamLegacy.md +10 -10
- package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/templates/overview.md +1 -140
- package/.docs/reference/tools/brightdata.md +4 -4
- package/.docs/reference/tools/create-code-mode.md +5 -5
- package/.docs/reference/tools/create-tool.md +15 -15
- package/.docs/reference/tools/graph-rag-tool.md +1 -1
- package/.docs/reference/tools/mcp-client.md +2 -2
- package/.docs/reference/tools/mcp-server.md +12 -12
- package/.docs/reference/tools/perplexity.md +3 -3
- package/.docs/reference/tools/tavily.md +1 -1
- package/.docs/reference/tools/vector-query-tool.md +1 -1
- package/.docs/reference/vectors/chroma.md +1 -1
- package/.docs/reference/vectors/mongodb.md +1 -1
- package/.docs/reference/vectors/pg.md +1 -1
- package/.docs/reference/vectors/s3vectors.md +4 -4
- package/.docs/reference/voice/google-gemini-live.md +3 -3
- package/.docs/reference/voice/inworld-realtime.md +12 -12
- package/.docs/reference/voice/inworld.md +2 -2
- package/.docs/reference/voice/voice.on.md +1 -1
- package/.docs/reference/workflows/run-methods/resume.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workspace/agentcore-runtime-sandbox.md +4 -4
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -1
- package/.docs/reference/workspace/apple-container-sandbox.md +5 -5
- package/.docs/reference/workspace/archil-filesystem.md +5 -5
- package/.docs/reference/workspace/blaxel-sandbox.md +1 -1
- package/.docs/reference/workspace/daytona-sandbox.md +1 -1
- package/.docs/reference/workspace/docker-sandbox.md +2 -2
- package/.docs/reference/workspace/e2b-sandbox.md +2 -2
- package/.docs/reference/workspace/files-sdk-filesystem.md +1 -1
- package/.docs/reference/workspace/filesystem.md +1 -1
- package/.docs/reference/workspace/local-filesystem.md +3 -3
- package/.docs/reference/workspace/local-sandbox.md +1 -1
- package/.docs/reference/workspace/mesa-filesystem.md +3 -3
- package/.docs/reference/workspace/modal-sandbox.md +1 -1
- package/.docs/reference/workspace/railway-sandbox.md +1 -1
- package/.docs/reference/workspace/s3-filesystem.md +4 -4
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/{vercel-microvm-sandbox.md → vercel-sandbox.md} +21 -15
- package/.docs/reference/workspace/{vercel.md → vercel-serverless.md} +21 -14
- package/.docs/reference/workspace/workspace-class.md +15 -15
- package/CHANGELOG.md +15 -0
- package/package.json +5 -5
- package/.docs/docs/agents/adding-voice.md +0 -383
- package/.docs/docs/community/contributing-templates.md +0 -5
- package/.docs/docs/community/discord.md +0 -11
- package/.docs/guides/build-your-ui/copilotkit.md +0 -291
- package/LICENSE.md +0 -30
- /package/.docs/docs/{community/licensing.md → license.md} +0 -0
- /package/.docs/docs/{agents → long-running-agents}/signals.md +0 -0
|
@@ -34,11 +34,11 @@ await agent.generateLegacy('message for agent')
|
|
|
34
34
|
|
|
35
35
|
**options.structuredOutput.instructions** (`string`): Custom instructions for the structuring agent.
|
|
36
36
|
|
|
37
|
-
**options.outputProcessors** (`Processor[]`): Overrides the output processors set on the agent. Output processors that can modify or validate messages from the agent before they are returned to the user. Must implement either (or both) of the
|
|
37
|
+
**options.outputProcessors** (`Processor[]`): Overrides the output processors set on the agent. Output processors that can modify or validate messages from the agent before they are returned to the user. Must implement either (or both) of the processOutputResult and processOutputStream functions.
|
|
38
38
|
|
|
39
|
-
**options.inputProcessors** (`Processor[]`): Overrides the input processors set on the agent. Input processors that can modify or validate messages before they are processed by the agent. Must implement the
|
|
39
|
+
**options.inputProcessors** (`Processor[]`): Overrides the input processors set on the agent. Input processors that can modify or validate messages before they are processed by the agent. Must implement the processInput function.
|
|
40
40
|
|
|
41
|
-
**options.experimental\_output** (`Zod schema | JsonSchema7`): Note, the preferred route is to use the
|
|
41
|
+
**options.experimental\_output** (`Zod schema | JsonSchema7`): Note, the preferred route is to use the structuredOutput property. Enables structured output generation alongside text generation and tool calls. The model will generate responses that conform to the provided schema.
|
|
42
42
|
|
|
43
43
|
**options.instructions** (`string`): Custom instructions that override the agent's default instructions for this specific generation. Useful for dynamically modifying agent behavior without creating a new agent instance.
|
|
44
44
|
|
|
@@ -46,11 +46,11 @@ await agent.generateLegacy('message for agent')
|
|
|
46
46
|
|
|
47
47
|
**options.memory** (`object`): Configuration for memory. This is the preferred way to manage memory.
|
|
48
48
|
|
|
49
|
-
**options.memory.thread** (`string | { id: string; metadata?: Record<string, any>, title?: string }`): The conversation thread, as a string ID or an object with an
|
|
49
|
+
**options.memory.thread** (`string | { id: string; metadata?: Record<string, any>, title?: string }`): The conversation thread, as a string ID or an object with an id and optional metadata.
|
|
50
50
|
|
|
51
51
|
**options.memory.resource** (`string`): Identifier for the user or resource associated with the thread.
|
|
52
52
|
|
|
53
|
-
**options.memory.options** (`MemoryConfig`): Configuration for memory behavior, like message history and semantic recall. See
|
|
53
|
+
**options.memory.options** (`MemoryConfig`): Configuration for memory behavior, like message history and semantic recall. See MemoryConfig below.
|
|
54
54
|
|
|
55
55
|
**options.maxSteps** (`number`): Maximum number of execution steps allowed.
|
|
56
56
|
|
|
@@ -86,17 +86,17 @@ await agent.generateLegacy('message for agent')
|
|
|
86
86
|
|
|
87
87
|
**options.clientTools** (`ToolsInput`): Tools that are executed on the 'client' side of the request. These tools do not have execute functions in the definition.
|
|
88
88
|
|
|
89
|
-
**options.hooks** (`ToolHooks`): Per-execution hooks that run before and after tool calls. Overrides matching agent-level hooks for this execution.
|
|
89
|
+
**options.hooks** (`ToolHooks`): Per-execution hooks that run before and after tool calls. Overrides matching agent-level hooks for this execution. beforeToolCall can return { proceed: false, output } to skip the tool call.
|
|
90
90
|
|
|
91
91
|
**options.savePerStep** (`boolean`): Save messages incrementally after each generation step completes (default: false). Disabled internally when observational memory is enabled.
|
|
92
92
|
|
|
93
|
-
**options.providerOptions** (`Record<string, Record<string, JSONValue>>`): Additional provider-specific options that are passed through to the underlying LLM provider. The structure is
|
|
93
|
+
**options.providerOptions** (`Record<string, Record<string, JSONValue>>`): Additional provider-specific options that are passed through to the underlying LLM provider. The structure is { providerName: { optionKey: value } }. Since Mastra extends AI SDK, see the AI SDK documentation for complete provider options.
|
|
94
94
|
|
|
95
|
-
**options.providerOptions.openai** (`Record<string, JSONValue>`): OpenAI-specific options. Example:
|
|
95
|
+
**options.providerOptions.openai** (`Record<string, JSONValue>`): OpenAI-specific options. Example: { reasoningEffort: 'high' }
|
|
96
96
|
|
|
97
|
-
**options.providerOptions.anthropic** (`Record<string, JSONValue>`): Anthropic-specific options. Example:
|
|
97
|
+
**options.providerOptions.anthropic** (`Record<string, JSONValue>`): Anthropic-specific options. Example: { maxTokens: 1000 }
|
|
98
98
|
|
|
99
|
-
**options.providerOptions.google** (`Record<string, JSONValue>`): Google-specific options. Example:
|
|
99
|
+
**options.providerOptions.google** (`Record<string, JSONValue>`): Google-specific options. Example: { safetySettings: \[...] }
|
|
100
100
|
|
|
101
101
|
**options.providerOptions.\[providerName]** (`Record<string, JSONValue>`): Other provider-specific options. The key is the provider name and the value is a record of provider-specific options.
|
|
102
102
|
|
|
@@ -104,7 +104,7 @@ await agent.generateLegacy('message for agent')
|
|
|
104
104
|
|
|
105
105
|
**options.maxTokens** (`number`): Maximum number of tokens to generate.
|
|
106
106
|
|
|
107
|
-
**options.topP** (`number`): Nucleus sampling. This is a number between 0 and 1. It is recommended to set either
|
|
107
|
+
**options.topP** (`number`): Nucleus sampling. This is a number between 0 and 1. It is recommended to set either temperature or topP, but not both.
|
|
108
108
|
|
|
109
109
|
**options.topK** (`number`): Only sample from the top K options for each subsequent token. Used to remove 'long tail' low probability responses.
|
|
110
110
|
|
|
@@ -122,7 +122,7 @@ await agent.generateLegacy('message for agent')
|
|
|
122
122
|
|
|
123
123
|
**text** (`string`): The generated text response. Present when output is 'text' (no schema provided).
|
|
124
124
|
|
|
125
|
-
**object** (`object`): The generated structured response. Present when a schema is provided via
|
|
125
|
+
**object** (`object`): The generated structured response. Present when a schema is provided via output, structuredOutput, or experimental\_output.
|
|
126
126
|
|
|
127
127
|
**toolCalls** (`Array<ToolCall>`): The tool calls made during the generation process. Present in both text and object modes.
|
|
128
128
|
|
|
@@ -18,7 +18,7 @@ await agent.getMetadata()
|
|
|
18
18
|
|
|
19
19
|
## Returns
|
|
20
20
|
|
|
21
|
-
**metadata** (`Record<string, unknown> | Promise<Record<string, unknown>>`): The metadata configured for the agent, or
|
|
21
|
+
**metadata** (`Record<string, unknown> | Promise<Record<string, unknown>>`): The metadata configured for the agent, or undefined if no metadata was configured. Returns either directly or as a promise that resolves to the metadata when defined as a function.
|
|
22
22
|
|
|
23
23
|
## Extended usage example
|
|
24
24
|
|
|
@@ -65,7 +65,7 @@ Returns: [`InngestAgent`](#inngestagent-interface)
|
|
|
65
65
|
|
|
66
66
|
### Parameters
|
|
67
67
|
|
|
68
|
-
**agent** (`Agent`): The Agent to wrap with Inngest durable execution. Agent methods (e.g.,
|
|
68
|
+
**agent** (`Agent`): The Agent to wrap with Inngest durable execution. Agent methods (e.g., generate(), listTools(), getMemory()) delegate to this agent via a Proxy.
|
|
69
69
|
|
|
70
70
|
**inngest** (`Inngest`): The Inngest client instance. Used to send workflow events and, in SDK v4, publish realtime stream events.
|
|
71
71
|
|
|
@@ -73,9 +73,9 @@ Returns: [`InngestAgent`](#inngestagent-interface)
|
|
|
73
73
|
|
|
74
74
|
**name** (`string`): Name override. (Default: `agent.name`)
|
|
75
75
|
|
|
76
|
-
**pubsub** (`PubSub`): PubSub instance for streaming events. The default
|
|
76
|
+
**pubsub** (`PubSub`): PubSub instance for streaming events. The default InngestPubSub uses Inngest Realtime, which works across processes. (Default: `InngestPubSub`)
|
|
77
77
|
|
|
78
|
-
**cache** (`MastraServerCache`): Cache for stored stream events, which enables resumable streams. When provided, the PubSub is automatically wrapped with
|
|
78
|
+
**cache** (`MastraServerCache`): Cache for stored stream events, which enables resumable streams. When provided, the PubSub is automatically wrapped with CachingPubSub. If omitted, the agent inherits the cache from the Mastra instance.
|
|
79
79
|
|
|
80
80
|
**mastra** (`Mastra`): Mastra instance for observability. Set automatically when the agent is registered with Mastra.
|
|
81
81
|
|
|
@@ -216,7 +216,7 @@ Returns: `boolean`
|
|
|
216
216
|
|
|
217
217
|
`stream()` accepts an `InngestAgentStreamOptions` object. It supports the same agent execution options as [`DurableAgent.stream()`](https://mastra.ai/reference/agents/durable-agent), plus lifecycle callbacks.
|
|
218
218
|
|
|
219
|
-
**runId** (`string`): Unique identifier for this run. Use it later with
|
|
219
|
+
**runId** (`string`): Unique identifier for this run. Use it later with resume() or observe().
|
|
220
220
|
|
|
221
221
|
**instructions** (`AgentExecutionOptions['instructions']`): Overrides the agent's default instructions for this run.
|
|
222
222
|
|
|
@@ -238,7 +238,7 @@ Returns: `boolean`
|
|
|
238
238
|
|
|
239
239
|
**requireToolApproval** (`boolean`): Require approval for all tool calls, which suspends the run until resumed.
|
|
240
240
|
|
|
241
|
-
**autoResumeSuspendedTools** (`boolean`): Automatically resume tools that suspended, instead of waiting for an external
|
|
241
|
+
**autoResumeSuspendedTools** (`boolean`): Automatically resume tools that suspended, instead of waiting for an external resume() call.
|
|
242
242
|
|
|
243
243
|
**toolCallConcurrency** (`number`): Maximum number of tool calls to execute concurrently.
|
|
244
244
|
|
|
@@ -246,7 +246,7 @@ Returns: `boolean`
|
|
|
246
246
|
|
|
247
247
|
**maxProcessorRetries** (`number`): Maximum number of processor retries per generation.
|
|
248
248
|
|
|
249
|
-
**untilIdle** (`boolean | { maxIdleMs?: number }`): When set, keeps the stream open across background-task continuations until the agent is idle. Pass
|
|
249
|
+
**untilIdle** (`boolean | { maxIdleMs?: number }`): When set, keeps the stream open across background-task continuations until the agent is idle. Pass true for the default 5-minute idle timeout, or { maxIdleMs } to customise.
|
|
250
250
|
|
|
251
251
|
**onChunk** (`(chunk: ChunkType) => void | Promise<void>`): Called for each streamed chunk.
|
|
252
252
|
|
|
@@ -275,11 +275,11 @@ interface InngestAgentStreamResult<OUTPUT = undefined> {
|
|
|
275
275
|
}
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
-
**output** (`MastraModelOutput`): The streaming output. Await
|
|
278
|
+
**output** (`MastraModelOutput`): The streaming output. Await output.text for the full text, or consume output.fullStream.
|
|
279
279
|
|
|
280
|
-
**fullStream** (`ReadableStream`): The full event stream, delegating to
|
|
280
|
+
**fullStream** (`ReadableStream`): The full event stream, delegating to output.fullStream.
|
|
281
281
|
|
|
282
|
-
**runId** (`string`): The unique run ID. Pass it to
|
|
282
|
+
**runId** (`string`): The unique run ID. Pass it to resume() or observe() to reconnect.
|
|
283
283
|
|
|
284
284
|
**threadId** (`string`): Thread ID when using memory.
|
|
285
285
|
|
|
@@ -52,7 +52,7 @@ await agent.network(`
|
|
|
52
52
|
|
|
53
53
|
**options.memory** (`object`): Configuration for memory. This is the preferred way to manage memory.
|
|
54
54
|
|
|
55
|
-
**options.memory.thread** (`string | { id: string; metadata?: Record<string, any>, title?: string }`): The conversation thread, as a string ID or an object with an
|
|
55
|
+
**options.memory.thread** (`string | { id: string; metadata?: Record<string, any>, title?: string }`): The conversation thread, as a string ID or an object with an id and optional metadata.
|
|
56
56
|
|
|
57
57
|
**options.memory.resource** (`string`): Identifier for the user or resource associated with the thread.
|
|
58
58
|
|
|
@@ -51,13 +51,13 @@ export const mastra = new Mastra({
|
|
|
51
51
|
|
|
52
52
|
## Parameters
|
|
53
53
|
|
|
54
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass
|
|
54
|
+
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
55
55
|
|
|
56
|
-
**path** (`string`): The route path (e.g.,
|
|
56
|
+
**path** (`string`): The route path (e.g., /chat or /chat/:agentId). Include :agentId for dynamic agent routing. (Default: `'/chat/:agentId'`)
|
|
57
57
|
|
|
58
|
-
**agent** (`string`): The ID of the agent to use for this chat route. Required if the path doesn't include
|
|
58
|
+
**agent** (`string`): The ID of the agent to use for this chat route. Required if the path doesn't include :agentId.
|
|
59
59
|
|
|
60
|
-
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass
|
|
60
|
+
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass { versionId: '\<id>' } to target an exact version, or { status: 'draft' } / { status: 'published' } to resolve by status. When the route is called, query parameters ?versionId=\<id> or ?status=draft|published take precedence over this static value. Requires the Editor to be configured.
|
|
61
61
|
|
|
62
62
|
**defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These can include instructions, memory configuration, maxSteps, and other execution settings.
|
|
63
63
|
|
|
@@ -50,23 +50,23 @@ export async function POST(req: Request) {
|
|
|
50
50
|
|
|
51
51
|
## Parameters
|
|
52
52
|
|
|
53
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass
|
|
53
|
+
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
54
54
|
|
|
55
55
|
**mastra** (`Mastra`): The Mastra instance containing registered agents.
|
|
56
56
|
|
|
57
57
|
**agentId** (`string`): The ID of the agent to use for chat.
|
|
58
58
|
|
|
59
|
-
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass
|
|
59
|
+
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass { versionId: '\<id>' } to target an exact version, or { status: 'draft' } / { status: 'published' } to resolve by status. Requires the Editor to be configured.
|
|
60
60
|
|
|
61
61
|
**params** (`ChatStreamHandlerParams`): Parameters for the chat stream, including messages and optional resume data.
|
|
62
62
|
|
|
63
63
|
**params.messages** (`UIMessage[]`): Array of messages in the conversation.
|
|
64
64
|
|
|
65
|
-
**params.resumeData** (`Record<string, any>`): Data for resuming a suspended agent execution. Requires
|
|
65
|
+
**params.resumeData** (`Record<string, any>`): Data for resuming a suspended agent execution. Requires runId to be set.
|
|
66
66
|
|
|
67
|
-
**params.runId** (`string`): The run ID. Required when
|
|
67
|
+
**params.runId** (`string`): The run ID. Required when resumeData is provided.
|
|
68
68
|
|
|
69
|
-
**params.providerOptions** (`Record<string, Record<string, unknown>>`): Provider-specific options passed to the language model (e.g.
|
|
69
|
+
**params.providerOptions** (`Record<string, Record<string, unknown>>`): Provider-specific options passed to the language model (e.g. { openai: { reasoningEffort: "high" } }). Merged with defaultOptions.providerOptions, with params taking precedence.
|
|
70
70
|
|
|
71
71
|
**params.requestContext** (`RequestContext`): Request context to pass to the agent execution.
|
|
72
72
|
|
|
@@ -82,4 +82,4 @@ export async function POST(req: Request) {
|
|
|
82
82
|
|
|
83
83
|
**onError** (`(error: unknown) => string`): Called when the stream encounters an error. Return the string that will be sent to the client as the error message. Use this to sanitize errors before they reach the client — for example, to prevent internal infrastructure details from leaking to end users.
|
|
84
84
|
|
|
85
|
-
**messageMetadata** (`(options: { part: UIMessageStreamPart }) => Record<string, unknown> | undefined`): A function that receives the current stream part and returns metadata to attach to start and finish chunks. See the
|
|
85
|
+
**messageMetadata** (`(options: { part: UIMessageStreamPart }) => Record<string, unknown> | undefined`): A function that receives the current stream part and returns metadata to attach to start and finish chunks. See the AI SDK message metadata docs for details.
|
|
@@ -34,14 +34,14 @@ export async function POST(req: Request) {
|
|
|
34
34
|
|
|
35
35
|
## Parameters
|
|
36
36
|
|
|
37
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass
|
|
37
|
+
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
38
38
|
|
|
39
39
|
**mastra** (`Mastra`): The Mastra instance to use for agent lookup and execution.
|
|
40
40
|
|
|
41
41
|
**agentId** (`string`): The ID of the routing agent to execute as a network.
|
|
42
42
|
|
|
43
|
-
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass
|
|
43
|
+
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass { versionId: '\<id>' } to target an exact version, or { status: 'draft' } / { status: 'published' } to resolve by status. Requires the Editor to be configured.
|
|
44
44
|
|
|
45
|
-
**params** (`NetworkStreamHandlerParams`): The request parameters containing messages and execution options. Includes
|
|
45
|
+
**params** (`NetworkStreamHandlerParams`): The request parameters containing messages and execution options. Includes messages (required) and any AgentExecutionOptions like memory, maxSteps, runId, etc.
|
|
46
46
|
|
|
47
47
|
**defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These are merged with params, with params taking precedence.
|
|
@@ -36,7 +36,7 @@ export async function POST(req: Request) {
|
|
|
36
36
|
|
|
37
37
|
## Parameters
|
|
38
38
|
|
|
39
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass
|
|
39
|
+
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
40
40
|
|
|
41
41
|
**mastra** (`Mastra`): The Mastra instance containing registered workflows.
|
|
42
42
|
|
|
@@ -49,13 +49,13 @@ export const mastra = new Mastra({
|
|
|
49
49
|
|
|
50
50
|
## Parameters
|
|
51
51
|
|
|
52
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass
|
|
52
|
+
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
53
53
|
|
|
54
|
-
**path** (`string`): The route path (e.g.,
|
|
54
|
+
**path** (`string`): The route path (e.g., /network or /network/:agentId). Include :agentId for dynamic agent routing. (Default: `'/network/:agentId'`)
|
|
55
55
|
|
|
56
|
-
**agent** (`string`): The ID of the routing agent to use for this network route. Required if the path doesn't include
|
|
56
|
+
**agent** (`string`): The ID of the routing agent to use for this network route. Required if the path doesn't include :agentId.
|
|
57
57
|
|
|
58
|
-
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass
|
|
58
|
+
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass { versionId: '\<id>' } to target an exact version, or { status: 'draft' } / { status: 'published' } to resolve by status. When the route is called, query parameters ?versionId=\<id> or ?status=draft|published take precedence over this static value. Requires the Editor to be configured.
|
|
59
59
|
|
|
60
60
|
**defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These can include instructions, memory configuration, maxSteps, and other execution settings.
|
|
61
61
|
|
|
@@ -44,7 +44,7 @@ export default function Chat() {
|
|
|
44
44
|
|
|
45
45
|
**messages** (`MessageListInput`): Messages to convert. Can be a string, array of strings, a single message object, or an array of message objects in any supported format.
|
|
46
46
|
|
|
47
|
-
**options.version** (`'v5' | 'v6'`): Selects the AI SDK message type to return. Omit it or pass
|
|
47
|
+
**options.version** (`'v5' | 'v6'`): Selects the AI SDK message type to return. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 useChat() message types.
|
|
48
48
|
|
|
49
49
|
## Returns
|
|
50
50
|
|
|
@@ -64,7 +64,7 @@ The first parameter is the Mastra stream to convert. It can be one of:
|
|
|
64
64
|
|
|
65
65
|
The second parameter is an options object:
|
|
66
66
|
|
|
67
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass
|
|
67
|
+
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
68
68
|
|
|
69
69
|
**from** (`'agent' | 'network' | 'workflow'`): The type of Mastra stream being converted. (Default: `'agent'`)
|
|
70
70
|
|
|
@@ -32,7 +32,7 @@ const { text } = await generateText({
|
|
|
32
32
|
|
|
33
33
|
## Parameters
|
|
34
34
|
|
|
35
|
-
**model** (`LanguageModelV2 | LanguageModelV3`): Any AI SDK v5 or v6 language model (e.g.,
|
|
35
|
+
**model** (`LanguageModelV2 | LanguageModelV3`): Any AI SDK v5 or v6 language model (e.g., openai('gpt-5.4'), anthropic('claude-opus-4-6')).
|
|
36
36
|
|
|
37
37
|
**options** (`WithMastraOptions`): Configuration object for processors and memory.
|
|
38
38
|
|
|
@@ -42,7 +42,7 @@ const { text } = await generateText({
|
|
|
42
42
|
|
|
43
43
|
**options.memory** (`WithMastraMemoryOptions`): Memory configuration - enables automatic message history persistence.
|
|
44
44
|
|
|
45
|
-
**options.memory.storage** (`MemoryStorage`): Memory storage domain for message persistence. Get it from a composite store using
|
|
45
|
+
**options.memory.storage** (`MemoryStorage`): Memory storage domain for message persistence. Get it from a composite store using await storage.getStore('memory').
|
|
46
46
|
|
|
47
47
|
**options.memory.threadId** (`string`): Thread ID for conversation persistence.
|
|
48
48
|
|
|
@@ -51,9 +51,9 @@ export const mastra = new Mastra({
|
|
|
51
51
|
|
|
52
52
|
## Parameters
|
|
53
53
|
|
|
54
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass
|
|
54
|
+
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
55
55
|
|
|
56
|
-
**path** (`string`): The route path (e.g.,
|
|
56
|
+
**path** (`string`): The route path (e.g., /workflow or /workflow/:workflowId). Include :workflowId for dynamic workflow routing. (Default: `'/api/workflows/:workflowId/stream'`)
|
|
57
57
|
|
|
58
58
|
**workflow** (`string`): Fixed workflow ID when not using dynamic routing. (Default: `undefined`)
|
|
59
59
|
|
|
@@ -32,7 +32,7 @@ export async function GET(req: Request) {
|
|
|
32
32
|
|
|
33
33
|
## Parameters
|
|
34
34
|
|
|
35
|
-
**workflowRun** (`WorkflowState`): The workflow run state object, as returned by
|
|
35
|
+
**workflowRun** (`WorkflowState`): The workflow run state object, as returned by getWorkflowRunById() or the workflow runs API. Contains runId, workflowName, status, and steps.
|
|
36
36
|
|
|
37
37
|
## Returns
|
|
38
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# MastraAuthGoogle
|
|
3
|
+
# MastraAuthGoogle and MastraRBACGoogle class
|
|
4
4
|
|
|
5
5
|
## MastraAuthGoogle class
|
|
6
6
|
|
|
@@ -36,9 +36,9 @@ export const mastra = new Mastra({
|
|
|
36
36
|
|
|
37
37
|
**scopes** (`string[]`): OAuth scopes requested during the login flow. (Default: `['openid', 'profile', 'email']`)
|
|
38
38
|
|
|
39
|
-
**allowedDomains** (`string | string[]`): Allowed Google Workspace hosted domains. Mastra validates these against the verified
|
|
39
|
+
**allowedDomains** (`string | string[]`): Allowed Google Workspace hosted domains. Mastra validates these against the verified hd claim. (Default: `process.env.GOOGLE_ALLOWED_DOMAINS`)
|
|
40
40
|
|
|
41
|
-
**hostedDomain** (`string`): Hosted-domain login hint passed to Google as
|
|
41
|
+
**hostedDomain** (`string`): Hosted-domain login hint passed to Google as hd. This is a hint only and is not used for authorization. (Default: `process.env.GOOGLE_HOSTED_DOMAIN or the single allowed domain`)
|
|
42
42
|
|
|
43
43
|
**session** (`GoogleSessionOptions`): Session cookie configuration.
|
|
44
44
|
|
|
@@ -48,7 +48,7 @@ export const mastra = new Mastra({
|
|
|
48
48
|
|
|
49
49
|
**session.cookiePassword** (`string`): Password for encrypting session cookies. Must be at least 32 characters. If not set, an auto-generated value is used in development that does not survive restarts.
|
|
50
50
|
|
|
51
|
-
**session.secureCookies** (`boolean`): Set the
|
|
51
|
+
**session.secureCookies** (`boolean`): Set the Secure flag on session cookies.
|
|
52
52
|
|
|
53
53
|
**name** (`string`): Custom name for the auth provider instance. (Default: `'google'`)
|
|
54
54
|
|
|
@@ -123,7 +123,7 @@ Returns: `Promise<GoogleUser | null>`
|
|
|
123
123
|
|
|
124
124
|
The `GoogleUser` type extends the base `EEUser` interface with Google-specific fields:
|
|
125
125
|
|
|
126
|
-
**id** (`string`): Mastra user ID. Uses the Google
|
|
126
|
+
**id** (`string`): Mastra user ID. Uses the Google sub claim.
|
|
127
127
|
|
|
128
128
|
**googleId** (`string`): Google Account subject identifier.
|
|
129
129
|
|
|
@@ -133,7 +133,7 @@ The `GoogleUser` type extends the base `EEUser` interface with Google-specific f
|
|
|
133
133
|
|
|
134
134
|
**avatarUrl** (`string`): URL to the user's Google profile picture.
|
|
135
135
|
|
|
136
|
-
**hostedDomain** (`string`): Google Workspace hosted domain from the verified
|
|
136
|
+
**hostedDomain** (`string`): Google Workspace hosted domain from the verified hd claim.
|
|
137
137
|
|
|
138
138
|
**expiresAt** (`Date`): Verified ID token expiration time, when available.
|
|
139
139
|
|
|
@@ -204,7 +204,7 @@ export const mastra = new Mastra({
|
|
|
204
204
|
|
|
205
205
|
### Constructor parameters
|
|
206
206
|
|
|
207
|
-
**roleMapping** (`RoleMapping`): Maps Google Workspace group role IDs to arrays of Mastra permission strings. Use
|
|
207
|
+
**roleMapping** (`RoleMapping`): Maps Google Workspace group role IDs to arrays of Mastra permission strings. Use '\_default' to assign permissions to users who do not match any group. Supports wildcards like '\*' (full access) and 'agents:\*' (all agent actions).
|
|
208
208
|
|
|
209
209
|
**accessToken** (`string`): Pre-obtained Workspace Directory API access token.
|
|
210
210
|
|
|
@@ -214,7 +214,7 @@ export const mastra = new Mastra({
|
|
|
214
214
|
|
|
215
215
|
**serviceAccount.clientEmail** (`string`): Google service account email.
|
|
216
216
|
|
|
217
|
-
**serviceAccount.privateKey** (`string`): PEM-encoded private key. Escaped
|
|
217
|
+
**serviceAccount.privateKey** (`string`): PEM-encoded private key. Escaped \n values from .env files are supported.
|
|
218
218
|
|
|
219
219
|
**serviceAccount.privateKeyId** (`string`): Optional private key ID.
|
|
220
220
|
|
|
@@ -222,9 +222,9 @@ export const mastra = new Mastra({
|
|
|
222
222
|
|
|
223
223
|
**serviceAccount.scopes** (`string[]`): OAuth scopes for the service account token.
|
|
224
224
|
|
|
225
|
-
**getUserKey** (`(user: unknown) => string | undefined`): Extract the Directory API
|
|
225
|
+
**getUserKey** (`(user: unknown) => string | undefined`): Extract the Directory API userKey from an authenticated user. Defaults to user.email.
|
|
226
226
|
|
|
227
|
-
**mapGroupToRoles** (`(group: GoogleWorkspaceGroup) => string[]`): Map a Google Workspace group to role IDs. Defaults to
|
|
227
|
+
**mapGroupToRoles** (`(group: GoogleWorkspaceGroup) => string[]`): Map a Google Workspace group to role IDs. Defaults to \[group.email].
|
|
228
228
|
|
|
229
229
|
**cache** (`PermissionCacheOptions`): Configure the LRU cache for group lookups.
|
|
230
230
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# MastraAuthOkta
|
|
3
|
+
# MastraAuthOkta and MastraRBACOkta class
|
|
4
4
|
|
|
5
5
|
## MastraAuthOkta class
|
|
6
6
|
|
|
@@ -28,7 +28,7 @@ export const mastra = new Mastra({
|
|
|
28
28
|
|
|
29
29
|
### Constructor parameters
|
|
30
30
|
|
|
31
|
-
**domain** (`string`): Your Okta domain (e.g.,
|
|
31
|
+
**domain** (`string`): Your Okta domain (e.g., dev-123456.okta.com). Used to construct the issuer URL and API endpoints. (Default: `process.env.OKTA_DOMAIN`)
|
|
32
32
|
|
|
33
33
|
**clientId** (`string`): The OAuth client ID from your Okta application. (Default: `process.env.OKTA_CLIENT_ID`)
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@ export const mastra = new Mastra({
|
|
|
40
40
|
|
|
41
41
|
**scopes** (`string[]`): OAuth scopes to request during the login flow. (Default: `['openid', 'profile', 'email', 'groups']`)
|
|
42
42
|
|
|
43
|
-
**apiToken** (`string`): Okta API token for user lookups via the Users API. Required for
|
|
43
|
+
**apiToken** (`string`): Okta API token for user lookups via the Users API. Required for getUser() to return user data by ID. (Default: `process.env.OKTA_API_TOKEN`)
|
|
44
44
|
|
|
45
45
|
**session** (`OktaSessionOptions`): Session cookie configuration.
|
|
46
46
|
|
|
@@ -50,7 +50,7 @@ export const mastra = new Mastra({
|
|
|
50
50
|
|
|
51
51
|
**session.cookiePassword** (`string`): Password for encrypting session cookies. Must be at least 32 characters. If not set, an auto-generated value is used that does not survive restarts.
|
|
52
52
|
|
|
53
|
-
**session.secureCookies** (`boolean`): Set the
|
|
53
|
+
**session.secureCookies** (`boolean`): Set the Secure flag on session cookies.
|
|
54
54
|
|
|
55
55
|
**name** (`string`): Custom name for the auth provider instance. (Default: `'okta'`)
|
|
56
56
|
|
|
@@ -58,13 +58,13 @@ export const mastra = new Mastra({
|
|
|
58
58
|
|
|
59
59
|
The following environment variables are automatically used when constructor options aren't provided:
|
|
60
60
|
|
|
61
|
-
**OKTA\_DOMAIN** (`string`): Your Okta domain (e.g.,
|
|
61
|
+
**OKTA\_DOMAIN** (`string`): Your Okta domain (e.g., dev-123456.okta.com). Found in your Okta admin console.
|
|
62
62
|
|
|
63
63
|
**OKTA\_CLIENT\_ID** (`string`): The OAuth client ID from your Okta application.
|
|
64
64
|
|
|
65
65
|
**OKTA\_CLIENT\_SECRET** (`string`): The OAuth client secret from your Okta application.
|
|
66
66
|
|
|
67
|
-
**OKTA\_ISSUER** (`string`): Token issuer URL. Defaults to
|
|
67
|
+
**OKTA\_ISSUER** (`string`): Token issuer URL. Defaults to https\://{domain}/oauth2/default if not set.
|
|
68
68
|
|
|
69
69
|
**OKTA\_REDIRECT\_URI** (`string`): OAuth redirect URI for the SSO callback.
|
|
70
70
|
|
|
@@ -85,9 +85,9 @@ After authentication, `authorizeUser` checks that the user has a valid `oktaId`.
|
|
|
85
85
|
|
|
86
86
|
The `OktaUser` type extends the base `EEUser` interface with Okta-specific fields:
|
|
87
87
|
|
|
88
|
-
**id** (`string`): User identifier (maps to the
|
|
88
|
+
**id** (`string`): User identifier (maps to the sub claim).
|
|
89
89
|
|
|
90
|
-
**oktaId** (`string`): Okta user ID (same as
|
|
90
|
+
**oktaId** (`string`): Okta user ID (same as id).
|
|
91
91
|
|
|
92
92
|
**email** (`string`): User email address.
|
|
93
93
|
|
|
@@ -95,7 +95,7 @@ The `OktaUser` type extends the base `EEUser` interface with Okta-specific field
|
|
|
95
95
|
|
|
96
96
|
**avatarUrl** (`string`): URL to the user's profile picture.
|
|
97
97
|
|
|
98
|
-
**groups** (`string[]`): Okta groups the user belongs to, populated from the
|
|
98
|
+
**groups** (`string[]`): Okta groups the user belongs to, populated from the groups claim.
|
|
99
99
|
|
|
100
100
|
## MastraRBACOkta class
|
|
101
101
|
|
|
@@ -149,13 +149,13 @@ export const mastra = new Mastra({
|
|
|
149
149
|
|
|
150
150
|
### Constructor parameters
|
|
151
151
|
|
|
152
|
-
**roleMapping** (`RoleMapping`): Maps Okta group names to arrays of Mastra permission strings. Use
|
|
152
|
+
**roleMapping** (`RoleMapping`): Maps Okta group names to arrays of Mastra permission strings. Use '\_default' to assign permissions to users who do not match any group. Supports wildcards like '\*' (full access) and 'agents:\*' (all agent actions).
|
|
153
153
|
|
|
154
154
|
**domain** (`string`): Your Okta domain. Used to initialize the Okta management SDK. (Default: `process.env.OKTA_DOMAIN`)
|
|
155
155
|
|
|
156
156
|
**apiToken** (`string`): Okta API token for the management SDK. Required to fetch user groups from the Okta API. (Default: `process.env.OKTA_API_TOKEN`)
|
|
157
157
|
|
|
158
|
-
**getUserId** (`(user: unknown) => string | undefined`): Extract the Okta user ID from a user object. Use this when combining Okta RBAC with a different auth provider. If not provided, falls back to
|
|
158
|
+
**getUserId** (`(user: unknown) => string | undefined`): Extract the Okta user ID from a user object. Use this when combining Okta RBAC with a different auth provider. If not provided, falls back to oktaId or id on the user object.
|
|
159
159
|
|
|
160
160
|
**cache** (`PermissionCacheOptions`): Configure the LRU cache for group lookups.
|
|
161
161
|
|
|
@@ -32,11 +32,11 @@ export const mastra = new Mastra({
|
|
|
32
32
|
|
|
33
33
|
**redirectUri** (`string`): OAuth redirect URI used by WorkOS AuthKit. Set this when you use the built-in WorkOS sign-in flow. (Default: `process.env.WORKOS_REDIRECT_URI`)
|
|
34
34
|
|
|
35
|
-
**fetchMemberships** (`boolean`): Loads organization memberships during authentication. Set this to
|
|
35
|
+
**fetchMemberships** (`boolean`): Loads organization memberships during authentication. Set this to true when you use MastraFGAWorkos so FGA checks can resolve the correct organization membership ID. (Default: `false`)
|
|
36
36
|
|
|
37
|
-
**trustJwtClaims** (`boolean`): Trusts verified bearer-token claims enough to construct a
|
|
37
|
+
**trustJwtClaims** (`boolean`): Trusts verified bearer-token claims enough to construct a WorkOSUser even when workos.userManagement.getUser() does not apply. Use this for service-account or machine-to-machine tokens backed by a WorkOS custom JWT template. (Default: `false`)
|
|
38
38
|
|
|
39
|
-
**jwtClaims** (`{ userId?: string; workosId?: string; email?: string; name?: string; organizationId?: string; organizationMembershipId?: string }`): Maps verified bearer JWT claims into the authenticated
|
|
39
|
+
**jwtClaims** (`{ userId?: string; workosId?: string; email?: string; name?: string; organizationId?: string; organizationMembershipId?: string }`): Maps verified bearer JWT claims into the authenticated WorkOSUser. Useful for custom JWT templates that include organizationMembershipId or other FGA-specific claims.
|
|
40
40
|
|
|
41
41
|
## Environment variables
|
|
42
42
|
|
|
@@ -37,31 +37,31 @@ await slack.configure({
|
|
|
37
37
|
|
|
38
38
|
`SlackProviderConfig` combines Slack-specific fields, Slack-adapter overrides (`toolDisplay`, `streaming`, `typingStatus`), and a curated subset of [`ChannelConfig`](https://mastra.ai/reference/agents/channels) options (such as `handlers`, `inlineMedia`, and `state`) forwarded to every connected agent. All fields are optional.
|
|
39
39
|
|
|
40
|
-
**refreshToken** (`string`): Slack App Configuration refresh token, used for automatic token rotation. Single-use; each rotation returns a new pair. Can also be provided later via
|
|
40
|
+
**refreshToken** (`string`): Slack App Configuration refresh token, used for automatic token rotation. Single-use; each rotation returns a new pair. Can also be provided later via configure(). If omitted, the provider starts unconfigured and cannot create apps until configure() is called or tokens are loaded from storage. Generate it under "Your App Configuration Tokens" at api.slack.com/apps.
|
|
41
41
|
|
|
42
|
-
**token** (`string`): Slack App Configuration access token for programmatic app creation. Optional, because the provider rotates to a fresh token on startup using
|
|
42
|
+
**token** (`string`): Slack App Configuration access token for programmatic app creation. Optional, because the provider rotates to a fresh token on startup using refreshToken.
|
|
43
43
|
|
|
44
|
-
**baseUrl** (`string`): Public base URL for webhook and OAuth callbacks. Required when calling
|
|
44
|
+
**baseUrl** (`string`): Public base URL for webhook and OAuth callbacks. Required when calling connect() to create apps. Can also be set via setBaseUrl() or auto-detected from the Mastra server config. For local development, use a tunnel such as cloudflared.
|
|
45
45
|
|
|
46
|
-
**encryptionKey** (`string`): Encryption key for sensitive stored data (client secret, signing secret, bot token). Use a 32+ character random string. Can be set via the
|
|
46
|
+
**encryptionKey** (`string`): Encryption key for sensitive stored data (client secret, signing secret, bot token). Use a 32+ character random string. Can be set via the MASTRA\_ENCRYPTION\_KEY env var. If omitted, secrets are stored in plaintext (not recommended for production).
|
|
47
47
|
|
|
48
|
-
**storage** (`ChannelsStorage`): Custom storage for installations. Defaults to Mastra's
|
|
48
|
+
**storage** (`ChannelsStorage`): Custom storage for installations. Defaults to Mastra's ChannelsStorage from the global storage. Throws if no persistent storage is available.
|
|
49
49
|
|
|
50
50
|
**redirectPath** (`string`): Path to redirect to after OAuth completion. (Default: `"/"`)
|
|
51
51
|
|
|
52
52
|
**onInstall** (`(installation: SlackInstallation) => Promise<void>`): Called when a workspace successfully installs the app.
|
|
53
53
|
|
|
54
|
-
**streaming** (`StreamingConfig | false`): Stream agent text deltas to Slack as they're generated. Pass
|
|
54
|
+
**streaming** (`StreamingConfig | false`): Stream agent text deltas to Slack as they're generated. Pass { updateIntervalMs } to customize the post-and-edit interval, or false to buffer text until step-finish. Disabling streaming restricts toolDisplay to static modes. (Default: `true`)
|
|
55
55
|
|
|
56
|
-
**toolDisplay** (`ToolDisplay`): How tool calls are rendered in Slack:
|
|
56
|
+
**toolDisplay** (`ToolDisplay`): How tool calls are rendered in Slack: 'cards', 'text', 'timeline', 'grouped', 'hidden', or a function. 'hidden' suppresses tool call/result rendering entirely. 'timeline' and 'grouped' require streaming. With streaming: false, only static modes are available and the default is 'cards'. (Default: `'grouped'`)
|
|
57
57
|
|
|
58
|
-
**typingStatus** (`boolean | TypingStatusFn`): Show a typing indicator while the agent works. Set
|
|
58
|
+
**typingStatus** (`boolean | TypingStatusFn`): Show a typing indicator while the agent works. Set false to disable, or pass a function to return custom status text per stream chunk (return undefined to fall back to the default for that chunk). (Default: `true`)
|
|
59
59
|
|
|
60
|
-
**waitUntil** (`WaitUntilFn`): Returns a
|
|
60
|
+
**waitUntil** (`WaitUntilFn`): Returns a waitUntil for the current Slack webhook request. Required on serverless runtimes where Hono can't bridge the platform's ExecutionContext (Vercel, AWS Lambda). Without it, the invocation freezes after the 200 ack and kills the run mid-flight. Pass the bare waitUntil(promise) from your platform SDK (for example, @vercel/functions). Cloudflare Workers and Netlify users typically don't need this.
|
|
61
61
|
|
|
62
|
-
**resolveWaitUntil** (`WaitUntilResolver`): Resolve
|
|
62
|
+
**resolveWaitUntil** (`WaitUntilResolver`): Resolve waitUntil from the request's Hono Context when the runtime exposes it through the request and core's default doesn't cover it. Resolution order: waitUntil → resolveWaitUntil → core default.
|
|
63
63
|
|
|
64
|
-
**handlers** (`ChannelHandlers`): Override built-in event handlers (
|
|
64
|
+
**handlers** (`ChannelHandlers`): Override built-in event handlers (onDirectMessage, onMention). Forwarded to AgentChannels for every agent connected via this provider.
|
|
65
65
|
|
|
66
66
|
**inlineMedia** (`ChannelConfig['inlineMedia']`): Which media types to send inline to the model.
|
|
67
67
|
|
|
@@ -69,13 +69,13 @@ await slack.configure({
|
|
|
69
69
|
|
|
70
70
|
**threadContext** (`ChannelConfig['threadContext']`): Fetch recent thread messages from Slack when the agent joins mid-conversation.
|
|
71
71
|
|
|
72
|
-
**tools** (`ChannelConfig['tools']`): Whether to include channel tools (
|
|
72
|
+
**tools** (`ChannelConfig['tools']`): Whether to include channel tools (add\_reaction, remove\_reaction).
|
|
73
73
|
|
|
74
|
-
**state** (`ChannelConfig['state']`): State adapter for message deduplication, locking, and subscriptions. Defaults to the
|
|
74
|
+
**state** (`ChannelConfig['state']`): State adapter for message deduplication, locking, and subscriptions. Defaults to the MastraStateAdapter backed by the Mastra instance's configured storage, so subscriptions persist across restarts.
|
|
75
75
|
|
|
76
76
|
**chatOptions** (`ChannelConfig['chatOptions']`): Additional options passed directly to the Chat SDK.
|
|
77
77
|
|
|
78
|
-
**logger** (`SlackAdapterConfig['logger']`): Logger forwarded to the underlying
|
|
78
|
+
**logger** (`SlackAdapterConfig['logger']`): Logger forwarded to the underlying SlackAdapter. Defaults to the adapter's ConsoleLogger.
|
|
79
79
|
|
|
80
80
|
## Methods
|
|
81
81
|
|
|
@@ -113,7 +113,7 @@ interface ChannelConnectResult {
|
|
|
113
113
|
|
|
114
114
|
**manifest** (`(defaults: SlackAppManifest) => SlackAppManifest`): Customize the Slack app manifest before it is sent to the Manifest API. Receives the default manifest and returns the final one. Use it for custom scopes, additional events, or interactivity settings.
|
|
115
115
|
|
|
116
|
-
**redirectUrl** (`string`): URL to redirect to after successful OAuth completion. Defaults to the provider's
|
|
116
|
+
**redirectUrl** (`string`): URL to redirect to after successful OAuth completion. Defaults to the provider's redirectPath or /.
|
|
117
117
|
|
|
118
118
|
#### `disconnect(agentId)`
|
|
119
119
|
|