@substrate-ai/core 0.20.73 → 0.20.75

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.
@@ -8,4 +8,6 @@ export type { VersionManagerDeps } from './version-manager-impl.js';
8
8
  export { UpdateChecker, UpdateCheckError } from './update-checker.js';
9
9
  export { VersionCache } from './version-cache.js';
10
10
  export type { VersionCacheEntry } from './version-cache.js';
11
+ export { classifyVersionGap } from './version-gap.js';
12
+ export type { VersionGap } from './version-gap.js';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/version-manager/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC9F,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACpF,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/version-manager/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC9F,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACpF,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA"}
@@ -5,4 +5,5 @@
5
5
  export { VersionManagerImpl, createVersionManager } from './version-manager-impl.js';
6
6
  export { UpdateChecker, UpdateCheckError } from './update-checker.js';
7
7
  export { VersionCache } from './version-cache.js';
8
+ export { classifyVersionGap } from './version-gap.js';
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/version-manager/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEpF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/version-manager/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEpF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Version-gap classification for the pre-dispatch advisory (obs_2026-05-02_019).
3
+ *
4
+ * Background: when a consumer's locally-installed substrate binary lags the
5
+ * published version by more than a single patch, dispatching produces work
6
+ * that may rely on prompt content / behavior the running binary does not yet
7
+ * implement — leading to false-alarm reopens (canonical incident: a strata
8
+ * reopen claimed "dispatched under v0.20.42" when the binary was v0.20.41).
9
+ *
10
+ * The existing background notification (`Update available: X → Y` to stderr
11
+ * on every CLI invocation) is easy to miss — buried under NDJSON event
12
+ * streams, scrolled out of the terminal before dispatch starts. The
13
+ * pre-dispatch advisory uses this classifier to decide when to escalate
14
+ * the warning into a prominent block at `substrate run` startup.
15
+ *
16
+ * Threshold: > 1 patch hop. Same major + same minor + (latest.patch -
17
+ * current.patch) <= 1 is `'none'` or `'patch-1'`. Anything larger is
18
+ * `'significant'` and warrants the prominent advisory.
19
+ */
20
+ export type VersionGap = 'none' | 'patch-1' | 'significant';
21
+ /**
22
+ * Classify the gap between the running version and the latest published version.
23
+ *
24
+ * @returns
25
+ * - `'none'` — versions equal, or current is ahead of latest (e.g., dev build)
26
+ * - `'patch-1'` — single patch hop (e.g., 0.20.71 → 0.20.72) — non-prominent
27
+ * - `'significant'` — > 1 patch hop, or any minor/major gap — prominent advisory
28
+ */
29
+ export declare function classifyVersionGap(current: string, latest: string): VersionGap;
30
+ //# sourceMappingURL=version-gap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-gap.d.ts","sourceRoot":"","sources":["../../src/version-manager/version-gap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAA;AAE3D;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAe9E"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Version-gap classification for the pre-dispatch advisory (obs_2026-05-02_019).
3
+ *
4
+ * Background: when a consumer's locally-installed substrate binary lags the
5
+ * published version by more than a single patch, dispatching produces work
6
+ * that may rely on prompt content / behavior the running binary does not yet
7
+ * implement — leading to false-alarm reopens (canonical incident: a strata
8
+ * reopen claimed "dispatched under v0.20.42" when the binary was v0.20.41).
9
+ *
10
+ * The existing background notification (`Update available: X → Y` to stderr
11
+ * on every CLI invocation) is easy to miss — buried under NDJSON event
12
+ * streams, scrolled out of the terminal before dispatch starts. The
13
+ * pre-dispatch advisory uses this classifier to decide when to escalate
14
+ * the warning into a prominent block at `substrate run` startup.
15
+ *
16
+ * Threshold: > 1 patch hop. Same major + same minor + (latest.patch -
17
+ * current.patch) <= 1 is `'none'` or `'patch-1'`. Anything larger is
18
+ * `'significant'` and warrants the prominent advisory.
19
+ */
20
+ import * as semver from 'semver';
21
+ /**
22
+ * Classify the gap between the running version and the latest published version.
23
+ *
24
+ * @returns
25
+ * - `'none'` — versions equal, or current is ahead of latest (e.g., dev build)
26
+ * - `'patch-1'` — single patch hop (e.g., 0.20.71 → 0.20.72) — non-prominent
27
+ * - `'significant'` — > 1 patch hop, or any minor/major gap — prominent advisory
28
+ */
29
+ export function classifyVersionGap(current, latest) {
30
+ const c = semver.coerce(current);
31
+ const l = semver.coerce(latest);
32
+ if (c === null || l === null)
33
+ return 'none';
34
+ // semver.lte covers "equal" and "current ahead of latest"
35
+ if (semver.lte(l, c))
36
+ return 'none';
37
+ // Different major or minor → always significant
38
+ if (l.major !== c.major || l.minor !== c.minor)
39
+ return 'significant';
40
+ // Same major.minor — measure patch gap
41
+ const patchDelta = l.patch - c.patch;
42
+ if (patchDelta <= 1)
43
+ return 'patch-1';
44
+ return 'significant';
45
+ }
46
+ //# sourceMappingURL=version-gap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-gap.js","sourceRoot":"","sources":["../../src/version-manager/version-gap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAIhC;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,MAAc;IAChE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC/B,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;IAE3C,0DAA0D;IAC1D,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,MAAM,CAAA;IAEnC,gDAAgD;IAChD,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QAAE,OAAO,aAAa,CAAA;IAEpE,uCAAuC;IACvC,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAA;IACpC,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,SAAS,CAAA;IACrC,OAAO,aAAa,CAAA;AACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrate-ai/core",
3
- "version": "0.20.73",
3
+ "version": "0.20.75",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {