@mastra/client-js 0.12.4-alpha.2 → 0.13.0-alpha.4
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 +22 -0
- package/README.md +2 -6
- package/dist/index.cjs +21 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -20
- 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/workflow.d.ts +5 -7
- package/dist/resources/workflow.d.ts.map +1 -1
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.13.0-alpha.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Fully deprecated createRun (now throws an error) in favour of createRunAsync ([#7897](https://github.com/mastra-ai/mastra/pull/7897))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`fb84c21`](https://github.com/mastra-ai/mastra/commit/fb84c21859d09bdc8f158bd5412bdc4b5835a61c), [`9d4fc09`](https://github.com/mastra-ai/mastra/commit/9d4fc09b2ad55caa7738c7ceb3a905e454f74cdd), [`d75ccf0`](https://github.com/mastra-ai/mastra/commit/d75ccf06dfd2582b916aa12624e3cd61b279edf1), [`0fed8f2`](https://github.com/mastra-ai/mastra/commit/0fed8f2aa84b167b3415ea6f8f70755775132c8d), [`87fd07f`](https://github.com/mastra-ai/mastra/commit/87fd07ff35387a38728967163460231b5d33ae3b)]:
|
|
14
|
+
- @mastra/core@0.17.0-alpha.4
|
|
15
|
+
|
|
16
|
+
## 0.12.4-alpha.3
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Update peerdep of @mastra/core ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
|
|
23
|
+
- @mastra/core@0.17.0-alpha.3
|
|
24
|
+
|
|
3
25
|
## 0.12.4-alpha.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -81,8 +81,8 @@ const client = new MastraClient({
|
|
|
81
81
|
- `getWorkflows()`: Get all workflows
|
|
82
82
|
- `getWorkflow(workflowId)`: Get a workflow instance
|
|
83
83
|
- `workflow.details()`: Get workflow details
|
|
84
|
-
- `workflow.
|
|
85
|
-
- `workflow.
|
|
84
|
+
- `workflow.createRunAsync()`: Create workflow run
|
|
85
|
+
- `workflow.createRun()`: Deprecated - use createRunAsync() instead
|
|
86
86
|
- `workflow.startAsync(params)`: Execute the workflow and wait for execution results
|
|
87
87
|
- `workflow.resumeAsync(params)`: Resume suspended workflow step async
|
|
88
88
|
- `workflow.watch({runId},(record)=>{})`: Watch the step transitions of the workflow run
|
|
@@ -125,7 +125,3 @@ The client uses the native `fetch` API internally for making HTTP requests. All
|
|
|
125
125
|
- Retry logic with exponential backoff
|
|
126
126
|
- Custom header management
|
|
127
127
|
- Error handling
|
|
128
|
-
|
|
129
|
-
## License
|
|
130
|
-
|
|
131
|
-
MIT
|
package/dist/index.cjs
CHANGED
|
@@ -1900,13 +1900,21 @@ var Workflow = class extends BaseResource {
|
|
|
1900
1900
|
body: { event: params.event, data: params.data }
|
|
1901
1901
|
});
|
|
1902
1902
|
}
|
|
1903
|
+
/**
|
|
1904
|
+
* @deprecated Use createRunAsync() instead.
|
|
1905
|
+
* @throws {Error} Always throws an error directing users to use createRunAsync()
|
|
1906
|
+
*/
|
|
1907
|
+
async createRun(_params) {
|
|
1908
|
+
throw new Error(
|
|
1909
|
+
"createRun() has been deprecated. Please use createRunAsync() instead.\n\nMigration guide:\n Before: const run = workflow.createRun();\n After: const run = await workflow.createRunAsync();\n\nNote: createRunAsync() is an async method, so make sure your calling function is async."
|
|
1910
|
+
);
|
|
1911
|
+
}
|
|
1903
1912
|
/**
|
|
1904
1913
|
* Creates a new workflow run
|
|
1905
1914
|
* @param params - Optional object containing the optional runId
|
|
1906
|
-
* @returns Promise containing the runId of the created run
|
|
1915
|
+
* @returns Promise containing the runId of the created run with methods to control execution
|
|
1907
1916
|
*/
|
|
1908
|
-
|
|
1909
|
-
async createRun(params) {
|
|
1917
|
+
async createRunAsync(params) {
|
|
1910
1918
|
const searchParams = new URLSearchParams();
|
|
1911
1919
|
if (!!params?.runId) {
|
|
1912
1920
|
searchParams.set("runId", params.runId);
|
|
@@ -1940,14 +1948,6 @@ var Workflow = class extends BaseResource {
|
|
|
1940
1948
|
}
|
|
1941
1949
|
};
|
|
1942
1950
|
}
|
|
1943
|
-
/**
|
|
1944
|
-
* Creates a new workflow run (alias for createRun)
|
|
1945
|
-
* @param params - Optional object containing the optional runId
|
|
1946
|
-
* @returns Promise containing the runId of the created run
|
|
1947
|
-
*/
|
|
1948
|
-
createRunAsync(params) {
|
|
1949
|
-
return this.createRun(params);
|
|
1950
|
-
}
|
|
1951
1951
|
/**
|
|
1952
1952
|
* Starts a workflow run synchronously without waiting for the workflow to complete
|
|
1953
1953
|
* @param params - Object containing the runId, inputData and runtimeContext
|
|
@@ -2309,11 +2309,20 @@ var AgentBuilder = class extends BaseResource {
|
|
|
2309
2309
|
};
|
|
2310
2310
|
}
|
|
2311
2311
|
}
|
|
2312
|
+
/**
|
|
2313
|
+
* @deprecated Use createRunAsync() instead.
|
|
2314
|
+
* @throws {Error} Always throws an error directing users to use createRunAsync()
|
|
2315
|
+
*/
|
|
2316
|
+
async createRun(_params) {
|
|
2317
|
+
throw new Error(
|
|
2318
|
+
"createRun() has been deprecated. Please use createRunAsync() instead.\n\nMigration guide:\n Before: const run = agentBuilder.createRun();\n After: const run = await agentBuilder.createRunAsync();\n\nNote: createRunAsync() is an async method, so make sure your calling function is async."
|
|
2319
|
+
);
|
|
2320
|
+
}
|
|
2312
2321
|
/**
|
|
2313
2322
|
* Creates a new agent builder action run and returns the runId.
|
|
2314
2323
|
* This calls `/api/agent-builder/:actionId/create-run`.
|
|
2315
2324
|
*/
|
|
2316
|
-
async
|
|
2325
|
+
async createRunAsync(params) {
|
|
2317
2326
|
const searchParams = new URLSearchParams();
|
|
2318
2327
|
if (!!params?.runId) {
|
|
2319
2328
|
searchParams.set("runId", params.runId);
|
|
@@ -2323,14 +2332,6 @@ var AgentBuilder = class extends BaseResource {
|
|
|
2323
2332
|
method: "POST"
|
|
2324
2333
|
});
|
|
2325
2334
|
}
|
|
2326
|
-
/**
|
|
2327
|
-
* Creates a new workflow run (alias for createRun)
|
|
2328
|
-
* @param params - Optional object containing the optional runId
|
|
2329
|
-
* @returns Promise containing the runId of the created run
|
|
2330
|
-
*/
|
|
2331
|
-
createRunAsync(params) {
|
|
2332
|
-
return this.createRun(params);
|
|
2333
|
-
}
|
|
2334
2335
|
/**
|
|
2335
2336
|
* Starts agent builder action asynchronously and waits for completion.
|
|
2336
2337
|
* This calls `/api/agent-builder/:actionId/start-async`.
|