@mastra/client-js 1.10.0-alpha.2 → 1.10.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/CHANGELOG.md +42 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +18 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -12
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/workspace.d.ts +6 -2
- package/dist/resources/workspace.d.ts.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -280,6 +280,7 @@ var BaseResource = class {
|
|
|
280
280
|
async function executeToolCallAndRespond({
|
|
281
281
|
response,
|
|
282
282
|
params,
|
|
283
|
+
agentId,
|
|
283
284
|
resourceId,
|
|
284
285
|
threadId,
|
|
285
286
|
requestContext,
|
|
@@ -297,6 +298,7 @@ async function executeToolCallAndRespond({
|
|
|
297
298
|
requestContext,
|
|
298
299
|
tracingContext: { currentSpan: void 0 },
|
|
299
300
|
agent: {
|
|
301
|
+
agentId,
|
|
300
302
|
messages: response.messages,
|
|
301
303
|
toolCallId: toolCall?.payload.toolCallId,
|
|
302
304
|
suspend: async () => {
|
|
@@ -445,6 +447,7 @@ var Agent = class extends BaseResource {
|
|
|
445
447
|
requestContext,
|
|
446
448
|
tracingContext: { currentSpan: void 0 },
|
|
447
449
|
agent: {
|
|
450
|
+
agentId: this.agentId,
|
|
448
451
|
messages: response.messages,
|
|
449
452
|
toolCallId: toolCall?.toolCallId,
|
|
450
453
|
suspend: async () => {
|
|
@@ -505,6 +508,7 @@ var Agent = class extends BaseResource {
|
|
|
505
508
|
return executeToolCallAndRespond({
|
|
506
509
|
response,
|
|
507
510
|
params,
|
|
511
|
+
agentId: this.agentId,
|
|
508
512
|
resourceId,
|
|
509
513
|
threadId,
|
|
510
514
|
requestContext,
|
|
@@ -1134,6 +1138,7 @@ var Agent = class extends BaseResource {
|
|
|
1134
1138
|
// TODO: Pass proper tracing context when client-js supports tracing
|
|
1135
1139
|
tracingContext: { currentSpan: void 0 },
|
|
1136
1140
|
agent: {
|
|
1141
|
+
agentId: this.agentId,
|
|
1137
1142
|
messages: response.messages,
|
|
1138
1143
|
toolCallId: toolCall2?.toolCallId,
|
|
1139
1144
|
suspend: async () => {
|
|
@@ -1435,6 +1440,7 @@ var Agent = class extends BaseResource {
|
|
|
1435
1440
|
// TODO: Pass proper tracing context when client-js supports tracing
|
|
1436
1441
|
tracingContext: { currentSpan: void 0 },
|
|
1437
1442
|
agent: {
|
|
1443
|
+
agentId: this.agentId,
|
|
1438
1444
|
messages: response.messages,
|
|
1439
1445
|
toolCallId: toolCall2?.toolCallId,
|
|
1440
1446
|
suspend: async () => {
|
|
@@ -3632,28 +3638,29 @@ var ProcessorProvider = class extends BaseResource {
|
|
|
3632
3638
|
|
|
3633
3639
|
// src/resources/workspace.ts
|
|
3634
3640
|
var WorkspaceSkillResource = class extends BaseResource {
|
|
3635
|
-
constructor(options, workspaceId, skillName) {
|
|
3641
|
+
constructor(options, workspaceId, skillName, skillPath) {
|
|
3636
3642
|
super(options);
|
|
3637
3643
|
this.workspaceId = workspaceId;
|
|
3638
3644
|
this.skillName = skillName;
|
|
3645
|
+
this.skillPath = skillPath;
|
|
3646
|
+
this.basePath = `/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}`;
|
|
3647
|
+
this.pathQuery = this.skillPath ? `?path=${encodeURIComponent(this.skillPath)}` : "";
|
|
3639
3648
|
}
|
|
3649
|
+
basePath;
|
|
3650
|
+
pathQuery;
|
|
3640
3651
|
/**
|
|
3641
3652
|
* Gets the full details of this skill including instructions
|
|
3642
3653
|
* @returns Promise containing skill details
|
|
3643
3654
|
*/
|
|
3644
3655
|
details() {
|
|
3645
|
-
return this.request(
|
|
3646
|
-
`/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}`
|
|
3647
|
-
);
|
|
3656
|
+
return this.request(`${this.basePath}${this.pathQuery}`);
|
|
3648
3657
|
}
|
|
3649
3658
|
/**
|
|
3650
3659
|
* Lists all reference file paths for this skill
|
|
3651
3660
|
* @returns Promise containing list of reference paths
|
|
3652
3661
|
*/
|
|
3653
3662
|
listReferences() {
|
|
3654
|
-
return this.request(
|
|
3655
|
-
`/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}/references`
|
|
3656
|
-
);
|
|
3663
|
+
return this.request(`${this.basePath}/references${this.pathQuery}`);
|
|
3657
3664
|
}
|
|
3658
3665
|
/**
|
|
3659
3666
|
* Gets the content of a specific reference file
|
|
@@ -3661,9 +3668,7 @@ var WorkspaceSkillResource = class extends BaseResource {
|
|
|
3661
3668
|
* @returns Promise containing reference content
|
|
3662
3669
|
*/
|
|
3663
3670
|
getReference(referencePath) {
|
|
3664
|
-
return this.request(
|
|
3665
|
-
`/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}/references/${encodeURIComponent(referencePath)}`
|
|
3666
|
-
);
|
|
3671
|
+
return this.request(`${this.basePath}/references/${encodeURIComponent(referencePath)}${this.pathQuery}`);
|
|
3667
3672
|
}
|
|
3668
3673
|
};
|
|
3669
3674
|
var Workspace = class extends BaseResource {
|
|
@@ -3846,10 +3851,11 @@ var Workspace = class extends BaseResource {
|
|
|
3846
3851
|
/**
|
|
3847
3852
|
* Gets a skill instance for further operations
|
|
3848
3853
|
* @param skillName - Skill name identifier
|
|
3854
|
+
* @param skillPath - Optional skill path for disambiguation when multiple skills share the same name
|
|
3849
3855
|
* @returns WorkspaceSkillResource instance
|
|
3850
3856
|
*/
|
|
3851
|
-
getSkill(skillName) {
|
|
3852
|
-
return new WorkspaceSkillResource(this.options, this.workspaceId, skillName);
|
|
3857
|
+
getSkill(skillName, skillPath) {
|
|
3858
|
+
return new WorkspaceSkillResource(this.options, this.workspaceId, skillName, skillPath);
|
|
3853
3859
|
}
|
|
3854
3860
|
};
|
|
3855
3861
|
|