@alva-ai/toolkit 0.19.0 → 0.21.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.
package/dist/cli.d.ts CHANGED
@@ -196,6 +196,10 @@ interface CronjobCreateRequest {
196
196
  cron_expression: string;
197
197
  name: string;
198
198
  args?: Record<string, unknown>;
199
+ /**
200
+ * Let successful scheduled and manually triggered Feed runs deliver declared
201
+ * alert outputs to eligible subscribers. Does not create subscriptions.
202
+ */
199
203
  push_notify?: boolean;
200
204
  /** Override per-cronjob V8 heap limit (MB). Valid range 1–2046. */
201
205
  max_heap_size_mb?: number;
@@ -226,6 +230,7 @@ interface Cronjob {
226
230
  cron_expression: string;
227
231
  status: string;
228
232
  args: Record<string, unknown>;
233
+ /** Whether successful Feed runs may deliver alerts to subscribers. */
229
234
  push_notify: boolean;
230
235
  /** Per-cronjob V8 heap cap (MB). null when using the server default. */
231
236
  max_heap_size_mb: number | null;
@@ -263,6 +268,7 @@ interface CronjobUpdateRequest {
263
268
  name?: string;
264
269
  cron_expression?: string;
265
270
  args?: Record<string, unknown>;
271
+ /** Enable or disable delivery of declared Feed alert outputs. */
266
272
  push_notify?: boolean;
267
273
  /** Override per-cronjob V8 heap limit (MB). Valid range 1–2046. */
268
274
  max_heap_size_mb?: number;
@@ -807,6 +813,8 @@ interface PushSubscription {
807
813
  target: PushTarget;
808
814
  created_at_ms: number;
809
815
  updated_at_ms: number;
816
+ /** Alva delivery channel id. "0" denotes the agent/home channel. */
817
+ channel_id?: string;
810
818
  /** Present on list responses. */
811
819
  cursor?: string;
812
820
  /** Feed metadata is present for FEED targets when available. */
@@ -840,6 +848,10 @@ interface PushSubscriptionFeedParams {
840
848
  username: string;
841
849
  name: string;
842
850
  }
851
+ interface SubscribeFeedParams extends PushSubscriptionFeedParams {
852
+ /** Delivery channel id. Omit for the user's agent/home channel. */
853
+ channelId?: string;
854
+ }
843
855
  interface PushSubscriptionListParams {
844
856
  /** Page size, default 50, max 200 server-side. */
845
857
  first?: number;
@@ -1071,6 +1083,8 @@ declare class DeployResource {
1071
1083
  }): Promise<void>;
1072
1084
  /**
1073
1085
  * Fire the cronjob workflow once, immediately, bypassing the schedule.
1086
+ * This is not a dry run: when publisher push and subscriber alert bindings
1087
+ * are enabled, a successful Feed execution may send real notifications.
1074
1088
  * Async — returns the Hatchet workflow run id at enqueue. The
1075
1089
  * `cronjob_runs` row can appear as DISPATCHED/RUNNING before it reaches a
1076
1090
  * terminal status; callers verify completion by polling
@@ -1598,7 +1612,7 @@ declare class SubscriptionsResource {
1598
1612
  * single automation's alerts, regardless of which playbook(s) consume it.
1599
1613
  * Does NOT follow any playbook. Idempotent.
1600
1614
  */
1601
- subscribeFeed(params: PushSubscriptionFeedParams): Promise<SubscribeFeedResponse>;
1615
+ subscribeFeed(params: SubscribeFeedParams): Promise<SubscribeFeedResponse>;
1602
1616
  /**
1603
1617
  * Unsubscribe from one feed `(username, name)` — disable that automation's
1604
1618
  * alerts for the caller. Idempotent.
@@ -1633,7 +1647,7 @@ declare class AlertsResource {
1633
1647
  constructor(client: AlvaClient);
1634
1648
  list(params?: PushSubscriptionListParams): Promise<PushSubscriptionListResponse>;
1635
1649
  follows(params?: FollowsListParams): Promise<FollowsListResponse>;
1636
- enableAutomation(params: PushSubscriptionFeedParams): Promise<SubscribeFeedResponse>;
1650
+ enableAutomation(params: SubscribeFeedParams): Promise<SubscribeFeedResponse>;
1637
1651
  disableAutomation(params: PushSubscriptionFeedParams): Promise<UnsubscribeResponse>;
1638
1652
  enableBatch(params: SubscribeBatchParams): Promise<SubscribeBatchResponse>;
1639
1653
  disableBatch(params: UnsubscribeBatchParams): Promise<UnsubscribeBatchResponse>;
@@ -1879,11 +1893,46 @@ declare class CliUsageError extends Error {
1879
1893
 
1880
1894
  declare const CLI_VERSION: string;
1881
1895
  declare const DEFAULT_RUN_TIMEOUT_MS = 600000;
1896
+ /**
1897
+ * @deprecated Internal command handling uses the strict declarative parser.
1898
+ * Retained for compatibility with existing `@alva-ai/toolkit/cli` consumers.
1899
+ */
1900
+ declare const BOOLEAN_FLAGS: Set<string>;
1882
1901
  /**
1883
1902
  * Returns true if version `a` is strictly older than version `b`.
1884
1903
  * Compares major.minor.patch as integers. Returns false on malformed input.
1885
1904
  */
1886
1905
  declare function isVersionOlderThan(a: string, b: string): boolean;
1906
+ type AlvaCliRuntimeMode = 'nodejs' | 'jagent';
1907
+ interface DispatchLocalFiles {
1908
+ readText(path: string): string;
1909
+ readBytes(path: string): BodyInit;
1910
+ writeBytes(path: string, data: Uint8Array): void;
1911
+ }
1912
+ interface DispatchRuntimeDeps {
1913
+ mode?: AlvaCliRuntimeMode;
1914
+ env?: Record<string, string | undefined>;
1915
+ stderr?: {
1916
+ write(value: string): unknown;
1917
+ };
1918
+ localFiles?: DispatchLocalFiles;
1919
+ readStdin?: () => Promise<string>;
1920
+ randomUUID?: () => string;
1921
+ configureFetchTimeout?: (timeoutMs: number) => void;
1922
+ writeBrokerResult?: (envelope: unknown, exitCode: number) => Promise<void>;
1923
+ }
1924
+ /**
1925
+ * @deprecated Use `dispatch()` for validated command execution. This permissive
1926
+ * parser remains available only to preserve the existing `./cli` export.
1927
+ */
1928
+ declare function parseFlags(argv: string[]): Record<string, string>;
1929
+ /**
1930
+ * Strips global flags (--api-key, --base-url, --profile, --arrays-endpoint)
1931
+ * and their associated values from an argv list. Supports both
1932
+ * `--flag value` and `--flag=value` forms.
1933
+ */
1934
+ declare function stripGlobalFlags(argv: string[]): string[];
1935
+
1887
1936
  interface WriteConfigDeps {
1888
1937
  env: Record<string, string | undefined>;
1889
1938
  homedir: () => string;
@@ -1896,30 +1945,16 @@ interface WriteConfigDeps {
1896
1945
  readFile: (path: string) => Promise<string>;
1897
1946
  runHooks?: (client: AlvaClient) => Promise<void>;
1898
1947
  }
1899
- type AlvaCliRuntimeMode = 'nodejs' | 'jagent';
1900
- interface DispatchRuntimeDeps {
1901
- mode?: AlvaCliRuntimeMode;
1902
- env?: Record<string, string | undefined>;
1903
- stderr?: Pick<typeof process.stderr, 'write'>;
1904
- }
1948
+ declare function dispatch(client: AlvaClient, args: string[], meta?: {
1949
+ profile?: string;
1950
+ baseUrl?: string;
1951
+ cliVersion?: string;
1952
+ }, deps?: DispatchRuntimeDeps): Promise<unknown>;
1905
1953
  declare function handleConfigure(args: string[], deps?: WriteConfigDeps): Promise<{
1906
1954
  status: string;
1907
1955
  apiKey: string;
1908
1956
  baseUrl?: string;
1909
1957
  profile: string;
1910
1958
  }>;
1911
- declare const BOOLEAN_FLAGS: Set<string>;
1912
- declare function parseFlags(argv: string[]): Record<string, string>;
1913
- declare function dispatch(client: AlvaClient, args: string[], meta?: {
1914
- profile?: string;
1915
- baseUrl?: string;
1916
- cliVersion?: string;
1917
- }, deps?: DispatchRuntimeDeps): Promise<unknown>;
1918
- /**
1919
- * Strips global flags (--api-key, --base-url, --profile, --arrays-endpoint)
1920
- * and their associated values from an argv list. Supports both
1921
- * `--flag value` and `--flag=value` forms.
1922
- */
1923
- declare function stripGlobalFlags(argv: string[]): string[];
1924
1959
 
1925
- export { type AlvaCliRuntimeMode, BOOLEAN_FLAGS, CLI_VERSION, CliUsageError, DEFAULT_RUN_TIMEOUT_MS, type DispatchRuntimeDeps, dispatch, handleConfigure, isVersionOlderThan, parseFlags, stripGlobalFlags };
1960
+ export { type AlvaCliRuntimeMode, BOOLEAN_FLAGS, CLI_VERSION, CliUsageError, DEFAULT_RUN_TIMEOUT_MS, type DispatchLocalFiles, type DispatchRuntimeDeps, dispatch, handleConfigure, isVersionOlderThan, parseFlags, stripGlobalFlags };