@alva-ai/toolkit 0.9.3 → 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/cli.js CHANGED
@@ -9575,7 +9575,8 @@ var DeployResource = class {
9575
9575
  path: params.path,
9576
9576
  cron_expression: params.cron_expression,
9577
9577
  args: params.args,
9578
- push_notify: params.push_notify
9578
+ push_notify: params.push_notify,
9579
+ max_heap_size_mb: params.max_heap_size_mb
9579
9580
  }
9580
9581
  });
9581
9582
  }
@@ -9729,6 +9730,11 @@ var FeedResource = class {
9729
9730
  };
9730
9731
 
9731
9732
  // src/resources/playbooks.ts
9733
+ var PLAYBOOK_VISIBILITIES = [
9734
+ "public",
9735
+ "private",
9736
+ "paid"
9737
+ ];
9732
9738
  var PlaybooksResource = class {
9733
9739
  constructor(client) {
9734
9740
  this.client = client;
@@ -9762,6 +9768,30 @@ var PlaybooksResource = class {
9762
9768
  has_next: raw.has_next ?? false
9763
9769
  };
9764
9770
  }
9771
+ /**
9772
+ * Set a playbook's visibility. Requires authentication; the owner is
9773
+ * resolved server-side from the authenticated user, so only the playbook
9774
+ * `name` is needed.
9775
+ *
9776
+ * Note: `private` and `paid` are paid-tier capabilities. A free-tier user
9777
+ * receives a `PERMISSION_DENIED` error from the gateway, which is surfaced
9778
+ * here unchanged.
9779
+ */
9780
+ async setVisibility(params) {
9781
+ if (!PLAYBOOK_VISIBILITIES.includes(params.visibility)) {
9782
+ throw new AlvaError(
9783
+ "INVALID_ARGUMENT",
9784
+ `Invalid visibility "${params.visibility}". Expected one of: ${PLAYBOOK_VISIBILITIES.join(", ")}.`,
9785
+ 400
9786
+ );
9787
+ }
9788
+ this.client._requireAuth();
9789
+ return await this.client._request(
9790
+ "POST",
9791
+ `/api/v1/playbook/${encodeURIComponent(params.name)}/visibility`,
9792
+ { body: { visibility: params.visibility } }
9793
+ );
9794
+ }
9765
9795
  };
9766
9796
  function toAgentPlaybook(raw) {
9767
9797
  const username = raw.creator?.name ?? "";
@@ -12485,7 +12515,7 @@ function formatPlaybookSkillFile(file) {
12485
12515
  import * as fs2 from "fs";
12486
12516
  import * as os2 from "os";
12487
12517
  import * as fsPromises2 from "fs/promises";
12488
- var CLI_VERSION = true ? "0.9.3" : "dev";
12518
+ var CLI_VERSION = true ? "0.9.5" : "dev";
12489
12519
  function isVersionOlderThan(a, b) {
12490
12520
  const parse4 = (v) => {
12491
12521
  if (!v) return null;
@@ -12515,7 +12545,7 @@ Commands:
12515
12545
  release Feed and playbook releases (feed, playbook-draft, playbook)
12516
12546
  lint Design-system lint (playbook)
12517
12547
  feed Feed lifecycle management (delete)
12518
- playbooks Playbook discovery (trending)
12548
+ playbooks Playbook discovery (trending) and visibility
12519
12549
  secrets Secret management (create, list, get, update, delete)
12520
12550
  sdk SDK documentation (doc, partitions, partition-summary)
12521
12551
  skillhub Playbook skills (list, tags, get, file)
@@ -12756,13 +12786,14 @@ Subcommands:
12756
12786
  runs List runs for a cronjob (cursor-paginated)
12757
12787
  run-logs Get stdout/stderr logs for a single cronjob run
12758
12788
 
12759
- Create flags:
12760
- --name <name> Cronjob name (required, 1-63 lowercase alphanumeric/hyphens)
12761
- --path <path> Path to script on ALFS (required, must exist)
12762
- --cron <expression> Cron expression (required, e.g. "0 */4 * * *")
12789
+ Create/Update flags:
12790
+ --name <name> Cronjob name (required on create, 1-63 lowercase alphanumeric/hyphens)
12791
+ --path <path> Path to script on ALFS (required on create, must exist)
12792
+ --cron <expression> Cron expression (required on create, e.g. "0 */4 * * *")
12763
12793
  --args <json> JSON object passed to require("env").args
12764
12794
  --push-notify Enable Telegram push notifications on completion
12765
12795
  --no-push-notify Disable push notifications
12796
+ --max-heap-size-mb <mb> Override per-cronjob V8 heap limit (1-2046, default uses server config)
12766
12797
 
12767
12798
  List flags:
12768
12799
  --limit <n> Max results per page (default: 20)
@@ -12836,7 +12867,8 @@ Examples:
12836
12867
  Find public playbooks with an agent-friendly response shape.
12837
12868
 
12838
12869
  Subcommands:
12839
- trending List trending playbooks
12870
+ trending List trending playbooks
12871
+ set-visibility Set a playbook's visibility (requires auth)
12840
12872
 
12841
12873
  Trending flags:
12842
12874
  --keyword <text> Search text
@@ -12847,6 +12879,10 @@ Trending flags:
12847
12879
  --cursor <cursor> Pagination cursor from previous response
12848
12880
  --current <cursor> Backward-compatible cursor alias
12849
12881
 
12882
+ Set-visibility flags:
12883
+ --name <name> Playbook name (required; owner derived from auth)
12884
+ --visibility <v> public, private, or paid (required, case-insensitive)
12885
+
12850
12886
  Response fields:
12851
12887
  playbooks[].ref "username/name" identifier for agents
12852
12888
  playbooks[].url_path Web path: /username/playbooks/name
@@ -12855,10 +12891,17 @@ Response fields:
12855
12891
  playbooks[].follow_count Social proof signal
12856
12892
  playbooks[].cursor Cursor for pagination
12857
12893
  has_next Whether another page exists
12894
+ playbook_path "<owner>/<name>" echoed by set-visibility
12895
+
12896
+ Notes:
12897
+ private and paid are paid-tier features; free-tier accounts get a
12898
+ PERMISSION_DENIED error from the gateway.
12858
12899
 
12859
12900
  Examples:
12860
12901
  alva playbooks trending --keyword scanner --tags macro,ai --sort recent --limit 5
12861
- alva playbooks trending --tag btc --cursor abc`,
12902
+ alva playbooks trending --tag btc --cursor abc
12903
+ alva playbooks set-visibility --name my-scanner --visibility private
12904
+ alva playbooks set-visibility --name my-scanner --visibility public`,
12862
12905
  release: `Usage: alva release <subcommand> [options]
12863
12906
 
12864
12907
  Publish feeds and playbooks to the Alva platform. The typical workflow:
@@ -13458,6 +13501,16 @@ function trendingPlaybooksSort(val) {
13458
13501
  "playbooks"
13459
13502
  );
13460
13503
  }
13504
+ function playbookVisibility(val) {
13505
+ const normalized = val.trim().toLowerCase();
13506
+ if (PLAYBOOK_VISIBILITIES.includes(normalized)) {
13507
+ return normalized;
13508
+ }
13509
+ throw new CliUsageError(
13510
+ `--visibility must be one of ${PLAYBOOK_VISIBILITIES.join(", ")} for 'playbooks set-visibility', got '${val}'`,
13511
+ "playbooks"
13512
+ );
13513
+ }
13461
13514
  function jsonParse(val) {
13462
13515
  if (val === void 0) return void 0;
13463
13516
  try {
@@ -13636,7 +13689,14 @@ async function dispatch(client, args, meta) {
13636
13689
  path: requireFlag(flags, "path", "deploy create"),
13637
13690
  cron_expression: requireFlag(flags, "cron", "deploy create"),
13638
13691
  args: jsonParse(flags["args"]),
13639
- push_notify: boolFlag(flags["push-notify"])
13692
+ push_notify: boolFlag(flags["push-notify"]),
13693
+ max_heap_size_mb: optionalBoundedIntegerFlag(
13694
+ flags,
13695
+ "max-heap-size-mb",
13696
+ "deploy create",
13697
+ 1,
13698
+ 2046
13699
+ )
13640
13700
  });
13641
13701
  case "list":
13642
13702
  return client.deploy.list({
@@ -13653,7 +13713,14 @@ async function dispatch(client, args, meta) {
13653
13713
  name: flags["name"],
13654
13714
  cron_expression: flags["cron"],
13655
13715
  args: jsonParse(flags["args"]),
13656
- push_notify: boolFlag(flags["push-notify"])
13716
+ push_notify: boolFlag(flags["push-notify"]),
13717
+ max_heap_size_mb: optionalBoundedIntegerFlag(
13718
+ flags,
13719
+ "max-heap-size-mb",
13720
+ "deploy update",
13721
+ 1,
13722
+ 2046
13723
+ )
13657
13724
  });
13658
13725
  case "delete":
13659
13726
  return client.deploy.delete({
@@ -13720,6 +13787,13 @@ async function dispatch(client, args, meta) {
13720
13787
  cursor: flags["cursor"],
13721
13788
  current: flags["current"]
13722
13789
  });
13790
+ case "set-visibility":
13791
+ return client.playbooks.setVisibility({
13792
+ name: requireFlag(flags, "name", "playbooks set-visibility"),
13793
+ visibility: playbookVisibility(
13794
+ requireFlag(flags, "visibility", "playbooks set-visibility")
13795
+ )
13796
+ });
13723
13797
  default:
13724
13798
  throw new CliUsageError(
13725
13799
  `Unknown subcommand: playbooks ${subcommand}`,