@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 CHANGED
@@ -1,5 +1,47 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 1.10.0-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Add optional `?path=` query param to workspace skill routes for disambiguating same-named skills. ([#14430](https://github.com/mastra-ai/mastra/pull/14430))
8
+
9
+ Skill routes continue to use `:skillName` in the URL path (no breaking change). When two skills share the same name (e.g. from different directories), pass the optional `?path=` query parameter to select the exact skill:
10
+
11
+ ```
12
+ GET /workspaces/:workspaceId/skills/:skillName?path=skills/brand-guidelines
13
+ ```
14
+
15
+ `SkillMetadata` now includes a `path` field, and the `list()` method returns all same-named skills for disambiguation. The client SDK's `getSkill()` accepts an optional `skillPath` parameter for disambiguation.
16
+
17
+ - Updated skill search result types and query parameters to use `skillName`/`skillNames` instead of `skillPath`/`skillPaths` for consistency with the name-based public API. ([#14430](https://github.com/mastra-ai/mastra/pull/14430))
18
+
19
+ - Added storage type detection to the Metrics Dashboard. The `/system/packages` endpoint now returns `observabilityStorageType`, identifying the observability storage backend. The dashboard shows an empty state when the storage does not support metrics (e.g. PostgreSQL, LibSQL), and displays a warning when using in-memory storage since metrics are not persisted across server restarts. Also added a docs link button to the Metrics page header. ([#14620](https://github.com/mastra-ai/mastra/pull/14620))
20
+
21
+ ```ts
22
+ import { MastraClient } from '@mastra/client-js';
23
+
24
+ const client = new MastraClient();
25
+ const system = await client.getSystemPackages();
26
+
27
+ // system.observabilityStorageType contains the class name of the observability store:
28
+ // - 'ObservabilityInMemory' → metrics work but are not persisted across restarts
29
+ // - 'ObservabilityPG', 'ObservabilityLibSQL', etc. → metrics not supported
30
+
31
+ if (system.observabilityStorageType === 'ObservabilityInMemory') {
32
+ console.warn('Metrics are not persisted — data will be lost on server restart.');
33
+ }
34
+
35
+ const SUPPORTED = new Set(['ObservabilityInMemory']);
36
+ if (!SUPPORTED.has(system.observabilityStorageType ?? '')) {
37
+ console.error('Metrics require in-memory observability storage.');
38
+ }
39
+ ```
40
+
41
+ - Updated dependencies [[`423aa6f`](https://github.com/mastra-ai/mastra/commit/423aa6fd12406de6a1cc6b68e463d30af1d790fb), [`47358d9`](https://github.com/mastra-ai/mastra/commit/47358d960bb2b931321de7e798f341ab0df81f44), [`4bb5adc`](https://github.com/mastra-ai/mastra/commit/4bb5adc05c88e3a83fe1ea5ecb9eae6e17313124), [`4bb5adc`](https://github.com/mastra-ai/mastra/commit/4bb5adc05c88e3a83fe1ea5ecb9eae6e17313124)]:
42
+ - @mastra/core@1.16.0-alpha.3
43
+ - @mastra/schema-compat@1.2.7-alpha.1
44
+
3
45
  ## 1.10.0-alpha.2
4
46
 
5
47
  ### Patch Changes
@@ -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.10.0-alpha.2"
6
+ version: "1.10.0-alpha.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.10.0-alpha.2",
2
+ "version": "1.10.0-alpha.3",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -282,6 +282,7 @@ var BaseResource = class {
282
282
  async function executeToolCallAndRespond({
283
283
  response,
284
284
  params,
285
+ agentId,
285
286
  resourceId,
286
287
  threadId,
287
288
  requestContext,
@@ -299,6 +300,7 @@ async function executeToolCallAndRespond({
299
300
  requestContext,
300
301
  tracingContext: { currentSpan: void 0 },
301
302
  agent: {
303
+ agentId,
302
304
  messages: response.messages,
303
305
  toolCallId: toolCall?.payload.toolCallId,
304
306
  suspend: async () => {
@@ -447,6 +449,7 @@ var Agent = class extends BaseResource {
447
449
  requestContext,
448
450
  tracingContext: { currentSpan: void 0 },
449
451
  agent: {
452
+ agentId: this.agentId,
450
453
  messages: response.messages,
451
454
  toolCallId: toolCall?.toolCallId,
452
455
  suspend: async () => {
@@ -507,6 +510,7 @@ var Agent = class extends BaseResource {
507
510
  return executeToolCallAndRespond({
508
511
  response,
509
512
  params,
513
+ agentId: this.agentId,
510
514
  resourceId,
511
515
  threadId,
512
516
  requestContext,
@@ -1136,6 +1140,7 @@ var Agent = class extends BaseResource {
1136
1140
  // TODO: Pass proper tracing context when client-js supports tracing
1137
1141
  tracingContext: { currentSpan: void 0 },
1138
1142
  agent: {
1143
+ agentId: this.agentId,
1139
1144
  messages: response.messages,
1140
1145
  toolCallId: toolCall2?.toolCallId,
1141
1146
  suspend: async () => {
@@ -1437,6 +1442,7 @@ var Agent = class extends BaseResource {
1437
1442
  // TODO: Pass proper tracing context when client-js supports tracing
1438
1443
  tracingContext: { currentSpan: void 0 },
1439
1444
  agent: {
1445
+ agentId: this.agentId,
1440
1446
  messages: response.messages,
1441
1447
  toolCallId: toolCall2?.toolCallId,
1442
1448
  suspend: async () => {
@@ -3634,28 +3640,29 @@ var ProcessorProvider = class extends BaseResource {
3634
3640
 
3635
3641
  // src/resources/workspace.ts
3636
3642
  var WorkspaceSkillResource = class extends BaseResource {
3637
- constructor(options, workspaceId, skillName) {
3643
+ constructor(options, workspaceId, skillName, skillPath) {
3638
3644
  super(options);
3639
3645
  this.workspaceId = workspaceId;
3640
3646
  this.skillName = skillName;
3647
+ this.skillPath = skillPath;
3648
+ this.basePath = `/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}`;
3649
+ this.pathQuery = this.skillPath ? `?path=${encodeURIComponent(this.skillPath)}` : "";
3641
3650
  }
3651
+ basePath;
3652
+ pathQuery;
3642
3653
  /**
3643
3654
  * Gets the full details of this skill including instructions
3644
3655
  * @returns Promise containing skill details
3645
3656
  */
3646
3657
  details() {
3647
- return this.request(
3648
- `/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}`
3649
- );
3658
+ return this.request(`${this.basePath}${this.pathQuery}`);
3650
3659
  }
3651
3660
  /**
3652
3661
  * Lists all reference file paths for this skill
3653
3662
  * @returns Promise containing list of reference paths
3654
3663
  */
3655
3664
  listReferences() {
3656
- return this.request(
3657
- `/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}/references`
3658
- );
3665
+ return this.request(`${this.basePath}/references${this.pathQuery}`);
3659
3666
  }
3660
3667
  /**
3661
3668
  * Gets the content of a specific reference file
@@ -3663,9 +3670,7 @@ var WorkspaceSkillResource = class extends BaseResource {
3663
3670
  * @returns Promise containing reference content
3664
3671
  */
3665
3672
  getReference(referencePath) {
3666
- return this.request(
3667
- `/workspaces/${encodeURIComponent(this.workspaceId)}/skills/${encodeURIComponent(this.skillName)}/references/${encodeURIComponent(referencePath)}`
3668
- );
3673
+ return this.request(`${this.basePath}/references/${encodeURIComponent(referencePath)}${this.pathQuery}`);
3669
3674
  }
3670
3675
  };
3671
3676
  var Workspace = class extends BaseResource {
@@ -3848,10 +3853,11 @@ var Workspace = class extends BaseResource {
3848
3853
  /**
3849
3854
  * Gets a skill instance for further operations
3850
3855
  * @param skillName - Skill name identifier
3856
+ * @param skillPath - Optional skill path for disambiguation when multiple skills share the same name
3851
3857
  * @returns WorkspaceSkillResource instance
3852
3858
  */
3853
- getSkill(skillName) {
3854
- return new WorkspaceSkillResource(this.options, this.workspaceId, skillName);
3859
+ getSkill(skillName, skillPath) {
3860
+ return new WorkspaceSkillResource(this.options, this.workspaceId, skillName, skillPath);
3855
3861
  }
3856
3862
  };
3857
3863