@alva-ai/toolkit 0.21.0 → 0.23.0-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/README.md +2 -0
- package/dist/browser.global.js +130 -3
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +209 -10
- package/dist/cli.js +817 -689
- package/dist/cli.js.map +1 -1
- package/dist/dispatch.d.ts +210 -11
- package/dist/dispatch.js +314 -81
- package/dist/dispatch.js.map +1 -1
- package/dist/index.cjs +506 -609
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +210 -11
- package/dist/index.d.ts +210 -11
- package/dist/index.js +505 -609
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/dispatch.js
CHANGED
|
@@ -6115,7 +6115,19 @@ var COMMAND_DEFINITIONS = [
|
|
|
6115
6115
|
"description",
|
|
6116
6116
|
"changelog",
|
|
6117
6117
|
"agent-type"
|
|
6118
|
-
]
|
|
6118
|
+
],
|
|
6119
|
+
booleans: ["skip-auto-trigger"]
|
|
6120
|
+
}),
|
|
6121
|
+
command("automation update", {
|
|
6122
|
+
values: [
|
|
6123
|
+
"id",
|
|
6124
|
+
"version",
|
|
6125
|
+
"cronjob-id",
|
|
6126
|
+
"description",
|
|
6127
|
+
"changelog",
|
|
6128
|
+
"agent-type"
|
|
6129
|
+
],
|
|
6130
|
+
booleans: ["trigger"]
|
|
6119
6131
|
}),
|
|
6120
6132
|
command("automation stop", { values: ["id"] }),
|
|
6121
6133
|
command("automation resume", { values: ["id"] }),
|
|
@@ -6138,7 +6150,11 @@ var COMMAND_DEFINITIONS = [
|
|
|
6138
6150
|
}),
|
|
6139
6151
|
command("playbooks list", {
|
|
6140
6152
|
values: ["owner", "limit", "cursor"],
|
|
6141
|
-
booleans: ["json"]
|
|
6153
|
+
booleans: ["json", "all"]
|
|
6154
|
+
}),
|
|
6155
|
+
command("playbooks mine", {
|
|
6156
|
+
values: ["filter", "limit", "cursor"],
|
|
6157
|
+
booleans: ["json", "all"]
|
|
6142
6158
|
}),
|
|
6143
6159
|
command("functions allowance"),
|
|
6144
6160
|
command("functions allowance get", { values: ["playbook-id"] }),
|
|
@@ -6174,7 +6190,8 @@ var COMMAND_DEFINITIONS = [
|
|
|
6174
6190
|
"description",
|
|
6175
6191
|
"changelog",
|
|
6176
6192
|
"agent-type"
|
|
6177
|
-
]
|
|
6193
|
+
],
|
|
6194
|
+
booleans: ["skip-auto-trigger"]
|
|
6178
6195
|
}),
|
|
6179
6196
|
command("release playbook-draft", {
|
|
6180
6197
|
values: [
|
|
@@ -6347,6 +6364,10 @@ var COMMAND_DEFINITIONS = [
|
|
|
6347
6364
|
command("portfolio activities", {
|
|
6348
6365
|
values: ["account-id", "limit", "page-token"]
|
|
6349
6366
|
}),
|
|
6367
|
+
command("markets narrative", { values: ["ticker"] }),
|
|
6368
|
+
command("markets earnings", {
|
|
6369
|
+
values: ["ticker", "event", "fiscal-year", "fiscal-quarter"]
|
|
6370
|
+
}),
|
|
6350
6371
|
command("trading accounts"),
|
|
6351
6372
|
command("trading portfolio", { values: ["account-id"] }),
|
|
6352
6373
|
command("trading orders", {
|
|
@@ -6582,35 +6603,13 @@ function parseCommand(args) {
|
|
|
6582
6603
|
}
|
|
6583
6604
|
|
|
6584
6605
|
// src/cli/dataSkillsFormat.ts
|
|
6585
|
-
var TIER_ORDER = [
|
|
6586
|
-
"public",
|
|
6587
|
-
"alternative",
|
|
6588
|
-
"unstructured"
|
|
6589
|
-
];
|
|
6590
|
-
function formatTierCounts(counts) {
|
|
6591
|
-
if (!counts) return "";
|
|
6592
|
-
const parts = [];
|
|
6593
|
-
for (const tier of TIER_ORDER) {
|
|
6594
|
-
const n = counts[tier];
|
|
6595
|
-
if (n) parts.push(`${tier}=${n}`);
|
|
6596
|
-
}
|
|
6597
|
-
return parts.join(" ");
|
|
6598
|
-
}
|
|
6599
6606
|
function formatSkillsList(payload) {
|
|
6600
6607
|
const skills = payload.skills ?? [];
|
|
6601
6608
|
if (skills.length === 0) return "(no skills)\n";
|
|
6602
6609
|
const lines = [`${skills.length} skill(s):`, ""];
|
|
6603
6610
|
for (const s of skills) {
|
|
6604
|
-
const
|
|
6605
|
-
|
|
6606
|
-
if (meta) {
|
|
6607
|
-
const parts = [`${meta.endpoint_count} endpoints`];
|
|
6608
|
-
const tiers = formatTierCounts(meta.endpoint_tier_counts);
|
|
6609
|
-
if (tiers) parts.push(tiers);
|
|
6610
|
-
if (meta.pro_count > 0) parts.push(`${meta.pro_count} pro`);
|
|
6611
|
-
tag = `[${parts.join("; ")}]`;
|
|
6612
|
-
}
|
|
6613
|
-
lines.push(`\u2022 ${s.name}${tag ? ` ${tag}` : ""}`);
|
|
6611
|
+
const tag = s.metadata ? ` [${s.metadata.endpoint_count} endpoints]` : "";
|
|
6612
|
+
lines.push(`\u2022 ${s.name}${tag}`);
|
|
6614
6613
|
if (s.description) lines.push(` ${s.description}`);
|
|
6615
6614
|
lines.push("");
|
|
6616
6615
|
}
|
|
@@ -6618,52 +6617,37 @@ function formatSkillsList(payload) {
|
|
|
6618
6617
|
}
|
|
6619
6618
|
function formatEndpointMetadataTable(endpoints) {
|
|
6620
6619
|
if (endpoints.length === 0) return "";
|
|
6621
|
-
const rows = endpoints.map((
|
|
6622
|
-
method:
|
|
6623
|
-
path:
|
|
6624
|
-
file:
|
|
6625
|
-
tier: e.tier,
|
|
6626
|
-
access: e.pro_required ? "pro" : "free"
|
|
6620
|
+
const rows = endpoints.map((endpoint) => ({
|
|
6621
|
+
method: endpoint.method,
|
|
6622
|
+
path: endpoint.path,
|
|
6623
|
+
file: endpoint.file
|
|
6627
6624
|
}));
|
|
6628
|
-
const headers = ["METHOD", "PATH", "FILE"
|
|
6629
|
-
const
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
const lines = [
|
|
6635
|
-
headers.map((h, i) => pad(h, widths[i])).join(" "),
|
|
6636
|
-
widths.map((w) => "-".repeat(w)).join(" "),
|
|
6637
|
-
...rows.map(
|
|
6638
|
-
(r) => [r.method, r.path, r.file, r.tier, r.access].map((v, i) => pad(String(v), widths[i])).join(" ")
|
|
6625
|
+
const headers = ["METHOD", "PATH", "FILE"];
|
|
6626
|
+
const keys = ["method", "path", "file"];
|
|
6627
|
+
const widths = headers.map(
|
|
6628
|
+
(header, index) => Math.max(
|
|
6629
|
+
header.length,
|
|
6630
|
+
...rows.map((row) => String(row[keys[index]]).length)
|
|
6639
6631
|
)
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
}
|
|
6643
|
-
function formatSingleEndpointMetadata(meta) {
|
|
6644
|
-
if (!meta) return "";
|
|
6632
|
+
);
|
|
6633
|
+
const pad = (value, width) => value + " ".repeat(Math.max(0, width - value.length));
|
|
6645
6634
|
return [
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6635
|
+
headers.map((header, index) => pad(header, widths[index])).join(" "),
|
|
6636
|
+
widths.map((width) => "-".repeat(width)).join(" "),
|
|
6637
|
+
...rows.map(
|
|
6638
|
+
(row) => keys.map((key, index) => pad(String(row[key]), widths[index])).join(" ")
|
|
6639
|
+
)
|
|
6651
6640
|
].join("\n");
|
|
6652
6641
|
}
|
|
6653
|
-
function isEndpointMetadata(
|
|
6654
|
-
return !!
|
|
6642
|
+
function isEndpointMetadata(metadata) {
|
|
6643
|
+
return !!metadata && typeof metadata === "object" && "path" in metadata && "method" in metadata;
|
|
6655
6644
|
}
|
|
6656
6645
|
function formatSkillSummary(doc) {
|
|
6657
6646
|
const sections = [];
|
|
6658
6647
|
sections.push(`# ${doc.name}`);
|
|
6659
6648
|
if (doc.description) sections.push(doc.description);
|
|
6660
6649
|
if (doc.metadata && !isEndpointMetadata(doc.metadata)) {
|
|
6661
|
-
|
|
6662
|
-
const parts = [`${m.endpoint_count} endpoints`];
|
|
6663
|
-
const counts = formatTierCounts(m.endpoint_tier_counts);
|
|
6664
|
-
if (counts) parts.push(counts);
|
|
6665
|
-
if (m.pro_count > 0) parts.push(`${m.pro_count} pro`);
|
|
6666
|
-
sections.push(`(${parts.join("; ")})`);
|
|
6650
|
+
sections.push(`(${doc.metadata.endpoint_count} endpoints)`);
|
|
6667
6651
|
}
|
|
6668
6652
|
sections.push("---");
|
|
6669
6653
|
sections.push((doc.content ?? "").trimEnd());
|
|
@@ -6678,7 +6662,13 @@ function formatSkillEndpoint(doc) {
|
|
|
6678
6662
|
sections.push(`# ${doc.name}`);
|
|
6679
6663
|
if (doc.description) sections.push(doc.description);
|
|
6680
6664
|
if (isEndpointMetadata(doc.metadata)) {
|
|
6681
|
-
sections.push(
|
|
6665
|
+
sections.push(
|
|
6666
|
+
[
|
|
6667
|
+
"Endpoint metadata:",
|
|
6668
|
+
` ${doc.metadata.method} ${doc.metadata.path}`,
|
|
6669
|
+
` file: ${doc.metadata.file}`
|
|
6670
|
+
].join("\n")
|
|
6671
|
+
);
|
|
6682
6672
|
}
|
|
6683
6673
|
sections.push("---");
|
|
6684
6674
|
sections.push((doc.content ?? "").trimEnd());
|
|
@@ -6733,6 +6723,7 @@ var PLAYBOOK_VISIBILITIES = [
|
|
|
6733
6723
|
"private",
|
|
6734
6724
|
"paid"
|
|
6735
6725
|
];
|
|
6726
|
+
var OWNED_PLAYBOOK_FILTERS = ["draft", "running", "paused"];
|
|
6736
6727
|
function webOriginFromApiBase(apiBaseUrl) {
|
|
6737
6728
|
try {
|
|
6738
6729
|
const host = new URL(apiBaseUrl).hostname;
|
|
@@ -6802,6 +6793,25 @@ function discoveryItemLines(item, webOrigin) {
|
|
|
6802
6793
|
out.push("");
|
|
6803
6794
|
return out;
|
|
6804
6795
|
}
|
|
6796
|
+
function formatOwnedPlaybookList(items, opts = {}) {
|
|
6797
|
+
if (!items || items.length === 0) return "(no playbooks)\n";
|
|
6798
|
+
const lines = [`${items.length} playbook(s):`, ""];
|
|
6799
|
+
for (const item of items) {
|
|
6800
|
+
const title = item.display_name || item.name || item.id;
|
|
6801
|
+
const visibility = item.visibility ? ` [${item.visibility}]` : "";
|
|
6802
|
+
lines.push(`\u2022 ${title}${visibility}`);
|
|
6803
|
+
if (item.name && item.name !== title) lines.push(` ${item.name}`);
|
|
6804
|
+
lines.push(` id: ${item.id}`);
|
|
6805
|
+
lines.push("");
|
|
6806
|
+
}
|
|
6807
|
+
if (opts.hasNext && !opts.all) {
|
|
6808
|
+
lines.push(
|
|
6809
|
+
"(more results \u2014 pass --cursor <last item cursor>, or --all for every page)",
|
|
6810
|
+
""
|
|
6811
|
+
);
|
|
6812
|
+
}
|
|
6813
|
+
return lines.join("\n");
|
|
6814
|
+
}
|
|
6805
6815
|
|
|
6806
6816
|
// src/cli/productFormat.ts
|
|
6807
6817
|
function formatAutomationList(result) {
|
|
@@ -10258,7 +10268,7 @@ ${formatReport(report, "human")}
|
|
|
10258
10268
|
}
|
|
10259
10269
|
|
|
10260
10270
|
// src/cli/dispatch.ts
|
|
10261
|
-
var CLI_VERSION = true ? "0.
|
|
10271
|
+
var CLI_VERSION = true ? "0.23.0-beta.0" : "dev";
|
|
10262
10272
|
var DEFAULT_RUN_TIMEOUT_MS = 6e5;
|
|
10263
10273
|
var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
|
|
10264
10274
|
var GLOBAL_VALUE_FLAGS = Object.entries(GLOBAL_FLAG_DEFINITIONS).filter(([, kind]) => kind === "value").map(([name]) => `--${name}`);
|
|
@@ -10304,7 +10314,7 @@ Commands:
|
|
|
10304
10314
|
service-account Restricted run-as identities (create, list, delete, grant, revoke)
|
|
10305
10315
|
release Feed and playbook releases (feed, playbook-draft, playbook)
|
|
10306
10316
|
lint Design-system lint (playbook)
|
|
10307
|
-
automation Automation management (list, inspect, publish, stop, resume, delete)
|
|
10317
|
+
automation Automation management (list, inspect, publish, update, stop, resume, delete)
|
|
10308
10318
|
alert Alert management (list, follows, enable, disable, history, preferences, enable-session-completed, disable-session-completed)
|
|
10309
10319
|
feed Legacy automation alias (list, stop, resume, delete, set-visibility)
|
|
10310
10320
|
playbooks Playbook discovery (trending, get, list) and visibility
|
|
@@ -10321,6 +10331,7 @@ Commands:
|
|
|
10321
10331
|
subscriptions Playbook follows and feed alert subscriptions
|
|
10322
10332
|
remix Save playbook remix lineage
|
|
10323
10333
|
portfolio Connected-account portfolio (accounts, summary, activities)
|
|
10334
|
+
markets Company narrative and earnings context (narrative, earnings)
|
|
10324
10335
|
trading Trading operations (accounts, portfolio, orders, subscriptions, equity-history, risk-rules, subscribe, unsubscribe, execute, update-risk-rules)
|
|
10325
10336
|
broker Agentic order execution \u2014 venue-native passthrough to trex (accounts, quote, order, balance, positions, ...; run 'alva broker describe')
|
|
10326
10337
|
auth Authentication (login)
|
|
@@ -10491,12 +10502,13 @@ Path conventions:
|
|
|
10491
10502
|
Quote tilde paths to prevent shell expansion: --path "~/data" (not --path ~/data).
|
|
10492
10503
|
|
|
10493
10504
|
Time series reads:
|
|
10494
|
-
|
|
10495
|
-
@last/{n}
|
|
10496
|
-
@range/{
|
|
10497
|
-
@
|
|
10498
|
-
@
|
|
10499
|
-
@
|
|
10505
|
+
Feed data directories are synth mounts. Their supported read suffixes are:
|
|
10506
|
+
@last/{n} Last N data points (chronological order)
|
|
10507
|
+
@range/{start_ms}..{end_ms} Between Unix millisecond timestamps
|
|
10508
|
+
@before/{timestamp_ms}/{limit} Up to limit points before a Unix millisecond timestamp
|
|
10509
|
+
@after/{timestamp_ms}/{limit} Up to limit points after a Unix millisecond timestamp
|
|
10510
|
+
@count Data point count
|
|
10511
|
+
RFC 3339, Unix-second timestamps, @range/{duration}, and @now are not supported.
|
|
10500
10512
|
|
|
10501
10513
|
Grant/revoke subjects:
|
|
10502
10514
|
special:user:* Public (anyone, including unauthenticated)
|
|
@@ -10724,7 +10736,8 @@ commands called "feeds"; ids are currently the same underlying feed ids.
|
|
|
10724
10736
|
Subcommands:
|
|
10725
10737
|
list List automations owned by the caller
|
|
10726
10738
|
inspect Inspect one automation and show its flow config path when available
|
|
10727
|
-
publish
|
|
10739
|
+
publish First-publish/register a new automation after deploying its cronjob
|
|
10740
|
+
update Partially update an existing automation by numeric id
|
|
10728
10741
|
stop Stop an automation's producer cronjob
|
|
10729
10742
|
resume Resume a stopped automation's producer cronjob
|
|
10730
10743
|
delete Soft-delete an automation
|
|
@@ -10743,15 +10756,33 @@ Publish flags:
|
|
|
10743
10756
|
--description <text> Automation description
|
|
10744
10757
|
--changelog <text> Per-major changelog summary
|
|
10745
10758
|
--agent-type <type> Agent kind that produces this automation, e.g. "alpi"
|
|
10759
|
+
--skip-auto-trigger Suppress the default first producer run. Publishing
|
|
10760
|
+
still creates the owner's alert binding.
|
|
10761
|
+
|
|
10762
|
+
Publish behavior:
|
|
10763
|
+
A new automation creates an ACTIVE owner alert binding, then triggers its
|
|
10764
|
+
first producer run unless --skip-auto-trigger is present. Use the flag when
|
|
10765
|
+
you will route the binding or trigger the producer explicitly afterward.
|
|
10766
|
+
|
|
10767
|
+
Update flags:
|
|
10768
|
+
--id <automation_id> Existing automation id (required)
|
|
10769
|
+
--version <version> New semantic version; omitted preserves the current one
|
|
10770
|
+
--cronjob-id <id> Replacement producer; omitted preserves the current one
|
|
10771
|
+
--description <text> Replace description; explicit empty string clears it
|
|
10772
|
+
--changelog <text> Replace per-major changelog; explicit empty clears it
|
|
10773
|
+
--agent-type <type> Replace agent kind; explicit empty clears it
|
|
10774
|
+
--trigger Trigger one run after the update commits
|
|
10746
10775
|
|
|
10747
10776
|
Lifecycle flags:
|
|
10748
|
-
--id <automation_id> Numeric automation id (required for inspect/stop/resume/delete)
|
|
10777
|
+
--id <automation_id> Numeric automation id (required for inspect/update/stop/resume/delete)
|
|
10749
10778
|
|
|
10750
10779
|
Examples:
|
|
10751
10780
|
alva automation list
|
|
10752
10781
|
alva automation list --status all --limit 20
|
|
10753
10782
|
alva automation inspect --id 42
|
|
10754
10783
|
alva automation publish --name btc-ema --version 1.0.0 --cronjob-id 42
|
|
10784
|
+
alva automation update --id 42 --description "Updated BTC EMA"
|
|
10785
|
+
alva automation update --id 42 --version 2.0.0 --trigger
|
|
10755
10786
|
alva automation stop --id 42
|
|
10756
10787
|
alva automation resume --id 42
|
|
10757
10788
|
alva automation delete --id 42`,
|
|
@@ -10861,7 +10892,8 @@ Find and resolve playbooks with an agent-friendly response shape.
|
|
|
10861
10892
|
Subcommands:
|
|
10862
10893
|
trending List trending playbooks
|
|
10863
10894
|
get Resolve playbooks by id(s) or "owner/name" ref
|
|
10864
|
-
list List a user's playbooks by owner username
|
|
10895
|
+
list List a user's public (released) playbooks by owner username
|
|
10896
|
+
mine List YOUR OWN playbooks incl. drafts (requires auth)
|
|
10865
10897
|
set-visibility Set a playbook's visibility (requires auth)
|
|
10866
10898
|
|
|
10867
10899
|
Get flags:
|
|
@@ -10872,8 +10904,16 @@ Get flags:
|
|
|
10872
10904
|
|
|
10873
10905
|
List flags:
|
|
10874
10906
|
--owner <username> Owner username (required)
|
|
10875
|
-
--limit <n> Max results per page
|
|
10907
|
+
--limit <n> Max results per page (default one page of ~50)
|
|
10908
|
+
--cursor <cursor> Pagination cursor from previous response
|
|
10909
|
+
--all Fetch every page (auto-paginate); without it a
|
|
10910
|
+
single page is returned \u2014 check has_next
|
|
10911
|
+
|
|
10912
|
+
Mine flags (your own playbooks, drafts included):
|
|
10913
|
+
--filter <f> draft | running | paused (optional; omit for all)
|
|
10914
|
+
--limit <n> Max results per page (default one page of ~50)
|
|
10876
10915
|
--cursor <cursor> Pagination cursor from previous response
|
|
10916
|
+
--all Fetch every page (auto-paginate)
|
|
10877
10917
|
|
|
10878
10918
|
Trending flags:
|
|
10879
10919
|
--keyword <text> Search text
|
|
@@ -10913,7 +10953,8 @@ Examples:
|
|
|
10913
10953
|
alva playbooks trending --keyword scanner --tags macro,ai --sort recent --limit 5
|
|
10914
10954
|
alva playbooks get --ids 8009,8010
|
|
10915
10955
|
alva playbooks get --ref alice/btc-dashboard
|
|
10916
|
-
alva playbooks list --owner alice
|
|
10956
|
+
alva playbooks list --owner alice --all
|
|
10957
|
+
alva playbooks mine --filter draft
|
|
10917
10958
|
alva playbooks set-visibility --name my-scanner --visibility private
|
|
10918
10959
|
alva playbooks set-visibility --name my-scanner --visibility public`,
|
|
10919
10960
|
functions: `Usage: alva functions <subcommand> [options]
|
|
@@ -11007,6 +11048,13 @@ Feed flags:
|
|
|
11007
11048
|
--agent-type <type> Agent kind that produces this feed, e.g. "alpi".
|
|
11008
11049
|
Marks the feed as an agent feed with an editable
|
|
11009
11050
|
prompt (AGENTS.md). Omit for a regular feed.
|
|
11051
|
+
--skip-auto-trigger Suppress the default first producer run. Releasing
|
|
11052
|
+
still creates the owner's alert binding.
|
|
11053
|
+
|
|
11054
|
+
Feed release behavior:
|
|
11055
|
+
A new feed creates an ACTIVE owner alert binding, then triggers its first
|
|
11056
|
+
producer run unless --skip-auto-trigger is present. Use the flag when you
|
|
11057
|
+
will route the binding or trigger the producer explicitly afterward.
|
|
11010
11058
|
|
|
11011
11059
|
Playbook-draft flags:
|
|
11012
11060
|
--name <name> URL-safe playbook name, unique per user (required)
|
|
@@ -11131,8 +11179,8 @@ public \u2014 no Alva credentials required.
|
|
|
11131
11179
|
|
|
11132
11180
|
Subcommands:
|
|
11133
11181
|
list List all available data skills
|
|
11134
|
-
summary <skill> Get the endpoints table for a skill
|
|
11135
|
-
endpoint <skill> <file> Get full documentation
|
|
11182
|
+
summary <skill> Get the endpoints table for a skill
|
|
11183
|
+
endpoint <skill> <file> Get full documentation for a specific endpoint
|
|
11136
11184
|
|
|
11137
11185
|
Flags:
|
|
11138
11186
|
--json Emit raw JSON instead of the readable rendering (for scripting / jq)
|
|
@@ -11365,6 +11413,33 @@ Examples:
|
|
|
11365
11413
|
alva portfolio accounts
|
|
11366
11414
|
alva portfolio summary --account-id trex:123
|
|
11367
11415
|
alva portfolio activities --account-id snaptrade:456 --limit 20`,
|
|
11416
|
+
markets: `Usage: alva markets <subcommand> [options]
|
|
11417
|
+
|
|
11418
|
+
Read the Markets backend's canonical company context. The Toolkit resolves
|
|
11419
|
+
earnings events through the backend period catalog; it does not construct ALFS
|
|
11420
|
+
owners, feed slugs, versions, or paths.
|
|
11421
|
+
|
|
11422
|
+
Subcommands:
|
|
11423
|
+
narrative Get the current narrative, history, and narrative change log
|
|
11424
|
+
earnings Get Pre, Release, Transcript, and Post for one fiscal event
|
|
11425
|
+
|
|
11426
|
+
Narrative flags:
|
|
11427
|
+
--ticker <symbol> Stock ticker (required)
|
|
11428
|
+
|
|
11429
|
+
Earnings flags:
|
|
11430
|
+
--ticker <symbol> Stock ticker (required)
|
|
11431
|
+
--event <selector> latest-completed (default) or next-confirmed
|
|
11432
|
+
--fiscal-year <year> Explicit fiscal year; requires --fiscal-quarter
|
|
11433
|
+
--fiscal-quarter <Q1..Q4> Explicit fiscal quarter; requires --fiscal-year
|
|
11434
|
+
|
|
11435
|
+
Do not combine --event with --fiscal-year/--fiscal-quarter. These commands read
|
|
11436
|
+
the current backend view; historical query-as-of gating is not supported yet.
|
|
11437
|
+
|
|
11438
|
+
Examples:
|
|
11439
|
+
alva markets narrative --ticker AAPL
|
|
11440
|
+
alva markets earnings --ticker AAPL
|
|
11441
|
+
alva markets earnings --ticker AAPL --event next-confirmed
|
|
11442
|
+
alva markets earnings --ticker AAPL --fiscal-year 2026 --fiscal-quarter Q3`,
|
|
11368
11443
|
trading: `Usage: alva trading <subcommand> [options]
|
|
11369
11444
|
|
|
11370
11445
|
Manage trading accounts, portfolios, orders, subscriptions, and risk rules.
|
|
@@ -11722,8 +11797,36 @@ function feedReleaseParams(flags, command2) {
|
|
|
11722
11797
|
view_json: jsonParse(flags["view-json"]),
|
|
11723
11798
|
description: flags["description"],
|
|
11724
11799
|
changelog: flags["changelog"],
|
|
11725
|
-
agent_type: flags["agent-type"]
|
|
11800
|
+
agent_type: flags["agent-type"],
|
|
11801
|
+
skip_auto_trigger: boolFlag(flags["skip-auto-trigger"])
|
|
11802
|
+
};
|
|
11803
|
+
}
|
|
11804
|
+
function automationUpdateParams(flags) {
|
|
11805
|
+
const command2 = "automation update";
|
|
11806
|
+
const cronjobID = flags["cronjob-id"] === void 0 ? void 0 : optionalBoundedIntegerFlag(
|
|
11807
|
+
flags,
|
|
11808
|
+
"cronjob-id",
|
|
11809
|
+
command2,
|
|
11810
|
+
1,
|
|
11811
|
+
Number.MAX_SAFE_INTEGER
|
|
11812
|
+
);
|
|
11813
|
+
const trigger = boolFlag(flags["trigger"]);
|
|
11814
|
+
const params = {
|
|
11815
|
+
id: requirePositiveIntegerStringFlag(flags, "id", command2),
|
|
11816
|
+
version: flags["version"],
|
|
11817
|
+
cronjob_id: cronjobID,
|
|
11818
|
+
description: flags["description"],
|
|
11819
|
+
changelog: flags["changelog"],
|
|
11820
|
+
agent_type: flags["agent-type"],
|
|
11821
|
+
trigger: trigger === true ? true : void 0
|
|
11726
11822
|
};
|
|
11823
|
+
if (params.version === void 0 && params.cronjob_id === void 0 && params.description === void 0 && params.changelog === void 0 && params.agent_type === void 0 && params.trigger !== true) {
|
|
11824
|
+
throw new CliUsageError(
|
|
11825
|
+
"automation update requires at least one field or --trigger",
|
|
11826
|
+
"automation"
|
|
11827
|
+
);
|
|
11828
|
+
}
|
|
11829
|
+
return params;
|
|
11727
11830
|
}
|
|
11728
11831
|
function trendingPlaybooksSort(val) {
|
|
11729
11832
|
if (val === void 0) return void 0;
|
|
@@ -11744,6 +11847,17 @@ function playbookVisibility(val) {
|
|
|
11744
11847
|
"playbooks"
|
|
11745
11848
|
);
|
|
11746
11849
|
}
|
|
11850
|
+
function ownedPlaybookFilter(val) {
|
|
11851
|
+
if (val === void 0 || val === "") return void 0;
|
|
11852
|
+
const normalized = val.trim().toLowerCase();
|
|
11853
|
+
if (OWNED_PLAYBOOK_FILTERS.includes(normalized)) {
|
|
11854
|
+
return normalized;
|
|
11855
|
+
}
|
|
11856
|
+
throw new CliUsageError(
|
|
11857
|
+
`--filter must be one of ${OWNED_PLAYBOOK_FILTERS.join(", ")} for 'playbooks mine', got '${val}'`,
|
|
11858
|
+
"playbooks"
|
|
11859
|
+
);
|
|
11860
|
+
}
|
|
11747
11861
|
function feedVisibility(val) {
|
|
11748
11862
|
const normalized = val.trim().toLowerCase();
|
|
11749
11863
|
if (normalized === "public" || normalized === "private") {
|
|
@@ -12581,6 +12695,8 @@ async function dispatch(client, args, meta, deps) {
|
|
|
12581
12695
|
return client.automation.publish(
|
|
12582
12696
|
feedReleaseParams(flags, "automation publish")
|
|
12583
12697
|
);
|
|
12698
|
+
case "update":
|
|
12699
|
+
return client.automation.update(automationUpdateParams(flags));
|
|
12584
12700
|
case "stop":
|
|
12585
12701
|
return client.automation.stop({
|
|
12586
12702
|
id: requireNumericFlag(flags, "id", "automation stop")
|
|
@@ -12661,15 +12777,71 @@ async function dispatch(client, args, meta, deps) {
|
|
|
12661
12777
|
);
|
|
12662
12778
|
}
|
|
12663
12779
|
case "list": {
|
|
12780
|
+
const owner = requireFlag(flags, "owner", "playbooks list");
|
|
12781
|
+
const limit = num(flags["limit"]);
|
|
12782
|
+
if (boolFlag(flags["all"]) ?? false) {
|
|
12783
|
+
const first = await client.playbooks.listByOwner({
|
|
12784
|
+
owner,
|
|
12785
|
+
limit,
|
|
12786
|
+
cursor: flags["cursor"]
|
|
12787
|
+
});
|
|
12788
|
+
const items = first.items;
|
|
12789
|
+
let hasNext = first.has_next;
|
|
12790
|
+
let cursor = first.next_cursor;
|
|
12791
|
+
while (hasNext && cursor) {
|
|
12792
|
+
const page = await client.playbooks.listByOwner({
|
|
12793
|
+
owner,
|
|
12794
|
+
limit,
|
|
12795
|
+
cursor
|
|
12796
|
+
});
|
|
12797
|
+
items.push(...page.items);
|
|
12798
|
+
hasNext = page.has_next;
|
|
12799
|
+
cursor = page.next_cursor;
|
|
12800
|
+
}
|
|
12801
|
+
return asJson ? { items, has_next: false } : formatPlaybookList(items, webOrigin);
|
|
12802
|
+
}
|
|
12664
12803
|
const result = await client.playbooks.listByOwner({
|
|
12665
|
-
owner
|
|
12666
|
-
limit
|
|
12804
|
+
owner,
|
|
12805
|
+
limit,
|
|
12667
12806
|
cursor: flags["cursor"]
|
|
12668
12807
|
});
|
|
12669
12808
|
return asJson ? result : formatPlaybookList(result.items, webOrigin, {
|
|
12670
12809
|
hasNext: result.has_next
|
|
12671
12810
|
});
|
|
12672
12811
|
}
|
|
12812
|
+
case "mine": {
|
|
12813
|
+
const filter = ownedPlaybookFilter(flags["filter"]);
|
|
12814
|
+
const limit = num(flags["limit"]);
|
|
12815
|
+
if (boolFlag(flags["all"]) ?? false) {
|
|
12816
|
+
const first = await client.playbooks.listOwn({
|
|
12817
|
+
filter,
|
|
12818
|
+
limit,
|
|
12819
|
+
cursor: flags["cursor"]
|
|
12820
|
+
});
|
|
12821
|
+
const items = first.playbooks;
|
|
12822
|
+
let hasNext = first.has_next;
|
|
12823
|
+
let cursor = items.length ? items[items.length - 1].cursor : void 0;
|
|
12824
|
+
while (hasNext && cursor) {
|
|
12825
|
+
const page = await client.playbooks.listOwn({
|
|
12826
|
+
filter,
|
|
12827
|
+
limit,
|
|
12828
|
+
cursor
|
|
12829
|
+
});
|
|
12830
|
+
items.push(...page.playbooks);
|
|
12831
|
+
hasNext = page.has_next;
|
|
12832
|
+
cursor = page.playbooks.length ? page.playbooks[page.playbooks.length - 1].cursor : void 0;
|
|
12833
|
+
}
|
|
12834
|
+
return asJson ? { playbooks: items, has_next: false } : formatOwnedPlaybookList(items, { all: true });
|
|
12835
|
+
}
|
|
12836
|
+
const result = await client.playbooks.listOwn({
|
|
12837
|
+
filter,
|
|
12838
|
+
limit,
|
|
12839
|
+
cursor: flags["cursor"]
|
|
12840
|
+
});
|
|
12841
|
+
return asJson ? result : formatOwnedPlaybookList(result.playbooks, {
|
|
12842
|
+
hasNext: result.has_next
|
|
12843
|
+
});
|
|
12844
|
+
}
|
|
12673
12845
|
default:
|
|
12674
12846
|
throw new CliUsageError(
|
|
12675
12847
|
`Unknown subcommand: playbooks ${subcommand}`,
|
|
@@ -13479,6 +13651,67 @@ async function dispatch(client, args, meta, deps) {
|
|
|
13479
13651
|
);
|
|
13480
13652
|
}
|
|
13481
13653
|
}
|
|
13654
|
+
case "markets": {
|
|
13655
|
+
if (!subcommand)
|
|
13656
|
+
throw new CliUsageError("Missing subcommand for markets", "markets");
|
|
13657
|
+
const ticker = requireFlag(flags, "ticker", `markets ${subcommand}`);
|
|
13658
|
+
switch (subcommand) {
|
|
13659
|
+
case "narrative":
|
|
13660
|
+
return client.markets.narrative(ticker);
|
|
13661
|
+
case "earnings": {
|
|
13662
|
+
const event = flags["event"];
|
|
13663
|
+
const fiscalYear = optionalBoundedIntegerFlag(
|
|
13664
|
+
flags,
|
|
13665
|
+
"fiscal-year",
|
|
13666
|
+
"markets earnings",
|
|
13667
|
+
1900,
|
|
13668
|
+
9999
|
|
13669
|
+
);
|
|
13670
|
+
const fiscalQuarter = flags["fiscal-quarter"]?.toUpperCase();
|
|
13671
|
+
const hasExplicitPeriod = fiscalYear !== void 0 || fiscalQuarter !== void 0;
|
|
13672
|
+
if (event !== void 0 && hasExplicitPeriod) {
|
|
13673
|
+
throw new CliUsageError(
|
|
13674
|
+
"--event cannot be combined with --fiscal-year or --fiscal-quarter for 'markets earnings'",
|
|
13675
|
+
"markets"
|
|
13676
|
+
);
|
|
13677
|
+
}
|
|
13678
|
+
if (fiscalYear === void 0 !== (fiscalQuarter === void 0)) {
|
|
13679
|
+
throw new CliUsageError(
|
|
13680
|
+
"--fiscal-year and --fiscal-quarter must be provided together for 'markets earnings'",
|
|
13681
|
+
"markets"
|
|
13682
|
+
);
|
|
13683
|
+
}
|
|
13684
|
+
if (event !== void 0 && event !== "latest-completed" && event !== "next-confirmed") {
|
|
13685
|
+
throw new CliUsageError(
|
|
13686
|
+
"--event must be 'latest-completed' or 'next-confirmed' for 'markets earnings'",
|
|
13687
|
+
"markets"
|
|
13688
|
+
);
|
|
13689
|
+
}
|
|
13690
|
+
if (fiscalQuarter !== void 0 && !["Q1", "Q2", "Q3", "Q4"].includes(fiscalQuarter)) {
|
|
13691
|
+
throw new CliUsageError(
|
|
13692
|
+
"--fiscal-quarter must be Q1, Q2, Q3, or Q4 for 'markets earnings'",
|
|
13693
|
+
"markets"
|
|
13694
|
+
);
|
|
13695
|
+
}
|
|
13696
|
+
if (fiscalYear !== void 0 && fiscalQuarter !== void 0) {
|
|
13697
|
+
return client.markets.earnings({
|
|
13698
|
+
ticker,
|
|
13699
|
+
fiscalYear,
|
|
13700
|
+
fiscalQuarter
|
|
13701
|
+
});
|
|
13702
|
+
}
|
|
13703
|
+
return client.markets.earnings({
|
|
13704
|
+
ticker,
|
|
13705
|
+
event
|
|
13706
|
+
});
|
|
13707
|
+
}
|
|
13708
|
+
default:
|
|
13709
|
+
throw new CliUsageError(
|
|
13710
|
+
`Unknown subcommand: markets ${subcommand}`,
|
|
13711
|
+
"markets"
|
|
13712
|
+
);
|
|
13713
|
+
}
|
|
13714
|
+
}
|
|
13482
13715
|
case "trading": {
|
|
13483
13716
|
if (!subcommand)
|
|
13484
13717
|
throw new CliUsageError("Missing subcommand for trading", "trading");
|