@mastra/server 0.0.0-cloud-transporter-20250513033346 → 0.0.0-course-20250527170450
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/dist/_tsup-dts-rollup.d.cts +110 -95
- package/dist/_tsup-dts-rollup.d.ts +110 -95
- package/dist/{chunk-IU5VO2I2.js → chunk-55DOQLP6.js} +2 -2
- package/dist/{chunk-OGCNNUHF.cjs → chunk-7DLZLWJV.cjs} +3 -2
- package/dist/{chunk-D4IRYCUI.cjs → chunk-A3KDUGS7.cjs} +6 -2
- package/dist/{chunk-4YZ3U35L.cjs → chunk-BNEY4P4P.cjs} +2 -2
- package/dist/{chunk-WUC6LSTW.js → chunk-J3PKLB3A.js} +6 -2
- package/dist/{chunk-MIQYDLLM.js → chunk-KUNQFY2W.js} +70 -34
- package/dist/{chunk-UCTEMO2Q.cjs → chunk-MMO2HDM6.cjs} +81 -44
- package/dist/{chunk-EJO45KYT.js → chunk-W7VCKPAD.js} +34 -34
- package/dist/{chunk-HWZVAG3H.js → chunk-WFBJJNCK.js} +3 -2
- package/dist/{chunk-I2B73Y4I.cjs → chunk-YIOVBYZH.cjs} +44 -44
- package/dist/server/handlers/agents.cjs +7 -7
- package/dist/server/handlers/agents.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/vector.cjs +7 -7
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/workflows.cjs +17 -13
- package/dist/server/handlers/workflows.d.cts +3 -2
- package/dist/server/handlers/workflows.d.ts +3 -2
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +18 -18
- package/dist/server/handlers.d.cts +1 -1
- package/dist/server/handlers.d.ts +1 -1
- package/dist/server/handlers.js +6 -6
- package/package.json +5 -5
- 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
|
@@ -8,24 +8,26 @@ import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
|
|
|
8
8
|
import { EvalRow } from '@mastra/core/storage';
|
|
9
9
|
import { GenerateObjectResult } from 'ai';
|
|
10
10
|
import { GenerateTextResult } from 'ai';
|
|
11
|
+
import type { IMastraLogger } from '@mastra/core/logger';
|
|
11
12
|
import type { JSONRPCError } from '@mastra/core/a2a';
|
|
12
13
|
import { JSONRPCResponse } from '@mastra/core/a2a';
|
|
13
|
-
import
|
|
14
|
+
import { LegacyStep } from '@mastra/core/workflows/legacy';
|
|
15
|
+
import type { LegacyWorkflow } from '@mastra/core/workflows/legacy';
|
|
16
|
+
import { LegacyWorkflowRunResult } from '@mastra/core/workflows/legacy';
|
|
17
|
+
import type { LegacyWorkflowRuns } from '@mastra/core/storage';
|
|
14
18
|
import type { Mastra } from '@mastra/core/mastra';
|
|
15
19
|
import type { MastraMemory } from '@mastra/core/memory';
|
|
16
20
|
import { Message } from 'ai';
|
|
17
21
|
import type { Message as Message_2 } from '@mastra/core/a2a';
|
|
18
22
|
import { MessageType } from '@mastra/core/memory';
|
|
19
|
-
import { NewStep } from '@mastra/core/workflows/vNext';
|
|
20
|
-
import type { NewWorkflow } from '@mastra/core/workflows/vNext';
|
|
21
23
|
import type { QueryResult } from '@mastra/core/vector';
|
|
22
24
|
import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
23
25
|
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
24
26
|
import { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
|
|
25
|
-
import type { SerializedStepFlowEntry } from '@mastra/core/workflows
|
|
27
|
+
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
26
28
|
import { Step } from '@mastra/core/workflows';
|
|
27
|
-
import { StepExecutionContext } from '@mastra/core/workflows';
|
|
28
|
-
import { StepGraph } from '@mastra/core/workflows';
|
|
29
|
+
import { StepExecutionContext } from '@mastra/core/workflows/legacy';
|
|
30
|
+
import { StepGraph } from '@mastra/core/workflows/legacy';
|
|
29
31
|
import { StorageThreadType } from '@mastra/core/memory';
|
|
30
32
|
import { Task } from '@mastra/core/a2a';
|
|
31
33
|
import { TaskAndHistory } from '@mastra/core/a2a';
|
|
@@ -36,10 +38,10 @@ import type { TaskSendParams } from '@mastra/core/a2a';
|
|
|
36
38
|
import type { TaskStatus } from '@mastra/core/a2a';
|
|
37
39
|
import type { ToolAction } from '@mastra/core/tools';
|
|
38
40
|
import type { VercelTool } from '@mastra/core/tools';
|
|
41
|
+
import { WatchEvent } from '@mastra/core/workflows';
|
|
39
42
|
import type { Workflow } from '@mastra/core/workflows';
|
|
40
|
-
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
|
|
41
|
-
import { WorkflowResult } from '@mastra/core/workflows
|
|
42
|
-
import { WorkflowRunResult } from '@mastra/core/workflows';
|
|
43
|
+
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
|
|
44
|
+
import { WorkflowResult } from '@mastra/core/workflows';
|
|
43
45
|
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
44
46
|
import { ZodType } from 'zod';
|
|
45
47
|
import { ZodTypeDef } from 'zod';
|
|
@@ -95,7 +97,7 @@ declare interface CreateIndexRequest {
|
|
|
95
97
|
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
export declare function
|
|
100
|
+
export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
99
101
|
runId: string;
|
|
100
102
|
}>;
|
|
101
103
|
|
|
@@ -114,7 +116,7 @@ export declare function createThreadHandler({ mastra, agentId, body, }: Pick<Mem
|
|
|
114
116
|
};
|
|
115
117
|
}): Promise<StorageThreadType>;
|
|
116
118
|
|
|
117
|
-
export declare function
|
|
119
|
+
export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
118
120
|
runId: string;
|
|
119
121
|
}>;
|
|
120
122
|
|
|
@@ -187,6 +189,8 @@ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }
|
|
|
187
189
|
workflows: {};
|
|
188
190
|
provider: string;
|
|
189
191
|
modelId: string;
|
|
192
|
+
defaultGenerateOptions: any;
|
|
193
|
+
defaultStreamOptions: any;
|
|
190
194
|
}>;
|
|
191
195
|
|
|
192
196
|
export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
|
|
@@ -207,7 +211,7 @@ export declare function getAgentExecutionHandler({ requestId, mastra, agentId, r
|
|
|
207
211
|
method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
|
|
208
212
|
params: TaskSendParams | TaskQueryParams | TaskIdParams;
|
|
209
213
|
taskStore?: InMemoryTaskStore;
|
|
210
|
-
logger?:
|
|
214
|
+
logger?: IMastraLogger;
|
|
211
215
|
}): Promise<any>;
|
|
212
216
|
|
|
213
217
|
export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
|
|
@@ -230,6 +234,28 @@ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agent
|
|
|
230
234
|
evals: EvalRow[];
|
|
231
235
|
}>;
|
|
232
236
|
|
|
237
|
+
export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
|
|
238
|
+
stepGraph: StepGraph;
|
|
239
|
+
stepSubscriberGraph: Record<string, StepGraph>;
|
|
240
|
+
serializedStepGraph: StepGraph;
|
|
241
|
+
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
242
|
+
name: string;
|
|
243
|
+
triggerSchema: string | undefined;
|
|
244
|
+
steps: any;
|
|
245
|
+
}>;
|
|
246
|
+
|
|
247
|
+
export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
|
|
248
|
+
|
|
249
|
+
export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
|
|
250
|
+
fromDate?: Date;
|
|
251
|
+
toDate?: Date;
|
|
252
|
+
limit?: number;
|
|
253
|
+
offset?: number;
|
|
254
|
+
resourceId?: string;
|
|
255
|
+
}): Promise<LegacyWorkflowRuns>;
|
|
256
|
+
|
|
257
|
+
export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
|
|
258
|
+
|
|
233
259
|
export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
|
|
234
260
|
runtimeContext: RuntimeContext;
|
|
235
261
|
agentId: string;
|
|
@@ -240,7 +266,7 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, a
|
|
|
240
266
|
evals: EvalRow[];
|
|
241
267
|
}>;
|
|
242
268
|
|
|
243
|
-
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<
|
|
269
|
+
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<any[]>;
|
|
244
270
|
|
|
245
271
|
export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
|
|
246
272
|
|
|
@@ -306,17 +332,18 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
|
|
|
306
332
|
|
|
307
333
|
export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
|
|
308
334
|
|
|
309
|
-
export declare function
|
|
335
|
+
export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
|
|
310
336
|
steps: SerializedStep[];
|
|
311
337
|
name: string | undefined;
|
|
338
|
+
description: string | undefined;
|
|
312
339
|
stepGraph: SerializedStepFlowEntry[];
|
|
313
340
|
inputSchema: string | undefined;
|
|
314
341
|
outputSchema: string | undefined;
|
|
315
342
|
}>;
|
|
316
343
|
|
|
317
|
-
export declare function
|
|
344
|
+
export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
|
|
318
345
|
|
|
319
|
-
export declare function
|
|
346
|
+
export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
|
|
320
347
|
fromDate?: Date;
|
|
321
348
|
toDate?: Date;
|
|
322
349
|
limit?: number;
|
|
@@ -324,29 +351,7 @@ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId, fromDa
|
|
|
324
351
|
resourceId?: string;
|
|
325
352
|
}): Promise<WorkflowRuns>;
|
|
326
353
|
|
|
327
|
-
export declare function
|
|
328
|
-
|
|
329
|
-
export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
|
|
330
|
-
stepGraph: StepGraph;
|
|
331
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
332
|
-
serializedStepGraph: StepGraph;
|
|
333
|
-
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
334
|
-
name: string;
|
|
335
|
-
triggerSchema: string | undefined;
|
|
336
|
-
steps: any;
|
|
337
|
-
}>;
|
|
338
|
-
|
|
339
|
-
export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
|
|
340
|
-
|
|
341
|
-
export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
|
|
342
|
-
fromDate?: Date;
|
|
343
|
-
toDate?: Date;
|
|
344
|
-
limit?: number;
|
|
345
|
-
offset?: number;
|
|
346
|
-
resourceId?: string;
|
|
347
|
-
}): Promise<WorkflowRuns>;
|
|
348
|
-
|
|
349
|
-
export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
|
|
354
|
+
export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
|
|
350
355
|
|
|
351
356
|
export declare function handleError(error: unknown, defaultMessage: string): never;
|
|
352
357
|
|
|
@@ -355,7 +360,7 @@ export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId
|
|
|
355
360
|
taskStore: InMemoryTaskStore;
|
|
356
361
|
agentId: string;
|
|
357
362
|
taskId: string;
|
|
358
|
-
logger?:
|
|
363
|
+
logger?: IMastraLogger;
|
|
359
364
|
}): Promise<JSONRPCResponse<Task, unknown>>;
|
|
360
365
|
|
|
361
366
|
export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
|
|
@@ -370,7 +375,7 @@ export declare function handleTaskSend({ requestId, params, taskStore, agent, lo
|
|
|
370
375
|
params: TaskSendParams;
|
|
371
376
|
taskStore: InMemoryTaskStore;
|
|
372
377
|
agent: Agent;
|
|
373
|
-
logger?:
|
|
378
|
+
logger?: IMastraLogger;
|
|
374
379
|
runtimeContext: RuntimeContext;
|
|
375
380
|
}): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
|
|
376
381
|
|
|
@@ -379,7 +384,7 @@ export declare function handleTaskSendSubscribe({ requestId, params, taskStore,
|
|
|
379
384
|
params: TaskSendParams;
|
|
380
385
|
taskStore: InMemoryTaskStore;
|
|
381
386
|
agent: Agent;
|
|
382
|
-
logger?:
|
|
387
|
+
logger?: IMastraLogger;
|
|
383
388
|
runtimeContext: RuntimeContext;
|
|
384
389
|
}): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
|
|
385
390
|
state: string;
|
|
@@ -466,6 +471,21 @@ export declare class InMemoryTaskStore {
|
|
|
466
471
|
}): Promise<void>;
|
|
467
472
|
}
|
|
468
473
|
|
|
474
|
+
export declare namespace legacyWorkflows {
|
|
475
|
+
export {
|
|
476
|
+
getLegacyWorkflowsHandler,
|
|
477
|
+
getLegacyWorkflowByIdHandler,
|
|
478
|
+
startAsyncLegacyWorkflowHandler,
|
|
479
|
+
getLegacyWorkflowRunHandler,
|
|
480
|
+
createLegacyWorkflowRunHandler,
|
|
481
|
+
startLegacyWorkflowRunHandler,
|
|
482
|
+
watchLegacyWorkflowHandler,
|
|
483
|
+
resumeAsyncLegacyWorkflowHandler,
|
|
484
|
+
resumeLegacyWorkflowHandler,
|
|
485
|
+
getLegacyWorkflowRunsHandler
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
469
489
|
export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
|
|
470
490
|
|
|
471
491
|
export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
|
|
@@ -475,7 +495,7 @@ export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore,
|
|
|
475
495
|
message: Message_2;
|
|
476
496
|
sessionId?: string | null;
|
|
477
497
|
metadata?: Record<string, unknown> | null;
|
|
478
|
-
logger?:
|
|
498
|
+
logger?: IMastraLogger;
|
|
479
499
|
}): Promise<TaskAndHistory>;
|
|
480
500
|
|
|
481
501
|
export declare namespace logs {
|
|
@@ -525,7 +545,7 @@ declare interface NetworkContext extends Context {
|
|
|
525
545
|
runtimeContext: RuntimeContext;
|
|
526
546
|
}
|
|
527
547
|
|
|
528
|
-
export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?:
|
|
548
|
+
export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
|
|
529
549
|
|
|
530
550
|
declare interface QueryRequest {
|
|
531
551
|
indexName: string;
|
|
@@ -541,39 +561,39 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
|
|
|
541
561
|
|
|
542
562
|
declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
543
563
|
|
|
544
|
-
export declare function
|
|
564
|
+
export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
565
|
+
body: {
|
|
566
|
+
stepId: string;
|
|
567
|
+
context: any;
|
|
568
|
+
};
|
|
569
|
+
runtimeContext: RuntimeContext;
|
|
570
|
+
}): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
|
|
571
|
+
|
|
572
|
+
export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, runtimeContextFromRequest, }: WorkflowContext_3 & {
|
|
545
573
|
body: {
|
|
546
574
|
step: string | string[];
|
|
547
575
|
resumeData?: unknown;
|
|
548
576
|
};
|
|
549
577
|
runtimeContext?: RuntimeContext_2;
|
|
550
578
|
runtimeContextFromRequest?: Record<string, unknown>;
|
|
551
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>,
|
|
579
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any>[]>>;
|
|
552
580
|
|
|
553
|
-
export declare function
|
|
581
|
+
export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
554
582
|
body: {
|
|
555
583
|
stepId: string;
|
|
556
584
|
context: any;
|
|
557
585
|
};
|
|
558
586
|
runtimeContext: RuntimeContext;
|
|
559
|
-
}): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
|
|
560
|
-
|
|
561
|
-
export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
|
|
562
|
-
body: {
|
|
563
|
-
step: string | string[];
|
|
564
|
-
resumeData?: unknown;
|
|
565
|
-
};
|
|
566
|
-
runtimeContext?: RuntimeContext_2;
|
|
567
587
|
}): Promise<{
|
|
568
588
|
message: string;
|
|
569
589
|
}>;
|
|
570
590
|
|
|
571
|
-
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }:
|
|
591
|
+
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
572
592
|
body: {
|
|
573
|
-
|
|
574
|
-
|
|
593
|
+
step: string | string[];
|
|
594
|
+
resumeData?: unknown;
|
|
575
595
|
};
|
|
576
|
-
runtimeContext
|
|
596
|
+
runtimeContext?: RuntimeContext_2;
|
|
577
597
|
}): Promise<{
|
|
578
598
|
message: string;
|
|
579
599
|
}>;
|
|
@@ -595,28 +615,28 @@ declare type SerializedStep = {
|
|
|
595
615
|
|
|
596
616
|
declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
597
617
|
|
|
598
|
-
export declare function
|
|
599
|
-
inputData?: unknown;
|
|
600
|
-
runtimeContext?: RuntimeContext_2;
|
|
601
|
-
runtimeContextFromRequest?: Record<string, unknown>;
|
|
602
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
|
|
603
|
-
|
|
604
|
-
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
618
|
+
export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
605
619
|
triggerData?: unknown;
|
|
606
620
|
runtimeContext: RuntimeContext;
|
|
607
|
-
}): Promise<
|
|
621
|
+
}): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
|
|
608
622
|
|
|
609
|
-
export declare function
|
|
623
|
+
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, runtimeContextFromRequest, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
610
624
|
inputData?: unknown;
|
|
611
625
|
runtimeContext?: RuntimeContext_2;
|
|
612
626
|
runtimeContextFromRequest?: Record<string, unknown>;
|
|
627
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any>[]>>;
|
|
628
|
+
|
|
629
|
+
export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
630
|
+
triggerData?: unknown;
|
|
631
|
+
runtimeContext: RuntimeContext;
|
|
613
632
|
}): Promise<{
|
|
614
633
|
message: string;
|
|
615
634
|
}>;
|
|
616
635
|
|
|
617
|
-
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId,
|
|
618
|
-
|
|
619
|
-
runtimeContext
|
|
636
|
+
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, runtimeContextFromRequest, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
637
|
+
inputData?: unknown;
|
|
638
|
+
runtimeContext?: RuntimeContext_2;
|
|
639
|
+
runtimeContextFromRequest?: Record<string, unknown>;
|
|
620
640
|
}): Promise<{
|
|
621
641
|
message: string;
|
|
622
642
|
}>;
|
|
@@ -656,6 +676,15 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
|
|
|
656
676
|
} & Parameters<AgentNetwork['stream']>[1];
|
|
657
677
|
}): Promise<Response>;
|
|
658
678
|
|
|
679
|
+
export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, runtimeContextFromRequest, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
680
|
+
inputData?: unknown;
|
|
681
|
+
runtimeContext?: RuntimeContext_2;
|
|
682
|
+
runtimeContextFromRequest?: Record<string, unknown>;
|
|
683
|
+
}): {
|
|
684
|
+
stream: globalThis.ReadableStream<WatchEvent>;
|
|
685
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any>[]>>;
|
|
686
|
+
};
|
|
687
|
+
|
|
659
688
|
declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
660
689
|
|
|
661
690
|
export declare namespace telemetry {
|
|
@@ -756,26 +785,6 @@ declare interface VectorContext extends Context {
|
|
|
756
785
|
vectorName?: string;
|
|
757
786
|
}
|
|
758
787
|
|
|
759
|
-
declare interface VNextWorkflowContext extends Context {
|
|
760
|
-
workflowId?: string;
|
|
761
|
-
runId?: string;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
export declare namespace vNextWorkflows {
|
|
765
|
-
export {
|
|
766
|
-
getVNextWorkflowsHandler,
|
|
767
|
-
getVNextWorkflowByIdHandler,
|
|
768
|
-
getVNextWorkflowRunByIdHandler,
|
|
769
|
-
createVNextWorkflowRunHandler,
|
|
770
|
-
startAsyncVNextWorkflowHandler,
|
|
771
|
-
startVNextWorkflowRunHandler,
|
|
772
|
-
watchVNextWorkflowHandler,
|
|
773
|
-
resumeAsyncVNextWorkflowHandler,
|
|
774
|
-
resumeVNextWorkflowHandler,
|
|
775
|
-
getVNextWorkflowRunsHandler
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
788
|
export declare namespace voice {
|
|
780
789
|
export {
|
|
781
790
|
getSpeakersHandler,
|
|
@@ -788,24 +797,30 @@ declare interface VoiceContext extends Context {
|
|
|
788
797
|
agentId?: string;
|
|
789
798
|
}
|
|
790
799
|
|
|
791
|
-
export declare function
|
|
800
|
+
export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
792
801
|
|
|
793
|
-
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<
|
|
802
|
+
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
794
803
|
|
|
795
804
|
declare interface WorkflowContext extends Context {
|
|
796
805
|
workflowId?: string;
|
|
797
806
|
runId?: string;
|
|
798
807
|
}
|
|
799
808
|
|
|
809
|
+
declare interface WorkflowContext_3 extends Context {
|
|
810
|
+
workflowId?: string;
|
|
811
|
+
runId?: string;
|
|
812
|
+
}
|
|
813
|
+
|
|
800
814
|
export declare namespace workflows {
|
|
801
815
|
export {
|
|
802
816
|
getWorkflowsHandler,
|
|
803
817
|
getWorkflowByIdHandler,
|
|
818
|
+
getWorkflowRunByIdHandler,
|
|
819
|
+
createWorkflowRunHandler,
|
|
804
820
|
startAsyncWorkflowHandler,
|
|
805
|
-
getWorkflowRunHandler,
|
|
806
|
-
createRunHandler,
|
|
807
821
|
startWorkflowRunHandler,
|
|
808
822
|
watchWorkflowHandler,
|
|
823
|
+
streamWorkflowHandler,
|
|
809
824
|
resumeAsyncWorkflowHandler,
|
|
810
825
|
resumeWorkflowHandler,
|
|
811
826
|
getWorkflowRunsHandler
|
|
@@ -91,7 +91,7 @@ async function describeIndex({
|
|
|
91
91
|
throw new HTTPException(400, { message: "Index name is required" });
|
|
92
92
|
}
|
|
93
93
|
const vector = getVector(mastra, vectorName);
|
|
94
|
-
const stats = await vector.describeIndex(indexName);
|
|
94
|
+
const stats = await vector.describeIndex({ indexName });
|
|
95
95
|
return {
|
|
96
96
|
dimension: stats.dimension,
|
|
97
97
|
count: stats.count,
|
|
@@ -111,7 +111,7 @@ async function deleteIndex({
|
|
|
111
111
|
throw new HTTPException(400, { message: "Index name is required" });
|
|
112
112
|
}
|
|
113
113
|
const vector = getVector(mastra, vectorName);
|
|
114
|
-
await vector.deleteIndex(indexName);
|
|
114
|
+
await vector.deleteIndex({ indexName });
|
|
115
115
|
return { success: true };
|
|
116
116
|
} catch (error) {
|
|
117
117
|
return handleError(error, "Error deleting index");
|
|
@@ -39,9 +39,10 @@ async function getLogsByRunIdHandler({
|
|
|
39
39
|
async function getLogTransports({ mastra }) {
|
|
40
40
|
try {
|
|
41
41
|
const logger = mastra.getLogger();
|
|
42
|
-
|
|
42
|
+
console.log(logger);
|
|
43
|
+
const transports = logger.getTransports();
|
|
43
44
|
return {
|
|
44
|
-
transports: transports ?
|
|
45
|
+
transports: transports ? [...transports.keys()] : []
|
|
45
46
|
};
|
|
46
47
|
} catch (error) {
|
|
47
48
|
return chunk64U3UDTH_cjs.handleError(error, "Error getting log Transports");
|
|
@@ -58,7 +58,9 @@ async function getAgentsHandler({ mastra, runtimeContext }) {
|
|
|
58
58
|
tools: serializedAgentTools,
|
|
59
59
|
workflows: serializedAgentWorkflows,
|
|
60
60
|
provider: llm?.getProvider(),
|
|
61
|
-
modelId: llm?.getModelId()
|
|
61
|
+
modelId: llm?.getModelId(),
|
|
62
|
+
defaultGenerateOptions: agent.getDefaultGenerateOptions(),
|
|
63
|
+
defaultStreamOptions: agent.getDefaultStreamOptions()
|
|
62
64
|
};
|
|
63
65
|
})
|
|
64
66
|
);
|
|
@@ -116,7 +118,9 @@ async function getAgentByIdHandler({
|
|
|
116
118
|
tools: serializedAgentTools,
|
|
117
119
|
workflows: serializedAgentWorkflows,
|
|
118
120
|
provider: llm?.getProvider(),
|
|
119
|
-
modelId: llm?.getModelId()
|
|
121
|
+
modelId: llm?.getModelId(),
|
|
122
|
+
defaultGenerateOptions: agent.getDefaultGenerateOptions(),
|
|
123
|
+
defaultStreamOptions: agent.getDefaultStreamOptions()
|
|
120
124
|
};
|
|
121
125
|
} catch (error) {
|
|
122
126
|
return chunk64U3UDTH_cjs.handleError(error, "Error getting agent");
|
|
@@ -93,7 +93,7 @@ async function describeIndex({
|
|
|
93
93
|
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Index name is required" });
|
|
94
94
|
}
|
|
95
95
|
const vector = getVector(mastra, vectorName);
|
|
96
|
-
const stats = await vector.describeIndex(indexName);
|
|
96
|
+
const stats = await vector.describeIndex({ indexName });
|
|
97
97
|
return {
|
|
98
98
|
dimension: stats.dimension,
|
|
99
99
|
count: stats.count,
|
|
@@ -113,7 +113,7 @@ async function deleteIndex({
|
|
|
113
113
|
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Index name is required" });
|
|
114
114
|
}
|
|
115
115
|
const vector = getVector(mastra, vectorName);
|
|
116
|
-
await vector.deleteIndex(indexName);
|
|
116
|
+
await vector.deleteIndex({ indexName });
|
|
117
117
|
return { success: true };
|
|
118
118
|
} catch (error) {
|
|
119
119
|
return chunk64U3UDTH_cjs.handleError(error, "Error deleting index");
|
|
@@ -56,7 +56,9 @@ async function getAgentsHandler({ mastra, runtimeContext }) {
|
|
|
56
56
|
tools: serializedAgentTools,
|
|
57
57
|
workflows: serializedAgentWorkflows,
|
|
58
58
|
provider: llm?.getProvider(),
|
|
59
|
-
modelId: llm?.getModelId()
|
|
59
|
+
modelId: llm?.getModelId(),
|
|
60
|
+
defaultGenerateOptions: agent.getDefaultGenerateOptions(),
|
|
61
|
+
defaultStreamOptions: agent.getDefaultStreamOptions()
|
|
60
62
|
};
|
|
61
63
|
})
|
|
62
64
|
);
|
|
@@ -114,7 +116,9 @@ async function getAgentByIdHandler({
|
|
|
114
116
|
tools: serializedAgentTools,
|
|
115
117
|
workflows: serializedAgentWorkflows,
|
|
116
118
|
provider: llm?.getProvider(),
|
|
117
|
-
modelId: llm?.getModelId()
|
|
119
|
+
modelId: llm?.getModelId(),
|
|
120
|
+
defaultGenerateOptions: agent.getDefaultGenerateOptions(),
|
|
121
|
+
defaultStreamOptions: agent.getDefaultStreamOptions()
|
|
118
122
|
};
|
|
119
123
|
} catch (error) {
|
|
120
124
|
return handleError(error, "Error getting agent");
|