@mastra/client-js 1.5.0 → 1.6.0

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/index.js CHANGED
@@ -4346,6 +4346,21 @@ var ToolProvider = class extends BaseResource {
4346
4346
  }
4347
4347
  };
4348
4348
 
4349
+ // src/resources/processor-provider.ts
4350
+ var ProcessorProvider = class extends BaseResource {
4351
+ constructor(options, providerId) {
4352
+ super(options);
4353
+ this.providerId = providerId;
4354
+ }
4355
+ /**
4356
+ * Gets details about this processor provider and its available processors
4357
+ * @returns Promise containing provider info and processor list
4358
+ */
4359
+ details() {
4360
+ return this.request(`/processor-providers/${encodeURIComponent(this.providerId)}`);
4361
+ }
4362
+ };
4363
+
4349
4364
  // src/resources/workspace.ts
4350
4365
  var WorkspaceSkillResource = class extends BaseResource {
4351
4366
  constructor(options, workspaceId, skillName) {
@@ -4569,6 +4584,52 @@ var Workspace = class extends BaseResource {
4569
4584
  }
4570
4585
  };
4571
4586
 
4587
+ // src/resources/stored-skill.ts
4588
+ var StoredSkill = class extends BaseResource {
4589
+ constructor(options, storedSkillId) {
4590
+ super(options);
4591
+ this.storedSkillId = storedSkillId;
4592
+ }
4593
+ /**
4594
+ * Retrieves details about the stored skill
4595
+ * @param requestContext - Optional request context to pass as query parameter
4596
+ * @returns Promise containing stored skill details
4597
+ */
4598
+ details(requestContext) {
4599
+ return this.request(
4600
+ `/stored/skills/${encodeURIComponent(this.storedSkillId)}${requestContextQueryString(requestContext)}`
4601
+ );
4602
+ }
4603
+ /**
4604
+ * Updates the stored skill with the provided fields
4605
+ * @param params - Fields to update
4606
+ * @param requestContext - Optional request context to pass as query parameter
4607
+ * @returns Promise containing the updated stored skill
4608
+ */
4609
+ update(params, requestContext) {
4610
+ return this.request(
4611
+ `/stored/skills/${encodeURIComponent(this.storedSkillId)}${requestContextQueryString(requestContext)}`,
4612
+ {
4613
+ method: "PATCH",
4614
+ body: params
4615
+ }
4616
+ );
4617
+ }
4618
+ /**
4619
+ * Deletes the stored skill
4620
+ * @param requestContext - Optional request context to pass as query parameter
4621
+ * @returns Promise containing deletion confirmation
4622
+ */
4623
+ delete(requestContext) {
4624
+ return this.request(
4625
+ `/stored/skills/${encodeURIComponent(this.storedSkillId)}${requestContextQueryString(requestContext)}`,
4626
+ {
4627
+ method: "DELETE"
4628
+ }
4629
+ );
4630
+ }
4631
+ };
4632
+
4572
4633
  // src/client.ts
4573
4634
  var MastraClient = class extends BaseResource {
4574
4635
  observability;
@@ -5331,6 +5392,58 @@ var MastraClient = class extends BaseResource {
5331
5392
  return new StoredMCPClient(this.options, storedMCPClientId);
5332
5393
  }
5333
5394
  // ============================================================================
5395
+ // Stored Skills
5396
+ // ============================================================================
5397
+ /**
5398
+ * Lists all stored skills with optional pagination
5399
+ * @param params - Optional pagination and ordering parameters
5400
+ * @returns Promise containing paginated list of stored skills
5401
+ */
5402
+ listStoredSkills(params) {
5403
+ const searchParams = new URLSearchParams();
5404
+ if (params?.page !== void 0) {
5405
+ searchParams.set("page", String(params.page));
5406
+ }
5407
+ if (params?.perPage !== void 0) {
5408
+ searchParams.set("perPage", String(params.perPage));
5409
+ }
5410
+ if (params?.orderBy) {
5411
+ if (params.orderBy.field) {
5412
+ searchParams.set("orderBy[field]", params.orderBy.field);
5413
+ }
5414
+ if (params.orderBy.direction) {
5415
+ searchParams.set("orderBy[direction]", params.orderBy.direction);
5416
+ }
5417
+ }
5418
+ if (params?.authorId) {
5419
+ searchParams.set("authorId", params.authorId);
5420
+ }
5421
+ if (params?.metadata) {
5422
+ searchParams.set("metadata", JSON.stringify(params.metadata));
5423
+ }
5424
+ const queryString = searchParams.toString();
5425
+ return this.request(`/stored/skills${queryString ? `?${queryString}` : ""}`);
5426
+ }
5427
+ /**
5428
+ * Creates a new stored skill
5429
+ * @param params - Skill configuration
5430
+ * @returns Promise containing the created stored skill
5431
+ */
5432
+ createStoredSkill(params) {
5433
+ return this.request("/stored/skills", {
5434
+ method: "POST",
5435
+ body: params
5436
+ });
5437
+ }
5438
+ /**
5439
+ * Gets a stored skill instance by ID for further operations (details, update, delete)
5440
+ * @param storedSkillId - ID of the stored skill
5441
+ * @returns StoredSkill instance
5442
+ */
5443
+ getStoredSkill(storedSkillId) {
5444
+ return new StoredSkill(this.options, storedSkillId);
5445
+ }
5446
+ // ============================================================================
5334
5447
  // Tool Providers
5335
5448
  // ============================================================================
5336
5449
  /**
@@ -5349,6 +5462,24 @@ var MastraClient = class extends BaseResource {
5349
5462
  return new ToolProvider(this.options, providerId);
5350
5463
  }
5351
5464
  // ============================================================================
5465
+ // Processor Providers
5466
+ // ============================================================================
5467
+ /**
5468
+ * Lists all registered processor providers
5469
+ * @returns Promise containing list of processor provider info
5470
+ */
5471
+ getProcessorProviders() {
5472
+ return this.request("/processor-providers");
5473
+ }
5474
+ /**
5475
+ * Gets a processor provider instance by ID for further operations
5476
+ * @param providerId - ID of the processor provider
5477
+ * @returns ProcessorProvider instance
5478
+ */
5479
+ getProcessorProvider(providerId) {
5480
+ return new ProcessorProvider(this.options, providerId);
5481
+ }
5482
+ // ============================================================================
5352
5483
  // System
5353
5484
  // ============================================================================
5354
5485
  /**