sentisense 0.59.0 → 0.60.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
@@ -477,11 +477,16 @@ client.entityMetrics.getMetrics("AAPL", {
477
477
  maxDataPoints: 100,
478
478
  })
479
479
 
480
- // Distribution by source
481
- client.entityMetrics.getDistribution("AAPL", "sentiment")
480
+ // Share of mentions by source (valueType "SHARE_PERCENT")
481
+ client.entityMetrics.getDistribution("AAPL", "mentions")
482
482
  client.entityMetrics.getDistribution("AAPL", "mentions", { dimension: "source" })
483
+
484
+ // Mean sentiment by source, in [-1, 1] (valueType "MEAN")
485
+ client.entityMetrics.getDistribution("AAPL", "sentiment")
483
486
  ```
484
487
 
488
+ In a distribution, `valueType` says what each number is. For a count metric such as `mentions` or `creators` it is `"SHARE_PERCENT"`: each value is that source's percentage share of the total, summing to about 100. For `sentiment` it is `"MEAN"`: each value is that source's mean polarity over the window, in [-1, 1], the same numbers as `GET /api/v2/metrics/entity/{symbol}/metric/sentiment/mean-by/source` in the [API reference](https://sentisense.ai/docs/api/metrics/). `sentisense_score` has no per-source split and answers with an empty distribution.
489
+
485
490
  Available metric types: `mentions`, `sentiment`, `sentisense_score`, `sentisense_rating`, `social_dominance`, `creators`. `sentisense` is an alias for `sentisense_score`; either spelling returns the same series, and keys are case-insensitive. Responses always name the canonical type, so a `sentisense` request answers with `SENTISENSE_SCORE`. `sentisense_rating` is the SentiSense Rating score and is a time series only: it has no source breakdown, so `getDistribution` answers with an empty distribution for it.
486
491
 
487
492
  ### Options
@@ -529,6 +534,7 @@ All five are optional: a response served before they shipped omits them. For the
529
534
 
530
535
  ```typescript
531
536
  client.marketMood.get() // Composite market sentiment with sub-signals
537
+ client.marketMood.get({ days: 30 }) // Same, with 30 days of history (default 180)
532
538
  client.kb.getPopularEntities() // Most-tracked entities
533
539
  client.kb.searchEntities("Tesla") // Resolve a name, alias, ticker or slug to what we track
534
540
  ```
package/dist/cli.cjs CHANGED
@@ -1331,7 +1331,7 @@ var flowsCommand = {
1331
1331
  };
1332
1332
 
1333
1333
  // src/version.ts
1334
- var VERSION = "0.59.0";
1334
+ var VERSION = "0.60.0";
1335
1335
 
1336
1336
  // src/resources/analyst.ts
1337
1337
  var Analyst = class {
@@ -1694,10 +1694,16 @@ var EntityMetrics = class {
1694
1694
  );
1695
1695
  }
1696
1696
  /**
1697
- * Get distribution data for a metric, broken down by a dimension (default: source).
1697
+ * Get a metric broken down by dimension (default dimension: source).
1698
+ *
1699
+ * `valueType` on the response says what each number in `distribution` is. For a count metric
1700
+ * such as `"mentions"` it is `"SHARE_PERCENT"`: each source's percentage share of the total,
1701
+ * summing to about 100. For `"sentiment"` it is `"MEAN"`: each source's mean polarity over the
1702
+ * window, in [-1, 1]. `"sentisense_score"` has no per-source split and answers with an empty
1703
+ * distribution.
1698
1704
  *
1699
1705
  * @param symbol Ticker symbol (e.g. "AAPL") or entity urlSlug.
1700
- * @param metricType The metric to break down (e.g. "mentions", "sentiment").
1706
+ * @param metricType The metric to break down (e.g. "mentions" or "sentiment").
1701
1707
  * @param options Optional dimension parameter.
1702
1708
  */
1703
1709
  async getDistribution(symbol, metricType, options = {}) {
@@ -2088,12 +2094,13 @@ var MarketMoodResource = class {
2088
2094
  constructor(client) {
2089
2095
  this.client = client;
2090
2096
  }
2091
- /** Get market mood data (scores, history, sectors). */
2092
- async get() {
2093
- return this.client.get("/api/v2/market-mood");
2097
+ async get(options) {
2098
+ const days = options?.days;
2099
+ return this.client.get(
2100
+ "/api/v2/market-mood",
2101
+ days === void 0 ? void 0 : { days }
2102
+ );
2094
2103
  }
2095
- // TODO: accept a `days` param to control history length (the endpoint supports ?days=N).
2096
- //
2097
2104
  // Market Mood is also reachable through `client.indexes`, which serves it in the shared
2098
2105
  // index envelope alongside fed-sentiment and ai-sentiment. Use this resource when you want
2099
2106
  // the phase band, weekly change, per-signal breakdown and per-sector map; use `indexes`
package/dist/index.cjs CHANGED
@@ -443,10 +443,16 @@ var EntityMetrics = class {
443
443
  );
444
444
  }
445
445
  /**
446
- * Get distribution data for a metric, broken down by a dimension (default: source).
446
+ * Get a metric broken down by dimension (default dimension: source).
447
+ *
448
+ * `valueType` on the response says what each number in `distribution` is. For a count metric
449
+ * such as `"mentions"` it is `"SHARE_PERCENT"`: each source's percentage share of the total,
450
+ * summing to about 100. For `"sentiment"` it is `"MEAN"`: each source's mean polarity over the
451
+ * window, in [-1, 1]. `"sentisense_score"` has no per-source split and answers with an empty
452
+ * distribution.
447
453
  *
448
454
  * @param symbol Ticker symbol (e.g. "AAPL") or entity urlSlug.
449
- * @param metricType The metric to break down (e.g. "mentions", "sentiment").
455
+ * @param metricType The metric to break down (e.g. "mentions" or "sentiment").
450
456
  * @param options Optional dimension parameter.
451
457
  */
452
458
  async getDistribution(symbol, metricType, options = {}) {
@@ -837,12 +843,13 @@ var MarketMoodResource = class {
837
843
  constructor(client) {
838
844
  this.client = client;
839
845
  }
840
- /** Get market mood data (scores, history, sectors). */
841
- async get() {
842
- return this.client.get("/api/v2/market-mood");
846
+ async get(options) {
847
+ const days = options?.days;
848
+ return this.client.get(
849
+ "/api/v2/market-mood",
850
+ days === void 0 ? void 0 : { days }
851
+ );
843
852
  }
844
- // TODO: accept a `days` param to control history length (the endpoint supports ?days=N).
845
- //
846
853
  // Market Mood is also reachable through `client.indexes`, which serves it in the shared
847
854
  // index envelope alongside fed-sentiment and ai-sentiment. Use this resource when you want
848
855
  // the phase band, weekly change, per-signal breakdown and per-sector map; use `indexes`
@@ -1346,7 +1353,7 @@ var Trackers = class {
1346
1353
  };
1347
1354
 
1348
1355
  // src/version.ts
1349
- var VERSION = "0.59.0";
1356
+ var VERSION = "0.60.0";
1350
1357
 
1351
1358
  // src/client.ts
1352
1359
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";