sentisense 0.50.0 → 0.51.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/index.d.mts CHANGED
@@ -668,6 +668,24 @@ type RatingDimensionKey = "crowd" | "smart_money" | "options" | "analysts" | "fu
668
668
  * the last run. The other two mean the run looked and declined to grade.
669
669
  */
670
670
  type RatingNotRatedReason = "stale" | "not_rated_today" | "insufficient_dimensions" | "insufficient_coverage_weight";
671
+ /**
672
+ * A risk condition evaluated against a rated stock. An active one deducts points from the
673
+ * score, up to 12 apiece; `percentile` itself is never touched by them.
674
+ */
675
+ type RiskCondition = "thin_coverage" | "weak_dimension" | "unprofitable" | "no_fundamentals" | "high_leverage" | "unseasoned_listing" | "small_market_cap" | "thin_liquidity" | "extended_price" | "insider_selling" | "institutional_outflow";
676
+ /**
677
+ * One graded deduction applied to a rated stock's score.
678
+ *
679
+ * A condition is graded rather than binary, so `points` is the share of the 12-point
680
+ * maximum this one actually cost. Only active conditions appear, and `penaltyPoints` is
681
+ * the sum of these.
682
+ */
683
+ interface RiskAdjustment {
684
+ /** Which condition, by the same key `riskConditions` reports. */
685
+ condition: RiskCondition;
686
+ /** Points deducted, to one decimal, up to 12 for a single condition. */
687
+ points: number;
688
+ }
671
689
  /**
672
690
  * One constituent leg behind a dimension's percentile.
673
691
  *
@@ -737,18 +755,59 @@ interface RatingBase {
737
755
  /** The standard financial disclaimer. Display it alongside the grade. */
738
756
  disclaimer: string;
739
757
  }
740
- /** A stock that has a grade for `asOf`. */
741
- interface RatedStockRating extends RatingBase {
758
+ /**
759
+ * A stock that has a grade for `asOf`.
760
+ *
761
+ * `score`, `bucketLetter`, `riskConditions`, `riskAdjustments` and `penaltyPoints` arrive
762
+ * from the next API deploy onward and are optional here because a response served before
763
+ * then omits them.
764
+ */
765
+ interface StockRating extends RatingBase {
742
766
  rated: true;
743
767
  /**
744
- * `"A"`, `"B"`, `"C"`, `"D"` or `"F"`. Served as stored, never re-derived from
745
- * `percentile`, so read it rather than computing your own bucket edges.
768
+ * The headline number, 0 to 100 with one decimal, and the number `letter` is the band
769
+ * of: `score = percentile - sum(riskAdjustments.map((a) => a.points))`, floored at 10
770
+ * when fewer than five dimensions are available and at 0 otherwise. Absent on a
771
+ * response served before this field shipped.
772
+ */
773
+ score?: number;
774
+ /**
775
+ * `"A"`, `"B"`, `"C"`, `"D"` or `"F"`: the band `score` falls in, at edges 90, 70, 30
776
+ * and 10. Served as stored, so read it rather than deriving your own edges. Deriving
777
+ * it from `percentile` disagrees with the API for every stock carrying a risk
778
+ * condition.
746
779
  */
747
780
  letter: string;
748
- /** Rank of `composite` among the day's rated stocks, 0 to 100. */
781
+ /**
782
+ * The band `percentile` alone would fall in, so a difference from `letter` is exactly
783
+ * what the risk conditions cost. Absent on a response served before this field
784
+ * shipped.
785
+ */
786
+ bucketLetter?: string;
787
+ /**
788
+ * Rank of `composite` among the day's rated stocks, 0 to 100. This stays the true rank
789
+ * of the blended signals: the risk conditions are subtracted from `score`, never here.
790
+ */
749
791
  percentile: number;
750
792
  /** The weighted blend before ranking, in [-1, +1]. */
751
793
  composite: number;
794
+ /**
795
+ * Which risk conditions were active. An empty array means none were, and the field is
796
+ * absent on a response served before it shipped.
797
+ */
798
+ riskConditions?: RiskCondition[];
799
+ /**
800
+ * The same conditions with the points each one actually cost, since a condition is
801
+ * graded rather than binary and can cost anything up to 12. Absent on a response
802
+ * served before this field shipped.
803
+ */
804
+ riskAdjustments?: RiskAdjustment[];
805
+ /**
806
+ * The sum of `riskAdjustments` points, to one decimal: how far `score` sits below
807
+ * `percentile` before the floor applies. Absent on a response served before this field
808
+ * shipped.
809
+ */
810
+ penaltyPoints?: number;
752
811
  /** How many stocks were rated that day: the rank's denominator. */
753
812
  ratedCount: number;
754
813
  /** The weights and floors in force when the row was written, e.g. `"2026.09-v1"`. */
@@ -758,7 +817,7 @@ interface RatedStockRating extends RatingBase {
758
817
  * A stock with no grade for `asOf`. A normal 200, not an error: ETFs and tickers outside
759
818
  * the swept universe answer this way, and the composition still arrives so a card can render.
760
819
  */
761
- interface UnratedStockRating extends RatingBase {
820
+ interface StockNotRated extends RatingBase {
762
821
  rated: false;
763
822
  /** Why there is no grade. */
764
823
  reason: RatingNotRatedReason;
@@ -779,7 +838,7 @@ interface UnratedStockRating extends RatingBase {
779
838
  * and it is not a recommendation about any security. Carry `disclaimer` wherever you display
780
839
  * a grade. Methodology: https://sentisense.ai/methodology/#sentisense-rating
781
840
  */
782
- type StockRating = RatedStockRating | UnratedStockRating;
841
+ type StockRatingResponse = StockRating | StockNotRated;
783
842
  type DocumentSource = "news" | "reddit" | "x" | "substack" | "youtube";
784
843
  /** Per-entity sentiment classification with resolved entity details. */
785
844
  interface SentimentEntry {
@@ -1500,7 +1559,7 @@ interface PreviewResponse<T> {
1500
1559
  /** Supported metric types for the v2 Serving Metrics API. */
1501
1560
  type MetricType = "mentions" | "sentiment" | "sentisense_score"
1502
1561
  /**
1503
- * The SentiSense Rating percentile, 0 to 100. Time series only: it has no source
1562
+ * The SentiSense Rating score, 0 to 100. Time series only: it has no source
1504
1563
  * breakdown, so `getDistribution` answers with an empty distribution for it.
1505
1564
  */
1506
1565
  | "sentisense_rating" | "social_dominance" | "creators";
@@ -3356,10 +3415,10 @@ declare class Stocks {
3356
3415
  * security. `disclaimer` carries the wording to display alongside a grade. Methodology:
3357
3416
  * https://sentisense.ai/methodology/#sentisense-rating
3358
3417
  *
3359
- * **A discriminated union on `rated`.** `if (rating.rated)` narrows to `letter`,
3360
- * `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the `else` branch
3361
- * narrows to `reason`, `dimensionsPresent` and `presentDimensions`. Branch on the flag
3362
- * rather than testing a field for `undefined`.
3418
+ * **A discriminated union on `rated`.** `if (rating.rated)` narrows to `score`,
3419
+ * `letter`, `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the
3420
+ * `else` branch narrows to `reason`, `dimensionsPresent` and `presentDimensions`.
3421
+ * Branch on the flag rather than testing a field for `undefined`.
3363
3422
  *
3364
3423
  * **Having no grade is a normal 200, not a 404.** ETFs and tickers outside the swept
3365
3424
  * universe answer with `rated` false, and the composition still arrives so a card can
@@ -3369,13 +3428,24 @@ declare class Stocks {
3369
3428
  *
3370
3429
  * `dimensions` always holds all six rows in a fixed order, including the ones with no
3371
3430
  * data, which arrive with `present` false and a `null` percentile. Read `present` first
3372
- * and never read a missing percentile as zero. `letter` is served as stored rather than
3373
- * derived from `percentile`, so read it instead of computing your own bucket edges.
3431
+ * and never read a missing percentile as zero.
3432
+ *
3433
+ * **`score` and `percentile` are different numbers.** `percentile` is the rank of the
3434
+ * blended signals against the day's rated set, and
3435
+ * `score = percentile - sum(riskAdjustments.map((a) => a.points))`, floored at 10 when
3436
+ * fewer than five dimensions are available and at 0 otherwise. `letter` is the band
3437
+ * `score` falls in, at edges 90, 70, 30 and 10, while `bucketLetter` is the band the
3438
+ * percentile alone would fall in, so a difference between the two letters is exactly
3439
+ * what the conditions cost. `riskConditions` names the active ones, `riskAdjustments`
3440
+ * gives the points each cost (graded, up to 12 apiece), and `penaltyPoints` is their
3441
+ * sum. `letter` is served as stored, so read it instead of computing your own bucket
3442
+ * edges. The five fields arrive from the next API deploy onward and are optional, so a
3443
+ * response served before then still parses.
3374
3444
  *
3375
- * For the daily history of a stock's percentile, ask `client.entityMetrics.getMetrics`
3376
- * for the `sentisense_rating` metric.
3445
+ * For the daily history of a stock's score, ask `client.entityMetrics.getMetrics` for
3446
+ * the `sentisense_rating` metric.
3377
3447
  */
3378
- getRating(ticker: string): Promise<StockRating>;
3448
+ getRating(ticker: string): Promise<StockRatingResponse>;
3379
3449
  }
3380
3450
 
3381
3451
  /**
@@ -3532,6 +3602,6 @@ declare class APIError extends SentiSenseError {
3532
3602
  constructor(message: string, status: number, code?: string);
3533
3603
  }
3534
3604
 
3535
- declare const VERSION = "0.50.0";
3605
+ declare const VERSION = "0.51.0";
3536
3606
 
3537
- export { type AISummary, APIError, type AnalystAction, type AnalystCall, type AnalystConsensus, type AnalystCoverage, type AnalystCoverageAnalyst, type AnalystCoverageBookEntry, type AnalystCoverageFirm, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AnalystFirmRating, type AnalystFirmTenure, type AnalystNote, type AnalystProfile, type AnalystRatingBuckets, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsQuarter, type EarningsSource, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystCallsOptions, type GetAnalystCoverageOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetOptionsHistoryOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticianMemberOptions, type GetPoliticiansOptions, type GetRecentEarningsOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type OptionsAggregate, type OptionsContext, type OptionsHistory, type OptionsHistoryWindow, type OptionsOiWalls, type OptionsOverview, type OptionsOverviewRow, type OptionsSummary, type OptionsUnusualContract, type OptionsWall, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, type RatedStockRating, type RatingBase, type RatingDimension, type RatingDimensionKey, type RatingFlag, type RatingNotRatedReason, type RatingSubLeg, type RecentEarningsEntry, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockPrice, type StockProfile, type StockQuote, type StockRating, type StockSocialDominance, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, type UnratedStockRating, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
3607
+ export { type AISummary, APIError, type AnalystAction, type AnalystCall, type AnalystConsensus, type AnalystCoverage, type AnalystCoverageAnalyst, type AnalystCoverageBookEntry, type AnalystCoverageFirm, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AnalystFirmRating, type AnalystFirmTenure, type AnalystNote, type AnalystProfile, type AnalystRatingBuckets, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsQuarter, type EarningsSource, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystCallsOptions, type GetAnalystCoverageOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetOptionsHistoryOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticianMemberOptions, type GetPoliticiansOptions, type GetRecentEarningsOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type OptionsAggregate, type OptionsContext, type OptionsHistory, type OptionsHistoryWindow, type OptionsOiWalls, type OptionsOverview, type OptionsOverviewRow, type OptionsSummary, type OptionsUnusualContract, type OptionsWall, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, type RatingBase, type RatingDimension, type RatingDimensionKey, type RatingFlag, type RatingNotRatedReason, type RatingSubLeg, type RecentEarningsEntry, type RiskAdjustment, type RiskCondition, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockNotRated, type StockPrice, type StockProfile, type StockQuote, type StockRating, type StockRatingResponse, type StockSocialDominance, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
package/dist/index.d.ts CHANGED
@@ -668,6 +668,24 @@ type RatingDimensionKey = "crowd" | "smart_money" | "options" | "analysts" | "fu
668
668
  * the last run. The other two mean the run looked and declined to grade.
669
669
  */
670
670
  type RatingNotRatedReason = "stale" | "not_rated_today" | "insufficient_dimensions" | "insufficient_coverage_weight";
671
+ /**
672
+ * A risk condition evaluated against a rated stock. An active one deducts points from the
673
+ * score, up to 12 apiece; `percentile` itself is never touched by them.
674
+ */
675
+ type RiskCondition = "thin_coverage" | "weak_dimension" | "unprofitable" | "no_fundamentals" | "high_leverage" | "unseasoned_listing" | "small_market_cap" | "thin_liquidity" | "extended_price" | "insider_selling" | "institutional_outflow";
676
+ /**
677
+ * One graded deduction applied to a rated stock's score.
678
+ *
679
+ * A condition is graded rather than binary, so `points` is the share of the 12-point
680
+ * maximum this one actually cost. Only active conditions appear, and `penaltyPoints` is
681
+ * the sum of these.
682
+ */
683
+ interface RiskAdjustment {
684
+ /** Which condition, by the same key `riskConditions` reports. */
685
+ condition: RiskCondition;
686
+ /** Points deducted, to one decimal, up to 12 for a single condition. */
687
+ points: number;
688
+ }
671
689
  /**
672
690
  * One constituent leg behind a dimension's percentile.
673
691
  *
@@ -737,18 +755,59 @@ interface RatingBase {
737
755
  /** The standard financial disclaimer. Display it alongside the grade. */
738
756
  disclaimer: string;
739
757
  }
740
- /** A stock that has a grade for `asOf`. */
741
- interface RatedStockRating extends RatingBase {
758
+ /**
759
+ * A stock that has a grade for `asOf`.
760
+ *
761
+ * `score`, `bucketLetter`, `riskConditions`, `riskAdjustments` and `penaltyPoints` arrive
762
+ * from the next API deploy onward and are optional here because a response served before
763
+ * then omits them.
764
+ */
765
+ interface StockRating extends RatingBase {
742
766
  rated: true;
743
767
  /**
744
- * `"A"`, `"B"`, `"C"`, `"D"` or `"F"`. Served as stored, never re-derived from
745
- * `percentile`, so read it rather than computing your own bucket edges.
768
+ * The headline number, 0 to 100 with one decimal, and the number `letter` is the band
769
+ * of: `score = percentile - sum(riskAdjustments.map((a) => a.points))`, floored at 10
770
+ * when fewer than five dimensions are available and at 0 otherwise. Absent on a
771
+ * response served before this field shipped.
772
+ */
773
+ score?: number;
774
+ /**
775
+ * `"A"`, `"B"`, `"C"`, `"D"` or `"F"`: the band `score` falls in, at edges 90, 70, 30
776
+ * and 10. Served as stored, so read it rather than deriving your own edges. Deriving
777
+ * it from `percentile` disagrees with the API for every stock carrying a risk
778
+ * condition.
746
779
  */
747
780
  letter: string;
748
- /** Rank of `composite` among the day's rated stocks, 0 to 100. */
781
+ /**
782
+ * The band `percentile` alone would fall in, so a difference from `letter` is exactly
783
+ * what the risk conditions cost. Absent on a response served before this field
784
+ * shipped.
785
+ */
786
+ bucketLetter?: string;
787
+ /**
788
+ * Rank of `composite` among the day's rated stocks, 0 to 100. This stays the true rank
789
+ * of the blended signals: the risk conditions are subtracted from `score`, never here.
790
+ */
749
791
  percentile: number;
750
792
  /** The weighted blend before ranking, in [-1, +1]. */
751
793
  composite: number;
794
+ /**
795
+ * Which risk conditions were active. An empty array means none were, and the field is
796
+ * absent on a response served before it shipped.
797
+ */
798
+ riskConditions?: RiskCondition[];
799
+ /**
800
+ * The same conditions with the points each one actually cost, since a condition is
801
+ * graded rather than binary and can cost anything up to 12. Absent on a response
802
+ * served before this field shipped.
803
+ */
804
+ riskAdjustments?: RiskAdjustment[];
805
+ /**
806
+ * The sum of `riskAdjustments` points, to one decimal: how far `score` sits below
807
+ * `percentile` before the floor applies. Absent on a response served before this field
808
+ * shipped.
809
+ */
810
+ penaltyPoints?: number;
752
811
  /** How many stocks were rated that day: the rank's denominator. */
753
812
  ratedCount: number;
754
813
  /** The weights and floors in force when the row was written, e.g. `"2026.09-v1"`. */
@@ -758,7 +817,7 @@ interface RatedStockRating extends RatingBase {
758
817
  * A stock with no grade for `asOf`. A normal 200, not an error: ETFs and tickers outside
759
818
  * the swept universe answer this way, and the composition still arrives so a card can render.
760
819
  */
761
- interface UnratedStockRating extends RatingBase {
820
+ interface StockNotRated extends RatingBase {
762
821
  rated: false;
763
822
  /** Why there is no grade. */
764
823
  reason: RatingNotRatedReason;
@@ -779,7 +838,7 @@ interface UnratedStockRating extends RatingBase {
779
838
  * and it is not a recommendation about any security. Carry `disclaimer` wherever you display
780
839
  * a grade. Methodology: https://sentisense.ai/methodology/#sentisense-rating
781
840
  */
782
- type StockRating = RatedStockRating | UnratedStockRating;
841
+ type StockRatingResponse = StockRating | StockNotRated;
783
842
  type DocumentSource = "news" | "reddit" | "x" | "substack" | "youtube";
784
843
  /** Per-entity sentiment classification with resolved entity details. */
785
844
  interface SentimentEntry {
@@ -1500,7 +1559,7 @@ interface PreviewResponse<T> {
1500
1559
  /** Supported metric types for the v2 Serving Metrics API. */
1501
1560
  type MetricType = "mentions" | "sentiment" | "sentisense_score"
1502
1561
  /**
1503
- * The SentiSense Rating percentile, 0 to 100. Time series only: it has no source
1562
+ * The SentiSense Rating score, 0 to 100. Time series only: it has no source
1504
1563
  * breakdown, so `getDistribution` answers with an empty distribution for it.
1505
1564
  */
1506
1565
  | "sentisense_rating" | "social_dominance" | "creators";
@@ -3356,10 +3415,10 @@ declare class Stocks {
3356
3415
  * security. `disclaimer` carries the wording to display alongside a grade. Methodology:
3357
3416
  * https://sentisense.ai/methodology/#sentisense-rating
3358
3417
  *
3359
- * **A discriminated union on `rated`.** `if (rating.rated)` narrows to `letter`,
3360
- * `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the `else` branch
3361
- * narrows to `reason`, `dimensionsPresent` and `presentDimensions`. Branch on the flag
3362
- * rather than testing a field for `undefined`.
3418
+ * **A discriminated union on `rated`.** `if (rating.rated)` narrows to `score`,
3419
+ * `letter`, `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the
3420
+ * `else` branch narrows to `reason`, `dimensionsPresent` and `presentDimensions`.
3421
+ * Branch on the flag rather than testing a field for `undefined`.
3363
3422
  *
3364
3423
  * **Having no grade is a normal 200, not a 404.** ETFs and tickers outside the swept
3365
3424
  * universe answer with `rated` false, and the composition still arrives so a card can
@@ -3369,13 +3428,24 @@ declare class Stocks {
3369
3428
  *
3370
3429
  * `dimensions` always holds all six rows in a fixed order, including the ones with no
3371
3430
  * data, which arrive with `present` false and a `null` percentile. Read `present` first
3372
- * and never read a missing percentile as zero. `letter` is served as stored rather than
3373
- * derived from `percentile`, so read it instead of computing your own bucket edges.
3431
+ * and never read a missing percentile as zero.
3432
+ *
3433
+ * **`score` and `percentile` are different numbers.** `percentile` is the rank of the
3434
+ * blended signals against the day's rated set, and
3435
+ * `score = percentile - sum(riskAdjustments.map((a) => a.points))`, floored at 10 when
3436
+ * fewer than five dimensions are available and at 0 otherwise. `letter` is the band
3437
+ * `score` falls in, at edges 90, 70, 30 and 10, while `bucketLetter` is the band the
3438
+ * percentile alone would fall in, so a difference between the two letters is exactly
3439
+ * what the conditions cost. `riskConditions` names the active ones, `riskAdjustments`
3440
+ * gives the points each cost (graded, up to 12 apiece), and `penaltyPoints` is their
3441
+ * sum. `letter` is served as stored, so read it instead of computing your own bucket
3442
+ * edges. The five fields arrive from the next API deploy onward and are optional, so a
3443
+ * response served before then still parses.
3374
3444
  *
3375
- * For the daily history of a stock's percentile, ask `client.entityMetrics.getMetrics`
3376
- * for the `sentisense_rating` metric.
3445
+ * For the daily history of a stock's score, ask `client.entityMetrics.getMetrics` for
3446
+ * the `sentisense_rating` metric.
3377
3447
  */
3378
- getRating(ticker: string): Promise<StockRating>;
3448
+ getRating(ticker: string): Promise<StockRatingResponse>;
3379
3449
  }
3380
3450
 
3381
3451
  /**
@@ -3532,6 +3602,6 @@ declare class APIError extends SentiSenseError {
3532
3602
  constructor(message: string, status: number, code?: string);
3533
3603
  }
3534
3604
 
3535
- declare const VERSION = "0.50.0";
3605
+ declare const VERSION = "0.51.0";
3536
3606
 
3537
- export { type AISummary, APIError, type AnalystAction, type AnalystCall, type AnalystConsensus, type AnalystCoverage, type AnalystCoverageAnalyst, type AnalystCoverageBookEntry, type AnalystCoverageFirm, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AnalystFirmRating, type AnalystFirmTenure, type AnalystNote, type AnalystProfile, type AnalystRatingBuckets, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsQuarter, type EarningsSource, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystCallsOptions, type GetAnalystCoverageOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetOptionsHistoryOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticianMemberOptions, type GetPoliticiansOptions, type GetRecentEarningsOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type OptionsAggregate, type OptionsContext, type OptionsHistory, type OptionsHistoryWindow, type OptionsOiWalls, type OptionsOverview, type OptionsOverviewRow, type OptionsSummary, type OptionsUnusualContract, type OptionsWall, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, type RatedStockRating, type RatingBase, type RatingDimension, type RatingDimensionKey, type RatingFlag, type RatingNotRatedReason, type RatingSubLeg, type RecentEarningsEntry, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockPrice, type StockProfile, type StockQuote, type StockRating, type StockSocialDominance, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, type UnratedStockRating, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
3607
+ export { type AISummary, APIError, type AnalystAction, type AnalystCall, type AnalystConsensus, type AnalystCoverage, type AnalystCoverageAnalyst, type AnalystCoverageBookEntry, type AnalystCoverageFirm, type AnalystEarningsSurprise, type AnalystEstimate, type AnalystEstimatesResponse, type AnalystFirmRating, type AnalystFirmTenure, type AnalystNote, type AnalystProfile, type AnalystRatingBuckets, type AssetMetadata, AuthenticationError, type CalendarMeta, type ChartData, type ChartDataPoint, type ClusterBuy, type CompanyKpisData, type CongressTrade, DeepHistoryUnavailableError, type Document, type DocumentSearchResponse, type DocumentSource, type EarningsCalendarResponse, type EarningsEvent, type EarningsKpiHighlight, type EarningsQuarter, type EarningsSource, type EtfAggregateCoverage, type EtfAnalystAggregate, type EtfAnalystContributor, type EtfHolding, type EtfHoldings, type EtfInfo, type EtfInsiderAggregate, type EtfInsiderContributor, type EtfScreenerExecuteResponse, type EtfScreenerRow, type EtfSentimentAggregate, type EtfSentimentReading, type FeaturedScreen, type FloatInfo, type Fundamentals, type FundamentalsPeriod, type FundamentalsPeriodsResponse, type GetAnalystActionsOptions, type GetAnalystCallsOptions, type GetAnalystCoverageOptions, type GetAnalystMarketActivityOptions, type GetEarningsCalendarOptions, type GetEarningsSummariesOptions, type GetEtfInsiderAggregateOptions, type GetHoldersOptions, type GetInsiderOptions, type GetInsightsOptions, type GetLatestInsightsOptions, type GetOptionsHistoryOptions, type GetPoliticianActivityOptions, type GetPoliticianDirectoryOptions, type GetPoliticianMemberOptions, type GetPoliticiansOptions, type GetRecentEarningsOptions, type GetStockInsightsRangeOptions, type GetUserInsightsOptions, type Holder, type HolderNotableChanges, type IndexConstituent, type IndexHistoryPoint, type IndexHistoryResponse, type IndexListResponse, type IndexListing, type IndexSnapshot, type InsiderActivityResponse, type InsiderActivitySummary, type InsiderTrade, type Insight, type InsightPreviewResponse, type InstitutionList, type InstitutionListResponse, type InstitutionSummary, type InstitutionalFlow, type InstitutionalFlows, type InstitutionalFlowsResponse, type KBEntity, type KpiCoverageEntry, type KpiCoverageResponse, type KpiDataPoint, type KpiSeries, type KpiTypeEntry, type ListInstitutionsOptions, type LockedInsight, type MarketMood, type MarketStatus, type MarketSummary, type MetricDistribution, type MetricDistributionOptions, type MetricType, type MetricsBreakdown, type MetricsOptions, NotFoundError, type OptionsAggregate, type OptionsContext, type OptionsHistory, type OptionsHistoryWindow, type OptionsOiWalls, type OptionsOverview, type OptionsOverviewRow, type OptionsSummary, type OptionsUnusualContract, type OptionsWall, type PoliticianDetail, type PoliticianDirectory, type PoliticianDirectoryEntry, type PoliticianDirectoryResponse, type PoliticianSummary, type PreviewResponse, type Quarter, RateLimitError, type RatingBase, type RatingDimension, type RatingDimensionKey, type RatingFlag, type RatingNotRatedReason, type RatingSubLeg, type RecentEarningsEntry, type RiskAdjustment, type RiskCondition, type ScreenerExecuteOptions, type ScreenerExecuteResponse, type ScreenerFieldCatalog, type ScreenerFieldDescriptor, type ScreenerFieldOption, type ScreenerFilter, type ScreenerPlan, type ScreenerRow, type ScreenerScreensResponse, type ScreenerSort, SentiSense, SentiSenseError, type SentiSenseOptions, type SentimentEntry, type ServingMetric, type ShortInterest, type ShortVolume, type SimilarStock, type StockDetail, type StockEntity, type StockImage, type StockNotRated, type StockPrice, type StockProfile, type StockQuote, type StockRating, type StockRatingResponse, type StockSocialDominance, type Story, type StoryCluster, type TickerHolders, type TrackerEvent, type TrackerGeoEntry, type TrackerHeadlineMetric, type TrackerListResponse, type TrackerListing, type TrackerMetricValue, type TrackerSignal, type TrackerSnapshot, type TrackerSnapshotResponse, type TrackerSourceRef, type TrackerTableRow, type TrackerTimeSeriesPoint, type TtmFundamentals, VERSION, type WeightedConsensus, type WeightedNetFlow, SentiSense as default };
package/dist/index.mjs CHANGED
@@ -1080,10 +1080,10 @@ var Stocks = class {
1080
1080
  * security. `disclaimer` carries the wording to display alongside a grade. Methodology:
1081
1081
  * https://sentisense.ai/methodology/#sentisense-rating
1082
1082
  *
1083
- * **A discriminated union on `rated`.** `if (rating.rated)` narrows to `letter`,
1084
- * `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the `else` branch
1085
- * narrows to `reason`, `dimensionsPresent` and `presentDimensions`. Branch on the flag
1086
- * rather than testing a field for `undefined`.
1083
+ * **A discriminated union on `rated`.** `if (rating.rated)` narrows to `score`,
1084
+ * `letter`, `percentile`, `composite`, `ratedCount` and `methodologyVersion`; the
1085
+ * `else` branch narrows to `reason`, `dimensionsPresent` and `presentDimensions`.
1086
+ * Branch on the flag rather than testing a field for `undefined`.
1087
1087
  *
1088
1088
  * **Having no grade is a normal 200, not a 404.** ETFs and tickers outside the swept
1089
1089
  * universe answer with `rated` false, and the composition still arrives so a card can
@@ -1093,11 +1093,22 @@ var Stocks = class {
1093
1093
  *
1094
1094
  * `dimensions` always holds all six rows in a fixed order, including the ones with no
1095
1095
  * data, which arrive with `present` false and a `null` percentile. Read `present` first
1096
- * and never read a missing percentile as zero. `letter` is served as stored rather than
1097
- * derived from `percentile`, so read it instead of computing your own bucket edges.
1098
- *
1099
- * For the daily history of a stock's percentile, ask `client.entityMetrics.getMetrics`
1100
- * for the `sentisense_rating` metric.
1096
+ * and never read a missing percentile as zero.
1097
+ *
1098
+ * **`score` and `percentile` are different numbers.** `percentile` is the rank of the
1099
+ * blended signals against the day's rated set, and
1100
+ * `score = percentile - sum(riskAdjustments.map((a) => a.points))`, floored at 10 when
1101
+ * fewer than five dimensions are available and at 0 otherwise. `letter` is the band
1102
+ * `score` falls in, at edges 90, 70, 30 and 10, while `bucketLetter` is the band the
1103
+ * percentile alone would fall in, so a difference between the two letters is exactly
1104
+ * what the conditions cost. `riskConditions` names the active ones, `riskAdjustments`
1105
+ * gives the points each cost (graded, up to 12 apiece), and `penaltyPoints` is their
1106
+ * sum. `letter` is served as stored, so read it instead of computing your own bucket
1107
+ * edges. The five fields arrive from the next API deploy onward and are optional, so a
1108
+ * response served before then still parses.
1109
+ *
1110
+ * For the daily history of a stock's score, ask `client.entityMetrics.getMetrics` for
1111
+ * the `sentisense_rating` metric.
1101
1112
  */
1102
1113
  async getRating(ticker) {
1103
1114
  return this.client.get(`/api/v1/rating/${encodeURIComponent(ticker.toUpperCase())}`);
@@ -1181,7 +1192,7 @@ var Trackers = class {
1181
1192
  };
1182
1193
 
1183
1194
  // src/version.ts
1184
- var VERSION = "0.50.0";
1195
+ var VERSION = "0.51.0";
1185
1196
 
1186
1197
  // src/client.ts
1187
1198
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";