@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.d.cts CHANGED
@@ -785,6 +785,18 @@ declare class FeedResource {
785
785
  delete(params: FeedDeleteRequest): Promise<FeedDeleteResponse>;
786
786
  }
787
787
 
788
+ /** Playbook visibility states understood by the gateway. */
789
+ type PlaybookVisibility = 'public' | 'private' | 'paid';
790
+ interface SetVisibilityParams {
791
+ /** URL-safe playbook name. The owner is derived server-side from auth. */
792
+ name: string;
793
+ /** Target visibility: public, private, or paid. */
794
+ visibility: PlaybookVisibility;
795
+ }
796
+ interface SetVisibilityResponse {
797
+ /** ALFS-style "<owner>/<name>" path echoed back by the gateway. */
798
+ playbook_path: string;
799
+ }
788
800
  type TrendingPlaybooksSort = 'FOLLOWS' | 'RECENT';
789
801
  type TrendingPlaybooksDir = 'FORWARD' | 'BACKWARD';
790
802
  interface TrendingPlaybooksParams {
@@ -842,6 +854,16 @@ declare class PlaybooksResource {
842
854
  * it into a smaller, agent-friendly shape.
843
855
  */
844
856
  trending(params?: TrendingPlaybooksParams): Promise<TrendingPlaybooksResponse>;
857
+ /**
858
+ * Set a playbook's visibility. Requires authentication; the owner is
859
+ * resolved server-side from the authenticated user, so only the playbook
860
+ * `name` is needed.
861
+ *
862
+ * Note: `private` and `paid` are paid-tier capabilities. A free-tier user
863
+ * receives a `PERMISSION_DENIED` error from the gateway, which is surfaced
864
+ * here unchanged.
865
+ */
866
+ setVisibility(params: SetVisibilityParams): Promise<SetVisibilityResponse>;
845
867
  }
846
868
 
847
869
  declare class SecretsResource {
package/dist/index.d.ts CHANGED
@@ -785,6 +785,18 @@ declare class FeedResource {
785
785
  delete(params: FeedDeleteRequest): Promise<FeedDeleteResponse>;
786
786
  }
787
787
 
788
+ /** Playbook visibility states understood by the gateway. */
789
+ type PlaybookVisibility = 'public' | 'private' | 'paid';
790
+ interface SetVisibilityParams {
791
+ /** URL-safe playbook name. The owner is derived server-side from auth. */
792
+ name: string;
793
+ /** Target visibility: public, private, or paid. */
794
+ visibility: PlaybookVisibility;
795
+ }
796
+ interface SetVisibilityResponse {
797
+ /** ALFS-style "<owner>/<name>" path echoed back by the gateway. */
798
+ playbook_path: string;
799
+ }
788
800
  type TrendingPlaybooksSort = 'FOLLOWS' | 'RECENT';
789
801
  type TrendingPlaybooksDir = 'FORWARD' | 'BACKWARD';
790
802
  interface TrendingPlaybooksParams {
@@ -842,6 +854,16 @@ declare class PlaybooksResource {
842
854
  * it into a smaller, agent-friendly shape.
843
855
  */
844
856
  trending(params?: TrendingPlaybooksParams): Promise<TrendingPlaybooksResponse>;
857
+ /**
858
+ * Set a playbook's visibility. Requires authentication; the owner is
859
+ * resolved server-side from the authenticated user, so only the playbook
860
+ * `name` is needed.
861
+ *
862
+ * Note: `private` and `paid` are paid-tier capabilities. A free-tier user
863
+ * receives a `PERMISSION_DENIED` error from the gateway, which is surfaced
864
+ * here unchanged.
865
+ */
866
+ setVisibility(params: SetVisibilityParams): Promise<SetVisibilityResponse>;
845
867
  }
846
868
 
847
869
  declare class SecretsResource {
package/dist/index.js CHANGED
@@ -323,6 +323,11 @@ var FeedResource = class {
323
323
  };
324
324
 
325
325
  // src/resources/playbooks.ts
326
+ var PLAYBOOK_VISIBILITIES = [
327
+ "public",
328
+ "private",
329
+ "paid"
330
+ ];
326
331
  var PlaybooksResource = class {
327
332
  constructor(client) {
328
333
  this.client = client;
@@ -356,6 +361,30 @@ var PlaybooksResource = class {
356
361
  has_next: raw.has_next ?? false
357
362
  };
358
363
  }
364
+ /**
365
+ * Set a playbook's visibility. Requires authentication; the owner is
366
+ * resolved server-side from the authenticated user, so only the playbook
367
+ * `name` is needed.
368
+ *
369
+ * Note: `private` and `paid` are paid-tier capabilities. A free-tier user
370
+ * receives a `PERMISSION_DENIED` error from the gateway, which is surfaced
371
+ * here unchanged.
372
+ */
373
+ async setVisibility(params) {
374
+ if (!PLAYBOOK_VISIBILITIES.includes(params.visibility)) {
375
+ throw new AlvaError(
376
+ "INVALID_ARGUMENT",
377
+ `Invalid visibility "${params.visibility}". Expected one of: ${PLAYBOOK_VISIBILITIES.join(", ")}.`,
378
+ 400
379
+ );
380
+ }
381
+ this.client._requireAuth();
382
+ return await this.client._request(
383
+ "POST",
384
+ `/api/v1/playbook/${encodeURIComponent(params.name)}/visibility`,
385
+ { body: { visibility: params.visibility } }
386
+ );
387
+ }
359
388
  };
360
389
  function toAgentPlaybook(raw) {
361
390
  const username = raw.creator?.name ?? "";
@@ -2710,7 +2739,7 @@ var installPlaybookRuntime = (targetWindow) => {
2710
2739
  };
2711
2740
 
2712
2741
  // src/index.ts
2713
- var VERSION = true ? "0.9.4" : "dev";
2742
+ var VERSION = true ? "0.9.5" : "dev";
2714
2743
  export {
2715
2744
  AlvaClient,
2716
2745
  AlvaError,