@mastra/client-js 1.46.1-alpha.0 → 1.47.0-alpha.10

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 (60) hide show
  1. package/dist/_types/@ai-sdk_provider/package.json +1 -0
  2. package/dist/_types/@ai-sdk_provider-utils/dist/index.d.ts +1 -1
  3. package/dist/_types/@ai-sdk_provider-utils/package.json +1 -0
  4. package/dist/_types/@ai-sdk_ui-utils/dist/index.d.ts +3 -3
  5. package/dist/_types/@ai-sdk_ui-utils/package.json +1 -0
  6. package/dist/client.d.ts +57 -208
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/docs/SKILL.md +2 -2
  9. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  10. package/dist/docs/references/docs-connections-a2a.md +4 -3
  11. package/dist/docs/references/docs-harness-agent-controller.md +4 -2
  12. package/dist/docs/references/reference-client-js-agent-controller.md +77 -16
  13. package/dist/docs/references/reference-client-js-agents.md +25 -0
  14. package/dist/docs/references/reference-client-js-mastra-client.md +1 -1
  15. package/dist/docs/references/reference-client-js-observability.md +104 -5
  16. package/dist/docs/references/reference-observability-tracing-trace-query.md +219 -46
  17. package/dist/index.cjs +353 -165
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.ts +3 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +354 -166
  22. package/dist/index.js.map +1 -1
  23. package/dist/resources/a2a.d.ts +5 -1
  24. package/dist/resources/a2a.d.ts.map +1 -1
  25. package/dist/resources/agent-builder.d.ts +25 -40
  26. package/dist/resources/agent-builder.d.ts.map +1 -1
  27. package/dist/resources/agent-controller.d.ts +5 -4
  28. package/dist/resources/agent-controller.d.ts.map +1 -1
  29. package/dist/resources/agent.d.ts +46 -74
  30. package/dist/resources/agent.d.ts.map +1 -1
  31. package/dist/resources/base.d.ts.map +1 -1
  32. package/dist/resources/channels.d.ts +13 -31
  33. package/dist/resources/channels.d.ts.map +1 -1
  34. package/dist/resources/conversations.d.ts +6 -3
  35. package/dist/resources/conversations.d.ts.map +1 -1
  36. package/dist/resources/mcp-tool.d.ts +9 -6
  37. package/dist/resources/mcp-tool.d.ts.map +1 -1
  38. package/dist/resources/memory-thread.d.ts +11 -11
  39. package/dist/resources/memory-thread.d.ts.map +1 -1
  40. package/dist/resources/observability-route-types.d.ts +101 -0
  41. package/dist/resources/observability-route-types.d.ts.map +1 -0
  42. package/dist/resources/observability.d.ts +35 -8
  43. package/dist/resources/observability.d.ts.map +1 -1
  44. package/dist/resources/responses.d.ts +5 -2
  45. package/dist/resources/responses.d.ts.map +1 -1
  46. package/dist/resources/run.d.ts +21 -57
  47. package/dist/resources/run.d.ts.map +1 -1
  48. package/dist/resources/tool.d.ts +6 -4
  49. package/dist/resources/tool.d.ts.map +1 -1
  50. package/dist/resources/vector.d.ts +5 -10
  51. package/dist/resources/vector.d.ts.map +1 -1
  52. package/dist/resources/workflow.d.ts +8 -10
  53. package/dist/resources/workflow.d.ts.map +1 -1
  54. package/dist/route-types.generated.d.ts +3010 -2190
  55. package/dist/route-types.generated.d.ts.map +1 -1
  56. package/dist/types.d.ts +252 -1593
  57. package/dist/types.d.ts.map +1 -1
  58. package/dist/utils/index.d.ts +7 -0
  59. package/dist/utils/index.d.ts.map +1 -1
  60. package/package.json +10 -10
package/dist/types.d.ts CHANGED
@@ -1,23 +1,21 @@
1
- import type { JSONValue, ToolInvocationUIPart } from './_types/@ai-sdk_ui-utils/dist/index.d.ts';
1
+ import type { JSONValue, ToolInvocationUIPart } from './_types/@ai-sdk_ui-utils/dist/index.js';
2
2
  import type { AgentExecutionOptions, MultiPrimitiveExecutionOptions, AgentGenerateOptions, AgentStreamOptions, SerializableStructuredOutputOptions, ToolsInput, UIMessageWithMetadata, AgentInstructions, AgentEditorConfig } from '@mastra/core/agent';
3
3
  import type { MessageListInput } from '@mastra/core/agent/message-list';
4
4
  import type { BuilderModelPolicy, DefaultModelEntry, ProviderModelEntry } from '@mastra/core/agent-builder/ee';
5
- import type { MastraScorerEntry, ScoreRowData } from '@mastra/core/evals';
5
+ import type { ScoreRowData } from '@mastra/core/evals';
6
6
  import type { CoreMessage, Provider as ModelProviderId } from '@mastra/core/llm';
7
- import type { LogLevel } from '@mastra/core/logger';
8
- import type { MCPToolType, ServerInfo } from '@mastra/core/mcp';
9
7
  import type { AiMessageType, MastraMessageV1, MastraDBMessage, MemoryConfig, StorageThreadType } from '@mastra/core/memory';
10
8
  import type { TracingOptions } from '@mastra/core/observability';
11
9
  import type { RequestContext } from '@mastra/core/request-context';
12
- import type { AgentInstructionBlock, PaginationInfo, WorkflowRuns, StorageListMessagesInput, Rule, RuleGroup, StorageConditionalVariant, StorageConditionalField, StoredProcessorGraph } from '@mastra/core/storage';
10
+ import type { AgentInstructionBlock, PaginationInfo, WorkflowRuns, Rule, RuleGroup, StorageConditionalVariant, StorageConditionalField, StoredProcessorGraph } from '@mastra/core/storage';
13
11
  import type { ChunkType } from '@mastra/core/stream';
14
12
  import type { QueryResult } from '@mastra/core/vector';
15
- import type { TimeTravelContext, Workflow, WorkflowResult, WorkflowRunStatus, WorkflowState } from '@mastra/core/workflows';
13
+ import type { SerializedStepFlowEntry, WorkflowResult, WorkflowRunStatus, WorkflowState } from '@mastra/core/workflows';
16
14
  import type { PublicSchema } from '@mastra/schema-compat/schema';
17
15
  import type { JSONSchema7 } from 'json-schema';
18
16
  import type { ZodSchema as ZodSchemaV3 } from 'zod/v3';
19
17
  import type { ZodType as ZodTypeV4 } from 'zod/v4';
20
- import type { Body, QueryParams, RouteKey, RouteResponse, Simplify } from './route-types.generated.js';
18
+ import type { Body, PathParams, QueryParams, RouteKey, RouteResponse, Simplify } from './route-types.generated.js';
21
19
  export type ZodSchema = ZodSchemaV3 | ZodTypeV4;
22
20
  /**
23
21
  * Provider metadata as it travels on a message part: a two-level map of
@@ -47,8 +45,13 @@ type RequestContextOptions = {
47
45
  };
48
46
  type GeneratedRequest<T> = OptionalizeUndefined<T>;
49
47
  type GeneratedResponse<T extends RouteKey> = Serialized<RouteResponse<T>>;
48
+ export type SerializedRouteResponse<T extends RouteKey> = GeneratedResponse<T>;
49
+ type WithoutIndexSignatures<T> = {
50
+ [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: T[K];
51
+ };
50
52
  export type ListFeedbackResponse = GeneratedResponse<'GET /observability/feedback'>;
51
53
  export type FeedbackItem = ListFeedbackResponse['feedback'][number];
54
+ export type GetMetricTimeSeriesResponse = GeneratedResponse<'POST /observability/metrics/timeseries'>;
52
55
  export interface ClientOptions {
53
56
  /** Base URL for API requests */
54
57
  baseUrl: string;
@@ -101,6 +104,12 @@ export interface SubscribeAgentThreadParams {
101
104
  resourceId?: string;
102
105
  threadId: string;
103
106
  }
107
+ /**
108
+ * @experimental Agent signals are experimental and may change in a future release.
109
+ */
110
+ export interface AbortAgentThreadParams extends SubscribeAgentThreadParams {
111
+ expectedRunId?: string;
112
+ }
104
113
  export type ListAgentSuspendedRunsParams = GeneratedRequest<QueryParams<'GET /agents/:agentId/suspended-runs'>>;
105
114
  /**
106
115
  * Listed suspended runs as returned by `agent.listSuspendedRuns()`.
@@ -128,165 +137,50 @@ export interface RequestOptions {
128
137
  headers?: Record<string, string>;
129
138
  body?: any;
130
139
  stream?: boolean;
140
+ /** Overrides the client's configured retry count for this request. */
141
+ retries?: number;
142
+ /** Per-request abort signal. Merged with the client-wide `abortSignal` from `ClientOptions`. */
143
+ signal?: AbortSignal;
131
144
  /** Credentials mode for requests. See https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials for more info. */
132
145
  credentials?: 'omit' | 'same-origin' | 'include';
133
146
  }
134
- export type ResponseInputTextPart = {
135
- type: 'input_text' | 'text' | 'output_text';
136
- text: string;
137
- };
138
- export type ResponseInputMessage = {
139
- role: 'system' | 'developer' | 'user' | 'assistant';
140
- content: string | ResponseInputTextPart[];
141
- };
142
- export type ResponseTextFormat = {
143
- type: 'json_object';
144
- } | {
145
- type: 'json_schema';
146
- name: string;
147
- description?: string;
148
- schema: Record<string, unknown>;
149
- strict?: boolean;
150
- };
151
- export type ResponseTextConfig = {
152
- format: ResponseTextFormat;
153
- };
154
- export type ResponseOutputText = {
155
- type: 'output_text';
156
- text: string;
157
- annotations?: unknown[];
158
- logprobs?: unknown[];
159
- };
160
- export type ResponseOutputMessage = {
161
- id: string;
147
+ type ResponseInput = Body<'POST /v1/responses'>['input'];
148
+ type ResponseInputMessageFromRoute = Exclude<ResponseInput, string>[number];
149
+ type ResponsePayload = GeneratedResponse<'POST /v1/responses'>;
150
+ export type ResponseInputTextPart = Exclude<ResponseInputMessageFromRoute['content'], string>[number];
151
+ export type ResponseInputMessage = ResponseInputMessageFromRoute;
152
+ export type ResponseTextConfig = NonNullable<Body<'POST /v1/responses'>['text']>;
153
+ export type ResponseTextFormat = ResponseTextConfig['format'];
154
+ export type ResponseOutputItem = ResponsePayload['output'][number];
155
+ export type ResponseOutputMessage = Extract<ResponseOutputItem, {
162
156
  type: 'message';
163
- role: 'assistant';
164
- status: 'in_progress' | 'completed' | 'incomplete';
165
- content: ResponseOutputText[];
166
- };
167
- export type ResponseOutputFunctionCall = {
168
- id: string;
157
+ }>;
158
+ export type ResponseOutputText = ResponseOutputMessage['content'][number];
159
+ export type ResponseOutputFunctionCall = Extract<ResponseOutputItem, {
169
160
  type: 'function_call';
170
- call_id: string;
171
- name: string;
172
- arguments: string;
173
- status?: 'in_progress' | 'completed' | 'incomplete';
174
- };
175
- export type ResponseOutputFunctionCallOutput = {
176
- id: string;
161
+ }>;
162
+ export type ResponseOutputFunctionCallOutput = Extract<ResponseOutputItem, {
177
163
  type: 'function_call_output';
178
- call_id: string;
179
- output: string;
180
- };
181
- export type ResponseUsage = {
182
- input_tokens: number;
183
- output_tokens: number;
184
- total_tokens: number;
185
- input_tokens_details?: {
186
- cached_tokens: number;
187
- };
188
- output_tokens_details?: {
189
- reasoning_tokens: number;
190
- };
191
- };
192
- export type ResponseTool = {
193
- type: 'function';
194
- name: string;
195
- description?: string;
196
- parameters?: unknown;
197
- };
198
- export type ResponseOutputItem = ResponseOutputMessage | ResponseOutputFunctionCall | ResponseOutputFunctionCallOutput;
199
- export type ConversationItemInputText = {
200
- type: 'input_text';
201
- text: string;
202
- };
203
- export type ConversationItemMessage = {
204
- id: string;
164
+ }>;
165
+ export type ResponseUsage = NonNullable<ResponsePayload['usage']>;
166
+ export type ResponseTool = NonNullable<ResponsePayload['tools']>[number];
167
+ export type ConversationItem = GeneratedResponse<'GET /v1/conversations/:conversationId/items'>['data'][number];
168
+ export type ConversationItemMessage = Extract<ConversationItem, {
205
169
  type: 'message';
206
- role: 'system' | 'user' | 'assistant';
207
- status: 'completed';
208
- content: Array<ConversationItemInputText | ResponseOutputText>;
209
- };
210
- export type ConversationItem = ConversationItemMessage | ResponseOutputFunctionCall | ResponseOutputFunctionCallOutput;
211
- export type ConversationItemsPage = {
212
- object: 'list';
213
- data: ConversationItem[];
214
- first_id: string | null;
215
- last_id: string | null;
216
- has_more: boolean;
217
- };
218
- export type ResponsesResponse = {
219
- id: string;
220
- object: 'response';
221
- created_at: number;
222
- completed_at?: number | null;
223
- model: string;
224
- status: 'in_progress' | 'completed' | 'incomplete';
225
- output: ResponseOutputItem[];
226
- usage: ResponseUsage | null;
227
- error?: {
228
- code?: string;
229
- message?: string;
230
- } | null;
231
- incomplete_details?: {
232
- reason?: string;
233
- } | null;
234
- instructions?: string | null;
235
- text?: ResponseTextConfig | null;
236
- previous_response_id?: string | null;
237
- conversation_id?: string | null;
238
- /** Provider-returned response state, such as `openai.responseId`, for provider-native continuation. */
239
- providerOptions?: Record<string, Record<string, unknown> | undefined>;
240
- tools?: ResponseTool[];
241
- store?: boolean;
170
+ }>;
171
+ export type ConversationItemInputText = Extract<ConversationItemMessage['content'][number], {
172
+ type: 'input_text';
173
+ }>;
174
+ export type ConversationItemsPage = GeneratedResponse<'GET /v1/conversations/:conversationId/items'>;
175
+ /** Response payload augmented by the SDK with concatenated message text. */
176
+ export type ResponsesResponse = ResponsePayload & {
242
177
  output_text: string;
243
178
  };
244
- export type ResponsesDeleteResponse = {
245
- id: string;
246
- object: 'response';
247
- deleted: true;
248
- };
249
- export type CreateResponseParams = {
250
- /** Optional model override, such as `openai/gpt-5`. When omitted, the agent default model is used. */
251
- model?: string;
252
- /** Mastra agent ID for the request. Required on initial requests; stored follow-ups can omit it when using `previous_response_id`. */
253
- agent_id?: string;
254
- /** Input text or message history for the current turn. */
255
- input: string | ResponseInputMessage[];
256
- /** Request-scoped instructions for the current response. */
257
- instructions?: string;
258
- /** Optional text output format. Supports `json_object` and `json_schema`. */
259
- text?: ResponseTextConfig;
260
- /** Optional conversation ID. In Mastra this is the raw threadId. */
261
- conversation_id?: string;
262
- /** Optional provider-specific options passed through to the underlying model call. */
263
- providerOptions?: Record<string, Record<string, unknown> | undefined>;
264
- /** When true, returns a streaming Responses API event stream. */
265
- stream?: boolean;
266
- /** Persists the response through the selected agent's memory. Requires a memory-backed agent. */
267
- store?: boolean;
268
- /** Continues a previously stored response chain. */
269
- previous_response_id?: string;
270
- requestContext?: RequestContext | Record<string, any>;
271
- };
272
- export type Conversation = {
273
- id: string;
274
- object: 'conversation';
275
- thread: StorageThreadType;
276
- };
277
- export type ConversationDeleted = {
278
- id: string;
279
- object: 'conversation.deleted';
280
- deleted: true;
281
- };
282
- export type CreateConversationParams = {
283
- agent_id: string;
284
- conversation_id?: string;
285
- resource_id?: string;
286
- title?: string;
287
- metadata?: Record<string, unknown>;
288
- requestContext?: RequestContext | Record<string, any>;
289
- };
179
+ export type ResponsesDeleteResponse = GeneratedResponse<'DELETE /v1/responses/:responseId'>;
180
+ export type CreateResponseParams = GeneratedRequest<WithoutIndexSignatures<Body<'POST /v1/responses'>>> & RequestContextOptions;
181
+ export type Conversation = GeneratedResponse<'POST /v1/conversations'>;
182
+ export type ConversationDeleted = GeneratedResponse<'DELETE /v1/conversations/:conversationId'>;
183
+ export type CreateConversationParams = GeneratedRequest<Body<'POST /v1/conversations'>> & RequestContextOptions;
290
184
  export type ResponsesCreatedEvent = {
291
185
  type: 'response.created';
292
186
  response: ResponsesResponse;
@@ -372,11 +266,9 @@ export type NetworkStreamParams<OUTPUT = undefined> = {
372
266
  model?: string;
373
267
  tracingOptions?: TracingOptions;
374
268
  } & Omit<MultiPrimitiveExecutionOptions<OUTPUT>, 'model'>;
375
- export interface GetAgentResponse {
269
+ export type GetAgentResponse = GeneratedResponse<'GET /agents/:agentId'> & {
270
+ /** Handler-provided identifier omitted from the serialized route schema's value shape. */
376
271
  id: string;
377
- name: string;
378
- description?: string;
379
- metadata?: Record<string, unknown>;
380
272
  instructions: AgentInstructions;
381
273
  tools: Record<string, GetToolResponse>;
382
274
  workflows: Record<string, GetWorkflowResponse>;
@@ -386,52 +278,21 @@ export interface GetAgentResponse {
386
278
  }>;
387
279
  skills?: SkillMetadata[];
388
280
  workspaceTools?: string[];
389
- /** Browser tool names available to this agent (if browser is configured) */
390
281
  browserTools?: string[];
391
- /**
392
- * Whether the agent has any browser provider — agent-level SDK browser or
393
- * workspace-level CLI browser. Gates the Studio browser viewer.
394
- */
395
282
  hasBrowser?: boolean;
396
- /** ID of the agent's workspace (if configured) */
397
283
  workspaceId?: string;
398
- provider: string;
399
- modelId: string;
400
- modelVersion: string;
401
- supportsMemory?: boolean;
402
- modelList: Array<{
403
- id: string;
404
- enabled: boolean;
405
- maxRetries: number;
406
- model: {
407
- modelId: string;
408
- provider: string;
409
- modelVersion: string;
410
- };
411
- }> | undefined;
412
- inputProcessors?: Array<{
413
- id: string;
414
- name: string;
415
- }>;
416
- outputProcessors?: Array<{
417
- id: string;
418
- name: string;
419
- }>;
420
284
  defaultOptions: WithoutMethods<AgentExecutionOptions>;
421
285
  defaultGenerateOptionsLegacy: WithoutMethods<AgentGenerateOptions>;
422
286
  defaultStreamOptionsLegacy: WithoutMethods<AgentStreamOptions>;
423
- /** Serialized JSON schema for request context validation */
424
287
  requestContextSchema?: string;
425
- source?: 'code' | 'stored';
426
- status?: 'draft' | 'published' | 'archived';
427
- activeVersionId?: string;
428
- hasDraft?: boolean;
429
288
  editor?: AgentEditorConfig;
430
- }
289
+ };
431
290
  /**
432
- * Response from the browser session probe endpoint.
291
+ * Response from the deployer-provided browser session probe endpoint.
433
292
  *
434
- * Use this to decide whether to open a screencast WebSocket for an agent/thread:
293
+ * This route is registered dynamically by deployer adapters rather than the
294
+ * server route registry, so it has no generated contract. Use it to decide
295
+ * whether to open a screencast WebSocket for an agent/thread:
435
296
  * - `screencastAvailable`: server has the `ws` / `@hono/node-ws` packages installed.
436
297
  * When false, opening a WS will fail and trigger a reconnect loop — skip it.
437
298
  * - `hasSession`: the agent has an active browser session for this thread. When
@@ -450,7 +311,7 @@ export type GenerateLegacyParams<T extends JSONSchema7 | ZodSchema | undefined =
450
311
  requestContext?: RequestContext | Record<string, any>;
451
312
  clientTools?: ToolsInput;
452
313
  clientToolsResolver?: ClientToolsResolver;
453
- } & WithoutMethods<Omit<AgentGenerateOptions<any>, 'model' | 'output' | 'experimental_output' | 'requestContext' | 'clientTools' | 'abortSignal'>>;
314
+ } & WithoutMethods<Omit<AgentGenerateOptions<any>, 'model' | 'output' | 'experimental_output' | 'requestContext' | 'clientTools'>>;
454
315
  export type StreamLegacyParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
455
316
  messages: string | string[] | CoreMessage[] | AiMessageType[] | UIMessageWithMetadata[];
456
317
  model?: string;
@@ -459,7 +320,7 @@ export type StreamLegacyParams<T extends JSONSchema7 | ZodSchema | undefined = u
459
320
  requestContext?: RequestContext | Record<string, any>;
460
321
  clientTools?: ToolsInput;
461
322
  clientToolsResolver?: ClientToolsResolver;
462
- } & WithoutMethods<Omit<AgentStreamOptions<any>, 'model' | 'output' | 'experimental_output' | 'requestContext' | 'clientTools' | 'abortSignal'>>;
323
+ } & WithoutMethods<Omit<AgentStreamOptions<any>, 'model' | 'output' | 'experimental_output' | 'requestContext' | 'clientTools'>>;
463
324
  export type StructuredOutputOptions<OUTPUT = undefined> = Omit<SerializableStructuredOutputOptions<OUTPUT>, 'schema'> & {
464
325
  schema: PublicSchema<OUTPUT>;
465
326
  };
@@ -469,7 +330,12 @@ export type StreamParamsBase<OUTPUT = undefined> = {
469
330
  requestContext?: RequestContext;
470
331
  clientTools?: ToolsInput;
471
332
  clientToolsResolver?: ClientToolsResolver;
472
- } & WithoutMethods<Omit<AgentExecutionOptions<OUTPUT>, 'model' | 'requestContext' | 'clientTools' | 'options' | 'abortSignal' | 'structuredOutput'>>;
333
+ /**
334
+ * Per-call abort signal. Aborting it (or cancelling the returned stream) aborts the
335
+ * underlying request and stops any client-tool continuations.
336
+ */
337
+ abortSignal?: AbortSignal;
338
+ } & WithoutMethods<Omit<AgentExecutionOptions<OUTPUT>, 'model' | 'requestContext' | 'clientTools' | 'options' | 'structuredOutput'>>;
473
339
  export type StreamParamsBaseWithoutMessages<OUTPUT = undefined> = StreamParamsBase<OUTPUT>;
474
340
  export type StreamParams<OUTPUT = undefined> = StreamParamsBase<OUTPUT> & {
475
341
  messages: MessageListInput;
@@ -486,48 +352,24 @@ export type StreamParams<OUTPUT = undefined> = StreamParamsBase<OUTPUT> & {
486
352
  * ids flow through (see Phase 1 of the admin model configuration plan).
487
353
  */
488
354
  export type AdminProviderId = ModelProviderId | (string & {});
489
- export type UpdateModelParams = {
490
- modelId: string;
491
- provider: AdminProviderId;
492
- };
493
- export type UpdateModelInModelListParams = {
494
- modelConfigId: string;
495
- model?: {
496
- modelId: string;
497
- provider: AdminProviderId;
498
- };
499
- maxRetries?: number;
500
- enabled?: boolean;
355
+ export type UpdateModelParams = GeneratedRequest<Body<'POST /agents/:agentId/model'>>;
356
+ export type UpdateModelInModelListParams = Omit<PathParams<'POST /agents/:agentId/models/:modelConfigId'>, 'agentId'> & GeneratedRequest<Body<'POST /agents/:agentId/models/:modelConfigId'>>;
357
+ export type ReorderModelListParams = GeneratedRequest<Body<'POST /agents/:agentId/models/reorder'>>;
358
+ export type GetToolResponse = GeneratedResponse<'GET /tools/:toolId'>;
359
+ /** Query contract with the SDK's legacy `false` sentinel for `limit`. */
360
+ export type ListWorkflowRunsParams = Omit<GeneratedRequest<QueryParams<'GET /workflows/:workflowId/runs'>>, 'limit'> & {
361
+ limit?: number | false;
501
362
  };
502
- export type ReorderModelListParams = {
503
- reorderedModelIds: string[];
363
+ type WorkflowRunsRouteResponse = SerializedRouteResponse<'GET /workflows/:workflowId/runs'>;
364
+ type WorkflowRunSnapshot = WorkflowRuns['runs'][number]['snapshot'];
365
+ export type ListWorkflowRunsResponse = Omit<WorkflowRunsRouteResponse, 'runs'> & {
366
+ runs: Array<Omit<WorkflowRunsRouteResponse['runs'][number], 'snapshot'> & {
367
+ snapshot: WorkflowRunSnapshot;
368
+ }>;
504
369
  };
505
- export interface GetToolResponse {
506
- id: string;
507
- description: string;
508
- inputSchema: string;
509
- outputSchema: string;
510
- requestContextSchema?: string;
511
- }
512
- export interface ListWorkflowRunsParams {
513
- fromDate?: Date;
514
- toDate?: Date;
515
- page?: number;
516
- perPage?: number;
517
- resourceId?: string;
518
- status?: WorkflowRunStatus;
519
- /** @deprecated Use page instead */
520
- offset?: number;
521
- /** @deprecated Use perPage instead */
522
- limit?: number | false;
523
- }
524
- export type ListWorkflowRunsResponse = WorkflowRuns;
525
- export interface WorkflowRunCounts {
526
- running: number;
527
- suspended: number;
528
- }
529
- export type ListWorkflowRunCountsResponse = Record<string, WorkflowRunCounts>;
530
- export type GetWorkflowRunByIdResponse = WorkflowState;
370
+ export type WorkflowRunCounts = GeneratedResponse<'GET /workflows/run-counts'>[string];
371
+ export type ListWorkflowRunCountsResponse = GeneratedResponse<'GET /workflows/run-counts'>;
372
+ export type GetWorkflowRunByIdResponse = Omit<GeneratedResponse<'GET /workflows/:workflowId/runs/:runId'>, 'serializedStepGraph'> & Omit<Serialized<WorkflowState>, 'serializedStepGraph'> & Pick<WorkflowState, 'serializedStepGraph'>;
531
373
  export type ListDynamicWorkflowsParams = GeneratedRequest<QueryParams<'GET /stored/workflows'>>;
532
374
  export type ListDynamicWorkflowsResponse = GeneratedResponse<'GET /stored/workflows'>;
533
375
  export type UpsertDynamicWorkflowParams = GeneratedRequest<Body<'POST /stored/workflows'>>;
@@ -535,154 +377,62 @@ export type UpsertDynamicWorkflowResponse = GeneratedResponse<'POST /stored/work
535
377
  type DynamicWorkflowDefinitionField = 'description' | 'inputSchema' | 'outputSchema' | 'stateSchema' | 'requestContextSchema' | 'graph';
536
378
  export type DynamicWorkflowDefinition = Omit<GeneratedResponse<'GET /stored/workflows/:dynamicWorkflowId'>, DynamicWorkflowDefinitionField> & Pick<UpsertDynamicWorkflowParams, DynamicWorkflowDefinitionField>;
537
379
  export type DeleteDynamicWorkflowResponse = GeneratedResponse<'DELETE /stored/workflows/:dynamicWorkflowId'>;
538
- export interface GetWorkflowResponse {
380
+ export type GetWorkflowResponse = Omit<GeneratedResponse<'GET /workflows/:workflowId'>, 'name' | 'stepGraph'> & {
539
381
  name: string;
540
- description?: string;
541
- metadata?: Record<string, unknown>;
542
- steps: {
543
- [key: string]: {
544
- id: string;
545
- description: string;
546
- inputSchema: string;
547
- outputSchema: string;
548
- resumeSchema: string;
549
- suspendSchema: string;
550
- stateSchema: string;
551
- metadata?: Record<string, unknown>;
552
- };
553
- };
554
- allSteps: {
555
- [key: string]: {
556
- id: string;
557
- description: string;
558
- inputSchema: string;
559
- outputSchema: string;
560
- resumeSchema: string;
561
- suspendSchema: string;
562
- stateSchema: string;
563
- isWorkflow: boolean;
564
- metadata?: Record<string, unknown>;
565
- };
566
- };
567
- stepGraph: Workflow['serializedStepGraph'];
568
- inputSchema: string;
569
- outputSchema: string;
570
- stateSchema: string;
571
- /** Serialized JSON schema for request context validation */
382
+ stepGraph?: SerializedStepFlowEntry[];
572
383
  requestContextSchema?: string;
573
- /** Whether this workflow is a processor workflow (auto-generated from agent processors) */
574
- isProcessorWorkflow?: boolean;
575
- /**
576
- * How this workflow got into the live registry. `'code'` for statically
577
- * authored or `addWorkflow()`-added workflows, `'dynamic'` for anything
578
- * hydrated or added via `addDynamicWorkflow()`. Absent on older servers.
579
- */
580
- origin?: 'code' | 'dynamic';
581
- }
384
+ };
582
385
  export type WorkflowRunResult = WorkflowResult<any, any, any, any>;
583
386
  export type UpsertVectorParams = GeneratedRequest<Body<'POST /vector/:vectorName/upsert'>>;
584
387
  export type CreateIndexParams = GeneratedRequest<Body<'POST /vector/:vectorName/create-index'>>;
585
- export interface QueryVectorParams {
586
- indexName: string;
587
- queryVector: number[];
588
- topK?: number;
589
- filter?: Record<string, any>;
590
- includeVector?: boolean;
591
- }
592
- export type QueryVectorResponse = QueryResult[];
388
+ export type QueryVectorParams = GeneratedRequest<Body<'POST /vector/:vectorName/query'>>;
389
+ /** The server schema currently represents vector-store-specific result rows as `unknown`. */
390
+ export type QueryVectorResponse = GeneratedResponse<'POST /vector/:vectorName/query'> & QueryResult[];
593
391
  export type GetVectorIndexResponse = GeneratedResponse<'GET /vector/:vectorName/indexes/:indexName'>;
594
- export interface SaveMessageToMemoryParams {
392
+ export type SaveMessageToMemoryParams = GeneratedRequest<Body<'POST /memory/save-messages'> & QueryParams<'POST /memory/save-messages'>> & RequestContextOptions & {
595
393
  messages: (MastraMessageV1 | MastraDBMessage)[];
596
- agentId: string;
597
- requestContext?: RequestContext | Record<string, any>;
598
- }
599
- export interface SaveNetworkMessageToMemoryParams {
394
+ };
395
+ export type SaveNetworkMessageToMemoryParams = GeneratedRequest<Body<'POST /memory/network/save-messages'> & QueryParams<'POST /memory/network/save-messages'>> & {
600
396
  messages: (MastraMessageV1 | MastraDBMessage)[];
601
- networkId: string;
602
- }
603
- export type SaveMessageToMemoryResponse = {
397
+ };
398
+ /** The server schema currently represents persisted message payloads as `unknown`. */
399
+ export type SaveMessageToMemoryResponse = GeneratedResponse<'POST /memory/save-messages'> & {
604
400
  messages: (MastraMessageV1 | MastraDBMessage)[];
605
401
  };
606
402
  export type CreateMemoryThreadParams = GeneratedRequest<Body<'POST /memory/threads'> & QueryParams<'POST /memory/threads'>> & RequestContextOptions;
607
403
  export type CreateMemoryThreadResponse = GeneratedResponse<'POST /memory/threads'>;
608
- export interface ListMemoryThreadsParams {
609
- /**
610
- * Optional resourceId to filter threads. When not provided, returns all threads.
611
- */
612
- resourceId?: string;
613
- /**
614
- * Optional metadata filter. Threads must match all specified key-value pairs (AND logic).
615
- */
616
- metadata?: Record<string, unknown>;
617
- /**
618
- * Optional agentId. When not provided and storage is configured on the server,
619
- * threads will be retrieved using storage directly.
620
- */
621
- agentId?: string;
622
- page?: number;
623
- perPage?: number;
624
- orderBy?: {
625
- field?: 'createdAt' | 'updatedAt';
626
- direction?: 'ASC' | 'DESC';
627
- };
628
- requestContext?: RequestContext | Record<string, any>;
629
- }
404
+ export type ListMemoryThreadsParams = GeneratedRequest<QueryParams<'GET /memory/threads'>> & RequestContextOptions;
630
405
  export type ListMemoryThreadsResponse = GeneratedResponse<'GET /memory/threads'>;
631
406
  export type GetMemoryConfigParams = GeneratedRequest<QueryParams<'GET /memory/config'>> & RequestContextOptions;
632
407
  export type GetMemoryConfigResponse = GeneratedResponse<'GET /memory/config'>;
633
- export interface UpdateMemoryThreadParams {
634
- title: string;
635
- metadata: Record<string, any>;
636
- resourceId: string;
637
- /**
638
- * Agent ID. Required by the server for write operations. If omitted, the agentId provided
639
- * to `getMemoryThread({ threadId, agentId })` is used.
640
- */
408
+ export type UpdateMemoryThreadParams = Omit<GeneratedRequest<Body<'PATCH /memory/threads/:threadId'> & QueryParams<'PATCH /memory/threads/:threadId'>>, 'agentId'> & RequestContextOptions & {
409
+ /** Resolved from the resource constructor when omitted. */
641
410
  agentId?: string;
642
- requestContext?: RequestContext | Record<string, any>;
643
- }
644
- export type ListMemoryThreadMessagesParams = Omit<StorageListMessagesInput, 'threadId'> & {
645
- includeSystemReminders?: boolean;
646
411
  };
647
- export type ListMemoryThreadMessagesResponse = {
412
+ export type ListMemoryThreadMessagesParams = GeneratedRequest<QueryParams<'GET /memory/threads/:threadId/messages'>> & RequestContextOptions & {
413
+ /** Optional network ID. When provided, uses the network memory endpoint. */
414
+ networkId?: string;
415
+ };
416
+ /** The route schema intentionally keeps persisted message payloads opaque. */
417
+ export type ListMemoryThreadMessagesResponse = GeneratedResponse<'GET /memory/threads/:threadId/messages'> & {
648
418
  messages: MastraDBMessage[];
649
419
  };
650
- export interface CloneMemoryThreadParams {
651
- newThreadId?: string;
652
- resourceId?: string;
653
- title?: string;
654
- metadata?: Record<string, any>;
655
- options?: {
656
- messageLimit?: number;
657
- messageFilter?: {
658
- startDate?: Date;
659
- endDate?: Date;
660
- messageIds?: string[];
661
- };
662
- };
663
- /**
664
- * Agent ID. Required by the server for write operations. If omitted, the agentId provided
665
- * to `getMemoryThread({ threadId, agentId })` is used.
666
- */
420
+ export type CloneMemoryThreadParams = Omit<GeneratedRequest<Body<'POST /memory/threads/:threadId/clone'> & QueryParams<'POST /memory/threads/:threadId/clone'>>, 'agentId'> & RequestContextOptions & {
421
+ /** Resolved from the resource constructor when omitted. */
667
422
  agentId?: string;
668
- requestContext?: RequestContext | Record<string, any>;
669
- }
670
- export type CloneMemoryThreadResponse = {
423
+ };
424
+ /** The route schema intentionally keeps cloned persisted message payloads opaque. */
425
+ export type CloneMemoryThreadResponse = GeneratedResponse<'POST /memory/threads/:threadId/clone'> & {
671
426
  thread: StorageThreadType;
672
427
  clonedMessages: MastraDBMessage[];
673
428
  };
674
429
  export type TransferMemoryThreadParams = GeneratedRequest<Body<'POST /memory/threads/:threadId/transfer'> & QueryParams<'POST /memory/threads/:threadId/transfer'>> & RequestContextOptions;
675
430
  export type GetLogsParams = GeneratedRequest<QueryParams<'GET /logs'>>;
676
- export interface GetLogParams {
677
- runId: string;
678
- transportId: string;
431
+ export type GetLogParams = Omit<PathParams<'GET /logs/:runId'> & GeneratedRequest<QueryParams<'GET /logs/:runId'>>, 'fromDate' | 'toDate'> & {
432
+ /** SDK convenience inputs serialized to the route's ISO date query values. */
679
433
  fromDate?: Date;
680
434
  toDate?: Date;
681
- logLevel?: LogLevel;
682
- filters?: Record<string, string>;
683
- page?: number;
684
- perPage?: number;
685
- }
435
+ };
686
436
  export type GetLogsResponse = GeneratedResponse<'GET /logs'>;
687
437
  export type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
688
438
  export interface GetVNextNetworkResponse {
@@ -745,28 +495,20 @@ export interface LoopVNextNetworkResponse {
745
495
  };
746
496
  steps: WorkflowResult<any, any, any, any>['steps'];
747
497
  }
748
- export interface McpServerListResponse {
749
- servers: ServerInfo[];
750
- next: string | null;
751
- total_count: number;
752
- }
753
- export interface McpToolInfo {
754
- id: string;
755
- name: string;
756
- description?: string;
757
- inputSchema: string;
758
- toolType?: MCPToolType;
759
- _meta?: Record<string, unknown>;
760
- }
761
- export interface McpServerToolListResponse {
762
- tools: McpToolInfo[];
763
- }
498
+ export type McpServerListResponse = GeneratedResponse<'GET /mcp/v0/servers'>;
499
+ export type McpToolInfo = GeneratedResponse<'GET /mcp/:serverId/tools/:toolId'>;
500
+ export type McpServerToolListResponse = GeneratedResponse<'GET /mcp/:serverId/tools'>;
501
+ /**
502
+ * `{ result }` for a completed tool, or the suspended shape a 2026-07-28 server reports
503
+ * when the tool asked for input (answer with `resumeData` and the echoed `suspendPayload`).
504
+ */
505
+ export type McpToolExecuteResponse = RouteResponse<'POST /mcp/:serverId/tools/:toolId/execute'>;
764
506
  /**
765
507
  * Client version of ScoreRowData with dates serialized as strings (from JSON)
766
508
  */
767
509
  export type ClientScoreRowData = Omit<ScoreRowData, 'createdAt' | 'updatedAt'> & {
768
510
  createdAt: string;
769
- updatedAt: string;
511
+ updatedAt: string | null;
770
512
  };
771
513
  /**
772
514
  * Response for listing scores (client version with serialized dates)
@@ -775,40 +517,19 @@ export type ListScoresResponse = {
775
517
  pagination: PaginationInfo;
776
518
  scores: ClientScoreRowData[];
777
519
  };
778
- export interface ListScoresByRunIdParams {
779
- runId: string;
780
- page?: number;
781
- perPage?: number;
782
- }
783
- export interface ListScoresByScorerIdParams {
784
- scorerId: string;
785
- entityId?: string;
786
- entityType?: string;
787
- page?: number;
788
- perPage?: number;
789
- }
790
- export interface ListScoresByEntityIdParams {
791
- entityId: string;
792
- entityType: string;
793
- page?: number;
794
- perPage?: number;
795
- }
796
- export interface SaveScoreParams {
520
+ export type ListScoresByRunIdParams = GeneratedRequest<PathParams<'GET /scores/run/:runId'> & QueryParams<'GET /scores/run/:runId'>>;
521
+ export type ListScoresByScorerIdParams = GeneratedRequest<PathParams<'GET /scores/scorer/:scorerId'> & QueryParams<'GET /scores/scorer/:scorerId'>>;
522
+ export type ListScoresByEntityIdParams = GeneratedRequest<PathParams<'GET /scores/entity/:entityType/:entityId'> & QueryParams<'GET /scores/entity/:entityType/:entityId'>>;
523
+ /** Score records remain opaque in the route schema because their shape is scorer-specific. */
524
+ export type SaveScoreParams = GeneratedRequest<Body<'POST /scores'>> & {
797
525
  score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>;
798
- }
799
- export interface SaveScoreResponse {
526
+ };
527
+ /** Score records remain opaque in the route schema because their shape is scorer-specific. */
528
+ export type SaveScoreResponse = GeneratedResponse<'POST /scores'> & {
800
529
  score: ClientScoreRowData;
801
- }
802
- export type GetScorerResponse = MastraScorerEntry & {
803
- agentIds: string[];
804
- agentNames: string[];
805
- workflowIds: string[];
806
- isRegistered: boolean;
807
- source: 'code' | 'stored';
808
530
  };
809
- export interface GetScorersResponse {
810
- scorers: Array<GetScorerResponse>;
811
- }
531
+ export type GetScorerResponse = GeneratedResponse<'GET /scores/scorers/:scorerId'>;
532
+ export type GetScorersResponse = GeneratedResponse<'GET /scores/scorers'>;
812
533
  export interface TemplateInstallationRequest {
813
534
  /** Template repository URL or slug */
814
535
  repo: string;
@@ -856,17 +577,9 @@ export interface MemorySearchResult {
856
577
  }>;
857
578
  };
858
579
  }
859
- export interface TimeTravelParams {
860
- step: string | string[];
861
- inputData?: Record<string, any>;
862
- resumeData?: Record<string, any>;
863
- initialState?: Record<string, any>;
864
- context?: TimeTravelContext<any, any, any, any>;
865
- nestedStepsContext?: Record<string, TimeTravelContext<any, any, any, any>>;
580
+ export type TimeTravelParams = Omit<Body<'POST /workflows/:workflowId/time-travel'>, 'requestContext'> & {
866
581
  requestContext?: RequestContext | Record<string, any>;
867
- tracingOptions?: TracingOptions;
868
- perStep?: boolean;
869
- }
582
+ };
870
583
  /**
871
584
  * Semantic recall configuration for vector-based memory retrieval
872
585
  */
@@ -884,8 +597,12 @@ export interface SemanticRecallConfig {
884
597
  * Title generation configuration
885
598
  */
886
599
  export type TitleGenerationConfig = boolean | {
887
- model: string;
600
+ model?: string;
888
601
  instructions?: string;
602
+ /** Minimum number of thread messages required before a title is generated */
603
+ minMessages?: number;
604
+ /** Emit the generated title as a transient `data-thread-title` chunk on the run stream, before `finish` */
605
+ emitEvent?: boolean;
889
606
  };
890
607
  /**
891
608
  * Serialized memory configuration matching SerializedMemoryConfig from @mastra/core
@@ -1085,17 +802,9 @@ export interface StoredAgentSkillConfig {
1085
802
  /** Resolution strategy: 'latest' = latest published version, 'live' = read from filesystem */
1086
803
  strategy?: 'latest' | 'live';
1087
804
  }
1088
- /**
1089
- * Workspace reference stored in agent snapshots.
1090
- * Can reference a stored workspace by ID or provide inline workspace config.
1091
- */
1092
- export type StoredWorkspaceRef = {
1093
- type: 'id';
1094
- workspaceId: string;
1095
- } | {
1096
- type: 'inline';
1097
- config: Record<string, unknown>;
1098
- };
805
+ export type StoredWorkspaceRef = Extract<NonNullable<GeneratedRequest<Body<'POST /stored/agents'>>['workspace']>, {
806
+ type: 'id' | 'inline' | 'provider';
807
+ }>;
1099
808
  export interface StoredBrowserConfig {
1100
809
  provider: string;
1101
810
  headless?: boolean;
@@ -1146,67 +855,11 @@ export type StoredAgentDurableConfig = boolean | {
1146
855
  /**
1147
856
  * Stored agent data returned from API
1148
857
  */
1149
- export interface StoredAgentResponse {
1150
- id: string;
1151
- status: string;
1152
- activeVersionId?: string;
1153
- authorId?: string;
1154
- author?: ResolvedAuthor;
1155
- visibility?: 'private' | 'public';
1156
- metadata?: Record<string, unknown>;
1157
- createdAt: string;
1158
- updatedAt: string;
1159
- name: string;
1160
- description?: string;
1161
- instructions: string | AgentInstructionBlock[];
1162
- model: ConditionalField<{
1163
- provider: string;
1164
- name: string;
1165
- [key: string]: unknown;
1166
- }>;
1167
- tools?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1168
- defaultOptions?: ConditionalField<DefaultOptions>;
1169
- workflows?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1170
- agents?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1171
- integrationTools?: ConditionalField<Record<string, StoredMCPClientToolsConfig>>;
1172
- toolProviders?: ConditionalField<Record<string, StoredToolProviderConfig>>;
1173
- mcpClients?: ConditionalField<Record<string, StoredMCPClientToolsConfig>>;
1174
- inputProcessors?: ConditionalField<StoredProcessorGraph>;
1175
- outputProcessors?: ConditionalField<StoredProcessorGraph>;
1176
- memory?: ConditionalField<SerializedMemoryConfig>;
1177
- scorers?: ConditionalField<Record<string, StoredAgentScorerConfig>>;
1178
- skills?: ConditionalField<Record<string, StoredAgentSkillConfig>>;
1179
- workspace?: ConditionalField<StoredWorkspaceRef>;
1180
- browser?: ConditionalField<StoredBrowserRef> | boolean | null;
1181
- requestContextSchema?: Record<string, unknown>;
1182
- durable?: StoredAgentDurableConfig;
1183
- isFavorited?: boolean;
1184
- favoriteCount?: number;
1185
- }
858
+ export type StoredAgentResponse = GeneratedResponse<'GET /stored/agents/:storedAgentId'>;
1186
859
  /**
1187
860
  * Parameters for listing stored agents
1188
861
  */
1189
- export interface ListStoredAgentsParams {
1190
- page?: number;
1191
- perPage?: number;
1192
- orderBy?: {
1193
- field?: 'createdAt' | 'updatedAt';
1194
- direction?: 'ASC' | 'DESC';
1195
- };
1196
- status?: 'draft' | 'published' | 'archived';
1197
- authorId?: string;
1198
- /**
1199
- * Restrict the list to public records. Only `'public'` is accepted by the
1200
- * server filter; private records are surfaced via the default scope-aware
1201
- * filter (caller's own rows + legacy unowned).
1202
- */
1203
- visibility?: 'public';
1204
- metadata?: Record<string, unknown>;
1205
- /** When true, only return agents favorited by the caller (or by `pinFavoritedFor`). */
1206
- favoritedOnly?: boolean;
1207
- /** When set, sort favorited-first for this user id. Required for `favoritedOnly`. */
1208
- pinFavoritedFor?: string;
1209
- }
862
+ export type ListStoredAgentsParams = GeneratedRequest<QueryParams<'GET /stored/agents'>>;
1210
863
  /**
1211
864
  * Response from favorite / unfavorite mutations.
1212
865
  */
@@ -1217,13 +870,7 @@ export interface FavoriteToggleResponse {
1217
870
  /**
1218
871
  * Response for listing stored agents
1219
872
  */
1220
- export interface ListStoredAgentsResponse {
1221
- agents: StoredAgentResponse[];
1222
- total: number;
1223
- page: number;
1224
- perPage: number | false;
1225
- hasMore: boolean;
1226
- }
873
+ export type ListStoredAgentsResponse = GeneratedResponse<'GET /stored/agents'>;
1227
874
  /**
1228
875
  * Parameters for cloning an agent to a stored agent
1229
876
  */
@@ -1245,51 +892,7 @@ export interface CloneAgentParams {
1245
892
  * Parameters for creating a stored agent.
1246
893
  * Flat union of agent-record fields and config fields.
1247
894
  */
1248
- export interface CreateStoredAgentParams {
1249
- /** Unique identifier for the agent. If not provided, derived from name via slugify. */
1250
- id?: string;
1251
- authorId?: string;
1252
- /** Visibility of the agent. Defaults to 'private'. */
1253
- visibility?: 'private' | 'public';
1254
- metadata?: Record<string, unknown>;
1255
- name: string;
1256
- description?: string;
1257
- instructions: string | AgentInstructionBlock[];
1258
- model: ConditionalField<{
1259
- provider: string;
1260
- name: string;
1261
- [key: string]: unknown;
1262
- }>;
1263
- tools?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1264
- defaultOptions?: ConditionalField<DefaultOptions>;
1265
- workflows?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1266
- agents?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1267
- integrationTools?: ConditionalField<Record<string, StoredMCPClientToolsConfig>>;
1268
- toolProviders?: ConditionalField<Record<string, StoredToolProviderConfig>>;
1269
- mcpClients?: ConditionalField<Record<string, StoredMCPClientToolsConfig>>;
1270
- inputProcessors?: ConditionalField<StoredProcessorGraph>;
1271
- outputProcessors?: ConditionalField<StoredProcessorGraph>;
1272
- memory?: ConditionalField<SerializedMemoryConfig>;
1273
- scorers?: ConditionalField<Record<string, StoredAgentScorerConfig>>;
1274
- skills?: ConditionalField<Record<string, StoredAgentSkillConfig>>;
1275
- workspace?: ConditionalField<StoredWorkspaceRef>;
1276
- /** Browser config. `true` = use admin default, `false` = no browser. */
1277
- browser?: ConditionalField<StoredBrowserRef> | boolean | null;
1278
- requestContextSchema?: Record<string, unknown>;
1279
- /**
1280
- * Run this agent with durable execution once it is hydrated by the server.
1281
- * Cache and pubsub are inherited from the server's Mastra instance — without
1282
- * distributed backends durability is process-local.
1283
- */
1284
- durable?: StoredAgentDurableConfig;
1285
- /**
1286
- * Publish the initial version so the agent resolves at `status: 'published'`.
1287
- * Defaults to true when omitted. Pass false to stage the agent as an unpublished
1288
- * draft — useful when overriding a code-defined agent, whose code definition keeps
1289
- * serving traffic until the override is published.
1290
- */
1291
- autoPublish?: boolean;
1292
- }
895
+ export type CreateStoredAgentParams = GeneratedRequest<Body<'POST /stored/agents'>>;
1293
896
  /**
1294
897
  * Parameters for updating a stored agent
1295
898
  */
@@ -1299,60 +902,13 @@ export type OpenStoredAgentChangeRequestParams = ExportStoredAgentParams & {
1299
902
  userName?: string;
1300
903
  inspectOnly?: boolean;
1301
904
  };
1302
- export interface ExportStoredAgentResponse {
1303
- agentId: string;
1304
- fileName: string;
1305
- content: string;
1306
- config: Record<string, unknown>;
1307
- }
1308
- export interface OpenStoredAgentChangeRequestResponse {
1309
- id?: string | number;
1310
- url: string;
1311
- ref?: string;
1312
- }
1313
- export interface UpdateStoredAgentParams {
1314
- authorId?: string;
1315
- /** Visibility of the agent. */
1316
- visibility?: 'private' | 'public';
1317
- metadata?: Record<string, unknown>;
1318
- name?: string;
1319
- description?: string;
1320
- instructions?: string | AgentInstructionBlock[];
1321
- model?: ConditionalField<{
1322
- provider: string;
1323
- name: string;
1324
- [key: string]: unknown;
1325
- }>;
1326
- tools?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1327
- defaultOptions?: ConditionalField<DefaultOptions>;
1328
- workflows?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1329
- agents?: ConditionalField<Record<string, StoredAgentToolConfig>>;
1330
- integrationTools?: ConditionalField<Record<string, StoredMCPClientToolsConfig>>;
1331
- toolProviders?: ConditionalField<Record<string, StoredToolProviderConfig>>;
1332
- mcpClients?: ConditionalField<Record<string, StoredMCPClientToolsConfig>>;
1333
- inputProcessors?: ConditionalField<StoredProcessorGraph>;
1334
- outputProcessors?: ConditionalField<StoredProcessorGraph>;
1335
- memory?: ConditionalField<SerializedMemoryConfig>;
1336
- scorers?: ConditionalField<Record<string, StoredAgentScorerConfig>>;
1337
- skills?: ConditionalField<Record<string, StoredAgentSkillConfig>>;
1338
- workspace?: ConditionalField<StoredWorkspaceRef>;
1339
- /** Browser config. `true` = use admin default, `false` = no browser. */
1340
- browser?: ConditionalField<StoredBrowserRef> | boolean | null;
1341
- requestContextSchema?: Record<string, unknown>;
1342
- /** Run this agent with durable execution once it is hydrated by the server. */
1343
- durable?: StoredAgentDurableConfig;
1344
- /** Optional message describing the changes for the auto-created version */
1345
- changeMessage?: string;
1346
- /** Immediately activate the auto-created version. Defaults to false when omitted. */
1347
- autoPublish?: boolean;
1348
- }
905
+ export type ExportStoredAgentResponse = GeneratedResponse<'POST /stored/agents/:storedAgentId/export'>;
906
+ export type OpenStoredAgentChangeRequestResponse = GeneratedResponse<'POST /stored/agents/:storedAgentId/change-request'>;
907
+ export type UpdateStoredAgentParams = GeneratedRequest<Body<'PATCH /stored/agents/:storedAgentId'>>;
1349
908
  /**
1350
909
  * Response for deleting a stored agent
1351
910
  */
1352
- export interface DeleteStoredAgentResponse {
1353
- success: boolean;
1354
- message: string;
1355
- }
911
+ export type DeleteStoredAgentResponse = GeneratedResponse<'DELETE /stored/agents/:storedAgentId'>;
1356
912
  /**
1357
913
  * A single agent that references another agent as a sub-agent. Includes both
1358
914
  * public and the caller's own private agents — anything the caller can read.
@@ -1367,10 +923,7 @@ export interface StoredAgentDependent {
1367
923
  * `hiddenCount` aggregates dependents the caller cannot read; it is only
1368
924
  * non-zero when the target agent is public.
1369
925
  */
1370
- export interface StoredAgentDependentsResponse {
1371
- dependents: StoredAgentDependent[];
1372
- hiddenCount: number;
1373
- }
926
+ export type StoredAgentDependentsResponse = GeneratedResponse<'GET /stored/agents/:storedAgentId/dependents'>;
1374
927
  /**
1375
928
  * Sampling configuration for scorers
1376
929
  */
@@ -1387,105 +940,27 @@ export type StoredScorerType = 'llm-judge' | 'answer-relevancy' | 'answer-simila
1387
940
  /**
1388
941
  * Stored scorer definition data returned from API
1389
942
  */
1390
- export interface StoredScorerResponse {
1391
- id: string;
1392
- status: string;
1393
- activeVersionId?: string;
1394
- authorId?: string;
1395
- metadata?: Record<string, unknown>;
1396
- createdAt: string;
1397
- updatedAt: string;
1398
- name: string;
1399
- description?: string;
1400
- type: StoredScorerType;
1401
- model?: {
1402
- provider: string;
1403
- name: string;
1404
- [key: string]: unknown;
1405
- };
1406
- instructions?: string;
1407
- scoreRange?: {
1408
- min?: number;
1409
- max?: number;
1410
- };
1411
- presetConfig?: Record<string, unknown>;
1412
- defaultSampling?: ScorerSamplingConfig;
1413
- }
943
+ export type StoredScorerResponse = GeneratedResponse<'GET /stored/scorers/:storedScorerId'>;
1414
944
  /**
1415
945
  * Parameters for listing stored scorer definitions
1416
946
  */
1417
- export interface ListStoredScorersParams {
1418
- page?: number;
1419
- perPage?: number;
1420
- orderBy?: {
1421
- field?: 'createdAt' | 'updatedAt';
1422
- direction?: 'ASC' | 'DESC';
1423
- };
1424
- authorId?: string;
1425
- metadata?: Record<string, unknown>;
1426
- }
947
+ export type ListStoredScorersParams = GeneratedRequest<QueryParams<'GET /stored/scorers'>>;
1427
948
  /**
1428
949
  * Response for listing stored scorer definitions
1429
950
  */
1430
- export interface ListStoredScorersResponse {
1431
- scorerDefinitions: StoredScorerResponse[];
1432
- total: number;
1433
- page: number;
1434
- perPage: number | false;
1435
- hasMore: boolean;
1436
- }
951
+ export type ListStoredScorersResponse = GeneratedResponse<'GET /stored/scorers'>;
1437
952
  /**
1438
953
  * Parameters for creating a stored scorer definition
1439
954
  */
1440
- export interface CreateStoredScorerParams {
1441
- id?: string;
1442
- authorId?: string;
1443
- metadata?: Record<string, unknown>;
1444
- name: string;
1445
- description?: string;
1446
- type: StoredScorerType;
1447
- model?: {
1448
- provider: string;
1449
- name: string;
1450
- [key: string]: unknown;
1451
- };
1452
- instructions?: string;
1453
- scoreRange?: {
1454
- min?: number;
1455
- max?: number;
1456
- };
1457
- presetConfig?: Record<string, unknown>;
1458
- defaultSampling?: ScorerSamplingConfig;
1459
- }
955
+ export type CreateStoredScorerParams = GeneratedRequest<Body<'POST /stored/scorers'>>;
1460
956
  /**
1461
957
  * Parameters for updating a stored scorer definition
1462
958
  */
1463
- export interface UpdateStoredScorerParams {
1464
- authorId?: string;
1465
- metadata?: Record<string, unknown>;
1466
- name?: string;
1467
- description?: string;
1468
- type?: StoredScorerType;
1469
- model?: {
1470
- provider: string;
1471
- name: string;
1472
- [key: string]: unknown;
1473
- };
1474
- instructions?: string;
1475
- scoreRange?: {
1476
- min?: number;
1477
- max?: number;
1478
- };
1479
- presetConfig?: Record<string, unknown>;
1480
- defaultSampling?: ScorerSamplingConfig;
1481
- }
959
+ export type UpdateStoredScorerParams = GeneratedRequest<Body<'PATCH /stored/scorers/:storedScorerId'>>;
1482
960
  /**
1483
961
  * Response for deleting a stored scorer definition
1484
962
  */
1485
- export interface DeleteStoredScorerResponse {
1486
- success: boolean;
1487
- message: string;
1488
- }
963
+ export type DeleteStoredScorerResponse = GeneratedResponse<'DELETE /stored/scorers/:storedScorerId'>;
1489
964
  /**
1490
965
  * MCP server transport configuration
1491
966
  */
@@ -1500,69 +975,27 @@ export interface StoredMCPServerConfig {
1500
975
  /**
1501
976
  * Stored MCP client data returned from API
1502
977
  */
1503
- export interface StoredMCPClientResponse {
1504
- id: string;
1505
- status: string;
1506
- activeVersionId?: string;
1507
- authorId?: string;
1508
- metadata?: Record<string, unknown>;
1509
- createdAt: string;
1510
- updatedAt: string;
1511
- name: string;
1512
- description?: string;
1513
- servers: Record<string, StoredMCPServerConfig>;
1514
- }
978
+ export type StoredMCPClientResponse = GeneratedResponse<'GET /stored/mcp-clients/:storedMCPClientId'>;
1515
979
  /**
1516
980
  * Parameters for listing stored MCP clients
1517
981
  */
1518
- export interface ListStoredMCPClientsParams {
1519
- page?: number;
1520
- perPage?: number;
1521
- orderBy?: {
1522
- field?: 'createdAt' | 'updatedAt';
1523
- direction?: 'ASC' | 'DESC';
1524
- };
1525
- authorId?: string;
1526
- metadata?: Record<string, unknown>;
1527
- }
982
+ export type ListStoredMCPClientsParams = GeneratedRequest<QueryParams<'GET /stored/mcp-clients'>>;
1528
983
  /**
1529
984
  * Response for listing stored MCP clients
1530
985
  */
1531
- export interface ListStoredMCPClientsResponse {
1532
- mcpClients: StoredMCPClientResponse[];
1533
- total: number;
1534
- page: number;
1535
- perPage: number | false;
1536
- hasMore: boolean;
1537
- }
986
+ export type ListStoredMCPClientsResponse = GeneratedResponse<'GET /stored/mcp-clients'>;
1538
987
  /**
1539
988
  * Parameters for creating a stored MCP client
1540
989
  */
1541
- export interface CreateStoredMCPClientParams {
1542
- id?: string;
1543
- authorId?: string;
1544
- metadata?: Record<string, unknown>;
1545
- name: string;
1546
- description?: string;
1547
- servers: Record<string, StoredMCPServerConfig>;
1548
- }
990
+ export type CreateStoredMCPClientParams = GeneratedRequest<Body<'POST /stored/mcp-clients'>>;
1549
991
  /**
1550
992
  * Parameters for updating a stored MCP client
1551
993
  */
1552
- export interface UpdateStoredMCPClientParams {
1553
- authorId?: string;
1554
- metadata?: Record<string, unknown>;
1555
- name?: string;
1556
- description?: string;
1557
- servers?: Record<string, StoredMCPServerConfig>;
1558
- }
994
+ export type UpdateStoredMCPClientParams = GeneratedRequest<Body<'PATCH /stored/mcp-clients/:storedMCPClientId'>>;
1559
995
  /**
1560
996
  * Response for deleting a stored MCP client
1561
997
  */
1562
- export interface DeleteStoredMCPClientResponse {
1563
- success: boolean;
1564
- message: string;
1565
- }
998
+ export type DeleteStoredMCPClientResponse = GeneratedResponse<'DELETE /stored/mcp-clients/:storedMCPClientId'>;
1566
999
  export interface AgentVersionResponse {
1567
1000
  id: string;
1568
1001
  agentId: string;
@@ -1699,14 +1132,8 @@ export interface CompareScorerVersionsResponse {
1699
1132
  diffs: VersionDiff[];
1700
1133
  }
1701
1134
  export type ListAgentsModelProvidersResponse = GeneratedResponse<'GET /agents/providers'>;
1702
- export interface Provider {
1703
- id: string;
1704
- name: string;
1705
- envVar: string | string[];
1706
- connected: boolean;
1707
- docUrl?: string;
1708
- models: string[];
1709
- }
1135
+ export type GetAgentBuilderActionsResponse = GeneratedResponse<'GET /agent-builder'>;
1136
+ export type Provider = ListAgentsModelProvidersResponse['providers'][number];
1710
1137
  export interface MastraPackage {
1711
1138
  name: string;
1712
1139
  version: string;
@@ -1900,92 +1327,27 @@ export interface StoredSkillFileNode {
1900
1327
  /**
1901
1328
  * Stored skill data returned from API
1902
1329
  */
1903
- export interface StoredSkillResponse {
1904
- id: string;
1905
- status: string;
1906
- authorId?: string;
1907
- visibility?: 'private' | 'public';
1908
- metadata?: Record<string, unknown>;
1909
- createdAt: string;
1910
- updatedAt: string;
1911
- name: string;
1912
- description?: string;
1913
- instructions: string;
1914
- license?: string;
1915
- files?: StoredSkillFileNode[];
1916
- isFavorited?: boolean;
1917
- favoriteCount?: number;
1918
- }
1330
+ export type StoredSkillResponse = GeneratedResponse<'GET /stored/skills/:storedSkillId'>;
1919
1331
  /**
1920
1332
  * Parameters for listing stored skills
1921
1333
  */
1922
- export interface ListStoredSkillsParams {
1923
- page?: number;
1924
- perPage?: number;
1925
- orderBy?: {
1926
- field?: 'createdAt' | 'updatedAt';
1927
- direction?: 'ASC' | 'DESC';
1928
- };
1929
- authorId?: string;
1930
- /**
1931
- * Restrict the list to public records. Only `'public'` is accepted by the
1932
- * server filter; private records are surfaced via the default scope-aware
1933
- * filter (caller's own rows + legacy unowned).
1934
- */
1935
- visibility?: 'public';
1936
- metadata?: Record<string, unknown>;
1937
- /** When true, only return skills favorited by the caller (or by `pinFavoritedFor`). */
1938
- favoritedOnly?: boolean;
1939
- /** When set, sort favorited-first for this user id. Required for `favoritedOnly`. */
1940
- pinFavoritedFor?: string;
1941
- }
1334
+ export type ListStoredSkillsParams = GeneratedRequest<QueryParams<'GET /stored/skills'>>;
1942
1335
  /**
1943
1336
  * Response for listing stored skills
1944
1337
  */
1945
- export interface ListStoredSkillsResponse {
1946
- skills: StoredSkillResponse[];
1947
- total: number;
1948
- page: number;
1949
- perPage: number | false;
1950
- hasMore: boolean;
1951
- }
1338
+ export type ListStoredSkillsResponse = GeneratedResponse<'GET /stored/skills'>;
1952
1339
  /**
1953
1340
  * Parameters for creating a stored skill
1954
1341
  */
1955
- export interface CreateStoredSkillParams {
1956
- id?: string;
1957
- authorId?: string;
1958
- /** Visibility of the skill. Defaults to 'private'. */
1959
- visibility?: 'private' | 'public';
1960
- metadata?: Record<string, unknown>;
1961
- name: string;
1962
- /** Required by the server: description of what the skill does and when to use it. */
1963
- description: string;
1964
- instructions: string;
1965
- license?: string;
1966
- files?: StoredSkillFileNode[];
1967
- }
1342
+ export type CreateStoredSkillParams = GeneratedRequest<Body<'POST /stored/skills'>>;
1968
1343
  /**
1969
1344
  * Parameters for updating a stored skill
1970
1345
  */
1971
- export interface UpdateStoredSkillParams {
1972
- authorId?: string;
1973
- /** Visibility of the skill. */
1974
- visibility?: 'private' | 'public';
1975
- metadata?: Record<string, unknown>;
1976
- name?: string;
1977
- description?: string;
1978
- instructions?: string;
1979
- license?: string;
1980
- files?: StoredSkillFileNode[];
1981
- }
1346
+ export type UpdateStoredSkillParams = GeneratedRequest<Body<'PATCH /stored/skills/:storedSkillId'>>;
1982
1347
  /**
1983
1348
  * Response for deleting a stored skill
1984
1349
  */
1985
- export interface DeleteStoredSkillResponse {
1986
- success: boolean;
1987
- message: string;
1988
- }
1350
+ export type DeleteStoredSkillResponse = GeneratedResponse<'DELETE /stored/skills/:storedSkillId'>;
1989
1351
  /**
1990
1352
  * Filesystem configuration in a stored workspace
1991
1353
  */
@@ -2004,120 +1366,29 @@ export interface StoredSandboxConfig {
2004
1366
  /**
2005
1367
  * Stored workspace data returned from API
2006
1368
  */
2007
- export interface StoredWorkspaceResponse {
2008
- id: string;
2009
- status: string;
2010
- activeVersionId?: string;
2011
- authorId?: string;
2012
- metadata?: Record<string, unknown>;
2013
- createdAt: string;
2014
- updatedAt: string;
2015
- name: string;
2016
- description?: string;
2017
- filesystem?: StoredFilesystemConfig;
2018
- sandbox?: StoredSandboxConfig;
2019
- mounts?: Record<string, StoredFilesystemConfig>;
2020
- skills?: string[];
2021
- tools?: {
2022
- enabled?: boolean;
2023
- requireApproval?: boolean;
2024
- tools?: Record<string, {
2025
- enabled?: boolean;
2026
- requireApproval?: boolean;
2027
- }>;
2028
- };
2029
- autoSync?: boolean;
2030
- operationTimeout?: number;
2031
- /** Whether this workspace is registered at runtime (only present in list responses) */
2032
- runtimeRegistered?: boolean;
2033
- }
1369
+ export type StoredWorkspaceResponse = GeneratedResponse<'GET /stored/workspaces/:storedWorkspaceId'>;
2034
1370
  /**
2035
1371
  * Parameters for listing stored workspaces
2036
1372
  */
2037
- export interface ListStoredWorkspacesParams {
2038
- page?: number;
2039
- perPage?: number;
2040
- orderBy?: {
2041
- field?: 'createdAt' | 'updatedAt';
2042
- direction?: 'ASC' | 'DESC';
2043
- };
2044
- authorId?: string;
2045
- metadata?: Record<string, unknown>;
2046
- }
1373
+ export type ListStoredWorkspacesParams = GeneratedRequest<QueryParams<'GET /stored/workspaces'>>;
2047
1374
  /**
2048
1375
  * Response for listing stored workspaces
2049
1376
  */
2050
- export interface ListStoredWorkspacesResponse {
2051
- workspaces: StoredWorkspaceResponse[];
2052
- total: number;
2053
- page: number;
2054
- perPage: number | false;
2055
- hasMore: boolean;
2056
- }
2057
- /**
2058
- * Processor phase types
2059
- */
2060
- export type ProcessorPhase = 'input' | 'inputStep' | 'outputStream' | 'outputResult' | 'outputStep';
2061
- /**
2062
- * Processor configuration showing how it's attached to an agent
2063
- */
2064
- export interface ProcessorConfiguration {
2065
- agentId: string;
2066
- agentName: string;
2067
- type: 'input' | 'output';
2068
- }
2069
- /**
2070
- * Processor in list response
2071
- */
2072
- export interface GetProcessorResponse {
2073
- id: string;
2074
- name?: string;
2075
- description?: string;
2076
- phases: ProcessorPhase[];
2077
- agentIds: string[];
2078
- isWorkflow: boolean;
2079
- }
2080
- /**
2081
- * Detailed processor response
2082
- */
2083
- export interface GetProcessorDetailResponse {
2084
- id: string;
2085
- name?: string;
2086
- description?: string;
2087
- phases: ProcessorPhase[];
2088
- configurations: ProcessorConfiguration[];
2089
- isWorkflow: boolean;
2090
- }
2091
- /**
2092
- * Parameters for executing a processor
2093
- */
2094
- export interface ExecuteProcessorParams {
2095
- phase: ProcessorPhase;
2096
- messages: MastraDBMessage[];
2097
- agentId?: string;
2098
- requestContext?: RequestContext | Record<string, any>;
2099
- }
2100
- /**
2101
- * Tripwire result from processor execution
2102
- */
2103
- export interface ProcessorTripwireResult {
2104
- triggered: boolean;
2105
- reason?: string;
2106
- metadata?: unknown;
2107
- }
2108
- /**
2109
- * Response from processor execution
2110
- */
2111
- export interface ExecuteProcessorResponse {
2112
- success: boolean;
2113
- phase: string;
2114
- messages?: MastraDBMessage[];
2115
- messageList?: {
2116
- messages: MastraDBMessage[];
2117
- };
2118
- tripwire?: ProcessorTripwireResult;
2119
- error?: string;
2120
- }
1377
+ export type ListStoredWorkspacesResponse = GeneratedResponse<'GET /stored/workspaces'>;
1378
+ /** Processor phases are defined by the processor detail route. */
1379
+ export type ProcessorPhase = GeneratedResponse<'GET /processors/:processorId'>['phases'][number];
1380
+ /** Processor attachment configuration returned by the detail route. */
1381
+ export type ProcessorConfiguration = GeneratedResponse<'GET /processors/:processorId'>['configurations'][number];
1382
+ /** Processor summary returned from the processor collection route. */
1383
+ export type GetProcessorResponse = GeneratedResponse<'GET /processors'>[string];
1384
+ /** Detailed processor response. */
1385
+ export type GetProcessorDetailResponse = GeneratedResponse<'GET /processors/:processorId'>;
1386
+ /** Parameters for executing a processor. */
1387
+ export type ExecuteProcessorParams = GeneratedRequest<Body<'POST /processors/:processorId/execute'>> & RequestContextOptions;
1388
+ /** Tripwire result returned from processor execution. */
1389
+ export type ProcessorTripwireResult = NonNullable<GeneratedResponse<'POST /processors/:processorId/execute'>['tripwire']>;
1390
+ /** Response from processor execution. */
1391
+ export type ExecuteProcessorResponse = GeneratedResponse<'POST /processors/:processorId/execute'>;
2121
1392
  /**
2122
1393
  * Parameters for getting observational memory
2123
1394
  */
@@ -2259,59 +1530,10 @@ export interface DatasetItemToolMock {
2259
1530
  matchArgs?: 'strict' | 'ignore';
2260
1531
  }
2261
1532
  /** Diagnostic receipt for item-level tool mocks, returned on experiment results. */
2262
- export interface ToolMockReport {
2263
- served: Array<{
2264
- mockIndex: number;
2265
- toolName: string;
2266
- args: unknown;
2267
- }>;
2268
- unconsumed: Array<{
2269
- mockIndex: number;
2270
- toolName: string;
2271
- args: unknown;
2272
- }>;
2273
- liveCalls: Array<{
2274
- toolName: string;
2275
- args: unknown;
2276
- }>;
2277
- failure?: {
2278
- code: 'TOOL_MOCK_MISMATCH' | 'TOOL_MOCK_EXHAUSTED';
2279
- toolName: string;
2280
- args: unknown;
2281
- };
2282
- }
2283
- export interface DatasetItem {
2284
- id: string;
2285
- datasetId: string;
2286
- datasetVersion: number;
2287
- externalId?: string | null;
2288
- input: unknown;
2289
- groundTruth?: unknown;
2290
- expectedTrajectory?: unknown;
2291
- toolMocks?: DatasetItemToolMock[];
2292
- scorerIds?: string[];
2293
- requestContext?: Record<string, unknown>;
2294
- metadata?: unknown;
2295
- source?: DatasetItemSource;
2296
- createdAt: string | Date;
2297
- updatedAt: string | Date;
2298
- }
2299
- export interface DatasetRecord {
2300
- id: string;
2301
- name: string;
2302
- description?: string | null;
2303
- metadata?: Record<string, unknown> | null;
2304
- inputSchema?: Record<string, unknown>;
2305
- groundTruthSchema?: Record<string, unknown>;
2306
- requestContextSchema?: Record<string, unknown>;
2307
- tags?: string[] | null;
2308
- targetType?: string | null;
2309
- targetIds?: string[] | null;
2310
- scorerIds?: string[] | null;
2311
- version: number;
2312
- createdAt: string | Date;
2313
- updatedAt: string | Date;
2314
- }
1533
+ export type ToolMockReport = NonNullable<GeneratedResponse<'GET /datasets/:datasetId/experiments/:experimentId/results'>['results'][number]['toolMockReport']>;
1534
+ export type DatasetItem = NonNullable<GeneratedResponse<'GET /datasets/:datasetId/items/:itemId'>>;
1535
+ export type DatasetRecord = NonNullable<GeneratedResponse<'GET /datasets/:datasetId'>>;
1536
+ export type ExperimentTargetType = NonNullable<QueryParams<'GET /experiments'>['targetType']>;
2315
1537
  export interface ExperimentProvenance {
2316
1538
  source?: string;
2317
1539
  sourceId?: string;
@@ -2329,80 +1551,13 @@ export interface ExperimentGrouping {
2329
1551
  variantId?: string;
2330
1552
  trialIndex?: number;
2331
1553
  }
2332
- export type ExperimentTargetType = 'agent' | 'workflow' | 'scorer' | 'processor';
2333
- export interface ListExperimentsParams extends ExperimentGrouping {
2334
- page?: number;
2335
- perPage?: number;
2336
- /** Only return experiments run against targets of this type */
2337
- targetType?: ExperimentTargetType;
2338
- /** Only return experiments run against this target ID */
2339
- targetId?: string;
2340
- }
2341
- export interface ListDatasetsParams {
2342
- page?: number;
2343
- perPage?: number;
2344
- /** Only return datasets attached to targets of this type */
2345
- targetType?: ExperimentTargetType;
2346
- /** Only return datasets attached to at least one of these target IDs */
2347
- targetIds?: string[];
2348
- }
2349
- export interface DatasetExperiment {
2350
- id: string;
2351
- datasetId: string | null;
2352
- datasetVersion: number | null;
2353
- agentVersion: string | null;
2354
- /** `null` for caller-driven ingestion experiments (the caller executes items itself). */
2355
- targetType: 'agent' | 'workflow' | 'scorer' | 'processor' | null;
2356
- targetId: string | null;
2357
- /** Run-level scorer IDs pinned at create time for caller-driven experiments. */
2358
- scorerIds?: string[] | null;
2359
- /** Human-readable name used as the primary label wherever the experiment is displayed. */
2360
- name?: string;
2361
- /** Longer description shown as secondary detail (e.g. in a tooltip). */
2362
- description?: string;
2363
- provenance: ExperimentProvenance | null;
2364
- runnerAttestation: ExperimentRunnerAttestation | null;
2365
- experimentSetId: string | null;
2366
- comparisonId: string | null;
2367
- variantId: string | null;
2368
- trialIndex: number | null;
2369
- status: 'pending' | 'running' | 'completed' | 'failed';
2370
- totalItems: number;
2371
- succeededCount: number;
2372
- failedCount: number;
2373
- skippedCount: number;
2374
- startedAt: string | Date | null;
2375
- completedAt: string | Date | null;
2376
- createdAt: string | Date;
2377
- updatedAt: string | Date;
2378
- }
2379
- export interface DatasetExperimentResult {
2380
- id: string;
2381
- experimentId: string;
2382
- itemId: string;
2383
- itemDatasetVersion: number | null;
2384
- input: unknown;
2385
- output: unknown | null;
2386
- groundTruth: unknown | null;
2387
- metadata?: Record<string, unknown> | null;
2388
- /** Structured failure info, as persisted by the experiment runner. */
2389
- error: {
2390
- message: string;
2391
- stack?: string;
2392
- code?: string;
2393
- } | null;
2394
- startedAt: string | Date;
2395
- completedAt: string | Date;
2396
- retryCount: number;
2397
- attempt?: number;
2398
- traceId: string | null;
2399
- status: 'needs-review' | 'reviewed' | 'complete' | null;
2400
- tags: string[] | null;
2401
- comment?: string | null;
2402
- toolMockReport?: ToolMockReport | null;
1554
+ export type ListExperimentsParams = GeneratedRequest<QueryParams<'GET /experiments'>>;
1555
+ export type ListDatasetsParams = GeneratedRequest<QueryParams<'GET /datasets'>>;
1556
+ export type DatasetExperiment = GeneratedResponse<'GET /experiments'>['experiments'][number];
1557
+ export type DatasetExperimentResult = GeneratedResponse<'GET /datasets/:datasetId/experiments/:experimentId/results'>['results'][number] & {
2403
1558
  /**
2404
- * Aggregated scorer runs. Absent on endpoints that return raw result rows
2405
- * (scores live in the scores store, keyed by `runId = experimentId`).
1559
+ * Aggregated scorer runs are a client convenience: score records are fetched
1560
+ * from the scores store rather than embedded in the route response.
2406
1561
  */
2407
1562
  scores?: Array<{
2408
1563
  scorerId: string;
@@ -2411,318 +1566,61 @@ export interface DatasetExperimentResult {
2411
1566
  reason: string | null;
2412
1567
  error: string | null;
2413
1568
  }>;
2414
- createdAt: string | Date;
2415
- }
2416
- export interface UpdateExperimentResultParams {
2417
- datasetId: string;
2418
- experimentId: string;
2419
- resultId: string;
2420
- status?: 'needs-review' | 'reviewed' | 'complete' | null;
2421
- tags?: string[];
2422
- comment?: string | null;
2423
- }
2424
- export interface CreateDatasetParams {
2425
- name: string;
2426
- description?: string;
2427
- metadata?: Record<string, unknown>;
2428
- inputSchema?: Record<string, unknown> | null;
2429
- groundTruthSchema?: Record<string, unknown> | null;
2430
- requestContextSchema?: Record<string, unknown> | null;
2431
- targetType?: string;
2432
- targetIds?: string[];
2433
- scorerIds?: string[];
2434
- }
2435
- export interface UpdateDatasetParams {
2436
- datasetId: string;
2437
- name?: string;
2438
- description?: string;
2439
- metadata?: Record<string, unknown>;
2440
- inputSchema?: Record<string, unknown> | null;
2441
- groundTruthSchema?: Record<string, unknown> | null;
2442
- requestContextSchema?: Record<string, unknown> | null;
2443
- tags?: string[];
2444
- targetType?: string;
2445
- targetIds?: string[];
2446
- scorerIds?: string[] | null;
2447
- /** Restrict the lookup to a specific tenant organization. */
2448
- organizationId?: string;
2449
- /** Restrict the lookup to a specific tenant project. */
2450
- projectId?: string;
2451
- }
2452
- export interface AddDatasetItemParams {
2453
- datasetId: string;
2454
- externalId?: string;
2455
- input: unknown;
2456
- groundTruth?: unknown;
2457
- expectedTrajectory?: unknown;
2458
- toolMocks?: DatasetItemToolMock[];
2459
- scorerIds?: string[];
2460
- requestContext?: Record<string, unknown>;
2461
- metadata?: Record<string, unknown>;
2462
- source?: DatasetItemSource;
2463
- }
2464
- export interface UpdateDatasetItemParams {
2465
- datasetId: string;
2466
- itemId: string;
2467
- input?: unknown;
2468
- groundTruth?: unknown;
2469
- expectedTrajectory?: unknown;
2470
- toolMocks?: DatasetItemToolMock[];
2471
- scorerIds?: string[] | null;
2472
- requestContext?: Record<string, unknown>;
2473
- metadata?: Record<string, unknown>;
2474
- source?: DatasetItemSource;
2475
- }
2476
- export interface BatchInsertDatasetItemsParams {
2477
- datasetId: string;
2478
- items: Array<{
2479
- externalId?: string;
2480
- input: unknown;
2481
- groundTruth?: unknown;
2482
- expectedTrajectory?: unknown;
2483
- toolMocks?: DatasetItemToolMock[];
2484
- scorerIds?: string[];
2485
- requestContext?: Record<string, unknown>;
2486
- metadata?: Record<string, unknown>;
2487
- source?: DatasetItemSource;
2488
- }>;
2489
- }
2490
- export interface BatchDeleteDatasetItemsParams {
2491
- datasetId: string;
2492
- itemIds: string[];
2493
- }
2494
- export interface GenerateDatasetItemsParams {
2495
- datasetId: string;
2496
- modelId: string;
2497
- prompt: string;
2498
- count?: number;
2499
- agentContext?: {
2500
- description?: string;
2501
- instructions?: string;
2502
- tools?: string[];
2503
- };
2504
- }
2505
- export interface GeneratedItem {
2506
- input: unknown;
2507
- groundTruth?: unknown;
2508
- }
2509
- export interface UpdateDatasetExperimentParams {
2510
- datasetId: string;
2511
- experimentId: string;
2512
- name?: string;
2513
- description?: string;
2514
- metadata?: Record<string, unknown>;
2515
- }
2516
- export interface TriggerDatasetExperimentParams {
2517
- datasetId: string;
2518
- targetType: 'agent' | 'workflow' | 'scorer';
2519
- targetId: string;
2520
- name?: string;
2521
- description?: string;
2522
- metadata?: Record<string, unknown>;
2523
- scorerIds?: string[];
2524
- version?: number;
2525
- agentVersion?: string;
2526
- maxConcurrency?: number;
2527
- provenance?: ExperimentProvenance;
2528
- grouping?: ExperimentGrouping;
2529
- requestContext?: Record<string, unknown>;
2530
- }
2531
- export interface CreateDatasetExperimentParams {
2532
- datasetId: string;
2533
- /** Caller-supplied experiment id (e.g. a workflow run id) for idempotent creates. */
2534
- id?: string;
2535
- /** Target executed per item via `runExperimentItem`. Both or neither of targetType/targetId. Omit for pure ingestion. */
2536
- targetType?: 'agent' | 'workflow' | 'scorer';
2537
- targetId?: string;
2538
- /** Run-level scorer IDs resolved server-side by `runExperimentItem`. Requires a target. */
2539
- scorerIds?: string[];
2540
- name?: string;
2541
- description?: string;
2542
- metadata?: Record<string, unknown>;
2543
- /** Pin to a specific dataset version. Defaults to the latest version. */
2544
- version?: number;
2545
- provenance?: ExperimentProvenance;
2546
- grouping?: ExperimentGrouping;
2547
- }
2548
- export interface CreateDatasetExperimentResponse {
2549
- experimentId: string;
2550
- status: 'pending' | 'running' | 'completed' | 'failed';
2551
- totalItems: number;
2552
- datasetVersion: number;
2553
- }
2554
- export interface RunExperimentItemParams {
2555
- datasetId: string;
2556
- experimentId: string;
2557
- itemId: string;
2558
- /** Zero-based repetition index. Defaults to 0. Retried calls with the same (experimentId, itemId, attempt) converge on one row. */
2559
- attempt?: number;
2560
- /** Request context merged with the item's own request context (item wins). */
2561
- requestContext?: Record<string, unknown>;
2562
- }
1569
+ };
1570
+ export type UpdateExperimentResultParams = PathParams<'PATCH /datasets/:datasetId/experiments/:experimentId/results/:resultId'> & WithoutIndexSignatures<GeneratedRequest<Body<'PATCH /datasets/:datasetId/experiments/:experimentId/results/:resultId'>>>;
1571
+ export type CreateDatasetParams = WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets'>>>;
1572
+ export type UpdateDatasetParams = PathParams<'PATCH /datasets/:datasetId'> & WithoutIndexSignatures<GeneratedRequest<Body<'PATCH /datasets/:datasetId'>>> & GeneratedRequest<QueryParams<'PATCH /datasets/:datasetId'>>;
1573
+ export type AddDatasetItemParams = PathParams<'POST /datasets/:datasetId/items'> & WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets/:datasetId/items'>>>;
1574
+ export type UpdateDatasetItemParams = PathParams<'PATCH /datasets/:datasetId/items/:itemId'> & WithoutIndexSignatures<GeneratedRequest<Body<'PATCH /datasets/:datasetId/items/:itemId'>>>;
1575
+ export type BatchInsertDatasetItemsParams = PathParams<'POST /datasets/:datasetId/items/batch'> & WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets/:datasetId/items/batch'>>>;
1576
+ export type BatchDeleteDatasetItemsParams = PathParams<'DELETE /datasets/:datasetId/items/batch'> & WithoutIndexSignatures<GeneratedRequest<Body<'DELETE /datasets/:datasetId/items/batch'>>>;
1577
+ export type GenerateDatasetItemsParams = PathParams<'POST /datasets/:datasetId/generate-items'> & WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets/:datasetId/generate-items'>>>;
1578
+ export type GeneratedItem = GeneratedResponse<'POST /datasets/:datasetId/generate-items'>['items'][number];
1579
+ export type UpdateDatasetExperimentParams = PathParams<'PATCH /datasets/:datasetId/experiments/:experimentId'> & WithoutIndexSignatures<GeneratedRequest<Body<'PATCH /datasets/:datasetId/experiments/:experimentId'>>>;
1580
+ export type TriggerDatasetExperimentParams = PathParams<'POST /datasets/:datasetId/experiments'> & WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets/:datasetId/experiments'>>>;
1581
+ export type CreateDatasetExperimentParams = PathParams<'POST /datasets/:datasetId/experiments'> & WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets/:datasetId/experiments'>>>;
1582
+ export type CreateDatasetExperimentResponse = GeneratedResponse<'POST /datasets/:datasetId/experiments'>;
1583
+ export type RunExperimentItemParams = PathParams<'POST /datasets/:datasetId/experiments/:experimentId/items/:itemId/run'> & WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets/:datasetId/experiments/:experimentId/items/:itemId/run'>>>;
2563
1584
  /**
2564
1585
  * A single experiment result row as the server returns it: structured
2565
1586
  * `error` object and no aggregated `scores` (scores live in the scores
2566
1587
  * store, keyed by `runId = experimentId`).
2567
1588
  */
1589
+ export type ListDatasetExperimentResultsResponse = Omit<GeneratedResponse<'GET /datasets/:datasetId/experiments/:experimentId/results'>, 'results'> & {
1590
+ results: DatasetExperimentResult[];
1591
+ };
2568
1592
  export type DatasetExperimentResultRow = Omit<DatasetExperimentResult, 'scores'>;
2569
- export interface RunExperimentItemResponse {
2570
- result: DatasetExperimentResultRow;
2571
- scores: Array<{
2572
- scorerId: string;
2573
- scorerName: string;
2574
- score: number | null;
2575
- reason: string | null;
2576
- error: string | null;
2577
- }>;
2578
- }
2579
- export interface SubmitExperimentResultParams {
2580
- datasetId: string;
2581
- experimentId: string;
2582
- itemId: string;
2583
- /** Zero-based repetition index. Defaults to 0. Retried submissions with the same (experimentId, itemId, attempt) converge on one row. */
2584
- attempt?: number;
2585
- input?: unknown;
2586
- output?: unknown;
2587
- groundTruth?: unknown;
2588
- error?: {
2589
- message: string;
2590
- stack?: string;
2591
- code?: string;
2592
- } | null;
2593
- startedAt?: Date;
2594
- completedAt?: Date;
2595
- traceId?: string;
2596
- /** Externally computed scores, persisted keyed by runId = experimentId. */
2597
- scores?: Array<{
2598
- scorerId: string;
2599
- scorerName?: string;
2600
- score: number;
2601
- reason?: string;
2602
- metadata?: Record<string, unknown>;
2603
- }>;
2604
- }
2605
- export interface FinalizeExperimentParams {
2606
- datasetId: string;
2607
- experimentId: string;
2608
- }
2609
- export interface CompareExperimentsParams {
2610
- datasetId: string;
2611
- experimentIdA: string;
2612
- experimentIdB: string;
2613
- thresholds?: Record<string, {
2614
- value: number;
2615
- direction?: 'higher-is-better' | 'lower-is-better';
2616
- }>;
2617
- }
2618
- export interface DatasetItemVersionResponse {
2619
- id: string;
2620
- datasetId: string;
2621
- datasetVersion: number;
2622
- input: unknown;
2623
- groundTruth?: unknown;
2624
- expectedTrajectory?: unknown;
2625
- toolMocks?: DatasetItemToolMock[];
2626
- scorerIds?: string[];
2627
- requestContext?: Record<string, unknown>;
2628
- metadata?: Record<string, unknown>;
2629
- validTo: number | null;
2630
- isDeleted: boolean;
2631
- createdAt: string | Date;
2632
- updatedAt: string | Date;
2633
- }
2634
- export interface DatasetVersionResponse {
2635
- id: string;
2636
- datasetId: string;
2637
- version: number;
2638
- createdAt: string | Date;
2639
- }
2640
- export interface CompareExperimentsResponse {
2641
- baselineId: string;
2642
- items: Array<{
2643
- itemId: string;
2644
- input: unknown;
2645
- groundTruth: unknown;
2646
- results: Record<string, {
2647
- output: unknown;
2648
- scores: Record<string, number | null>;
2649
- } | null>;
2650
- }>;
2651
- }
1593
+ export type RunExperimentItemResponse = GeneratedResponse<'POST /datasets/:datasetId/experiments/:experimentId/items/:itemId/run'>;
1594
+ export type SubmitExperimentResultParams = PathParams<'POST /datasets/:datasetId/experiments/:experimentId/results'> & WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets/:datasetId/experiments/:experimentId/results'>>>;
1595
+ export type FinalizeExperimentParams = PathParams<'POST /datasets/:datasetId/experiments/:experimentId/finalize'>;
1596
+ export type CompareExperimentsParams = PathParams<'POST /datasets/:datasetId/compare'> & WithoutIndexSignatures<GeneratedRequest<Body<'POST /datasets/:datasetId/compare'>>>;
1597
+ export type DatasetItemVersionResponse = NonNullable<SerializedRouteResponse<'GET /datasets/:datasetId/items/:itemId/versions/:datasetVersion'>>;
1598
+ export type DatasetVersionResponse = SerializedRouteResponse<'GET /datasets/:datasetId/versions'>['versions'][number];
1599
+ export type CompareExperimentsResponse = GeneratedResponse<'POST /datasets/:datasetId/compare'>;
2652
1600
  /**
2653
1601
  * Stored prompt block data returned from API
2654
1602
  */
2655
- export interface StoredPromptBlockResponse {
2656
- id: string;
2657
- status: string;
2658
- activeVersionId?: string;
2659
- hasDraft?: boolean;
2660
- authorId?: string;
2661
- metadata?: Record<string, unknown>;
2662
- createdAt: string;
2663
- updatedAt: string;
2664
- name: string;
2665
- description?: string;
2666
- content: string;
2667
- rules?: RuleGroup;
2668
- requestContextSchema?: Record<string, unknown>;
2669
- }
1603
+ export type StoredPromptBlockResponse = GeneratedResponse<'GET /stored/prompt-blocks/:storedPromptBlockId'>;
2670
1604
  /**
2671
1605
  * Parameters for listing stored prompt blocks
2672
1606
  */
2673
- export interface ListStoredPromptBlocksParams {
2674
- page?: number;
2675
- perPage?: number;
2676
- orderBy?: {
2677
- field?: 'createdAt' | 'updatedAt';
2678
- direction?: 'ASC' | 'DESC';
2679
- };
2680
- status?: 'draft' | 'published' | 'archived';
2681
- authorId?: string;
2682
- metadata?: Record<string, unknown>;
2683
- }
1607
+ export type ListStoredPromptBlocksParams = GeneratedRequest<QueryParams<'GET /stored/prompt-blocks'>>;
2684
1608
  /**
2685
1609
  * Response for listing stored prompt blocks
2686
1610
  */
2687
- export interface ListStoredPromptBlocksResponse {
2688
- promptBlocks: StoredPromptBlockResponse[];
2689
- total: number;
2690
- page: number;
2691
- perPage: number | false;
2692
- hasMore: boolean;
2693
- }
1611
+ export type ListStoredPromptBlocksResponse = GeneratedResponse<'GET /stored/prompt-blocks'>;
2694
1612
  /**
2695
1613
  * Parameters for creating a stored prompt block
2696
1614
  */
2697
- export interface CreateStoredPromptBlockParams {
2698
- id?: string;
2699
- authorId?: string;
2700
- metadata?: Record<string, unknown>;
2701
- name: string;
2702
- description?: string;
2703
- content: string;
2704
- rules?: RuleGroup;
2705
- requestContextSchema?: Record<string, unknown>;
2706
- }
1615
+ export type CreateStoredPromptBlockParams = GeneratedRequest<Body<'POST /stored/prompt-blocks'>>;
2707
1616
  /**
2708
1617
  * Parameters for updating a stored prompt block
2709
1618
  */
2710
- export interface UpdateStoredPromptBlockParams {
2711
- authorId?: string;
2712
- metadata?: Record<string, unknown>;
2713
- name?: string;
2714
- description?: string;
2715
- content?: string;
2716
- rules?: RuleGroup;
2717
- requestContextSchema?: Record<string, unknown>;
2718
- }
1619
+ export type UpdateStoredPromptBlockParams = GeneratedRequest<Body<'PATCH /stored/prompt-blocks/:storedPromptBlockId'>>;
2719
1620
  /**
2720
1621
  * Response for deleting a stored prompt block
2721
1622
  */
2722
- export interface DeleteStoredPromptBlockResponse {
2723
- success: boolean;
2724
- message: string;
2725
- }
1623
+ export type DeleteStoredPromptBlockResponse = GeneratedResponse<'DELETE /stored/prompt-blocks/:storedPromptBlockId'>;
2726
1624
  export interface PromptBlockVersionResponse {
2727
1625
  id: string;
2728
1626
  blockId: string;
@@ -2801,136 +1699,41 @@ export interface ScheduleIfIdle {
2801
1699
  * Flat agent-schedule view returned by the unified `/schedules` surface.
2802
1700
  * Discriminate from workflow schedules by the presence of `agentId`.
2803
1701
  */
2804
- export interface AgentSchedule {
2805
- id: string;
1702
+ export type AgentSchedule = Extract<GeneratedResponse<'GET /schedules'>['schedules'][number], {
2806
1703
  agentId: string;
2807
- /** Mirror of the workflow-schedule discriminator — always absent on agent schedules. */
2808
- workflowId?: undefined;
2809
- /** Workflow-run summary — never hydrated for agent schedules. */
2810
- lastRun?: undefined;
2811
- name?: string;
2812
- threadId?: string;
2813
- resourceId?: string;
2814
- prompt: string;
2815
- cron: string;
2816
- timezone?: string;
2817
- status: ScheduleStatus;
2818
- nextFireAt: number;
2819
- lastFireAt?: number;
2820
- lastRunId?: string;
2821
- signalType?: ScheduleSignalType;
2822
- tagName?: string;
2823
- attributes?: ScheduleSignalAttributes;
2824
- ifActive?: ScheduleIfActive;
2825
- ifIdle?: ScheduleIfIdle;
2826
- providerOptions?: Record<string, unknown>;
2827
- metadata?: Record<string, unknown>;
2828
- createdAt: number;
2829
- updatedAt: number;
2830
- }
1704
+ }>;
2831
1705
  /**
2832
1706
  * Flat workflow-schedule view returned by the unified `/schedules` surface.
2833
1707
  * Discriminate from agent schedules by the presence of `workflowId`.
2834
1708
  */
2835
- export interface WorkflowSchedule {
2836
- id: string;
1709
+ export type WorkflowSchedule = Extract<GeneratedResponse<'GET /schedules'>['schedules'][number], {
2837
1710
  workflowId: string;
2838
- /** Mirror of the agent-schedule discriminator — always absent on workflow schedules. */
2839
- agentId?: undefined;
2840
- cron: string;
2841
- timezone?: string;
2842
- status: ScheduleStatus;
2843
- nextFireAt: number;
2844
- lastFireAt?: number;
2845
- lastRunId?: string;
2846
- lastRun?: ScheduleRunSummary;
2847
- inputData?: unknown;
2848
- initialState?: unknown;
2849
- requestContext?: Record<string, unknown>;
2850
- metadata?: Record<string, unknown>;
2851
- createdAt: number;
2852
- updatedAt: number;
2853
- }
1711
+ }>;
2854
1712
  /** Union of the flat views returned by the unified `/schedules` surface. */
2855
1713
  export type ScheduleResponse = AgentSchedule | WorkflowSchedule;
2856
1714
  export type ScheduleTriggerOutcome = 'published' | 'succeeded' | 'delivered' | 'persisted' | 'discarded' | 'skipped' | 'aborted' | 'failed';
2857
1715
  export type ScheduleTriggerKind = 'schedule-fire' | 'queue-drain' | 'manual';
2858
- export interface ScheduleTriggerResponse {
2859
- id?: string;
2860
- scheduleId: string;
2861
- runId: string | null;
2862
- scheduledFireAt: number;
2863
- actualFireAt: number;
2864
- outcome: ScheduleTriggerOutcome;
2865
- error?: string;
2866
- triggerKind?: ScheduleTriggerKind;
2867
- parentTriggerId?: string;
2868
- metadata?: Record<string, unknown>;
2869
- run?: ScheduleRunSummary;
2870
- }
2871
- export interface ListSchedulesParams {
2872
- /** Scope the list to a single agent's schedules. */
2873
- agentId?: string;
2874
- /** Scope the list to a single workflow's schedules. */
2875
- workflowId?: string;
2876
- status?: ScheduleStatus;
2877
- /** Agent-schedule only: match the target threadId. */
2878
- threadId?: string;
2879
- /** Agent-schedule only: match the target resourceId. */
2880
- resourceId?: string;
2881
- /** Agent-schedule only: match the free-form target name. */
2882
- name?: string;
2883
- }
2884
- export interface ListSchedulesResponse {
2885
- schedules: ScheduleResponse[];
2886
- }
2887
- export interface ListScheduleTriggersParams {
2888
- limit?: number;
2889
- fromActualFireAt?: number;
2890
- toActualFireAt?: number;
2891
- }
2892
- export interface ListScheduleTriggersResponse {
2893
- triggers: ScheduleTriggerResponse[];
2894
- }
1716
+ export type ScheduleTriggerResponse = GeneratedResponse<'GET /schedules/:scheduleId/triggers'>['triggers'][number];
1717
+ export type ListSchedulesParams = GeneratedRequest<QueryParams<'GET /schedules'>>;
1718
+ export type ListSchedulesResponse = GeneratedResponse<'GET /schedules'>;
1719
+ export type ListScheduleTriggersParams = GeneratedRequest<QueryParams<'GET /schedules/:scheduleId/triggers'>>;
1720
+ export type ListScheduleTriggersResponse = GeneratedResponse<'GET /schedules/:scheduleId/triggers'>;
2895
1721
  /**
2896
1722
  * Agent variant of the `client.createSchedule(...)` body — targets an agent
2897
1723
  * by `agentId`. Mirrors `CreateAgentScheduleInput` on the core Schedules
2898
1724
  * service.
2899
1725
  */
2900
- export interface CreateAgentScheduleInput {
2901
- /** Optional stable id; normalized to `agent_<slug>`. A random id is generated when omitted. */
2902
- id?: string;
1726
+ export type CreateAgentScheduleInput = Extract<WithoutIndexSignatures<GeneratedRequest<Body<'POST /schedules'>>>, {
2903
1727
  agentId: string;
2904
- cron: string;
2905
- prompt: string;
2906
- name?: string;
2907
- timezone?: string;
2908
- threadId?: string;
2909
- resourceId?: string;
2910
- signalType?: ScheduleSignalType;
2911
- tagName?: string;
2912
- attributes?: ScheduleSignalAttributes;
2913
- ifActive?: ScheduleIfActive;
2914
- ifIdle?: ScheduleIfIdle;
2915
- providerOptions?: Record<string, unknown>;
2916
- metadata?: Record<string, unknown>;
2917
- }
1728
+ }>;
2918
1729
  /**
2919
1730
  * Workflow variant of the `client.createSchedule(...)` body — targets a
2920
1731
  * workflow by `workflowId`. Mirrors `CreateWorkflowScheduleInput` on the
2921
1732
  * core Schedules service.
2922
1733
  */
2923
- export interface CreateWorkflowScheduleInput {
2924
- /** Optional stable id; normalized to `schedule_<slug>`. A random id is generated when omitted. */
2925
- id?: string;
1734
+ export type CreateWorkflowScheduleInput = Extract<WithoutIndexSignatures<GeneratedRequest<Body<'POST /schedules'>>>, {
2926
1735
  workflowId: string;
2927
- cron: string;
2928
- timezone?: string;
2929
- inputData?: unknown;
2930
- initialState?: unknown;
2931
- requestContext?: Record<string, unknown>;
2932
- metadata?: Record<string, unknown>;
2933
- }
1736
+ }>;
2934
1737
  /**
2935
1738
  * Body for `client.createSchedule(...)`. Discriminated by which target id is
2936
1739
  * present: `agentId` creates an agent schedule, `workflowId` a workflow
@@ -2943,23 +1746,7 @@ export type CreateScheduleInput = CreateAgentScheduleInput | CreateWorkflowSched
2943
1746
  * server. `threadId` / `resourceId` are part of an agent schedule's identity
2944
1747
  * and cannot be changed — to retarget, delete and recreate.
2945
1748
  */
2946
- export interface UpdateScheduleInput {
2947
- cron?: string;
2948
- timezone?: string;
2949
- status?: ScheduleStatus;
2950
- metadata?: Record<string, unknown>;
2951
- prompt?: string;
2952
- name?: string;
2953
- signalType?: ScheduleSignalType;
2954
- tagName?: string;
2955
- attributes?: ScheduleSignalAttributes;
2956
- ifActive?: ScheduleIfActive;
2957
- ifIdle?: ScheduleIfIdle;
2958
- providerOptions?: Record<string, unknown>;
2959
- inputData?: unknown;
2960
- initialState?: unknown;
2961
- requestContext?: Record<string, unknown>;
2962
- }
1749
+ export type UpdateScheduleInput = WithoutIndexSignatures<GeneratedRequest<Body<'PATCH /schedules/:scheduleId'>>>;
2963
1750
  /**
2964
1751
  * Response for POST /schedules/:scheduleId/run.
2965
1752
  *
@@ -2967,11 +1754,7 @@ export interface UpdateScheduleInput {
2967
1754
  * fires. `claimId` is the trigger row's `runId` (used to look up the
2968
1755
  * resulting trigger row via `listScheduleTriggers`).
2969
1756
  */
2970
- export interface RunScheduleResponse {
2971
- scheduleId: string;
2972
- claimId: string;
2973
- scheduledFireAt: number;
2974
- }
1757
+ export type RunScheduleResponse = GeneratedResponse<'POST /schedules/:scheduleId/run'>;
2975
1758
  export interface ExperimentReviewCounts {
2976
1759
  experimentId: string;
2977
1760
  total: number;
@@ -3014,36 +1797,7 @@ export type { BuilderModelPolicy, DefaultModelEntry, ProviderModelEntry, ModelPr
3014
1797
  /**
3015
1798
  * Response from GET /editor/builder/settings
3016
1799
  */
3017
- export interface BuilderSettingsResponse {
3018
- enabled: boolean;
3019
- features?: {
3020
- agent?: BuilderAgentFeatures;
3021
- };
3022
- configuration?: {
3023
- agent?: Record<string, unknown>;
3024
- };
3025
- /**
3026
- * Server-derived model policy. Always present; `{ active: false }` when no
3027
- * builder is configured. UI consumers should read this directly rather than
3028
- * re-deriving from `features` / `configuration`.
3029
- */
3030
- modelPolicy?: BuilderModelPolicy;
3031
- /**
3032
- * Resolved picker visibility for tools, agents, and workflows. Present when
3033
- * the builder is enabled. Each `visible*` field is `null` when unrestricted
3034
- * (show all registered entries) and `string[]` otherwise — making the
3035
- * empty-vs-unrestricted distinction explicit so the UI never has to
3036
- * disambiguate.
3037
- */
3038
- picker?: BuilderPickerResponse;
3039
- /**
3040
- * Non-fatal warnings produced by builder config validation (e.g. allowlist
3041
- * entries with unknown providers that aren't tagged `kind: 'custom'`, or
3042
- * picker allowlist entries that don't match a registered ID).
3043
- * Only present when there is at least one warning.
3044
- */
3045
- modelPolicyWarnings?: string[];
3046
- }
1800
+ export type BuilderSettingsResponse = GeneratedResponse<'GET /editor/builder/settings'>;
3047
1801
  /**
3048
1802
  * Response from GET /editor/builder/models/available.
3049
1803
  *
@@ -3082,113 +1836,18 @@ export interface BuilderPickerResponse {
3082
1836
  *
3083
1837
  * Agent Builder infrastructure configuration plus lightweight runtime resolution state.
3084
1838
  */
3085
- export interface InfrastructureStatusResponse {
3086
- channels: {
3087
- providers: Array<{
3088
- id: string;
3089
- name: string;
3090
- isConfigured: boolean;
3091
- routeCount: number;
3092
- }>;
3093
- };
3094
- browser: {
3095
- type: string | null;
3096
- provider: string | null;
3097
- env: string | null;
3098
- registered: boolean;
3099
- availableProviders: string[];
3100
- config: Array<{
3101
- key: string;
3102
- value: string;
3103
- }>;
3104
- };
3105
- workspace: {
3106
- type: string | null;
3107
- workspaceId: string | null;
3108
- name: string | null;
3109
- source: string | null;
3110
- registered: boolean;
3111
- hasFilesystem: boolean;
3112
- hasSandbox: boolean;
3113
- filesystemProvider: string | null;
3114
- sandboxProvider: string | null;
3115
- config: Array<{
3116
- key: string;
3117
- value: string;
3118
- }>;
3119
- };
3120
- registries: {
3121
- skillsSh: {
3122
- enabled: boolean;
3123
- };
3124
- };
3125
- }
1839
+ export type InfrastructureStatusResponse = GeneratedResponse<'GET /editor/builder/infrastructure'>;
3126
1840
  /**
3127
1841
  * One known skill registry surfaced from the Agent Builder config.
3128
1842
  */
3129
- export interface BuilderRegistryDescriptor {
3130
- id: string;
3131
- enabled: boolean;
3132
- label: string;
3133
- }
3134
- /**
3135
- * Response from `GET /editor/builder/registries`.
3136
- */
3137
- export interface ListBuilderRegistriesResponse {
3138
- registries: BuilderRegistryDescriptor[];
3139
- }
3140
- /**
3141
- * Single skill summary returned from a registry search/popular endpoint.
3142
- * Wire shape matches the upstream skills.sh proxy.
3143
- */
3144
- export interface BuilderRegistrySkillSummary {
3145
- id: string;
3146
- name: string;
3147
- installs: number;
3148
- /** Repository identifier in `owner/repo` or `owner/repo/path` form. */
3149
- topSource: string;
3150
- }
3151
- /**
3152
- * Response from `GET /editor/builder/registries/:registryId/search`.
3153
- */
3154
- export interface BuilderRegistrySearchResponse {
3155
- query: string;
3156
- searchType: string;
3157
- skills: BuilderRegistrySkillSummary[];
3158
- count: number;
3159
- }
3160
- /**
3161
- * Response from `GET /editor/builder/registries/:registryId/popular`.
3162
- */
3163
- export interface BuilderRegistryPopularResponse {
3164
- skills: BuilderRegistrySkillSummary[];
3165
- count: number;
3166
- limit: number;
3167
- offset: number;
3168
- }
3169
- /**
3170
- * Response from `GET /editor/builder/registries/:registryId/preview`.
3171
- */
3172
- export interface BuilderRegistryPreviewResponse {
3173
- content: string;
3174
- }
3175
- /**
3176
- * Body for `POST /editor/builder/registries/:registryId/install`.
3177
- */
3178
- export interface BuilderRegistryInstallBody {
3179
- owner: string;
3180
- repo: string;
3181
- skillName: string;
3182
- visibility?: 'private' | 'public';
3183
- }
3184
- /**
3185
- * Response from `POST /editor/builder/registries/:registryId/install`.
3186
- */
3187
- export interface BuilderRegistryInstallResponse {
3188
- storedSkillId: string;
3189
- name: string;
3190
- filesWritten: number;
3191
- }
1843
+ export type BuilderRegistryDescriptor = GeneratedResponse<'GET /editor/builder/registries'>['registries'][number];
1844
+ export type ListBuilderRegistriesResponse = GeneratedResponse<'GET /editor/builder/registries'>;
1845
+ export type BuilderRegistrySkillSummary = GeneratedResponse<'GET /editor/builder/registries/:registryId/search'>['skills'][number];
1846
+ export type BuilderRegistrySearchResponse = GeneratedResponse<'GET /editor/builder/registries/:registryId/search'>;
1847
+ export type BuilderRegistryPopularResponse = GeneratedResponse<'GET /editor/builder/registries/:registryId/popular'>;
1848
+ export type BuilderRegistryPreviewResponse = GeneratedResponse<'GET /editor/builder/registries/:registryId/preview'>;
1849
+ export type BuilderRegistryInstallBody = GeneratedRequest<Body<'POST /editor/builder/registries/:registryId/install'>>;
1850
+ export type BuilderRegistryInstallResponse = GeneratedResponse<'POST /editor/builder/registries/:registryId/install'>;
3192
1851
  export type { PermissionPolicy, ToolCategory } from '@mastra/core/agent-controller';
3193
1852
  export type { TaskItemSnapshot as AgentControllerTaskSnapshot } from '@mastra/core/tools';
3194
1853
  export type AgentControllerInfo = GeneratedResponse<'GET /agent-controller'>['agentControllers'][number];