@frontmcp/sdk 0.5.0 → 0.5.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.
Files changed (26) hide show
  1. package/README.md +3 -3
  2. package/package.json +4 -4
  3. package/src/common/metadata/tool.metadata.d.ts +32 -0
  4. package/src/common/schemas/http-output.schema.d.ts +10 -2
  5. package/src/completion/flows/complete.flow.d.ts +17 -2
  6. package/src/logging/flows/set-level.flow.d.ts +17 -2
  7. package/src/prompt/flows/get-prompt.flow.d.ts +97 -2
  8. package/src/prompt/flows/prompts-list.flow.d.ts +12 -1
  9. package/src/resource/flows/read-resource.flow.d.ts +22 -3
  10. package/src/resource/flows/resource-templates-list.flow.d.ts +20 -1
  11. package/src/resource/flows/resources-list.flow.d.ts +20 -1
  12. package/src/resource/flows/subscribe-resource.flow.d.ts +17 -2
  13. package/src/resource/flows/unsubscribe-resource.flow.d.ts +17 -2
  14. package/src/tool/flows/call-tool.flow.d.ts +97 -2
  15. package/src/tool/flows/tools-list.flow.d.ts +19 -1
  16. package/src/transport/mcp-handlers/complete-request.handler.d.ts +27 -1
  17. package/src/transport/mcp-handlers/get-prompt-request.handler.d.ts +52 -1
  18. package/src/transport/mcp-handlers/index.d.ts +413 -7
  19. package/src/transport/mcp-handlers/list-prompts-request.handler.d.ts +27 -1
  20. package/src/transport/mcp-handlers/list-resource-templates-request.handler.d.ts +32 -1
  21. package/src/transport/mcp-handlers/list-resources-request.handler.d.ts +32 -1
  22. package/src/transport/mcp-handlers/list-tools-request.handler.d.ts +30 -1
  23. package/src/transport/mcp-handlers/logging-set-level-request.handler.d.ts +20 -0
  24. package/src/transport/mcp-handlers/read-resource-request.handler.d.ts +27 -1
  25. package/src/transport/mcp-handlers/subscribe-request.handler.d.ts +20 -0
  26. package/src/transport/mcp-handlers/unsubscribe-request.handler.d.ts +20 -0
@@ -5,8 +5,15 @@ declare const inputSchema: z.ZodObject<{
5
5
  request: z.ZodObject<{
6
6
  method: z.ZodLiteral<"tools/call">;
7
7
  params: z.ZodObject<{
8
+ task: z.ZodOptional<z.ZodObject<{
9
+ ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodNull]>>;
10
+ pollInterval: z.ZodOptional<z.ZodNumber>;
11
+ }, z.core.$loose>>;
8
12
  _meta: z.ZodOptional<z.ZodObject<{
9
13
  progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
14
+ "io.modelcontextprotocol/related-task": z.ZodOptional<z.ZodObject<{
15
+ taskId: z.ZodString;
16
+ }, z.core.$loose>>;
10
17
  }, z.core.$loose>>;
11
18
  name: z.ZodString;
12
19
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -15,25 +22,61 @@ declare const inputSchema: z.ZodObject<{
15
22
  ctx: z.ZodAny;
16
23
  }, z.core.$strip>;
17
24
  declare const outputSchema: z.ZodObject<{
18
- _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
25
+ _meta: z.ZodOptional<z.ZodObject<{
26
+ "io.modelcontextprotocol/related-task": z.ZodOptional<z.ZodObject<{
27
+ taskId: z.ZodString;
28
+ }, z.core.$loose>>;
29
+ }, z.core.$loose>>;
19
30
  content: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
20
31
  type: z.ZodLiteral<"text">;
21
32
  text: z.ZodString;
33
+ annotations: z.ZodOptional<z.ZodObject<{
34
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
35
+ user: "user";
36
+ assistant: "assistant";
37
+ }>>>;
38
+ priority: z.ZodOptional<z.ZodNumber>;
39
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
40
+ }, z.core.$strip>>;
22
41
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
23
42
  }, z.core.$strip>, z.ZodObject<{
24
43
  type: z.ZodLiteral<"image">;
25
44
  data: z.ZodString;
26
45
  mimeType: z.ZodString;
46
+ annotations: z.ZodOptional<z.ZodObject<{
47
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
48
+ user: "user";
49
+ assistant: "assistant";
50
+ }>>>;
51
+ priority: z.ZodOptional<z.ZodNumber>;
52
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
53
+ }, z.core.$strip>>;
27
54
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
28
55
  }, z.core.$strip>, z.ZodObject<{
29
56
  type: z.ZodLiteral<"audio">;
30
57
  data: z.ZodString;
31
58
  mimeType: z.ZodString;
59
+ annotations: z.ZodOptional<z.ZodObject<{
60
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
61
+ user: "user";
62
+ assistant: "assistant";
63
+ }>>>;
64
+ priority: z.ZodOptional<z.ZodNumber>;
65
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
66
+ }, z.core.$strip>>;
32
67
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
33
68
  }, z.core.$strip>, z.ZodObject<{
34
69
  uri: z.ZodString;
35
70
  description: z.ZodOptional<z.ZodString>;
36
71
  mimeType: z.ZodOptional<z.ZodString>;
72
+ annotations: z.ZodOptional<z.ZodObject<{
73
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
74
+ user: "user";
75
+ assistant: "assistant";
76
+ }>>>;
77
+ priority: z.ZodOptional<z.ZodNumber>;
78
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
79
+ }, z.core.$strip>>;
37
80
  _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
38
81
  icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
39
82
  src: z.ZodString;
@@ -56,6 +99,14 @@ declare const outputSchema: z.ZodObject<{
56
99
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
57
100
  blob: z.ZodString;
58
101
  }, z.core.$strip>]>;
102
+ annotations: z.ZodOptional<z.ZodObject<{
103
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
104
+ user: "user";
105
+ assistant: "assistant";
106
+ }>>>;
107
+ priority: z.ZodOptional<z.ZodNumber>;
108
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
109
+ }, z.core.$strip>>;
59
110
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
60
111
  }, z.core.$strip>]>>>;
61
112
  structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -79,25 +130,61 @@ declare const stateSchema: z.ZodObject<{
79
130
  }>, import("../../common").ToolOutputType, unknown, unknown>>;
80
131
  rawOutput: z.ZodOptional<z.ZodAny>;
81
132
  output: z.ZodObject<{
82
- _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
133
+ _meta: z.ZodOptional<z.ZodObject<{
134
+ "io.modelcontextprotocol/related-task": z.ZodOptional<z.ZodObject<{
135
+ taskId: z.ZodString;
136
+ }, z.core.$loose>>;
137
+ }, z.core.$loose>>;
83
138
  content: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
84
139
  type: z.ZodLiteral<"text">;
85
140
  text: z.ZodString;
141
+ annotations: z.ZodOptional<z.ZodObject<{
142
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
143
+ user: "user";
144
+ assistant: "assistant";
145
+ }>>>;
146
+ priority: z.ZodOptional<z.ZodNumber>;
147
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
148
+ }, z.core.$strip>>;
86
149
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
87
150
  }, z.core.$strip>, z.ZodObject<{
88
151
  type: z.ZodLiteral<"image">;
89
152
  data: z.ZodString;
90
153
  mimeType: z.ZodString;
154
+ annotations: z.ZodOptional<z.ZodObject<{
155
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
156
+ user: "user";
157
+ assistant: "assistant";
158
+ }>>>;
159
+ priority: z.ZodOptional<z.ZodNumber>;
160
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
161
+ }, z.core.$strip>>;
91
162
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
92
163
  }, z.core.$strip>, z.ZodObject<{
93
164
  type: z.ZodLiteral<"audio">;
94
165
  data: z.ZodString;
95
166
  mimeType: z.ZodString;
167
+ annotations: z.ZodOptional<z.ZodObject<{
168
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
169
+ user: "user";
170
+ assistant: "assistant";
171
+ }>>>;
172
+ priority: z.ZodOptional<z.ZodNumber>;
173
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
174
+ }, z.core.$strip>>;
96
175
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
97
176
  }, z.core.$strip>, z.ZodObject<{
98
177
  uri: z.ZodString;
99
178
  description: z.ZodOptional<z.ZodString>;
100
179
  mimeType: z.ZodOptional<z.ZodString>;
180
+ annotations: z.ZodOptional<z.ZodObject<{
181
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
182
+ user: "user";
183
+ assistant: "assistant";
184
+ }>>>;
185
+ priority: z.ZodOptional<z.ZodNumber>;
186
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
187
+ }, z.core.$strip>>;
101
188
  _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
102
189
  icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
103
190
  src: z.ZodString;
@@ -120,6 +207,14 @@ declare const stateSchema: z.ZodObject<{
120
207
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
121
208
  blob: z.ZodString;
122
209
  }, z.core.$strip>]>;
210
+ annotations: z.ZodOptional<z.ZodObject<{
211
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
212
+ user: "user";
213
+ assistant: "assistant";
214
+ }>>>;
215
+ priority: z.ZodOptional<z.ZodNumber>;
216
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
217
+ }, z.core.$strip>>;
123
218
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
124
219
  }, z.core.$strip>]>>>;
125
220
  structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -4,8 +4,15 @@ import { z } from 'zod';
4
4
  declare const inputSchema: z.ZodObject<{
5
5
  request: z.ZodObject<{
6
6
  params: z.ZodOptional<z.ZodObject<{
7
+ task: z.ZodOptional<z.ZodObject<{
8
+ ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodNull]>>;
9
+ pollInterval: z.ZodOptional<z.ZodNumber>;
10
+ }, z.core.$loose>>;
7
11
  _meta: z.ZodOptional<z.ZodObject<{
8
12
  progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
13
+ "io.modelcontextprotocol/related-task": z.ZodOptional<z.ZodObject<{
14
+ taskId: z.ZodString;
15
+ }, z.core.$loose>>;
9
16
  }, z.core.$loose>>;
10
17
  cursor: z.ZodOptional<z.ZodString>;
11
18
  }, z.core.$loose>>;
@@ -14,7 +21,11 @@ declare const inputSchema: z.ZodObject<{
14
21
  ctx: z.ZodUnknown;
15
22
  }, z.core.$strip>;
16
23
  declare const outputSchema: z.ZodObject<{
17
- _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
24
+ _meta: z.ZodOptional<z.ZodObject<{
25
+ "io.modelcontextprotocol/related-task": z.ZodOptional<z.ZodObject<{
26
+ taskId: z.ZodString;
27
+ }, z.core.$loose>>;
28
+ }, z.core.$loose>>;
18
29
  nextCursor: z.ZodOptional<z.ZodString>;
19
30
  tools: z.ZodArray<z.ZodObject<{
20
31
  description: z.ZodOptional<z.ZodString>;
@@ -35,6 +46,13 @@ declare const outputSchema: z.ZodObject<{
35
46
  idempotentHint: z.ZodOptional<z.ZodBoolean>;
36
47
  openWorldHint: z.ZodOptional<z.ZodBoolean>;
37
48
  }, z.core.$strip>>;
49
+ execution: z.ZodOptional<z.ZodObject<{
50
+ taskSupport: z.ZodOptional<z.ZodEnum<{
51
+ optional: "optional";
52
+ required: "required";
53
+ forbidden: "forbidden";
54
+ }>>;
55
+ }, z.core.$strip>>;
38
56
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
39
57
  icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
58
  src: z.ZodString;
@@ -4,8 +4,15 @@ export default function CompleteRequestHandler({ scope }: McpHandlerOptions): {
4
4
  requestSchema: import("zod").ZodObject<{
5
5
  method: import("zod").ZodLiteral<"completion/complete">;
6
6
  params: import("zod").ZodObject<{
7
+ task: import("zod").ZodOptional<import("zod").ZodObject<{
8
+ ttl: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodNull]>>;
9
+ pollInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
10
+ }, import("zod/v4/core").$loose>>;
7
11
  _meta: import("zod").ZodOptional<import("zod").ZodObject<{
8
12
  progressToken: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
13
+ "io.modelcontextprotocol/related-task": import("zod").ZodOptional<import("zod").ZodObject<{
14
+ taskId: import("zod").ZodString;
15
+ }, import("zod/v4/core").$loose>>;
9
16
  }, import("zod/v4/core").$loose>>;
10
17
  ref: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
11
18
  type: import("zod").ZodLiteral<"ref/prompt">;
@@ -38,9 +45,18 @@ export default function CompleteRequestHandler({ scope }: McpHandlerOptions): {
38
45
  name: string;
39
46
  value: string;
40
47
  };
48
+ task?: {
49
+ [x: string]: unknown;
50
+ ttl?: number | null | undefined;
51
+ pollInterval?: number | undefined;
52
+ } | undefined;
41
53
  _meta?: {
42
54
  [x: string]: unknown;
43
55
  progressToken?: string | number | undefined;
56
+ "io.modelcontextprotocol/related-task"?: {
57
+ [x: string]: unknown;
58
+ taskId: string;
59
+ } | undefined;
44
60
  } | undefined;
45
61
  context?: {
46
62
  arguments?: {
@@ -54,6 +70,10 @@ export default function CompleteRequestHandler({ scope }: McpHandlerOptions): {
54
70
  [x: string]: unknown;
55
71
  _meta?: {
56
72
  [x: string]: unknown;
73
+ "io.modelcontextprotocol/related-task"?: {
74
+ [x: string]: unknown;
75
+ taskId: string;
76
+ } | undefined;
57
77
  } | undefined;
58
78
  } | undefined;
59
79
  }>) => Promise<{
@@ -64,6 +84,12 @@ export default function CompleteRequestHandler({ scope }: McpHandlerOptions): {
64
84
  total?: number | undefined;
65
85
  hasMore?: boolean | undefined;
66
86
  };
67
- _meta?: Record<string, unknown> | undefined;
87
+ _meta?: {
88
+ [x: string]: unknown;
89
+ "io.modelcontextprotocol/related-task"?: {
90
+ [x: string]: unknown;
91
+ taskId: string;
92
+ } | undefined;
93
+ } | undefined;
68
94
  }>;
69
95
  };
@@ -4,8 +4,15 @@ export default function GetPromptRequestHandler({ scope }: McpHandlerOptions): {
4
4
  requestSchema: import("zod").ZodObject<{
5
5
  method: import("zod").ZodLiteral<"prompts/get">;
6
6
  params: import("zod").ZodObject<{
7
+ task: import("zod").ZodOptional<import("zod").ZodObject<{
8
+ ttl: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodNull]>>;
9
+ pollInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
10
+ }, import("zod/v4/core").$loose>>;
7
11
  _meta: import("zod").ZodOptional<import("zod").ZodObject<{
8
12
  progressToken: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
13
+ "io.modelcontextprotocol/related-task": import("zod").ZodOptional<import("zod").ZodObject<{
14
+ taskId: import("zod").ZodString;
15
+ }, import("zod/v4/core").$loose>>;
9
16
  }, import("zod/v4/core").$loose>>;
10
17
  name: import("zod").ZodString;
11
18
  arguments: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
@@ -16,9 +23,18 @@ export default function GetPromptRequestHandler({ scope }: McpHandlerOptions): {
16
23
  params: {
17
24
  [x: string]: unknown;
18
25
  name: string;
26
+ task?: {
27
+ [x: string]: unknown;
28
+ ttl?: number | null | undefined;
29
+ pollInterval?: number | undefined;
30
+ } | undefined;
19
31
  _meta?: {
20
32
  [x: string]: unknown;
21
33
  progressToken?: string | number | undefined;
34
+ "io.modelcontextprotocol/related-task"?: {
35
+ [x: string]: unknown;
36
+ taskId: string;
37
+ } | undefined;
22
38
  } | undefined;
23
39
  arguments?: {
24
40
  [x: string]: string;
@@ -30,6 +46,10 @@ export default function GetPromptRequestHandler({ scope }: McpHandlerOptions): {
30
46
  [x: string]: unknown;
31
47
  _meta?: {
32
48
  [x: string]: unknown;
49
+ "io.modelcontextprotocol/related-task"?: {
50
+ [x: string]: unknown;
51
+ taskId: string;
52
+ } | undefined;
33
53
  } | undefined;
34
54
  } | undefined;
35
55
  }>) => Promise<{
@@ -39,16 +59,31 @@ export default function GetPromptRequestHandler({ scope }: McpHandlerOptions): {
39
59
  content: {
40
60
  type: "text";
41
61
  text: string;
62
+ annotations?: {
63
+ audience?: ("user" | "assistant")[] | undefined;
64
+ priority?: number | undefined;
65
+ lastModified?: string | undefined;
66
+ } | undefined;
42
67
  _meta?: Record<string, unknown> | undefined;
43
68
  } | {
44
69
  type: "image";
45
70
  data: string;
46
71
  mimeType: string;
72
+ annotations?: {
73
+ audience?: ("user" | "assistant")[] | undefined;
74
+ priority?: number | undefined;
75
+ lastModified?: string | undefined;
76
+ } | undefined;
47
77
  _meta?: Record<string, unknown> | undefined;
48
78
  } | {
49
79
  type: "audio";
50
80
  data: string;
51
81
  mimeType: string;
82
+ annotations?: {
83
+ audience?: ("user" | "assistant")[] | undefined;
84
+ priority?: number | undefined;
85
+ lastModified?: string | undefined;
86
+ } | undefined;
52
87
  _meta?: Record<string, unknown> | undefined;
53
88
  } | {
54
89
  uri: string;
@@ -56,6 +91,11 @@ export default function GetPromptRequestHandler({ scope }: McpHandlerOptions): {
56
91
  type: "resource_link";
57
92
  description?: string | undefined;
58
93
  mimeType?: string | undefined;
94
+ annotations?: {
95
+ audience?: ("user" | "assistant")[] | undefined;
96
+ priority?: number | undefined;
97
+ lastModified?: string | undefined;
98
+ } | undefined;
59
99
  _meta?: {
60
100
  [x: string]: unknown;
61
101
  } | undefined;
@@ -78,10 +118,21 @@ export default function GetPromptRequestHandler({ scope }: McpHandlerOptions): {
78
118
  mimeType?: string | undefined;
79
119
  _meta?: Record<string, unknown> | undefined;
80
120
  };
121
+ annotations?: {
122
+ audience?: ("user" | "assistant")[] | undefined;
123
+ priority?: number | undefined;
124
+ lastModified?: string | undefined;
125
+ } | undefined;
81
126
  _meta?: Record<string, unknown> | undefined;
82
127
  };
83
128
  }[];
84
- _meta?: Record<string, unknown> | undefined;
129
+ _meta?: {
130
+ [x: string]: unknown;
131
+ "io.modelcontextprotocol/related-task"?: {
132
+ [x: string]: unknown;
133
+ taskId: string;
134
+ } | undefined;
135
+ } | undefined;
85
136
  description?: string | undefined;
86
137
  }>;
87
138
  };