@mastra/client-js 0.0.0-message-file-url-handling-fix-20250904234524 → 0.0.0-monorepo-binary-20251013210052

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 (41) hide show
  1. package/CHANGELOG.md +492 -3
  2. package/README.md +6 -10
  3. package/dist/client.d.ts +37 -39
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/index.cjs +671 -588
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +670 -589
  10. package/dist/index.js.map +1 -1
  11. package/dist/resources/agent-builder.d.ts +5 -6
  12. package/dist/resources/agent-builder.d.ts.map +1 -1
  13. package/dist/resources/agent.d.ts +71 -42
  14. package/dist/resources/agent.d.ts.map +1 -1
  15. package/dist/resources/index.d.ts +0 -2
  16. package/dist/resources/index.d.ts.map +1 -1
  17. package/dist/resources/mcp-tool.d.ts +2 -1
  18. package/dist/resources/mcp-tool.d.ts.map +1 -1
  19. package/dist/resources/observability.d.ts +17 -1
  20. package/dist/resources/observability.d.ts.map +1 -1
  21. package/dist/resources/tool.d.ts +2 -1
  22. package/dist/resources/tool.d.ts.map +1 -1
  23. package/dist/resources/vector.d.ts +5 -2
  24. package/dist/resources/vector.d.ts.map +1 -1
  25. package/dist/resources/workflow.d.ts +128 -13
  26. package/dist/resources/workflow.d.ts.map +1 -1
  27. package/dist/tools.d.ts +22 -0
  28. package/dist/tools.d.ts.map +1 -0
  29. package/dist/types.d.ts +65 -47
  30. package/dist/types.d.ts.map +1 -1
  31. package/dist/utils/index.d.ts +2 -0
  32. package/dist/utils/index.d.ts.map +1 -1
  33. package/dist/utils/process-mastra-stream.d.ts +5 -1
  34. package/dist/utils/process-mastra-stream.d.ts.map +1 -1
  35. package/package.json +5 -6
  36. package/dist/resources/legacy-workflow.d.ts +0 -87
  37. package/dist/resources/legacy-workflow.d.ts.map +0 -1
  38. package/dist/resources/network.d.ts +0 -30
  39. package/dist/resources/network.d.ts.map +0 -1
  40. package/dist/resources/vNextNetwork.d.ts +0 -42
  41. package/dist/resources/vNextNetwork.d.ts.map +0 -1
@@ -26,18 +26,17 @@ export declare class AgentBuilder extends BaseResource {
26
26
  constructor(options: ClientOptions, actionId: string);
27
27
  transformWorkflowResult(result: any): AgentBuilderActionResult;
28
28
  /**
29
- * Creates a new agent builder action run and returns the runId.
30
- * This calls `/api/agent-builder/:actionId/create-run`.
29
+ * @deprecated Use createRunAsync() instead.
30
+ * @throws {Error} Always throws an error directing users to use createRunAsync()
31
31
  */
32
- createRun(params?: {
32
+ createRun(_params?: {
33
33
  runId?: string;
34
34
  }): Promise<{
35
35
  runId: string;
36
36
  }>;
37
37
  /**
38
- * Creates a new workflow run (alias for createRun)
39
- * @param params - Optional object containing the optional runId
40
- * @returns Promise containing the runId of the created run
38
+ * Creates a new agent builder action run and returns the runId.
39
+ * This calls `/api/agent-builder/:actionId/create-run`.
41
40
  */
42
41
  createRunAsync(params?: {
43
42
  runId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-builder.d.ts","sourceRoot":"","sources":["../../src/resources/agent-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC,MAAM,WAAW,yBAAyB;IACxC,+CAA+C;IAC/C,SAAS,EAAE,GAAG,CAAC;IACf,+CAA+C;IAC/C,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MA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AAC,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAAA;KAAE,EACzE,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI;IA0B5D;;;OAGG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM;IAO3B;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC;IAKtC;;;OAGG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAwB5G;;;OAGG;IACG,kBAAkB,CAAC,KAAK,EAAE,MAAM;IAOtC;;;OAGG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAO5D;;;OAGG;IACG,YAAY,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAO1G"}
@@ -1,11 +1,12 @@
1
1
  import { processDataStream } from '@ai-sdk/ui-utils';
2
+ import type { MessageListInput } from '@mastra/core/agent/message-list';
2
3
  import type { GenerateReturn } from '@mastra/core/llm';
3
4
  import type { RuntimeContext } from '@mastra/core/runtime-context';
4
5
  import type { OutputSchema, MastraModelOutput } from '@mastra/core/stream';
5
6
  import type { JSONSchema7 } from 'json-schema';
6
7
  import type { ZodType } from 'zod';
7
- import type { GenerateParams, GetAgentResponse, GetEvalsByAgentIdResponse, GetToolResponse, ClientOptions, StreamParams, UpdateModelParams, StreamVNextParams } from '../types.js';
8
- import { processMastraStream } from '../utils/process-mastra-stream.js';
8
+ import type { GenerateLegacyParams, GetAgentResponse, GetEvalsByAgentIdResponse, GetToolResponse, ClientOptions, StreamParams, StreamLegacyParams, UpdateModelParams, UpdateModelInModelListParams, ReorderModelListParams, NetworkStreamParams } from '../types.js';
9
+ import { processMastraNetworkStream, processMastraStream } from '../utils/process-mastra-stream.js';
9
10
  import { BaseResource } from './base.js';
10
11
  export declare class AgentVoice extends BaseResource {
11
12
  private agentId;
@@ -31,17 +32,21 @@ export declare class AgentVoice extends BaseResource {
31
32
  }>;
32
33
  /**
33
34
  * Get available speakers for the agent's voice provider
35
+ * @param runtimeContext - Optional runtime context to pass as query parameter
36
+ * @param runtimeContext - Optional runtime context to pass as query parameter
34
37
  * @returns Promise containing list of available speakers
35
38
  */
36
- getSpeakers(): Promise<Array<{
39
+ getSpeakers(runtimeContext?: RuntimeContext | Record<string, any>): Promise<Array<{
37
40
  voiceId: string;
38
41
  [key: string]: any;
39
42
  }>>;
40
43
  /**
41
44
  * Get the listener configuration for the agent's voice provider
45
+ * @param runtimeContext - Optional runtime context to pass as query parameter
46
+ * @param runtimeContext - Optional runtime context to pass as query parameter
42
47
  * @returns Promise containing a check if the agent has listening capabilities
43
48
  */
44
- getListener(): Promise<{
49
+ getListener(runtimeContext?: RuntimeContext | Record<string, any>): Promise<{
45
50
  enabled: boolean;
46
51
  }>;
47
52
  }
@@ -51,64 +56,51 @@ export declare class Agent extends BaseResource {
51
56
  constructor(options: ClientOptions, agentId: string);
52
57
  /**
53
58
  * Retrieves details about the agent
59
+ * @param runtimeContext - Optional runtime context to pass as query parameter
54
60
  * @returns Promise containing agent details including model and instructions
55
61
  */
56
- details(): Promise<GetAgentResponse>;
62
+ details(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetAgentResponse>;
57
63
  /**
58
64
  * Generates a response from the agent
59
65
  * @param params - Generation parameters including prompt
60
66
  * @returns Promise containing the generated response
61
67
  */
62
- generate(params: GenerateParams<undefined> & {
68
+ generateLegacy(params: GenerateLegacyParams<undefined> & {
63
69
  output?: never;
64
70
  experimental_output?: never;
65
71
  }): Promise<GenerateReturn<any, undefined, undefined>>;
66
- generate<Output extends JSONSchema7 | ZodType>(params: GenerateParams<Output> & {
72
+ generateLegacy<Output extends JSONSchema7 | ZodType>(params: GenerateLegacyParams<Output> & {
67
73
  output: Output;
68
74
  experimental_output?: never;
69
75
  }): Promise<GenerateReturn<any, Output, undefined>>;
70
- generate<StructuredOutput extends JSONSchema7 | ZodType>(params: GenerateParams<StructuredOutput> & {
76
+ generateLegacy<StructuredOutput extends JSONSchema7 | ZodType>(params: GenerateLegacyParams<StructuredOutput> & {
71
77
  output?: never;
72
78
  experimental_output: StructuredOutput;
73
79
  }): Promise<GenerateReturn<any, undefined, StructuredOutput>>;
74
- /**
75
- * Generates a response from the agent
76
- * @param params - Generation parameters including prompt
77
- * @returns Promise containing the generated response
78
- */
79
- generateLegacy(params: GenerateParams<undefined> & {
80
- output?: never;
81
- experimental_output?: never;
82
- }): Promise<GenerateReturn<any, undefined, undefined>>;
83
- generateLegacy<Output extends JSONSchema7 | ZodType>(params: GenerateParams<Output> & {
84
- output: Output;
85
- experimental_output?: never;
86
- }): Promise<GenerateReturn<any, Output, undefined>>;
87
- generateLegacy<StructuredOutput extends JSONSchema7 | ZodType>(params: GenerateParams<StructuredOutput> & {
88
- output?: never;
89
- experimental_output: StructuredOutput;
90
- }): Promise<GenerateReturn<any, undefined, StructuredOutput>>;
91
- generateVNext<T extends OutputSchema | undefined = undefined>(params: StreamVNextParams<T>): Promise<ReturnType<MastraModelOutput['getFullOutput']>>;
80
+ generate<OUTPUT extends OutputSchema = undefined>(messages: MessageListInput, options?: Omit<StreamParams<OUTPUT>, 'messages'>): Promise<ReturnType<MastraModelOutput<OUTPUT>['getFullOutput']>>;
81
+ generate<OUTPUT extends OutputSchema = undefined>(params: StreamParams<OUTPUT>): Promise<ReturnType<MastraModelOutput<OUTPUT>['getFullOutput']>>;
92
82
  private processChatResponse;
93
83
  /**
94
84
  * Streams a response from the agent
95
85
  * @param params - Stream parameters including prompt
96
86
  * @returns Promise containing the enhanced Response object with processDataStream method
97
87
  */
98
- stream<T extends JSONSchema7 | ZodType | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
99
- processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
100
- }>;
101
- /**
102
- * Streams a response from the agent
103
- * @param params - Stream parameters including prompt
104
- * @returns Promise containing the enhanced Response object with processDataStream method
105
- */
106
- streamLegacy<T extends JSONSchema7 | ZodType | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
88
+ streamLegacy<T extends JSONSchema7 | ZodType | undefined = undefined>(params: StreamLegacyParams<T>): Promise<Response & {
107
89
  processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
108
90
  }>;
109
91
  private processChatResponse_vNext;
110
- processStreamResponse_vNext(processedParams: any, writable: any): Promise<Response>;
111
- streamVNext<T extends OutputSchema | undefined = undefined>(params: StreamVNextParams<T>): Promise<Response & {
92
+ processStreamResponse(processedParams: any, writable: any): Promise<Response>;
93
+ network(params: NetworkStreamParams): Promise<Response & {
94
+ processDataStream: ({ onChunk, }: {
95
+ onChunk: Parameters<typeof processMastraNetworkStream>[0]['onChunk'];
96
+ }) => Promise<void>;
97
+ }>;
98
+ stream<OUTPUT extends OutputSchema = undefined>(messages: MessageListInput, options?: Omit<StreamParams<OUTPUT>, 'messages'>): Promise<Response & {
99
+ processDataStream: ({ onChunk, }: {
100
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
101
+ }) => Promise<void>;
102
+ }>;
103
+ stream<OUTPUT extends OutputSchema = undefined>(params: StreamParams<OUTPUT>): Promise<Response & {
112
104
  processDataStream: ({ onChunk, }: {
113
105
  onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
114
106
  }) => Promise<void>;
@@ -116,13 +108,14 @@ export declare class Agent extends BaseResource {
116
108
  /**
117
109
  * Processes the stream response and handles tool calls
118
110
  */
119
- private processStreamResponse;
111
+ private processStreamResponseLegacy;
120
112
  /**
121
113
  * Gets details about a specific tool available to the agent
122
114
  * @param toolId - ID of the tool to retrieve
115
+ * @param runtimeContext - Optional runtime context to pass as query parameter
123
116
  * @returns Promise containing tool details
124
117
  */
125
- getTool(toolId: string): Promise<GetToolResponse>;
118
+ getTool(toolId: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetToolResponse>;
126
119
  /**
127
120
  * Executes a tool for the agent
128
121
  * @param toolId - ID of the tool to execute
@@ -131,18 +124,20 @@ export declare class Agent extends BaseResource {
131
124
  */
132
125
  executeTool(toolId: string, params: {
133
126
  data: any;
134
- runtimeContext?: RuntimeContext;
127
+ runtimeContext?: RuntimeContext | Record<string, any>;
135
128
  }): Promise<any>;
136
129
  /**
137
130
  * Retrieves evaluation results for the agent
131
+ * @param runtimeContext - Optional runtime context to pass as query parameter
138
132
  * @returns Promise containing agent evaluations
139
133
  */
140
- evals(): Promise<GetEvalsByAgentIdResponse>;
134
+ evals(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetEvalsByAgentIdResponse>;
141
135
  /**
142
136
  * Retrieves live evaluation results for the agent
137
+ * @param runtimeContext - Optional runtime context to pass as query parameter
143
138
  * @returns Promise containing live agent evaluations
144
139
  */
145
- liveEvals(): Promise<GetEvalsByAgentIdResponse>;
140
+ liveEvals(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetEvalsByAgentIdResponse>;
146
141
  /**
147
142
  * Updates the model for the agent
148
143
  * @param params - Parameters for updating the model
@@ -151,5 +146,39 @@ export declare class Agent extends BaseResource {
151
146
  updateModel(params: UpdateModelParams): Promise<{
152
147
  message: string;
153
148
  }>;
149
+ /**
150
+ * Updates the model for the agent in the model list
151
+ * @param params - Parameters for updating the model
152
+ * @returns Promise containing the updated model
153
+ */
154
+ updateModelInModelList({ modelConfigId, ...params }: UpdateModelInModelListParams): Promise<{
155
+ message: string;
156
+ }>;
157
+ /**
158
+ * Reorders the models for the agent
159
+ * @param params - Parameters for reordering the model list
160
+ * @returns Promise containing the updated model list
161
+ */
162
+ reorderModelList(params: ReorderModelListParams): Promise<{
163
+ message: string;
164
+ }>;
165
+ /**
166
+ * @deprecated generateVNext has been renamed to generate. Please use generate instead.
167
+ */
168
+ generateVNext<OUTPUT extends OutputSchema = undefined>(messages: MessageListInput, options?: Omit<StreamParams<OUTPUT>, 'messages'>): Promise<ReturnType<MastraModelOutput['getFullOutput']>>;
169
+ generateVNext<OUTPUT extends OutputSchema = undefined>(params: StreamParams<OUTPUT>): Promise<ReturnType<MastraModelOutput['getFullOutput']>>;
170
+ /**
171
+ * @deprecated streamVNext has been renamed to stream. Please use stream instead.
172
+ */
173
+ streamVNext<OUTPUT extends OutputSchema = undefined>(messages: MessageListInput, options?: Omit<StreamParams<OUTPUT>, 'messages'>): Promise<Response & {
174
+ processDataStream: ({ onChunk, }: {
175
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
176
+ }) => Promise<void>;
177
+ }>;
178
+ streamVNext<OUTPUT extends OutputSchema = undefined>(params: StreamParams<OUTPUT>): Promise<Response & {
179
+ processDataStream: ({ onChunk, }: {
180
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
181
+ }) => Promise<void>;
182
+ }>;
154
183
  }
155
184
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/resources/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAYvE,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE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CAAC,CAAC;SAC/D,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACrB,CACF;CAeF"}
@@ -1,8 +1,6 @@
1
1
  export * from './agent.js';
2
- export * from './network.js';
3
2
  export * from './memory-thread.js';
4
3
  export * from './vector.js';
5
- export * from './legacy-workflow.js';
6
4
  export * from './tool.js';
7
5
  export * from './base.js';
8
6
  export * from './workflow.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
@@ -11,9 +11,10 @@ export declare class MCPTool extends BaseResource {
11
11
  constructor(options: ClientOptions, serverId: string, toolId: string);
12
12
  /**
13
13
  * Retrieves details about this specific tool from the MCP server.
14
+ * @param runtimeContext - Optional runtime context to pass as query parameter
14
15
  * @returns Promise containing the tool's information (name, description, schema).
15
16
  */
16
- details(): Promise<McpToolInfo>;
17
+ details(runtimeContext?: RuntimeContext | Record<string, any>): Promise<McpToolInfo>;
17
18
  /**
18
19
  * Executes this specific tool on the MCP server.
19
20
  * @param params - Parameters for tool execution, including data/args and optional runtimeContext.
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-tool.d.ts","sourceRoot":"","sources":["../../src/resources/mcp-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAAY;IACvC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMpE;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC;IAI/B;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAgB/E"}
1
+ {"version":3,"file":"mcp-tool.d.ts","sourceRoot":"","sources":["../../src/resources/mcp-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAAY;IACvC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMpE;;;;OAIG;IACH,OAAO,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAIpF;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAgB/E"}
@@ -1,5 +1,5 @@
1
1
  import type { AITraceRecord, AITracesPaginatedArg } from '@mastra/core/storage';
2
- import type { ClientOptions, GetAITracesResponse } from '../types.js';
2
+ import type { ClientOptions, GetAITracesResponse, GetScoresBySpanParams, GetScoresResponse } from '../types.js';
3
3
  import { BaseResource } from './base.js';
4
4
  export declare class Observability extends BaseResource {
5
5
  constructor(options: ClientOptions);
@@ -15,5 +15,21 @@ export declare class Observability extends BaseResource {
15
15
  * @returns Promise containing paginated traces and pagination info
16
16
  */
17
17
  getTraces(params: AITracesPaginatedArg): Promise<GetAITracesResponse>;
18
+ /**
19
+ * Retrieves scores by trace ID and span ID
20
+ * @param params - Parameters containing trace ID, span ID, and pagination options
21
+ * @returns Promise containing scores and pagination info
22
+ */
23
+ getScoresBySpan(params: GetScoresBySpanParams): Promise<GetScoresResponse>;
24
+ score(params: {
25
+ scorerName: string;
26
+ targets: Array<{
27
+ traceId: string;
28
+ spanId?: string;
29
+ }>;
30
+ }): Promise<{
31
+ status: string;
32
+ message: string;
33
+ }>;
18
34
  }
19
35
  //# sourceMappingURL=observability.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../../src/resources/observability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,EAAE,aAAa;IAIlC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIjD;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA6BtE"}
1
+ {"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../../src/resources/observability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,EAAE,aAAa;IAIlC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIjD;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAmCrE;;;;OAIG;IACI,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiBjF,KAAK,CAAC,MAAM,EAAE;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,KAAK,CAAC;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACtD,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAMjD"}
@@ -6,9 +6,10 @@ export declare class Tool extends BaseResource {
6
6
  constructor(options: ClientOptions, toolId: string);
7
7
  /**
8
8
  * Retrieves details about the tool
9
+ * @param runtimeContext - Optional runtime context to pass as query parameter
9
10
  * @returns Promise containing tool details including description and schemas
10
11
  */
11
- details(): Promise<GetToolResponse>;
12
+ details(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetToolResponse>;
12
13
  /**
13
14
  * Executes the tool with the provided parameters
14
15
  * @param params - Parameters required for tool execution
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/resources/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,IAAK,SAAQ,YAAY;IAGlC,OAAO,CAAC,MAAM;gBADd,OAAO,EAAE,aAAa,EACd,MAAM,EAAE,MAAM;IAKxB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC;IAInC;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAiBpH"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/resources/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,IAAK,SAAQ,YAAY;IAGlC,OAAO,CAAC,MAAM;gBADd,OAAO,EAAE,aAAa,EACd,MAAM,EAAE,MAAM;IAKxB;;;;OAIG;IACH,OAAO,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAIxF;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAiBpH"}
@@ -1,3 +1,4 @@
1
+ import type { RuntimeContext } from '@mastra/core/runtime-context';
1
2
  import type { CreateIndexParams, GetVectorIndexResponse, QueryVectorParams, QueryVectorResponse, ClientOptions, UpsertVectorParams } from '../types.js';
2
3
  import { BaseResource } from './base.js';
3
4
  export declare class Vector extends BaseResource {
@@ -6,9 +7,10 @@ export declare class Vector extends BaseResource {
6
7
  /**
7
8
  * Retrieves details about a specific vector index
8
9
  * @param indexName - Name of the index to get details for
10
+ * @param runtimeContext - Optional runtime context to pass as query parameter
9
11
  * @returns Promise containing vector index details
10
12
  */
11
- details(indexName: string): Promise<GetVectorIndexResponse>;
13
+ details(indexName: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetVectorIndexResponse>;
12
14
  /**
13
15
  * Deletes a vector index
14
16
  * @param indexName - Name of the index to delete
@@ -19,9 +21,10 @@ export declare class Vector extends BaseResource {
19
21
  }>;
20
22
  /**
21
23
  * Retrieves a list of all available indexes
24
+ * @param runtimeContext - Optional runtime context to pass as query parameter
22
25
  * @returns Promise containing array of index names
23
26
  */
24
- getIndexes(): Promise<{
27
+ getIndexes(runtimeContext?: RuntimeContext | Record<string, any>): Promise<{
25
28
  indexes: string[];
26
29
  }>;
27
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../src/resources/vector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,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5B;;;;;OAKG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAMlH;;;;OAIG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAMxD;;;;OAIG;IACH,UAAU,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAIjG;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAOrE;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOrD;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAM/D"}
@@ -1,5 +1,6 @@
1
+ import type { TracingOptions } from '@mastra/core/ai-tracing';
1
2
  import type { RuntimeContext } from '@mastra/core/runtime-context';
2
- import type { ClientOptions, GetWorkflowResponse, GetWorkflowRunsResponse, GetWorkflowRunsParams, WorkflowRunResult, WorkflowWatchResult, GetWorkflowRunByIdResponse, GetWorkflowRunExecutionResultResponse } from '../types.js';
3
+ import type { ClientOptions, GetWorkflowResponse, GetWorkflowRunsResponse, GetWorkflowRunsParams, WorkflowRunResult, WorkflowWatchResult, GetWorkflowRunByIdResponse, GetWorkflowRunExecutionResultResponse, StreamVNextChunkType } from '../types.js';
3
4
  import { BaseResource } from './base.js';
4
5
  export declare class Workflow extends BaseResource {
5
6
  private workflowId;
@@ -14,27 +15,31 @@ export declare class Workflow extends BaseResource {
14
15
  private streamProcessor;
15
16
  /**
16
17
  * Retrieves details about the workflow
18
+ * @param runtimeContext - Optional runtime context to pass as query parameter
17
19
  * @returns Promise containing workflow details including steps and graphs
18
20
  */
19
- details(): Promise<GetWorkflowResponse>;
21
+ details(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowResponse>;
20
22
  /**
21
23
  * Retrieves all runs for a workflow
22
24
  * @param params - Parameters for filtering runs
25
+ * @param runtimeContext - Optional runtime context to pass as query parameter
23
26
  * @returns Promise containing workflow runs array
24
27
  */
25
- runs(params?: GetWorkflowRunsParams): Promise<GetWorkflowRunsResponse>;
28
+ runs(params?: GetWorkflowRunsParams, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunsResponse>;
26
29
  /**
27
30
  * Retrieves a specific workflow run by its ID
28
31
  * @param runId - The ID of the workflow run to retrieve
32
+ * @param runtimeContext - Optional runtime context to pass as query parameter
29
33
  * @returns Promise containing the workflow run details
30
34
  */
31
- runById(runId: string): Promise<GetWorkflowRunByIdResponse>;
35
+ runById(runId: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunByIdResponse>;
32
36
  /**
33
37
  * Retrieves the execution result for a specific workflow run by its ID
34
38
  * @param runId - The ID of the workflow run to retrieve the execution result for
39
+ * @param runtimeContext - Optional runtime context to pass as query parameter
35
40
  * @returns Promise containing the workflow run execution result
36
41
  */
37
- runExecutionResult(runId: string): Promise<GetWorkflowRunExecutionResultResponse>;
42
+ runExecutionResult(runId: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunExecutionResultResponse>;
38
43
  /**
39
44
  * Cancels a specific workflow run by its ID
40
45
  * @param runId - The ID of the workflow run to cancel
@@ -56,24 +61,86 @@ export declare class Workflow extends BaseResource {
56
61
  message: string;
57
62
  }>;
58
63
  /**
59
- * Creates a new workflow run
60
- * @param params - Optional object containing the optional runId
61
- * @returns Promise containing the runId of the created run
64
+ * @deprecated Use createRunAsync() instead.
65
+ * @throws {Error} Always throws an error directing users to use createRunAsync()
62
66
  */
63
- createRun(params?: {
67
+ createRun(_params?: {
64
68
  runId?: string;
65
69
  }): Promise<{
66
70
  runId: string;
71
+ start: (params: {
72
+ inputData: Record<string, any>;
73
+ runtimeContext?: RuntimeContext | Record<string, any>;
74
+ }) => Promise<{
75
+ message: string;
76
+ }>;
77
+ watch: (onRecord: (record: WorkflowWatchResult) => void) => Promise<void>;
78
+ resume: (params: {
79
+ step: string | string[];
80
+ resumeData?: Record<string, any>;
81
+ runtimeContext?: RuntimeContext | Record<string, any>;
82
+ }) => Promise<{
83
+ message: string;
84
+ }>;
85
+ stream: (params: {
86
+ inputData: Record<string, any>;
87
+ runtimeContext?: RuntimeContext | Record<string, any>;
88
+ }) => Promise<ReadableStream>;
89
+ startAsync: (params: {
90
+ inputData: Record<string, any>;
91
+ runtimeContext?: RuntimeContext | Record<string, any>;
92
+ }) => Promise<WorkflowRunResult>;
93
+ resumeAsync: (params: {
94
+ step: string | string[];
95
+ resumeData?: Record<string, any>;
96
+ runtimeContext?: RuntimeContext | Record<string, any>;
97
+ }) => Promise<WorkflowRunResult>;
67
98
  }>;
68
99
  /**
69
- * Creates a new workflow run (alias for createRun)
100
+ * Creates a new workflow run
70
101
  * @param params - Optional object containing the optional runId
71
- * @returns Promise containing the runId of the created run
102
+ * @returns Promise containing the runId of the created run with methods to control execution
72
103
  */
73
104
  createRunAsync(params?: {
74
105
  runId?: string;
75
106
  }): Promise<{
76
107
  runId: string;
108
+ start: (params: {
109
+ inputData: Record<string, any>;
110
+ runtimeContext?: RuntimeContext | Record<string, any>;
111
+ tracingOptions?: TracingOptions;
112
+ }) => Promise<{
113
+ message: string;
114
+ }>;
115
+ watch: (onRecord: (record: WorkflowWatchResult) => void) => Promise<void>;
116
+ resume: (params: {
117
+ step: string | string[];
118
+ resumeData?: Record<string, any>;
119
+ runtimeContext?: RuntimeContext | Record<string, any>;
120
+ tracingOptions?: TracingOptions;
121
+ }) => Promise<{
122
+ message: string;
123
+ }>;
124
+ stream: (params: {
125
+ inputData: Record<string, any>;
126
+ runtimeContext?: RuntimeContext | Record<string, any>;
127
+ }) => Promise<ReadableStream>;
128
+ startAsync: (params: {
129
+ inputData: Record<string, any>;
130
+ runtimeContext?: RuntimeContext | Record<string, any>;
131
+ tracingOptions?: TracingOptions;
132
+ }) => Promise<WorkflowRunResult>;
133
+ resumeAsync: (params: {
134
+ step: string | string[];
135
+ resumeData?: Record<string, any>;
136
+ runtimeContext?: RuntimeContext | Record<string, any>;
137
+ tracingOptions?: TracingOptions;
138
+ }) => Promise<WorkflowRunResult>;
139
+ resumeStreamVNext: (params: {
140
+ step: string | string[];
141
+ resumeData?: Record<string, any>;
142
+ runtimeContext?: RuntimeContext | Record<string, any>;
143
+ }) => Promise<ReadableStream>;
77
144
  }>;
78
145
  /**
79
146
  * Starts a workflow run synchronously without waiting for the workflow to complete
@@ -84,6 +151,7 @@ export declare class Workflow extends BaseResource {
84
151
  runId: string;
85
152
  inputData: Record<string, any>;
86
153
  runtimeContext?: RuntimeContext | Record<string, any>;
154
+ tracingOptions?: TracingOptions;
87
155
  }): Promise<{
88
156
  message: string;
89
157
  }>;
@@ -92,11 +160,12 @@ export declare class Workflow extends BaseResource {
92
160
  * @param params - Object containing the runId, step, resumeData and runtimeContext
93
161
  * @returns Promise containing success message
94
162
  */
95
- resume({ step, runId, resumeData, ...rest }: {
163
+ resume({ step, runId, resumeData, tracingOptions, ...rest }: {
96
164
  step: string | string[];
97
165
  runId: string;
98
166
  resumeData?: Record<string, any>;
99
167
  runtimeContext?: RuntimeContext | Record<string, any>;
168
+ tracingOptions?: TracingOptions;
100
169
  }): Promise<{
101
170
  message: string;
102
171
  }>;
@@ -109,6 +178,7 @@ export declare class Workflow extends BaseResource {
109
178
  runId?: string;
110
179
  inputData: Record<string, any>;
111
180
  runtimeContext?: RuntimeContext | Record<string, any>;
181
+ tracingOptions?: TracingOptions;
112
182
  }): Promise<WorkflowRunResult>;
113
183
  /**
114
184
  * Starts a workflow run and returns a stream
@@ -118,11 +188,43 @@ export declare class Workflow extends BaseResource {
118
188
  stream(params: {
119
189
  runId?: string;
120
190
  inputData: Record<string, any>;
121
- runtimeContext?: RuntimeContext;
191
+ runtimeContext?: RuntimeContext | Record<string, any>;
192
+ tracingOptions?: TracingOptions;
193
+ }): Promise<import("stream/web").ReadableStream<{
194
+ type: string;
195
+ payload: any;
196
+ }>>;
197
+ /**
198
+ * Observes workflow stream for a workflow run
199
+ * @param params - Object containing the runId
200
+ * @returns Promise containing the workflow execution results
201
+ */
202
+ observeStream(params: {
203
+ runId: string;
122
204
  }): Promise<import("stream/web").ReadableStream<{
123
205
  type: string;
124
206
  payload: any;
125
207
  }>>;
208
+ /**
209
+ * Starts a workflow run and returns a stream
210
+ * @param params - Object containing the optional runId, inputData and runtimeContext
211
+ * @returns Promise containing the workflow execution results
212
+ */
213
+ streamVNext(params: {
214
+ runId?: string;
215
+ inputData?: Record<string, any>;
216
+ runtimeContext?: RuntimeContext;
217
+ closeOnSuspend?: boolean;
218
+ tracingOptions?: TracingOptions;
219
+ }): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
220
+ /**
221
+ * Observes workflow vNext stream for a workflow run
222
+ * @param params - Object containing the runId
223
+ * @returns Promise containing the workflow execution results
224
+ */
225
+ observeStreamVNext(params: {
226
+ runId: string;
227
+ }): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
126
228
  /**
127
229
  * Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
128
230
  * @param params - Object containing the runId, step, resumeData and runtimeContext
@@ -133,7 +235,20 @@ export declare class Workflow extends BaseResource {
133
235
  step: string | string[];
134
236
  resumeData?: Record<string, any>;
135
237
  runtimeContext?: RuntimeContext | Record<string, any>;
238
+ tracingOptions?: TracingOptions;
136
239
  }): Promise<WorkflowRunResult>;
240
+ /**
241
+ * Resumes a suspended workflow step that uses streamVNext asynchronously and returns a promise that resolves when the workflow is complete
242
+ * @param params - Object containing the runId, step, resumeData and runtimeContext
243
+ * @returns Promise containing the workflow resume results
244
+ */
245
+ resumeStreamVNext(params: {
246
+ runId: string;
247
+ step: string | string[];
248
+ resumeData?: Record<string, any>;
249
+ runtimeContext?: RuntimeContext | Record<string, any>;
250
+ tracingOptions?: TracingOptions;
251
+ }): Promise<ReadableStream>;
137
252
  /**
138
253
  * Watches workflow transitions in real-time
139
254
  * @param runId - Optional run ID to filter the watch stream