@alva-ai/toolkit 0.13.0 → 0.14.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/README.md +4 -2
- package/dist/browser.global.js +43 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +71 -2
- package/dist/cli.js +373 -24
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +154 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -2
- package/dist/index.d.ts +70 -2
- package/dist/index.js +153 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
|
@@ -21,6 +21,52 @@ interface UserProfile {
|
|
|
21
21
|
/** Caller's alfs home directory, e.g. `/alva/home/<username>`. */
|
|
22
22
|
home_path: string;
|
|
23
23
|
}
|
|
24
|
+
interface CreditWallet {
|
|
25
|
+
balance: number;
|
|
26
|
+
totalRemaining: number;
|
|
27
|
+
todayUsed: number;
|
|
28
|
+
}
|
|
29
|
+
interface CreditWalletItemsParams {
|
|
30
|
+
/** Inclusive UTC lower bound, Unix milliseconds. */
|
|
31
|
+
startAtMs: number;
|
|
32
|
+
/** Exclusive UTC upper bound, Unix milliseconds. */
|
|
33
|
+
endAtMs: number;
|
|
34
|
+
/** Optional chat/session id to filter consumption records. */
|
|
35
|
+
sessionId?: string;
|
|
36
|
+
/** Page size, defaulted and capped by the gateway. */
|
|
37
|
+
first?: number;
|
|
38
|
+
/** Opaque cursor from a previous page's `pageInfo.endCursor`. */
|
|
39
|
+
after?: string;
|
|
40
|
+
}
|
|
41
|
+
interface CreditWalletItem {
|
|
42
|
+
id: string;
|
|
43
|
+
sessionId: string | null;
|
|
44
|
+
playbookId: string | null;
|
|
45
|
+
feedId: string | null;
|
|
46
|
+
op: string;
|
|
47
|
+
source: string;
|
|
48
|
+
amount: number;
|
|
49
|
+
extras?: unknown;
|
|
50
|
+
/** Creation timestamp, Unix milliseconds. */
|
|
51
|
+
createdAtMs: number;
|
|
52
|
+
}
|
|
53
|
+
interface CreditWalletPageInfo {
|
|
54
|
+
hasNextPage: boolean;
|
|
55
|
+
hasPreviousPage: boolean;
|
|
56
|
+
startCursor: string | null;
|
|
57
|
+
endCursor: string | null;
|
|
58
|
+
}
|
|
59
|
+
interface CreditWalletItemEdge {
|
|
60
|
+
cursor: string;
|
|
61
|
+
node: CreditWalletItem;
|
|
62
|
+
}
|
|
63
|
+
interface CreditWalletItemConnection {
|
|
64
|
+
pageInfo: CreditWalletPageInfo;
|
|
65
|
+
edges: CreditWalletItemEdge[];
|
|
66
|
+
}
|
|
67
|
+
interface CreditWalletItemsResponse extends CreditWallet {
|
|
68
|
+
items: CreditWalletItemConnection;
|
|
69
|
+
}
|
|
24
70
|
type SubscriptionTier = 'SUBSCRIPTION_TIER_UNSPECIFIED' | 'SUBSCRIPTION_TIER_FREE' | 'SUBSCRIPTION_TIER_PRO';
|
|
25
71
|
interface EnsureArraysJwtResponse {
|
|
26
72
|
expires_at: number;
|
|
@@ -226,6 +272,12 @@ interface FeedReleaseRequest {
|
|
|
226
272
|
view_json?: Record<string, unknown>;
|
|
227
273
|
description?: string;
|
|
228
274
|
changelog?: string;
|
|
275
|
+
/**
|
|
276
|
+
* Agent kind that produces this feed (e.g. "alpi"). Optional. Marks the feed
|
|
277
|
+
* as an agent feed whose prompt is editable; an empty/omitted value means a
|
|
278
|
+
* regular (non-agent) feed. The backend validates it against its catalog.
|
|
279
|
+
*/
|
|
280
|
+
agent_type?: string;
|
|
229
281
|
}
|
|
230
282
|
interface FeedReleaseResponse {
|
|
231
283
|
feed_id: number;
|
|
@@ -953,8 +1005,10 @@ interface TrendingPlaybookItem {
|
|
|
953
1005
|
description: string;
|
|
954
1006
|
tags: string[];
|
|
955
1007
|
follow_count: number;
|
|
956
|
-
/** Relative web path for opening or citing the playbook. */
|
|
1008
|
+
/** Relative web path for opening or citing the playbook, e.g. `/u/alice/playbooks/btc`. */
|
|
957
1009
|
url_path: string;
|
|
1010
|
+
/** Absolute, clickable web URL, e.g. `https://alva.ai/u/alice/playbooks/btc`. */
|
|
1011
|
+
url: string;
|
|
958
1012
|
/** README ALFS path when available. */
|
|
959
1013
|
readme?: string;
|
|
960
1014
|
/** Cursor to pass as `cursor` / `current` for pagination. */
|
|
@@ -1473,6 +1527,14 @@ declare class FunctionsResource {
|
|
|
1473
1527
|
revokeAllowance(params: RevokeAllowanceParams): Promise<RevokeAllowanceResponse>;
|
|
1474
1528
|
}
|
|
1475
1529
|
|
|
1530
|
+
declare class CreditsResource {
|
|
1531
|
+
private client;
|
|
1532
|
+
constructor(client: AlvaClient);
|
|
1533
|
+
wallet(): Promise<CreditWallet>;
|
|
1534
|
+
items(params: CreditWalletItemsParams): Promise<CreditWalletItemsResponse>;
|
|
1535
|
+
private graphql;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1476
1538
|
interface RequestOptions {
|
|
1477
1539
|
query?: Record<string, unknown>;
|
|
1478
1540
|
body?: unknown;
|
|
@@ -1531,6 +1593,7 @@ declare class AlvaClient {
|
|
|
1531
1593
|
private _channelGroupSubscriptions?;
|
|
1532
1594
|
private _feedback?;
|
|
1533
1595
|
private _functions?;
|
|
1596
|
+
private _credits?;
|
|
1534
1597
|
constructor(config: AlvaClientConfig);
|
|
1535
1598
|
get fs(): FsResource;
|
|
1536
1599
|
get run(): RunResource;
|
|
@@ -1555,10 +1618,16 @@ declare class AlvaClient {
|
|
|
1555
1618
|
get channelGroupSubscriptions(): ChannelGroupSubscriptionsResource;
|
|
1556
1619
|
get feedback(): FeedbackResource;
|
|
1557
1620
|
get functions(): FunctionsResource;
|
|
1621
|
+
get credits(): CreditsResource;
|
|
1558
1622
|
_requireAuth(): void;
|
|
1559
1623
|
_request(method: string, path: string, options?: RequestOptions): Promise<unknown>;
|
|
1560
1624
|
}
|
|
1561
1625
|
|
|
1626
|
+
declare class CliUsageError extends Error {
|
|
1627
|
+
readonly command?: string;
|
|
1628
|
+
constructor(message: string, command?: string);
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1562
1631
|
declare const CLI_VERSION: string;
|
|
1563
1632
|
declare const DEFAULT_RUN_TIMEOUT_MS = 600000;
|
|
1564
1633
|
/**
|
|
@@ -1604,4 +1673,4 @@ declare function dispatch(client: AlvaClient, args: string[], meta?: {
|
|
|
1604
1673
|
*/
|
|
1605
1674
|
declare function stripGlobalFlags(argv: string[]): string[];
|
|
1606
1675
|
|
|
1607
|
-
export { type AlvaCliRuntimeMode, BOOLEAN_FLAGS, CLI_VERSION, DEFAULT_RUN_TIMEOUT_MS, type DispatchRuntimeDeps, dispatch, handleConfigure, isVersionOlderThan, parseFlags, stripGlobalFlags };
|
|
1676
|
+
export { type AlvaCliRuntimeMode, BOOLEAN_FLAGS, CLI_VERSION, CliUsageError, DEFAULT_RUN_TIMEOUT_MS, type DispatchRuntimeDeps, dispatch, handleConfigure, isVersionOlderThan, parseFlags, stripGlobalFlags };
|