@mastra/client-js 0.0.0-issue-7087-20250910004053 → 0.0.0-just-snapshot-20251014192224
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 +431 -3
- package/README.md +6 -10
- package/dist/client.d.ts +37 -39
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +559 -547
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +558 -548
- package/dist/index.js.map +1 -1
- package/dist/resources/agent-builder.d.ts +5 -6
- package/dist/resources/agent-builder.d.ts.map +1 -1
- package/dist/resources/agent.d.ts +72 -43
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/index.d.ts +0 -2
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/mcp-tool.d.ts +2 -1
- package/dist/resources/mcp-tool.d.ts.map +1 -1
- package/dist/resources/observability.d.ts +17 -1
- package/dist/resources/observability.d.ts.map +1 -1
- package/dist/resources/tool.d.ts +2 -1
- package/dist/resources/tool.d.ts.map +1 -1
- package/dist/resources/vector.d.ts +5 -2
- package/dist/resources/vector.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +119 -19
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/tools.d.ts +22 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/types.d.ts +65 -48
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/process-mastra-stream.d.ts +5 -1
- package/dist/utils/process-mastra-stream.d.ts.map +1 -1
- package/package.json +5 -6
- package/dist/resources/legacy-workflow.d.ts +0 -87
- package/dist/resources/legacy-workflow.d.ts.map +0 -1
- package/dist/resources/network.d.ts +0 -30
- package/dist/resources/network.d.ts.map +0 -1
- package/dist/resources/vNextNetwork.d.ts +0 -42
- package/dist/resources/vNextNetwork.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-just-snapshot-20251014192224",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"type": "module",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"json-schema": "^0.4.0",
|
|
40
40
|
"rxjs": "7.8.1",
|
|
41
41
|
"zod-to-json-schema": "^3.24.6",
|
|
42
|
-
"@mastra/core": "0.0.0-
|
|
42
|
+
"@mastra/core": "0.0.0-just-snapshot-20251014192224"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"zod": "^3.25.0 || ^4.0.0"
|
|
@@ -52,13 +52,12 @@
|
|
|
52
52
|
"@types/node": "^20.19.0",
|
|
53
53
|
"zod": "^3.25.76",
|
|
54
54
|
"ai": "^4.3.19",
|
|
55
|
-
"eslint": "^9.
|
|
56
|
-
"globby": "^14.1.0",
|
|
55
|
+
"eslint": "^9.36.0",
|
|
57
56
|
"tsup": "^8.5.0",
|
|
58
57
|
"typescript": "^5.8.3",
|
|
59
58
|
"vitest": "^3.2.4",
|
|
60
|
-
"@internal/
|
|
61
|
-
"@internal/
|
|
59
|
+
"@internal/lint": "0.0.0-just-snapshot-20251014192224",
|
|
60
|
+
"@internal/types-builder": "0.0.0-just-snapshot-20251014192224"
|
|
62
61
|
},
|
|
63
62
|
"scripts": {
|
|
64
63
|
"lint": "eslint .",
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { ClientOptions, LegacyWorkflowRunResult, GetLegacyWorkflowRunsResponse, GetWorkflowRunsParams, GetLegacyWorkflowResponse } from '../types.js';
|
|
2
|
-
import { BaseResource } from './base.js';
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,OA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MAAM,EAAE,GAAG,CAAC,CAAC;KAC9B,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAUpC;;;;;;OAMG;YACY,eAAe;IAgE9B;;;;OAIG;IACG,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI;CAiB/F"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { processDataStream } from '@ai-sdk/ui-utils';
|
|
2
|
-
import type { GenerateReturn } from '@mastra/core/llm';
|
|
3
|
-
import type { JSONSchema7 } from 'json-schema';
|
|
4
|
-
import type { ZodSchema } from 'zod';
|
|
5
|
-
import type { GenerateParams, ClientOptions, StreamParams, GetNetworkResponse } from '../types.js';
|
|
6
|
-
import { BaseResource } from './base.js';
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,kBAAkB,CAAC;AACvD,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"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { RuntimeContext } from '@mastra/core/runtime-context';
|
|
2
|
-
import type { WatchEvent } from '@mastra/core/workflows';
|
|
3
|
-
import type { ClientOptions, GetVNextNetworkResponse, GenerateVNextNetworkResponse, LoopVNextNetworkResponse, GenerateOrStreamVNextNetworkParams, LoopStreamVNextNetworkParams } from '../types.js';
|
|
4
|
-
import { BaseResource } from './base.js';
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vNextNetwork.d.ts","sourceRoot":"","sources":["../../src/resources/vNextNetwork.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,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;AAGlB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC,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"}
|