dsh-model-switch 0.4.35 → 0.4.36

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.
@@ -1,2 +1,2 @@
1
- import { a as bindAutoReviewSessionCorrelation, c as installToolCallSafetyNet, d as resolveSessionAutoReviewRoute, f as reviewLlm, i as autoReviewStatus, l as isReviewerInfrastructureFailure, n as autoReviewGate, o as defensivePermissionPresets, p as reviewScope, r as autoReviewRouteOf, s as inject, t as apply, u as name } from "./auto-review-D-0A5Amx.js";
1
+ import { a as bindAutoReviewSessionCorrelation, c as installToolCallSafetyNet, d as resolveSessionAutoReviewRoute, f as reviewLlm, i as autoReviewStatus, l as isReviewerInfrastructureFailure, n as autoReviewGate, o as defensivePermissionPresets, p as reviewScope, r as autoReviewRouteOf, s as inject, t as apply, u as name } from "./auto-review-CvmQaRVf.js";
2
2
  export { apply, autoReviewGate, autoReviewRouteOf, autoReviewStatus, bindAutoReviewSessionCorrelation, defensivePermissionPresets, inject, installToolCallSafetyNet, isReviewerInfrastructureFailure, name, resolveSessionAutoReviewRoute, reviewLlm, reviewScope };
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { o as normalizeProviderGroups } from "./session-route-D1zoZgf3.js";
2
- import { i as autoReviewStatus } from "./auto-review-D-0A5Amx.js";
2
+ import { i as autoReviewStatus } from "./auto-review-CvmQaRVf.js";
3
3
  import { ModelSwitchAdapterRegistry } from "./adapter-registry.js";
4
4
  import { createRequire } from "node:module";
5
5
  import z from "@deepseek-ai/schemastery";
@@ -15,8 +15,35 @@
15
15
  * and must not resurrect a preset the user may have chosen since.
16
16
  */
17
17
  export declare const AUTO_SESSION_STATE_MAX_AGE_MS: number;
18
+ /** A decoded snapshot: the ids recorded at `savedAt`. */
19
+ export interface AutoSessionState {
20
+ savedAt: number;
21
+ ids: string[];
22
+ }
23
+ /**
24
+ * What one replay can do right now.
25
+ *
26
+ * `restore` holds the recorded ids that exist in the live session list and can
27
+ * be moved back onto Auto; `remaining` holds the ones no live session claims
28
+ * yet. The remaining ids stay in the file (with their original `savedAt`) so a
29
+ * later claim — or the next start — can still replay them, instead of the
30
+ * replay consuming the whole snapshot and dropping what it could not restore.
31
+ */
32
+ export interface AutoSnapshotReplay {
33
+ restore: string[];
34
+ remaining: string[];
35
+ }
18
36
  /** Serialize the session ids that were on Auto at `savedAt`. */
19
37
  export declare function encodeAutoSessionState(ids: readonly string[], savedAt: number): string;
38
+ /**
39
+ * Decode a snapshot written by {@link encodeAutoSessionState}, keeping the
40
+ * timestamp so a partial replay can write the rest back with the original
41
+ * expiry instead of restarting the replay window.
42
+ *
43
+ * Every malformed or stale shape degrades to `undefined`: an unreadable state
44
+ * file must never stop the Auto registration from being released or re-claimed.
45
+ */
46
+ export declare function decodeAutoSessionStatePayload(raw: string | undefined, now: number, maxAgeMs?: number): AutoSessionState | undefined;
20
47
  /**
21
48
  * Decode a snapshot written by {@link encodeAutoSessionState}.
22
49
  *
@@ -24,3 +51,21 @@ export declare function encodeAutoSessionState(ids: readonly string[], savedAt:
24
51
  * must never stop the Auto registration from being released or re-claimed.
25
52
  */
26
53
  export declare function decodeAutoSessionState(raw: string | undefined, now: number, maxAgeMs?: number): string[];
54
+ /**
55
+ * Union of two id lists, order-preserving and de-duplicated.
56
+ *
57
+ * A release-time snapshot merges what the live read sees with what the
58
+ * continuous record saw earlier, because the live read can run after the
59
+ * official teardown already moved the sessions off Auto — or fail outright.
60
+ */
61
+ export declare function mergeAutoSessionIds(primary: readonly string[], secondary: readonly string[]): string[];
62
+ /**
63
+ * Split a recorded id list into what one replay can restore now and what has
64
+ * to stay recorded.
65
+ *
66
+ * A recorded id counts as restorable as soon as a live session carries it; ids
67
+ * without a live session (not loaded yet, or already gone) remain in the file.
68
+ */
69
+ export declare function planAutoSnapshotReplay(ids: readonly string[], live: readonly {
70
+ id: string;
71
+ }[]): AutoSnapshotReplay;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-model-switch",
3
- "version": "0.4.35",
3
+ "version": "0.4.36",
4
4
  "description": "Explicit model routing plus composer/Plan picker for DeepSeek Harness",
5
5
  "repository": {
6
6
  "type": "git",