@mastra/core 0.10.12 → 0.10.13

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 (235) hide show
  1. package/package.json +1 -1
  2. package/a2a.d.ts +0 -1
  3. package/agent.d.ts +0 -1
  4. package/base.d.ts +0 -1
  5. package/bundler.d.ts +0 -1
  6. package/deployer.d.ts +0 -1
  7. package/di.d.ts +0 -1
  8. package/dist/a2a/index.cjs +0 -79
  9. package/dist/a2a/index.d.cts +0 -780
  10. package/dist/a2a/index.d.ts +0 -780
  11. package/dist/a2a/index.js +0 -68
  12. package/dist/agent/index.cjs +0 -15
  13. package/dist/agent/index.d.cts +0 -29
  14. package/dist/agent/index.d.ts +0 -29
  15. package/dist/agent/index.js +0 -2
  16. package/dist/base-B_y9sMg0.d.cts +0 -162
  17. package/dist/base-CS5eSXbL.d.cts +0 -4117
  18. package/dist/base-ClrXcCRx.d.ts +0 -162
  19. package/dist/base-DBhKcre4.d.ts +0 -4117
  20. package/dist/base.cjs +0 -10
  21. package/dist/base.d.cts +0 -6
  22. package/dist/base.d.ts +0 -6
  23. package/dist/base.js +0 -1
  24. package/dist/bundler/index.cjs +0 -10
  25. package/dist/bundler/index.d.cts +0 -30
  26. package/dist/bundler/index.d.ts +0 -30
  27. package/dist/bundler/index.js +0 -1
  28. package/dist/chunk-2GRYVZ2O.cjs +0 -244
  29. package/dist/chunk-2HDFKWFU.js +0 -2249
  30. package/dist/chunk-32C7JDIZ.js +0 -1
  31. package/dist/chunk-4UBOJFSL.js +0 -989
  32. package/dist/chunk-4UWPFBC6.js +0 -88
  33. package/dist/chunk-4Z3OU5RY.cjs +0 -31
  34. package/dist/chunk-5HTMDAXP.js +0 -359
  35. package/dist/chunk-5IEKR756.js +0 -53
  36. package/dist/chunk-5YDTZN2X.js +0 -114
  37. package/dist/chunk-6UNGH46J.js +0 -75
  38. package/dist/chunk-6Y4UL5Z6.cjs +0 -94
  39. package/dist/chunk-7F6BQXE2.cjs +0 -425
  40. package/dist/chunk-7H2GET5Z.cjs +0 -668
  41. package/dist/chunk-7HZ6NIAF.cjs +0 -2
  42. package/dist/chunk-7MZNOW6W.cjs +0 -2263
  43. package/dist/chunk-7XQIPES3.js +0 -668
  44. package/dist/chunk-AKYTYALY.js +0 -70
  45. package/dist/chunk-ATXBSEFT.js +0 -22
  46. package/dist/chunk-B6TOBUS6.cjs +0 -80
  47. package/dist/chunk-B7SQOKEC.cjs +0 -91
  48. package/dist/chunk-BB4KXGBU.js +0 -83
  49. package/dist/chunk-BB6DPGIV.cjs +0 -6
  50. package/dist/chunk-C4LMN2IR.js +0 -27
  51. package/dist/chunk-DFFVEKIG.js +0 -407
  52. package/dist/chunk-E7AX3U6M.cjs +0 -659
  53. package/dist/chunk-EWCOOO3H.js +0 -5007
  54. package/dist/chunk-F2WMR75C.cjs +0 -183
  55. package/dist/chunk-FBKJ3652.cjs +0 -5034
  56. package/dist/chunk-FEYYOBBG.cjs +0 -24
  57. package/dist/chunk-FL5SZ2XU.js +0 -181
  58. package/dist/chunk-GH2KM66J.js +0 -37
  59. package/dist/chunk-GWFS5DAR.cjs +0 -37
  60. package/dist/chunk-HNEE7IF4.js +0 -60
  61. package/dist/chunk-HSVOEWAM.cjs +0 -2
  62. package/dist/chunk-J52TXHZV.cjs +0 -73
  63. package/dist/chunk-JNMQKJH4.js +0 -10
  64. package/dist/chunk-JQOMTERC.js +0 -89
  65. package/dist/chunk-LABUWBKX.cjs +0 -71
  66. package/dist/chunk-LXFZUKP3.cjs +0 -34
  67. package/dist/chunk-MP2QBLUJ.cjs +0 -70
  68. package/dist/chunk-MUNFCOMB.cjs +0 -62
  69. package/dist/chunk-NH5WJNNS.js +0 -1
  70. package/dist/chunk-P3Q73CAW.cjs +0 -55
  71. package/dist/chunk-PA2YIVIT.js +0 -61
  72. package/dist/chunk-QFTBW7ZZ.cjs +0 -2
  73. package/dist/chunk-QQ5K5TZE.cjs +0 -619
  74. package/dist/chunk-QUSEDVYI.cjs +0 -991
  75. package/dist/chunk-R4V75T7J.js +0 -1
  76. package/dist/chunk-SGGPJWRQ.js +0 -69
  77. package/dist/chunk-ST5RMVLG.cjs +0 -87
  78. package/dist/chunk-TC2SCOTE.js +0 -605
  79. package/dist/chunk-U64IJDC5.cjs +0 -109
  80. package/dist/chunk-UX3B6S2I.cjs +0 -65
  81. package/dist/chunk-V5D2LIF5.js +0 -68
  82. package/dist/chunk-VG4OPO2R.js +0 -240
  83. package/dist/chunk-WQNOATKB.js +0 -103
  84. package/dist/chunk-Y7D2JLKS.js +0 -4
  85. package/dist/chunk-YJEHXYK5.js +0 -657
  86. package/dist/chunk-YOQP5T77.js +0 -32
  87. package/dist/chunk-ZIZ3CVHN.cjs +0 -120
  88. package/dist/chunk-ZPOUMTTH.cjs +0 -362
  89. package/dist/chunk-ZZLBNB3U.cjs +0 -12
  90. package/dist/deployer/index.cjs +0 -10
  91. package/dist/deployer/index.d.cts +0 -19
  92. package/dist/deployer/index.d.ts +0 -19
  93. package/dist/deployer/index.js +0 -1
  94. package/dist/di/index.cjs +0 -10
  95. package/dist/di/index.d.cts +0 -1
  96. package/dist/di/index.d.ts +0 -1
  97. package/dist/di/index.js +0 -1
  98. package/dist/error/index.cjs +0 -22
  99. package/dist/error/index.d.cts +0 -86
  100. package/dist/error/index.d.ts +0 -86
  101. package/dist/error/index.js +0 -1
  102. package/dist/eval/index.cjs +0 -14
  103. package/dist/eval/index.d.cts +0 -43
  104. package/dist/eval/index.d.ts +0 -43
  105. package/dist/eval/index.js +0 -1
  106. package/dist/hooks/index.cjs +0 -18
  107. package/dist/hooks/index.d.cts +0 -33
  108. package/dist/hooks/index.d.ts +0 -33
  109. package/dist/hooks/index.js +0 -1
  110. package/dist/index.cjs +0 -281
  111. package/dist/index.d.cts +0 -92
  112. package/dist/index.d.ts +0 -92
  113. package/dist/index.js +0 -112
  114. package/dist/integration/index.cjs +0 -14
  115. package/dist/integration/index.d.cts +0 -65
  116. package/dist/integration/index.d.ts +0 -65
  117. package/dist/integration/index.js +0 -1
  118. package/dist/llm/index.cjs +0 -10
  119. package/dist/llm/index.d.cts +0 -29
  120. package/dist/llm/index.d.ts +0 -29
  121. package/dist/llm/index.js +0 -1
  122. package/dist/logger/index.cjs +0 -43
  123. package/dist/logger/index.d.cts +0 -96
  124. package/dist/logger/index.d.ts +0 -96
  125. package/dist/logger/index.js +0 -2
  126. package/dist/logger-B8XXh6ya.d.cts +0 -159
  127. package/dist/logger-Bpa2oLL4.d.ts +0 -159
  128. package/dist/mastra/index.cjs +0 -10
  129. package/dist/mastra/index.d.cts +0 -29
  130. package/dist/mastra/index.d.ts +0 -29
  131. package/dist/mastra/index.js +0 -1
  132. package/dist/mcp/index.cjs +0 -106
  133. package/dist/mcp/index.d.cts +0 -29
  134. package/dist/mcp/index.d.ts +0 -29
  135. package/dist/mcp/index.js +0 -100
  136. package/dist/memory/index.cjs +0 -18
  137. package/dist/memory/index.d.cts +0 -29
  138. package/dist/memory/index.d.ts +0 -29
  139. package/dist/memory/index.js +0 -1
  140. package/dist/network/index.cjs +0 -311
  141. package/dist/network/index.d.cts +0 -29
  142. package/dist/network/index.d.ts +0 -29
  143. package/dist/network/index.js +0 -309
  144. package/dist/network/vNext/index.cjs +0 -873
  145. package/dist/network/vNext/index.d.cts +0 -29
  146. package/dist/network/vNext/index.d.ts +0 -29
  147. package/dist/network/vNext/index.js +0 -871
  148. package/dist/relevance/index.cjs +0 -18
  149. package/dist/relevance/index.d.cts +0 -49
  150. package/dist/relevance/index.d.ts +0 -49
  151. package/dist/relevance/index.js +0 -1
  152. package/dist/runtime-context/index.cjs +0 -10
  153. package/dist/runtime-context/index.d.cts +0 -52
  154. package/dist/runtime-context/index.d.ts +0 -52
  155. package/dist/runtime-context/index.js +0 -1
  156. package/dist/server/index.cjs +0 -62
  157. package/dist/server/index.d.cts +0 -52
  158. package/dist/server/index.d.ts +0 -52
  159. package/dist/server/index.js +0 -59
  160. package/dist/storage/index.cjs +0 -336
  161. package/dist/storage/index.d.cts +0 -149
  162. package/dist/storage/index.d.ts +0 -149
  163. package/dist/storage/index.js +0 -303
  164. package/dist/telemetry/index.cjs +0 -30
  165. package/dist/telemetry/index.d.cts +0 -75
  166. package/dist/telemetry/index.d.ts +0 -75
  167. package/dist/telemetry/index.js +0 -1
  168. package/dist/telemetry/otel-vendor.cjs +0 -103
  169. package/dist/telemetry/otel-vendor.d.cts +0 -20
  170. package/dist/telemetry/otel-vendor.d.ts +0 -20
  171. package/dist/telemetry/otel-vendor.js +0 -57
  172. package/dist/tools/index.cjs +0 -18
  173. package/dist/tools/index.d.cts +0 -41
  174. package/dist/tools/index.d.ts +0 -41
  175. package/dist/tools/index.js +0 -1
  176. package/dist/tts/index.cjs +0 -10
  177. package/dist/tts/index.d.cts +0 -28
  178. package/dist/tts/index.d.ts +0 -28
  179. package/dist/tts/index.js +0 -1
  180. package/dist/types-Bo1uigWx.d.cts +0 -17
  181. package/dist/types-Bo1uigWx.d.ts +0 -17
  182. package/dist/utils.cjs +0 -58
  183. package/dist/utils.d.cts +0 -149
  184. package/dist/utils.d.ts +0 -149
  185. package/dist/utils.js +0 -1
  186. package/dist/vector/filter/index.cjs +0 -192
  187. package/dist/vector/filter/index.d.cts +0 -128
  188. package/dist/vector/filter/index.d.ts +0 -128
  189. package/dist/vector/filter/index.js +0 -190
  190. package/dist/vector/index.cjs +0 -10
  191. package/dist/vector/index.d.cts +0 -77
  192. package/dist/vector/index.d.ts +0 -77
  193. package/dist/vector/index.js +0 -1
  194. package/dist/voice/index.cjs +0 -18
  195. package/dist/voice/index.d.cts +0 -29
  196. package/dist/voice/index.d.ts +0 -29
  197. package/dist/voice/index.js +0 -1
  198. package/dist/workflows/constants.cjs +0 -10
  199. package/dist/workflows/constants.d.cts +0 -3
  200. package/dist/workflows/constants.d.ts +0 -3
  201. package/dist/workflows/constants.js +0 -1
  202. package/dist/workflows/index.cjs +0 -42
  203. package/dist/workflows/index.d.cts +0 -282
  204. package/dist/workflows/index.d.ts +0 -282
  205. package/dist/workflows/index.js +0 -1
  206. package/dist/workflows/legacy/index.cjs +0 -90
  207. package/dist/workflows/legacy/index.d.cts +0 -91
  208. package/dist/workflows/legacy/index.d.ts +0 -91
  209. package/dist/workflows/legacy/index.js +0 -1
  210. package/error.d.ts +0 -1
  211. package/eval.d.ts +0 -1
  212. package/hooks.d.ts +0 -1
  213. package/integration.d.ts +0 -1
  214. package/llm.d.ts +0 -1
  215. package/logger.d.ts +0 -1
  216. package/mastra.d.ts +0 -1
  217. package/mcp.d.ts +0 -1
  218. package/memory.d.ts +0 -1
  219. package/network/vNext.d.ts +0 -1
  220. package/network.d.ts +0 -1
  221. package/relevance.d.ts +0 -1
  222. package/runtime-context.d.ts +0 -1
  223. package/server.d.ts +0 -1
  224. package/storage.d.ts +0 -1
  225. package/telemetry/otel-vendor.d.ts +0 -1
  226. package/telemetry.d.ts +0 -1
  227. package/tools.d.ts +0 -1
  228. package/tts.d.ts +0 -1
  229. package/utils.d.ts +0 -1
  230. package/vector/filter.d.ts +0 -1
  231. package/vector.d.ts +0 -1
  232. package/voice.d.ts +0 -1
  233. package/workflows/_constants.d.ts +0 -1
  234. package/workflows/legacy.d.ts +0 -1
  235. package/workflows.d.ts +0 -1
@@ -1,780 +0,0 @@
1
- /**
2
- * Base interface for identifying JSON-RPC messages.
3
- */
4
- interface JSONRPCMessageIdentifier {
5
- /**
6
- * Request identifier. Can be a string, number, or null.
7
- * Responses must have the same ID as the request they relate to.
8
- * Notifications (requests without an expected response) should omit the ID or use null.
9
- */
10
- id?: number | string | null;
11
- }
12
- /**
13
- * Base interface for all JSON-RPC messages (Requests and Responses).
14
- */
15
- interface JSONRPCMessage extends JSONRPCMessageIdentifier {
16
- /**
17
- * Specifies the JSON-RPC version. Must be "2.0".
18
- * @default "2.0"
19
- * @const "2.0"
20
- */
21
- jsonrpc?: '2.0';
22
- }
23
- /**
24
- * Represents a JSON-RPC request object base structure.
25
- * Specific request types should extend this.
26
- */
27
- interface JSONRPCRequest extends JSONRPCMessage {
28
- /**
29
- * The name of the method to be invoked.
30
- */
31
- method: string;
32
- /**
33
- * Parameters for the method. Can be a structured object, an array, or null/omitted.
34
- * Specific request interfaces will define the exact type.
35
- * @default null
36
- */
37
- params?: unknown;
38
- }
39
- /**
40
- * Represents a JSON-RPC error object.
41
- */
42
- interface JSONRPCError<Data = unknown | null, Code = number> {
43
- /**
44
- * A number indicating the error type that occurred.
45
- */
46
- code: Code;
47
- /**
48
- * A string providing a short description of the error.
49
- */
50
- message: string;
51
- /**
52
- * Optional additional data about the error.
53
- * @default null
54
- */
55
- data?: Data;
56
- }
57
- /**
58
- * Represents a JSON-RPC response object.
59
- */
60
- interface JSONRPCResponse<R = unknown | null, E = unknown | null> extends JSONRPCMessage {
61
- /**
62
- * The result of the method invocation. Required on success.
63
- * Should be null or omitted if an error occurred.
64
- * @default null
65
- */
66
- result?: R;
67
- /**
68
- * An error object if an error occurred during the request. Required on failure.
69
- * Should be null or omitted if the request was successful.
70
- * @default null
71
- */
72
- error?: JSONRPCError<E> | null;
73
- }
74
- /**
75
- * Represents the state of a task within the A2A protocol.
76
- * @description An enumeration.
77
- */
78
- type TaskState = 'submitted' | 'working' | 'input-required' | 'completed' | 'canceled' | 'failed' | 'unknown';
79
- /**
80
- * Defines the authentication schemes and credentials for an agent.
81
- */
82
- interface AgentAuthentication {
83
- /**
84
- * List of supported authentication schemes.
85
- */
86
- schemes: string[];
87
- /**
88
- * Credentials for authentication. Can be a string (e.g., token) or null if not required initially.
89
- * @default null
90
- */
91
- credentials?: string | null;
92
- }
93
- /**
94
- * Describes the capabilities of an agent.
95
- */
96
- interface AgentCapabilities {
97
- /**
98
- * Indicates if the agent supports streaming responses.
99
- * @default false
100
- */
101
- streaming?: boolean;
102
- /**
103
- * Indicates if the agent supports push notification mechanisms.
104
- * @default false
105
- */
106
- pushNotifications?: boolean;
107
- /**
108
- * Indicates if the agent supports providing state transition history.
109
- * @default false
110
- */
111
- stateTransitionHistory?: boolean;
112
- }
113
- /**
114
- * Represents the provider or organization behind an agent.
115
- */
116
- interface AgentProvider {
117
- /**
118
- * The name of the organization providing the agent.
119
- */
120
- organization: string;
121
- /**
122
- * URL associated with the agent provider.
123
- * @default null
124
- */
125
- url?: string | null;
126
- }
127
- /**
128
- * Defines a specific skill or capability offered by an agent.
129
- */
130
- interface AgentSkill {
131
- /**
132
- * Unique identifier for the skill.
133
- */
134
- id: string;
135
- /**
136
- * Human-readable name of the skill.
137
- */
138
- name: string;
139
- /**
140
- * Optional description of the skill.
141
- * @default null
142
- */
143
- description?: string | null;
144
- /**
145
- * Optional list of tags associated with the skill for categorization.
146
- * @default null
147
- */
148
- tags?: string[] | null;
149
- /**
150
- * Optional list of example inputs or use cases for the skill.
151
- * @default null
152
- */
153
- examples?: string[] | null;
154
- /**
155
- * Optional list of input modes supported by this skill, overriding agent defaults.
156
- * @default null
157
- */
158
- inputModes?: string[] | null;
159
- /**
160
- * Optional list of output modes supported by this skill, overriding agent defaults.
161
- * @default null
162
- */
163
- outputModes?: string[] | null;
164
- }
165
- /**
166
- * Represents the metadata card for an agent, describing its properties and capabilities.
167
- */
168
- interface AgentCard {
169
- /**
170
- * The name of the agent.
171
- */
172
- name: string;
173
- /**
174
- * An optional description of the agent.
175
- * @default null
176
- */
177
- description?: string | null;
178
- /**
179
- * The base URL endpoint for interacting with the agent.
180
- */
181
- url: string;
182
- /**
183
- * Information about the provider of the agent.
184
- * @default null
185
- */
186
- provider?: AgentProvider | null;
187
- /**
188
- * The version identifier for the agent or its API.
189
- */
190
- version: string;
191
- /**
192
- * An optional URL pointing to the agent's documentation.
193
- * @default null
194
- */
195
- documentationUrl?: string | null;
196
- /**
197
- * The capabilities supported by the agent.
198
- */
199
- capabilities: AgentCapabilities;
200
- /**
201
- * Authentication details required to interact with the agent.
202
- * @default null
203
- */
204
- authentication?: AgentAuthentication | null;
205
- /**
206
- * Default input modes supported by the agent (e.g., 'text', 'file', 'json').
207
- * @default ["text"]
208
- */
209
- defaultInputModes?: string[];
210
- /**
211
- * Default output modes supported by the agent (e.g., 'text', 'file', 'json').
212
- * @default ["text"]
213
- */
214
- defaultOutputModes?: string[];
215
- /**
216
- * List of specific skills offered by the agent.
217
- */
218
- skills: AgentSkill[];
219
- }
220
- interface FileContentBase {
221
- /**
222
- * Optional name of the file.
223
- * @default null
224
- */
225
- name?: string | null;
226
- /**
227
- * Optional MIME type of the file content.
228
- * @default null
229
- */
230
- mimeType?: string | null;
231
- /**
232
- * File content encoded as a Base64 string. Use this OR `uri`.
233
- */
234
- bytes?: string | null;
235
- /**
236
- * URI pointing to the file content. Use this OR `bytes`.
237
- */
238
- uri?: string | null;
239
- }
240
- type FileContentBytes = FileContentBase & {
241
- bytes: string;
242
- uri?: never;
243
- };
244
- type FileContentUri = FileContentBase & {
245
- /** URI pointing to the file content. */
246
- uri: string;
247
- bytes?: never;
248
- };
249
- /**
250
- * Represents the content of a file, either as base64 encoded bytes or a URI.
251
- * @description Ensures that either 'bytes' or 'uri' is provided, but not both. (Note: This constraint is informational in TypeScript types).
252
- */
253
- type FileContent = FileContentBytes | FileContentUri;
254
- /**
255
- * Represents a part of a message containing text content.
256
- */
257
- interface TextPart {
258
- type: 'text';
259
- /**
260
- * The text content.
261
- */
262
- text: string;
263
- /**
264
- * Optional metadata associated with this text part.
265
- */
266
- metadata?: Record<string, unknown> | null;
267
- }
268
- /**
269
- * Represents a part of a message containing file content.
270
- */
271
- interface FilePart {
272
- /**
273
- * Type identifier for this part.
274
- */
275
- type: 'file';
276
- /**
277
- * The file content, provided either inline or via URI.
278
- */
279
- file: FileContent;
280
- /**
281
- * Optional metadata associated with this file part.
282
- */
283
- metadata?: Record<string, unknown> | null;
284
- }
285
- /**
286
- * Represents a part of a message containing structured data (JSON).
287
- */
288
- interface DataPart {
289
- /**
290
- * Type identifier for this part.
291
- */
292
- type: 'data';
293
- /**
294
- * The structured data content as a JSON object.
295
- */
296
- data: Record<string, unknown>;
297
- /**
298
- * Optional metadata associated with this data part.
299
- */
300
- metadata?: Record<string, unknown> | null;
301
- }
302
- /**
303
- * Represents a single part of a multi-part message. Can be text, file, or data.
304
- */
305
- type Part = TextPart | FilePart | DataPart;
306
- /**
307
- * Represents an artifact generated or used by a task, potentially composed of multiple parts.
308
- */
309
- interface Artifact {
310
- /**
311
- * Optional name for the artifact.
312
- * @default null
313
- */
314
- name?: string | null;
315
- /**
316
- * Optional description of the artifact.
317
- * @default null
318
- */
319
- description?: string | null;
320
- /**
321
- * The constituent parts of the artifact.
322
- */
323
- parts: Part[];
324
- /**
325
- * Optional index for ordering artifacts, especially relevant in streaming or updates.
326
- * @default 0
327
- */
328
- index?: number;
329
- /**
330
- * Optional flag indicating if this artifact content should append to previous content (for streaming).
331
- * @default null
332
- */
333
- append?: boolean | null;
334
- /**
335
- * Optional metadata associated with the artifact.
336
- * @default null
337
- */
338
- metadata?: Record<string, unknown> | null;
339
- /**
340
- * Optional flag indicating if this is the last chunk of data for this artifact (for streaming).
341
- * @default null
342
- */
343
- lastChunk?: boolean | null;
344
- }
345
- /**
346
- * Represents a message exchanged between a user and an agent.
347
- */
348
- interface Message {
349
- /**
350
- * The role of the sender (user or agent).
351
- */
352
- role: 'user' | 'agent';
353
- /**
354
- * The content of the message, composed of one or more parts.
355
- */
356
- parts: Part[];
357
- /**
358
- * Optional metadata associated with the message.
359
- * @default null
360
- */
361
- metadata?: Record<string, unknown> | null;
362
- }
363
- /**
364
- * Represents the status of a task at a specific point in time.
365
- */
366
- interface TaskStatus {
367
- /**
368
- * The current state of the task.
369
- */
370
- state: TaskState;
371
- /**
372
- * An optional message associated with the current status (e.g., progress update, final response).
373
- * @default null
374
- */
375
- message?: Message | null;
376
- /**
377
- * The timestamp when this status was recorded (ISO 8601 format).
378
- * @format date-time
379
- */
380
- timestamp?: string;
381
- }
382
- /**
383
- * Represents a task being processed by an agent.
384
- */
385
- interface Task {
386
- /**
387
- * Unique identifier for the task.
388
- */
389
- id: string;
390
- /**
391
- * Optional identifier for the session this task belongs to.
392
- * @default null
393
- */
394
- sessionId?: string | null;
395
- /**
396
- * The current status of the task.
397
- */
398
- status: TaskStatus;
399
- /**
400
- * Optional list of artifacts associated with the task (e.g., outputs, intermediate files).
401
- * @default null
402
- */
403
- artifacts?: Artifact[] | null;
404
- /**
405
- * Optional metadata associated with the task.
406
- * @default null
407
- */
408
- metadata?: Record<string, unknown> | null;
409
- }
410
- /**
411
- * Represents the history of messages exchanged within a task's session.
412
- */
413
- interface TaskHistory {
414
- /**
415
- * List of messages in chronological order.
416
- * @default []
417
- */
418
- messageHistory?: Message[];
419
- }
420
- /**
421
- * Represents a status update event for a task, typically used in streaming scenarios.
422
- */
423
- interface TaskStatusUpdateEvent {
424
- /**
425
- * The ID of the task being updated.
426
- */
427
- id: string;
428
- /**
429
- * The new status of the task.
430
- */
431
- status: TaskStatus;
432
- /**
433
- * Flag indicating if this is the final update for the task.
434
- * @default false
435
- */
436
- final?: boolean;
437
- /**
438
- * Optional metadata associated with this update event.
439
- * @default null
440
- */
441
- metadata?: Record<string, unknown> | null;
442
- }
443
- /**
444
- * Represents an artifact update event for a task, typically used in streaming scenarios.
445
- */
446
- interface TaskArtifactUpdateEvent {
447
- /**
448
- * The ID of the task being updated.
449
- */
450
- id: string;
451
- /**
452
- * The new or updated artifact for the task.
453
- */
454
- artifact: Artifact;
455
- /**
456
- * Flag indicating if this is the final update for the task.
457
- * @default false
458
- */
459
- final?: boolean;
460
- /**
461
- * Optional metadata associated with this update event.
462
- * @default null
463
- */
464
- metadata?: Record<string, unknown> | null;
465
- }
466
- type TaskUpdateEvent = TaskStatusUpdateEvent;
467
- /** Error code for JSON Parse Error (-32700). Invalid JSON was received by the server. */
468
- declare const ErrorCodeParseError = -32700;
469
- type ErrorCodeParseError = typeof ErrorCodeParseError;
470
- /** Error code for Invalid Request (-32600). The JSON sent is not a valid Request object. */
471
- declare const ErrorCodeInvalidRequest = -32600;
472
- type ErrorCodeInvalidRequest = typeof ErrorCodeInvalidRequest;
473
- /** Error code for Method Not Found (-32601). The method does not exist / is not available. */
474
- declare const ErrorCodeMethodNotFound = -32601;
475
- type ErrorCodeMethodNotFound = typeof ErrorCodeMethodNotFound;
476
- /** Error code for Invalid Params (-32602). Invalid method parameter(s). */
477
- declare const ErrorCodeInvalidParams = -32602;
478
- type ErrorCodeInvalidParams = typeof ErrorCodeInvalidParams;
479
- /** Error code for Internal Error (-32603). Internal JSON-RPC error. */
480
- declare const ErrorCodeInternalError = -32603;
481
- type ErrorCodeInternalError = typeof ErrorCodeInternalError;
482
- /** Error code for Task Not Found (-32001). The specified task was not found. */
483
- declare const ErrorCodeTaskNotFound = -32001;
484
- type ErrorCodeTaskNotFound = typeof ErrorCodeTaskNotFound;
485
- /** Error code for Task Not Cancelable (-32002). The specified task cannot be canceled. */
486
- declare const ErrorCodeTaskNotCancelable = -32002;
487
- type ErrorCodeTaskNotCancelable = typeof ErrorCodeTaskNotCancelable;
488
- /** Error code for Push Notification Not Supported (-32003). Push Notifications are not supported for this operation or agent. */
489
- declare const ErrorCodePushNotificationNotSupported = -32003;
490
- type ErrorCodePushNotificationNotSupported = typeof ErrorCodePushNotificationNotSupported;
491
- /** Error code for Unsupported Operation (-32004). The requested operation is not supported by the agent. */
492
- declare const ErrorCodeUnsupportedOperation = -32004;
493
- type ErrorCodeUnsupportedOperation = typeof ErrorCodeUnsupportedOperation;
494
- /**
495
- * Union of all well-known A2A and standard JSON-RPC error codes defined in this schema.
496
- * Use this type for checking against specific error codes. A server might theoretically
497
- * use other codes within the valid JSON-RPC ranges.
498
- */
499
- type KnownErrorCode = typeof ErrorCodeParseError | typeof ErrorCodeInvalidRequest | typeof ErrorCodeMethodNotFound | typeof ErrorCodeInvalidParams | typeof ErrorCodeInternalError | typeof ErrorCodeTaskNotFound | typeof ErrorCodeTaskNotCancelable | typeof ErrorCodePushNotificationNotSupported | typeof ErrorCodeUnsupportedOperation;
500
- type A2AError$1 = JSONRPCError<unknown | null, KnownErrorCode | number>;
501
- /**
502
- * Authentication information, potentially including additional properties beyond the standard ones.
503
- * (Note: Schema allows additional properties).
504
- */
505
- interface AuthenticationInfo extends AgentAuthentication {
506
- /** Allow any other properties */
507
- [key: string]: any;
508
- }
509
- /**
510
- * Information required for setting up push notifications.
511
- */
512
- interface PushNotificationConfig {
513
- /**
514
- * The URL endpoint where the agent should send notifications.
515
- */
516
- url: string;
517
- /**
518
- * A token to be included in push notification requests for verification/authentication.
519
- */
520
- token?: string;
521
- /**
522
- * Optional authentication details needed by the agent to call the notification URL.
523
- * @default null
524
- */
525
- authentication?: AuthenticationInfo | null;
526
- }
527
- /**
528
- * Represents the push notification information associated with a specific task ID.
529
- * Used as parameters for `tasks/pushNotification/set` and as a result type.
530
- */
531
- interface TaskPushNotificationConfig {
532
- /**
533
- * The ID of the task the notification config is associated with.
534
- */
535
- id: string;
536
- /**
537
- * The push notification configuration details.
538
- */
539
- pushNotificationConfig: PushNotificationConfig;
540
- }
541
- /**
542
- * Parameters for the `tasks/send` method.
543
- */
544
- interface TaskSendParams {
545
- /**
546
- * Unique identifier for the task being initiated or continued.
547
- */
548
- id: string;
549
- /**
550
- * Optional identifier for the session this task belongs to. If not provided, a new session might be implicitly created depending on the agent.
551
- */
552
- sessionId?: string;
553
- /**
554
- * The message content to send to the agent for processing.
555
- */
556
- message: Message;
557
- /**
558
- * Optional pushNotification information for receiving notifications about this task. Requires agent capability.
559
- * @default null
560
- */
561
- pushNotification?: PushNotificationConfig | null;
562
- /**
563
- * Optional parameter to specify how much message history to include in the response.
564
- * @default null
565
- */
566
- historyLength?: number | null;
567
- /**
568
- * Optional metadata associated with sending this message.
569
- * @default null
570
- */
571
- metadata?: Record<string, unknown> | null;
572
- }
573
- /**
574
- * Basic parameters used for task ID operations.
575
- * Used by: `tasks/cancel`, `tasks/pushNotification/get`.
576
- */
577
- interface TaskIdParams {
578
- /**
579
- * The unique identifier of the task.
580
- */
581
- id: string;
582
- /**
583
- * Optional metadata to include with the operation.
584
- * @default null
585
- */
586
- metadata?: Record<string, unknown> | null;
587
- }
588
- /**
589
- * Parameters used for querying task-related information by ID.
590
- * Used by: `tasks/get`, `tasks/getHistory`, `tasks/subscribe`, `tasks/resubscribe`.
591
- */
592
- interface TaskQueryParams extends TaskIdParams {
593
- /**
594
- * Optional history length to retrieve for the task.
595
- * @default null
596
- */
597
- historyLength?: number | null;
598
- }
599
- /**
600
- * Request to send a message/initiate a task.
601
- */
602
- interface SendTaskRequest extends JSONRPCRequest {
603
- /**
604
- * Method name for sending a task message.
605
- */
606
- method: 'tasks/send';
607
- /**
608
- * Parameters for the send task method.
609
- */
610
- params: TaskSendParams;
611
- }
612
- /**
613
- * Request to retrieve the current state of a task.
614
- */
615
- interface GetTaskRequest extends JSONRPCRequest {
616
- /**
617
- * Method name for getting task status.
618
- */
619
- method: 'tasks/get';
620
- /**
621
- * Parameters for the get task method.
622
- */
623
- params: TaskQueryParams;
624
- }
625
- /**
626
- * Request to cancel a currently running task.
627
- */
628
- interface CancelTaskRequest extends JSONRPCRequest {
629
- /**
630
- * Method name for canceling a task.
631
- */
632
- method: 'tasks/cancel';
633
- /**
634
- * Parameters for the cancel task method.
635
- */
636
- params: TaskIdParams;
637
- }
638
- /**
639
- * Request to set or update the push notification config for a task.
640
- */
641
- interface SetTaskPushNotificationRequest extends JSONRPCRequest {
642
- /**
643
- * Method name for setting a task notifications.
644
- */
645
- method: 'tasks/pushNotification/set';
646
- /**
647
- * Parameters for the set task push notification method.
648
- */
649
- params: TaskPushNotificationConfig;
650
- }
651
- /**
652
- * Request to retrieve the currently configured push notification configuration for a task.
653
- */
654
- interface GetTaskPushNotificationRequest extends JSONRPCRequest {
655
- /**
656
- * Method name for getting task notification configuration.
657
- */
658
- method: 'tasks/pushNotification/get';
659
- /**
660
- * Parameters for the get task push notification config method.
661
- */
662
- params: TaskIdParams;
663
- }
664
- /**
665
- * Request to resubscribe to updates for a task after a connection interruption.
666
- */
667
- interface TaskResubscriptionRequest extends JSONRPCRequest {
668
- /**
669
- * Method name for resubscribing to task updates.
670
- */
671
- method: 'tasks/resubscribe';
672
- /**
673
- * Parameters for the task resubscription method.
674
- */
675
- params: TaskQueryParams;
676
- }
677
- /**
678
- * Request to send a message/initiate a task and subscribe to streaming updates.
679
- */
680
- interface SendTaskStreamingRequest extends JSONRPCRequest {
681
- /**
682
- * Method name for sending a task message and subscribing to updates.
683
- */
684
- method: 'tasks/sendSubscribe';
685
- /**
686
- * Parameters for the streaming task send method.
687
- */
688
- params: TaskSendParams;
689
- }
690
- /**
691
- * Response to a `tasks/send` request.
692
- * Contains the Task object or an error.
693
- */
694
- type SendTaskResponse = JSONRPCResponse<Task | null, A2AError$1>;
695
- /**
696
- * Response to a streaming task operation, either through `tasks/sendSubscribe` or a subscription.
697
- * Contains a TaskStatusUpdateEvent, TaskArtifactUpdateEvent, or an error.
698
- */
699
- type SendTaskStreamingResponse = JSONRPCResponse<TaskStatusUpdateEvent | TaskArtifactUpdateEvent | null, A2AError$1>;
700
- /**
701
- * Response to a `tasks/get` request. Contains the Task object or an error.
702
- */
703
- type GetTaskResponse = JSONRPCResponse<Task | null, A2AError$1>;
704
- /**
705
- * Response to a `tasks/cancel` request. Contains the updated Task object (usually with 'canceled' state) or an error.
706
- */
707
- type CancelTaskResponse = JSONRPCResponse<Task | null, A2AError$1>;
708
- /**
709
- * Response to a `tasks/getHistory` request. Contains the TaskHistory object or an error.
710
- */
711
- type GetTaskHistoryResponse = JSONRPCResponse<TaskHistory | null, A2AError$1>;
712
- /**
713
- * Response to a `tasks/pushNotification/set` request. Contains the confirmed TaskPushNotificationConfig or an error.
714
- */
715
- type SetTaskPushNotificationResponse = JSONRPCResponse<TaskPushNotificationConfig | null, A2AError$1>;
716
- /**
717
- * Response to a `tasks/pushNotification/get` request. Contains the TaskPushNotificationConfig or an error.
718
- */
719
- type GetTaskPushNotificationResponse = JSONRPCResponse<TaskPushNotificationConfig | null, A2AError$1>;
720
- /**
721
- * Represents any valid request defined in the A2A protocol.
722
- */
723
- type A2ARequest = SendTaskRequest | GetTaskRequest | CancelTaskRequest | SetTaskPushNotificationRequest | GetTaskPushNotificationRequest | TaskResubscriptionRequest | SendTaskStreamingRequest;
724
- /**
725
- * Represents any valid JSON-RPC response defined in the A2A protocol.
726
- * (This is a helper type, not explicitly defined with `oneOf` in the schema like A2ARequest, but useful).
727
- */
728
- type A2AResponse = SendTaskResponse | GetTaskResponse | CancelTaskResponse | GetTaskHistoryResponse | SetTaskPushNotificationResponse | GetTaskPushNotificationResponse;
729
- interface TaskAndHistory {
730
- task: Task;
731
- history: Message[];
732
- }
733
- interface TaskContext {
734
- /**
735
- * The current state of the task when the handler is invoked or resumed.
736
- * Note: This is a snapshot. For the absolute latest state during async operations,
737
- * the handler might need to reload the task via the store.
738
- */
739
- task: Task;
740
- /**
741
- * The specific user message that triggered this handler invocation or resumption.
742
- */
743
- userMessage: Message;
744
- /**
745
- * Function to check if cancellation has been requested for this task.
746
- * Handlers should ideally check this periodically during long-running operations.
747
- * @returns {boolean} True if cancellation has been requested, false otherwise.
748
- */
749
- isCancelled(): boolean;
750
- /**
751
- * The message history associated with the task up to the point the handler is invoked.
752
- * Optional, as history might not always be available or relevant.
753
- */
754
- history?: Message[];
755
- }
756
-
757
- /**
758
- * Custom error class for A2A server operations, incorporating JSON-RPC error codes.
759
- */
760
- declare class A2AError extends Error {
761
- code: KnownErrorCode | number;
762
- data?: unknown;
763
- taskId?: string;
764
- constructor(code: KnownErrorCode | number, message: string, data?: unknown, taskId?: string);
765
- /**
766
- * Formats the error into a standard JSON-RPC error object structure.
767
- */
768
- toJSONRPCError(): JSONRPCError<unknown>;
769
- static parseError(message: string, data?: unknown): A2AError;
770
- static invalidRequest(message: string, data?: unknown): A2AError;
771
- static methodNotFound(method: string): A2AError;
772
- static invalidParams(message: string, data?: unknown): A2AError;
773
- static internalError(message: string, data?: unknown): A2AError;
774
- static taskNotFound(taskId: string): A2AError;
775
- static taskNotCancelable(taskId: string): A2AError;
776
- static pushNotificationNotSupported(): A2AError;
777
- static unsupportedOperation(operation: string): A2AError;
778
- }
779
-
780
- export { A2AError, type A2ARequest, type A2AResponse, type AgentAuthentication, type AgentCapabilities, type AgentCard, type AgentProvider, type AgentSkill, type Artifact, type AuthenticationInfo, type CancelTaskRequest, type CancelTaskResponse, type DataPart, ErrorCodeInternalError, ErrorCodeInvalidParams, ErrorCodeInvalidRequest, ErrorCodeMethodNotFound, ErrorCodeParseError, ErrorCodePushNotificationNotSupported, ErrorCodeTaskNotCancelable, ErrorCodeTaskNotFound, ErrorCodeUnsupportedOperation, type FileContent, type FileContentBase, type FileContentBytes, type FileContentUri, type FilePart, type GetTaskHistoryResponse, type GetTaskPushNotificationRequest, type GetTaskPushNotificationResponse, type GetTaskRequest, type GetTaskResponse, type JSONRPCError, type JSONRPCMessage, type JSONRPCMessageIdentifier, type JSONRPCRequest, type JSONRPCResponse, type KnownErrorCode, type Message, type Part, type PushNotificationConfig, type SendTaskRequest, type SendTaskResponse, type SendTaskStreamingRequest, type SendTaskStreamingResponse, type SetTaskPushNotificationRequest, type SetTaskPushNotificationResponse, type Task, type TaskAndHistory, type TaskArtifactUpdateEvent, type TaskContext, type TaskHistory, type TaskIdParams, type TaskPushNotificationConfig, type TaskQueryParams, type TaskResubscriptionRequest, type TaskSendParams, type TaskState, type TaskStatus, type TaskStatusUpdateEvent, type TaskUpdateEvent, type TextPart };