@juspay/neurolink 12.7.1 → 12.7.2

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/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
- ## [12.7.1](https://github.com/juspay/neurolink/compare/v12.7.0...v12.7.1) (2026-08-29)
1
+ ## [12.7.2](https://github.com/juspay/neurolink/compare/v12.7.1...v12.7.2) (2026-08-29)
2
2
 
3
3
  ### Bug Fixes
4
4
 
5
- - **(proxy):** repair the comment [#1601](https://github.com/juspay/neurolink/issues/1601) landed malformed, and the claim it left standing ([2f41549](https://github.com/juspay/neurolink/commit/2f4154969b208700953e90dd1cd3a91c22aff9d5))
5
+ - **(localUsage):** pin window monotonicity, and stop two tests lying about failure ([f07f145](https://github.com/juspay/neurolink/commit/f07f1454e457f73c3d9b162faa09f1cd624f9e27))
6
6
 
7
7
  ## [11.2.3](https://github.com/juspay/neurolink/compare/v11.2.2...v11.2.3) (2026-08-19)
8
8
 
@@ -16,14 +16,43 @@
16
16
  * Three fixes in three files each closed one door and left the others open.
17
17
  * The logic lives here once now, so the next door closes everywhere at once.
18
18
  *
19
- * Contract: `Infinity` is the ONLY value meaning all-history. Anything that is
20
- * not a usable finite window NaN, negative, or so large the arithmetic stops
21
- * being finite — collapses to a zero-length window, which is what a
22
- * nonsensical request should read as.
19
+ * Contract, stated as the two directions rather than as one rule, because the
20
+ * single-sentence version of it was wrong here for weeks:
21
+ *
22
+ * - `0`, negatives, `-Infinity` and `NaN` are NOT windows. They collapse to
23
+ * a zero-length one and read nothing. Two of the three historical defects
24
+ * above are here (`0` and `NaN`); `-Infinity` and negatives are the same
25
+ * class and were fixed with them.
26
+ * - `Infinity`, and any finite value whose window is longer than any
27
+ * history, mean ALL HISTORY. The THIRD historical defect — `MAX_VALUE` —
28
+ * lives in this bucket, not the one above: what was wrong about it was the
29
+ * mechanism (a `-Infinity` cutoff), never the outcome. A window of 1e308 days covers every
30
+ * transcript that could exist, so "everything" is the right answer to it
31
+ * and "nothing" is a wrong one.
32
+ *
33
+ * The prose here used to say the opposite of that second point — that a span
34
+ * too large to stay finite "collapses to a zero-length window". The code never
35
+ * did that, and the code was right. Anyone reconciling the two by changing the
36
+ * code re-creates a defect this suite has already seen once: asserting
37
+ * absurd-means-nothing produces a NON-MONOTONIC CLIFF, where 2.07e300 read
38
+ * everything, 2.09e300 read nothing, and `Infinity` read everything again.
39
+ * That was found by running the CLI — `usage local --since 999999999999`
40
+ * reported 518,576 turns while `--since 1e308` reported 39 — not by reading
41
+ * either the code or this comment.
42
+ *
43
+ * The invariant that actually holds, and the one worth testing, is
44
+ * MONOTONICITY: a wider window never reads less than a narrower one, across
45
+ * the whole range including the absurd end.
23
46
  */
24
47
  export declare const DEFAULT_SINCE_DAYS = 30;
25
48
  /**
26
49
  * @returns the epoch-ms cutoff a scan must not read past, or `undefined` for an
27
- * unbounded (all-history) scan — which only `Infinity` produces.
50
+ * unbounded (all-history) scan.
51
+ *
52
+ * `undefined` has TWO sources, not one, and this line used to name only the
53
+ * first: an explicit `Infinity`, and any finite request whose span overflows
54
+ * (`Number.MAX_VALUE`). They mean the same thing on purpose — see the contract
55
+ * above — but a reader who believes only `Infinity` reaches this branch will
56
+ * mis-handle the second.
28
57
  */
29
58
  export declare function resolveScanCutoffMs(sinceDays: number | undefined, defaultDays?: number): number | undefined;
@@ -16,16 +16,45 @@
16
16
  * Three fixes in three files each closed one door and left the others open.
17
17
  * The logic lives here once now, so the next door closes everywhere at once.
18
18
  *
19
- * Contract: `Infinity` is the ONLY value meaning all-history. Anything that is
20
- * not a usable finite window NaN, negative, or so large the arithmetic stops
21
- * being finite — collapses to a zero-length window, which is what a
22
- * nonsensical request should read as.
19
+ * Contract, stated as the two directions rather than as one rule, because the
20
+ * single-sentence version of it was wrong here for weeks:
21
+ *
22
+ * - `0`, negatives, `-Infinity` and `NaN` are NOT windows. They collapse to
23
+ * a zero-length one and read nothing. Two of the three historical defects
24
+ * above are here (`0` and `NaN`); `-Infinity` and negatives are the same
25
+ * class and were fixed with them.
26
+ * - `Infinity`, and any finite value whose window is longer than any
27
+ * history, mean ALL HISTORY. The THIRD historical defect — `MAX_VALUE` —
28
+ * lives in this bucket, not the one above: what was wrong about it was the
29
+ * mechanism (a `-Infinity` cutoff), never the outcome. A window of 1e308 days covers every
30
+ * transcript that could exist, so "everything" is the right answer to it
31
+ * and "nothing" is a wrong one.
32
+ *
33
+ * The prose here used to say the opposite of that second point — that a span
34
+ * too large to stay finite "collapses to a zero-length window". The code never
35
+ * did that, and the code was right. Anyone reconciling the two by changing the
36
+ * code re-creates a defect this suite has already seen once: asserting
37
+ * absurd-means-nothing produces a NON-MONOTONIC CLIFF, where 2.07e300 read
38
+ * everything, 2.09e300 read nothing, and `Infinity` read everything again.
39
+ * That was found by running the CLI — `usage local --since 999999999999`
40
+ * reported 518,576 turns while `--since 1e308` reported 39 — not by reading
41
+ * either the code or this comment.
42
+ *
43
+ * The invariant that actually holds, and the one worth testing, is
44
+ * MONOTONICITY: a wider window never reads less than a narrower one, across
45
+ * the whole range including the absurd end.
23
46
  */
24
47
  export const DEFAULT_SINCE_DAYS = 30;
25
48
  const MS_PER_DAY = 86_400_000;
26
49
  /**
27
50
  * @returns the epoch-ms cutoff a scan must not read past, or `undefined` for an
28
- * unbounded (all-history) scan — which only `Infinity` produces.
51
+ * unbounded (all-history) scan.
52
+ *
53
+ * `undefined` has TWO sources, not one, and this line used to name only the
54
+ * first: an explicit `Infinity`, and any finite request whose span overflows
55
+ * (`Number.MAX_VALUE`). They mean the same thing on purpose — see the contract
56
+ * above — but a reader who believes only `Infinity` reaches this branch will
57
+ * mis-handle the second.
29
58
  */
30
59
  export function resolveScanCutoffMs(sinceDays, defaultDays = DEFAULT_SINCE_DAYS) {
31
60
  const requested = sinceDays ?? defaultDays;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "12.7.1",
3
+ "version": "12.7.2",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (connect any MCP server), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
6
6
  "author": {