@mastra/client-js 1.13.5-alpha.2 → 1.13.5-alpha.3
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 +10 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +7 -2
- package/dist/docs/references/reference-client-js-mastra-client.md +23 -0
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 1.13.5-alpha.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed @mastra/client-js to re-export RequestContext so client SDK users can import it from @mastra/client-js. ([#15413](https://github.com/mastra-ai/mastra/pull/15413))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`fdd54cf`](https://github.com/mastra-ai/mastra/commit/fdd54cf612a9af876e9fdd85e534454f6e7dd518), [`7db42a9`](https://github.com/mastra-ai/mastra/commit/7db42a9cccd3b29c44fb0731f792c51575e8421c), [`30456b6`](https://github.com/mastra-ai/mastra/commit/30456b6b08c8fd17e109dd093b73d93b65e83bc5), [`9d11a8c`](https://github.com/mastra-ai/mastra/commit/9d11a8c1c8924eb975a245a5884d40ca1b7e0491), [`d246696`](https://github.com/mastra-ai/mastra/commit/d246696139a3144a5b21b042d41c532688e957e1), [`354f9ce`](https://github.com/mastra-ai/mastra/commit/354f9ce1ca6af2074b6a196a23f8ec30012dccca), [`e9837b5`](https://github.com/mastra-ai/mastra/commit/e9837b53699e18711b09e0ca010a4106376f2653)]:
|
|
10
|
+
- @mastra/core@1.26.0-alpha.3
|
|
11
|
+
- @mastra/schema-compat@1.2.9-alpha.1
|
|
12
|
+
|
|
3
13
|
## 1.13.5-alpha.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-client-js
|
|
|
3
3
|
description: Documentation for @mastra/client-js. Use when working with @mastra/client-js APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/client-js"
|
|
6
|
-
version: "1.13.5-alpha.
|
|
6
|
+
version: "1.13.5-alpha.3"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.13.5-alpha.
|
|
2
|
+
"version": "1.13.5-alpha.3",
|
|
3
3
|
"package": "@mastra/client-js",
|
|
4
|
-
"exports": {
|
|
4
|
+
"exports": {
|
|
5
|
+
"RequestContext": {
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"implementation": "dist/request-context"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
5
10
|
"modules": {}
|
|
6
11
|
}
|
|
@@ -12,6 +12,29 @@ export const mastraClient = new MastraClient({
|
|
|
12
12
|
})
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## `RequestContext`
|
|
16
|
+
|
|
17
|
+
When you use `RequestContext` with the client SDK, import it from `@mastra/client-js`.
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { MastraClient, RequestContext } from '@mastra/client-js'
|
|
21
|
+
|
|
22
|
+
const client = new MastraClient({
|
|
23
|
+
baseUrl: 'http://localhost:4111/',
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const requestContext = new RequestContext()
|
|
27
|
+
requestContext.set('userId', 'user-123')
|
|
28
|
+
|
|
29
|
+
const agent = client.getAgent('support-agent')
|
|
30
|
+
|
|
31
|
+
const response = await agent.generate('Summarize this ticket', {
|
|
32
|
+
requestContext,
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
You can also pass `requestContext` as a `Record<string, any>`.
|
|
37
|
+
|
|
15
38
|
## Parameters
|
|
16
39
|
|
|
17
40
|
**baseUrl** (`string`): The base URL for the Mastra API. All requests will be sent relative to this URL.
|
package/dist/index.cjs
CHANGED
|
@@ -5758,6 +5758,10 @@ function createTool(opts) {
|
|
|
5758
5758
|
return new ClientTool(opts);
|
|
5759
5759
|
}
|
|
5760
5760
|
|
|
5761
|
+
Object.defineProperty(exports, "RequestContext", {
|
|
5762
|
+
enumerable: true,
|
|
5763
|
+
get: function () { return requestContext.RequestContext; }
|
|
5764
|
+
});
|
|
5761
5765
|
exports.ClientTool = ClientTool;
|
|
5762
5766
|
exports.MastraClient = MastraClient;
|
|
5763
5767
|
exports.MastraClientError = MastraClientError;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { v4 } from '@lukeed/uuid';
|
|
|
3
3
|
import { getErrorFromUnknown } from '@mastra/core/error';
|
|
4
4
|
import { standardSchemaToJSONSchema, toStandardSchema } from '@mastra/schema-compat/schema';
|
|
5
5
|
import { RequestContext } from '@mastra/core/request-context';
|
|
6
|
+
export { RequestContext } from '@mastra/core/request-context';
|
|
6
7
|
import { zodToJsonSchema as zodToJsonSchema$1 } from '@mastra/schema-compat/zod-to-json';
|
|
7
8
|
|
|
8
9
|
// src/resources/agent.ts
|