@mastra/client-js 1.0.0-beta.7 → 1.0.0-beta.9
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 +16 -0
- package/dist/client.d.ts +20 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/index.cjs +81 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/stored-agent.d.ts +26 -0
- package/dist/resources/stored-agent.d.ts.map +1 -0
- package/dist/types.d.ts +99 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix `saveMessageToMemory` return type to match API response. The method now correctly returns `{ messages: (MastraMessageV1 | MastraDBMessage)[] }` instead of `(MastraMessageV1 | MastraDBMessage)[]` to align with the server endpoint response schema. ([#10996](https://github.com/mastra-ai/mastra/pull/10996))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`72df8ae`](https://github.com/mastra-ai/mastra/commit/72df8ae595584cdd7747d5c39ffaca45e4507227), [`9198899`](https://github.com/mastra-ai/mastra/commit/91988995c427b185c33714b7f3be955367911324), [`653e65a`](https://github.com/mastra-ai/mastra/commit/653e65ae1f9502c2958a32f47a5a2df11e612a92), [`c6fd6fe`](https://github.com/mastra-ai/mastra/commit/c6fd6fedd09e9cf8004b03a80925f5e94826ad7e), [`0bed332`](https://github.com/mastra-ai/mastra/commit/0bed332843f627202c6520eaf671771313cd20f3)]:
|
|
10
|
+
- @mastra/core@1.0.0-beta.9
|
|
11
|
+
|
|
12
|
+
## 1.0.0-beta.8
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`0d41fe2`](https://github.com/mastra-ai/mastra/commit/0d41fe245355dfc66d61a0d9c85d9400aac351ff), [`6b3ba91`](https://github.com/mastra-ai/mastra/commit/6b3ba91494cc10394df96782f349a4f7b1e152cc), [`7907fd1`](https://github.com/mastra-ai/mastra/commit/7907fd1c5059813b7b870b81ca71041dc807331b)]:
|
|
17
|
+
- @mastra/core@1.0.0-beta.8
|
|
18
|
+
|
|
3
19
|
## 1.0.0-beta.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/client.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { ServerDetailInfo } from '@mastra/core/mcp';
|
|
|
2
2
|
import type { RequestContext } from '@mastra/core/request-context';
|
|
3
3
|
import type { TraceRecord, TracesPaginatedArg } from '@mastra/core/storage';
|
|
4
4
|
import type { WorkflowInfo } from '@mastra/core/workflows';
|
|
5
|
-
import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource, A2A, MCPTool, AgentBuilder } from './resources/index.js';
|
|
6
|
-
import type { ClientOptions, CreateMemoryThreadParams, CreateMemoryThreadResponse, GetAgentResponse, GetLogParams, GetLogsParams, GetLogsResponse, GetToolResponse, GetWorkflowResponse, SaveMessageToMemoryParams, SaveMessageToMemoryResponse, McpServerListResponse, McpServerToolListResponse, GetScorerResponse, ListScoresByScorerIdParams, ListScoresResponse, ListScoresByRunIdParams, ListScoresByEntityIdParams, ListScoresBySpanParams, SaveScoreParams, SaveScoreResponse, GetTracesResponse, GetMemoryConfigParams, GetMemoryConfigResponse, ListMemoryThreadMessagesResponse, MemorySearchResponse, ListAgentsModelProvidersResponse, ListMemoryThreadsParams, ListMemoryThreadsResponse } from './types.js';
|
|
5
|
+
import { Agent, MemoryThread, Tool, Workflow, Vector, BaseResource, A2A, MCPTool, AgentBuilder, StoredAgent } from './resources/index.js';
|
|
6
|
+
import type { ClientOptions, CreateMemoryThreadParams, CreateMemoryThreadResponse, GetAgentResponse, GetLogParams, GetLogsParams, GetLogsResponse, GetToolResponse, GetWorkflowResponse, SaveMessageToMemoryParams, SaveMessageToMemoryResponse, McpServerListResponse, McpServerToolListResponse, GetScorerResponse, ListScoresByScorerIdParams, ListScoresResponse, ListScoresByRunIdParams, ListScoresByEntityIdParams, ListScoresBySpanParams, SaveScoreParams, SaveScoreResponse, GetTracesResponse, GetMemoryConfigParams, GetMemoryConfigResponse, ListMemoryThreadMessagesResponse, MemorySearchResponse, ListAgentsModelProvidersResponse, ListMemoryThreadsParams, ListMemoryThreadsResponse, ListStoredAgentsParams, ListStoredAgentsResponse, CreateStoredAgentParams, StoredAgentResponse } from './types.js';
|
|
7
7
|
export declare class MastraClient extends BaseResource {
|
|
8
8
|
private observability;
|
|
9
9
|
constructor(options: ClientOptions);
|
|
@@ -254,5 +254,23 @@ export declare class MastraClient extends BaseResource {
|
|
|
254
254
|
status: string;
|
|
255
255
|
message: string;
|
|
256
256
|
}>;
|
|
257
|
+
/**
|
|
258
|
+
* Lists all stored agents with optional pagination
|
|
259
|
+
* @param params - Optional pagination and ordering parameters
|
|
260
|
+
* @returns Promise containing paginated list of stored agents
|
|
261
|
+
*/
|
|
262
|
+
listStoredAgents(params?: ListStoredAgentsParams): Promise<ListStoredAgentsResponse>;
|
|
263
|
+
/**
|
|
264
|
+
* Creates a new stored agent
|
|
265
|
+
* @param params - Agent configuration including id, name, instructions, model, etc.
|
|
266
|
+
* @returns Promise containing the created stored agent
|
|
267
|
+
*/
|
|
268
|
+
createStoredAgent(params: CreateStoredAgentParams): Promise<StoredAgentResponse>;
|
|
269
|
+
/**
|
|
270
|
+
* Gets a stored agent instance by ID for further operations (details, update, delete)
|
|
271
|
+
* @param storedAgentId - ID of the stored agent to retrieve
|
|
272
|
+
* @returns StoredAgent instance
|
|
273
|
+
*/
|
|
274
|
+
getStoredAgent(storedAgentId: string): StoredAgent;
|
|
257
275
|
}
|
|
258
276
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,GAAG,EACH,OAAO,EACP,YAAY,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,GAAG,EACH,OAAO,EACP,YAAY,EAEZ,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,eAAe,EACf,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;IAI/C,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIjE,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI7E,KAAK,CAAC,MAAM,EAAE;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,KAAK,CAAC;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACtD,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAQhD;;;;OAIG;IACI,gBAAgB,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAsB3F;;;;OAIG;IACI,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAOvF;;;;OAIG;IACI,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW;CAG1D"}
|
package/dist/index.cjs
CHANGED
|
@@ -2836,6 +2836,41 @@ var Observability = class extends BaseResource {
|
|
|
2836
2836
|
}
|
|
2837
2837
|
};
|
|
2838
2838
|
|
|
2839
|
+
// src/resources/stored-agent.ts
|
|
2840
|
+
var StoredAgent = class extends BaseResource {
|
|
2841
|
+
constructor(options, storedAgentId) {
|
|
2842
|
+
super(options);
|
|
2843
|
+
this.storedAgentId = storedAgentId;
|
|
2844
|
+
}
|
|
2845
|
+
/**
|
|
2846
|
+
* Retrieves details about the stored agent
|
|
2847
|
+
* @returns Promise containing stored agent details
|
|
2848
|
+
*/
|
|
2849
|
+
details() {
|
|
2850
|
+
return this.request(`/api/stored/agents/${encodeURIComponent(this.storedAgentId)}`);
|
|
2851
|
+
}
|
|
2852
|
+
/**
|
|
2853
|
+
* Updates the stored agent with the provided fields
|
|
2854
|
+
* @param params - Fields to update
|
|
2855
|
+
* @returns Promise containing the updated stored agent
|
|
2856
|
+
*/
|
|
2857
|
+
update(params) {
|
|
2858
|
+
return this.request(`/api/stored/agents/${encodeURIComponent(this.storedAgentId)}`, {
|
|
2859
|
+
method: "PATCH",
|
|
2860
|
+
body: params
|
|
2861
|
+
});
|
|
2862
|
+
}
|
|
2863
|
+
/**
|
|
2864
|
+
* Deletes the stored agent
|
|
2865
|
+
* @returns Promise containing deletion confirmation
|
|
2866
|
+
*/
|
|
2867
|
+
delete() {
|
|
2868
|
+
return this.request(`/api/stored/agents/${encodeURIComponent(this.storedAgentId)}`, {
|
|
2869
|
+
method: "DELETE"
|
|
2870
|
+
});
|
|
2871
|
+
}
|
|
2872
|
+
};
|
|
2873
|
+
|
|
2839
2874
|
// src/client.ts
|
|
2840
2875
|
var MastraClient = class extends BaseResource {
|
|
2841
2876
|
observability;
|
|
@@ -3351,6 +3386,52 @@ var MastraClient = class extends BaseResource {
|
|
|
3351
3386
|
score(params) {
|
|
3352
3387
|
return this.observability.score(params);
|
|
3353
3388
|
}
|
|
3389
|
+
// ============================================================================
|
|
3390
|
+
// Stored Agents
|
|
3391
|
+
// ============================================================================
|
|
3392
|
+
/**
|
|
3393
|
+
* Lists all stored agents with optional pagination
|
|
3394
|
+
* @param params - Optional pagination and ordering parameters
|
|
3395
|
+
* @returns Promise containing paginated list of stored agents
|
|
3396
|
+
*/
|
|
3397
|
+
listStoredAgents(params) {
|
|
3398
|
+
const searchParams = new URLSearchParams();
|
|
3399
|
+
if (params?.page !== void 0) {
|
|
3400
|
+
searchParams.set("page", String(params.page));
|
|
3401
|
+
}
|
|
3402
|
+
if (params?.perPage !== void 0) {
|
|
3403
|
+
searchParams.set("perPage", String(params.perPage));
|
|
3404
|
+
}
|
|
3405
|
+
if (params?.orderBy) {
|
|
3406
|
+
if (params.orderBy.field) {
|
|
3407
|
+
searchParams.set("orderBy[field]", params.orderBy.field);
|
|
3408
|
+
}
|
|
3409
|
+
if (params.orderBy.direction) {
|
|
3410
|
+
searchParams.set("orderBy[direction]", params.orderBy.direction);
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
const queryString = searchParams.toString();
|
|
3414
|
+
return this.request(`/api/stored/agents${queryString ? `?${queryString}` : ""}`);
|
|
3415
|
+
}
|
|
3416
|
+
/**
|
|
3417
|
+
* Creates a new stored agent
|
|
3418
|
+
* @param params - Agent configuration including id, name, instructions, model, etc.
|
|
3419
|
+
* @returns Promise containing the created stored agent
|
|
3420
|
+
*/
|
|
3421
|
+
createStoredAgent(params) {
|
|
3422
|
+
return this.request("/api/stored/agents", {
|
|
3423
|
+
method: "POST",
|
|
3424
|
+
body: params
|
|
3425
|
+
});
|
|
3426
|
+
}
|
|
3427
|
+
/**
|
|
3428
|
+
* Gets a stored agent instance by ID for further operations (details, update, delete)
|
|
3429
|
+
* @param storedAgentId - ID of the stored agent to retrieve
|
|
3430
|
+
* @returns StoredAgent instance
|
|
3431
|
+
*/
|
|
3432
|
+
getStoredAgent(storedAgentId) {
|
|
3433
|
+
return new StoredAgent(this.options, storedAgentId);
|
|
3434
|
+
}
|
|
3354
3435
|
};
|
|
3355
3436
|
|
|
3356
3437
|
// src/tools.ts
|