sentisense 0.76.0 → 0.77.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 CHANGED
@@ -72,7 +72,7 @@ npx -y sentisense@latest health
72
72
  | `quote <ticker>...` | Price, day range, 52-week range, market cap, P/E. One request per ticker; ETFs show AUM, expense ratio and NAV |
73
73
  | `sentiment <ticker>` | SentiSense Score, tone, attention, per-source breakdown, `--days N` history |
74
74
  | `mood` | Composite market sentiment, the signals behind it, and the sector map |
75
- | `analysts <ticker>` | Consensus, price target band, recent upgrades and downgrades. `--coverage` for who covers it, by firm |
75
+ | `analysts <ticker>` | Consensus, price target band, recent upgrades and downgrades with each firm's target move. `--coverage` for who covers it, by firm |
76
76
  | `analyst <slug>` | One analyst: their firms, their coverage book, and `--calls` for their price target notes |
77
77
  | `earnings [ticker]` | Forward calendar with no ticker, per-quarter analysis with one (`earnings AAPL`) |
78
78
  | `kpis <ticker>` | Company KPIs from earnings filings: latest value and year-over-year change per series, `--series ID` for one series' history, `--types` for the series list, `--coverage` for the covered tickers |
@@ -469,11 +469,23 @@ The price target cone (mean, high, low, upside %) and consensus are free for eve
469
469
  client.analyst.consensus("AAPL") // Price target cone + consensus. Free, full data.
470
470
  client.analyst.consensusHistory("AAPL", { limit: 90 }) // Daily history. Free: last 30 days; distribution fields null.
471
471
  client.analyst.calledIt("AAPL", { limit: 10 }) // Recorded calls for 20% moves over five sessions. Free: newest move, up to 5 calls, move counts intact.
472
- client.analyst.actions("AAPL", { lookbackDays: 30 }) // Upgrade/downgrade feed. Free: 3 most recent.
472
+ client.analyst.actions("AAPL", { lookbackDays: 30 }) // Upgrade/downgrade feed with price targets (PRO). Free: 3 most recent, targets null.
473
473
  client.analyst.estimates("AAPL") // Forward EPS + surprises. Free: 1 quarter. data.ticker: the listing per-share figures are for (BRK-A answers BRK.B).
474
474
  client.analyst.marketActivity({ lookbackDays: 7 }) // Market-wide analyst actions (PRO).
475
475
  ```
476
476
 
477
+ Action rows carry `priceTarget`, the target the firm stated with the action, and `priorPriceTarget`, the target it moved from. Each is `null` when the firm stated none or we do not hold it, never zero; `priorPriceTarget` is also `null` when the firm kept its target unchanged, and always `null` when `priceTarget` is. Both are PRO (and sample companies): free preview rows carry `null` for both. Firms do not restate old targets after a stock split, so `actions` rows dated before a split carry `null` for both; `marketActivity` skips that check, so read a stock that split from `actions`. Both fields are optional on `AnalystAction`, since older responses lack them.
478
+
479
+ ```typescript
480
+ const { data: rows } = await client.analyst.actions("NVDA", { lookbackDays: 7 });
481
+ for (const row of rows) {
482
+ const { priceTarget: target, priorPriceTarget: prior } = row;
483
+ if (target != null && prior != null && target < prior) {
484
+ console.log(`${row.actionDate} ${row.firm} cut its target from ${prior} to ${target}`);
485
+ }
486
+ }
487
+ ```
488
+
477
489
  Coverage answers "who covers this stock and what did they say" in one call, and it is the entry point into the per-analyst surfaces: every named analyst carries the slug that addresses their profile and their calls.
478
490
 
479
491
  ```typescript
package/dist/cli.cjs CHANGED
@@ -594,6 +594,19 @@ function actionTone(actionType) {
594
594
  if (actionType === "DOWNGRADE") return "down";
595
595
  return void 0;
596
596
  }
597
+ function isTarget(value) {
598
+ return typeof value === "number" && Number.isFinite(value);
599
+ }
600
+ function targetText(value) {
601
+ return Number.isInteger(value) ? `$${value}` : money(value);
602
+ }
603
+ function targetMove(action) {
604
+ const target = action.priceTarget;
605
+ if (!isTarget(target)) return cell("");
606
+ const prior = action.priorPriceTarget;
607
+ if (!isTarget(prior)) return cell(targetText(target));
608
+ return cell(`${targetText(prior)} to ${targetText(target)}`, direction(target - prior));
609
+ }
597
610
  function primaryAnalyst(row) {
598
611
  const named = row.latestNote?.analyst ?? null;
599
612
  const match = (named ? row.analysts.find(
@@ -624,6 +637,9 @@ var analystsCommand = {
624
637
  'on a row is what "sentisense analyst <slug>" takes.',
625
638
  "A firm can cover a ticker on a rating action alone, so a blank target is a real reading",
626
639
  "rather than missing data, and a blank analyst means the note named nobody.",
640
+ "TARGET on a rating change is the price target the firm stated with it, shown as",
641
+ '"$400 to $200" when it moved from a prior target. It is blank when the firm stated',
642
+ "none, and blank on a free key outside the sample companies.",
627
643
  "--limit trims the rows printed under --coverage; the API returns the whole book either",
628
644
  "way, and --full prints all of it."
629
645
  ],
@@ -690,13 +706,14 @@ var analystsCommand = {
690
706
  blocks.push({ kind: "blank" });
691
707
  blocks.push({
692
708
  kind: "table",
693
- head: ["DATE", "FIRM", "ACTION", "FROM", "TO"],
709
+ head: ["DATE", "FIRM", "ACTION", "FROM", "TO", "TARGET"],
694
710
  rows: shown.map((action) => [
695
711
  cell(action.actionDate),
696
712
  cell(action.firm),
697
713
  cell(action.actionType, actionTone(action.actionType)),
698
714
  cell(action.fromGrade ?? ""),
699
- cell(action.toGrade ?? "")
715
+ cell(action.toGrade ?? ""),
716
+ targetMove(action)
700
717
  ])
701
718
  });
702
719
  if (!full && rows.length > shown.length) {
@@ -1432,7 +1449,7 @@ var flowsCommand = {
1432
1449
  };
1433
1450
 
1434
1451
  // src/version.ts
1435
- var VERSION = "0.76.0";
1452
+ var VERSION = "0.77.0";
1436
1453
 
1437
1454
  // src/resources/analyst.ts
1438
1455
  var Analyst = class {
@@ -1483,6 +1500,10 @@ var Analyst = class {
1483
1500
  /**
1484
1501
  * Get recent analyst upgrade/downgrade actions for a ticker, newest first.
1485
1502
  * Free users receive the 3 most recent.
1503
+ *
1504
+ * Each row carries `priceTarget`, the target the firm stated with the action, and
1505
+ * `priorPriceTarget`, the target it moved from (PRO; `null` on free preview rows,
1506
+ * `null` when the firm stated none or kept its target unchanged).
1486
1507
  */
1487
1508
  async actions(ticker, options) {
1488
1509
  return this.client.get(
@@ -1502,6 +1523,10 @@ var Analyst = class {
1502
1523
  /**
1503
1524
  * Get market-wide recent analyst actions across all covered tickers, newest first.
1504
1525
  * Free users receive the 5 most recent.
1526
+ *
1527
+ * Rows carry the same `priceTarget` and `priorPriceTarget` as {@link actions} (PRO;
1528
+ * `null` on free preview rows). This feed does not check for stock splits, so for a
1529
+ * stock that split inside the window, read its targets from {@link actions}.
1505
1530
  */
1506
1531
  async marketActivity(options) {
1507
1532
  return this.client.get("/api/v1/analyst/activity", options);
package/dist/index.cjs CHANGED
@@ -131,6 +131,10 @@ var Analyst = class {
131
131
  /**
132
132
  * Get recent analyst upgrade/downgrade actions for a ticker, newest first.
133
133
  * Free users receive the 3 most recent.
134
+ *
135
+ * Each row carries `priceTarget`, the target the firm stated with the action, and
136
+ * `priorPriceTarget`, the target it moved from (PRO; `null` on free preview rows,
137
+ * `null` when the firm stated none or kept its target unchanged).
134
138
  */
135
139
  async actions(ticker, options) {
136
140
  return this.client.get(
@@ -150,6 +154,10 @@ var Analyst = class {
150
154
  /**
151
155
  * Get market-wide recent analyst actions across all covered tickers, newest first.
152
156
  * Free users receive the 5 most recent.
157
+ *
158
+ * Rows carry the same `priceTarget` and `priorPriceTarget` as {@link actions} (PRO;
159
+ * `null` on free preview rows). This feed does not check for stock splits, so for a
160
+ * stock that split inside the window, read its targets from {@link actions}.
153
161
  */
154
162
  async marketActivity(options) {
155
163
  return this.client.get("/api/v1/analyst/activity", options);
@@ -1563,7 +1571,7 @@ function serializeTrackerParams(params) {
1563
1571
  }
1564
1572
 
1565
1573
  // src/version.ts
1566
- var VERSION = "0.76.0";
1574
+ var VERSION = "0.77.0";
1567
1575
 
1568
1576
  // src/client.ts
1569
1577
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";