@mastra/mcp-docs-server 0.13.7 → 0.13.8-alpha.1
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/organized/changelogs/%40internal%2Fstorage-test-utils.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +67 -67
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +44 -44
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +78 -78
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +52 -52
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +52 -52
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +81 -81
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +36 -36
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +47 -47
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Flance.md +30 -0
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +50 -50
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +51 -51
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +43 -43
- package/.docs/organized/changelogs/%40mastra%2Fmem0.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +51 -51
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +48 -48
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +32 -0
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +58 -58
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +58 -58
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Frag.md +46 -46
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +65 -65
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +49 -49
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +43 -43
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +31 -31
- package/.docs/organized/changelogs/create-mastra.md +10 -10
- package/.docs/organized/changelogs/mastra.md +79 -79
- package/.docs/raw/agents/overview.mdx +52 -47
- package/.docs/raw/community/contributing-templates.mdx +1 -0
- package/.docs/raw/memory/overview.mdx +3 -1
- package/.docs/raw/memory/working-memory.mdx +67 -0
- package/.docs/raw/observability/logging.mdx +94 -19
- package/.docs/raw/reference/observability/logger.mdx +69 -50
- package/.docs/raw/reference/observability/providers/langfuse.mdx +47 -14
- package/.docs/raw/reference/workflows/dountil.mdx +1 -2
- package/.docs/raw/reference/workflows/dowhile.mdx +1 -2
- package/.docs/raw/reference/workflows/resume.mdx +13 -3
- package/.docs/raw/reference/workflows/step.mdx +0 -1
- package/.docs/raw/workflows/suspend-and-resume.mdx +13 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/logger.d.ts +11 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/prepare-docs/code-examples.d.ts +5 -0
- package/dist/prepare-docs/code-examples.d.ts.map +1 -0
- package/dist/prepare-docs/copy-raw.d.ts +2 -0
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -0
- package/dist/prepare-docs/package-changes.d.ts +5 -0
- package/dist/prepare-docs/package-changes.d.ts.map +1 -0
- package/dist/prepare-docs/prepare.d.ts +2 -1
- package/dist/prepare-docs/prepare.d.ts.map +1 -0
- package/dist/stdio.d.ts +2 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/tools/__tests__/test-setup.d.ts +5 -0
- package/dist/tools/__tests__/test-setup.d.ts.map +1 -0
- package/dist/tools/blog.d.ts +22 -0
- package/dist/tools/blog.d.ts.map +1 -0
- package/dist/tools/changes.d.ts +22 -0
- package/dist/tools/changes.d.ts.map +1 -0
- package/dist/tools/course.d.ts +85 -0
- package/dist/tools/course.d.ts.map +1 -0
- package/dist/tools/docs.d.ts +28 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/examples.d.ts +28 -0
- package/dist/tools/examples.d.ts.map +1 -0
- package/dist/utils.d.ts +62 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +5 -5
- package/dist/_tsup-dts-rollup.d.ts +0 -304
|
@@ -1,86 +1,98 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Reference:
|
|
3
|
-
description: Documentation for
|
|
2
|
+
title: "Reference: PinoLogger | Mastra Observability Docs"
|
|
3
|
+
description: Documentation for PinoLogger, which provides methods to record events at various severity levels.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# PinoLogger
|
|
7
7
|
|
|
8
|
-
A Logger instance is created
|
|
8
|
+
A Logger instance is created using `new PinoLogger()` and provides methods to record events at various severity levels.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
When deploying to Mastra Cloud, logs are displayed on the [Logs](../../docs/mastra-cloud/dashboard.mdx#logs) page. In self-hosted or custom environments, logs can be directed to files or external services depending on the configured transports.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
// Using a console logger
|
|
14
|
-
const logger = new PinoLogger({ name: "Mastra", level: "info" });
|
|
12
|
+
## Usage example
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
logger
|
|
14
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers copy
|
|
15
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
16
|
+
import { PinoLogger } from '@mastra/loggers';
|
|
17
|
+
|
|
18
|
+
export const mastra = new Mastra({
|
|
19
|
+
// ...
|
|
20
|
+
logger: new PinoLogger({
|
|
21
|
+
name: 'Mastra',
|
|
22
|
+
level: 'info',
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
##
|
|
27
|
+
## Parameters
|
|
26
28
|
|
|
27
29
|
<PropertiesTable
|
|
28
30
|
content={[
|
|
29
31
|
{
|
|
30
|
-
name: "
|
|
31
|
-
type: "
|
|
32
|
-
description: "
|
|
32
|
+
name: "name",
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "A label used to group and identify logs from this logger.",
|
|
33
35
|
},
|
|
34
|
-
|
|
35
|
-
name: "
|
|
36
|
-
type: "
|
|
37
|
-
description: "
|
|
36
|
+
{
|
|
37
|
+
name: "level",
|
|
38
|
+
type: `"debug" | "info" | "warn" | "error"`,
|
|
39
|
+
description: "Sets the minimum log level. Messages below this level are ignored.",
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
|
-
name: "
|
|
41
|
-
type: "
|
|
42
|
-
description: "
|
|
42
|
+
name: "transports",
|
|
43
|
+
type: "Record<string, LoggerTransport>",
|
|
44
|
+
description: "A map of transport instances used to persist logs.",
|
|
43
45
|
},
|
|
44
46
|
{
|
|
45
|
-
name: "
|
|
46
|
-
type: "
|
|
47
|
-
|
|
47
|
+
name: "overrideDefaultTransports",
|
|
48
|
+
type: "boolean",
|
|
49
|
+
isOptional: true,
|
|
50
|
+
description: "If true, disables the default console transport.",
|
|
48
51
|
},
|
|
49
52
|
{
|
|
50
|
-
name: "
|
|
51
|
-
type: "
|
|
53
|
+
name: "formatters",
|
|
54
|
+
type: "pino.LoggerOptions['formatters']",
|
|
52
55
|
isOptional: true,
|
|
53
|
-
description:
|
|
54
|
-
"Cleanup resources held by the logger (e.g., network connections for Upstash). Not all loggers implement this.",
|
|
56
|
+
description: "Custom Pino formatters for log serialization.",
|
|
55
57
|
},
|
|
56
58
|
]}
|
|
57
59
|
/>
|
|
58
60
|
|
|
59
|
-
**Note:** Some loggers require a `BaseLogMessage` object (with `message`, `destinationPath`, `type` fields). For instance, the `File` and `Upstash` loggers need structured messages.
|
|
60
61
|
|
|
61
|
-
## File
|
|
62
|
+
## File transport (structured logs)
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
Writes structured logs to a file using the `FileTransport`. The logger accepts a plain message as the first argument and structured metadata as the second argument. These are internally converted to a `BaseLogMessage` and persisted to the configured file path.
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
```typescript filename="src/mastra/loggers/file-transport.ts" showLineNumbers copy
|
|
64
68
|
import { FileTransport } from "@mastra/loggers/file";
|
|
69
|
+
import { PinoLogger } from "@mastra/loggers/pino";
|
|
65
70
|
|
|
66
|
-
const fileLogger = new PinoLogger({
|
|
71
|
+
export const fileLogger = new PinoLogger({
|
|
67
72
|
name: "Mastra",
|
|
68
73
|
transports: { file: new FileTransport({ path: "test-dir/test.log" }) },
|
|
69
74
|
level: "warn",
|
|
70
75
|
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### File transport usage
|
|
71
79
|
|
|
80
|
+
```typescript showLineNumbers copy
|
|
72
81
|
fileLogger.warn("Low disk space", {
|
|
73
82
|
destinationPath: "system",
|
|
74
83
|
type: "WORKFLOW",
|
|
75
84
|
});
|
|
76
85
|
```
|
|
77
86
|
|
|
78
|
-
## Upstash
|
|
87
|
+
## Upstash transport (remote log drain)
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
Streams structured logs to a remote Redis list using the `UpstashTransport`. The logger accepts a string message and a structured metadata object. This enables centralized logging for distributed environments, supporting filtering by `destinationPath`, `type`, and `runId`.
|
|
90
|
+
|
|
91
|
+
```typescript filename="src/mastra/loggers/upstash-transport.ts" showLineNumbers copy
|
|
81
92
|
import { UpstashTransport } from "@mastra/loggers/upstash";
|
|
93
|
+
import { PinoLogger } from "@mastra/loggers/pino";
|
|
82
94
|
|
|
83
|
-
const
|
|
95
|
+
export const upstashLogger = new PinoLogger({
|
|
84
96
|
name: "Mastra",
|
|
85
97
|
transports: {
|
|
86
98
|
upstash: new UpstashTransport({
|
|
@@ -91,28 +103,35 @@ const logger = new PinoLogger({
|
|
|
91
103
|
},
|
|
92
104
|
level: "info",
|
|
93
105
|
});
|
|
106
|
+
```
|
|
94
107
|
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
|
|
109
|
+
### Upstash transport usage
|
|
110
|
+
|
|
111
|
+
```typescript showLineNumbers copy
|
|
112
|
+
upstashLogger.info("User signed in", {
|
|
97
113
|
destinationPath: "auth",
|
|
98
114
|
type: "AGENT",
|
|
99
115
|
runId: "run_123",
|
|
100
116
|
});
|
|
101
117
|
```
|
|
102
118
|
|
|
103
|
-
## Custom
|
|
119
|
+
## Custom transport
|
|
104
120
|
|
|
105
121
|
You can create custom transports using the `createCustomTransport` utility to integrate with any logging service or stream.
|
|
106
122
|
|
|
107
|
-
###
|
|
123
|
+
### Sentry transport example
|
|
108
124
|
|
|
109
|
-
|
|
125
|
+
Creates a custom transport using `createCustomTransport` and integrates it with a third-party logging stream such as `pino-sentry-transport`. This allows forwarding logs to an external system like Sentry for advanced monitoring and observability.
|
|
126
|
+
|
|
127
|
+
```typescript filename="src/mastra/loggers/sentry-transport.ts" showLineNumbers copy
|
|
110
128
|
import { createCustomTransport } from "@mastra/core/loggers";
|
|
111
|
-
import
|
|
129
|
+
import { PinoLogger } from "@mastra/loggers/pino";
|
|
130
|
+
import pinoSentry from "pino-sentry-transport";
|
|
112
131
|
|
|
113
132
|
const sentryStream = await pinoSentry({
|
|
114
133
|
sentry: {
|
|
115
|
-
dsn:
|
|
134
|
+
dsn: "YOUR_SENTRY_DSN",
|
|
116
135
|
_experiments: {
|
|
117
136
|
enableLogs: true,
|
|
118
137
|
},
|
|
@@ -121,9 +140,9 @@ const sentryStream = await pinoSentry({
|
|
|
121
140
|
|
|
122
141
|
const customTransport = createCustomTransport(sentryStream);
|
|
123
142
|
|
|
124
|
-
const
|
|
143
|
+
export const sentryLogger = new PinoLogger({
|
|
125
144
|
name: "Mastra",
|
|
126
|
-
transports: { sentry: customTransport },
|
|
127
145
|
level: "info",
|
|
146
|
+
transports: { sentry: customTransport },
|
|
128
147
|
});
|
|
129
|
-
```
|
|
148
|
+
```
|
|
@@ -11,36 +11,69 @@ Langfuse is an open-source observability platform designed specifically for LLM
|
|
|
11
11
|
|
|
12
12
|
## Configuration
|
|
13
13
|
|
|
14
|
-
To use Langfuse with Mastra, you
|
|
14
|
+
To use Langfuse with Mastra, you can configure it using either environment variables or directly in your Mastra configuration.
|
|
15
|
+
|
|
16
|
+
### Using Environment Variables
|
|
17
|
+
|
|
18
|
+
Set the following environment variables:
|
|
15
19
|
|
|
16
20
|
```env
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
OTEL_EXPORTER_OTLP_ENDPOINT="https://cloud.langfuse.com/api/public/otel/v1/traces" # 🇪🇺 EU data region
|
|
22
|
+
# OTEL_EXPORTER_OTLP_ENDPOINT="https://us.cloud.langfuse.com/api/public/otel/v1/traces" # 🇺🇸 US data region
|
|
23
|
+
|
|
24
|
+
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic ${AUTH_STRING}"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Where `AUTH_STRING` is the base64-encoded combination of your public and secret keys (see below).
|
|
28
|
+
|
|
29
|
+
### Generating AUTH_STRING
|
|
30
|
+
|
|
31
|
+
The authorization uses basic auth with your Langfuse API keys. You can generate the base64-encoded auth string using:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
echo -n "pk-lf-1234567890:sk-lf-1234567890" | base64
|
|
20
35
|
```
|
|
21
36
|
|
|
22
|
-
|
|
37
|
+
For long API keys on GNU systems, you may need to add `-w 0` to prevent auto-wrapping:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
echo -n "pk-lf-1234567890:sk-lf-1234567890" | base64 -w 0
|
|
41
|
+
```
|
|
23
42
|
|
|
24
43
|
## Implementation
|
|
25
44
|
|
|
26
|
-
Here's how to configure Mastra to use Langfuse:
|
|
45
|
+
Here's how to configure Mastra to use Langfuse with OpenTelemetry:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { Mastra } from "@mastra/core";
|
|
49
|
+
|
|
50
|
+
export const mastra = new Mastra({
|
|
51
|
+
// ... other config
|
|
52
|
+
telemetry: {
|
|
53
|
+
enabled: true,
|
|
54
|
+
export: {
|
|
55
|
+
type: 'otlp',
|
|
56
|
+
endpoint: 'https://cloud.langfuse.com/api/public/otel/v1/traces', // or your preferred endpoint
|
|
57
|
+
headers: {
|
|
58
|
+
Authorization: `Basic ${AUTH_STRING}`, // Your base64-encoded auth string
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Alternatively, if you're using environment variables, you can simplify the configuration:
|
|
27
66
|
|
|
28
67
|
```typescript
|
|
29
68
|
import { Mastra } from "@mastra/core";
|
|
30
|
-
import { LangfuseExporter } from "langfuse-vercel";
|
|
31
69
|
|
|
32
70
|
export const mastra = new Mastra({
|
|
33
71
|
// ... other config
|
|
34
72
|
telemetry: {
|
|
35
|
-
serviceName: "ai", // this must be set to "ai" so that the LangfuseExporter thinks it's an AI SDK trace
|
|
36
73
|
enabled: true,
|
|
37
74
|
export: {
|
|
38
|
-
type:
|
|
39
|
-
|
|
40
|
-
publicKey: process.env.LANGFUSE_PUBLIC_KEY,
|
|
41
|
-
secretKey: process.env.LANGFUSE_SECRET_KEY,
|
|
42
|
-
baseUrl: process.env.LANGFUSE_BASEURL,
|
|
43
|
-
}),
|
|
75
|
+
type: 'otlp',
|
|
76
|
+
// endpoint and headers will be read from OTEL_EXPORTER_OTLP_* env vars
|
|
44
77
|
},
|
|
45
78
|
},
|
|
46
79
|
});
|
|
@@ -15,12 +15,22 @@ const result = await run.start({ inputData: { startValue: 0 } });
|
|
|
15
15
|
|
|
16
16
|
if (result.status === "suspended") {
|
|
17
17
|
const resumedResults = await run.resume({
|
|
18
|
-
step: result.suspended[0],
|
|
19
18
|
resumeData: { newValue: 0 },
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
21
|
```
|
|
23
22
|
|
|
23
|
+
|
|
24
|
+
For more advanced scenarios where you need to specify the exact step to resume:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
await run.resume({
|
|
28
|
+
step: result.suspended[0], // Explicitly choose which step to resume
|
|
29
|
+
resumeData: { newValue: 0 },
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
> **Note**: When exactly one step is suspended, you can omit the `step` parameter and the workflow will automatically resume that step. For workflows with multiple suspended steps, you must explicitly specify which step to resume.
|
|
33
|
+
|
|
24
34
|
## Parameters
|
|
25
35
|
|
|
26
36
|
<PropertiesTable
|
|
@@ -40,8 +50,8 @@ if (result.status === "suspended") {
|
|
|
40
50
|
{
|
|
41
51
|
name: "step",
|
|
42
52
|
type: "Step | Step[] | string | string[]",
|
|
43
|
-
description: "The step(s) to resume execution from",
|
|
44
|
-
isOptional:
|
|
53
|
+
description: "The step(s) to resume execution from. When omitted, the workflow will automatically resume the suspended step if exactly one step is suspended. Throws an error if multiple steps are suspended and no step is specified.",
|
|
54
|
+
isOptional: true,
|
|
45
55
|
},
|
|
46
56
|
{
|
|
47
57
|
name: "runtimeContext",
|
|
@@ -156,5 +156,4 @@ const processOrder = createStep({
|
|
|
156
156
|
|
|
157
157
|
- [Control flow](../../docs/workflows/control-flow.mdx)
|
|
158
158
|
- [Using agents and tools](../../docs/workflows/using-with-agents-and-tools.mdx)
|
|
159
|
-
- [Tool and agent as step example](../../examples/workflows/agent-and-tool-interop.mdx)
|
|
160
159
|
- [Input data mapping](../../docs/workflows/input-data-mapping.mdx)
|
|
@@ -111,11 +111,11 @@ In this case, the logic resumes the first step listed in the `suspended` array.
|
|
|
111
111
|
}
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
> See [Run Workflow Results](/workflows/overview#run-workflow-results) for more details.
|
|
114
|
+
> See [Run Workflow Results](/docs/workflows/overview#run-workflow-results) for more details.
|
|
115
115
|
|
|
116
116
|
## Resuming a workflow with `resume()`
|
|
117
117
|
|
|
118
|
-
A workflow can be resumed by calling `resume` and providing the required `resumeData`.
|
|
118
|
+
A workflow can be resumed by calling `resume` and providing the required `resumeData`. You can either explicitly specify which step to resume from, or when exactly one step is suspended, omit the `step` parameter and the workflow will automatically resume that step.
|
|
119
119
|
|
|
120
120
|
```typescript {16-18} filename="src/mastra/workflows/test-workflow.ts" showLineNumbers copy
|
|
121
121
|
import { mastra } from "./mastra";
|
|
@@ -142,6 +142,17 @@ if (result.status === "suspended") {
|
|
|
142
142
|
}
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
+
You can also omit the `step` parameter when exactly one step is suspended:
|
|
146
|
+
|
|
147
|
+
```typescript {5} filename="src/mastra/workflows/test-workflow.ts" showLineNumbers copy
|
|
148
|
+
const resumedResult = await run.resume({
|
|
149
|
+
resumeData: {
|
|
150
|
+
city: "Berlin"
|
|
151
|
+
},
|
|
152
|
+
// step parameter omitted - automatically resumes the single suspended step
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
145
156
|
### Resuming nested workflows
|
|
146
157
|
|
|
147
158
|
To resume a suspended nested workflow pass the workflow instance to the `step` parameter of the `resume` function.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAiBxC,QAAA,IAAI,MAAM,EAAE,SAAS,CAAC;AA+BtB,iBAAe,SAAS,kBAQvB;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MCPServer } from '@mastra/mcp';
|
|
2
|
+
export interface Logger {
|
|
3
|
+
info: (message: string, data?: any) => Promise<void>;
|
|
4
|
+
warning: (message: string, data?: any) => Promise<void>;
|
|
5
|
+
error: (message: string, error?: any) => Promise<void>;
|
|
6
|
+
debug: (message: string, data?: any) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const writeErrorLog: (message: string, data?: any) => void;
|
|
9
|
+
export declare function createLogger(server?: MCPServer): Logger;
|
|
10
|
+
export declare const logger: Logger;
|
|
11
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,EAAE,OAAO,GAAG,SA2BxD,CAAC;AAGF,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAoDvD;AAGD,eAAO,MAAM,MAAM,QAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-examples.d.ts","sourceRoot":"","sources":["../../src/prepare-docs/code-examples.ts"],"names":[],"mappings":"AAoCA;;GAEG;AACH,wBAAsB,mBAAmB,kBAmFxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-raw.d.ts","sourceRoot":"","sources":["../../src/prepare-docs/copy-raw.ts"],"names":[],"mappings":"AAgCA,wBAAsB,OAAO,kBAkB5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-changes.d.ts","sourceRoot":"","sources":["../../src/prepare-docs/package-changes.ts"],"names":[],"mappings":"AA8DA;;GAEG;AACH,wBAAsB,qBAAqB,kBAmC1C"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function prepare(): Promise<void>;
|
|
2
|
+
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/prepare-docs/prepare.ts"],"names":[],"mappings":"AAKA,wBAAsB,OAAO,kBAQ5B"}
|
package/dist/stdio.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/test-setup.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAuCxC,eAAO,MAAM,MAAM,wCAGjB,CAAC;AAKH,eAAO,MAAM,GAAG,WAWd,CAAC;AAEH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,mBAsBlD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const blogInputSchema: z.ZodObject<{
|
|
3
|
+
url: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
url: string;
|
|
6
|
+
}, {
|
|
7
|
+
url: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type BlogInput = z.infer<typeof blogInputSchema>;
|
|
10
|
+
export declare const blogTool: {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
parameters: z.ZodObject<{
|
|
14
|
+
url: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
url: string;
|
|
17
|
+
}, {
|
|
18
|
+
url: string;
|
|
19
|
+
}>;
|
|
20
|
+
execute: (args: BlogInput) => Promise<string>;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=blog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blog.d.ts","sourceRoot":"","sources":["../../src/tools/blog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyExB,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,QAAQ;;;;;;;;;;oBAKG,SAAS;CAehC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const changesInputSchema: z.ZodObject<{
|
|
3
|
+
package: z.ZodOptional<z.ZodString>;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
package?: string | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
package?: string | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export type ChangesInput = z.infer<typeof changesInputSchema>;
|
|
10
|
+
export declare const changesTool: {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
parameters: z.ZodObject<{
|
|
14
|
+
package: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
package?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
package?: string | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
execute: (args: ChangesInput) => Promise<string>;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=changes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/tools/changes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuDxB,eAAO,MAAM,kBAAkB;;;;;;EAK7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,WAAW;;;;;;;;;;oBAIA,YAAY;CAgBnC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const _courseLessonSchema: z.ZodObject<{
|
|
3
|
+
lessonName: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
lessonName: string;
|
|
6
|
+
}, {
|
|
7
|
+
lessonName: string;
|
|
8
|
+
}>;
|
|
9
|
+
declare const _confirmationSchema: z.ZodObject<{
|
|
10
|
+
confirm: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
confirm?: boolean | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
confirm?: boolean | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
type CourseState = {
|
|
17
|
+
currentLesson: string;
|
|
18
|
+
lessons: Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
status: number;
|
|
21
|
+
steps: Array<{
|
|
22
|
+
name: string;
|
|
23
|
+
status: number;
|
|
24
|
+
}>;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
export declare function registerUserLocally(email: string): Promise<{
|
|
28
|
+
success: boolean;
|
|
29
|
+
id: string;
|
|
30
|
+
key: string;
|
|
31
|
+
message: string;
|
|
32
|
+
}>;
|
|
33
|
+
export declare function updateCourseStateOnServerLocally(deviceId: string, state: CourseState): Promise<void>;
|
|
34
|
+
export declare const startMastraCourse: {
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
parameters: z.ZodObject<{
|
|
38
|
+
email: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
email?: string | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
email?: string | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
execute: (args: {
|
|
45
|
+
email?: string;
|
|
46
|
+
}) => Promise<string>;
|
|
47
|
+
};
|
|
48
|
+
export declare const getMastraCourseStatus: {
|
|
49
|
+
name: string;
|
|
50
|
+
description: string;
|
|
51
|
+
parameters: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
52
|
+
execute: (_args: Record<string, never>) => Promise<string>;
|
|
53
|
+
};
|
|
54
|
+
export declare const startMastraCourseLesson: {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
parameters: z.ZodObject<{
|
|
58
|
+
lessonName: z.ZodString;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
lessonName: string;
|
|
61
|
+
}, {
|
|
62
|
+
lessonName: string;
|
|
63
|
+
}>;
|
|
64
|
+
execute: (args: z.infer<typeof _courseLessonSchema>) => Promise<string>;
|
|
65
|
+
};
|
|
66
|
+
export declare const nextMastraCourseStep: {
|
|
67
|
+
name: string;
|
|
68
|
+
description: string;
|
|
69
|
+
parameters: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
70
|
+
execute: (_args: Record<string, never>) => Promise<string>;
|
|
71
|
+
};
|
|
72
|
+
export declare const clearMastraCourseHistory: {
|
|
73
|
+
name: string;
|
|
74
|
+
description: string;
|
|
75
|
+
parameters: z.ZodObject<{
|
|
76
|
+
confirm: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
confirm?: boolean | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
confirm?: boolean | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
execute: (args: z.infer<typeof _confirmationSchema>) => Promise<string>;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=course.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course.d.ts","sourceRoot":"","sources":["../../src/tools/course.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,mBAAmB;;;;;;EAEvB,CAAC;AAEH,QAAA,MAAM,mBAAmB;;;;;;EAEvB,CAAC;AAGH,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,KAAK,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC,CAAC;KACJ,CAAC,CAAC;CACJ,CAAC;AAqGF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAmCzE;AA+CD,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDpG;AA6LD,eAAO,MAAM,iBAAiB;;;;;;;;;;oBAON;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;CA0HzC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;qBAIT,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;CAqF7C,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;oBAKZ,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC;CAwD1D,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;qBAKR,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;CA4F7C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;oBAKb,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC;CA8B1D,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const docsInputSchema: z.ZodObject<{
|
|
3
|
+
paths: z.ZodArray<z.ZodString, "many">;
|
|
4
|
+
queryKeywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
paths: string[];
|
|
7
|
+
queryKeywords?: string[] | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
paths: string[];
|
|
10
|
+
queryKeywords?: string[] | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type DocsInput = z.infer<typeof docsInputSchema>;
|
|
13
|
+
export declare const docsTool: {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
parameters: z.ZodObject<{
|
|
17
|
+
paths: z.ZodArray<z.ZodString, "many">;
|
|
18
|
+
queryKeywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
paths: string[];
|
|
21
|
+
queryKeywords?: string[] | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
paths: string[];
|
|
24
|
+
queryKeywords?: string[] | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
execute: (args: DocsInput) => Promise<string>;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/tools/docs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4JxB,eAAO,MAAM,eAAe;;;;;;;;;EAW1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;oBAkBG,SAAS;CAiDhC,CAAC"}
|