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