@alva-ai/toolkit 0.23.1 → 0.24.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.
@@ -229,7 +229,8 @@ interface Cronjob {
229
229
  path: string;
230
230
  cron_expression: string;
231
231
  status: string;
232
- args: Record<string, unknown>;
232
+ /** Valid current rows are objects; legacy invalid rows are returned as strings. */
233
+ args: Record<string, unknown> | string | null;
233
234
  /** Whether successful Feed runs may deliver alerts to subscribers. */
234
235
  push_notify: boolean;
235
236
  /** Per-cronjob V8 heap cap (MB). null when using the server default. */
@@ -448,6 +449,42 @@ interface AutomationUpdateResponse {
448
449
  version: string;
449
450
  cronjob_id: number;
450
451
  }
452
+ interface AutomationEmailDelivery {
453
+ isEnabled: boolean;
454
+ isAvailable: boolean;
455
+ address: string | null;
456
+ }
457
+ interface AutomationAlertDelivery {
458
+ isEnabled: boolean;
459
+ alvaChannels: Array<{
460
+ id: string;
461
+ }>;
462
+ email: AutomationEmailDelivery;
463
+ }
464
+ interface AutomationAlertDeliveryGetRequest {
465
+ /** Positive decimal automation id kept as a string to preserve int64 precision. */
466
+ id: string;
467
+ }
468
+ interface AutomationAlertDeliveryUpdateRequest {
469
+ /** Positive decimal automation id kept as a string to preserve int64 precision. */
470
+ id: string;
471
+ /** Replace Alva destinations when present; an explicit empty list clears them. */
472
+ alvaChannelIds?: readonly string[];
473
+ /** Update only the verified-account email destination when present. */
474
+ emailEnabled?: boolean;
475
+ }
476
+ interface AutomationAlertDeliveryUpdateResponse {
477
+ automation: {
478
+ id: string;
479
+ };
480
+ alertDelivery: {
481
+ isEnabled: boolean;
482
+ alvaChannels?: Array<{
483
+ id: string;
484
+ }>;
485
+ email?: AutomationEmailDelivery;
486
+ };
487
+ }
451
488
  interface FeedStatusUpdateRequest {
452
489
  /** Numeric feed id to stop/resume. */
453
490
  id: number;
@@ -1085,17 +1122,26 @@ declare class RunResource {
1085
1122
  private client;
1086
1123
  constructor(client: AlvaClient);
1087
1124
  execute(params: RunRequest): Promise<RunResponse>;
1125
+ /** @internal Used by the CLI to preserve the exact --args JSON text. */
1126
+ _executeSerializedArgs(params: RunRequest, serializedArgs: string): Promise<RunResponse>;
1127
+ private request;
1088
1128
  }
1089
1129
 
1090
1130
  declare class DeployResource {
1091
1131
  private client;
1092
1132
  constructor(client: AlvaClient);
1093
1133
  create(params: CronjobCreateRequest): Promise<Cronjob>;
1134
+ /** @internal Used by the CLI to preserve the exact --args JSON text. */
1135
+ _createSerializedArgs(params: CronjobCreateRequest, serializedArgs: string): Promise<Cronjob>;
1136
+ private createRequest;
1094
1137
  list(params?: CronjobListParams): Promise<CronjobListResponse>;
1095
1138
  get(params: {
1096
1139
  id: number;
1097
1140
  }): Promise<Cronjob>;
1098
1141
  update(params: CronjobUpdateRequest): Promise<Cronjob>;
1142
+ /** @internal Used by the CLI to preserve the exact --args JSON text. */
1143
+ _updateSerializedArgs(params: CronjobUpdateRequest, serializedArgs: string): Promise<Cronjob>;
1144
+ private updateRequest;
1099
1145
  delete(params: {
1100
1146
  id: number;
1101
1147
  }): Promise<void>;
@@ -1211,6 +1257,7 @@ declare class FeedResource {
1211
1257
  */
1212
1258
  declare class AutomationResource {
1213
1259
  private client;
1260
+ readonly delivery: AutomationAlertDeliveryResource;
1214
1261
  constructor(client: AlvaClient);
1215
1262
  list(params?: FeedListParams): Promise<FeedListResponse>;
1216
1263
  /**
@@ -1224,6 +1271,13 @@ declare class AutomationResource {
1224
1271
  delete(params: FeedDeleteRequest): Promise<FeedDeleteResponse>;
1225
1272
  publish(params: FeedReleaseRequest): Promise<FeedReleaseResponse>;
1226
1273
  }
1274
+ declare class AutomationAlertDeliveryResource {
1275
+ private client;
1276
+ constructor(client: AlvaClient);
1277
+ get(params: AutomationAlertDeliveryGetRequest): Promise<AutomationAlertDelivery>;
1278
+ update(params: AutomationAlertDeliveryUpdateRequest): Promise<AutomationAlertDeliveryUpdateResponse>;
1279
+ private graphql;
1280
+ }
1227
1281
 
1228
1282
  /** Playbook visibility states understood by the gateway. */
1229
1283
  type PlaybookVisibility = 'public' | 'private' | 'paid';
@@ -2102,7 +2156,7 @@ declare const BOOLEAN_FLAGS: Set<string>;
2102
2156
  * Compares major.minor.patch as integers. Returns false on malformed input.
2103
2157
  */
2104
2158
  declare function isVersionOlderThan(a: string, b: string): boolean;
2105
- declare const HELP_TEXT = "Usage: alva <command> [options]\n\nCommands:\n configure Save API key and endpoint to a named profile\n whoami Verify credentials and show current identity\n user User profile operations (me)\n fs Filesystem operations (read, write, stat, readdir, mkdir, remove, rename, copy, symlink, readlink, chmod, grant, revoke)\n run Execute code in the Alva runtime\n deploy Cronjob management (create, list, get, update, delete, pause, resume, runs, run-logs)\n loop Self-scheduled in-channel goal loops (create)\n service-account Restricted run-as identities (create, list, delete, grant, revoke)\n release Feed and playbook releases (feed, playbook-draft, playbook)\n lint Design-system lint (playbook)\n automation Automation management (list, inspect, publish, update, stop, resume, delete)\n alert Alert management (list, follows, enable, disable, history, preferences, enable-session-completed, disable-session-completed)\n feed Legacy automation alias (list, stop, resume, delete, set-visibility)\n playbooks Playbook discovery (trending, get, list) and visibility\n functions Playbook UDF function management (register, list, delete, invoke, allowance)\n credits Credit wallet and self-scoped usage history (wallet, items)\n secrets Secret management (create, list, get, update, delete)\n sdk SDK documentation (doc, partitions, partition-summary)\n skillhub Playbook skills (list, tags, get, file)\n data-skills Data-skill documentation from the Arrays backend (list, summary, endpoint)\n comments Playbook comments (create, pin, unpin)\n notification-history Feed notification delivery history (list-feed)\n notification-preferences Notification preferences (list, enable-session-completed, disable-session-completed)\n feedback Submit user-confirmed Alva platform feedback (submit)\n subscriptions Playbook follows and feed alert subscriptions\n remix Save playbook remix lineage\n portfolio Connected-account portfolio (accounts, summary, activities)\n markets Company narrative and earnings context (narrative, earnings)\n trading Trading operations (accounts, portfolio, orders, subscriptions, equity-history, risk-rules, subscribe, unsubscribe, execute, update-risk-rules)\n broker Agentic order execution \u2014 venue-native passthrough to trex (accounts, quote, order, balance, positions, ...; run 'alva broker describe')\n auth Authentication (login)\n screenshot Capture a web screenshot as PNG\n arrays Arrays backend operations (token ensure, token status)\n\nGlobal options:\n --api-key <key> API key (overrides env and config file)\n --base-url <url> API base URL (overrides env and config file)\n --profile <name> Named profile to use (default: \"default\")\n --arrays-endpoint <url> Arrays backend URL (or ARRAYS_ENDPOINT env; default: https://data-tools.prd.space.id)\n -v, --version Show CLI version\n --help Show help (use 'alva <command> --help' for command details)\n\nConfig resolution: --api-key flag > ALVA_API_KEY env > profile in ~/.config/alva/config.json\nProfile resolution: --profile flag > ALVA_PROFILE env > \"default\"\n\nQuick start:\n npm install -g @alva-ai/toolkit\n alva configure --api-key alva_your_key_here\n alva whoami";
2159
+ declare const HELP_TEXT = "Usage: alva <command> [options]\n\nCommands:\n configure Save API key and endpoint to a named profile\n whoami Verify credentials and show current identity\n user User profile operations (me)\n fs Filesystem operations (read, write, stat, readdir, mkdir, remove, rename, copy, symlink, readlink, chmod, grant, revoke)\n run Execute code in the Alva runtime\n deploy Cronjob management (create, list, get, update, delete, pause, resume, runs, run-logs)\n loop Self-scheduled in-channel goal loops (create)\n service-account Restricted run-as identities (create, list, delete, grant, revoke)\n release Feed and playbook releases (feed, playbook-draft, playbook)\n lint Design-system lint (playbook)\n automation Automation management (list, inspect, publish, update, delivery, stop, resume, delete)\n alert Alert management (list, follows, enable, disable, history, preferences, enable-session-completed, disable-session-completed)\n feed Legacy automation alias (list, stop, resume, delete, set-visibility)\n playbooks Playbook discovery (trending, get, list) and visibility\n functions Playbook UDF function management (register, list, delete, invoke, allowance)\n credits Credit wallet and self-scoped usage history (wallet, items)\n secrets Secret management (create, list, get, update, delete)\n sdk SDK documentation (doc, partitions, partition-summary)\n skillhub Playbook skills (list, tags, get, file)\n data-skills Data-skill documentation from the Arrays backend (list, summary, endpoint)\n comments Playbook comments (create, pin, unpin)\n notification-history Feed notification delivery history (list-feed)\n notification-preferences Notification preferences (list, enable-session-completed, disable-session-completed)\n feedback Submit user-confirmed Alva platform feedback (submit)\n subscriptions Playbook follows and feed alert subscriptions\n remix Save playbook remix lineage\n portfolio Connected-account portfolio (accounts, summary, activities)\n markets Company narrative and earnings context (narrative, earnings)\n trading Trading operations (accounts, portfolio, orders, subscriptions, equity-history, risk-rules, subscribe, unsubscribe, execute, update-risk-rules)\n broker Agentic order execution \u2014 venue-native passthrough to trex (accounts, quote, order, balance, positions, ...; run 'alva broker describe')\n auth Authentication (login)\n screenshot Capture a web screenshot as PNG\n arrays Arrays backend operations (token ensure, token status)\n\nGlobal options:\n --api-key <key> API key (overrides env and config file)\n --base-url <url> API base URL (overrides env and config file)\n --profile <name> Named profile to use (default: \"default\")\n --arrays-endpoint <url> Arrays backend URL (or ARRAYS_ENDPOINT env; default: https://data-tools.prd.space.id)\n -v, --version Show CLI version\n --help Show help (use 'alva <command> --help' for command details)\n\nConfig resolution: --api-key flag > ALVA_API_KEY env > profile in ~/.config/alva/config.json\nProfile resolution: --profile flag > ALVA_PROFILE env > \"default\"\n\nQuick start:\n npm install -g @alva-ai/toolkit\n alva configure --api-key alva_your_key_here\n alva whoami";
2106
2160
  declare const COMMAND_HELP: Record<string, string>;
2107
2161
  type AlvaCliRuntimeMode = 'nodejs' | 'jagent';
2108
2162
  interface DispatchLocalFiles {
package/dist/dispatch.js CHANGED
@@ -6129,6 +6129,12 @@ var COMMAND_DEFINITIONS = [
6129
6129
  ],
6130
6130
  booleans: ["trigger"]
6131
6131
  }),
6132
+ command("automation delivery"),
6133
+ command("automation delivery get", { values: ["id"] }),
6134
+ command("automation delivery update", {
6135
+ values: ["id", "alva-channel-ids"],
6136
+ booleans: ["email-enabled"]
6137
+ }),
6132
6138
  command("automation stop", { values: ["id"] }),
6133
6139
  command("automation resume", { values: ["id"] }),
6134
6140
  command("automation delete", { values: ["id"] }),
@@ -10267,8 +10273,72 @@ ${formatReport(report, "human")}
10267
10273
  return report;
10268
10274
  }
10269
10275
 
10276
+ // src/jsonPayload.ts
10277
+ var MAX_SAFE_INTEGER_DIGITS = "9007199254740991";
10278
+ function scaledIntegerGreater(left, leftTrailingZeros, right, rightTrailingZeros) {
10279
+ const leftLength = left.length + leftTrailingZeros;
10280
+ const rightLength = right.length + rightTrailingZeros;
10281
+ if (leftLength !== rightLength) return leftLength > rightLength;
10282
+ for (let index = 0; index < leftLength; index++) {
10283
+ const leftDigit = index < left.length ? left[index] : "0";
10284
+ const rightDigit = index < right.length ? right[index] : "0";
10285
+ if (leftDigit !== rightDigit) return leftDigit > rightDigit;
10286
+ }
10287
+ return false;
10288
+ }
10289
+ function numberOutsideSafeRange(token) {
10290
+ const match = token.match(
10291
+ /^-?(?<whole>\d+)(?:\.(?<fraction>\d+))?(?:[eE](?<exponent>[+-]?\d+))?$/
10292
+ );
10293
+ if (!match?.groups) return true;
10294
+ const whole = match.groups.whole;
10295
+ const fraction = match.groups.fraction ?? "";
10296
+ const exponent = Number(match.groups.exponent ?? "0");
10297
+ if (!Number.isSafeInteger(exponent)) return true;
10298
+ const digits = (whole + fraction).replace(/^0+/, "") || "0";
10299
+ if (digits === "0") return false;
10300
+ const scale = exponent - fraction.length;
10301
+ return scale >= 0 ? scaledIntegerGreater(digits, scale, MAX_SAFE_INTEGER_DIGITS, 0) : scaledIntegerGreater(digits, 0, MAX_SAFE_INTEGER_DIGITS, -scale);
10302
+ }
10303
+ function validateJSONNumberTokens(raw) {
10304
+ let index = 0;
10305
+ while (index < raw.length) {
10306
+ if (raw[index] === '"') {
10307
+ index++;
10308
+ while (index < raw.length) {
10309
+ if (raw[index] === "\\") {
10310
+ index += 2;
10311
+ } else if (raw[index++] === '"') {
10312
+ break;
10313
+ }
10314
+ }
10315
+ continue;
10316
+ }
10317
+ if (raw[index] === "-" || /\d/.test(raw[index] ?? "")) {
10318
+ const match = raw.slice(index).match(/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/);
10319
+ if (match) {
10320
+ if (numberOutsideSafeRange(match[0])) {
10321
+ throw new TypeError(
10322
+ "args contains a number outside JavaScript's safe range; use a string for int64 and identifier values"
10323
+ );
10324
+ }
10325
+ index += match[0].length;
10326
+ continue;
10327
+ }
10328
+ }
10329
+ index++;
10330
+ }
10331
+ }
10332
+ function validateSerializedArgs(raw) {
10333
+ const value = JSON.parse(raw);
10334
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
10335
+ throw new TypeError("args must be a JSON object");
10336
+ }
10337
+ validateJSONNumberTokens(raw);
10338
+ }
10339
+
10270
10340
  // src/cli/dispatch.ts
10271
- var CLI_VERSION = true ? "0.23.1" : "dev";
10341
+ var CLI_VERSION = true ? "0.24.0" : "dev";
10272
10342
  var DEFAULT_RUN_TIMEOUT_MS = 6e5;
10273
10343
  var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
10274
10344
  var GLOBAL_VALUE_FLAGS = Object.entries(GLOBAL_FLAG_DEFINITIONS).filter(([, kind]) => kind === "value").map(([name]) => `--${name}`);
@@ -10314,7 +10384,7 @@ Commands:
10314
10384
  service-account Restricted run-as identities (create, list, delete, grant, revoke)
10315
10385
  release Feed and playbook releases (feed, playbook-draft, playbook)
10316
10386
  lint Design-system lint (playbook)
10317
- automation Automation management (list, inspect, publish, update, stop, resume, delete)
10387
+ automation Automation management (list, inspect, publish, update, delivery, stop, resume, delete)
10318
10388
  alert Alert management (list, follows, enable, disable, history, preferences, enable-session-completed, disable-session-completed)
10319
10389
  feed Legacy automation alias (list, stop, resume, delete, set-visibility)
10320
10390
  playbooks Playbook discovery (trending, get, list) and visibility
@@ -10742,6 +10812,7 @@ Subcommands:
10742
10812
  inspect Inspect one automation and show its flow config path when available
10743
10813
  publish First-publish/register a new automation after deploying its cronjob
10744
10814
  update Partially update an existing automation by numeric id
10815
+ delivery Get or partially update per-automation alert destinations
10745
10816
  stop Stop an automation's producer cronjob
10746
10817
  resume Resume a stopped automation's producer cronjob
10747
10818
  delete Soft-delete an automation
@@ -10777,6 +10848,16 @@ Update flags:
10777
10848
  --agent-type <type> Replace agent kind; explicit empty clears it
10778
10849
  --trigger Trigger one run after the update commits
10779
10850
 
10851
+ Delivery subcommands:
10852
+ delivery get Read Alva channel and verified-email destinations
10853
+ delivery update Update only the destination fields explicitly provided
10854
+
10855
+ Delivery flags:
10856
+ --id <automation_id> Existing automation id (required)
10857
+ --alva-channel-ids <a,b> Replace Alva destinations; empty clears them
10858
+ --email-enabled Enable verified-account email delivery
10859
+ --no-email-enabled Disable email delivery
10860
+
10780
10861
  Lifecycle flags:
10781
10862
  --id <automation_id> Numeric automation id (required for inspect/update/stop/resume/delete)
10782
10863
 
@@ -10787,6 +10868,10 @@ Examples:
10787
10868
  alva automation publish --name btc-ema --version 1.0.0 --cronjob-id 42
10788
10869
  alva automation update --id 42 --description "Updated BTC EMA"
10789
10870
  alva automation update --id 42 --version 2.0.0 --trigger
10871
+ alva automation delivery get --id 42
10872
+ alva automation delivery update --id 42 --email-enabled
10873
+ alva automation delivery update --id 42 --no-email-enabled
10874
+ alva automation delivery update --id 42 --alva-channel-ids 0,123
10790
10875
  alva automation stop --id 42
10791
10876
  alva automation resume --id 42
10792
10877
  alva automation delete --id 42`,
@@ -11570,6 +11655,18 @@ function boolFlag(val) {
11570
11655
  if (val === "false") return false;
11571
11656
  return void 0;
11572
11657
  }
11658
+ function serializedJSONFlag(value, command2) {
11659
+ if (value === void 0) return void 0;
11660
+ try {
11661
+ validateSerializedArgs(value);
11662
+ } catch (error) {
11663
+ throw new CliUsageError(
11664
+ `--args must contain valid JSON for '${command2}': ${error instanceof Error ? error.message : String(error)}`,
11665
+ command2.split(" ")[0]
11666
+ );
11667
+ }
11668
+ return value;
11669
+ }
11573
11670
  function requireFlag(flags, name, command2) {
11574
11671
  const val = flags[name];
11575
11672
  if (val === void 0) {
@@ -11845,6 +11942,23 @@ function automationUpdateParams(flags) {
11845
11942
  }
11846
11943
  return params;
11847
11944
  }
11945
+ function automationDeliveryUpdateParams(flags) {
11946
+ const command2 = "automation delivery update";
11947
+ const id = requirePositiveIntegerStringFlag(flags, "id", command2);
11948
+ const alvaChannelIds = flags["alva-channel-ids"] === void 0 ? void 0 : csvList(flags["alva-channel-ids"]) ?? [];
11949
+ const emailEnabled = boolFlag(flags["email-enabled"]);
11950
+ if (alvaChannelIds === void 0 && emailEnabled === void 0) {
11951
+ throw new CliUsageError(
11952
+ "automation delivery update requires --alva-channel-ids or --email-enabled/--no-email-enabled",
11953
+ "automation"
11954
+ );
11955
+ }
11956
+ return {
11957
+ id,
11958
+ alvaChannelIds,
11959
+ emailEnabled
11960
+ };
11961
+ }
11848
11962
  function trendingPlaybooksSort(val) {
11849
11963
  if (val === void 0) return void 0;
11850
11964
  const normalized = val.trim().toUpperCase();
@@ -12407,11 +12521,10 @@ async function dispatch(client, args, meta, deps) {
12407
12521
  }
12408
12522
  const timeout_ms = runTimeoutMs(flags, deps);
12409
12523
  configureRunFetchTimeout(timeout_ms, deps);
12410
- return client.run.execute({
12524
+ const params = {
12411
12525
  code,
12412
12526
  entry_path: flags["entry-path"],
12413
12527
  working_dir: flags["working-dir"],
12414
- args: jsonParse(flags["args"]),
12415
12528
  max_heap_size_mb: optionalBoundedIntegerFlag(
12416
12529
  flags,
12417
12530
  "max-heap-size-mb",
@@ -12420,18 +12533,19 @@ async function dispatch(client, args, meta, deps) {
12420
12533
  2048
12421
12534
  ),
12422
12535
  timeout_ms
12423
- });
12536
+ };
12537
+ const serializedArgs = serializedJSONFlag(flags["args"], "run");
12538
+ return serializedArgs === void 0 ? client.run.execute(params) : client.run._executeSerializedArgs(params, serializedArgs);
12424
12539
  }
12425
12540
  case "deploy": {
12426
12541
  if (!subcommand)
12427
12542
  throw new CliUsageError("Missing subcommand for deploy", "deploy");
12428
12543
  switch (subcommand) {
12429
- case "create":
12430
- return client.deploy.create({
12544
+ case "create": {
12545
+ const params = {
12431
12546
  name: requireFlag(flags, "name", "deploy create"),
12432
12547
  path: requireFlag(flags, "path", "deploy create"),
12433
12548
  cron_expression: requireFlag(flags, "cron", "deploy create"),
12434
- args: jsonParse(flags["args"]),
12435
12549
  push_notify: boolFlag(flags["push-notify"]),
12436
12550
  max_heap_size_mb: optionalBoundedIntegerFlag(
12437
12551
  flags,
@@ -12451,7 +12565,13 @@ async function dispatch(client, args, meta, deps) {
12451
12565
  flags,
12452
12566
  "deploy create"
12453
12567
  )
12454
- });
12568
+ };
12569
+ const serializedArgs = serializedJSONFlag(
12570
+ flags["args"],
12571
+ "deploy create"
12572
+ );
12573
+ return serializedArgs === void 0 ? client.deploy.create(params) : client.deploy._createSerializedArgs(params, serializedArgs);
12574
+ }
12455
12575
  case "list":
12456
12576
  return client.deploy.list({
12457
12577
  limit: num(flags["limit"]),
@@ -12461,12 +12581,11 @@ async function dispatch(client, args, meta, deps) {
12461
12581
  return client.deploy.get({
12462
12582
  id: requireNumericFlag(flags, "id", "deploy get")
12463
12583
  });
12464
- case "update":
12465
- return client.deploy.update({
12584
+ case "update": {
12585
+ const params = {
12466
12586
  id: requireNumericFlag(flags, "id", "deploy update"),
12467
12587
  name: flags["name"],
12468
12588
  cron_expression: flags["cron"],
12469
- args: jsonParse(flags["args"]),
12470
12589
  push_notify: boolFlag(flags["push-notify"]),
12471
12590
  max_heap_size_mb: optionalBoundedIntegerFlag(
12472
12591
  flags,
@@ -12483,7 +12602,13 @@ async function dispatch(client, args, meta, deps) {
12483
12602
  3600
12484
12603
  ),
12485
12604
  run_as_user_id: resolveRunAsFlag(flags, "deploy update")
12486
- });
12605
+ };
12606
+ const serializedArgs = serializedJSONFlag(
12607
+ flags["args"],
12608
+ "deploy update"
12609
+ );
12610
+ return serializedArgs === void 0 ? client.deploy.update(params) : client.deploy._updateSerializedArgs(params, serializedArgs);
12611
+ }
12487
12612
  case "delete":
12488
12613
  return client.deploy.delete({
12489
12614
  id: requireNumericFlag(flags, "id", "deploy delete")
@@ -12714,6 +12839,31 @@ async function dispatch(client, args, meta, deps) {
12714
12839
  );
12715
12840
  case "update":
12716
12841
  return client.automation.update(automationUpdateParams(flags));
12842
+ case "delivery": {
12843
+ const leaf = parsedCommand.path[2];
12844
+ if (!leaf || leaf === "--help" || leaf === "-h") {
12845
+ return { _help: true, text: COMMAND_HELP.automation };
12846
+ }
12847
+ switch (leaf) {
12848
+ case "get":
12849
+ return client.automation.delivery.get({
12850
+ id: requirePositiveIntegerStringFlag(
12851
+ flags,
12852
+ "id",
12853
+ "automation delivery get"
12854
+ )
12855
+ });
12856
+ case "update":
12857
+ return client.automation.delivery.update(
12858
+ automationDeliveryUpdateParams(flags)
12859
+ );
12860
+ default:
12861
+ throw new CliUsageError(
12862
+ `Unknown subcommand: automation delivery ${leaf}`,
12863
+ "automation"
12864
+ );
12865
+ }
12866
+ }
12717
12867
  case "stop":
12718
12868
  return client.automation.stop({
12719
12869
  id: requireNumericFlag(flags, "id", "automation stop")