@mastra/client-js 0.0.0-error-handler-fix-20251020202607 → 0.0.0-execa-dynamic-import-20260304221256
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.
- package/CHANGELOG.md +3375 -3
- package/LICENSE.md +15 -0
- package/README.md +11 -13
- package/dist/_types/@ai-sdk_ui-utils/dist/index.d.ts +820 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +10345 -0
- package/dist/client.d.ts +397 -75
- package/dist/client.d.ts.map +1 -1
- package/dist/docs/SKILL.md +44 -0
- package/dist/docs/assets/SOURCE_MAP.json +6 -0
- package/dist/docs/references/docs-server-auth-auth0.md +220 -0
- package/dist/docs/references/docs-server-auth-clerk.md +132 -0
- package/dist/docs/references/docs-server-auth-firebase.md +272 -0
- package/dist/docs/references/docs-server-auth-jwt.md +110 -0
- package/dist/docs/references/docs-server-auth-supabase.md +117 -0
- package/dist/docs/references/docs-server-auth-workos.md +186 -0
- package/dist/docs/references/docs-server-mastra-client.md +243 -0
- package/dist/docs/references/reference-ai-sdk-to-ai-sdk-stream.md +231 -0
- package/dist/docs/references/reference-ai-sdk-to-ai-sdk-v4-messages.md +79 -0
- package/dist/docs/references/reference-ai-sdk-to-ai-sdk-v5-messages.md +76 -0
- package/dist/docs/references/reference-client-js-agents.md +437 -0
- package/dist/docs/references/reference-client-js-error-handling.md +16 -0
- package/dist/docs/references/reference-client-js-logs.md +24 -0
- package/dist/docs/references/reference-client-js-mastra-client.md +63 -0
- package/dist/docs/references/reference-client-js-memory.md +221 -0
- package/dist/docs/references/reference-client-js-observability.md +72 -0
- package/dist/docs/references/reference-client-js-telemetry.md +20 -0
- package/dist/docs/references/reference-client-js-tools.md +44 -0
- package/dist/docs/references/reference-client-js-vectors.md +79 -0
- package/dist/docs/references/reference-client-js-workflows.md +199 -0
- package/dist/index.cjs +4575 -1896
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4875 -2193
- package/dist/index.js.map +1 -1
- package/dist/resources/a2a.d.ts.map +1 -1
- package/dist/resources/agent-builder.d.ts +55 -62
- package/dist/resources/agent-builder.d.ts.map +1 -1
- package/dist/resources/agent.d.ts +89 -51
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/base.d.ts +2 -1
- package/dist/resources/base.d.ts.map +1 -1
- package/dist/resources/index.d.ts +9 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/mcp-tool.d.ts +5 -5
- package/dist/resources/mcp-tool.d.ts.map +1 -1
- package/dist/resources/memory-thread.d.ts +31 -16
- package/dist/resources/memory-thread.d.ts.map +1 -1
- package/dist/resources/observability.d.ts +62 -19
- package/dist/resources/observability.d.ts.map +1 -1
- package/dist/resources/processor-provider.d.ts +15 -0
- package/dist/resources/processor-provider.d.ts.map +1 -0
- package/dist/resources/processor.d.ts +20 -0
- package/dist/resources/processor.d.ts.map +1 -0
- package/dist/resources/run.d.ts +210 -0
- package/dist/resources/run.d.ts.map +1 -0
- package/dist/resources/stored-agent.d.ts +83 -0
- package/dist/resources/stored-agent.d.ts.map +1 -0
- package/dist/resources/stored-mcp-client.d.ts +30 -0
- package/dist/resources/stored-mcp-client.d.ts.map +1 -0
- package/dist/resources/stored-prompt-block.d.ts +83 -0
- package/dist/resources/stored-prompt-block.d.ts.map +1 -0
- package/dist/resources/stored-scorer.d.ts +83 -0
- package/dist/resources/stored-scorer.d.ts.map +1 -0
- package/dist/resources/stored-skill.d.ts +30 -0
- package/dist/resources/stored-skill.d.ts.map +1 -0
- package/dist/resources/tool-provider.d.ts +27 -0
- package/dist/resources/tool-provider.d.ts.map +1 -0
- package/dist/resources/tool.d.ts +4 -4
- package/dist/resources/vector.d.ts +5 -5
- package/dist/resources/vector.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +32 -231
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/resources/workspace.d.ts +125 -0
- package/dist/resources/workspace.d.ts.map +1 -0
- package/dist/tools.d.ts +2 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +1673 -146
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +56 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/process-mastra-stream.d.ts +1 -1
- package/dist/utils/process-mastra-stream.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema.d.ts +9 -1
- package/dist/utils/zod-to-json-schema.d.ts.map +1 -1
- package/package.json +20 -18
- package/dist/resources/network-memory-thread.d.ts +0 -47
- package/dist/resources/network-memory-thread.d.ts.map +0 -1
|
@@ -1 +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;
|
|
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;IAc1E;;;;;OAKG;IACG,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;IAe3G;;;;OAIG;IACG,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAchE;;;;OAIG;IACG,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAWzD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RequestContext } from '@mastra/core/request-context';
|
|
2
2
|
import type { WorkflowInfo } from '@mastra/core/workflows';
|
|
3
|
-
import type { ClientOptions } from '../types.js';
|
|
3
|
+
import type { ClientOptions, ListWorkflowRunsParams } from '../types.js';
|
|
4
4
|
import { BaseResource } from './base.js';
|
|
5
5
|
export interface AgentBuilderActionRequest {
|
|
6
6
|
/** Input data specific to the workflow type */
|
|
7
7
|
inputData: any;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/** Request context for the action execution */
|
|
9
|
+
requestContext?: RequestContext;
|
|
10
10
|
}
|
|
11
11
|
export interface AgentBuilderActionResult {
|
|
12
12
|
success: boolean;
|
|
@@ -26,54 +26,49 @@ export declare class AgentBuilder extends BaseResource {
|
|
|
26
26
|
constructor(options: ClientOptions, actionId: string);
|
|
27
27
|
transformWorkflowResult(result: any): AgentBuilderActionResult;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @throws {Error} Always throws an error directing users to use createRunAsync()
|
|
29
|
+
* Creates a transform stream that parses binary chunks into JSON records.
|
|
31
30
|
*/
|
|
32
|
-
|
|
33
|
-
runId?: string;
|
|
34
|
-
}): Promise<{
|
|
35
|
-
runId: string;
|
|
36
|
-
}>;
|
|
31
|
+
private createRecordParserTransform;
|
|
37
32
|
/**
|
|
38
33
|
* Creates a new agent builder action run and returns the runId.
|
|
39
|
-
* This calls `/
|
|
34
|
+
* This calls `/agent-builder/:actionId/create-run`.
|
|
40
35
|
*/
|
|
41
|
-
|
|
36
|
+
createRun(params?: {
|
|
42
37
|
runId?: string;
|
|
43
38
|
}): Promise<{
|
|
44
39
|
runId: string;
|
|
45
40
|
}>;
|
|
46
41
|
/**
|
|
47
42
|
* Starts agent builder action asynchronously and waits for completion.
|
|
48
|
-
* This calls `/
|
|
43
|
+
* This calls `/agent-builder/:actionId/start-async`.
|
|
49
44
|
*/
|
|
50
45
|
startAsync(params: AgentBuilderActionRequest, runId?: string): Promise<AgentBuilderActionResult>;
|
|
51
46
|
/**
|
|
52
47
|
* Starts an existing agent builder action run.
|
|
53
|
-
* This calls `/
|
|
48
|
+
* This calls `/agent-builder/:actionId/start`.
|
|
54
49
|
*/
|
|
55
50
|
startActionRun(params: AgentBuilderActionRequest, runId: string): Promise<{
|
|
56
51
|
message: string;
|
|
57
52
|
}>;
|
|
58
53
|
/**
|
|
59
54
|
* Resumes a suspended agent builder action step.
|
|
60
|
-
* This calls `/
|
|
55
|
+
* This calls `/agent-builder/:actionId/resume`.
|
|
61
56
|
*/
|
|
62
57
|
resume(params: {
|
|
63
|
-
step
|
|
58
|
+
step?: string | string[];
|
|
64
59
|
resumeData?: unknown;
|
|
65
|
-
|
|
60
|
+
requestContext?: RequestContext;
|
|
66
61
|
}, runId: string): Promise<{
|
|
67
62
|
message: string;
|
|
68
63
|
}>;
|
|
69
64
|
/**
|
|
70
65
|
* Resumes a suspended agent builder action step asynchronously.
|
|
71
|
-
* This calls `/
|
|
66
|
+
* This calls `/agent-builder/:actionId/resume-async`.
|
|
72
67
|
*/
|
|
73
68
|
resumeAsync(params: {
|
|
74
|
-
step
|
|
69
|
+
step?: string | string[];
|
|
75
70
|
resumeData?: unknown;
|
|
76
|
-
|
|
71
|
+
requestContext?: RequestContext;
|
|
77
72
|
}, runId: string): Promise<AgentBuilderActionResult>;
|
|
78
73
|
/**
|
|
79
74
|
* Creates an async generator that processes a readable stream and yields action records
|
|
@@ -85,76 +80,74 @@ export declare class AgentBuilder extends BaseResource {
|
|
|
85
80
|
private streamProcessor;
|
|
86
81
|
/**
|
|
87
82
|
* Streams agent builder action progress in real-time.
|
|
88
|
-
* This calls `/
|
|
83
|
+
* This calls `/agent-builder/:actionId/stream`.
|
|
89
84
|
*/
|
|
90
85
|
stream(params: AgentBuilderActionRequest, runId?: string): Promise<import("stream/web").ReadableStream<{
|
|
91
86
|
type: string;
|
|
92
87
|
payload: any;
|
|
93
88
|
}>>;
|
|
94
89
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
90
|
+
* Observes an existing agent builder action run stream.
|
|
91
|
+
* Replays cached execution from the beginning, then continues with live stream.
|
|
92
|
+
* This is the recommended method for recovery after page refresh/hot reload.
|
|
93
|
+
* This calls `/agent-builder/:actionId/observe`
|
|
97
94
|
*/
|
|
98
|
-
|
|
95
|
+
observeStream(params: {
|
|
96
|
+
runId: string;
|
|
97
|
+
}): Promise<import("stream/web").ReadableStream<{
|
|
99
98
|
type: string;
|
|
100
99
|
payload: any;
|
|
101
100
|
}>>;
|
|
102
101
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* This calls `/api/agent-builder/:actionId/watch`.
|
|
102
|
+
* Observes an existing agent builder action run stream using legacy streaming API.
|
|
103
|
+
* Replays cached execution from the beginning, then continues with live stream.
|
|
104
|
+
* This calls `/agent-builder/:actionId/observe-stream-legacy`.
|
|
107
105
|
*/
|
|
108
|
-
|
|
106
|
+
observeStreamLegacy(params: {
|
|
109
107
|
runId: string;
|
|
110
|
-
|
|
111
|
-
}, onRecord: (record: {
|
|
108
|
+
}): Promise<import("stream/web").ReadableStream<{
|
|
112
109
|
type: string;
|
|
113
110
|
payload: any;
|
|
114
|
-
}
|
|
111
|
+
}>>;
|
|
115
112
|
/**
|
|
116
|
-
*
|
|
117
|
-
* This calls `/
|
|
113
|
+
* Resumes a suspended agent builder action and streams the results.
|
|
114
|
+
* This calls `/agent-builder/:actionId/resume-stream`.
|
|
118
115
|
*/
|
|
119
|
-
|
|
116
|
+
resumeStream(params: {
|
|
117
|
+
runId: string;
|
|
118
|
+
step: string | string[];
|
|
119
|
+
resumeData?: unknown;
|
|
120
|
+
requestContext?: RequestContext;
|
|
121
|
+
}): Promise<ReadableStream>;
|
|
122
|
+
/**
|
|
123
|
+
* Gets a specific action run by its ID.
|
|
124
|
+
* This calls `/agent-builder/:actionId/runs/:runId`.
|
|
125
|
+
* @param runId - The ID of the action run to retrieve
|
|
126
|
+
* @param options - Optional configuration
|
|
127
|
+
* @param options.fields - Optional array of fields to return (e.g., ['result', 'steps']). Available fields: result, error, payload, steps, activeStepsPath, serializedStepGraph. Metadata fields (runId, workflowName, resourceId, createdAt, updatedAt) and status are always included.
|
|
128
|
+
* @param options.withNestedWorkflows - Whether to include nested workflow data in steps. Defaults to true. Set to false for better performance when you don't need nested workflow details.
|
|
129
|
+
* @returns Promise containing the action run details with metadata and processed execution state
|
|
130
|
+
*/
|
|
131
|
+
runById(runId: string, options?: {
|
|
132
|
+
fields?: string[];
|
|
133
|
+
withNestedWorkflows?: boolean;
|
|
134
|
+
}): Promise<unknown>;
|
|
120
135
|
/**
|
|
121
136
|
* Gets details about this agent builder action.
|
|
122
|
-
* This calls `/
|
|
137
|
+
* This calls `/agent-builder/:actionId`.
|
|
123
138
|
*/
|
|
124
139
|
details(): Promise<WorkflowInfo>;
|
|
125
140
|
/**
|
|
126
141
|
* Gets all runs for this agent builder action.
|
|
127
|
-
* This calls `/
|
|
128
|
-
*/
|
|
129
|
-
runs(params?: {
|
|
130
|
-
fromDate?: Date;
|
|
131
|
-
toDate?: Date;
|
|
132
|
-
limit?: number;
|
|
133
|
-
offset?: number;
|
|
134
|
-
resourceId?: string;
|
|
135
|
-
}): Promise<unknown>;
|
|
136
|
-
/**
|
|
137
|
-
* Gets the execution result of an agent builder action run.
|
|
138
|
-
* This calls `/api/agent-builder/:actionId/runs/:runId/execution-result`.
|
|
142
|
+
* This calls `/agent-builder/:actionId/runs`.
|
|
139
143
|
*/
|
|
140
|
-
|
|
144
|
+
runs(params?: ListWorkflowRunsParams): Promise<unknown>;
|
|
141
145
|
/**
|
|
142
146
|
* Cancels an agent builder action run.
|
|
143
|
-
* This calls `/
|
|
147
|
+
* This calls `/agent-builder/:actionId/runs/:runId/cancel`.
|
|
144
148
|
*/
|
|
145
149
|
cancelRun(runId: string): Promise<{
|
|
146
150
|
message: string;
|
|
147
151
|
}>;
|
|
148
|
-
/**
|
|
149
|
-
* Sends an event to an agent builder action run.
|
|
150
|
-
* This calls `/api/agent-builder/:actionId/runs/:runId/send-event`.
|
|
151
|
-
*/
|
|
152
|
-
sendRunEvent(params: {
|
|
153
|
-
runId: string;
|
|
154
|
-
event: string;
|
|
155
|
-
data: unknown;
|
|
156
|
-
}): Promise<{
|
|
157
|
-
message: string;
|
|
158
|
-
}>;
|
|
159
152
|
}
|
|
160
153
|
//# sourceMappingURL=agent-builder.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"agent-builder.d.ts","sourceRoot":"","sources":["../../src/resources/agent-builder.ts"],"names":[],"mapp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E;QACR,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B;IAmBH;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC;IAKtC;;;OAGG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,sBAAsB;IAmC1C;;;OAGG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAM7D"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { processDataStream } from '
|
|
1
|
+
import { processDataStream } from '../_types/@ai-sdk_ui-utils/dist/index.js';
|
|
2
|
+
import type { SerializableStructuredOutputOptions } from '@mastra/core/agent';
|
|
2
3
|
import type { MessageListInput } from '@mastra/core/agent/message-list';
|
|
3
4
|
import type { GenerateReturn } from '@mastra/core/llm';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
5
|
+
import type { RequestContext } from '@mastra/core/request-context';
|
|
6
|
+
import type { FullOutput } from '@mastra/core/stream';
|
|
6
7
|
import type { JSONSchema7 } from 'json-schema';
|
|
7
8
|
import type { ZodType } from 'zod';
|
|
8
|
-
import type { GenerateLegacyParams, GetAgentResponse,
|
|
9
|
+
import type { GenerateLegacyParams, GetAgentResponse, GetToolResponse, ClientOptions, StreamLegacyParams, UpdateModelParams, UpdateModelInModelListParams, ReorderModelListParams, NetworkStreamParams, StreamParamsBaseWithoutMessages, CloneAgentParams, StoredAgentResponse } from '../types.js';
|
|
9
10
|
import { processMastraNetworkStream, processMastraStream } from '../utils/process-mastra-stream.js';
|
|
10
11
|
import { BaseResource } from './base.js';
|
|
11
12
|
export declare class AgentVoice extends BaseResource {
|
|
@@ -32,21 +33,21 @@ export declare class AgentVoice extends BaseResource {
|
|
|
32
33
|
}>;
|
|
33
34
|
/**
|
|
34
35
|
* Get available speakers for the agent's voice provider
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
36
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
37
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
37
38
|
* @returns Promise containing list of available speakers
|
|
38
39
|
*/
|
|
39
|
-
getSpeakers(
|
|
40
|
+
getSpeakers(requestContext?: RequestContext | Record<string, any>): Promise<Array<{
|
|
40
41
|
voiceId: string;
|
|
41
42
|
[key: string]: any;
|
|
42
43
|
}>>;
|
|
43
44
|
/**
|
|
44
45
|
* Get the listener configuration for the agent's voice provider
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
46
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
47
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
47
48
|
* @returns Promise containing a check if the agent has listening capabilities
|
|
48
49
|
*/
|
|
49
|
-
getListener(
|
|
50
|
+
getListener(requestContext?: RequestContext | Record<string, any>): Promise<{
|
|
50
51
|
enabled: boolean;
|
|
51
52
|
}>;
|
|
52
53
|
}
|
|
@@ -56,10 +57,20 @@ export declare class Agent extends BaseResource {
|
|
|
56
57
|
constructor(options: ClientOptions, agentId: string);
|
|
57
58
|
/**
|
|
58
59
|
* Retrieves details about the agent
|
|
59
|
-
* @param
|
|
60
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
60
61
|
* @returns Promise containing agent details including model and instructions
|
|
61
62
|
*/
|
|
62
|
-
details(
|
|
63
|
+
details(requestContext?: RequestContext | Record<string, any>): Promise<GetAgentResponse>;
|
|
64
|
+
enhanceInstructions(instructions: string, comment: string): Promise<{
|
|
65
|
+
explanation: string;
|
|
66
|
+
new_prompt: string;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Clones this agent to a new stored agent in the database
|
|
70
|
+
* @param params - Clone parameters including optional newId, newName, metadata, authorId, and requestContext
|
|
71
|
+
* @returns Promise containing the created stored agent
|
|
72
|
+
*/
|
|
73
|
+
clone(params?: CloneAgentParams): Promise<StoredAgentResponse>;
|
|
63
74
|
/**
|
|
64
75
|
* Generates a response from the agent
|
|
65
76
|
* @param params - Generation parameters including prompt
|
|
@@ -77,8 +88,10 @@ export declare class Agent extends BaseResource {
|
|
|
77
88
|
output?: never;
|
|
78
89
|
experimental_output: StructuredOutput;
|
|
79
90
|
}): Promise<GenerateReturn<any, undefined, StructuredOutput>>;
|
|
80
|
-
generate
|
|
81
|
-
generate<OUTPUT extends
|
|
91
|
+
generate(messages: MessageListInput, options?: StreamParamsBaseWithoutMessages): Promise<FullOutput<undefined>>;
|
|
92
|
+
generate<OUTPUT extends {}>(messages: MessageListInput, options: StreamParamsBaseWithoutMessages<OUTPUT> & {
|
|
93
|
+
structuredOutput: SerializableStructuredOutputOptions<OUTPUT>;
|
|
94
|
+
}): Promise<FullOutput<OUTPUT>>;
|
|
82
95
|
private processChatResponse;
|
|
83
96
|
/**
|
|
84
97
|
* Streams a response from the agent
|
|
@@ -89,22 +102,70 @@ export declare class Agent extends BaseResource {
|
|
|
89
102
|
processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
|
|
90
103
|
}>;
|
|
91
104
|
private processChatResponse_vNext;
|
|
92
|
-
processStreamResponse(processedParams: any,
|
|
93
|
-
network(params: NetworkStreamParams): Promise<Response & {
|
|
105
|
+
processStreamResponse(processedParams: any, controller: ReadableStreamDefaultController<Uint8Array>, route?: string): Promise<Response>;
|
|
106
|
+
network<OUTPUT>(messages: MessageListInput, params: Omit<NetworkStreamParams<OUTPUT>, 'messages'>): Promise<Response & {
|
|
107
|
+
processDataStream: ({ onChunk, }: {
|
|
108
|
+
onChunk: Parameters<typeof processMastraNetworkStream>[0]['onChunk'];
|
|
109
|
+
}) => Promise<void>;
|
|
110
|
+
}>;
|
|
111
|
+
approveNetworkToolCall(params: {
|
|
112
|
+
runId: string;
|
|
113
|
+
}): Promise<Response & {
|
|
114
|
+
processDataStream: ({ onChunk, }: {
|
|
115
|
+
onChunk: Parameters<typeof processMastraNetworkStream>[0]['onChunk'];
|
|
116
|
+
}) => Promise<void>;
|
|
117
|
+
}>;
|
|
118
|
+
declineNetworkToolCall(params: {
|
|
119
|
+
runId: string;
|
|
120
|
+
}): Promise<Response & {
|
|
94
121
|
processDataStream: ({ onChunk, }: {
|
|
95
122
|
onChunk: Parameters<typeof processMastraNetworkStream>[0]['onChunk'];
|
|
96
123
|
}) => Promise<void>;
|
|
97
124
|
}>;
|
|
98
|
-
stream<OUTPUT extends
|
|
125
|
+
stream<OUTPUT extends {}>(messages: MessageListInput, streamOptions: StreamParamsBaseWithoutMessages<OUTPUT> & {
|
|
126
|
+
structuredOutput: SerializableStructuredOutputOptions<OUTPUT>;
|
|
127
|
+
}): Promise<Response & {
|
|
99
128
|
processDataStream: ({ onChunk, }: {
|
|
100
129
|
onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
|
|
101
130
|
}) => Promise<void>;
|
|
102
131
|
}>;
|
|
103
|
-
stream
|
|
132
|
+
stream(messages: MessageListInput, streamOptions?: StreamParamsBaseWithoutMessages): Promise<Response & {
|
|
133
|
+
processDataStream: ({ onChunk, }: {
|
|
134
|
+
onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
|
|
135
|
+
}) => Promise<void>;
|
|
136
|
+
}>;
|
|
137
|
+
approveToolCall(params: {
|
|
138
|
+
runId: string;
|
|
139
|
+
toolCallId: string;
|
|
140
|
+
}): Promise<Response & {
|
|
141
|
+
processDataStream: ({ onChunk, }: {
|
|
142
|
+
onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
|
|
143
|
+
}) => Promise<void>;
|
|
144
|
+
}>;
|
|
145
|
+
declineToolCall(params: {
|
|
146
|
+
runId: string;
|
|
147
|
+
toolCallId: string;
|
|
148
|
+
}): Promise<Response & {
|
|
104
149
|
processDataStream: ({ onChunk, }: {
|
|
105
150
|
onChunk: Parameters<typeof processMastraStream>[0]['onChunk'];
|
|
106
151
|
}) => Promise<void>;
|
|
107
152
|
}>;
|
|
153
|
+
/**
|
|
154
|
+
* Approves a pending tool call and returns the complete response (non-streaming).
|
|
155
|
+
* Used when `requireToolApproval` is enabled with generate() to allow the agent to proceed.
|
|
156
|
+
*/
|
|
157
|
+
approveToolCallGenerate(params: {
|
|
158
|
+
runId: string;
|
|
159
|
+
toolCallId: string;
|
|
160
|
+
}): Promise<any>;
|
|
161
|
+
/**
|
|
162
|
+
* Declines a pending tool call and returns the complete response (non-streaming).
|
|
163
|
+
* Used when `requireToolApproval` is enabled with generate() to prevent tool execution.
|
|
164
|
+
*/
|
|
165
|
+
declineToolCallGenerate(params: {
|
|
166
|
+
runId: string;
|
|
167
|
+
toolCallId: string;
|
|
168
|
+
}): Promise<any>;
|
|
108
169
|
/**
|
|
109
170
|
* Processes the stream response and handles tool calls
|
|
110
171
|
*/
|
|
@@ -112,10 +173,10 @@ export declare class Agent extends BaseResource {
|
|
|
112
173
|
/**
|
|
113
174
|
* Gets details about a specific tool available to the agent
|
|
114
175
|
* @param toolId - ID of the tool to retrieve
|
|
115
|
-
* @param
|
|
176
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
116
177
|
* @returns Promise containing tool details
|
|
117
178
|
*/
|
|
118
|
-
getTool(toolId: string,
|
|
179
|
+
getTool(toolId: string, requestContext?: RequestContext | Record<string, any>): Promise<GetToolResponse>;
|
|
119
180
|
/**
|
|
120
181
|
* Executes a tool for the agent
|
|
121
182
|
* @param toolId - ID of the tool to execute
|
|
@@ -124,20 +185,8 @@ export declare class Agent extends BaseResource {
|
|
|
124
185
|
*/
|
|
125
186
|
executeTool(toolId: string, params: {
|
|
126
187
|
data: any;
|
|
127
|
-
|
|
188
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
128
189
|
}): Promise<any>;
|
|
129
|
-
/**
|
|
130
|
-
* Retrieves evaluation results for the agent
|
|
131
|
-
* @param runtimeContext - Optional runtime context to pass as query parameter
|
|
132
|
-
* @returns Promise containing agent evaluations
|
|
133
|
-
*/
|
|
134
|
-
evals(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetEvalsByAgentIdResponse>;
|
|
135
|
-
/**
|
|
136
|
-
* Retrieves live evaluation results for the agent
|
|
137
|
-
* @param runtimeContext - Optional runtime context to pass as query parameter
|
|
138
|
-
* @returns Promise containing live agent evaluations
|
|
139
|
-
*/
|
|
140
|
-
liveEvals(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetEvalsByAgentIdResponse>;
|
|
141
190
|
/**
|
|
142
191
|
* Updates the model for the agent
|
|
143
192
|
* @param params - Parameters for updating the model
|
|
@@ -146,6 +195,13 @@ export declare class Agent extends BaseResource {
|
|
|
146
195
|
updateModel(params: UpdateModelParams): Promise<{
|
|
147
196
|
message: string;
|
|
148
197
|
}>;
|
|
198
|
+
/**
|
|
199
|
+
* Resets the agent's model to the original model that was set during construction
|
|
200
|
+
* @returns Promise containing a success message
|
|
201
|
+
*/
|
|
202
|
+
resetModel(): Promise<{
|
|
203
|
+
message: string;
|
|
204
|
+
}>;
|
|
149
205
|
/**
|
|
150
206
|
* Updates the model for the agent in the model list
|
|
151
207
|
* @param params - Parameters for updating the model
|
|
@@ -162,23 +218,5 @@ export declare class Agent extends BaseResource {
|
|
|
162
218
|
reorderModelList(params: ReorderModelListParams): Promise<{
|
|
163
219
|
message: string;
|
|
164
220
|
}>;
|
|
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
|
-
}>;
|
|
183
221
|
}
|
|
184
222
|
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/resources/agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/resources/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAWvE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AAC9E,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,UAAU,EAAqB,MAAM,qBAAqB,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,aAAa,EAEb,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,sBAAsB,EACtB,mBAAmB,EACnB,+BAA+B,EAC/B,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,UAAU,CAAC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CAAC;IAOpE;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAO1C;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE,4BAA4B,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAOhH;;;;OAIG;IACH,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAM/E"}
|
package/dist/resources/base.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { RequestOptions, ClientOptions } from '../types.js';
|
|
2
2
|
export declare class BaseResource {
|
|
3
3
|
readonly options: ClientOptions;
|
|
4
|
+
protected readonly apiPrefix: string;
|
|
4
5
|
constructor(options: ClientOptions);
|
|
5
6
|
/**
|
|
6
7
|
* Makes an HTTP request to the API with retries and exponential backoff
|
|
7
|
-
* @param path - The API endpoint path
|
|
8
|
+
* @param path - The API endpoint path (without prefix, e.g., '/agents')
|
|
8
9
|
* @param options - Optional request configuration
|
|
9
10
|
* @returns Promise containing the response data
|
|
10
11
|
*/
|
|
@@ -1 +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;
|
|
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;AAI9D,qBAAa,YAAY;IACvB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEzB,OAAO,EAAE,aAAa;IAKlC;;;;;OAKG;IACU,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC;CAkFhF"}
|
|
@@ -2,10 +2,19 @@ export * from './agent.js';
|
|
|
2
2
|
export * from './memory-thread.js';
|
|
3
3
|
export * from './vector.js';
|
|
4
4
|
export * from './tool.js';
|
|
5
|
+
export * from './processor.js';
|
|
5
6
|
export * from './base.js';
|
|
6
7
|
export * from './workflow.js';
|
|
7
8
|
export * from './a2a.js';
|
|
8
9
|
export * from './mcp-tool.js';
|
|
9
10
|
export * from './agent-builder.js';
|
|
10
11
|
export * from './observability.js';
|
|
12
|
+
export * from './stored-agent.js';
|
|
13
|
+
export * from './stored-prompt-block.js';
|
|
14
|
+
export * from './stored-mcp-client.js';
|
|
15
|
+
export * from './stored-scorer.js';
|
|
16
|
+
export * from './tool-provider.js';
|
|
17
|
+
export * from './processor-provider.js';
|
|
18
|
+
export * from './workspace.js';
|
|
19
|
+
export * from './stored-skill.js';
|
|
11
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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"}
|
|
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,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RequestContext } from '@mastra/core/request-context';
|
|
2
2
|
import type { ClientOptions, McpToolInfo } from '../types.js';
|
|
3
3
|
import { BaseResource } from './base.js';
|
|
4
4
|
/**
|
|
@@ -11,18 +11,18 @@ 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
|
|
14
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
15
15
|
* @returns Promise containing the tool's information (name, description, schema).
|
|
16
16
|
*/
|
|
17
|
-
details(
|
|
17
|
+
details(requestContext?: RequestContext | Record<string, any>): Promise<McpToolInfo>;
|
|
18
18
|
/**
|
|
19
19
|
* Executes this specific tool on the MCP server.
|
|
20
|
-
* @param params - Parameters for tool execution, including data/args and optional
|
|
20
|
+
* @param params - Parameters for tool execution, including data/args and optional requestContext.
|
|
21
21
|
* @returns Promise containing the result of the tool execution.
|
|
22
22
|
*/
|
|
23
23
|
execute(params: {
|
|
24
24
|
data?: any;
|
|
25
|
-
|
|
25
|
+
requestContext?: RequestContext;
|
|
26
26
|
}): Promise<any>;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=mcp-tool.d.ts.map
|
|
@@ -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;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;
|
|
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;IAMpF;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,GAA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