@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/index.d.cts 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>;
package/dist/index.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>;
package/dist/index.js CHANGED
@@ -20,6 +20,11 @@ var CliUsageError = class extends Error {
20
20
  }
21
21
  };
22
22
 
23
+ // src/arrayBuffer.ts
24
+ function isArrayBuffer(value) {
25
+ return Object.prototype.toString.call(value) === "[object ArrayBuffer]";
26
+ }
27
+
23
28
  // src/resources/fs.ts
24
29
  var WRITE_FLAG_APPEND = 1 << 0;
25
30
  function isValidUtf8(bytes) {
@@ -71,7 +76,7 @@ var FsResource = class {
71
76
  const result = await this.client._request("GET", "/api/v1/fs/read", {
72
77
  query: { path: params.path, offset: params.offset, size: params.size }
73
78
  });
74
- if (!(result instanceof ArrayBuffer)) return result;
79
+ if (!isArrayBuffer(result)) return result;
75
80
  if (!isValidUtf8(new Uint8Array(result))) {
76
81
  return result;
77
82
  }
@@ -270,6 +275,8 @@ var DeployResource = class {
270
275
  }
271
276
  /**
272
277
  * Fire the cronjob workflow once, immediately, bypassing the schedule.
278
+ * This is not a dry run: when publisher push and subscriber alert bindings
279
+ * are enabled, a successful Feed execution may send real notifications.
273
280
  * Async — returns the Hatchet workflow run id at enqueue. The
274
281
  * `cronjob_runs` row can appear as DISPATCHED/RUNNING before it reaches a
275
282
  * terminal status; callers verify completion by polling
@@ -1487,40 +1494,40 @@ var SKILL_ENDPOINT_METADATA = [
1487
1494
  file: "contracts",
1488
1495
  method: "GET",
1489
1496
  path: "/api/v1/options/contracts",
1490
- tier: "alternative",
1491
- required_subscription_tier: "pro",
1492
- access: "pro_only",
1493
- pro_required: true
1497
+ tier: "public",
1498
+ required_subscription_tier: "free",
1499
+ access: "free_and_pro",
1500
+ pro_required: false
1494
1501
  },
1495
1502
  {
1496
1503
  skill: "arrays-data-api-options",
1497
1504
  file: "kline",
1498
1505
  method: "GET",
1499
1506
  path: "/api/v1/options/kline",
1500
- tier: "alternative",
1501
- required_subscription_tier: "pro",
1502
- access: "pro_only",
1503
- pro_required: true
1507
+ tier: "public",
1508
+ required_subscription_tier: "free",
1509
+ access: "free_and_pro",
1510
+ pro_required: false
1504
1511
  },
1505
1512
  {
1506
1513
  skill: "arrays-data-api-options",
1507
1514
  file: "greeks",
1508
1515
  method: "GET",
1509
1516
  path: "/api/v1/options/greeks",
1510
- tier: "alternative",
1511
- required_subscription_tier: "pro",
1512
- access: "pro_only",
1513
- pro_required: true
1517
+ tier: "public",
1518
+ required_subscription_tier: "free",
1519
+ access: "free_and_pro",
1520
+ pro_required: false
1514
1521
  },
1515
1522
  {
1516
1523
  skill: "arrays-data-api-options",
1517
1524
  file: "chain",
1518
1525
  method: "GET",
1519
1526
  path: "/api/v1/options/chain",
1520
- tier: "alternative",
1521
- required_subscription_tier: "pro",
1522
- access: "pro_only",
1523
- pro_required: true
1527
+ tier: "public",
1528
+ required_subscription_tier: "free",
1529
+ access: "free_and_pro",
1530
+ pro_required: false
1524
1531
  },
1525
1532
  {
1526
1533
  skill: "arrays-data-api-equity-fundamentals",
@@ -2437,7 +2444,15 @@ var SubscriptionsResource = class {
2437
2444
  async subscribeFeed(params) {
2438
2445
  this.client._requireAuth();
2439
2446
  const path = `/api/v1/subscriptions/feed/${encodeURIComponent(params.username)}/${encodeURIComponent(params.name)}`;
2440
- return this.client._request("POST", path);
2447
+ if (params.channelId === void 0) {
2448
+ return this.client._request(
2449
+ "POST",
2450
+ path
2451
+ );
2452
+ }
2453
+ return this.client._request("POST", path, {
2454
+ body: { channel_id: params.channelId }
2455
+ });
2441
2456
  }
2442
2457
  /**
2443
2458
  * Unsubscribe from one feed `(username, name)` — disable that automation's
@@ -3714,7 +3729,7 @@ var installPlaybookRuntime = (targetWindow) => {
3714
3729
  };
3715
3730
 
3716
3731
  // src/index.ts
3717
- var VERSION = true ? "0.19.0" : "dev";
3732
+ var VERSION = true ? "0.21.0" : "dev";
3718
3733
  export {
3719
3734
  AlertsResource,
3720
3735
  AlvaClient,