@mastra/client-js 0.0.0-fix-memory-xxhash-20250409202110 → 0.0.0-fix-message-embedding-20250506021742
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 +334 -2
- package/{LICENSE → LICENSE.md} +3 -1
- package/dist/index.cjs +423 -6
- package/dist/index.d.cts +151 -8
- package/dist/index.d.ts +151 -8
- package/dist/index.js +423 -6
- package/package.json +10 -5
- package/src/adapters/agui.test.ts +167 -0
- package/src/adapters/agui.ts +219 -0
- package/src/client.ts +47 -11
- package/src/index.test.ts +4 -4
- package/src/resources/agent.ts +1 -2
- package/src/resources/base.ts +1 -1
- package/src/resources/index.ts +1 -0
- package/src/resources/memory-thread.ts +1 -8
- package/src/resources/network.ts +1 -1
- package/src/resources/tool.ts +9 -3
- package/src/resources/vnext-workflow.ts +257 -0
- package/src/resources/workflow.ts +38 -2
- package/src/types.ts +41 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbstractAgent } from '@ag-ui/client';
|
|
2
|
+
import { processDataStream } from '@ai-sdk/ui-utils';
|
|
3
|
+
import { CoreMessage, AiMessageType, StorageThreadType, MessageType, StepAction, StepGraph, WorkflowRuns, WorkflowRunResult as WorkflowRunResult$1, QueryResult, BaseLogMessage, GenerateReturn } from '@mastra/core';
|
|
2
4
|
import { JSONSchema7 } from 'json-schema';
|
|
3
5
|
import { ZodSchema } from 'zod';
|
|
4
|
-
import { processDataStream } from '@ai-sdk/ui-utils';
|
|
5
6
|
import { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
|
|
7
|
+
import { NewWorkflow, WorkflowResult, WatchEvent } from '@mastra/core/workflows/vNext';
|
|
8
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
6
9
|
|
|
7
10
|
interface ClientOptions {
|
|
8
11
|
/** Base URL for API requests */
|
|
@@ -38,6 +41,9 @@ type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
|
38
41
|
} & Omit<AgentStreamOptions<T>, 'onFinish' | 'onStepFinish' | 'telemetry'>;
|
|
39
42
|
interface GetEvalsByAgentIdResponse extends GetAgentResponse {
|
|
40
43
|
evals: any[];
|
|
44
|
+
instructions: string;
|
|
45
|
+
name: string;
|
|
46
|
+
id: string;
|
|
41
47
|
}
|
|
42
48
|
interface GetToolResponse {
|
|
43
49
|
id: string;
|
|
@@ -53,6 +59,14 @@ interface GetWorkflowResponse {
|
|
|
53
59
|
stepSubscriberGraph: Record<string, StepGraph>;
|
|
54
60
|
workflowId?: string;
|
|
55
61
|
}
|
|
62
|
+
interface GetWorkflowRunsParams {
|
|
63
|
+
fromDate?: Date;
|
|
64
|
+
toDate?: Date;
|
|
65
|
+
limit?: number;
|
|
66
|
+
offset?: number;
|
|
67
|
+
resourceId?: string;
|
|
68
|
+
}
|
|
69
|
+
type GetWorkflowRunsResponse = WorkflowRuns;
|
|
56
70
|
type WorkflowRunResult = {
|
|
57
71
|
activePaths: Record<string, {
|
|
58
72
|
status: string;
|
|
@@ -63,6 +77,26 @@ type WorkflowRunResult = {
|
|
|
63
77
|
timestamp: number;
|
|
64
78
|
runId: string;
|
|
65
79
|
};
|
|
80
|
+
interface GetVNextWorkflowResponse {
|
|
81
|
+
name: string;
|
|
82
|
+
steps: {
|
|
83
|
+
[key: string]: {
|
|
84
|
+
id: string;
|
|
85
|
+
description: string;
|
|
86
|
+
inputSchema: string;
|
|
87
|
+
outputSchema: string;
|
|
88
|
+
resumeSchema: string;
|
|
89
|
+
suspendSchema: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
stepGraph: NewWorkflow['serializedStepGraph'];
|
|
93
|
+
inputSchema: string;
|
|
94
|
+
outputSchema: string;
|
|
95
|
+
}
|
|
96
|
+
type VNextWorkflowWatchResult = WatchEvent & {
|
|
97
|
+
runId: string;
|
|
98
|
+
};
|
|
99
|
+
type VNextWorkflowRunResult = WorkflowResult<any, any>;
|
|
66
100
|
interface UpsertVectorParams {
|
|
67
101
|
indexName: string;
|
|
68
102
|
vectors: number[][];
|
|
@@ -97,7 +131,7 @@ type SaveMessageToMemoryResponse = MessageType[];
|
|
|
97
131
|
interface CreateMemoryThreadParams {
|
|
98
132
|
title: string;
|
|
99
133
|
metadata: Record<string, any>;
|
|
100
|
-
|
|
134
|
+
resourceId: string;
|
|
101
135
|
threadId: string;
|
|
102
136
|
agentId: string;
|
|
103
137
|
}
|
|
@@ -110,7 +144,7 @@ type GetMemoryThreadResponse = StorageThreadType[];
|
|
|
110
144
|
interface UpdateMemoryThreadParams {
|
|
111
145
|
title: string;
|
|
112
146
|
metadata: Record<string, any>;
|
|
113
|
-
|
|
147
|
+
resourceId: string;
|
|
114
148
|
}
|
|
115
149
|
interface GetMemoryThreadMessagesResponse {
|
|
116
150
|
messages: CoreMessage[];
|
|
@@ -163,9 +197,7 @@ type Span = {
|
|
|
163
197
|
createdAt: string;
|
|
164
198
|
};
|
|
165
199
|
interface GetTelemetryResponse {
|
|
166
|
-
traces:
|
|
167
|
-
traces: Span[];
|
|
168
|
-
};
|
|
200
|
+
traces: Span[];
|
|
169
201
|
}
|
|
170
202
|
interface GetTelemetryParams {
|
|
171
203
|
name?: string;
|
|
@@ -173,6 +205,8 @@ interface GetTelemetryParams {
|
|
|
173
205
|
page?: number;
|
|
174
206
|
perPage?: number;
|
|
175
207
|
attribute?: Record<string, string>;
|
|
208
|
+
fromDate?: Date;
|
|
209
|
+
toDate?: Date;
|
|
176
210
|
}
|
|
177
211
|
interface GetNetworkResponse {
|
|
178
212
|
name: string;
|
|
@@ -378,6 +412,12 @@ declare class Workflow extends BaseResource {
|
|
|
378
412
|
* @returns Promise containing workflow details including steps and graphs
|
|
379
413
|
*/
|
|
380
414
|
details(): Promise<GetWorkflowResponse>;
|
|
415
|
+
/**
|
|
416
|
+
* Retrieves all runs for a workflow
|
|
417
|
+
* @param params - Parameters for filtering runs
|
|
418
|
+
* @returns Promise containing workflow runs array
|
|
419
|
+
*/
|
|
420
|
+
runs(params?: GetWorkflowRunsParams): Promise<GetWorkflowRunsResponse>;
|
|
381
421
|
/**
|
|
382
422
|
* @deprecated Use `startAsync` instead
|
|
383
423
|
* Executes the workflow with the provided parameters
|
|
@@ -471,9 +511,98 @@ declare class Tool extends BaseResource {
|
|
|
471
511
|
*/
|
|
472
512
|
execute(params: {
|
|
473
513
|
data: any;
|
|
514
|
+
runId?: string;
|
|
474
515
|
}): Promise<any>;
|
|
475
516
|
}
|
|
476
517
|
|
|
518
|
+
declare class VNextWorkflow extends BaseResource {
|
|
519
|
+
private workflowId;
|
|
520
|
+
constructor(options: ClientOptions, workflowId: string);
|
|
521
|
+
/**
|
|
522
|
+
* Creates an async generator that processes a readable stream and yields vNext workflow records
|
|
523
|
+
* separated by the Record Separator character (\x1E)
|
|
524
|
+
*
|
|
525
|
+
* @param stream - The readable stream to process
|
|
526
|
+
* @returns An async generator that yields parsed records
|
|
527
|
+
*/
|
|
528
|
+
private streamProcessor;
|
|
529
|
+
/**
|
|
530
|
+
* Retrieves details about the vNext workflow
|
|
531
|
+
* @returns Promise containing vNext workflow details including steps and graphs
|
|
532
|
+
*/
|
|
533
|
+
details(): Promise<GetVNextWorkflowResponse>;
|
|
534
|
+
/**
|
|
535
|
+
* Retrieves all runs for a vNext workflow
|
|
536
|
+
* @param params - Parameters for filtering runs
|
|
537
|
+
* @returns Promise containing vNext workflow runs array
|
|
538
|
+
*/
|
|
539
|
+
runs(params?: GetWorkflowRunsParams): Promise<GetWorkflowRunsResponse>;
|
|
540
|
+
/**
|
|
541
|
+
* Creates a new vNext workflow run
|
|
542
|
+
* @param params - Optional object containing the optional runId
|
|
543
|
+
* @returns Promise containing the runId of the created run
|
|
544
|
+
*/
|
|
545
|
+
createRun(params?: {
|
|
546
|
+
runId?: string;
|
|
547
|
+
}): Promise<{
|
|
548
|
+
runId: string;
|
|
549
|
+
}>;
|
|
550
|
+
/**
|
|
551
|
+
* Starts a vNext workflow run synchronously without waiting for the workflow to complete
|
|
552
|
+
* @param params - Object containing the runId, inputData and runtimeContext
|
|
553
|
+
* @returns Promise containing success message
|
|
554
|
+
*/
|
|
555
|
+
start(params: {
|
|
556
|
+
runId: string;
|
|
557
|
+
inputData: Record<string, any>;
|
|
558
|
+
runtimeContext?: RuntimeContext;
|
|
559
|
+
}): Promise<{
|
|
560
|
+
message: string;
|
|
561
|
+
}>;
|
|
562
|
+
/**
|
|
563
|
+
* Resumes a suspended vNext workflow step synchronously without waiting for the vNext workflow to complete
|
|
564
|
+
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
565
|
+
* @returns Promise containing success message
|
|
566
|
+
*/
|
|
567
|
+
resume({ step, runId, resumeData, runtimeContext, }: {
|
|
568
|
+
step: string | string[];
|
|
569
|
+
runId: string;
|
|
570
|
+
resumeData?: Record<string, any>;
|
|
571
|
+
runtimeContext?: RuntimeContext;
|
|
572
|
+
}): Promise<{
|
|
573
|
+
message: string;
|
|
574
|
+
}>;
|
|
575
|
+
/**
|
|
576
|
+
* Starts a vNext workflow run asynchronously and returns a promise that resolves when the vNext workflow is complete
|
|
577
|
+
* @param params - Object containing the optional runId, inputData and runtimeContext
|
|
578
|
+
* @returns Promise containing the vNext workflow execution results
|
|
579
|
+
*/
|
|
580
|
+
startAsync(params: {
|
|
581
|
+
runId?: string;
|
|
582
|
+
inputData: Record<string, any>;
|
|
583
|
+
runtimeContext?: RuntimeContext;
|
|
584
|
+
}): Promise<VNextWorkflowRunResult>;
|
|
585
|
+
/**
|
|
586
|
+
* Resumes a suspended vNext workflow step asynchronously and returns a promise that resolves when the vNext workflow is complete
|
|
587
|
+
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
588
|
+
* @returns Promise containing the vNext workflow resume results
|
|
589
|
+
*/
|
|
590
|
+
resumeAsync(params: {
|
|
591
|
+
runId: string;
|
|
592
|
+
step: string | string[];
|
|
593
|
+
resumeData?: Record<string, any>;
|
|
594
|
+
runtimeContext?: RuntimeContext;
|
|
595
|
+
}): Promise<VNextWorkflowRunResult>;
|
|
596
|
+
/**
|
|
597
|
+
* Watches vNext workflow transitions in real-time
|
|
598
|
+
* @param runId - Optional run ID to filter the watch stream
|
|
599
|
+
* @returns AsyncGenerator that yields parsed records from the vNext workflow watch stream
|
|
600
|
+
*/
|
|
601
|
+
watch({ runId }: {
|
|
602
|
+
runId?: string;
|
|
603
|
+
}, onRecord: (record: VNextWorkflowWatchResult) => void): Promise<void>;
|
|
604
|
+
}
|
|
605
|
+
|
|
477
606
|
declare class MastraClient extends BaseResource {
|
|
478
607
|
constructor(options: ClientOptions);
|
|
479
608
|
/**
|
|
@@ -481,6 +610,9 @@ declare class MastraClient extends BaseResource {
|
|
|
481
610
|
* @returns Promise containing map of agent IDs to agent details
|
|
482
611
|
*/
|
|
483
612
|
getAgents(): Promise<Record<string, GetAgentResponse>>;
|
|
613
|
+
getAGUI({ resourceId }: {
|
|
614
|
+
resourceId: string;
|
|
615
|
+
}): Promise<Record<string, AbstractAgent>>;
|
|
484
616
|
/**
|
|
485
617
|
* Gets an agent instance by ID
|
|
486
618
|
* @param agentId - ID of the agent to retrieve
|
|
@@ -540,6 +672,17 @@ declare class MastraClient extends BaseResource {
|
|
|
540
672
|
* @returns Workflow instance
|
|
541
673
|
*/
|
|
542
674
|
getWorkflow(workflowId: string): Workflow;
|
|
675
|
+
/**
|
|
676
|
+
* Retrieves all available vNext workflows
|
|
677
|
+
* @returns Promise containing map of vNext workflow IDs to vNext workflow details
|
|
678
|
+
*/
|
|
679
|
+
getVNextWorkflows(): Promise<Record<string, GetVNextWorkflowResponse>>;
|
|
680
|
+
/**
|
|
681
|
+
* Gets a vNext workflow instance by ID
|
|
682
|
+
* @param workflowId - ID of the vNext workflow to retrieve
|
|
683
|
+
* @returns vNext Workflow instance
|
|
684
|
+
*/
|
|
685
|
+
getVNextWorkflow(workflowId: string): VNextWorkflow;
|
|
543
686
|
/**
|
|
544
687
|
* Gets a vector instance by name
|
|
545
688
|
* @param vectorName - Name of the vector to retrieve
|
|
@@ -584,4 +727,4 @@ declare class MastraClient extends BaseResource {
|
|
|
584
727
|
getNetwork(networkId: string): Network;
|
|
585
728
|
}
|
|
586
729
|
|
|
587
|
-
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type GenerateParams, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVectorIndexResponse, type GetWorkflowResponse, MastraClient, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult };
|
|
730
|
+
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type GenerateParams, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextWorkflowResponse, type GetVectorIndexResponse, type GetWorkflowResponse, type GetWorkflowRunsParams, type GetWorkflowRunsResponse, MastraClient, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type VNextWorkflowRunResult, type VNextWorkflowWatchResult, type WorkflowRunResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbstractAgent } from '@ag-ui/client';
|
|
2
|
+
import { processDataStream } from '@ai-sdk/ui-utils';
|
|
3
|
+
import { CoreMessage, AiMessageType, StorageThreadType, MessageType, StepAction, StepGraph, WorkflowRuns, WorkflowRunResult as WorkflowRunResult$1, QueryResult, BaseLogMessage, GenerateReturn } from '@mastra/core';
|
|
2
4
|
import { JSONSchema7 } from 'json-schema';
|
|
3
5
|
import { ZodSchema } from 'zod';
|
|
4
|
-
import { processDataStream } from '@ai-sdk/ui-utils';
|
|
5
6
|
import { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
|
|
7
|
+
import { NewWorkflow, WorkflowResult, WatchEvent } from '@mastra/core/workflows/vNext';
|
|
8
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
6
9
|
|
|
7
10
|
interface ClientOptions {
|
|
8
11
|
/** Base URL for API requests */
|
|
@@ -38,6 +41,9 @@ type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
|
|
|
38
41
|
} & Omit<AgentStreamOptions<T>, 'onFinish' | 'onStepFinish' | 'telemetry'>;
|
|
39
42
|
interface GetEvalsByAgentIdResponse extends GetAgentResponse {
|
|
40
43
|
evals: any[];
|
|
44
|
+
instructions: string;
|
|
45
|
+
name: string;
|
|
46
|
+
id: string;
|
|
41
47
|
}
|
|
42
48
|
interface GetToolResponse {
|
|
43
49
|
id: string;
|
|
@@ -53,6 +59,14 @@ interface GetWorkflowResponse {
|
|
|
53
59
|
stepSubscriberGraph: Record<string, StepGraph>;
|
|
54
60
|
workflowId?: string;
|
|
55
61
|
}
|
|
62
|
+
interface GetWorkflowRunsParams {
|
|
63
|
+
fromDate?: Date;
|
|
64
|
+
toDate?: Date;
|
|
65
|
+
limit?: number;
|
|
66
|
+
offset?: number;
|
|
67
|
+
resourceId?: string;
|
|
68
|
+
}
|
|
69
|
+
type GetWorkflowRunsResponse = WorkflowRuns;
|
|
56
70
|
type WorkflowRunResult = {
|
|
57
71
|
activePaths: Record<string, {
|
|
58
72
|
status: string;
|
|
@@ -63,6 +77,26 @@ type WorkflowRunResult = {
|
|
|
63
77
|
timestamp: number;
|
|
64
78
|
runId: string;
|
|
65
79
|
};
|
|
80
|
+
interface GetVNextWorkflowResponse {
|
|
81
|
+
name: string;
|
|
82
|
+
steps: {
|
|
83
|
+
[key: string]: {
|
|
84
|
+
id: string;
|
|
85
|
+
description: string;
|
|
86
|
+
inputSchema: string;
|
|
87
|
+
outputSchema: string;
|
|
88
|
+
resumeSchema: string;
|
|
89
|
+
suspendSchema: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
stepGraph: NewWorkflow['serializedStepGraph'];
|
|
93
|
+
inputSchema: string;
|
|
94
|
+
outputSchema: string;
|
|
95
|
+
}
|
|
96
|
+
type VNextWorkflowWatchResult = WatchEvent & {
|
|
97
|
+
runId: string;
|
|
98
|
+
};
|
|
99
|
+
type VNextWorkflowRunResult = WorkflowResult<any, any>;
|
|
66
100
|
interface UpsertVectorParams {
|
|
67
101
|
indexName: string;
|
|
68
102
|
vectors: number[][];
|
|
@@ -97,7 +131,7 @@ type SaveMessageToMemoryResponse = MessageType[];
|
|
|
97
131
|
interface CreateMemoryThreadParams {
|
|
98
132
|
title: string;
|
|
99
133
|
metadata: Record<string, any>;
|
|
100
|
-
|
|
134
|
+
resourceId: string;
|
|
101
135
|
threadId: string;
|
|
102
136
|
agentId: string;
|
|
103
137
|
}
|
|
@@ -110,7 +144,7 @@ type GetMemoryThreadResponse = StorageThreadType[];
|
|
|
110
144
|
interface UpdateMemoryThreadParams {
|
|
111
145
|
title: string;
|
|
112
146
|
metadata: Record<string, any>;
|
|
113
|
-
|
|
147
|
+
resourceId: string;
|
|
114
148
|
}
|
|
115
149
|
interface GetMemoryThreadMessagesResponse {
|
|
116
150
|
messages: CoreMessage[];
|
|
@@ -163,9 +197,7 @@ type Span = {
|
|
|
163
197
|
createdAt: string;
|
|
164
198
|
};
|
|
165
199
|
interface GetTelemetryResponse {
|
|
166
|
-
traces:
|
|
167
|
-
traces: Span[];
|
|
168
|
-
};
|
|
200
|
+
traces: Span[];
|
|
169
201
|
}
|
|
170
202
|
interface GetTelemetryParams {
|
|
171
203
|
name?: string;
|
|
@@ -173,6 +205,8 @@ interface GetTelemetryParams {
|
|
|
173
205
|
page?: number;
|
|
174
206
|
perPage?: number;
|
|
175
207
|
attribute?: Record<string, string>;
|
|
208
|
+
fromDate?: Date;
|
|
209
|
+
toDate?: Date;
|
|
176
210
|
}
|
|
177
211
|
interface GetNetworkResponse {
|
|
178
212
|
name: string;
|
|
@@ -378,6 +412,12 @@ declare class Workflow extends BaseResource {
|
|
|
378
412
|
* @returns Promise containing workflow details including steps and graphs
|
|
379
413
|
*/
|
|
380
414
|
details(): Promise<GetWorkflowResponse>;
|
|
415
|
+
/**
|
|
416
|
+
* Retrieves all runs for a workflow
|
|
417
|
+
* @param params - Parameters for filtering runs
|
|
418
|
+
* @returns Promise containing workflow runs array
|
|
419
|
+
*/
|
|
420
|
+
runs(params?: GetWorkflowRunsParams): Promise<GetWorkflowRunsResponse>;
|
|
381
421
|
/**
|
|
382
422
|
* @deprecated Use `startAsync` instead
|
|
383
423
|
* Executes the workflow with the provided parameters
|
|
@@ -471,9 +511,98 @@ declare class Tool extends BaseResource {
|
|
|
471
511
|
*/
|
|
472
512
|
execute(params: {
|
|
473
513
|
data: any;
|
|
514
|
+
runId?: string;
|
|
474
515
|
}): Promise<any>;
|
|
475
516
|
}
|
|
476
517
|
|
|
518
|
+
declare class VNextWorkflow extends BaseResource {
|
|
519
|
+
private workflowId;
|
|
520
|
+
constructor(options: ClientOptions, workflowId: string);
|
|
521
|
+
/**
|
|
522
|
+
* Creates an async generator that processes a readable stream and yields vNext workflow records
|
|
523
|
+
* separated by the Record Separator character (\x1E)
|
|
524
|
+
*
|
|
525
|
+
* @param stream - The readable stream to process
|
|
526
|
+
* @returns An async generator that yields parsed records
|
|
527
|
+
*/
|
|
528
|
+
private streamProcessor;
|
|
529
|
+
/**
|
|
530
|
+
* Retrieves details about the vNext workflow
|
|
531
|
+
* @returns Promise containing vNext workflow details including steps and graphs
|
|
532
|
+
*/
|
|
533
|
+
details(): Promise<GetVNextWorkflowResponse>;
|
|
534
|
+
/**
|
|
535
|
+
* Retrieves all runs for a vNext workflow
|
|
536
|
+
* @param params - Parameters for filtering runs
|
|
537
|
+
* @returns Promise containing vNext workflow runs array
|
|
538
|
+
*/
|
|
539
|
+
runs(params?: GetWorkflowRunsParams): Promise<GetWorkflowRunsResponse>;
|
|
540
|
+
/**
|
|
541
|
+
* Creates a new vNext workflow run
|
|
542
|
+
* @param params - Optional object containing the optional runId
|
|
543
|
+
* @returns Promise containing the runId of the created run
|
|
544
|
+
*/
|
|
545
|
+
createRun(params?: {
|
|
546
|
+
runId?: string;
|
|
547
|
+
}): Promise<{
|
|
548
|
+
runId: string;
|
|
549
|
+
}>;
|
|
550
|
+
/**
|
|
551
|
+
* Starts a vNext workflow run synchronously without waiting for the workflow to complete
|
|
552
|
+
* @param params - Object containing the runId, inputData and runtimeContext
|
|
553
|
+
* @returns Promise containing success message
|
|
554
|
+
*/
|
|
555
|
+
start(params: {
|
|
556
|
+
runId: string;
|
|
557
|
+
inputData: Record<string, any>;
|
|
558
|
+
runtimeContext?: RuntimeContext;
|
|
559
|
+
}): Promise<{
|
|
560
|
+
message: string;
|
|
561
|
+
}>;
|
|
562
|
+
/**
|
|
563
|
+
* Resumes a suspended vNext workflow step synchronously without waiting for the vNext workflow to complete
|
|
564
|
+
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
565
|
+
* @returns Promise containing success message
|
|
566
|
+
*/
|
|
567
|
+
resume({ step, runId, resumeData, runtimeContext, }: {
|
|
568
|
+
step: string | string[];
|
|
569
|
+
runId: string;
|
|
570
|
+
resumeData?: Record<string, any>;
|
|
571
|
+
runtimeContext?: RuntimeContext;
|
|
572
|
+
}): Promise<{
|
|
573
|
+
message: string;
|
|
574
|
+
}>;
|
|
575
|
+
/**
|
|
576
|
+
* Starts a vNext workflow run asynchronously and returns a promise that resolves when the vNext workflow is complete
|
|
577
|
+
* @param params - Object containing the optional runId, inputData and runtimeContext
|
|
578
|
+
* @returns Promise containing the vNext workflow execution results
|
|
579
|
+
*/
|
|
580
|
+
startAsync(params: {
|
|
581
|
+
runId?: string;
|
|
582
|
+
inputData: Record<string, any>;
|
|
583
|
+
runtimeContext?: RuntimeContext;
|
|
584
|
+
}): Promise<VNextWorkflowRunResult>;
|
|
585
|
+
/**
|
|
586
|
+
* Resumes a suspended vNext workflow step asynchronously and returns a promise that resolves when the vNext workflow is complete
|
|
587
|
+
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
588
|
+
* @returns Promise containing the vNext workflow resume results
|
|
589
|
+
*/
|
|
590
|
+
resumeAsync(params: {
|
|
591
|
+
runId: string;
|
|
592
|
+
step: string | string[];
|
|
593
|
+
resumeData?: Record<string, any>;
|
|
594
|
+
runtimeContext?: RuntimeContext;
|
|
595
|
+
}): Promise<VNextWorkflowRunResult>;
|
|
596
|
+
/**
|
|
597
|
+
* Watches vNext workflow transitions in real-time
|
|
598
|
+
* @param runId - Optional run ID to filter the watch stream
|
|
599
|
+
* @returns AsyncGenerator that yields parsed records from the vNext workflow watch stream
|
|
600
|
+
*/
|
|
601
|
+
watch({ runId }: {
|
|
602
|
+
runId?: string;
|
|
603
|
+
}, onRecord: (record: VNextWorkflowWatchResult) => void): Promise<void>;
|
|
604
|
+
}
|
|
605
|
+
|
|
477
606
|
declare class MastraClient extends BaseResource {
|
|
478
607
|
constructor(options: ClientOptions);
|
|
479
608
|
/**
|
|
@@ -481,6 +610,9 @@ declare class MastraClient extends BaseResource {
|
|
|
481
610
|
* @returns Promise containing map of agent IDs to agent details
|
|
482
611
|
*/
|
|
483
612
|
getAgents(): Promise<Record<string, GetAgentResponse>>;
|
|
613
|
+
getAGUI({ resourceId }: {
|
|
614
|
+
resourceId: string;
|
|
615
|
+
}): Promise<Record<string, AbstractAgent>>;
|
|
484
616
|
/**
|
|
485
617
|
* Gets an agent instance by ID
|
|
486
618
|
* @param agentId - ID of the agent to retrieve
|
|
@@ -540,6 +672,17 @@ declare class MastraClient extends BaseResource {
|
|
|
540
672
|
* @returns Workflow instance
|
|
541
673
|
*/
|
|
542
674
|
getWorkflow(workflowId: string): Workflow;
|
|
675
|
+
/**
|
|
676
|
+
* Retrieves all available vNext workflows
|
|
677
|
+
* @returns Promise containing map of vNext workflow IDs to vNext workflow details
|
|
678
|
+
*/
|
|
679
|
+
getVNextWorkflows(): Promise<Record<string, GetVNextWorkflowResponse>>;
|
|
680
|
+
/**
|
|
681
|
+
* Gets a vNext workflow instance by ID
|
|
682
|
+
* @param workflowId - ID of the vNext workflow to retrieve
|
|
683
|
+
* @returns vNext Workflow instance
|
|
684
|
+
*/
|
|
685
|
+
getVNextWorkflow(workflowId: string): VNextWorkflow;
|
|
543
686
|
/**
|
|
544
687
|
* Gets a vector instance by name
|
|
545
688
|
* @param vectorName - Name of the vector to retrieve
|
|
@@ -584,4 +727,4 @@ declare class MastraClient extends BaseResource {
|
|
|
584
727
|
getNetwork(networkId: string): Network;
|
|
585
728
|
}
|
|
586
729
|
|
|
587
|
-
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type GenerateParams, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVectorIndexResponse, type GetWorkflowResponse, MastraClient, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult };
|
|
730
|
+
export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type GenerateParams, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextWorkflowResponse, type GetVectorIndexResponse, type GetWorkflowResponse, type GetWorkflowRunsParams, type GetWorkflowRunsResponse, MastraClient, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type VNextWorkflowRunResult, type VNextWorkflowWatchResult, type WorkflowRunResult };
|