@alva-ai/toolkit 0.34.0-beta.0 → 0.35.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/dispatch.js CHANGED
@@ -6038,12 +6038,12 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
6038
6038
  ),
6039
6039
  action(
6040
6040
  "steward send",
6041
- { values: ["body", "delivery-ids", "request-id"] },
6041
+ { values: ["body", "delivery-ids", "request-id", "digest-run-id"] },
6042
6042
  "steward-self"
6043
6043
  ),
6044
6044
  action(
6045
6045
  "steward pending",
6046
- { values: ["after", "since", "until", "first"] },
6046
+ { values: ["since", "until", "digest-run-id"] },
6047
6047
  "steward-self"
6048
6048
  ),
6049
6049
  action(
@@ -6051,6 +6051,7 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
6051
6051
  { values: ["delivery-ids", "digest-run-id"] },
6052
6052
  "steward-self"
6053
6053
  ),
6054
+ action("steward status", { values: ["digest-run-id"] }, "steward-self"),
6054
6055
  route("company-news create", "company-news create", {
6055
6056
  values: ["name", "tickers", "initial-lookback-hours", "page-size"]
6056
6057
  }),
@@ -6226,6 +6227,27 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
6226
6227
  route("markets earnings", "markets earnings", {
6227
6228
  values: ["ticker", "event", "fiscal-year", "fiscal-quarter"]
6228
6229
  }),
6230
+ route("markets watchlist list", "markets watchlist list", {
6231
+ values: ["limit", "cursor"]
6232
+ }),
6233
+ route("markets watchlist add", "markets watchlist add", {
6234
+ values: ["tickers", "kind"]
6235
+ }),
6236
+ route("markets watchlist remove", "markets watchlist remove", {
6237
+ values: ["tickers", "kind"]
6238
+ }),
6239
+ route("people search", "people search", {
6240
+ values: ["query", "kind", "limit"]
6241
+ }),
6242
+ route("people follows list", "people follows list", {
6243
+ values: ["kind", "limit", "cursor"]
6244
+ }),
6245
+ route("people follows follow", "people follows follow", {
6246
+ values: ["kind", "id"]
6247
+ }),
6248
+ route("people follows unfollow", "people follows unfollow", {
6249
+ values: ["kind", "id"]
6250
+ }),
6229
6251
  route("trading-pairs search", "trading-pairs search", {
6230
6252
  values: [
6231
6253
  "symbol",
@@ -6531,11 +6553,12 @@ Commands:
6531
6553
  run Execute Jagent JavaScript
6532
6554
  data-skills Discover structured Arrays data endpoints
6533
6555
  skillhub Discover curated methodology blueprints
6534
- markets Read market narrative and earnings context
6556
+ markets Read market context; manage the ticker watchlist
6557
+ people Search, follow, and unfollow Alva users and curated people
6535
6558
  trading-pairs Discover and strictly verify canonical trading pairs
6536
6559
  automation Create and operate scheduled automations
6537
6560
  schedule Manage future messages for this Session Inbox
6538
- steward Push steward reports for this Session Inbox (decide, forward, send, pending, briefed)
6561
+ steward Push steward routing and durable Daily Brief runs
6539
6562
  thesis Read published viewpoints and manage authored theses
6540
6563
  company-news Create backend-managed multi-ticker News Feeds
6541
6564
  playbooks Discover, build, release, and manage Playbooks
@@ -6579,16 +6602,18 @@ decide --delivery-id <id> --decision <immediate|digest|suppress> --reason <tex
6579
6602
  Record the decision first; forward/send are rejected without it.
6580
6603
  forward --delivery-id <id> [--request-id <uuid>]
6581
6604
  Re-post the original alert card by reference (immediate only).
6605
+ status --digest-run-id <uuid>
6606
+ Read the durable state and receipt of this Brief occurrence.
6607
+ pending --digest-run-id <uuid>
6608
+ Read the complete fixed-window delivery set owned by this run.
6609
+ send --digest-run-id <uuid> [--delivery-ids <a,b,c>] [--body <markdown>]
6610
+ Publish the reviewed coverage and complete the run. Omit the body
6611
+ when reviewed coverage yields no useful content; keep those ids.
6612
+ pending [--since <RFC3339>] [--until <RFC3339>]
6613
+ Legacy fixed-window read; automatic paging and bounded retries.
6582
6614
  send [--delivery-ids <a,b,c>] --body <markdown> [--request-id <uuid>]
6583
- Post your own Markdown covering the listed deliveries; the response
6584
- echoes requestId \u2014 pass it to briefed. Omit --delivery-ids for a
6585
- For-You-only Brief that covers no ledger delivery.
6586
- pending [--after <cursor>] [--since <RFC3339>] [--until <RFC3339>] [--first <1-100>]
6587
- Deliveries held for the Daily Brief. Repeat with --after <nextCursor>
6588
- until nextCursor is null; the cursor carries the window.
6589
6615
  briefed --digest-run-id <id> --delivery-ids <a,b,c>
6590
- Mark every reviewed delivery covered: use the requestId echoed by send,
6591
- or the digest_request run id when nothing was worth sending.
6616
+ Legacy send/completion contract; do not use for durable runs.
6592
6617
 
6593
6618
  request ids are generated when omitted; pass one to retry an unclear result.
6594
6619
 
@@ -6734,7 +6759,34 @@ Subcommands:
6734
6759
 
6735
6760
  Subcommands:
6736
6761
  narrative
6737
- earnings`,
6762
+ earnings
6763
+ watchlist list|add|remove`,
6764
+ "markets watchlist": `Usage: alva markets watchlist <list|add|remove> [options]
6765
+
6766
+ The user's ticker watchlist in the Alva App. Act only when the user asks to
6767
+ add or remove tickers. add/remove take --tickers <A,B> (1-50 exact symbols;
6768
+ suffix one with :stock, :etf, or :crypto to pick its kind, e.g. BTC:crypto)
6769
+ and optional --kind stock|etf|crypto as the default kind; one atomic write.
6770
+ Report every group: added|removed (written now), unchanged (already in that
6771
+ state), unresolved (NOT_FOUND, or FAILED_PRECONDITION = ambiguous symbol: ask
6772
+ the user or retry with a kind suffix). Nothing is written when no ticker
6773
+ resolves. add re-adds a ticker the user removed earlier. list takes
6774
+ --limit <1-100> and --cursor <pageInfo.endCursor>.`,
6775
+ people: `Usage: alva people <subcommand> [options]
6776
+
6777
+ Subcommands:
6778
+ search --query <text> [--kind user|person] [--limit <1-50>]
6779
+ follows list|follow|unfollow
6780
+
6781
+ USER is an Alva user; PERSON is a curated person (KOL). follow/unfollow take
6782
+ --kind and --id from search or list results. Search is a prefix match on
6783
+ name, username, or slug. Follow only an exact match; when several profiles
6784
+ match, ask the user which one. Act only when the user asks to follow or
6785
+ unfollow.`,
6786
+ "people follows": `Usage: alva people follows <list|follow|unfollow> [options]
6787
+
6788
+ list: [--kind user|person] [--limit <1-50>] [--cursor <pageInfo.endCursor>]
6789
+ follow|unfollow: --kind user|person --id <profile id>`,
6738
6790
  "trading-pairs": `Usage: alva trading-pairs <subcommand>
6739
6791
 
6740
6792
  Subcommands:
@@ -7144,10 +7196,105 @@ function validateXReadParams(params) {
7144
7196
  }
7145
7197
  }
7146
7198
 
7147
- // src/resources/thesisPublication.ts
7199
+ // src/resources/follows.ts
7200
+ var MAX_TICKERS = 50;
7201
+ var MAX_TICKER_LENGTH = 40;
7202
+ var MAX_PROFILE_FIRST = 50;
7203
+ var MAX_PROFILE_QUERY_LENGTH = 200;
7204
+ var TICKER_KINDS = ["STOCK", "ETF", "CRYPTO"];
7205
+ var PROFILE_KINDS = ["USER", "PERSON"];
7148
7206
  function record2(value) {
7149
7207
  return typeof value === "object" && value !== null && !Array.isArray(value);
7150
7208
  }
7209
+ function boundedFirst(value, max, name = "first") {
7210
+ if (value === void 0) return void 0;
7211
+ if (!Number.isInteger(value) || value < 1 || value > max) {
7212
+ throw new Error(`${name} must be an integer between 1 and ${max}`);
7213
+ }
7214
+ return value;
7215
+ }
7216
+ function profileKind(value, required) {
7217
+ if (value === void 0 && !required) return void 0;
7218
+ if (typeof value !== "string" || !PROFILE_KINDS.includes(value)) {
7219
+ throw new Error("kind must be USER or PERSON");
7220
+ }
7221
+ return value;
7222
+ }
7223
+ function tickerKind(value) {
7224
+ if (value === void 0) return void 0;
7225
+ if (typeof value !== "string" || !TICKER_KINDS.includes(value)) {
7226
+ throw new Error("kind must be STOCK, ETF, or CRYPTO");
7227
+ }
7228
+ return value;
7229
+ }
7230
+ function parseTickerSpec(raw) {
7231
+ const separator = raw.lastIndexOf(":");
7232
+ if (separator === -1) return { ticker: raw };
7233
+ return {
7234
+ ticker: raw.slice(0, separator),
7235
+ kind: tickerKind(
7236
+ raw.slice(separator + 1).trim().toUpperCase()
7237
+ )
7238
+ };
7239
+ }
7240
+ function normalizeWatchlistTickersParams(params) {
7241
+ if (!record2(params) || !Array.isArray(params.tickers)) {
7242
+ throw new Error("tickers must be a list of ticker symbols");
7243
+ }
7244
+ const defaultKind = tickerKind(params.kind);
7245
+ const tickers = [];
7246
+ for (const raw of params.tickers) {
7247
+ const spec = typeof raw === "string" ? { ticker: raw } : raw;
7248
+ if (!record2(spec) || typeof spec.ticker !== "string") {
7249
+ throw new Error("tickers must be symbols or {ticker, kind} specs");
7250
+ }
7251
+ const ticker = spec.ticker.trim().toUpperCase();
7252
+ if (!ticker || /\s/.test(ticker) || ticker.length > MAX_TICKER_LENGTH) {
7253
+ throw new Error(
7254
+ `ticker '${spec.ticker}' must be a non-empty symbol of at most ${MAX_TICKER_LENGTH} characters`
7255
+ );
7256
+ }
7257
+ const kind = tickerKind(spec.kind) ?? defaultKind;
7258
+ if (!tickers.some((t) => t.ticker === ticker && t.kind === kind)) {
7259
+ tickers.push(kind === void 0 ? { ticker } : { ticker, kind });
7260
+ }
7261
+ }
7262
+ if (tickers.length === 0 || tickers.length > MAX_TICKERS) {
7263
+ throw new Error(
7264
+ `tickers must contain between 1 and ${MAX_TICKERS} symbols`
7265
+ );
7266
+ }
7267
+ return { tickers };
7268
+ }
7269
+ function validateProfileRef(params) {
7270
+ if (!record2(params)) throw new Error("profile reference must be an object");
7271
+ const kind = profileKind(params.kind, true);
7272
+ if (typeof params.id !== "string" || !/^[1-9]\d{0,18}$/.test(params.id)) {
7273
+ throw new Error("id must be a positive decimal profile id");
7274
+ }
7275
+ return { kind, id: params.id };
7276
+ }
7277
+ function validateSearchProfilesParams(params) {
7278
+ if (!record2(params) || typeof params.query !== "string") {
7279
+ throw new Error("query is required");
7280
+ }
7281
+ const query = params.query.trim();
7282
+ if (!query || query.length > MAX_PROFILE_QUERY_LENGTH) {
7283
+ throw new Error(
7284
+ `query must be non-empty and at most ${MAX_PROFILE_QUERY_LENGTH} characters`
7285
+ );
7286
+ }
7287
+ return {
7288
+ query,
7289
+ kind: profileKind(params.kind, false),
7290
+ first: boundedFirst(params.first, MAX_PROFILE_FIRST)
7291
+ };
7292
+ }
7293
+
7294
+ // src/resources/thesisPublication.ts
7295
+ function record3(value) {
7296
+ return typeof value === "object" && value !== null && !Array.isArray(value);
7297
+ }
7151
7298
  function isPositiveInt64(value) {
7152
7299
  return typeof value === "string" && /^[1-9]\d{0,18}$/.test(value) && BigInt(value) <= 9223372036854775807n;
7153
7300
  }
@@ -7218,7 +7365,7 @@ var SELECTORS = [
7218
7365
  "entityId"
7219
7366
  ];
7220
7367
  function validateThesisPageParams(params) {
7221
- if (!record2(params)) throw argument("Thesis parameters must be an object");
7368
+ if (!record3(params)) throw argument("Thesis parameters must be an object");
7222
7369
  const first = params.first === void 0 ? 10 : params.first;
7223
7370
  if (typeof first !== "number" || !Number.isInteger(first) || first < 1 || first > 50) {
7224
7371
  throw argument("first must be an integer between 1 and 50");
@@ -7284,7 +7431,7 @@ query ToolkitForYou($input: FeedEntryConnectionInput) {
7284
7431
  }
7285
7432
  `.trim();
7286
7433
  function validateForYouListParams(params) {
7287
- if (!record2(params)) throw new Error("For You parameters must be an object");
7434
+ if (!record3(params)) throw new Error("For You parameters must be an object");
7288
7435
  const first = params.first === void 0 ? 20 : params.first;
7289
7436
  if (typeof first !== "number" || !Number.isInteger(first) || first < 1 || first > 50) {
7290
7437
  throw new Error("first must be an integer between 1 and 50");
@@ -7319,7 +7466,7 @@ query ToolkitForYouTheses($input: ThesisRecommendationInput) {
7319
7466
  }
7320
7467
  `.trim();
7321
7468
  function validateForYouThesesParams(params) {
7322
- if (!record2(params)) throw new Error("Thesis parameters must be an object");
7469
+ if (!record3(params)) throw new Error("Thesis parameters must be an object");
7323
7470
  const first = params.first === void 0 ? 10 : params.first;
7324
7471
  if (typeof first !== "number" || !Number.isInteger(first) || first < 1 || first > 10) {
7325
7472
  throw new Error("first must be an integer between 1 and 10");
@@ -7360,6 +7507,30 @@ var BRIEFED = `
7360
7507
  mutation ToolkitStewardBriefed($input: CompleteStewardBriefInput!) {
7361
7508
  completeStewardBrief(input: $input) { ok }
7362
7509
  }`.trim();
7510
+ var DIGEST_RUN_FIELDS = `
7511
+ digestRunId state scheduleId scheduleVersion occurrenceIndex
7512
+ windowSinceMs windowUntilMs scanCompletedAtMs bodySha256 coverageSha256
7513
+ channelMessageId attempts lastError startedAtMs completedAtMs sendUncertainAtMs
7514
+ `.trim();
7515
+ var DIGEST_RUN = `
7516
+ query ToolkitStewardDigestRun($inboxPath: String!, $digestRunId: String!) {
7517
+ viewer { stewardDigestRun(inboxPath: $inboxPath, digestRunId: $digestRunId) { ${DIGEST_RUN_FIELDS} } }
7518
+ }`.trim();
7519
+ var DIGEST_RUN_PENDING = `
7520
+ query ToolkitStewardDigestRunPending($inboxPath: String!, $digestRunId: String!, $input: StewardDigestRunPendingInput) {
7521
+ viewer {
7522
+ stewardDigestRunPending(inboxPath: $inboxPath, digestRunId: $digestRunId, input: $input) {
7523
+ edges {
7524
+ node { deliveryId feedEntryId source { kind id } decisionReason consumedAtMs alertSnapshot }
7525
+ }
7526
+ pageInfo { hasNextPage endCursor }
7527
+ }
7528
+ }
7529
+ }`.trim();
7530
+ var PUBLISH_DAILY_BRIEF = `
7531
+ mutation ToolkitStewardPublishDailyBrief($input: PublishStewardDailyBriefInput!) {
7532
+ publishStewardDailyBrief(input: $input) { run { ${DIGEST_RUN_FIELDS} } }
7533
+ }`.trim();
7363
7534
  var DECISIONS = /* @__PURE__ */ new Set([
7364
7535
  "immediate",
7365
7536
  "digest",
@@ -7624,14 +7795,21 @@ var COMMAND_DEFINITIONS = [
7624
7795
  values: ["inbox-path", "delivery-id", "request-id"]
7625
7796
  }),
7626
7797
  command("steward send", {
7627
- values: ["inbox-path", "body", "delivery-ids", "request-id"]
7798
+ values: [
7799
+ "inbox-path",
7800
+ "body",
7801
+ "delivery-ids",
7802
+ "request-id",
7803
+ "digest-run-id"
7804
+ ]
7628
7805
  }),
7629
7806
  command("steward pending", {
7630
- values: ["inbox-path", "after", "since", "until", "first"]
7807
+ values: ["inbox-path", "since", "until", "first", "digest-run-id"]
7631
7808
  }),
7632
7809
  command("steward briefed", {
7633
7810
  values: ["inbox-path", "delivery-ids", "digest-run-id"]
7634
7811
  }),
7812
+ command("steward status", { values: ["inbox-path", "digest-run-id"] }),
7635
7813
  command("company-news create", {
7636
7814
  values: ["name", "tickers", "initial-lookback-hours", "page-size"]
7637
7815
  }),
@@ -7997,9 +8175,18 @@ var COMMAND_DEFINITIONS = [
7997
8175
  values: ["account-id", "limit", "page-token"]
7998
8176
  }),
7999
8177
  command("markets narrative", { values: ["ticker"] }),
8178
+ command("markets watchlist"),
8179
+ command("markets watchlist list", { values: ["limit", "cursor"] }),
8180
+ command("markets watchlist add", { values: ["tickers", "kind"] }),
8181
+ command("markets watchlist remove", { values: ["tickers", "kind"] }),
8000
8182
  command("markets earnings", {
8001
8183
  values: ["ticker", "event", "fiscal-year", "fiscal-quarter"]
8002
8184
  }),
8185
+ command("people search", { values: ["query", "kind", "limit"] }),
8186
+ command("people follows"),
8187
+ command("people follows list", { values: ["kind", "limit", "cursor"] }),
8188
+ command("people follows follow", { values: ["kind", "id"] }),
8189
+ command("people follows unfollow", { values: ["kind", "id"] }),
8003
8190
  command("trading-pairs search", {
8004
8191
  values: [
8005
8192
  "symbol",
@@ -11829,7 +12016,7 @@ function formatTradingPairResolved(result) {
11829
12016
  }
11830
12017
 
11831
12018
  // src/cli/dispatch.ts
11832
- var CLI_VERSION = true ? "0.34.0-beta.0" : "dev";
12019
+ var CLI_VERSION = true ? "0.35.0" : "dev";
11833
12020
  var DEFAULT_RUN_TIMEOUT_MS = 6e5;
11834
12021
  var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
11835
12022
  var GLOBAL_VALUE_FLAGS = Object.entries(GLOBAL_FLAG_DEFINITIONS).filter(([, kind]) => kind === "value").map(([name]) => `--${name}`);
@@ -11894,31 +12081,30 @@ Embedded commands target the host-attached Inbox; the terminal CLI requires
11894
12081
  Subcommands:
11895
12082
  decide Record the decision for one delivery (required before forward/send)
11896
12083
  forward Re-post the original alert card by reference (immediate only)
11897
- send Post steward-authored Markdown covering the listed deliveries
11898
- pending Page deliveries decided "digest" that no brief has covered yet
11899
- briefed Record that a Daily Brief covered the listed deliveries
12084
+ status Read one durable Daily Brief run
12085
+ pending Read a durable run's complete fixed-window set, or use legacy bounds
12086
+ send Publish and complete a durable run, or use the legacy send contract
12087
+ briefed Record that a Daily Brief covered at most 100 listed deliveries
11900
12088
 
11901
12089
  Flags:
11902
12090
  --inbox-path <path> Steward Session Inbox (terminal CLI only)
11903
12091
  --delivery-id <id> One delivery (decide, forward)
11904
- --delivery-ids <a,b,c> Comma-separated deliveries (briefed; optional for send \u2014 omit for a For-You-only Brief)
12092
+ --delivery-ids <a,b,c> Comma-separated deliveries (legacy briefed: max 100; optional for send \u2014 omit for a For-You-only Brief)
11905
12093
  --decision <immediate|digest|suppress>
11906
12094
  --reason <text> Short audit note stored with the decision
11907
- --body <markdown> Message body (send)
12095
+ --body <markdown> Message body (durable send: omit when reviewed coverage yields no useful content)
11908
12096
  --request-id <uuid> Idempotency key; generated when omitted
11909
- --after <cursor> Opaque cursor from the previous page's nextCursor (pending)
11910
- --since <RFC3339> First page only: lower bound on decision time (pending)
11911
- --until <RFC3339> First page only: fixed upper bound of the Brief window; later pages inherit it through the cursor (pending)
11912
- --first <n> Page size, 1-100 (pending)
11913
- --digest-run-id <id> The request id echoed by the send that carried these deliveries (briefed)
12097
+ --since <RFC3339> Lower bound on decision time (pending)
12098
+ --until <RFC3339> Fixed upper bound of the Brief window (pending)
12099
+ --first <n> Internal page size, 1-100 (terminal pending only)
12100
+ --digest-run-id <uuid> Durable run identity (status/pending/send)
11914
12101
 
11915
12102
  Examples (terminal; the embedded Agent tool omits --inbox-path):
11916
12103
  alva steward decide --inbox-path /alva/home/alice/agents/steward-9/.pi/agent/sessions/main.inbox.jsonl --delivery-id 123 --decision immediate --reason "guidance cut 15%"
11917
12104
  alva steward forward --inbox-path <inbox> --delivery-id 123
11918
- alva steward send --inbox-path <inbox> --delivery-ids 124,125 --body "Two related moves..."
11919
- alva steward send --inbox-path <inbox> --body "For You: ..." # For-You-only Brief, no ledger delivery
11920
- alva steward pending --inbox-path <inbox> --until 2026-09-15T13:00:00Z
11921
- alva steward pending --inbox-path <inbox> --after <nextCursor from the previous page>
12105
+ alva steward status --inbox-path <inbox> --digest-run-id <uuid>
12106
+ alva steward pending --inbox-path <inbox> --digest-run-id <uuid>
12107
+ alva steward send --inbox-path <inbox> --digest-run-id <uuid> --delivery-ids 124,125 --body "Daily Brief..."
11922
12108
  alva steward briefed --inbox-path <inbox> --digest-run-id <request id echoed by send> --delivery-ids 124,125`,
11923
12109
  configure: `Usage: alva configure --api-key <key> [--base-url <url>] [--profile <name>]
11924
12110
 
@@ -13063,6 +13249,8 @@ owners, feed slugs, versions, or paths.
13063
13249
  Subcommands:
13064
13250
  narrative Get the current narrative, history, and narrative change log
13065
13251
  earnings Get Pre, Release, Transcript, and Post for one fiscal event
13252
+ watchlist list|add|remove
13253
+ The user's ticker watchlist in the Alva App
13066
13254
 
13067
13255
  Narrative flags:
13068
13256
  --ticker <symbol> Stock ticker (required)
@@ -13076,6 +13264,21 @@ Earnings flags:
13076
13264
  Do not combine --event with --fiscal-year/--fiscal-quarter. These commands read
13077
13265
  the current backend view; historical query-as-of gating is not supported yet.
13078
13266
 
13267
+ Watchlist flags:
13268
+ --tickers <A,B> add/remove: 1-50 exact symbols (required).
13269
+ Suffix one symbol with :stock, :etf, or
13270
+ :crypto to pick its kind (BTC:crypto)
13271
+ --kind <stock|etf|crypto> add/remove: default kind for unsuffixed symbols
13272
+ --limit <1-100> list: page size (default 20)
13273
+ --cursor <endCursor> list: pageInfo.endCursor of the previous page
13274
+
13275
+ add/remove write every resolved symbol in one atomic batch. Result groups:
13276
+ added|removed (written now), unchanged (already in that state), unresolved
13277
+ (NOT_FOUND, or FAILED_PRECONDITION = several entities share the symbol:
13278
+ retry it with a kind suffix). Nothing is written when no symbol resolves.
13279
+ remove is recorded even for symbols not in the watchlist, so holdings sync
13280
+ does not add them back; add re-adds a symbol the user removed earlier.
13281
+
13079
13282
  Output semantics:
13080
13283
  Narrative is dated Alva analysis. Use current for present-tense company
13081
13284
  context and history only to explain changes; use separate sources for live
@@ -13093,7 +13296,32 @@ Examples:
13093
13296
  alva markets narrative --ticker AAPL
13094
13297
  alva markets earnings --ticker AAPL
13095
13298
  alva markets earnings --ticker AAPL --event next-confirmed
13096
- alva markets earnings --ticker AAPL --fiscal-year 2026 --fiscal-quarter Q3`,
13299
+ alva markets earnings --ticker AAPL --fiscal-year 2026 --fiscal-quarter Q3
13300
+ alva markets watchlist add --tickers NVDA,LMT,BTC:crypto
13301
+ alva markets watchlist list --limit 50`,
13302
+ people: `Usage: alva people <subcommand> [options]
13303
+
13304
+ Search and follow public profiles: USER is an Alva user, PERSON is a curated
13305
+ person. These change the same Following list the user sees in the Alva App.
13306
+
13307
+ Subcommands:
13308
+ search Prefix match on name, username, slug, or alias
13309
+ follows list List the profiles the caller follows
13310
+ follows follow Follow one profile (idempotent)
13311
+ follows unfollow Unfollow one profile (idempotent)
13312
+
13313
+ Flags:
13314
+ --query <text> search: name or username prefix (required)
13315
+ --kind <user|person> search/list: optional filter; follow/unfollow:
13316
+ required, from a search or list result
13317
+ --id <id> follow/unfollow: profile id (required)
13318
+ --limit <1-50> search/list: page size
13319
+ --cursor <endCursor> list: pageInfo.endCursor of the previous page
13320
+
13321
+ Examples:
13322
+ alva people search --query "cathie wood" --kind person
13323
+ alva people follows follow --kind person --id 42
13324
+ alva people follows list`,
13097
13325
  "trading-pairs": `Usage: alva trading-pairs <subcommand> [options]
13098
13326
 
13099
13327
  Discover canonical trading-pair identities before backtesting or trading.
@@ -13516,19 +13744,19 @@ function deliveryProviderFilter(flags, command2) {
13516
13744
  }
13517
13745
  return flags["delivery-provider"];
13518
13746
  }
13519
- function projectUserProfileForCLI(record3) {
13520
- const { active_channel: activeIMProvider, ...profile } = record3;
13747
+ function projectUserProfileForCLI(record4) {
13748
+ const { active_channel: activeIMProvider, ...profile } = record4;
13521
13749
  return { ...profile, active_im_provider: activeIMProvider };
13522
13750
  }
13523
13751
  function projectNotificationHistoryForCLI(response) {
13524
13752
  if (response === null || typeof response !== "object" || Array.isArray(response)) {
13525
13753
  return response;
13526
13754
  }
13527
- const record3 = response;
13528
- if (!Array.isArray(record3.items)) return response;
13755
+ const record4 = response;
13756
+ if (!Array.isArray(record4.items)) return response;
13529
13757
  return {
13530
- ...record3,
13531
- items: record3.items.map((item) => {
13758
+ ...record4,
13759
+ items: record4.items.map((item) => {
13532
13760
  if (item === null || typeof item !== "object" || Array.isArray(item)) {
13533
13761
  return item;
13534
13762
  }
@@ -13542,6 +13770,111 @@ function num(val) {
13542
13770
  const n = Number(val);
13543
13771
  return Number.isNaN(n) ? void 0 : n;
13544
13772
  }
13773
+ function upperFlag(val) {
13774
+ return val === void 0 ? void 0 : val.trim().toUpperCase();
13775
+ }
13776
+ function optionalCursorFlag(val) {
13777
+ if (val === void 0) return void 0;
13778
+ if (!val.trim() || val.length > 4096) {
13779
+ throw new Error(
13780
+ "--cursor must be a non-empty cursor of at most 4096 characters"
13781
+ );
13782
+ }
13783
+ return val;
13784
+ }
13785
+ function usageChecked(command2, check) {
13786
+ try {
13787
+ return check();
13788
+ } catch (error) {
13789
+ if (error instanceof CliUsageError) throw error;
13790
+ throw new CliUsageError(
13791
+ error instanceof Error ? error.message : String(error),
13792
+ command2.split(" ")[0]
13793
+ );
13794
+ }
13795
+ }
13796
+ function dispatchWatchlist(client, leaf, flags) {
13797
+ switch (leaf) {
13798
+ case void 0:
13799
+ return { _help: true, text: COMMAND_HELP.markets };
13800
+ case "add":
13801
+ case "remove": {
13802
+ const command2 = `markets watchlist ${leaf}`;
13803
+ const params = usageChecked(
13804
+ command2,
13805
+ () => normalizeWatchlistTickersParams({
13806
+ tickers: (csvList(requireFlag(flags, "tickers", command2)) ?? []).map(
13807
+ parseTickerSpec
13808
+ ),
13809
+ kind: upperFlag(flags["kind"])
13810
+ })
13811
+ );
13812
+ return leaf === "add" ? client.follows.addToWatchlist(params) : client.follows.removeFromWatchlist(params);
13813
+ }
13814
+ case "list": {
13815
+ const command2 = "markets watchlist list";
13816
+ return client.follows.watchlist({
13817
+ first: optionalBoundedIntegerFlag(flags, "limit", command2, 1, 100),
13818
+ after: usageChecked(command2, () => optionalCursorFlag(flags["cursor"]))
13819
+ });
13820
+ }
13821
+ default:
13822
+ throw new CliUsageError(
13823
+ `Unknown subcommand: markets watchlist ${leaf}`,
13824
+ "markets"
13825
+ );
13826
+ }
13827
+ }
13828
+ function dispatchPeople(client, path, flags) {
13829
+ const [subcommand, leaf] = path;
13830
+ if (subcommand === void 0 || subcommand === "follows" && !leaf) {
13831
+ return { _help: true, text: COMMAND_HELP.people };
13832
+ }
13833
+ const command2 = ["people", ...path].join(" ");
13834
+ switch (subcommand === "follows" ? `follows ${leaf}` : subcommand) {
13835
+ case "search":
13836
+ return client.follows.searchProfiles(
13837
+ usageChecked(
13838
+ command2,
13839
+ () => validateSearchProfilesParams({
13840
+ query: requireFlag(flags, "query", command2),
13841
+ kind: upperFlag(flags["kind"]),
13842
+ first: optionalBoundedIntegerFlag(flags, "limit", command2, 1, 50)
13843
+ })
13844
+ )
13845
+ );
13846
+ case "follows list":
13847
+ return client.follows.profiles({
13848
+ kind: usageChecked(
13849
+ command2,
13850
+ () => optionalProfileKind(upperFlag(flags["kind"]))
13851
+ ),
13852
+ first: optionalBoundedIntegerFlag(flags, "limit", command2, 1, 50),
13853
+ after: usageChecked(command2, () => optionalCursorFlag(flags["cursor"]))
13854
+ });
13855
+ case "follows follow":
13856
+ case "follows unfollow": {
13857
+ const params = usageChecked(
13858
+ command2,
13859
+ () => validateProfileRef({
13860
+ kind: upperFlag(
13861
+ requireFlag(flags, "kind", command2)
13862
+ ),
13863
+ id: requireFlag(flags, "id", command2)
13864
+ })
13865
+ );
13866
+ return leaf === "follow" ? client.follows.followProfile(params) : client.follows.unfollowProfile(params);
13867
+ }
13868
+ default:
13869
+ throw new CliUsageError(`Unknown subcommand: ${command2}`, "people");
13870
+ }
13871
+ }
13872
+ function optionalProfileKind(kind) {
13873
+ if (kind !== void 0 && kind !== "USER" && kind !== "PERSON") {
13874
+ throw new Error("kind must be USER or PERSON");
13875
+ }
13876
+ return kind;
13877
+ }
13545
13878
  function csvList(val) {
13546
13879
  if (val === void 0) return void 0;
13547
13880
  const values = val.split(",").map((item) => item.trim()).filter(Boolean);
@@ -14198,7 +14531,7 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
14198
14531
  const positionals = parsedCommand.positionals;
14199
14532
  if (group === "whoami") {
14200
14533
  const user = await client.user.me();
14201
- const record3 = projectUserProfileForCLI(
14534
+ const record4 = projectUserProfileForCLI(
14202
14535
  user
14203
14536
  );
14204
14537
  const version = meta?.cliVersion ?? CLI_VERSION;
@@ -14215,10 +14548,10 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
14215
14548
  metaBlock.arrays_jwt = arraysJwtStatus;
14216
14549
  }
14217
14550
  const result = {
14218
- ...record3,
14551
+ ...record4,
14219
14552
  _meta: metaBlock
14220
14553
  };
14221
- const minVersion = record3.toolkit_min_version;
14554
+ const minVersion = record4.toolkit_min_version;
14222
14555
  if (typeof minVersion === "string" && version && version !== "dev" && isVersionOlderThan(version, minVersion)) {
14223
14556
  result._warning = `Warning: your toolkit version (${version}) is older than the minimum recommended version (${minVersion}). Please upgrade: npm install -g @alva-ai/toolkit`;
14224
14557
  }
@@ -14592,6 +14925,14 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
14592
14925
  requestId: flags["request-id"]
14593
14926
  });
14594
14927
  case "send":
14928
+ if (flags["digest-run-id"] !== void 0) {
14929
+ return client.steward.sendDigestRun({
14930
+ inboxPath,
14931
+ digestRunId: requireFlag(flags, "digest-run-id", "steward send"),
14932
+ deliveryIds: optionalIds("delivery-ids"),
14933
+ body: flags.body
14934
+ });
14935
+ }
14595
14936
  return client.steward.send({
14596
14937
  inboxPath,
14597
14938
  body: requireFlag(flags, "body", "steward send"),
@@ -14599,6 +14940,16 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
14599
14940
  requestId: flags["request-id"]
14600
14941
  });
14601
14942
  case "pending": {
14943
+ if (flags["digest-run-id"] !== void 0) {
14944
+ return client.steward.digestRunPending({
14945
+ inboxPath,
14946
+ digestRunId: requireFlag(
14947
+ flags,
14948
+ "digest-run-id",
14949
+ "steward pending"
14950
+ )
14951
+ });
14952
+ }
14602
14953
  const parseTime = (name) => {
14603
14954
  const value = flags[name];
14604
14955
  if (value === void 0) return void 0;
@@ -14614,7 +14965,6 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
14614
14965
  const first = flags.first === void 0 ? void 0 : Number(flags.first);
14615
14966
  return client.steward.pending({
14616
14967
  inboxPath,
14617
- after: flags.after,
14618
14968
  sinceMs: parseTime("since"),
14619
14969
  untilMs: parseTime("until"),
14620
14970
  first
@@ -14626,6 +14976,11 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
14626
14976
  deliveryIds: ids("delivery-ids"),
14627
14977
  digestRunId: requireFlag(flags, "digest-run-id", "steward briefed")
14628
14978
  });
14979
+ case "status":
14980
+ return client.steward.digestRun({
14981
+ inboxPath,
14982
+ digestRunId: requireFlag(flags, "digest-run-id", "steward status")
14983
+ });
14629
14984
  default:
14630
14985
  throw new CliUsageError(
14631
14986
  `Unknown subcommand: steward ${subcommand}`,
@@ -16011,6 +16366,9 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
16011
16366
  case "markets": {
16012
16367
  if (!subcommand)
16013
16368
  throw new CliUsageError("Missing subcommand for markets", "markets");
16369
+ if (subcommand === "watchlist") {
16370
+ return dispatchWatchlist(client, parsedCommand.path[2], flags);
16371
+ }
16014
16372
  const ticker = requireFlag(flags, "ticker", `markets ${subcommand}`);
16015
16373
  switch (subcommand) {
16016
16374
  case "narrative":
@@ -16124,6 +16482,8 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
16124
16482
  );
16125
16483
  }
16126
16484
  }
16485
+ case "people":
16486
+ return dispatchPeople(client, parsedCommand.path.slice(1), flags);
16127
16487
  case "trading": {
16128
16488
  if (!subcommand)
16129
16489
  throw new CliUsageError("Missing subcommand for trading", "trading");