@mastra/client-js 0.0.0-remove-cloud-span-transform-20250425214156 → 0.0.0-remove-unused-model-providers-api-20251030210744

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 (66) hide show
  1. package/CHANGELOG.md +2411 -2
  2. package/LICENSE.md +11 -42
  3. package/README.md +14 -15
  4. package/dist/client.d.ts +253 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/example.d.ts +2 -0
  7. package/dist/example.d.ts.map +1 -0
  8. package/dist/index.cjs +2810 -382
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +5 -691
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +2809 -387
  13. package/dist/index.js.map +1 -0
  14. package/dist/resources/a2a.d.ts +41 -0
  15. package/dist/resources/a2a.d.ts.map +1 -0
  16. package/dist/resources/agent-builder.d.ts +208 -0
  17. package/dist/resources/agent-builder.d.ts.map +1 -0
  18. package/dist/resources/agent.d.ts +199 -0
  19. package/dist/resources/agent.d.ts.map +1 -0
  20. package/dist/resources/base.d.ts +13 -0
  21. package/dist/resources/base.d.ts.map +1 -0
  22. package/dist/resources/index.d.ts +11 -0
  23. package/dist/resources/index.d.ts.map +1 -0
  24. package/dist/resources/mcp-tool.d.ts +28 -0
  25. package/dist/resources/mcp-tool.d.ts.map +1 -0
  26. package/dist/resources/memory-thread.d.ts +61 -0
  27. package/dist/resources/memory-thread.d.ts.map +1 -0
  28. package/dist/resources/observability.d.ts +35 -0
  29. package/dist/resources/observability.d.ts.map +1 -0
  30. package/dist/resources/tool.d.ts +24 -0
  31. package/dist/resources/tool.d.ts.map +1 -0
  32. package/dist/resources/vector.d.ts +51 -0
  33. package/dist/resources/vector.d.ts.map +1 -0
  34. package/dist/resources/workflow.d.ts +269 -0
  35. package/dist/resources/workflow.d.ts.map +1 -0
  36. package/dist/tools.d.ts +22 -0
  37. package/dist/tools.d.ts.map +1 -0
  38. package/dist/types.d.ts +460 -0
  39. package/dist/types.d.ts.map +1 -0
  40. package/dist/utils/index.d.ts +11 -0
  41. package/dist/utils/index.d.ts.map +1 -0
  42. package/dist/utils/process-client-tools.d.ts +3 -0
  43. package/dist/utils/process-client-tools.d.ts.map +1 -0
  44. package/dist/utils/process-mastra-stream.d.ts +11 -0
  45. package/dist/utils/process-mastra-stream.d.ts.map +1 -0
  46. package/dist/utils/zod-to-json-schema.d.ts +3 -0
  47. package/dist/utils/zod-to-json-schema.d.ts.map +1 -0
  48. package/package.json +39 -19
  49. package/dist/index.d.cts +0 -691
  50. package/eslint.config.js +0 -6
  51. package/src/client.ts +0 -232
  52. package/src/example.ts +0 -65
  53. package/src/index.test.ts +0 -710
  54. package/src/index.ts +0 -2
  55. package/src/resources/agent.ts +0 -205
  56. package/src/resources/base.ts +0 -70
  57. package/src/resources/index.ts +0 -8
  58. package/src/resources/memory-thread.ts +0 -53
  59. package/src/resources/network.ts +0 -92
  60. package/src/resources/tool.ts +0 -32
  61. package/src/resources/vector.ts +0 -83
  62. package/src/resources/vnext-workflow.ts +0 -225
  63. package/src/resources/workflow.ts +0 -215
  64. package/src/types.ts +0 -237
  65. package/tsconfig.json +0 -5
  66. package/vitest.config.js +0 -8
@@ -0,0 +1,41 @@
1
+ import type { AgentCard, GetTaskResponse, MessageSendParams, SendMessageResponse, SendStreamingMessageResponse, Task, TaskQueryParams } from '@mastra/core/a2a';
2
+ import type { ClientOptions } from '../types.js';
3
+ import { BaseResource } from './base.js';
4
+ /**
5
+ * Class for interacting with an agent via the A2A protocol
6
+ */
7
+ export declare class A2A extends BaseResource {
8
+ private agentId;
9
+ constructor(options: ClientOptions, agentId: string);
10
+ /**
11
+ * Get the agent card with metadata about the agent
12
+ * @returns Promise containing the agent card information
13
+ */
14
+ getCard(): Promise<AgentCard>;
15
+ /**
16
+ * Send a message to the agent and gets a message or task response
17
+ * @param params - Parameters for the task
18
+ * @returns Promise containing the response
19
+ */
20
+ sendMessage(params: MessageSendParams): Promise<SendMessageResponse>;
21
+ /**
22
+ * Sends a message to an agent to initiate/continue a task and subscribes
23
+ * the client to real-time updates for that task via Server-Sent Events (SSE).
24
+ * @param params - Parameters for the task
25
+ * @returns A stream of Server-Sent Events. Each SSE `data` field contains a `SendStreamingMessageResponse`
26
+ */
27
+ sendStreamingMessage(params: MessageSendParams): Promise<AsyncIterable<SendStreamingMessageResponse>>;
28
+ /**
29
+ * Get the status and result of a task
30
+ * @param params - Parameters for querying the task
31
+ * @returns Promise containing the task response
32
+ */
33
+ getTask(params: TaskQueryParams): Promise<GetTaskResponse>;
34
+ /**
35
+ * Cancel a running task
36
+ * @param params - Parameters identifying the task to cancel
37
+ * @returns Promise containing the task response
38
+ */
39
+ cancelTask(params: TaskQueryParams): Promise<Task>;
40
+ }
41
+ //# sourceMappingURL=a2a.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a.d.ts","sourceRoot":"","sources":["../../src/resources/a2a.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,4BAA4B,EAC5B,IAAI,EACJ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,qBAAa,GAAI,SAAQ,YAAY;IAGjC,OAAO,CAAC,OAAO;gBADf,OAAO,EAAE,aAAa,EACd,OAAO,EAAE,MAAM;IAKzB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;IAInC;;;;OAIG;IACG,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAY1E;;;;;OAKG;IACG,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;IAY3G;;;;OAIG;IACG,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAYhE;;;;OAIG;IACG,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CASzD"}
@@ -0,0 +1,208 @@
1
+ import type { RequestContext } from '@mastra/core/request-context';
2
+ import type { WorkflowInfo } from '@mastra/core/workflows';
3
+ import type { ClientOptions } from '../types.js';
4
+ import { BaseResource } from './base.js';
5
+ export interface AgentBuilderActionRequest {
6
+ /** Input data specific to the workflow type */
7
+ inputData: any;
8
+ /** Request context for the action execution */
9
+ requestContext?: RequestContext;
10
+ }
11
+ export interface AgentBuilderActionResult {
12
+ success: boolean;
13
+ applied: boolean;
14
+ branchName?: string;
15
+ message: string;
16
+ validationResults?: any;
17
+ error?: string;
18
+ errors?: string[];
19
+ stepResults?: any;
20
+ }
21
+ /**
22
+ * Agent Builder resource: operations related to agent-builder workflows via server endpoints.
23
+ */
24
+ export declare class AgentBuilder extends BaseResource {
25
+ private actionId;
26
+ constructor(options: ClientOptions, actionId: string);
27
+ transformWorkflowResult(result: any): AgentBuilderActionResult;
28
+ /**
29
+ * Creates a transform stream that parses binary chunks into JSON records.
30
+ */
31
+ private createRecordParserTransform;
32
+ /**
33
+ * @deprecated Use createRunAsync() instead.
34
+ * @throws {Error} Always throws an error directing users to use createRunAsync()
35
+ */
36
+ createRun(_params?: {
37
+ runId?: string;
38
+ }): Promise<{
39
+ runId: string;
40
+ }>;
41
+ /**
42
+ * Creates a new agent builder action run and returns the runId.
43
+ * This calls `/api/agent-builder/:actionId/create-run`.
44
+ */
45
+ createRunAsync(params?: {
46
+ runId?: string;
47
+ }): Promise<{
48
+ runId: string;
49
+ }>;
50
+ /**
51
+ * Starts agent builder action asynchronously and waits for completion.
52
+ * This calls `/api/agent-builder/:actionId/start-async`.
53
+ */
54
+ startAsync(params: AgentBuilderActionRequest, runId?: string): Promise<AgentBuilderActionResult>;
55
+ /**
56
+ * Starts an existing agent builder action run.
57
+ * This calls `/api/agent-builder/:actionId/start`.
58
+ */
59
+ startActionRun(params: AgentBuilderActionRequest, runId: string): Promise<{
60
+ message: string;
61
+ }>;
62
+ /**
63
+ * Resumes a suspended agent builder action step.
64
+ * This calls `/api/agent-builder/:actionId/resume`.
65
+ */
66
+ resume(params: {
67
+ step?: string | string[];
68
+ resumeData?: unknown;
69
+ requestContext?: RequestContext;
70
+ }, runId: string): Promise<{
71
+ message: string;
72
+ }>;
73
+ /**
74
+ * Resumes a suspended agent builder action step asynchronously.
75
+ * This calls `/api/agent-builder/:actionId/resume-async`.
76
+ */
77
+ resumeAsync(params: {
78
+ step?: string | string[];
79
+ resumeData?: unknown;
80
+ requestContext?: RequestContext;
81
+ }, runId: string): Promise<AgentBuilderActionResult>;
82
+ /**
83
+ * Creates an async generator that processes a readable stream and yields action records
84
+ * separated by the Record Separator character (\x1E)
85
+ *
86
+ * @param stream - The readable stream to process
87
+ * @returns An async generator that yields parsed records
88
+ */
89
+ private streamProcessor;
90
+ /**
91
+ * Streams agent builder action progress in real-time.
92
+ * This calls `/api/agent-builder/:actionId/stream`.
93
+ */
94
+ stream(params: AgentBuilderActionRequest, runId?: string): Promise<import("stream/web").ReadableStream<{
95
+ type: string;
96
+ payload: any;
97
+ }>>;
98
+ /**
99
+ * Streams agent builder action progress in real-time using VNext streaming.
100
+ * This calls `/api/agent-builder/:actionId/streamVNext`.
101
+ */
102
+ streamVNext(params: AgentBuilderActionRequest, runId?: string): Promise<import("stream/web").ReadableStream<{
103
+ type: string;
104
+ payload: any;
105
+ }>>;
106
+ /**
107
+ * Watches an existing agent builder action run by runId.
108
+ * This is used for hot reload recovery - it loads the existing run state
109
+ * and streams any remaining progress.
110
+ * This calls `/api/agent-builder/:actionId/watch`.
111
+ */
112
+ watch({ runId, eventType }: {
113
+ runId: string;
114
+ eventType?: 'watch' | 'watch-v2';
115
+ }, onRecord: (record: {
116
+ type: string;
117
+ payload: any;
118
+ }) => void): Promise<void>;
119
+ /**
120
+ * Observes an existing agent builder action run stream.
121
+ * Replays cached execution from the beginning, then continues with live stream.
122
+ * This is the recommended method for recovery after page refresh/hot reload.
123
+ * This calls `/api/agent-builder/:actionId/observe` (which delegates to observeStreamVNext).
124
+ */
125
+ observeStream(params: {
126
+ runId: string;
127
+ }): Promise<import("stream/web").ReadableStream<{
128
+ type: string;
129
+ payload: any;
130
+ }>>;
131
+ /**
132
+ * Observes an existing agent builder action run stream using VNext streaming API.
133
+ * Replays cached execution from the beginning, then continues with live stream.
134
+ * This calls `/api/agent-builder/:actionId/observe-streamVNext`.
135
+ */
136
+ observeStreamVNext(params: {
137
+ runId: string;
138
+ }): Promise<import("stream/web").ReadableStream<{
139
+ type: string;
140
+ payload: any;
141
+ }>>;
142
+ /**
143
+ * Observes an existing agent builder action run stream using legacy streaming API.
144
+ * Replays cached execution from the beginning, then continues with live stream.
145
+ * This calls `/api/agent-builder/:actionId/observe-stream-legacy`.
146
+ */
147
+ observeStreamLegacy(params: {
148
+ runId: string;
149
+ }): Promise<import("stream/web").ReadableStream<{
150
+ type: string;
151
+ payload: any;
152
+ }>>;
153
+ /**
154
+ * Resumes a suspended agent builder action and streams the results.
155
+ * This calls `/api/agent-builder/:actionId/resume-stream`.
156
+ */
157
+ resumeStream(params: {
158
+ runId: string;
159
+ step: string | string[];
160
+ resumeData?: unknown;
161
+ requestContext?: RequestContext;
162
+ }): Promise<ReadableStream>;
163
+ /**
164
+ * Gets a specific action run by its ID.
165
+ * This calls `/api/agent-builder/:actionId/runs/:runId`.
166
+ */
167
+ runById(runId: string): Promise<unknown>;
168
+ /**
169
+ * Gets details about this agent builder action.
170
+ * This calls `/api/agent-builder/:actionId`.
171
+ */
172
+ details(): Promise<WorkflowInfo>;
173
+ /**
174
+ * Gets all runs for this agent builder action.
175
+ * This calls `/api/agent-builder/:actionId/runs`.
176
+ */
177
+ runs(params?: {
178
+ fromDate?: Date;
179
+ toDate?: Date;
180
+ limit?: number;
181
+ offset?: number;
182
+ resourceId?: string;
183
+ }): Promise<unknown>;
184
+ /**
185
+ * Gets the execution result of an agent builder action run.
186
+ * This calls `/api/agent-builder/:actionId/runs/:runId/execution-result`.
187
+ */
188
+ runExecutionResult(runId: string): Promise<unknown>;
189
+ /**
190
+ * Cancels an agent builder action run.
191
+ * This calls `/api/agent-builder/:actionId/runs/:runId/cancel`.
192
+ */
193
+ cancelRun(runId: string): Promise<{
194
+ message: string;
195
+ }>;
196
+ /**
197
+ * Sends an event to an agent builder action run.
198
+ * This calls `/api/agent-builder/:actionId/runs/:runId/send-event`.
199
+ */
200
+ sendRunEvent(params: {
201
+ runId: string;
202
+ event: string;
203
+ data: unknown;
204
+ }): Promise<{
205
+ message: string;
206
+ }>;
207
+ }
208
+ //# sourceMappingURL=agent-builder.d.ts.map
@@ -0,0 +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,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,GAAG,CAAC;CACnB;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AAC;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"}
@@ -0,0 +1,199 @@
1
+ import { processDataStream } from '@ai-sdk/ui-utils';
2
+ import type { MessageListInput } from '@mastra/core/agent/message-list';
3
+ import type { GenerateReturn } from '@mastra/core/llm';
4
+ import type { RequestContext } from '@mastra/core/request-context';
5
+ import type { OutputSchema, MastraModelOutput } from '@mastra/core/stream';
6
+ import type { JSONSchema7 } from 'json-schema';
7
+ import type { ZodType } from 'zod';
8
+ import type { GenerateLegacyParams, GetAgentResponse, GetToolResponse, ClientOptions, StreamParams, StreamLegacyParams, UpdateModelParams, UpdateModelInModelListParams, ReorderModelListParams, NetworkStreamParams } from '../types.js';
9
+ import { processMastraNetworkStream, processMastraStream } from '../utils/process-mastra-stream.js';
10
+ import { BaseResource } from './base.js';
11
+ export declare class AgentVoice extends BaseResource {
12
+ private agentId;
13
+ constructor(options: ClientOptions, agentId: string);
14
+ /**
15
+ * Convert text to speech using the agent's voice provider
16
+ * @param text - Text to convert to speech
17
+ * @param options - Optional provider-specific options for speech generation
18
+ * @returns Promise containing the audio data
19
+ */
20
+ speak(text: string, options?: {
21
+ speaker?: string;
22
+ [key: string]: any;
23
+ }): Promise<Response>;
24
+ /**
25
+ * Convert speech to text using the agent's voice provider
26
+ * @param audio - Audio data to transcribe
27
+ * @param options - Optional provider-specific options
28
+ * @returns Promise containing the transcribed text
29
+ */
30
+ listen(audio: Blob, options?: Record<string, any>): Promise<{
31
+ text: string;
32
+ }>;
33
+ /**
34
+ * Get available speakers for the agent's voice provider
35
+ * @param requestContext - Optional request context to pass as query parameter
36
+ * @param requestContext - Optional request context to pass as query parameter
37
+ * @returns Promise containing list of available speakers
38
+ */
39
+ getSpeakers(requestContext?: RequestContext | Record<string, any>): Promise<Array<{
40
+ voiceId: string;
41
+ [key: string]: any;
42
+ }>>;
43
+ /**
44
+ * Get the listener configuration for the agent's voice provider
45
+ * @param requestContext - Optional request context to pass as query parameter
46
+ * @param requestContext - Optional request context to pass as query parameter
47
+ * @returns Promise containing a check if the agent has listening capabilities
48
+ */
49
+ getListener(requestContext?: RequestContext | Record<string, any>): Promise<{
50
+ enabled: boolean;
51
+ }>;
52
+ }
53
+ export declare class Agent extends BaseResource {
54
+ private agentId;
55
+ readonly voice: AgentVoice;
56
+ constructor(options: ClientOptions, agentId: string);
57
+ /**
58
+ * Retrieves details about the agent
59
+ * @param requestContext - Optional request context to pass as query parameter
60
+ * @returns Promise containing agent details including model and instructions
61
+ */
62
+ details(requestContext?: RequestContext | Record<string, any>): Promise<GetAgentResponse>;
63
+ enhanceInstructions(instructions: string, comment: string): Promise<{
64
+ explanation: string;
65
+ new_prompt: string;
66
+ }>;
67
+ /**
68
+ * Generates a response from the agent
69
+ * @param params - Generation parameters including prompt
70
+ * @returns Promise containing the generated response
71
+ */
72
+ generateLegacy(params: GenerateLegacyParams<undefined> & {
73
+ output?: never;
74
+ experimental_output?: never;
75
+ }): Promise<GenerateReturn<any, undefined, undefined>>;
76
+ generateLegacy<Output extends JSONSchema7 | ZodType>(params: GenerateLegacyParams<Output> & {
77
+ output: Output;
78
+ experimental_output?: never;
79
+ }): Promise<GenerateReturn<any, Output, undefined>>;
80
+ generateLegacy<StructuredOutput extends JSONSchema7 | ZodType>(params: GenerateLegacyParams<StructuredOutput> & {
81
+ output?: never;
82
+ experimental_output: StructuredOutput;
83
+ }): Promise<GenerateReturn<any, undefined, StructuredOutput>>;
84
+ generate<OUTPUT extends OutputSchema = undefined>(messages: MessageListInput, options?: Omit<StreamParams<OUTPUT>, 'messages'>): Promise<ReturnType<MastraModelOutput<OUTPUT>['getFullOutput']>>;
85
+ generate<OUTPUT extends OutputSchema = undefined>(params: StreamParams<OUTPUT>): Promise<ReturnType<MastraModelOutput<OUTPUT>['getFullOutput']>>;
86
+ private processChatResponse;
87
+ /**
88
+ * Streams a response from the agent
89
+ * @param params - Stream parameters including prompt
90
+ * @returns Promise containing the enhanced Response object with processDataStream method
91
+ */
92
+ streamLegacy<T extends JSONSchema7 | ZodType | undefined = undefined>(params: StreamLegacyParams<T>): Promise<Response & {
93
+ processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
94
+ }>;
95
+ private processChatResponse_vNext;
96
+ processStreamResponse(processedParams: any, writable: any, route?: string): Promise<Response>;
97
+ network(params: NetworkStreamParams): Promise<Response & {
98
+ processDataStream: ({ onChunk, }: {
99
+ onChunk: Parameters<typeof processMastraNetworkStream>[0]['onChunk'];
100
+ }) => Promise<void>;
101
+ }>;
102
+ stream<OUTPUT extends OutputSchema = undefined>(messages: MessageListInput, options?: Omit<StreamParams<OUTPUT>, 'messages'>): Promise<Response & {
103
+ processDataStream: ({ onChunk, }: {
104
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
105
+ }) => Promise<void>;
106
+ }>;
107
+ stream<OUTPUT extends OutputSchema = undefined>(params: StreamParams<OUTPUT>): Promise<Response & {
108
+ processDataStream: ({ onChunk, }: {
109
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
110
+ }) => Promise<void>;
111
+ }>;
112
+ approveToolCall(params: {
113
+ runId: string;
114
+ toolCallId: string;
115
+ }): Promise<Response & {
116
+ processDataStream: ({ onChunk, }: {
117
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
118
+ }) => Promise<void>;
119
+ }>;
120
+ declineToolCall(params: {
121
+ runId: string;
122
+ toolCallId: string;
123
+ }): Promise<Response & {
124
+ processDataStream: ({ onChunk, }: {
125
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
126
+ }) => Promise<void>;
127
+ }>;
128
+ /**
129
+ * Processes the stream response and handles tool calls
130
+ */
131
+ private processStreamResponseLegacy;
132
+ /**
133
+ * Gets details about a specific tool available to the agent
134
+ * @param toolId - ID of the tool to retrieve
135
+ * @param requestContext - Optional request context to pass as query parameter
136
+ * @returns Promise containing tool details
137
+ */
138
+ getTool(toolId: string, requestContext?: RequestContext | Record<string, any>): Promise<GetToolResponse>;
139
+ /**
140
+ * Executes a tool for the agent
141
+ * @param toolId - ID of the tool to execute
142
+ * @param params - Parameters required for tool execution
143
+ * @returns Promise containing the tool execution results
144
+ */
145
+ executeTool(toolId: string, params: {
146
+ data: any;
147
+ requestContext?: RequestContext | Record<string, any>;
148
+ }): Promise<any>;
149
+ /**
150
+ * Updates the model for the agent
151
+ * @param params - Parameters for updating the model
152
+ * @returns Promise containing the updated model
153
+ */
154
+ updateModel(params: UpdateModelParams): Promise<{
155
+ message: string;
156
+ }>;
157
+ /**
158
+ * Resets the agent's model to the original model that was set during construction
159
+ * @returns Promise containing a success message
160
+ */
161
+ resetModel(): Promise<{
162
+ message: string;
163
+ }>;
164
+ /**
165
+ * Updates the model for the agent in the model list
166
+ * @param params - Parameters for updating the model
167
+ * @returns Promise containing the updated model
168
+ */
169
+ updateModelInModelList({ modelConfigId, ...params }: UpdateModelInModelListParams): Promise<{
170
+ message: string;
171
+ }>;
172
+ /**
173
+ * Reorders the models for the agent
174
+ * @param params - Parameters for reordering the model list
175
+ * @returns Promise containing the updated model list
176
+ */
177
+ reorderModelList(params: ReorderModelListParams): Promise<{
178
+ message: string;
179
+ }>;
180
+ /**
181
+ * @deprecated generateVNext has been renamed to generate. Please use generate instead.
182
+ */
183
+ generateVNext<OUTPUT extends OutputSchema = undefined>(messages: MessageListInput, options?: Omit<StreamParams<OUTPUT>, 'messages'>): Promise<ReturnType<MastraModelOutput['getFullOutput']>>;
184
+ generateVNext<OUTPUT extends OutputSchema = undefined>(params: StreamParams<OUTPUT>): Promise<ReturnType<MastraModelOutput['getFullOutput']>>;
185
+ /**
186
+ * @deprecated streamVNext has been renamed to stream. Please use stream instead.
187
+ */
188
+ streamVNext<OUTPUT extends OutputSchema = undefined>(messages: MessageListInput, options?: Omit<StreamParams<OUTPUT>, 'messages'>): Promise<Response & {
189
+ processDataStream: ({ onChunk, }: {
190
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
191
+ }) => Promise<void>;
192
+ }>;
193
+ streamVNext<OUTPUT extends OutputSchema = undefined>(params: StreamParams<OUTPUT>): Promise<Response & {
194
+ processDataStream: ({ onChunk, }: {
195
+ onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
196
+ }) => Promise<void>;
197
+ }>;
198
+ }
199
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/resources/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAWvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,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,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,OAA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,YAAY,GAAG,SAAS,EACvD,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAC/C,OAAO,CACR,QAAQ,GAAG;QACT,iBAAiB,EAAE,CAAC,EAClB,OAAO,GACR,EAAE;YACD,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;SAC/D,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACrB,CACF;IAEK,WAAW,CAAC,MAAM,SAAS,YAAY,GAAG,SAAS,EACvD,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,GAC3B,OAAO,CACR,QAAQ,GAAG;QACT,iBAAiB,EAAE,CAAC,EAClB,OAAO,GACR,EAAE;YACD,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;SAC/D,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACrB,CACF;CAeF"}
@@ -0,0 +1,13 @@
1
+ import type { RequestOptions, ClientOptions } from '../types.js';
2
+ export declare class BaseResource {
3
+ readonly options: ClientOptions;
4
+ constructor(options: ClientOptions);
5
+ /**
6
+ * Makes an HTTP request to the API with retries and exponential backoff
7
+ * @param path - The API endpoint path
8
+ * @param options - Optional request configuration
9
+ * @returns Promise containing the response data
10
+ */
11
+ request<T>(path: string, options?: RequestOptions): Promise<T>;
12
+ }
13
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/resources/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9D,qBAAa,YAAY;IACvB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;gBAEpB,OAAO,EAAE,aAAa;IAIlC;;;;;OAKG;IACU,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC;CA6DhF"}
@@ -0,0 +1,11 @@
1
+ export * from './agent.js';
2
+ export * from './memory-thread.js';
3
+ export * from './vector.js';
4
+ export * from './tool.js';
5
+ export * from './base.js';
6
+ export * from './workflow.js';
7
+ export * from './a2a.js';
8
+ export * from './mcp-tool.js';
9
+ export * from './agent-builder.js';
10
+ export * from './observability.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,28 @@
1
+ import type { RequestContext } from '@mastra/core/request-context';
2
+ import type { ClientOptions, McpToolInfo } from '../types.js';
3
+ import { BaseResource } from './base.js';
4
+ /**
5
+ * Represents a specific tool available on a specific MCP server.
6
+ * Provides methods to get details and execute the tool.
7
+ */
8
+ export declare class MCPTool extends BaseResource {
9
+ private serverId;
10
+ private toolId;
11
+ constructor(options: ClientOptions, serverId: string, toolId: string);
12
+ /**
13
+ * Retrieves details about this specific tool from the MCP server.
14
+ * @param requestContext - Optional request context to pass as query parameter
15
+ * @returns Promise containing the tool's information (name, description, schema).
16
+ */
17
+ details(requestContext?: RequestContext | Record<string, any>): Promise<McpToolInfo>;
18
+ /**
19
+ * Executes this specific tool on the MCP server.
20
+ * @param params - Parameters for tool execution, including data/args and optional requestContext.
21
+ * @returns Promise containing the result of the tool execution.
22
+ */
23
+ execute(params: {
24
+ data?: any;
25
+ requestContext?: RequestContext;
26
+ }): Promise<any>;
27
+ }
28
+ //# sourceMappingURL=mcp-tool.d.ts.map
@@ -0,0 +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;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"}
@@ -0,0 +1,61 @@
1
+ import type { RequestContext } from '@mastra/core/di';
2
+ import type { StorageThreadType } from '@mastra/core/memory';
3
+ import type { GetMemoryThreadMessagesResponse, ClientOptions, UpdateMemoryThreadParams, GetMemoryThreadMessagesParams, GetMemoryThreadMessagesPaginatedParams, GetMemoryThreadMessagesPaginatedResponse } from '../types.js';
4
+ import { BaseResource } from './base.js';
5
+ export declare class MemoryThread extends BaseResource {
6
+ private threadId;
7
+ private agentId;
8
+ constructor(options: ClientOptions, threadId: string, agentId: string);
9
+ /**
10
+ * Retrieves the memory thread details
11
+ * @param requestContext - Optional request context to pass as query parameter
12
+ * @returns Promise containing thread details including title and metadata
13
+ */
14
+ get(requestContext?: RequestContext | Record<string, any>): Promise<StorageThreadType>;
15
+ /**
16
+ * Updates the memory thread properties
17
+ * @param params - Update parameters including title, metadata, and optional request context
18
+ * @returns Promise containing updated thread details
19
+ */
20
+ update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
21
+ /**
22
+ * Deletes the memory thread
23
+ * @param requestContext - Optional request context to pass as query parameter
24
+ * @returns Promise containing deletion result
25
+ */
26
+ delete(requestContext?: RequestContext | Record<string, any>): Promise<{
27
+ result: string;
28
+ }>;
29
+ /**
30
+ * Retrieves messages associated with the thread
31
+ * @param params - Optional parameters including limit for number of messages to retrieve and request context
32
+ * @returns Promise containing thread messages and UI messages
33
+ */
34
+ getMessages(params?: GetMemoryThreadMessagesParams & {
35
+ requestContext?: RequestContext | Record<string, any>;
36
+ }): Promise<GetMemoryThreadMessagesResponse>;
37
+ /**
38
+ * Retrieves paginated messages associated with the thread with advanced filtering and selection options
39
+ * @param params - Pagination parameters including selectBy criteria, page, perPage, date ranges, message inclusion options, and request context
40
+ * @returns Promise containing paginated thread messages with pagination metadata (total, page, perPage, hasMore)
41
+ */
42
+ getMessagesPaginated({ selectBy, requestContext, ...rest }: GetMemoryThreadMessagesPaginatedParams & {
43
+ requestContext?: RequestContext | Record<string, any>;
44
+ }): Promise<GetMemoryThreadMessagesPaginatedResponse>;
45
+ /**
46
+ * Deletes one or more messages from the thread
47
+ * @param messageIds - Can be a single message ID (string), array of message IDs,
48
+ * message object with id property, or array of message objects
49
+ * @param requestContext - Optional request context to pass as query parameter
50
+ * @returns Promise containing deletion result
51
+ */
52
+ deleteMessages(messageIds: string | string[] | {
53
+ id: string;
54
+ } | {
55
+ id: string;
56
+ }[], requestContext?: RequestContext | Record<string, any>): Promise<{
57
+ success: boolean;
58
+ message: string;
59
+ }>;
60
+ }
61
+ //# sourceMappingURL=memory-thread.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-thread.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AAG,CAAC,CAAC;KACvD,GAAG,OAAO,CAAC,wCAAwC,CAAC;IAUrD;;;;;;OAMG;IACH,cAAc,CACZ,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,EACjE,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAYlD"}
@@ -0,0 +1,35 @@
1
+ import type { AITraceRecord, AITracesPaginatedArg } from '@mastra/core/storage';
2
+ import type { ClientOptions, GetAITracesResponse, GetScoresBySpanParams, GetScoresResponse } from '../types.js';
3
+ import { BaseResource } from './base.js';
4
+ export declare class Observability extends BaseResource {
5
+ constructor(options: ClientOptions);
6
+ /**
7
+ * Retrieves a specific AI trace by ID
8
+ * @param traceId - ID of the trace to retrieve
9
+ * @returns Promise containing the AI trace with all its spans
10
+ */
11
+ getTrace(traceId: string): Promise<AITraceRecord>;
12
+ /**
13
+ * Retrieves paginated list of AI traces with optional filtering
14
+ * @param params - Parameters for pagination and filtering
15
+ * @returns Promise containing paginated traces and pagination info
16
+ */
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
+ }>;
34
+ }
35
+ //# sourceMappingURL=observability.d.ts.map
@@ -0,0 +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,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"}