@alva-ai/toolkit 0.9.4 → 0.9.5

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.cjs CHANGED
@@ -374,6 +374,11 @@ var FeedResource = class {
374
374
  };
375
375
 
376
376
  // src/resources/playbooks.ts
377
+ var PLAYBOOK_VISIBILITIES = [
378
+ "public",
379
+ "private",
380
+ "paid"
381
+ ];
377
382
  var PlaybooksResource = class {
378
383
  constructor(client) {
379
384
  this.client = client;
@@ -407,6 +412,30 @@ var PlaybooksResource = class {
407
412
  has_next: raw.has_next ?? false
408
413
  };
409
414
  }
415
+ /**
416
+ * Set a playbook's visibility. Requires authentication; the owner is
417
+ * resolved server-side from the authenticated user, so only the playbook
418
+ * `name` is needed.
419
+ *
420
+ * Note: `private` and `paid` are paid-tier capabilities. A free-tier user
421
+ * receives a `PERMISSION_DENIED` error from the gateway, which is surfaced
422
+ * here unchanged.
423
+ */
424
+ async setVisibility(params) {
425
+ if (!PLAYBOOK_VISIBILITIES.includes(params.visibility)) {
426
+ throw new AlvaError(
427
+ "INVALID_ARGUMENT",
428
+ `Invalid visibility "${params.visibility}". Expected one of: ${PLAYBOOK_VISIBILITIES.join(", ")}.`,
429
+ 400
430
+ );
431
+ }
432
+ this.client._requireAuth();
433
+ return await this.client._request(
434
+ "POST",
435
+ `/api/v1/playbook/${encodeURIComponent(params.name)}/visibility`,
436
+ { body: { visibility: params.visibility } }
437
+ );
438
+ }
410
439
  };
411
440
  function toAgentPlaybook(raw) {
412
441
  const username = raw.creator?.name ?? "";
@@ -2761,7 +2790,7 @@ var installPlaybookRuntime = (targetWindow) => {
2761
2790
  };
2762
2791
 
2763
2792
  // src/index.ts
2764
- var VERSION = true ? "0.9.4" : "dev";
2793
+ var VERSION = true ? "0.9.5" : "dev";
2765
2794
  // Annotate the CommonJS export names for ESM import in node:
2766
2795
  0 && (module.exports = {
2767
2796
  AlvaClient,