@mastra/server 0.0.0-separate-trace-data-from-component-20250501042644 → 0.0.0-share-agent-metadata-with-cloud-20250718110128
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/LICENSE.md +11 -42
- package/README.md +48 -135
- package/dist/_tsup-dts-rollup.d.cts +556 -103
- package/dist/_tsup-dts-rollup.d.ts +556 -103
- package/dist/{chunk-FV45V6WC.cjs → chunk-2KZFMI6P.cjs} +1 -7
- package/dist/{chunk-5YGDYMRB.cjs → chunk-2SLFAFTR.cjs} +14 -13
- package/dist/chunk-3CNDE7QY.cjs +308 -0
- package/dist/chunk-4D66QEKC.js +81 -0
- package/dist/{chunk-M3YJLWTU.js → chunk-5PQQ42EZ.js} +68 -57
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/{chunk-M56ECCHK.cjs → chunk-7TP2LX5L.cjs} +20 -19
- package/dist/chunk-B2PAS2IB.cjs +514 -0
- package/dist/{chunk-Y3SV5XK4.js → chunk-BK4XT6EG.js} +105 -16
- package/dist/{chunk-QN4KF3BH.cjs → chunk-CCGRCYWJ.cjs} +2 -2
- package/dist/{chunk-QJ3AHN64.js → chunk-CRCR3ZUK.js} +4 -3
- package/dist/{chunk-D3G23FP3.cjs → chunk-FRVBFMO2.cjs} +24 -22
- package/dist/{chunk-7IWQE76Z.cjs → chunk-G7KH752Y.cjs} +16 -10
- package/dist/chunk-GHC4YV6R.js +504 -0
- package/dist/chunk-H7DMHBKY.js +498 -0
- package/dist/chunk-JMLYCXMK.cjs +332 -0
- package/dist/{chunk-Q6SHQECN.js → chunk-KHZKYUNR.js} +34 -10
- package/dist/{chunk-RBQASTUP.js → chunk-KOHWJYJT.js} +120 -27
- package/dist/{chunk-TRDNDNGQ.js → chunk-LCM566I4.js} +2 -7
- package/dist/chunk-LF7P5PLR.js +14 -0
- package/dist/chunk-LI436ITD.cjs +2042 -0
- package/dist/{chunk-5JNVY6DU.js → chunk-LRCAAFUA.js} +7 -5
- package/dist/chunk-LZ3VJXSO.cjs +278 -0
- package/dist/chunk-MEGCYGBU.js +2039 -0
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/chunk-PZQDCRPV.cjs +16 -0
- package/dist/chunk-QGX47B5D.cjs +86 -0
- package/dist/{chunk-WTHDCRMY.js → chunk-RG473F6Y.js} +12 -6
- package/dist/chunk-RHSWAXKB.cjs +118 -0
- package/dist/{chunk-L7XE5QTW.js → chunk-RSEO4XPX.js} +1 -1
- package/dist/chunk-SDPGVWQJ.cjs +512 -0
- package/dist/{chunk-4JINXASC.js → chunk-WNVFNNWN.js} +5 -4
- package/dist/server/handlers/a2a.cjs +30 -0
- package/dist/server/handlers/a2a.d.cts +6 -0
- package/dist/server/handlers/a2a.d.ts +6 -0
- package/dist/server/handlers/a2a.js +1 -0
- package/dist/server/handlers/agents.cjs +7 -7
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/error.cjs +2 -2
- package/dist/server/handlers/error.js +1 -1
- package/dist/server/handlers/legacyWorkflows.cjs +46 -0
- package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
- package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
- package/dist/server/handlers/legacyWorkflows.js +1 -0
- package/dist/server/handlers/logs.cjs +4 -4
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +17 -9
- package/dist/server/handlers/memory.d.cts +2 -0
- package/dist/server/handlers/memory.d.ts +2 -0
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/network.cjs +5 -5
- package/dist/server/handlers/network.js +1 -1
- package/dist/server/handlers/telemetry.cjs +3 -3
- package/dist/server/handlers/telemetry.js +1 -1
- package/dist/server/handlers/tools.cjs +5 -5
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +2 -2
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/vNextNetwork.cjs +218 -0
- package/dist/server/handlers/vNextNetwork.d.cts +6 -0
- package/dist/server/handlers/vNextNetwork.d.ts +6 -0
- package/dist/server/handlers/vNextNetwork.js +211 -0
- package/dist/server/handlers/vector.cjs +7 -7
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -4
- package/dist/server/handlers/voice.d.cts +1 -0
- package/dist/server/handlers/voice.d.ts +1 -0
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +29 -13
- package/dist/server/handlers/workflows.d.cts +6 -2
- package/dist/server/handlers/workflows.d.ts +6 -2
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +32 -27
- package/dist/server/handlers.d.cts +2 -1
- package/dist/server/handlers.d.ts +2 -1
- package/dist/server/handlers.js +11 -10
- package/package.json +15 -14
- package/dist/chunk-2FJURXCL.cjs +0 -213
- package/dist/chunk-3AHQ5RGN.js +0 -11
- package/dist/chunk-3EJZQ6TQ.js +0 -49
- package/dist/chunk-4BIX6GMY.cjs +0 -189
- package/dist/chunk-55HTWX4C.cjs +0 -93
- package/dist/chunk-5SWCVTNL.cjs +0 -5579
- package/dist/chunk-AELYAUEE.cjs +0 -316
- package/dist/chunk-EVCC233P.cjs +0 -321
- package/dist/chunk-JPB6RPGB.js +0 -304
- package/dist/chunk-OMN3UI6X.js +0 -5576
- package/dist/chunk-SKBVVI24.cjs +0 -54
- package/dist/chunk-ZLBRQFDD.cjs +0 -13
- package/dist/server/handlers/vNextWorkflows.cjs +0 -46
- package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
- package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
- package/dist/server/handlers/vNextWorkflows.js +0 -1
|
@@ -1,35 +1,76 @@
|
|
|
1
1
|
import type { Agent } from '@mastra/core/agent';
|
|
2
|
+
import type { AgentCard } from '@mastra/core/a2a';
|
|
2
3
|
import type { AgentNetwork } from '@mastra/core/network';
|
|
4
|
+
import type { Artifact } from '@mastra/core/a2a';
|
|
3
5
|
import type { BaseLogMessage } from '@mastra/core/logger';
|
|
4
6
|
import { CoreMessage } from 'ai';
|
|
5
|
-
import {
|
|
7
|
+
import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
|
|
8
|
+
import { DefaultEngineType } from '@mastra/core';
|
|
9
|
+
import { EvalRow } from '@mastra/core';
|
|
6
10
|
import { GenerateObjectResult } from 'ai';
|
|
7
11
|
import { GenerateTextResult } from 'ai';
|
|
12
|
+
import type { IMastraLogger } from '@mastra/core/logger';
|
|
13
|
+
import type { JSONRPCError } from '@mastra/core/a2a';
|
|
14
|
+
import { JSONRPCResponse } from '@mastra/core/a2a';
|
|
15
|
+
import { LegacyStep } from '@mastra/core/workflows/legacy';
|
|
16
|
+
import type { LegacyWorkflow } from '@mastra/core/workflows/legacy';
|
|
17
|
+
import { LegacyWorkflowRunResult } from '@mastra/core/workflows/legacy';
|
|
18
|
+
import type { LegacyWorkflowRuns } from '@mastra/core/storage';
|
|
19
|
+
import type { LogLevel } from '@mastra/core/logger';
|
|
8
20
|
import type { Mastra } from '@mastra/core/mastra';
|
|
21
|
+
import type { MastraError } from '@mastra/core/error';
|
|
9
22
|
import type { MastraMemory } from '@mastra/core/memory';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { NewStep } from '@mastra/core/workflows/vNext';
|
|
13
|
-
import type { NewWorkflow } from '@mastra/core/workflows/vNext';
|
|
23
|
+
import { MastraMessageV1 } from '@mastra/core';
|
|
24
|
+
import type { Message } from '@mastra/core/a2a';
|
|
14
25
|
import type { QueryResult } from '@mastra/core/vector';
|
|
15
26
|
import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
16
|
-
import
|
|
27
|
+
import { ReadableStream as ReadableStream_3 } from 'stream/web';
|
|
28
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
17
29
|
import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
|
|
18
|
-
import { SerializedStepFlowEntry } from '@mastra/core/workflows
|
|
19
|
-
import { Step } from '@mastra/core
|
|
20
|
-
import { StepExecutionContext } from '@mastra/core/workflows';
|
|
21
|
-
import { StepGraph } from '@mastra/core/workflows';
|
|
22
|
-
import {
|
|
30
|
+
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
31
|
+
import { Step } from '@mastra/core';
|
|
32
|
+
import { StepExecutionContext } from '@mastra/core/workflows/legacy';
|
|
33
|
+
import { StepGraph } from '@mastra/core/workflows/legacy';
|
|
34
|
+
import { StepResult } from '@mastra/core';
|
|
35
|
+
import { StorageThreadType } from '@mastra/core';
|
|
36
|
+
import { StreamEvent } from '@mastra/core';
|
|
37
|
+
import { Task } from '@mastra/core/a2a';
|
|
38
|
+
import { TaskAndHistory } from '@mastra/core/a2a';
|
|
39
|
+
import type { TaskContext } from '@mastra/core/a2a';
|
|
40
|
+
import type { TaskIdParams } from '@mastra/core/a2a';
|
|
41
|
+
import type { TaskQueryParams } from '@mastra/core/a2a';
|
|
42
|
+
import type { TaskSendParams } from '@mastra/core/a2a';
|
|
43
|
+
import type { TaskStatus } from '@mastra/core/a2a';
|
|
23
44
|
import type { ToolAction } from '@mastra/core/tools';
|
|
45
|
+
import { UIMessage } from 'ai';
|
|
24
46
|
import type { VercelTool } from '@mastra/core/tools';
|
|
47
|
+
import type { WatchEvent } from '@mastra/core/workflows';
|
|
25
48
|
import type { Workflow } from '@mastra/core/workflows';
|
|
26
|
-
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
|
|
27
|
-
import { WorkflowResult } from '@mastra/core
|
|
28
|
-
import { WorkflowRunResult } from '@mastra/core/workflows';
|
|
49
|
+
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
|
|
50
|
+
import { WorkflowResult } from '@mastra/core';
|
|
29
51
|
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
52
|
+
import { WorkingMemoryTemplate } from '@mastra/core';
|
|
53
|
+
import { ZodBoolean } from 'zod';
|
|
54
|
+
import { ZodEnum } from 'zod';
|
|
55
|
+
import { ZodNumber } from 'zod';
|
|
56
|
+
import { ZodObject } from 'zod';
|
|
57
|
+
import { ZodOptional } from 'zod';
|
|
58
|
+
import { ZodString } from 'zod';
|
|
30
59
|
import { ZodType } from 'zod';
|
|
60
|
+
import { ZodTypeAny } from 'zod';
|
|
31
61
|
import { ZodTypeDef } from 'zod';
|
|
32
62
|
|
|
63
|
+
export declare namespace a2a {
|
|
64
|
+
export {
|
|
65
|
+
getAgentCardByIdHandler,
|
|
66
|
+
handleTaskSend,
|
|
67
|
+
handleTaskGet,
|
|
68
|
+
handleTaskSendSubscribe,
|
|
69
|
+
handleTaskCancel,
|
|
70
|
+
getAgentExecutionHandler
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
33
74
|
export declare namespace agents {
|
|
34
75
|
export {
|
|
35
76
|
getAgentsHandler,
|
|
@@ -41,17 +82,27 @@ export declare namespace agents {
|
|
|
41
82
|
}
|
|
42
83
|
}
|
|
43
84
|
|
|
44
|
-
export declare interface ApiError extends
|
|
85
|
+
export declare interface ApiError extends MastraError {
|
|
45
86
|
message: string;
|
|
46
87
|
status?: number;
|
|
47
88
|
}
|
|
48
89
|
|
|
90
|
+
export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
|
|
91
|
+
|
|
92
|
+
export declare function cancelWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
93
|
+
message: string;
|
|
94
|
+
}>;
|
|
95
|
+
|
|
49
96
|
declare type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
|
|
50
97
|
|
|
51
98
|
export declare interface Context {
|
|
52
99
|
mastra: Mastra;
|
|
53
100
|
}
|
|
54
101
|
|
|
102
|
+
export declare function convertToCoreMessage(message: Message): CoreMessage_2;
|
|
103
|
+
|
|
104
|
+
export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
|
|
105
|
+
|
|
55
106
|
export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
56
107
|
index: CreateIndexRequest;
|
|
57
108
|
}): Promise<{
|
|
@@ -64,17 +115,26 @@ declare interface CreateIndexRequest {
|
|
|
64
115
|
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
65
116
|
}
|
|
66
117
|
|
|
67
|
-
export declare function
|
|
118
|
+
export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
68
119
|
runId: string;
|
|
69
120
|
}>;
|
|
70
121
|
|
|
71
|
-
export declare function
|
|
122
|
+
export declare function createSuccessResponse<T>(id: number | string | null, result: T): JSONRPCResponse<T>;
|
|
123
|
+
|
|
124
|
+
export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
|
|
125
|
+
task: Task;
|
|
126
|
+
userMessage: Message;
|
|
127
|
+
history: Message[];
|
|
128
|
+
activeCancellations: Set<string>;
|
|
129
|
+
}): TaskContext;
|
|
130
|
+
|
|
131
|
+
export declare function createThreadHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
72
132
|
body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
|
|
73
133
|
resourceId?: string;
|
|
74
134
|
};
|
|
75
135
|
}): Promise<StorageThreadType>;
|
|
76
136
|
|
|
77
|
-
export declare function
|
|
137
|
+
export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
78
138
|
runId: string;
|
|
79
139
|
}>;
|
|
80
140
|
|
|
@@ -84,7 +144,7 @@ export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<Vec
|
|
|
84
144
|
success: boolean;
|
|
85
145
|
}>;
|
|
86
146
|
|
|
87
|
-
export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
|
|
147
|
+
export declare function deleteThreadHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
88
148
|
result: string;
|
|
89
149
|
}>;
|
|
90
150
|
|
|
@@ -101,21 +161,23 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
|
|
|
101
161
|
export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
|
|
102
162
|
agentId?: string;
|
|
103
163
|
data: any;
|
|
104
|
-
runtimeContext:
|
|
164
|
+
runtimeContext: RuntimeContext_2;
|
|
105
165
|
}): Promise<any>;
|
|
106
166
|
|
|
107
167
|
export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
|
|
108
168
|
data?: unknown;
|
|
109
|
-
runtimeContext:
|
|
169
|
+
runtimeContext: RuntimeContext_2;
|
|
110
170
|
}) => Promise<any>;
|
|
111
171
|
|
|
112
|
-
export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
172
|
+
export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
113
173
|
runtimeContext: RuntimeContext;
|
|
114
174
|
agentId: string;
|
|
115
175
|
body: GetBody<'generate'> & {
|
|
116
176
|
resourceid?: string;
|
|
177
|
+
runtimeContext?: Record<string, unknown>;
|
|
117
178
|
};
|
|
118
|
-
|
|
179
|
+
abortSignal?: AbortSignal;
|
|
180
|
+
}): Promise<GenerateTextResult<any, unknown>>;
|
|
119
181
|
|
|
120
182
|
export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
|
|
121
183
|
runtimeContext: RuntimeContext;
|
|
@@ -134,21 +196,70 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
|
|
|
134
196
|
};
|
|
135
197
|
}): Promise<NodeJS.ReadableStream>;
|
|
136
198
|
|
|
137
|
-
export declare function
|
|
199
|
+
export declare function generateVNextNetworkHandler({ mastra, runtimeContext, networkId, body, }: NetworkContext_2 & {
|
|
200
|
+
runtimeContext: RuntimeContext;
|
|
201
|
+
body: {
|
|
202
|
+
message: string;
|
|
203
|
+
threadId?: string;
|
|
204
|
+
resourceId?: string;
|
|
205
|
+
};
|
|
206
|
+
}): Promise<{
|
|
207
|
+
task: string;
|
|
208
|
+
result: string;
|
|
209
|
+
resourceId: string;
|
|
210
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
211
|
+
}>;
|
|
212
|
+
|
|
213
|
+
export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, isPlayground, }: Context & {
|
|
214
|
+
isPlayground?: boolean;
|
|
138
215
|
runtimeContext: RuntimeContext;
|
|
139
216
|
agentId: string;
|
|
140
217
|
}): Promise<{
|
|
141
218
|
name: any;
|
|
142
219
|
instructions: string;
|
|
143
220
|
tools: any;
|
|
221
|
+
workflows: {};
|
|
144
222
|
provider: string;
|
|
145
223
|
modelId: string;
|
|
224
|
+
defaultGenerateOptions: any;
|
|
225
|
+
defaultStreamOptions: any;
|
|
146
226
|
}>;
|
|
147
227
|
|
|
148
|
-
export declare function
|
|
228
|
+
export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
|
|
229
|
+
runtimeContext: RuntimeContext;
|
|
230
|
+
agentId: keyof ReturnType<typeof mastra.getAgents>;
|
|
231
|
+
executionUrl?: string;
|
|
232
|
+
version?: string;
|
|
233
|
+
provider?: {
|
|
234
|
+
organization: string;
|
|
235
|
+
url: string;
|
|
236
|
+
};
|
|
237
|
+
}): Promise<AgentCard>;
|
|
238
|
+
|
|
239
|
+
export declare function getAgentExecutionHandler({ requestId, mastra, agentId, runtimeContext, method, params, taskStore, logger, }: Context & {
|
|
240
|
+
requestId: string;
|
|
149
241
|
runtimeContext: RuntimeContext;
|
|
242
|
+
agentId: string;
|
|
243
|
+
method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
|
|
244
|
+
params: TaskSendParams | TaskQueryParams | TaskIdParams;
|
|
245
|
+
taskStore?: InMemoryTaskStore;
|
|
246
|
+
logger?: IMastraLogger;
|
|
150
247
|
}): Promise<any>;
|
|
151
248
|
|
|
249
|
+
export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
|
|
250
|
+
runtimeContext: RuntimeContext;
|
|
251
|
+
}): Promise<Record<string, Omit<{
|
|
252
|
+
id: string;
|
|
253
|
+
name: any;
|
|
254
|
+
instructions: string;
|
|
255
|
+
tools: any;
|
|
256
|
+
workflows: {};
|
|
257
|
+
provider: string;
|
|
258
|
+
modelId: string;
|
|
259
|
+
defaultGenerateOptions: any;
|
|
260
|
+
defaultStreamOptions: any;
|
|
261
|
+
}, "id">>>;
|
|
262
|
+
|
|
152
263
|
declare type GetBody<T extends keyof Agent & {
|
|
153
264
|
[K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
|
|
154
265
|
}[keyof Agent]> = {
|
|
@@ -165,6 +276,35 @@ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agent
|
|
|
165
276
|
evals: EvalRow[];
|
|
166
277
|
}>;
|
|
167
278
|
|
|
279
|
+
export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
|
|
280
|
+
stepGraph: StepGraph;
|
|
281
|
+
stepSubscriberGraph: Record<string, StepGraph>;
|
|
282
|
+
serializedStepGraph: StepGraph;
|
|
283
|
+
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
284
|
+
name: string;
|
|
285
|
+
triggerSchema: string | undefined;
|
|
286
|
+
steps: any;
|
|
287
|
+
}>;
|
|
288
|
+
|
|
289
|
+
export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
|
|
290
|
+
|
|
291
|
+
export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
|
|
292
|
+
fromDate?: Date;
|
|
293
|
+
toDate?: Date;
|
|
294
|
+
limit?: number;
|
|
295
|
+
offset?: number;
|
|
296
|
+
resourceId?: string;
|
|
297
|
+
}): Promise<LegacyWorkflowRuns>;
|
|
298
|
+
|
|
299
|
+
export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Get available listeners for an agent
|
|
303
|
+
*/
|
|
304
|
+
export declare function getListenerHandler({ mastra, agentId }: VoiceContext): Promise<{
|
|
305
|
+
enabled: boolean;
|
|
306
|
+
}>;
|
|
307
|
+
|
|
168
308
|
export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
|
|
169
309
|
runtimeContext: RuntimeContext;
|
|
170
310
|
agentId: string;
|
|
@@ -175,21 +315,35 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, a
|
|
|
175
315
|
evals: EvalRow[];
|
|
176
316
|
}>;
|
|
177
317
|
|
|
178
|
-
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<
|
|
318
|
+
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, params, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId' | 'params'>): Promise<{
|
|
319
|
+
logs: BaseLogMessage[];
|
|
320
|
+
total: number;
|
|
321
|
+
page: number;
|
|
322
|
+
perPage: number;
|
|
323
|
+
hasMore: boolean;
|
|
324
|
+
}>;
|
|
179
325
|
|
|
180
|
-
export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<
|
|
326
|
+
export declare function getLogsHandler({ mastra, transportId, params, }: Pick<LogsContext, 'mastra' | 'transportId' | 'params'>): Promise<{
|
|
327
|
+
logs: BaseLogMessage[];
|
|
328
|
+
total: number;
|
|
329
|
+
page: number;
|
|
330
|
+
perPage: number;
|
|
331
|
+
hasMore: boolean;
|
|
332
|
+
}>;
|
|
181
333
|
|
|
182
334
|
export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
|
|
183
335
|
transports: string[];
|
|
184
336
|
}>;
|
|
185
337
|
|
|
186
|
-
export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
|
|
338
|
+
export declare function getMemoryStatusHandler({ mastra, agentId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
187
339
|
result: boolean;
|
|
188
340
|
}>;
|
|
189
341
|
|
|
190
|
-
export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>
|
|
342
|
+
export declare function getMessagesHandler({ mastra, agentId, threadId, limit, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
343
|
+
limit?: number;
|
|
344
|
+
}): Promise<{
|
|
191
345
|
messages: CoreMessage[];
|
|
192
|
-
uiMessages:
|
|
346
|
+
uiMessages: UIMessage[];
|
|
193
347
|
}>;
|
|
194
348
|
|
|
195
349
|
export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
@@ -231,45 +385,148 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
|
|
|
231
385
|
|
|
232
386
|
export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
|
|
233
387
|
|
|
234
|
-
export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
|
|
388
|
+
export declare function getThreadByIdHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType>;
|
|
235
389
|
|
|
236
|
-
export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
|
|
390
|
+
export declare function getThreadsHandler({ mastra, agentId, resourceId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType[]>;
|
|
237
391
|
|
|
238
392
|
export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
|
|
239
393
|
|
|
240
394
|
export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
|
|
241
395
|
|
|
242
|
-
export declare function
|
|
243
|
-
|
|
396
|
+
export declare function getVNextNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
397
|
+
id: string;
|
|
398
|
+
name: string;
|
|
399
|
+
instructions: string;
|
|
400
|
+
agents: {
|
|
401
|
+
name: string;
|
|
402
|
+
provider: string;
|
|
403
|
+
modelId: string;
|
|
404
|
+
}[];
|
|
405
|
+
workflows: {
|
|
406
|
+
name: string | undefined;
|
|
407
|
+
description: string | undefined;
|
|
408
|
+
inputSchema: string | undefined;
|
|
409
|
+
outputSchema: string | undefined;
|
|
410
|
+
}[];
|
|
411
|
+
tools: {
|
|
412
|
+
id: string;
|
|
413
|
+
description: string;
|
|
414
|
+
}[];
|
|
415
|
+
routingModel: {
|
|
416
|
+
provider: string;
|
|
417
|
+
modelId: string;
|
|
418
|
+
};
|
|
419
|
+
}>;
|
|
420
|
+
|
|
421
|
+
export declare function getVNextNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'runtimeContext'>): Promise<{
|
|
422
|
+
id: string;
|
|
423
|
+
name: string;
|
|
424
|
+
instructions: string;
|
|
425
|
+
tools: {
|
|
426
|
+
id: string;
|
|
427
|
+
description: string;
|
|
428
|
+
}[];
|
|
429
|
+
agents: {
|
|
430
|
+
name: string;
|
|
431
|
+
provider: string;
|
|
432
|
+
modelId: string;
|
|
433
|
+
}[];
|
|
434
|
+
workflows: {
|
|
435
|
+
name: string | undefined;
|
|
436
|
+
description: string | undefined;
|
|
437
|
+
inputSchema: string | undefined;
|
|
438
|
+
outputSchema: string | undefined;
|
|
439
|
+
}[];
|
|
440
|
+
routingModel: {
|
|
441
|
+
provider: string;
|
|
442
|
+
modelId: string;
|
|
443
|
+
};
|
|
444
|
+
}[]>;
|
|
445
|
+
|
|
446
|
+
export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
|
|
447
|
+
steps: Record<string, SerializedStep>;
|
|
448
|
+
allSteps: Record<string, SerializedStep>;
|
|
244
449
|
name: string | undefined;
|
|
450
|
+
description: string | undefined;
|
|
245
451
|
stepGraph: SerializedStepFlowEntry[];
|
|
246
452
|
inputSchema: string | undefined;
|
|
247
453
|
outputSchema: string | undefined;
|
|
248
454
|
}>;
|
|
249
455
|
|
|
250
|
-
export declare function
|
|
456
|
+
export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
|
|
251
457
|
|
|
252
|
-
export declare function
|
|
458
|
+
export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
|
|
253
459
|
|
|
254
|
-
export declare function
|
|
460
|
+
export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
|
|
461
|
+
fromDate?: Date;
|
|
462
|
+
toDate?: Date;
|
|
463
|
+
limit?: number;
|
|
464
|
+
offset?: number;
|
|
465
|
+
resourceId?: string;
|
|
466
|
+
}): Promise<WorkflowRuns>;
|
|
255
467
|
|
|
256
|
-
export declare function
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
468
|
+
export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Handler to get the working memory for a thread (optionally resource-scoped).
|
|
472
|
+
* @returns workingMemory - the working memory for the thread
|
|
473
|
+
* @returns source - thread or resource
|
|
474
|
+
*/
|
|
475
|
+
export declare function getWorkingMemoryHandler({ mastra, agentId, threadId, resourceId, networkId, runtimeContext, memoryConfig, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
476
|
+
resourceId?: Parameters<MastraMemory['getWorkingMemory']>[0]['resourceId'];
|
|
477
|
+
memoryConfig?: Parameters<MastraMemory['getWorkingMemory']>[0]['memoryConfig'];
|
|
478
|
+
}): Promise<{
|
|
479
|
+
workingMemory: string | null;
|
|
480
|
+
source: string;
|
|
481
|
+
workingMemoryTemplate: WorkingMemoryTemplate | null;
|
|
482
|
+
threadExists: boolean;
|
|
264
483
|
}>;
|
|
265
484
|
|
|
266
|
-
export declare function
|
|
485
|
+
export declare function handleError(error: unknown, defaultMessage: string): never;
|
|
267
486
|
|
|
268
|
-
export declare function
|
|
487
|
+
export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId, logger, }: {
|
|
488
|
+
requestId: string;
|
|
489
|
+
taskStore: InMemoryTaskStore;
|
|
490
|
+
agentId: string;
|
|
491
|
+
taskId: string;
|
|
492
|
+
logger?: IMastraLogger;
|
|
493
|
+
}): Promise<JSONRPCResponse<Task, unknown>>;
|
|
269
494
|
|
|
270
|
-
export declare function
|
|
495
|
+
export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
|
|
496
|
+
requestId: string;
|
|
497
|
+
taskStore: InMemoryTaskStore;
|
|
498
|
+
agentId: string;
|
|
499
|
+
taskId: string;
|
|
500
|
+
}): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
|
|
501
|
+
|
|
502
|
+
export declare function handleTaskSend({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
|
|
503
|
+
requestId: string;
|
|
504
|
+
params: TaskSendParams;
|
|
505
|
+
taskStore: InMemoryTaskStore;
|
|
506
|
+
agent: Agent;
|
|
507
|
+
agentId: string;
|
|
508
|
+
logger?: IMastraLogger;
|
|
509
|
+
runtimeContext: RuntimeContext;
|
|
510
|
+
}): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
|
|
271
511
|
|
|
272
|
-
export declare function
|
|
512
|
+
export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
|
|
513
|
+
requestId: string;
|
|
514
|
+
params: TaskSendParams;
|
|
515
|
+
taskStore: InMemoryTaskStore;
|
|
516
|
+
agent: Agent;
|
|
517
|
+
agentId: string;
|
|
518
|
+
logger?: IMastraLogger;
|
|
519
|
+
runtimeContext: RuntimeContext;
|
|
520
|
+
}): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
|
|
521
|
+
state: string;
|
|
522
|
+
message: {
|
|
523
|
+
role: string;
|
|
524
|
+
parts: {
|
|
525
|
+
type: string;
|
|
526
|
+
text: string;
|
|
527
|
+
}[];
|
|
528
|
+
};
|
|
529
|
+
}, unknown>, void, unknown>;
|
|
273
530
|
|
|
274
531
|
/**
|
|
275
532
|
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
@@ -319,11 +576,13 @@ export declare class HTTPException extends Error {
|
|
|
319
576
|
* @property res - Optional response object to use.
|
|
320
577
|
* @property message - Optional custom error message.
|
|
321
578
|
* @property cause - Optional cause of the error.
|
|
579
|
+
* @property stack - Optional stack trace for the error.
|
|
322
580
|
*/
|
|
323
581
|
declare type HTTPExceptionOptions = {
|
|
324
582
|
res?: Response;
|
|
325
583
|
message?: string;
|
|
326
584
|
cause?: unknown;
|
|
585
|
+
stack?: string;
|
|
327
586
|
};
|
|
328
587
|
|
|
329
588
|
/**
|
|
@@ -332,8 +591,46 @@ declare type HTTPExceptionOptions = {
|
|
|
332
591
|
*/
|
|
333
592
|
declare type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
334
593
|
|
|
594
|
+
export declare class InMemoryTaskStore {
|
|
595
|
+
private store;
|
|
596
|
+
activeCancellations: Set<string>;
|
|
597
|
+
load({ agentId, taskId }: {
|
|
598
|
+
agentId: string;
|
|
599
|
+
taskId: string;
|
|
600
|
+
}): Promise<TaskAndHistory | null>;
|
|
601
|
+
save({ agentId, data }: {
|
|
602
|
+
agentId: string;
|
|
603
|
+
data: TaskAndHistory;
|
|
604
|
+
}): Promise<void>;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export declare namespace legacyWorkflows {
|
|
608
|
+
export {
|
|
609
|
+
getLegacyWorkflowsHandler,
|
|
610
|
+
getLegacyWorkflowByIdHandler,
|
|
611
|
+
startAsyncLegacyWorkflowHandler,
|
|
612
|
+
getLegacyWorkflowRunHandler,
|
|
613
|
+
createLegacyWorkflowRunHandler,
|
|
614
|
+
startLegacyWorkflowRunHandler,
|
|
615
|
+
watchLegacyWorkflowHandler,
|
|
616
|
+
resumeAsyncLegacyWorkflowHandler,
|
|
617
|
+
resumeLegacyWorkflowHandler,
|
|
618
|
+
getLegacyWorkflowRunsHandler
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
335
622
|
export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
|
|
336
623
|
|
|
624
|
+
export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
|
|
625
|
+
agentId: string;
|
|
626
|
+
taskId: string;
|
|
627
|
+
taskStore: InMemoryTaskStore;
|
|
628
|
+
message: Message;
|
|
629
|
+
sessionId?: string | null;
|
|
630
|
+
metadata?: Record<string, unknown> | null;
|
|
631
|
+
logger?: IMastraLogger;
|
|
632
|
+
}): Promise<TaskAndHistory>;
|
|
633
|
+
|
|
337
634
|
export declare namespace logs {
|
|
338
635
|
export {
|
|
339
636
|
getLogsHandler,
|
|
@@ -346,8 +643,72 @@ declare type LogsContext = {
|
|
|
346
643
|
mastra: Mastra;
|
|
347
644
|
transportId?: string;
|
|
348
645
|
runId?: string;
|
|
646
|
+
params?: {
|
|
647
|
+
fromDate?: Date;
|
|
648
|
+
toDate?: Date;
|
|
649
|
+
logLevel?: LogLevel;
|
|
650
|
+
filters?: string | string[];
|
|
651
|
+
page?: number;
|
|
652
|
+
perPage?: number;
|
|
653
|
+
};
|
|
349
654
|
};
|
|
350
655
|
|
|
656
|
+
export declare function loopStreamVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
657
|
+
runtimeContext: RuntimeContext;
|
|
658
|
+
body: {
|
|
659
|
+
message: string;
|
|
660
|
+
threadId?: string;
|
|
661
|
+
resourceId?: string;
|
|
662
|
+
maxIterations?: number;
|
|
663
|
+
};
|
|
664
|
+
}): Promise<{
|
|
665
|
+
stream: ReadableStream_3<StreamEvent>;
|
|
666
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
|
|
667
|
+
task: ZodString;
|
|
668
|
+
resourceId: ZodString;
|
|
669
|
+
resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
|
|
670
|
+
prompt: ZodString;
|
|
671
|
+
result: ZodString;
|
|
672
|
+
isComplete: ZodOptional<ZodBoolean>;
|
|
673
|
+
completionReason: ZodOptional<ZodString>;
|
|
674
|
+
iteration: ZodNumber;
|
|
675
|
+
}, "strip", ZodTypeAny, {
|
|
676
|
+
prompt: string;
|
|
677
|
+
resourceId: string;
|
|
678
|
+
result: string;
|
|
679
|
+
task: string;
|
|
680
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
681
|
+
iteration: number;
|
|
682
|
+
isComplete?: boolean | undefined;
|
|
683
|
+
completionReason?: string | undefined;
|
|
684
|
+
}, {
|
|
685
|
+
prompt: string;
|
|
686
|
+
resourceId: string;
|
|
687
|
+
result: string;
|
|
688
|
+
task: string;
|
|
689
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
690
|
+
iteration: number;
|
|
691
|
+
isComplete?: boolean | undefined;
|
|
692
|
+
completionReason?: string | undefined;
|
|
693
|
+
}>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
|
|
694
|
+
}>;
|
|
695
|
+
|
|
696
|
+
export declare function loopVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
697
|
+
runtimeContext: RuntimeContext;
|
|
698
|
+
body: {
|
|
699
|
+
message: string;
|
|
700
|
+
};
|
|
701
|
+
}): Promise<{
|
|
702
|
+
status: "success";
|
|
703
|
+
result: {
|
|
704
|
+
text: string;
|
|
705
|
+
iteration: number;
|
|
706
|
+
};
|
|
707
|
+
steps: {
|
|
708
|
+
[x: string]: StepResult<any, any, any, any> | StepResult<unknown, unknown, unknown, unknown>;
|
|
709
|
+
};
|
|
710
|
+
}>;
|
|
711
|
+
|
|
351
712
|
export declare namespace memory {
|
|
352
713
|
export {
|
|
353
714
|
getMemoryStatusHandler,
|
|
@@ -357,7 +718,9 @@ export declare namespace memory {
|
|
|
357
718
|
createThreadHandler,
|
|
358
719
|
updateThreadHandler,
|
|
359
720
|
deleteThreadHandler,
|
|
360
|
-
getMessagesHandler
|
|
721
|
+
getMessagesHandler,
|
|
722
|
+
getWorkingMemoryHandler,
|
|
723
|
+
updateWorkingMemoryHandler
|
|
361
724
|
}
|
|
362
725
|
}
|
|
363
726
|
|
|
@@ -365,6 +728,8 @@ declare interface MemoryContext extends Context {
|
|
|
365
728
|
agentId?: string;
|
|
366
729
|
resourceId?: string;
|
|
367
730
|
threadId?: string;
|
|
731
|
+
networkId?: string;
|
|
732
|
+
runtimeContext?: RuntimeContext_2;
|
|
368
733
|
}
|
|
369
734
|
|
|
370
735
|
export declare namespace network {
|
|
@@ -381,6 +746,13 @@ declare interface NetworkContext extends Context {
|
|
|
381
746
|
runtimeContext: RuntimeContext;
|
|
382
747
|
}
|
|
383
748
|
|
|
749
|
+
declare interface NetworkContext_2 extends Context {
|
|
750
|
+
networkId?: string;
|
|
751
|
+
runtimeContext: RuntimeContext;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
|
|
755
|
+
|
|
384
756
|
declare interface QueryRequest {
|
|
385
757
|
indexName: string;
|
|
386
758
|
queryVector: number[];
|
|
@@ -395,23 +767,33 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
|
|
|
395
767
|
|
|
396
768
|
declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
397
769
|
|
|
398
|
-
export declare function
|
|
770
|
+
export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
771
|
+
body: {
|
|
772
|
+
stepId: string;
|
|
773
|
+
context: any;
|
|
774
|
+
};
|
|
775
|
+
runtimeContext: RuntimeContext;
|
|
776
|
+
}): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
|
|
777
|
+
|
|
778
|
+
export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
399
779
|
body: {
|
|
400
780
|
step: string | string[];
|
|
401
781
|
resumeData?: unknown;
|
|
402
782
|
};
|
|
403
783
|
runtimeContext?: RuntimeContext_2;
|
|
404
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>,
|
|
784
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
405
785
|
|
|
406
|
-
export declare function
|
|
786
|
+
export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
407
787
|
body: {
|
|
408
788
|
stepId: string;
|
|
409
789
|
context: any;
|
|
410
790
|
};
|
|
411
791
|
runtimeContext: RuntimeContext;
|
|
412
|
-
}): Promise<
|
|
792
|
+
}): Promise<{
|
|
793
|
+
message: string;
|
|
794
|
+
}>;
|
|
413
795
|
|
|
414
|
-
export declare function
|
|
796
|
+
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
415
797
|
body: {
|
|
416
798
|
step: string | string[];
|
|
417
799
|
resumeData?: unknown;
|
|
@@ -421,44 +803,50 @@ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId,
|
|
|
421
803
|
message: string;
|
|
422
804
|
}>;
|
|
423
805
|
|
|
424
|
-
export declare function
|
|
806
|
+
export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
425
807
|
body: {
|
|
426
|
-
|
|
427
|
-
context: any;
|
|
808
|
+
messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
|
|
428
809
|
};
|
|
429
|
-
|
|
810
|
+
}): Promise<MastraMessageV1[]>;
|
|
811
|
+
|
|
812
|
+
export declare function sendWorkflowRunEventHandler({ mastra, workflowId, runId, event, data, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
813
|
+
event: string;
|
|
814
|
+
data: unknown;
|
|
430
815
|
}): Promise<{
|
|
431
816
|
message: string;
|
|
432
817
|
}>;
|
|
433
818
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
819
|
+
declare type SerializedStep = {
|
|
820
|
+
id: string;
|
|
821
|
+
description: string;
|
|
822
|
+
inputSchema: string | undefined;
|
|
823
|
+
outputSchema: string | undefined;
|
|
824
|
+
resumeSchema: string | undefined;
|
|
825
|
+
suspendSchema: string | undefined;
|
|
826
|
+
};
|
|
439
827
|
|
|
440
828
|
declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
441
829
|
|
|
442
|
-
export declare function
|
|
443
|
-
inputData?: unknown;
|
|
444
|
-
runtimeContext?: RuntimeContext_2;
|
|
445
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
|
|
446
|
-
|
|
447
|
-
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
830
|
+
export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
448
831
|
triggerData?: unknown;
|
|
449
832
|
runtimeContext: RuntimeContext;
|
|
450
|
-
}): Promise<
|
|
833
|
+
}): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
|
|
451
834
|
|
|
452
|
-
export declare function
|
|
835
|
+
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
453
836
|
inputData?: unknown;
|
|
454
837
|
runtimeContext?: RuntimeContext_2;
|
|
838
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
839
|
+
|
|
840
|
+
export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
841
|
+
triggerData?: unknown;
|
|
842
|
+
runtimeContext: RuntimeContext;
|
|
455
843
|
}): Promise<{
|
|
456
844
|
message: string;
|
|
457
845
|
}>;
|
|
458
846
|
|
|
459
|
-
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId,
|
|
460
|
-
|
|
461
|
-
runtimeContext
|
|
847
|
+
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
848
|
+
inputData?: unknown;
|
|
849
|
+
runtimeContext?: RuntimeContext_2;
|
|
462
850
|
}): Promise<{
|
|
463
851
|
message: string;
|
|
464
852
|
}>;
|
|
@@ -476,18 +864,24 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
|
|
|
476
864
|
status: string;
|
|
477
865
|
message: string;
|
|
478
866
|
error: any;
|
|
867
|
+
} | {
|
|
868
|
+
status: string;
|
|
869
|
+
message: string;
|
|
870
|
+
traceCount?: undefined;
|
|
479
871
|
} | {
|
|
480
872
|
status: string;
|
|
481
873
|
message: string;
|
|
482
874
|
traceCount: number;
|
|
483
875
|
}>;
|
|
484
876
|
|
|
485
|
-
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
877
|
+
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
486
878
|
runtimeContext: RuntimeContext;
|
|
487
879
|
agentId: string;
|
|
488
880
|
body: GetBody<'stream'> & {
|
|
489
881
|
resourceid?: string;
|
|
882
|
+
runtimeContext?: string;
|
|
490
883
|
};
|
|
884
|
+
abortSignal?: AbortSignal;
|
|
491
885
|
}): Promise<Response | undefined>;
|
|
492
886
|
|
|
493
887
|
export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
|
|
@@ -497,6 +891,62 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
|
|
|
497
891
|
} & Parameters<AgentNetwork['stream']>[1];
|
|
498
892
|
}): Promise<Response>;
|
|
499
893
|
|
|
894
|
+
export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
895
|
+
runtimeContext: RuntimeContext;
|
|
896
|
+
body: {
|
|
897
|
+
message: string;
|
|
898
|
+
threadId?: string;
|
|
899
|
+
resourceId?: string;
|
|
900
|
+
};
|
|
901
|
+
}): Promise<{
|
|
902
|
+
stream: ReadableStream_3<StreamEvent>;
|
|
903
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
|
|
904
|
+
task: ZodString;
|
|
905
|
+
resourceId: ZodString;
|
|
906
|
+
resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
|
|
907
|
+
prompt: ZodString;
|
|
908
|
+
result: ZodString;
|
|
909
|
+
isComplete: ZodOptional<ZodBoolean>;
|
|
910
|
+
completionReason: ZodOptional<ZodString>;
|
|
911
|
+
iteration: ZodNumber;
|
|
912
|
+
threadId: ZodOptional<ZodString>;
|
|
913
|
+
threadResourceId: ZodOptional<ZodString>;
|
|
914
|
+
isOneOff: ZodBoolean;
|
|
915
|
+
}, "strip", ZodTypeAny, {
|
|
916
|
+
prompt: string;
|
|
917
|
+
resourceId: string;
|
|
918
|
+
result: string;
|
|
919
|
+
task: string;
|
|
920
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
921
|
+
iteration: number;
|
|
922
|
+
isOneOff: boolean;
|
|
923
|
+
threadId?: string | undefined;
|
|
924
|
+
threadResourceId?: string | undefined;
|
|
925
|
+
isComplete?: boolean | undefined;
|
|
926
|
+
completionReason?: string | undefined;
|
|
927
|
+
}, {
|
|
928
|
+
prompt: string;
|
|
929
|
+
resourceId: string;
|
|
930
|
+
result: string;
|
|
931
|
+
task: string;
|
|
932
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
933
|
+
iteration: number;
|
|
934
|
+
isOneOff: boolean;
|
|
935
|
+
threadId?: string | undefined;
|
|
936
|
+
threadResourceId?: string | undefined;
|
|
937
|
+
isComplete?: boolean | undefined;
|
|
938
|
+
completionReason?: string | undefined;
|
|
939
|
+
}>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
|
|
940
|
+
}>;
|
|
941
|
+
|
|
942
|
+
export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
943
|
+
inputData?: unknown;
|
|
944
|
+
runtimeContext?: RuntimeContext_2;
|
|
945
|
+
}): Promise<{
|
|
946
|
+
stream: ReadableStream_2<StreamEvent>;
|
|
947
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
948
|
+
}>;
|
|
949
|
+
|
|
500
950
|
declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
501
951
|
|
|
502
952
|
export declare namespace telemetry {
|
|
@@ -513,6 +963,8 @@ declare interface TelemetryContext extends Context {
|
|
|
513
963
|
page?: number;
|
|
514
964
|
perPage?: number;
|
|
515
965
|
attribute?: string | string[];
|
|
966
|
+
fromDate?: Date;
|
|
967
|
+
toDate?: Date;
|
|
516
968
|
};
|
|
517
969
|
}
|
|
518
970
|
|
|
@@ -561,10 +1013,21 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
|
|
|
561
1013
|
*/
|
|
562
1014
|
export declare type UnofficialStatusCode = -1;
|
|
563
1015
|
|
|
564
|
-
export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
|
|
1016
|
+
export declare function updateThreadHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
565
1017
|
body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
|
|
566
1018
|
}): Promise<StorageThreadType>;
|
|
567
1019
|
|
|
1020
|
+
/**
|
|
1021
|
+
* Handler to update the working memory for a thread (optionally resource-scoped).
|
|
1022
|
+
* @param threadId - the thread id
|
|
1023
|
+
* @param body - the body containing the working memory to update and the resource id (optional)
|
|
1024
|
+
*/
|
|
1025
|
+
export declare function updateWorkingMemoryHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
1026
|
+
body: Omit<Parameters<MastraMemory['updateWorkingMemory']>[0], 'threadId'>;
|
|
1027
|
+
}): Promise<{
|
|
1028
|
+
success: boolean;
|
|
1029
|
+
}>;
|
|
1030
|
+
|
|
568
1031
|
declare interface UpsertRequest {
|
|
569
1032
|
indexName: string;
|
|
570
1033
|
vectors: number[][];
|
|
@@ -595,31 +1058,12 @@ declare interface VectorContext extends Context {
|
|
|
595
1058
|
vectorName?: string;
|
|
596
1059
|
}
|
|
597
1060
|
|
|
598
|
-
declare interface VNextWorkflowContext extends Context {
|
|
599
|
-
workflowId?: string;
|
|
600
|
-
runId?: string;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
export declare namespace vNextWorkflows {
|
|
604
|
-
export {
|
|
605
|
-
getVNextWorkflowsHandler,
|
|
606
|
-
getVNextWorkflowByIdHandler,
|
|
607
|
-
getVNextWorkflowRunHandler,
|
|
608
|
-
createVNextWorkflowRunHandler,
|
|
609
|
-
startAsyncVNextWorkflowHandler,
|
|
610
|
-
startVNextWorkflowRunHandler,
|
|
611
|
-
watchVNextWorkflowHandler,
|
|
612
|
-
resumeAsyncVNextWorkflowHandler,
|
|
613
|
-
resumeVNextWorkflowHandler,
|
|
614
|
-
getVNextWorkflowRunsHandler
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
|
|
618
1061
|
export declare namespace voice {
|
|
619
1062
|
export {
|
|
620
1063
|
getSpeakersHandler,
|
|
621
1064
|
generateSpeechHandler,
|
|
622
|
-
transcribeSpeechHandler
|
|
1065
|
+
transcribeSpeechHandler,
|
|
1066
|
+
getListenerHandler
|
|
623
1067
|
}
|
|
624
1068
|
}
|
|
625
1069
|
|
|
@@ -627,27 +1071,36 @@ declare interface VoiceContext extends Context {
|
|
|
627
1071
|
agentId?: string;
|
|
628
1072
|
}
|
|
629
1073
|
|
|
630
|
-
export declare function
|
|
1074
|
+
export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
631
1075
|
|
|
632
|
-
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<
|
|
1076
|
+
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
633
1077
|
|
|
634
1078
|
declare interface WorkflowContext extends Context {
|
|
635
1079
|
workflowId?: string;
|
|
636
1080
|
runId?: string;
|
|
637
1081
|
}
|
|
638
1082
|
|
|
1083
|
+
declare interface WorkflowContext_3 extends Context {
|
|
1084
|
+
workflowId?: string;
|
|
1085
|
+
runId?: string;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
639
1088
|
export declare namespace workflows {
|
|
640
1089
|
export {
|
|
641
1090
|
getWorkflowsHandler,
|
|
642
1091
|
getWorkflowByIdHandler,
|
|
1092
|
+
getWorkflowRunByIdHandler,
|
|
1093
|
+
getWorkflowRunExecutionResultHandler,
|
|
1094
|
+
createWorkflowRunHandler,
|
|
643
1095
|
startAsyncWorkflowHandler,
|
|
644
|
-
getWorkflowRunHandler,
|
|
645
|
-
createRunHandler,
|
|
646
1096
|
startWorkflowRunHandler,
|
|
647
1097
|
watchWorkflowHandler,
|
|
1098
|
+
streamWorkflowHandler,
|
|
648
1099
|
resumeAsyncWorkflowHandler,
|
|
649
1100
|
resumeWorkflowHandler,
|
|
650
|
-
getWorkflowRunsHandler
|
|
1101
|
+
getWorkflowRunsHandler,
|
|
1102
|
+
cancelWorkflowRunHandler,
|
|
1103
|
+
sendWorkflowRunEventHandler
|
|
651
1104
|
}
|
|
652
1105
|
}
|
|
653
1106
|
|