@mastra/client-js 1.45.1-alpha.1 → 1.46.0-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/dist/client.d.ts +19 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-harness-signals.md +39 -0
- package/dist/index.cjs +37 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/memory-thread.d.ts +10 -1
- package/dist/resources/memory-thread.d.ts.map +1 -1
- package/dist/route-types.generated.d.ts +54 -23
- package/dist/route-types.generated.d.ts.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2760,6 +2760,24 @@ var MemoryThread = class extends BaseResource {
|
|
|
2760
2760
|
body
|
|
2761
2761
|
});
|
|
2762
2762
|
}
|
|
2763
|
+
/**
|
|
2764
|
+
* Transfers ownership of the thread (and all of its messages) to a different resource.
|
|
2765
|
+
*
|
|
2766
|
+
* This is a privileged operation: the server rejects it when the caller is resource-scoped
|
|
2767
|
+
* (i.e. a per-user/tenant context). Unlike `update`, it does not reset the thread's `createdAt`.
|
|
2768
|
+
* @param params - Transfer parameters including the target `resourceId`, optional `agentId`, and request context.
|
|
2769
|
+
* @returns Promise containing the transferred thread with its new `resourceId`
|
|
2770
|
+
*/
|
|
2771
|
+
transfer(params) {
|
|
2772
|
+
const { agentId, requestContext, ...body } = params;
|
|
2773
|
+
const resolvedAgentId = agentId ?? this.agentId;
|
|
2774
|
+
const agentIdParam = resolvedAgentId ? `?agentId=${resolvedAgentId}` : "";
|
|
2775
|
+
const contextParam = requestContextQueryString(requestContext, agentIdParam ? "&" : "?");
|
|
2776
|
+
return this.request(`/memory/threads/${this.threadId}/transfer${agentIdParam}${contextParam}`, {
|
|
2777
|
+
method: "POST",
|
|
2778
|
+
body
|
|
2779
|
+
});
|
|
2780
|
+
}
|
|
2763
2781
|
};
|
|
2764
2782
|
/**
|
|
2765
2783
|
* Backwards-compat helper: `deleteMessages` historically accepted a `RequestContext` (or plain
|
|
@@ -6317,6 +6335,25 @@ function agentControllerMessageText(message) {
|
|
|
6317
6335
|
}
|
|
6318
6336
|
//#endregion
|
|
6319
6337
|
//#region src/client.ts
|
|
6338
|
+
/**
|
|
6339
|
+
* Provides typed access to agents, workflows, and other APIs on a running Mastra server.
|
|
6340
|
+
* Point `baseUrl` at your server and configure authentication when required.
|
|
6341
|
+
*
|
|
6342
|
+
* @example
|
|
6343
|
+
* ```typescript
|
|
6344
|
+
* import { MastraClient } from '@mastra/client-js';
|
|
6345
|
+
*
|
|
6346
|
+
* const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
|
|
6347
|
+
* ```
|
|
6348
|
+
*
|
|
6349
|
+
* @see For documentation bundled with your installed package, locate
|
|
6350
|
+
* `@mastra/client-js/package.json` with your project's resolver or package-manager
|
|
6351
|
+
* tooling, then read `dist/docs/SKILL.md` from that package root and follow its
|
|
6352
|
+
* reference links. Use package-manager tools for virtual or archived packages.
|
|
6353
|
+
*
|
|
6354
|
+
* @see [Client documentation](https://mastra.ai/reference/client-js/mastra-client)
|
|
6355
|
+
* if packaged docs are unavailable.
|
|
6356
|
+
*/
|
|
6320
6357
|
var MastraClient = class extends BaseResource {
|
|
6321
6358
|
observability;
|
|
6322
6359
|
conversations;
|