@alva-ai/toolkit 0.9.0 → 0.9.1
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 +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.js +81 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +33 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +84 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11259,6 +11259,34 @@ var TradingResource = class {
|
|
|
11259
11259
|
}
|
|
11260
11260
|
};
|
|
11261
11261
|
|
|
11262
|
+
// src/resources/portfolio.ts
|
|
11263
|
+
var PortfolioResource = class {
|
|
11264
|
+
constructor(client) {
|
|
11265
|
+
this.client = client;
|
|
11266
|
+
}
|
|
11267
|
+
client;
|
|
11268
|
+
async accounts() {
|
|
11269
|
+
this.client._requireAuth();
|
|
11270
|
+
return this.client._request("GET", "/api/v1/portfolio/accounts");
|
|
11271
|
+
}
|
|
11272
|
+
async summary(accountId) {
|
|
11273
|
+
this.client._requireAuth();
|
|
11274
|
+
return this.client._request("GET", "/api/v1/portfolio/summary", {
|
|
11275
|
+
query: { accountId }
|
|
11276
|
+
});
|
|
11277
|
+
}
|
|
11278
|
+
async activities(params) {
|
|
11279
|
+
this.client._requireAuth();
|
|
11280
|
+
return this.client._request("GET", "/api/v1/portfolio/activities", {
|
|
11281
|
+
query: {
|
|
11282
|
+
accountId: params.accountId,
|
|
11283
|
+
limit: params.limit,
|
|
11284
|
+
pageToken: params.pageToken
|
|
11285
|
+
}
|
|
11286
|
+
});
|
|
11287
|
+
}
|
|
11288
|
+
};
|
|
11289
|
+
|
|
11262
11290
|
// src/resources/arraysJwt.ts
|
|
11263
11291
|
var ArraysJwtResource = class {
|
|
11264
11292
|
constructor(client) {
|
|
@@ -11526,6 +11554,7 @@ var AlvaClient = class {
|
|
|
11526
11554
|
_screenshot;
|
|
11527
11555
|
_user;
|
|
11528
11556
|
_trading;
|
|
11557
|
+
_portfolio;
|
|
11529
11558
|
_arraysJwt;
|
|
11530
11559
|
_notifications;
|
|
11531
11560
|
_notificationPreferences;
|
|
@@ -11586,6 +11615,9 @@ var AlvaClient = class {
|
|
|
11586
11615
|
get trading() {
|
|
11587
11616
|
return this._trading ??= new TradingResource(this);
|
|
11588
11617
|
}
|
|
11618
|
+
get portfolio() {
|
|
11619
|
+
return this._portfolio ??= new PortfolioResource(this);
|
|
11620
|
+
}
|
|
11589
11621
|
get arraysJwt() {
|
|
11590
11622
|
return this._arraysJwt ??= new ArraysJwtResource(this);
|
|
11591
11623
|
}
|
|
@@ -12454,7 +12486,7 @@ function formatPlaybookSkillFile(file) {
|
|
|
12454
12486
|
import * as fs2 from "fs";
|
|
12455
12487
|
import * as os2 from "os";
|
|
12456
12488
|
import * as fsPromises2 from "fs/promises";
|
|
12457
|
-
var CLI_VERSION = true ? "0.9.
|
|
12489
|
+
var CLI_VERSION = true ? "0.9.1" : "dev";
|
|
12458
12490
|
function isVersionOlderThan(a, b) {
|
|
12459
12491
|
const parse4 = (v) => {
|
|
12460
12492
|
if (!v) return null;
|
|
@@ -12495,6 +12527,7 @@ Commands:
|
|
|
12495
12527
|
push-subscriptions Personal push opt-in (subscribe-playbook, unsubscribe-playbook, subscribe-feed, unsubscribe-feed, list)
|
|
12496
12528
|
channel Channel group operations (group-subscriptions context, list, subscribe, unsubscribe)
|
|
12497
12529
|
remix Save playbook remix lineage
|
|
12530
|
+
portfolio Connected-account portfolio (accounts, summary, activities)
|
|
12498
12531
|
trading Trading operations (accounts, portfolio, orders, subscriptions, equity-history, risk-rules, subscribe, unsubscribe, execute, update-risk-rules)
|
|
12499
12532
|
auth Authentication (login)
|
|
12500
12533
|
screenshot Capture a web screenshot as PNG
|
|
@@ -13163,6 +13196,27 @@ Examples:
|
|
|
13163
13196
|
alva screenshot --url /playbook/alice/btc-dashboard --out dashboard.png
|
|
13164
13197
|
alva screenshot --url /playbook/alice/btc-dashboard --out chart.png --selector ".chart-container"
|
|
13165
13198
|
alva screenshot --url /playbook/alice/btc-dashboard --out small.png --compress --compress-quality 70 --compress-max-width 1280`,
|
|
13199
|
+
portfolio: `Usage: alva portfolio <subcommand> [options]
|
|
13200
|
+
|
|
13201
|
+
Read-only view of connected accounts across TREX and SnapTrade.
|
|
13202
|
+
For trading actions (subscribe, execute, etc.) use 'alva trading'.
|
|
13203
|
+
|
|
13204
|
+
Subcommands:
|
|
13205
|
+
accounts List all connected accounts (TREX + SnapTrade)
|
|
13206
|
+
summary Get portfolio summary (holdings + balance) for an account
|
|
13207
|
+
activities List recent activity for an account
|
|
13208
|
+
|
|
13209
|
+
Summary/Activities flags:
|
|
13210
|
+
--account-id <id> Account ID with provider prefix, e.g. trex:123 or snaptrade:456 (required)
|
|
13211
|
+
|
|
13212
|
+
Activities optional flags:
|
|
13213
|
+
--limit <n> Max results (default 50, max 200)
|
|
13214
|
+
--page-token <tok> Pagination token from a previous response
|
|
13215
|
+
|
|
13216
|
+
Examples:
|
|
13217
|
+
alva portfolio accounts
|
|
13218
|
+
alva portfolio summary --account-id trex:123
|
|
13219
|
+
alva portfolio activities --account-id snaptrade:456 --limit 20`,
|
|
13166
13220
|
trading: `Usage: alva trading <subcommand> [options]
|
|
13167
13221
|
|
|
13168
13222
|
Manage trading accounts, portfolios, orders, subscriptions, and risk rules.
|
|
@@ -14207,6 +14261,32 @@ async function dispatch(client, args, meta) {
|
|
|
14207
14261
|
fs2.writeFileSync(outFile, buf);
|
|
14208
14262
|
return { written: outFile, bytes: buf.length };
|
|
14209
14263
|
}
|
|
14264
|
+
case "portfolio": {
|
|
14265
|
+
if (!subcommand)
|
|
14266
|
+
throw new CliUsageError(
|
|
14267
|
+
"Missing subcommand for portfolio",
|
|
14268
|
+
"portfolio"
|
|
14269
|
+
);
|
|
14270
|
+
switch (subcommand) {
|
|
14271
|
+
case "accounts":
|
|
14272
|
+
return client.portfolio.accounts();
|
|
14273
|
+
case "summary":
|
|
14274
|
+
return client.portfolio.summary(
|
|
14275
|
+
requireFlag(flags, "account-id", "portfolio summary")
|
|
14276
|
+
);
|
|
14277
|
+
case "activities":
|
|
14278
|
+
return client.portfolio.activities({
|
|
14279
|
+
accountId: requireFlag(flags, "account-id", "portfolio activities"),
|
|
14280
|
+
limit: num(flags["limit"]),
|
|
14281
|
+
pageToken: flags["page-token"]
|
|
14282
|
+
});
|
|
14283
|
+
default:
|
|
14284
|
+
throw new CliUsageError(
|
|
14285
|
+
`Unknown subcommand: portfolio ${subcommand}`,
|
|
14286
|
+
"portfolio"
|
|
14287
|
+
);
|
|
14288
|
+
}
|
|
14289
|
+
}
|
|
14210
14290
|
case "trading": {
|
|
14211
14291
|
if (!subcommand)
|
|
14212
14292
|
throw new CliUsageError("Missing subcommand for trading", "trading");
|