@alva-ai/toolkit 0.23.1 → 0.25.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. */
@@ -371,8 +372,8 @@ interface FeedReleaseResponse {
371
372
  feed_path: string;
372
373
  }
373
374
  interface FeedDeleteRequest {
374
- /** Numeric feed id to delete. */
375
- id: number;
375
+ /** Positive decimal feed id. String form preserves int64 precision. */
376
+ id: number | string;
376
377
  }
377
378
  type FeedListStatus = 'active' | 'paused' | 'all';
378
379
  interface FeedListParams {
@@ -399,14 +400,16 @@ interface FeedListResponse {
399
400
  has_more: boolean;
400
401
  }
401
402
  interface AutomationInspectRequest {
402
- /** Numeric automation id. Currently the same underlying feed id. */
403
- id: number;
403
+ /** Positive decimal automation id. String form preserves int64 precision. */
404
+ id: number | string;
404
405
  }
405
406
  interface AutomationInspectResponse {
406
407
  /** Numeric automation id encoded as a string, matching the gateway response. */
407
408
  id: string;
408
409
  /** Backing feed id encoded as a string. */
409
410
  feed_id: string;
411
+ /** Backing producer cronjob id used by lifecycle and run operations. */
412
+ cronjob_id?: number;
410
413
  name: string;
411
414
  description?: string;
412
415
  /** Automation runtime status. */
@@ -448,9 +451,45 @@ interface AutomationUpdateResponse {
448
451
  version: string;
449
452
  cronjob_id: number;
450
453
  }
454
+ interface AutomationEmailDelivery {
455
+ isEnabled: boolean;
456
+ isAvailable: boolean;
457
+ address: string | null;
458
+ }
459
+ interface AutomationAlertDelivery {
460
+ isEnabled: boolean;
461
+ alvaChannels: Array<{
462
+ id: string;
463
+ }>;
464
+ email: AutomationEmailDelivery;
465
+ }
466
+ interface AutomationAlertDeliveryGetRequest {
467
+ /** Positive decimal automation id kept as a string to preserve int64 precision. */
468
+ id: string;
469
+ }
470
+ interface AutomationAlertDeliveryUpdateRequest {
471
+ /** Positive decimal automation id kept as a string to preserve int64 precision. */
472
+ id: string;
473
+ /** Replace Alva destinations when present; an explicit empty list clears them. */
474
+ alvaChannelIds?: readonly string[];
475
+ /** Update only the verified-account email destination when present. */
476
+ emailEnabled?: boolean;
477
+ }
478
+ interface AutomationAlertDeliveryUpdateResponse {
479
+ automation: {
480
+ id: string;
481
+ };
482
+ alertDelivery: {
483
+ isEnabled: boolean;
484
+ alvaChannels?: Array<{
485
+ id: string;
486
+ }>;
487
+ email?: AutomationEmailDelivery;
488
+ };
489
+ }
451
490
  interface FeedStatusUpdateRequest {
452
- /** Numeric feed id to stop/resume. */
453
- id: number;
491
+ /** Positive decimal feed id. String form preserves int64 precision. */
492
+ id: number | string;
454
493
  }
455
494
  interface FeedStatusUpdateResponse {
456
495
  /** Echoed feed id (string form, matching gateway response). */
@@ -465,8 +504,8 @@ interface FeedDeleteResponse {
465
504
  /** Feed visibility: 'public' publishes the feed, 'private' unpublishes it. */
466
505
  type FeedVisibility = 'public' | 'private';
467
506
  interface FeedSetVisibilityRequest {
468
- /** Numeric feed id to publish/unpublish. */
469
- id: number;
507
+ /** Positive decimal feed id. String form preserves int64 precision. */
508
+ id: number | string;
470
509
  /** Target visibility. */
471
510
  visibility: FeedVisibility;
472
511
  }
@@ -1085,17 +1124,26 @@ declare class RunResource {
1085
1124
  private client;
1086
1125
  constructor(client: AlvaClient);
1087
1126
  execute(params: RunRequest): Promise<RunResponse>;
1127
+ /** @internal Used by the CLI to preserve the exact --args JSON text. */
1128
+ _executeSerializedArgs(params: RunRequest, serializedArgs: string): Promise<RunResponse>;
1129
+ private request;
1088
1130
  }
1089
1131
 
1090
1132
  declare class DeployResource {
1091
1133
  private client;
1092
1134
  constructor(client: AlvaClient);
1093
1135
  create(params: CronjobCreateRequest): Promise<Cronjob>;
1136
+ /** @internal Used by the CLI to preserve the exact --args JSON text. */
1137
+ _createSerializedArgs(params: CronjobCreateRequest, serializedArgs: string): Promise<Cronjob>;
1138
+ private createRequest;
1094
1139
  list(params?: CronjobListParams): Promise<CronjobListResponse>;
1095
1140
  get(params: {
1096
1141
  id: number;
1097
1142
  }): Promise<Cronjob>;
1098
1143
  update(params: CronjobUpdateRequest): Promise<Cronjob>;
1144
+ /** @internal Used by the CLI to preserve the exact --args JSON text. */
1145
+ _updateSerializedArgs(params: CronjobUpdateRequest, serializedArgs: string): Promise<Cronjob>;
1146
+ private updateRequest;
1099
1147
  delete(params: {
1100
1148
  id: number;
1101
1149
  }): Promise<void>;
@@ -1211,6 +1259,7 @@ declare class FeedResource {
1211
1259
  */
1212
1260
  declare class AutomationResource {
1213
1261
  private client;
1262
+ readonly delivery: AutomationAlertDeliveryResource;
1214
1263
  constructor(client: AlvaClient);
1215
1264
  list(params?: FeedListParams): Promise<FeedListResponse>;
1216
1265
  /**
@@ -1224,6 +1273,13 @@ declare class AutomationResource {
1224
1273
  delete(params: FeedDeleteRequest): Promise<FeedDeleteResponse>;
1225
1274
  publish(params: FeedReleaseRequest): Promise<FeedReleaseResponse>;
1226
1275
  }
1276
+ declare class AutomationAlertDeliveryResource {
1277
+ private client;
1278
+ constructor(client: AlvaClient);
1279
+ get(params: AutomationAlertDeliveryGetRequest): Promise<AutomationAlertDelivery>;
1280
+ update(params: AutomationAlertDeliveryUpdateRequest): Promise<AutomationAlertDeliveryUpdateResponse>;
1281
+ private graphql;
1282
+ }
1227
1283
 
1228
1284
  /** Playbook visibility states understood by the gateway. */
1229
1285
  type PlaybookVisibility = 'public' | 'private' | 'paid';
@@ -2092,26 +2148,14 @@ declare class CliUsageError extends Error {
2092
2148
 
2093
2149
  declare const CLI_VERSION: string;
2094
2150
  declare const DEFAULT_RUN_TIMEOUT_MS = 600000;
2095
- /**
2096
- * @deprecated Internal command handling uses the strict declarative parser.
2097
- * Retained for compatibility with existing `@alva-ai/toolkit/cli` consumers.
2098
- */
2099
- declare const BOOLEAN_FLAGS: Set<string>;
2100
- /**
2101
- * Returns true if version `a` is strictly older than version `b`.
2102
- * Compares major.minor.patch as integers. Returns false on malformed input.
2103
- */
2104
- 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";
2106
- declare const COMMAND_HELP: Record<string, string>;
2107
- type AlvaCliRuntimeMode = 'nodejs' | 'jagent';
2151
+ type DispatchRuntime = 'nodejs' | 'jagent';
2108
2152
  interface DispatchLocalFiles {
2109
2153
  readText(path: string): string;
2110
2154
  readBytes(path: string): BodyInit;
2111
2155
  writeBytes(path: string, data: Uint8Array): void;
2112
2156
  }
2113
2157
  interface DispatchRuntimeDeps {
2114
- mode?: AlvaCliRuntimeMode;
2158
+ runtime?: DispatchRuntime;
2115
2159
  env?: Record<string, string | undefined>;
2116
2160
  stderr?: {
2117
2161
  write(value: string): unknown;
@@ -2122,21 +2166,13 @@ interface DispatchRuntimeDeps {
2122
2166
  configureFetchTimeout?: (timeoutMs: number) => void;
2123
2167
  writeBrokerResult?: (envelope: unknown, exitCode: number) => Promise<void>;
2124
2168
  }
2125
- /**
2126
- * @deprecated Use `dispatch()` for validated command execution. This permissive
2127
- * parser remains available only to preserve the existing `./cli` export.
2128
- */
2129
- declare function parseFlags(argv: string[]): Record<string, string>;
2169
+
2170
+ /** Stable leaf inventory for Alpi Alva safety smokes and tooling. */
2171
+ declare const ALPI_ALVA_COMMAND_PATHS: readonly string[];
2130
2172
  declare function dispatch(client: AlvaClient, args: string[], meta?: {
2131
2173
  profile?: string;
2132
2174
  baseUrl?: string;
2133
2175
  cliVersion?: string;
2134
2176
  }, deps?: DispatchRuntimeDeps): Promise<unknown>;
2135
- /**
2136
- * Strips global flags (--api-key, --base-url, --profile, --arrays-endpoint)
2137
- * and their associated values from an argv list. Supports both
2138
- * `--flag value` and `--flag=value` forms.
2139
- */
2140
- declare function stripGlobalFlags(argv: string[]): string[];
2141
2177
 
2142
- export { type AlvaCliRuntimeMode, BOOLEAN_FLAGS, CLI_VERSION, COMMAND_HELP, CliUsageError, DEFAULT_RUN_TIMEOUT_MS, type DispatchLocalFiles, type DispatchRuntimeDeps, HELP_TEXT, dispatch, isVersionOlderThan, parseFlags, stripGlobalFlags };
2178
+ export { ALPI_ALVA_COMMAND_PATHS, CLI_VERSION, CliUsageError, DEFAULT_RUN_TIMEOUT_MS, type DispatchLocalFiles, type DispatchRuntime, type DispatchRuntimeDeps, dispatch };