dsh-model-switch 0.4.34 → 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.
- package/CHANGELOG.md +19 -0
- package/lib/auto-review-9SreBh-0.js +855 -0
- package/lib/auto-review-CMHNfRuV.js +1015 -0
- package/lib/auto-review-CvmQaRVf.js +1022 -0
- package/lib/auto-review-D-0A5Amx.js +859 -0
- package/lib/auto-review-oan7iXY7.js +987 -0
- package/lib/auto-review.js +1 -1
- package/lib/index.js +3 -3
- package/lib/types/auto-sessions-state.d.ts +71 -0
- package/package.json +1 -1
package/lib/auto-review.js
CHANGED
|
@@ -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-
|
|
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,16 +1,16 @@
|
|
|
1
1
|
import { o as normalizeProviderGroups } from "./session-route-D1zoZgf3.js";
|
|
2
|
-
import { i as autoReviewStatus } from "./auto-review-
|
|
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";
|
|
6
6
|
import { Service } from "@deepseek-ai/cordis";
|
|
7
|
+
import { readFileSync } from "node:fs";
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
7
9
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
8
10
|
import { clientRequestSchema } from "@deepseek-ai/dsh-client-connection";
|
|
9
11
|
import { credentialRef, isCredentialRefName } from "@deepseek-ai/dsh-credentials";
|
|
10
12
|
import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
|
|
11
13
|
import { Config as Config$1, DEEPSEEK_DEFAULT_API_VERSION, DEEPSEEK_DEFAULT_BASE_URL, DEEPSEEK_DEFAULT_MAX_TOKENS, DEEPSEEK_DEFAULT_MAX_USES, DEEPSEEK_DEFAULT_MODEL, DEEPSEEK_PROVIDER_ID, DeepSeekSearchProvider, WEB_SEARCH_DEEPSEEK_SETTINGS_NAMESPACE } from "@deepseek-ai/dsh-web-search-deepseek";
|
|
12
|
-
import { readFileSync } from "node:fs";
|
|
13
|
-
import { dirname, join } from "node:path";
|
|
14
14
|
//#region lib/types/host-settings.js
|
|
15
15
|
/**
|
|
16
16
|
* Annotated rather than inferred: the nested entry schema's inferred type
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable snapshot of the sessions that were on the Auto preset when this row
|
|
3
|
+
* released the Auto registration.
|
|
4
|
+
*
|
|
5
|
+
* The official auto-review gate's teardown moves live `auto` sessions to the
|
|
6
|
+
* fallback preset (`danger-full-access`) by design. That teardown runs whenever
|
|
7
|
+
* a gate is disposed — including every hot recompose of this row, where nothing
|
|
8
|
+
* of ours stays mounted long enough to restore the selection. This module owns
|
|
9
|
+
* the pure encode/decode half of the workaround: the ids are written before the
|
|
10
|
+
* release and replayed on the next mount.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* How long a snapshot stays replayable. A flip caused by our own release is
|
|
14
|
+
* followed by a re-claim within seconds; anything older is a different restart
|
|
15
|
+
* and must not resurrect a preset the user may have chosen since.
|
|
16
|
+
*/
|
|
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
|
+
}
|
|
36
|
+
/** Serialize the session ids that were on Auto at `savedAt`. */
|
|
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;
|
|
47
|
+
/**
|
|
48
|
+
* Decode a snapshot written by {@link encodeAutoSessionState}.
|
|
49
|
+
*
|
|
50
|
+
* Every malformed or stale shape degrades to `[]`: an unreadable state file
|
|
51
|
+
* must never stop the Auto registration from being released or re-claimed.
|
|
52
|
+
*/
|
|
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;
|