@mastra/client-js 0.10.17 → 0.10.18-alpha.0
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/.turbo/turbo-build.log +2 -17
- package/CHANGELOG.md +12 -0
- package/dist/adapters/agui.d.ts +23 -0
- package/dist/adapters/agui.d.ts.map +1 -0
- package/dist/client.d.ts +265 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/example.d.ts +2 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -1328
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/a2a.d.ts +44 -0
- package/dist/resources/a2a.d.ts.map +1 -0
- package/dist/resources/agent.d.ts +112 -0
- package/dist/resources/agent.d.ts.map +1 -0
- package/dist/resources/base.d.ts +13 -0
- package/dist/resources/base.d.ts.map +1 -0
- package/dist/resources/index.d.ts +11 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/legacy-workflow.d.ts +87 -0
- package/dist/resources/legacy-workflow.d.ts.map +1 -0
- package/dist/resources/mcp-tool.d.ts +27 -0
- package/dist/resources/mcp-tool.d.ts.map +1 -0
- package/dist/resources/memory-thread.d.ts +53 -0
- package/dist/resources/memory-thread.d.ts.map +1 -0
- package/dist/resources/network-memory-thread.d.ts +47 -0
- package/dist/resources/network-memory-thread.d.ts.map +1 -0
- package/dist/resources/network.d.ts +30 -0
- package/dist/resources/network.d.ts.map +1 -0
- package/dist/resources/tool.d.ts +23 -0
- package/dist/resources/tool.d.ts.map +1 -0
- package/dist/resources/vNextNetwork.d.ts +42 -0
- package/dist/resources/vNextNetwork.d.ts.map +1 -0
- package/dist/resources/vector.d.ts +48 -0
- package/dist/resources/vector.d.ts.map +1 -0
- package/dist/resources/workflow.d.ts +154 -0
- package/dist/resources/workflow.d.ts.map +1 -0
- package/dist/types.d.ts +422 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/process-client-tools.d.ts +3 -0
- package/dist/utils/process-client-tools.d.ts.map +1 -0
- package/dist/utils/zod-to-json-schema.d.ts +105 -0
- package/dist/utils/zod-to-json-schema.d.ts.map +1 -0
- package/integration-tests/agui-adapter.test.ts +122 -0
- package/integration-tests/package.json +18 -0
- package/integration-tests/src/mastra/index.ts +35 -0
- package/integration-tests/vitest.config.ts +9 -0
- package/package.json +8 -5
- package/src/adapters/agui.test.ts +145 -3
- package/tsconfig.build.json +9 -0
- package/tsconfig.json +1 -1
- package/tsup.config.ts +22 -0
- package/dist/index.d.cts +0 -1328
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ClientOptions, LegacyWorkflowRunResult, GetLegacyWorkflowRunsResponse, GetWorkflowRunsParams, GetLegacyWorkflowResponse } from '../types';
|
|
2
|
+
import { BaseResource } from './base';
|
|
3
|
+
export declare class LegacyWorkflow extends BaseResource {
|
|
4
|
+
private workflowId;
|
|
5
|
+
constructor(options: ClientOptions, workflowId: string);
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves details about the legacy workflow
|
|
8
|
+
* @returns Promise containing legacy workflow details including steps and graphs
|
|
9
|
+
*/
|
|
10
|
+
details(): Promise<GetLegacyWorkflowResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves all runs for a legacy workflow
|
|
13
|
+
* @param params - Parameters for filtering runs
|
|
14
|
+
* @returns Promise containing legacy workflow runs array
|
|
15
|
+
*/
|
|
16
|
+
runs(params?: GetWorkflowRunsParams): Promise<GetLegacyWorkflowRunsResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new legacy workflow run
|
|
19
|
+
* @returns Promise containing the generated run ID
|
|
20
|
+
*/
|
|
21
|
+
createRun(params?: {
|
|
22
|
+
runId?: string;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
runId: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Starts a legacy workflow run synchronously without waiting for the workflow to complete
|
|
28
|
+
* @param params - Object containing the runId and triggerData
|
|
29
|
+
* @returns Promise containing success message
|
|
30
|
+
*/
|
|
31
|
+
start(params: {
|
|
32
|
+
runId: string;
|
|
33
|
+
triggerData: Record<string, any>;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
message: string;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Resumes a suspended legacy workflow step synchronously without waiting for the workflow to complete
|
|
39
|
+
* @param stepId - ID of the step to resume
|
|
40
|
+
* @param runId - ID of the legacy workflow run
|
|
41
|
+
* @param context - Context to resume the legacy workflow with
|
|
42
|
+
* @returns Promise containing the legacy workflow resume results
|
|
43
|
+
*/
|
|
44
|
+
resume({ stepId, runId, context, }: {
|
|
45
|
+
stepId: string;
|
|
46
|
+
runId: string;
|
|
47
|
+
context: Record<string, any>;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
message: string;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
|
|
53
|
+
* @param params - Object containing the optional runId and triggerData
|
|
54
|
+
* @returns Promise containing the workflow execution results
|
|
55
|
+
*/
|
|
56
|
+
startAsync(params: {
|
|
57
|
+
runId?: string;
|
|
58
|
+
triggerData: Record<string, any>;
|
|
59
|
+
}): Promise<LegacyWorkflowRunResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Resumes a suspended legacy workflow step asynchronously and returns a promise that resolves when the workflow is complete
|
|
62
|
+
* @param params - Object containing the runId, stepId, and context
|
|
63
|
+
* @returns Promise containing the workflow resume results
|
|
64
|
+
*/
|
|
65
|
+
resumeAsync(params: {
|
|
66
|
+
runId: string;
|
|
67
|
+
stepId: string;
|
|
68
|
+
context: Record<string, any>;
|
|
69
|
+
}): Promise<LegacyWorkflowRunResult>;
|
|
70
|
+
/**
|
|
71
|
+
* Creates an async generator that processes a readable stream and yields records
|
|
72
|
+
* separated by the Record Separator character (\x1E)
|
|
73
|
+
*
|
|
74
|
+
* @param stream - The readable stream to process
|
|
75
|
+
* @returns An async generator that yields parsed records
|
|
76
|
+
*/
|
|
77
|
+
private streamProcessor;
|
|
78
|
+
/**
|
|
79
|
+
* Watches legacy workflow transitions in real-time
|
|
80
|
+
* @param runId - Optional run ID to filter the watch stream
|
|
81
|
+
* @returns AsyncGenerator that yields parsed records from the legacy workflow watch stream
|
|
82
|
+
*/
|
|
83
|
+
watch({ runId }: {
|
|
84
|
+
runId?: string;
|
|
85
|
+
}, onRecord: (record: LegacyWorkflowRunResult) => void): Promise<void>;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=legacy-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-workflow.d.ts","sourceRoot":"","sources":["../../src/resources/legacy-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC,qBAAa,cAAe,SAAQ,YAAY;IAG5C,OAAO,CAAC,UAAU;gBADlB,OAAO,EAAE,aAAa,EACd,UAAU,EAAE,MAAM;IAK5B;;;OAGG;IACH,OAAO,IA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,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI;CAiB/F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
2
|
+
import type { ClientOptions, McpToolInfo } from '../types';
|
|
3
|
+
import { BaseResource } from './base';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a specific tool available on a specific MCP server.
|
|
6
|
+
* Provides methods to get details and execute the tool.
|
|
7
|
+
*/
|
|
8
|
+
export declare class MCPTool extends BaseResource {
|
|
9
|
+
private serverId;
|
|
10
|
+
private toolId;
|
|
11
|
+
constructor(options: ClientOptions, serverId: string, toolId: string);
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves details about this specific tool from the MCP server.
|
|
14
|
+
* @returns Promise containing the tool's information (name, description, schema).
|
|
15
|
+
*/
|
|
16
|
+
details(): Promise<McpToolInfo>;
|
|
17
|
+
/**
|
|
18
|
+
* Executes this specific tool on the MCP server.
|
|
19
|
+
* @param params - Parameters for tool execution, including data/args and optional runtimeContext.
|
|
20
|
+
* @returns Promise containing the result of the tool execution.
|
|
21
|
+
*/
|
|
22
|
+
execute(params: {
|
|
23
|
+
data?: any;
|
|
24
|
+
runtimeContext?: RuntimeContext;
|
|
25
|
+
}): Promise<any>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=mcp-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-tool.d.ts","sourceRoot":"","sources":["../../src/resources/mcp-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAAY;IACvC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMpE;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC;IAI/B;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAgB/E"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { StorageThreadType } from '@mastra/core';
|
|
2
|
+
import type { GetMemoryThreadMessagesResponse, ClientOptions, UpdateMemoryThreadParams, GetMemoryThreadMessagesParams, GetMemoryThreadMessagesPaginatedParams, GetMemoryThreadMessagesPaginatedResponse } from '../types';
|
|
3
|
+
import { BaseResource } from './base';
|
|
4
|
+
export declare class MemoryThread extends BaseResource {
|
|
5
|
+
private threadId;
|
|
6
|
+
private agentId;
|
|
7
|
+
constructor(options: ClientOptions, threadId: string, agentId: string);
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves the memory thread details
|
|
10
|
+
* @returns Promise containing thread details including title and metadata
|
|
11
|
+
*/
|
|
12
|
+
get(): Promise<StorageThreadType>;
|
|
13
|
+
/**
|
|
14
|
+
* Updates the memory thread properties
|
|
15
|
+
* @param params - Update parameters including title and metadata
|
|
16
|
+
* @returns Promise containing updated thread details
|
|
17
|
+
*/
|
|
18
|
+
update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
|
|
19
|
+
/**
|
|
20
|
+
* Deletes the memory thread
|
|
21
|
+
* @returns Promise containing deletion result
|
|
22
|
+
*/
|
|
23
|
+
delete(): Promise<{
|
|
24
|
+
result: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves messages associated with the thread
|
|
28
|
+
* @param params - Optional parameters including limit for number of messages to retrieve
|
|
29
|
+
* @returns Promise containing thread messages and UI messages
|
|
30
|
+
*/
|
|
31
|
+
getMessages(params?: GetMemoryThreadMessagesParams): Promise<GetMemoryThreadMessagesResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves paginated messages associated with the thread with advanced filtering and selection options
|
|
34
|
+
* @param params - Pagination parameters including selectBy criteria, page, perPage, date ranges, and message inclusion options
|
|
35
|
+
* @returns Promise containing paginated thread messages with pagination metadata (total, page, perPage, hasMore)
|
|
36
|
+
*/
|
|
37
|
+
getMessagesPaginated({ selectBy, ...rest }: GetMemoryThreadMessagesPaginatedParams): Promise<GetMemoryThreadMessagesPaginatedResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Deletes one or more messages from the thread
|
|
40
|
+
* @param messageIds - Can be a single message ID (string), array of message IDs,
|
|
41
|
+
* message object with id property, or array of message objects
|
|
42
|
+
* @returns Promise containing deletion result
|
|
43
|
+
*/
|
|
44
|
+
deleteMessages(messageIds: string | string[] | {
|
|
45
|
+
id: string;
|
|
46
|
+
} | {
|
|
47
|
+
id: string;
|
|
48
|
+
}[]): Promise<{
|
|
49
|
+
success: boolean;
|
|
50
|
+
message: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=memory-thread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-thread.d.ts","sourceRoot":"","sources":["../../src/resources/memory-thread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EACV,+BAA+B,EAC/B,aAAa,EACb,wBAAwB,EACxB,6BAA6B,EAC7B,sCAAsC,EACtC,wCAAwC,EACzC,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,YAAa,SAAQ,YAAY;IAG1C,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,OAAO;gBAFf,OAAO,EAAE,aAAa,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM;IAKzB;;;OAGG;IACH,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAIjC;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOpE;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAMrC;;;;OAIG;IACH,WAAW,CAAC,MAAM,CAAC,EAAE,6BAA6B,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAQ7F;;;;OAIG;IACH,oBAAoB,CAAC,EACnB,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,sCAAsC,GAAG,OAAO,CAAC,wCAAwC,CAAC;IAQ7F;;;;;OAKG;IACH,cAAc,CACZ,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,GAChE,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CASlD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { StorageThreadType } from '@mastra/core';
|
|
2
|
+
import type { GetMemoryThreadMessagesResponse, ClientOptions, UpdateMemoryThreadParams, GetMemoryThreadMessagesParams } from '../types';
|
|
3
|
+
import { BaseResource } from './base';
|
|
4
|
+
export declare class NetworkMemoryThread extends BaseResource {
|
|
5
|
+
private threadId;
|
|
6
|
+
private networkId;
|
|
7
|
+
constructor(options: ClientOptions, threadId: string, networkId: string);
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves the memory thread details
|
|
10
|
+
* @returns Promise containing thread details including title and metadata
|
|
11
|
+
*/
|
|
12
|
+
get(): Promise<StorageThreadType>;
|
|
13
|
+
/**
|
|
14
|
+
* Updates the memory thread properties
|
|
15
|
+
* @param params - Update parameters including title and metadata
|
|
16
|
+
* @returns Promise containing updated thread details
|
|
17
|
+
*/
|
|
18
|
+
update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
|
|
19
|
+
/**
|
|
20
|
+
* Deletes the memory thread
|
|
21
|
+
* @returns Promise containing deletion result
|
|
22
|
+
*/
|
|
23
|
+
delete(): Promise<{
|
|
24
|
+
result: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves messages associated with the thread
|
|
28
|
+
* @param params - Optional parameters including limit for number of messages to retrieve
|
|
29
|
+
* @returns Promise containing thread messages and UI messages
|
|
30
|
+
*/
|
|
31
|
+
getMessages(params?: GetMemoryThreadMessagesParams): Promise<GetMemoryThreadMessagesResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Deletes one or more messages from the thread
|
|
34
|
+
* @param messageIds - Can be a single message ID (string), array of message IDs,
|
|
35
|
+
* message object with id property, or array of message objects
|
|
36
|
+
* @returns Promise containing deletion result
|
|
37
|
+
*/
|
|
38
|
+
deleteMessages(messageIds: string | string[] | {
|
|
39
|
+
id: string;
|
|
40
|
+
} | {
|
|
41
|
+
id: string;
|
|
42
|
+
}[]): Promise<{
|
|
43
|
+
success: boolean;
|
|
44
|
+
message: string;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=network-memory-thread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-memory-thread.d.ts","sourceRoot":"","sources":["../../src/resources/network-memory-thread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EACV,+BAA+B,EAC/B,aAAa,EACb,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,mBAAoB,SAAQ,YAAY;IAGjD,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS;gBAFjB,OAAO,EAAE,aAAa,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM;IAK3B;;;OAGG;IACH,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAIjC;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOpE;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAMrC;;;;OAIG;IACH,WAAW,CAAC,MAAM,CAAC,EAAE,6BAA6B,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAQ7F;;;;;OAKG;IACH,cAAc,CACZ,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,GAChE,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CASlD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { processDataStream } from '@ai-sdk/ui-utils';
|
|
2
|
+
import type { GenerateReturn } from '@mastra/core';
|
|
3
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
4
|
+
import type { ZodSchema } from 'zod';
|
|
5
|
+
import type { GenerateParams, ClientOptions, StreamParams, GetNetworkResponse } from '../types';
|
|
6
|
+
import { BaseResource } from './base';
|
|
7
|
+
export declare class Network extends BaseResource {
|
|
8
|
+
private networkId;
|
|
9
|
+
constructor(options: ClientOptions, networkId: string);
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves details about the network
|
|
12
|
+
* @returns Promise containing network details
|
|
13
|
+
*/
|
|
14
|
+
details(): Promise<GetNetworkResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Generates a response from the agent
|
|
17
|
+
* @param params - Generation parameters including prompt
|
|
18
|
+
* @returns Promise containing the generated response
|
|
19
|
+
*/
|
|
20
|
+
generate<Output extends JSONSchema7 | ZodSchema | undefined = undefined, StructuredOutput extends JSONSchema7 | ZodSchema | undefined = undefined>(params: GenerateParams<Output>): Promise<GenerateReturn<any, Output, StructuredOutput>>;
|
|
21
|
+
/**
|
|
22
|
+
* Streams a response from the agent
|
|
23
|
+
* @param params - Stream parameters including prompt
|
|
24
|
+
* @returns Promise containing the enhanced Response object with processDataStream method
|
|
25
|
+
*/
|
|
26
|
+
stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
|
|
27
|
+
processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/resources/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGhG,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,OAAQ,SAAQ,YAAY;IAGrC,OAAO,CAAC,SAAS;gBADjB,OAAO,EAAE,aAAa,EACd,SAAS,EAAE,MAAM;IAK3B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAItC;;;;OAIG;IACH,QAAQ,CACN,MAAM,SAAS,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,EAC9D,gBAAgB,SAAS,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,EACxE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAazF;;;;OAIG;IACG,MAAM,CAAC,CAAC,SAAS,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,EACpE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,OAAO,CACR,QAAQ,GAAG;QACT,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACzG,CACF;CA4BF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
2
|
+
import type { GetToolResponse, ClientOptions } from '../types';
|
|
3
|
+
import { BaseResource } from './base';
|
|
4
|
+
export declare class Tool extends BaseResource {
|
|
5
|
+
private toolId;
|
|
6
|
+
constructor(options: ClientOptions, toolId: string);
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves details about the tool
|
|
9
|
+
* @returns Promise containing tool details including description and schemas
|
|
10
|
+
*/
|
|
11
|
+
details(): Promise<GetToolResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Executes the tool with the provided parameters
|
|
14
|
+
* @param params - Parameters required for tool execution
|
|
15
|
+
* @returns Promise containing the tool execution results
|
|
16
|
+
*/
|
|
17
|
+
execute(params: {
|
|
18
|
+
data: any;
|
|
19
|
+
runId?: string;
|
|
20
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
21
|
+
}): Promise<any>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/resources/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,qBAAa,IAAK,SAAQ,YAAY;IAGlC,OAAO,CAAC,MAAM;gBADd,OAAO,EAAE,aAAa,EACd,MAAM,EAAE,MAAM;IAKxB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC;IAInC;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAiBpH"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { WatchEvent } from '@mastra/core/workflows';
|
|
2
|
+
import type { ClientOptions, GetVNextNetworkResponse, GenerateVNextNetworkResponse, LoopVNextNetworkResponse, GenerateOrStreamVNextNetworkParams, LoopStreamVNextNetworkParams } from '../types';
|
|
3
|
+
import { BaseResource } from './base';
|
|
4
|
+
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
5
|
+
export declare class VNextNetwork extends BaseResource {
|
|
6
|
+
private networkId;
|
|
7
|
+
constructor(options: ClientOptions, networkId: string);
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves details about the network
|
|
10
|
+
* @returns Promise containing vNext network details
|
|
11
|
+
*/
|
|
12
|
+
details(): Promise<GetVNextNetworkResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Generates a response from the v-next network
|
|
15
|
+
* @param params - Generation parameters including message
|
|
16
|
+
* @returns Promise containing the generated response
|
|
17
|
+
*/
|
|
18
|
+
generate(params: GenerateOrStreamVNextNetworkParams): Promise<GenerateVNextNetworkResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Generates a response from the v-next network using multiple primitives
|
|
21
|
+
* @param params - Generation parameters including message
|
|
22
|
+
* @returns Promise containing the generated response
|
|
23
|
+
*/
|
|
24
|
+
loop(params: {
|
|
25
|
+
message: string;
|
|
26
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
27
|
+
}): Promise<LoopVNextNetworkResponse>;
|
|
28
|
+
private streamProcessor;
|
|
29
|
+
/**
|
|
30
|
+
* Streams a response from the v-next network
|
|
31
|
+
* @param params - Stream parameters including message
|
|
32
|
+
* @returns Promise containing the results
|
|
33
|
+
*/
|
|
34
|
+
stream(params: GenerateOrStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Streams a response from the v-next network loop
|
|
37
|
+
* @param params - Stream parameters including message
|
|
38
|
+
* @returns Promise containing the results
|
|
39
|
+
*/
|
|
40
|
+
loopStream(params: LoopStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=vNextNetwork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vNextNetwork.d.ts","sourceRoot":"","sources":["../../src/resources/vNextNetwork.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,qBAAa,YAAa,SAAQ,YAAY;IAG1C,OAAO,CAAC,SAAS;gBADjB,OAAO,EAAE,aAAa,EACd,SAAS,EAAE,MAAM;IAK3B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAI3C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAU3F;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACvD,GAAG,OAAO,CAAC,wBAAwB,CAAC;YAUtB,eAAe;IAgE9B;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,kCAAkC,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI;IA2B/F;;;;OAIG;IACG,UAAU,CAAC,MAAM,EAAE,4BAA4B,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI;CA0B9F"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CreateIndexParams, GetVectorIndexResponse, QueryVectorParams, QueryVectorResponse, ClientOptions, UpsertVectorParams } from '../types';
|
|
2
|
+
import { BaseResource } from './base';
|
|
3
|
+
export declare class Vector extends BaseResource {
|
|
4
|
+
private vectorName;
|
|
5
|
+
constructor(options: ClientOptions, vectorName: string);
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves details about a specific vector index
|
|
8
|
+
* @param indexName - Name of the index to get details for
|
|
9
|
+
* @returns Promise containing vector index details
|
|
10
|
+
*/
|
|
11
|
+
details(indexName: string): Promise<GetVectorIndexResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Deletes a vector index
|
|
14
|
+
* @param indexName - Name of the index to delete
|
|
15
|
+
* @returns Promise indicating deletion success
|
|
16
|
+
*/
|
|
17
|
+
delete(indexName: string): Promise<{
|
|
18
|
+
success: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves a list of all available indexes
|
|
22
|
+
* @returns Promise containing array of index names
|
|
23
|
+
*/
|
|
24
|
+
getIndexes(): Promise<{
|
|
25
|
+
indexes: string[];
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new vector index
|
|
29
|
+
* @param params - Parameters for index creation including dimension and metric
|
|
30
|
+
* @returns Promise indicating creation success
|
|
31
|
+
*/
|
|
32
|
+
createIndex(params: CreateIndexParams): Promise<{
|
|
33
|
+
success: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Upserts vectors into an index
|
|
37
|
+
* @param params - Parameters containing vectors, metadata, and optional IDs
|
|
38
|
+
* @returns Promise containing array of vector IDs
|
|
39
|
+
*/
|
|
40
|
+
upsert(params: UpsertVectorParams): Promise<string[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Queries vectors in an index
|
|
43
|
+
* @param params - Query parameters including query vector and search options
|
|
44
|
+
* @returns Promise containing query results
|
|
45
|
+
*/
|
|
46
|
+
query(params: QueryVectorParams): Promise<QueryVectorResponse>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=vector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../src/resources/vector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,MAAO,SAAQ,YAAY;IAGpC,OAAO,CAAC,UAAU;gBADlB,OAAO,EAAE,aAAa,EACd,UAAU,EAAE,MAAM;IAK5B;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAI3D;;;;OAIG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAMxD;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAI5C;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAOrE;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOrD;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAM/D"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
2
|
+
import type { ClientOptions, GetWorkflowResponse, GetWorkflowRunsResponse, GetWorkflowRunsParams, WorkflowRunResult, WorkflowWatchResult, GetWorkflowRunByIdResponse, GetWorkflowRunExecutionResultResponse } from '../types';
|
|
3
|
+
import { BaseResource } from './base';
|
|
4
|
+
export declare class Workflow extends BaseResource {
|
|
5
|
+
private workflowId;
|
|
6
|
+
constructor(options: ClientOptions, workflowId: string);
|
|
7
|
+
/**
|
|
8
|
+
* Creates an async generator that processes a readable stream and yields workflow records
|
|
9
|
+
* separated by the Record Separator character (\x1E)
|
|
10
|
+
*
|
|
11
|
+
* @param stream - The readable stream to process
|
|
12
|
+
* @returns An async generator that yields parsed records
|
|
13
|
+
*/
|
|
14
|
+
private streamProcessor;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves details about the workflow
|
|
17
|
+
* @returns Promise containing workflow details including steps and graphs
|
|
18
|
+
*/
|
|
19
|
+
details(): Promise<GetWorkflowResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves all runs for a workflow
|
|
22
|
+
* @param params - Parameters for filtering runs
|
|
23
|
+
* @returns Promise containing workflow runs array
|
|
24
|
+
*/
|
|
25
|
+
runs(params?: GetWorkflowRunsParams): Promise<GetWorkflowRunsResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves a specific workflow run by its ID
|
|
28
|
+
* @param runId - The ID of the workflow run to retrieve
|
|
29
|
+
* @returns Promise containing the workflow run details
|
|
30
|
+
*/
|
|
31
|
+
runById(runId: string): Promise<GetWorkflowRunByIdResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the execution result for a specific workflow run by its ID
|
|
34
|
+
* @param runId - The ID of the workflow run to retrieve the execution result for
|
|
35
|
+
* @returns Promise containing the workflow run execution result
|
|
36
|
+
*/
|
|
37
|
+
runExecutionResult(runId: string): Promise<GetWorkflowRunExecutionResultResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Cancels a specific workflow run by its ID
|
|
40
|
+
* @param runId - The ID of the workflow run to cancel
|
|
41
|
+
* @returns Promise containing a success message
|
|
42
|
+
*/
|
|
43
|
+
cancelRun(runId: string): Promise<{
|
|
44
|
+
message: string;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Sends an event to a specific workflow run by its ID
|
|
48
|
+
* @param params - Object containing the runId, event and data
|
|
49
|
+
* @returns Promise containing a success message
|
|
50
|
+
*/
|
|
51
|
+
sendRunEvent(params: {
|
|
52
|
+
runId: string;
|
|
53
|
+
event: string;
|
|
54
|
+
data: unknown;
|
|
55
|
+
}): Promise<{
|
|
56
|
+
message: string;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new workflow run
|
|
60
|
+
* @param params - Optional object containing the optional runId
|
|
61
|
+
* @returns Promise containing the runId of the created run
|
|
62
|
+
*/
|
|
63
|
+
createRun(params?: {
|
|
64
|
+
runId?: string;
|
|
65
|
+
}): Promise<{
|
|
66
|
+
runId: string;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Creates a new workflow run (alias for createRun)
|
|
70
|
+
* @param params - Optional object containing the optional runId
|
|
71
|
+
* @returns Promise containing the runId of the created run
|
|
72
|
+
*/
|
|
73
|
+
createRunAsync(params?: {
|
|
74
|
+
runId?: string;
|
|
75
|
+
}): Promise<{
|
|
76
|
+
runId: string;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Starts a workflow run synchronously without waiting for the workflow to complete
|
|
80
|
+
* @param params - Object containing the runId, inputData and runtimeContext
|
|
81
|
+
* @returns Promise containing success message
|
|
82
|
+
*/
|
|
83
|
+
start(params: {
|
|
84
|
+
runId: string;
|
|
85
|
+
inputData: Record<string, any>;
|
|
86
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
87
|
+
}): Promise<{
|
|
88
|
+
message: string;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Resumes a suspended workflow step synchronously without waiting for the workflow to complete
|
|
92
|
+
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
93
|
+
* @returns Promise containing success message
|
|
94
|
+
*/
|
|
95
|
+
resume({ step, runId, resumeData, ...rest }: {
|
|
96
|
+
step: string | string[];
|
|
97
|
+
runId: string;
|
|
98
|
+
resumeData?: Record<string, any>;
|
|
99
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
message: string;
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
|
|
105
|
+
* @param params - Object containing the optional runId, inputData and runtimeContext
|
|
106
|
+
* @returns Promise containing the workflow execution results
|
|
107
|
+
*/
|
|
108
|
+
startAsync(params: {
|
|
109
|
+
runId?: string;
|
|
110
|
+
inputData: Record<string, any>;
|
|
111
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
112
|
+
}): Promise<WorkflowRunResult>;
|
|
113
|
+
/**
|
|
114
|
+
* Starts a workflow run and returns a stream
|
|
115
|
+
* @param params - Object containing the optional runId, inputData and runtimeContext
|
|
116
|
+
* @returns Promise containing the workflow execution results
|
|
117
|
+
*/
|
|
118
|
+
stream(params: {
|
|
119
|
+
runId?: string;
|
|
120
|
+
inputData: Record<string, any>;
|
|
121
|
+
runtimeContext?: RuntimeContext;
|
|
122
|
+
}): Promise<import("stream/web").ReadableStream<{
|
|
123
|
+
type: string;
|
|
124
|
+
payload: any;
|
|
125
|
+
}>>;
|
|
126
|
+
/**
|
|
127
|
+
* Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
|
|
128
|
+
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
129
|
+
* @returns Promise containing the workflow resume results
|
|
130
|
+
*/
|
|
131
|
+
resumeAsync(params: {
|
|
132
|
+
runId: string;
|
|
133
|
+
step: string | string[];
|
|
134
|
+
resumeData?: Record<string, any>;
|
|
135
|
+
runtimeContext?: RuntimeContext | Record<string, any>;
|
|
136
|
+
}): Promise<WorkflowRunResult>;
|
|
137
|
+
/**
|
|
138
|
+
* Watches workflow transitions in real-time
|
|
139
|
+
* @param runId - Optional run ID to filter the watch stream
|
|
140
|
+
* @returns AsyncGenerator that yields parsed records from the workflow watch stream
|
|
141
|
+
*/
|
|
142
|
+
watch({ runId }: {
|
|
143
|
+
runId?: string;
|
|
144
|
+
}, onRecord: (record: WorkflowWatchResult) => void): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Creates a new ReadableStream from an iterable or async iterable of objects,
|
|
147
|
+
* serializing each as JSON and separating them with the record separator (\x1E).
|
|
148
|
+
*
|
|
149
|
+
* @param records - An iterable or async iterable of objects to stream
|
|
150
|
+
* @returns A ReadableStream emitting the records as JSON strings separated by the record separator
|
|
151
|
+
*/
|
|
152
|
+
static createRecordStream(records: Iterable<any> | AsyncIterable<any>): ReadableStream;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/resources/workflow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