@alva-ai/toolkit 0.15.0 → 0.16.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/browser.global.js +3 -3
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +158 -1
- package/dist/cli.js +652 -40
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +230 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +159 -2
- package/dist/index.d.ts +159 -2
- package/dist/index.js +228 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
|
@@ -307,6 +307,56 @@ interface FeedDeleteRequest {
|
|
|
307
307
|
/** Numeric feed id to delete. */
|
|
308
308
|
id: number;
|
|
309
309
|
}
|
|
310
|
+
type FeedListStatus = 'active' | 'paused' | 'all';
|
|
311
|
+
interface FeedListParams {
|
|
312
|
+
/** Page size, default 50, max 100 server-side. */
|
|
313
|
+
limit?: number;
|
|
314
|
+
/** Opaque cursor token from the previous page. */
|
|
315
|
+
cursor?: string;
|
|
316
|
+
/** Runtime status filter; defaults to active on the gateway. */
|
|
317
|
+
status?: FeedListStatus;
|
|
318
|
+
}
|
|
319
|
+
interface FeedListItem {
|
|
320
|
+
/** Numeric feed id encoded as a string, matching the gateway response. */
|
|
321
|
+
id: string;
|
|
322
|
+
name: string;
|
|
323
|
+
/** Feed runtime status. */
|
|
324
|
+
status: 'ACTIVE' | 'PAUSED' | 'UNSPECIFIED' | (string & {});
|
|
325
|
+
cron_expression?: string;
|
|
326
|
+
total_runs: number;
|
|
327
|
+
used_by_total: number;
|
|
328
|
+
}
|
|
329
|
+
interface FeedListResponse {
|
|
330
|
+
feeds: FeedListItem[];
|
|
331
|
+
next_cursor?: string;
|
|
332
|
+
has_more: boolean;
|
|
333
|
+
}
|
|
334
|
+
interface AutomationInspectRequest {
|
|
335
|
+
/** Numeric automation id. Currently the same underlying feed id. */
|
|
336
|
+
id: number;
|
|
337
|
+
}
|
|
338
|
+
interface AutomationInspectResponse {
|
|
339
|
+
/** Numeric automation id encoded as a string, matching the gateway response. */
|
|
340
|
+
id: string;
|
|
341
|
+
/** Backing feed id encoded as a string. */
|
|
342
|
+
feed_id: string;
|
|
343
|
+
name: string;
|
|
344
|
+
description?: string;
|
|
345
|
+
/** Automation runtime status. */
|
|
346
|
+
status: 'ACTIVE' | 'PAUSED' | 'UNSPECIFIED' | (string & {});
|
|
347
|
+
cron_expression?: string;
|
|
348
|
+
total_runs: number;
|
|
349
|
+
/**
|
|
350
|
+
* Backend product-flow registry id. Null for ordinary non-flow automations.
|
|
351
|
+
*/
|
|
352
|
+
flow_id: string | null;
|
|
353
|
+
/**
|
|
354
|
+
* Absolute ALFS config path for caller-owned product-flow automations.
|
|
355
|
+
* Null for ordinary automations and product-flow automations not owned by
|
|
356
|
+
* the caller.
|
|
357
|
+
*/
|
|
358
|
+
flow_config_path: string | null;
|
|
359
|
+
}
|
|
310
360
|
interface FeedStatusUpdateRequest {
|
|
311
361
|
/** Numeric feed id to stop/resume. */
|
|
312
362
|
id: number;
|
|
@@ -315,12 +365,26 @@ interface FeedStatusUpdateResponse {
|
|
|
315
365
|
/** Echoed feed id (string form, matching gateway response). */
|
|
316
366
|
id: string;
|
|
317
367
|
/** Feed runtime status after the update. */
|
|
318
|
-
status: 'ACTIVE' | 'PAUSED' | 'UNSPECIFIED' | string;
|
|
368
|
+
status: 'ACTIVE' | 'PAUSED' | 'UNSPECIFIED' | (string & {});
|
|
319
369
|
}
|
|
320
370
|
interface FeedDeleteResponse {
|
|
321
371
|
/** Echoed feed id (string form, matching gateway response). */
|
|
322
372
|
id: string;
|
|
323
373
|
}
|
|
374
|
+
/** Feed visibility: 'public' publishes the feed, 'private' unpublishes it. */
|
|
375
|
+
type FeedVisibility = 'public' | 'private';
|
|
376
|
+
interface FeedSetVisibilityRequest {
|
|
377
|
+
/** Numeric feed id to publish/unpublish. */
|
|
378
|
+
id: number;
|
|
379
|
+
/** Target visibility. */
|
|
380
|
+
visibility: FeedVisibility;
|
|
381
|
+
}
|
|
382
|
+
interface FeedSetVisibilityResponse {
|
|
383
|
+
/** Echoed feed id (string form, matching gateway response). */
|
|
384
|
+
id: string;
|
|
385
|
+
/** Feed visibility after the update. */
|
|
386
|
+
visibility: FeedVisibility;
|
|
387
|
+
}
|
|
324
388
|
interface PlaybookDraftRequest {
|
|
325
389
|
name: string;
|
|
326
390
|
display_name: string;
|
|
@@ -867,6 +931,33 @@ interface ChannelGroupSubscriptionMutationResponse {
|
|
|
867
931
|
admin: ChannelGroupAdminInfo | null;
|
|
868
932
|
subscriptions: ChannelGroupSubscription[];
|
|
869
933
|
}
|
|
934
|
+
/** Params for reading a group's buffered chat history (group-chat digest). */
|
|
935
|
+
interface ChannelGroupHistoryParams {
|
|
936
|
+
/** Platform: "telegram" | "discord" | "slack". */
|
|
937
|
+
channel: string;
|
|
938
|
+
/** Platform group/channel id. */
|
|
939
|
+
remote_chat_id: string;
|
|
940
|
+
/** Window start, message-origin timestamp in microseconds (inclusive). */
|
|
941
|
+
from_micros: number | string;
|
|
942
|
+
/** Window end, message-origin timestamp in microseconds (inclusive). */
|
|
943
|
+
to_micros: number | string;
|
|
944
|
+
}
|
|
945
|
+
/** One buffered group message, projected for the digest. */
|
|
946
|
+
interface GroupChatMessage {
|
|
947
|
+
sender_username: string;
|
|
948
|
+
content: string;
|
|
949
|
+
/** "[photo]" etc. when the message carried media. */
|
|
950
|
+
media_summary: string;
|
|
951
|
+
ts_micros: number;
|
|
952
|
+
/** Deep link back to the original message; empty when unavailable. */
|
|
953
|
+
permalink: string;
|
|
954
|
+
/** "user" | "assistant" (bot replies). */
|
|
955
|
+
role: string;
|
|
956
|
+
}
|
|
957
|
+
interface ChannelGroupHistoryResponse {
|
|
958
|
+
/** Chronological (ts ascending). */
|
|
959
|
+
messages: GroupChatMessage[];
|
|
960
|
+
}
|
|
870
961
|
interface ServiceAccount {
|
|
871
962
|
id: string;
|
|
872
963
|
display_name: string;
|
|
@@ -995,6 +1086,10 @@ declare class ReleaseResource {
|
|
|
995
1086
|
declare class FeedResource {
|
|
996
1087
|
private client;
|
|
997
1088
|
constructor(client: AlvaClient);
|
|
1089
|
+
/**
|
|
1090
|
+
* List feeds owned by the caller. Backed by GET /api/v1/feed.
|
|
1091
|
+
*/
|
|
1092
|
+
list(params?: FeedListParams): Promise<FeedListResponse>;
|
|
998
1093
|
/**
|
|
999
1094
|
* Stop a feed's producer cronjob. This pauses future scheduled runs while
|
|
1000
1095
|
* preserving the feed and its existing data.
|
|
@@ -1017,6 +1112,36 @@ declare class FeedResource {
|
|
|
1017
1112
|
* Auth: caller must own the feed (uid match), enforced by the backend.
|
|
1018
1113
|
*/
|
|
1019
1114
|
delete(params: FeedDeleteRequest): Promise<FeedDeleteResponse>;
|
|
1115
|
+
/**
|
|
1116
|
+
* Publish or unpublish a feed. Backed by POST /api/v1/feed/:id/visibility.
|
|
1117
|
+
*
|
|
1118
|
+
* Setting visibility to 'public' publishes the feed (the backend sets
|
|
1119
|
+
* feeds.is_public and projects the ALFS public read grant in the same
|
|
1120
|
+
* transaction); 'private' unpublishes it. Prefer this over granting the
|
|
1121
|
+
* ALFS public read subject directly (e.g. `alva fs grant`), which bypasses
|
|
1122
|
+
* the is_public flag and causes drift.
|
|
1123
|
+
*
|
|
1124
|
+
* Auth: caller must own the feed (uid match), enforced by the backend.
|
|
1125
|
+
*/
|
|
1126
|
+
setVisibility(params: FeedSetVisibilityRequest): Promise<FeedSetVisibilityResponse>;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Product-facing automation API. Backed by the existing feed/release gateway
|
|
1131
|
+
* surfaces while those lower-level names remain on the wire for compatibility.
|
|
1132
|
+
*/
|
|
1133
|
+
declare class AutomationResource {
|
|
1134
|
+
private client;
|
|
1135
|
+
constructor(client: AlvaClient);
|
|
1136
|
+
list(params?: FeedListParams): Promise<FeedListResponse>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Inspect one automation. Backed by GET /api/v1/automation/:id.
|
|
1139
|
+
*/
|
|
1140
|
+
inspect(params: AutomationInspectRequest): Promise<AutomationInspectResponse>;
|
|
1141
|
+
stop(params: FeedStatusUpdateRequest): Promise<FeedStatusUpdateResponse>;
|
|
1142
|
+
resume(params: FeedStatusUpdateRequest): Promise<FeedStatusUpdateResponse>;
|
|
1143
|
+
delete(params: FeedDeleteRequest): Promise<FeedDeleteResponse>;
|
|
1144
|
+
publish(params: FeedReleaseRequest): Promise<FeedReleaseResponse>;
|
|
1020
1145
|
}
|
|
1021
1146
|
|
|
1022
1147
|
/** Playbook visibility states understood by the gateway. */
|
|
@@ -1473,6 +1598,26 @@ declare class SubscriptionsResource {
|
|
|
1473
1598
|
unsubscribeBatch(params: UnsubscribeBatchParams): Promise<UnsubscribeBatchResponse>;
|
|
1474
1599
|
}
|
|
1475
1600
|
|
|
1601
|
+
/**
|
|
1602
|
+
* Product-facing alert API. The current transport still calls the legacy
|
|
1603
|
+
* subscription and notification-history endpoints.
|
|
1604
|
+
*/
|
|
1605
|
+
declare class AlertsResource {
|
|
1606
|
+
private client;
|
|
1607
|
+
constructor(client: AlvaClient);
|
|
1608
|
+
list(params?: PushSubscriptionListParams): Promise<PushSubscriptionListResponse>;
|
|
1609
|
+
follows(params?: FollowsListParams): Promise<FollowsListResponse>;
|
|
1610
|
+
enableAutomation(params: PushSubscriptionFeedParams): Promise<SubscribeFeedResponse>;
|
|
1611
|
+
disableAutomation(params: PushSubscriptionFeedParams): Promise<UnsubscribeResponse>;
|
|
1612
|
+
enablePlaybook(params: PushSubscriptionPlaybookParams): Promise<SubscribePlaybookResponse>;
|
|
1613
|
+
disablePlaybook(params: PushSubscriptionPlaybookParams): Promise<UnsubscribeResponse>;
|
|
1614
|
+
disableBatch(params: UnsubscribeBatchParams): Promise<UnsubscribeBatchResponse>;
|
|
1615
|
+
historyAutomation(params: NotificationListParams): Promise<FeedNotificationListResponse>;
|
|
1616
|
+
historyPlaybook(params: NotificationListParams): Promise<PlaybookNotificationListResponse>;
|
|
1617
|
+
preferences(): Promise<NotificationPreferencesResponse>;
|
|
1618
|
+
updatePreference(params: NotificationPreferenceUpdateParams): Promise<NotificationPreferenceUpdateResponse>;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1476
1621
|
/**
|
|
1477
1622
|
* Group push subscriptions for an external channel session.
|
|
1478
1623
|
*
|
|
@@ -1487,6 +1632,14 @@ declare class ChannelGroupSubscriptionsResource {
|
|
|
1487
1632
|
list(params: ChannelGroupSubscriptionSessionParams): Promise<ChannelGroupSubscriptionListResponse>;
|
|
1488
1633
|
subscribe(params: ChannelGroupSubscriptionMutationParams): Promise<ChannelGroupSubscriptionMutationResponse>;
|
|
1489
1634
|
unsubscribe(params: ChannelGroupSubscriptionMutationParams): Promise<ChannelGroupSubscriptionMutationResponse>;
|
|
1635
|
+
/**
|
|
1636
|
+
* Read a group's buffered chat messages in a time window, for the group-chat
|
|
1637
|
+
* digest automation. Admin-gated: the authenticated caller must be that
|
|
1638
|
+
* group's Alva admin (a digest feed runs as that admin). Each message carries
|
|
1639
|
+
* a `permalink` deep-link back to the original message for "jump to original".
|
|
1640
|
+
* `from_micros`/`to_micros` are message-origin timestamps in microseconds.
|
|
1641
|
+
*/
|
|
1642
|
+
getGroupChatHistory(params: ChannelGroupHistoryParams): Promise<ChannelGroupHistoryResponse>;
|
|
1490
1643
|
}
|
|
1491
1644
|
|
|
1492
1645
|
declare class FeedbackResource {
|
|
@@ -1640,6 +1793,7 @@ declare class AlvaClient {
|
|
|
1640
1793
|
private _serviceAccount?;
|
|
1641
1794
|
private _release?;
|
|
1642
1795
|
private _feed?;
|
|
1796
|
+
private _automation?;
|
|
1643
1797
|
private _playbooks?;
|
|
1644
1798
|
private _secrets?;
|
|
1645
1799
|
private _sdk?;
|
|
@@ -1655,6 +1809,7 @@ declare class AlvaClient {
|
|
|
1655
1809
|
private _notifications?;
|
|
1656
1810
|
private _notificationPreferences?;
|
|
1657
1811
|
private _subscriptions?;
|
|
1812
|
+
private _alerts?;
|
|
1658
1813
|
private _channelGroupSubscriptions?;
|
|
1659
1814
|
private _feedback?;
|
|
1660
1815
|
private _functions?;
|
|
@@ -1666,6 +1821,7 @@ declare class AlvaClient {
|
|
|
1666
1821
|
get serviceAccount(): ServiceAccountResource;
|
|
1667
1822
|
get release(): ReleaseResource;
|
|
1668
1823
|
get feed(): FeedResource;
|
|
1824
|
+
get automation(): AutomationResource;
|
|
1669
1825
|
get playbooks(): PlaybooksResource;
|
|
1670
1826
|
get secrets(): SecretsResource;
|
|
1671
1827
|
get sdk(): SdkDocsResource;
|
|
@@ -1681,6 +1837,7 @@ declare class AlvaClient {
|
|
|
1681
1837
|
get notifications(): NotificationsResource;
|
|
1682
1838
|
get notificationPreferences(): NotificationPreferencesResource;
|
|
1683
1839
|
get subscriptions(): SubscriptionsResource;
|
|
1840
|
+
get alerts(): AlertsResource;
|
|
1684
1841
|
get channelGroupSubscriptions(): ChannelGroupSubscriptionsResource;
|
|
1685
1842
|
get feedback(): FeedbackResource;
|
|
1686
1843
|
get functions(): FunctionsResource;
|