sentisense 0.74.0 → 0.75.1

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
@@ -67,7 +67,7 @@ npx -y sentisense@latest health
67
67
  | Command | What you get |
68
68
  |---------|--------------|
69
69
  | `auth [key]` | Store a key, show what is configured, or `--remove` it |
70
- | `init` | A temporary key with no signup, printed as `SENTISENSE_API_KEY=...`, plus a link to keep it |
70
+ | `init` | A temporary key with no signup, printed as `SENTISENSE_API_KEY=...`, plus a command to try it and a link to keep it |
71
71
  | `health` | Reachability, key validity, latency, and the resolved base URL |
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 |
@@ -92,10 +92,18 @@ Run `sentisense help <command>` for its flags and examples.
92
92
  `init` is built for coding agents: it asks nothing and writes nothing into your project.
93
93
 
94
94
  ```bash
95
- npx -y sentisense@latest init # prints SENTISENSE_API_KEY=<key> and a keep link
95
+ npx -y sentisense@latest init # prints SENTISENSE_API_KEY=<key>, a command to try, and a keep link
96
96
  npx -y sentisense@latest init --json # the same, as JSON
97
97
  ```
98
98
 
99
+ Right after the key, `init` prints one command to run next:
100
+
101
+ ```bash
102
+ npx sentisense sentiment TSLA --api-key <key>
103
+ ```
104
+
105
+ Tesla is a sample company, so the temporary key gets its full sentiment reading. `--api-key` applies to that one call, so it works before the key is stored anywhere. With `--json`, the same line is in `starterCommand`.
106
+
99
107
  It prints a temporary free key as `SENTISENSE_API_KEY=<key>`. Store it the way your project already stores secrets; the SDK and every command read `SENTISENSE_API_KEY` from the environment. To keep the key, open the link it prints, sign in or create a free account, and the same key stays on your account with nothing else to change. Until it is kept, the key stops working after a few days and has request limits; the link still keeps it for about two weeks. When a key is already configured, `init` says so and makes no new one; `--new` asks for a fresh temporary key anyway. To tell machines that share a network apart, the request carries a random per-install id, stored as `install-id` in the CLI's config directory; it identifies nothing about you.
100
108
 
101
109
  Three of these chain into each other. Start from a name, land on a person:
@@ -675,6 +683,24 @@ const symbol = hits.find((hit) => hit.ticker)?.ticker; // "TSLA"
675
683
 
676
684
  An empty array is the normal answer for a query that matches nothing, so branch on `length` rather than catching.
677
685
 
686
+ ### Trackers
687
+
688
+ Every tracker returns the same snapshot envelope, so one renderer per `viewType` covers them all. `trackers.list()` says which trackers exist and, on those that have them, the `filters` each accepts (`{ key, values }`, with `values` the complete list).
689
+
690
+ ```typescript
691
+ const { trackers } = await client.trackers.list();
692
+ const heatmap = await client.trackers.get("market-heatmap", { scope: "nasdaq100" });
693
+
694
+ // Narrow a tracker that lists filters, as an object or the wire string "state:TX".
695
+ const tx = await client.trackers.get("data-center-moratoriums", { filter: { state: "TX" } });
696
+ console.log(tx.totalCount, "Texas records");
697
+ for (const row of tx.data.rows ?? []) {
698
+ console.log(row.rowId, row.name, row.ticker, row.endsDate, row.statesNamed);
699
+ }
700
+ ```
701
+
702
+ Rows carry `ticker`, `url`, `endsDate` (ISO date) and `statesNamed` when a row has them, and absent otherwise. Other named cells, such as the `market-heatmap` columns, are on the row too (`row.marketCap`, typed `unknown`). Combine filters with commas: `{ state: "TX", category: "local" }` sends `filter=state:TX,category:local`. An unknown filter key or value throws `APIError` with `status: 400` and `code: "invalid_filter"`, the same way a bad `scope` throws `code: "invalid_scope"`, so a call never comes back unfiltered by accident.
703
+
678
704
  ### Screener
679
705
 
680
706
  Filter the tracked universe on the SentiSense Score, attention, analyst consensus, technicals, price and end-of-day options readings in one query. Screening on analyst ratings alone is something a dozen free tools do; screening on analyst ratings *where the Score disagrees* is not.
package/dist/cli.cjs CHANGED
@@ -1432,7 +1432,7 @@ var flowsCommand = {
1432
1432
  };
1433
1433
 
1434
1434
  // src/version.ts
1435
- var VERSION = "0.74.0";
1435
+ var VERSION = "0.75.1";
1436
1436
 
1437
1437
  // src/resources/analyst.ts
1438
1438
  var Analyst = class {
@@ -2879,13 +2879,27 @@ var Trackers = class {
2879
2879
  * in your renderer.
2880
2880
  *
2881
2881
  * @param trackerId slug from {@link list}, e.g. `"institution-concentration"`.
2882
- * @param params provider-specific query params (e.g. `{ scope: "us" }` for
2883
- * geographically-scoped trackers like hantavirus). Unknown keys are ignored.
2882
+ * @param params provider-specific query params, e.g. `{ scope: "nasdaq100" }` for
2883
+ * `market-heatmap`, or `{ filter: { state: "TX" } }` for a tracker that lists
2884
+ * `filters`. A bad `filter` throws `APIError` with `code: "invalid_filter"`.
2884
2885
  */
2885
2886
  async get(trackerId, params) {
2886
- return this.client.get(`/api/v1/trackers/${trackerId}`, params);
2887
+ return this.client.get(`/api/v1/trackers/${trackerId}`, serializeTrackerParams(params));
2887
2888
  }
2888
2889
  };
2890
+ function serializeTrackerFilter(filter) {
2891
+ if (typeof filter === "string") return filter;
2892
+ return Object.entries(filter).map(([key, value]) => `${key}:${value}`).join(",");
2893
+ }
2894
+ function serializeTrackerParams(params) {
2895
+ if (!params) return void 0;
2896
+ const out = {};
2897
+ for (const [key, value] of Object.entries(params)) {
2898
+ if (value === void 0 || value === null) continue;
2899
+ out[key] = key === "filter" ? serializeTrackerFilter(value) : value;
2900
+ }
2901
+ return out;
2902
+ }
2889
2903
 
2890
2904
  // src/client.ts
2891
2905
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";
@@ -3422,6 +3436,10 @@ var PROVISION_PATH = "/api/v1/keys/provision";
3422
3436
  var CLIENT_ID_HEADER = "X-SentiSense-Client-Id";
3423
3437
  var LLMS_URL = "https://sentisense.ai/llms.txt";
3424
3438
  var SKILL_URL = "https://sentisense.ai/skill.md";
3439
+ var STARTER_ARGS = "sentiment TSLA";
3440
+ function starterCommand(apiKey) {
3441
+ return `npx sentisense ${STARTER_ARGS} --api-key ${apiKey}`;
3442
+ }
3425
3443
  var SOURCE_TEXT = {
3426
3444
  config: 'your own key saved with "sentisense auth"',
3427
3445
  flag: "the key passed with --api-key",
@@ -3493,6 +3511,7 @@ var initCommand = {
3493
3511
  "it prints SENTISENSE_API_KEY=<key> and a keep link. Store the key the way the project",
3494
3512
  "already stores secrets (an environment variable, a .env file kept out of git, a secret",
3495
3513
  "manager). The SDK and every sentisense command read SENTISENSE_API_KEY from the environment.",
3514
+ "After the key it prints one command to try next (Tesla's sentiment, a sample company).",
3496
3515
  "The key is temporary until kept: open the link, sign in or create a free account, and the",
3497
3516
  "same key stays on your account. Until then it stops working after a few days and has request",
3498
3517
  "limits; the link keeps it for about two weeks, even after it stops working.",
@@ -3526,6 +3545,7 @@ var initCommand = {
3526
3545
  }
3527
3546
  const minted = await mintKey(context);
3528
3547
  const keepWindow = minted.keepUntil ? `; it works until ${formatUtc(minted.keepUntil)}, even after the key stops` : "";
3548
+ const starter = starterCommand(minted.apiKey);
3529
3549
  return {
3530
3550
  json: {
3531
3551
  apiKey: minted.apiKey,
@@ -3535,6 +3555,7 @@ var initCommand = {
3535
3555
  keepUntil: minted.keepUntil ?? null,
3536
3556
  keepUrl: minted.keepUrl,
3537
3557
  limits: minted.limits ?? null,
3558
+ starterCommand: starter,
3538
3559
  docs: { llms: LLMS_URL, skill: SKILL_URL }
3539
3560
  },
3540
3561
  doc: doc(
@@ -3545,6 +3566,9 @@ var initCommand = {
3545
3566
  text: `A temporary key, working until ${formatUtc(minted.expiresAt)} unless kept. Set it as the ${ENV_VAR} environment variable wherever this project keeps its secrets; the SDK and the sentisense commands read it from there.`
3546
3567
  },
3547
3568
  { kind: "blank" },
3569
+ { kind: "text", text: "Run this next. Tesla is a sample company, so this key gets its full sentiment reading:" },
3570
+ { kind: "text", text: starter, tone: "accent" },
3571
+ { kind: "blank" },
3548
3572
  {
3549
3573
  kind: "text",
3550
3574
  text: "Keep this key: open this link and sign in (or create a free account), and the same key stays on your account for good. Nothing else changes."
package/dist/index.cjs CHANGED
@@ -1527,16 +1527,30 @@ var Trackers = class {
1527
1527
  * in your renderer.
1528
1528
  *
1529
1529
  * @param trackerId slug from {@link list}, e.g. `"institution-concentration"`.
1530
- * @param params provider-specific query params (e.g. `{ scope: "us" }` for
1531
- * geographically-scoped trackers like hantavirus). Unknown keys are ignored.
1530
+ * @param params provider-specific query params, e.g. `{ scope: "nasdaq100" }` for
1531
+ * `market-heatmap`, or `{ filter: { state: "TX" } }` for a tracker that lists
1532
+ * `filters`. A bad `filter` throws `APIError` with `code: "invalid_filter"`.
1532
1533
  */
1533
1534
  async get(trackerId, params) {
1534
- return this.client.get(`/api/v1/trackers/${trackerId}`, params);
1535
+ return this.client.get(`/api/v1/trackers/${trackerId}`, serializeTrackerParams(params));
1535
1536
  }
1536
1537
  };
1538
+ function serializeTrackerFilter(filter) {
1539
+ if (typeof filter === "string") return filter;
1540
+ return Object.entries(filter).map(([key, value]) => `${key}:${value}`).join(",");
1541
+ }
1542
+ function serializeTrackerParams(params) {
1543
+ if (!params) return void 0;
1544
+ const out = {};
1545
+ for (const [key, value] of Object.entries(params)) {
1546
+ if (value === void 0 || value === null) continue;
1547
+ out[key] = key === "filter" ? serializeTrackerFilter(value) : value;
1548
+ }
1549
+ return out;
1550
+ }
1537
1551
 
1538
1552
  // src/version.ts
1539
- var VERSION = "0.74.0";
1553
+ var VERSION = "0.75.1";
1540
1554
 
1541
1555
  // src/client.ts
1542
1556
  var DEFAULT_BASE_URL = "https://app.sentisense.ai";