dsh-model-switch 0.4.55 → 0.4.57
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 +23 -0
- package/lib/auto-review-0qWCLB6y.js +1079 -0
- package/lib/auto-review-BHMVpmsr.js +1068 -0
- package/lib/auto-review-D0RrXQQb.js +1068 -0
- package/lib/auto-review.js +1 -1
- package/lib/automode-compat.js +14 -11
- package/lib/index.js +29 -17
- package/lib/prime-memory-compat-0eGkT2SF.js +652 -0
- package/lib/prime-memory-compat-B7x3nSB2.js +649 -0
- package/lib/prime-memory-compat-C6dvrTgT.js +649 -0
- package/lib/prime-memory-compat-CCKuGrem.js +647 -0
- package/lib/prime-memory-compat-DqmcT12Z.js +645 -0
- package/lib/prime-memory-compat-MlRHdNv4.js +656 -0
- package/lib/prime-memory-compat-X6WlrtaN.js +657 -0
- package/lib/prime-memory-compat.js +2 -599
- package/lib/review-timeout-CKTTDj8g.js +336 -0
- package/lib/review-timeout-DJJot3kf.js +334 -0
- package/lib/review-timeout-oDuyGOaM.js +335 -0
- package/lib/review-timeout.js +1 -1
- package/lib/subagent-runtime.js +9 -3
- package/lib/types/auto-review.d.ts +1 -1
- package/lib/types/automode-compat.d.ts +1 -1
- package/lib/types/capabilities-rpc.d.ts +7 -0
- package/lib/types/prime-memory-compat.d.ts +15 -1
- package/lib/types/review-timeout.d.ts +1 -1
- package/lib/types/subagent-runtime.d.ts +1 -3
- 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-0qWCLB6y.js";
|
|
2
2
|
export { apply, autoReviewGate, autoReviewRouteOf, autoReviewStatus, bindAutoReviewSessionCorrelation, defensivePermissionPresets, inject, installToolCallSafetyNet, isReviewerInfrastructureFailure, name, resolveSessionAutoReviewRoute, reviewLlm, reviewScope };
|
package/lib/automode-compat.js
CHANGED
|
@@ -4,7 +4,7 @@ import { t as applyFiberConfig } from "./fiber-hot-update-DrZANcwD.js";
|
|
|
4
4
|
/** Cordis plugin identity; matches the `cordis.patch.yml` insert row id. */
|
|
5
5
|
const name = "model-switch-automode-compat";
|
|
6
6
|
/** The loader is the only seam this row needs besides this plugin's settings. */
|
|
7
|
-
const inject = ["loader"
|
|
7
|
+
const inject = ["loader"];
|
|
8
8
|
/** Third-party package this row adapts (strict package identity, never a prefix). */
|
|
9
9
|
const AUTOMODE_PACKAGE = "@log.li/dsh-automode";
|
|
10
10
|
/** Live adapter state, surfaced next to the allowlist editor. */
|
|
@@ -292,16 +292,19 @@ function installAutomodeCompat(ctx, loader, settings) {
|
|
|
292
292
|
* Row entry point: adapt the third-party row on activation and on remount.
|
|
293
293
|
* @param ctx - this row's context.
|
|
294
294
|
*/
|
|
295
|
-
function apply(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
295
|
+
function apply(outer) {
|
|
296
|
+
outer.inject(["modelSwitch"], (ctx) => {
|
|
297
|
+
const runtime = ctx.modelSwitch;
|
|
298
|
+
const loader = ctx.get("loader", false);
|
|
299
|
+
const settings = () => runtime.currentSettings();
|
|
300
|
+
const adapter = installAutomodeCompat(ctx, loader, settings);
|
|
301
|
+
ctx.effect(function* () {
|
|
302
|
+
yield adapter.dispose;
|
|
303
|
+
yield ctx.on("model-switch/settings-update", () => {
|
|
304
|
+
if (adapter.replay()) ctx.logger.info(`model-switch: re-applied the dsh-automode adaptation after a settings change (${lastSummary})`);
|
|
305
|
+
});
|
|
306
|
+
}, "model-switch: keep the dsh-automode adapter aligned with the settings");
|
|
307
|
+
});
|
|
305
308
|
}
|
|
306
309
|
//#endregion
|
|
307
310
|
export { AUTOMODE_PACKAGE, apply, automodeCompatStatus, automodeCompatView, describeAutomodePlan, inject, installAutomodeCompat, isAutomodeEntry, name, planAutomodeCompat };
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { s as normalizeProviderGroups } from "./session-route-D8izd8Zd.js";
|
|
2
2
|
import { r as resolveToolSource, t as DEFAULT_READ_ONLY_TOOLS } from "./tool-allowlist-DlzB5GlQ.js";
|
|
3
|
-
import { i as autoReviewStatus } from "./auto-review-
|
|
3
|
+
import { i as autoReviewStatus } from "./auto-review-0qWCLB6y.js";
|
|
4
4
|
import { ModelSwitchAdapterRegistry } from "./adapter-registry.js";
|
|
5
5
|
import { automodeCompatView } from "./automode-compat.js";
|
|
6
|
-
import { u as reviewTimeoutStatus } from "./review-timeout-
|
|
6
|
+
import { u as reviewTimeoutStatus } from "./review-timeout-DJJot3kf.js";
|
|
7
|
+
import { l as primeMemoryCompatStatus } from "./prime-memory-compat-X6WlrtaN.js";
|
|
7
8
|
import { createRequire } from "node:module";
|
|
8
9
|
import z from "@deepseek-ai/schemastery";
|
|
9
10
|
import { Service } from "@deepseek-ai/cordis";
|
|
@@ -543,6 +544,12 @@ function installCapabilitiesRpc(ctx, registry, snapshot) {
|
|
|
543
544
|
allowedCalls: autoReviewStatus.allowedCalls,
|
|
544
545
|
skippedReadOnly: autoReviewStatus.skippedReadOnly,
|
|
545
546
|
automode: automodeCompatView(),
|
|
547
|
+
primeMemory: {
|
|
548
|
+
installed: primeMemoryCompatStatus.installed,
|
|
549
|
+
route: primeMemoryCompatStatus.route,
|
|
550
|
+
routeSkipped: primeMemoryCompatStatus.routeSkipped,
|
|
551
|
+
replays: primeMemoryCompatStatus.replays
|
|
552
|
+
},
|
|
546
553
|
reviewTimeout: {
|
|
547
554
|
configuredMs: reviewTimeoutStatus.configuredMs,
|
|
548
555
|
applied: reviewTimeoutStatus.applied,
|
|
@@ -971,23 +978,28 @@ var ModelSwitchRuntime = class extends Service {
|
|
|
971
978
|
constructor(ctx, entry) {
|
|
972
979
|
super(ctx, "modelSwitch");
|
|
973
980
|
this.source = () => readConfig(entry);
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
981
|
+
try {
|
|
982
|
+
ctx.inject(["settings"], (scope) => scope.effect(() => scope.settings.configure({ auto: false }, ctx.fiber), "Model Switch: disable automatic settings form"));
|
|
983
|
+
if (!allowDshRuntime(ctx.logger, "dsh-model-switch", ["@deepseek-ai/dsh-agent"])) return;
|
|
984
|
+
installDeepSeekSearchAdapter(ctx);
|
|
985
|
+
installModelSwitchSearchProvider(ctx, this);
|
|
986
|
+
installCapabilitiesRpc(ctx, this.adapters, () => this.capabilities);
|
|
987
|
+
const imageTool = installGenerateImageTool(ctx, this);
|
|
988
|
+
ctx.on("loader/volatile-update", () => {
|
|
989
|
+
imageTool.reconcile().catch((error) => {
|
|
990
|
+
ctx.logger.error("Model Switch: failed to regenerate generate_image schema");
|
|
991
|
+
ctx.logger.error(error);
|
|
992
|
+
});
|
|
993
|
+
ctx.emit("model-switch/settings-update");
|
|
984
994
|
});
|
|
985
995
|
ctx.emit("model-switch/settings-update");
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
996
|
+
bridgeAgentPresets(ctx).then((bridged) => {
|
|
997
|
+
if (bridged.length > 0) ctx.logger.info(`model-switch: bridged agent preset compaction rows (${bridged.join(", ")})`);
|
|
998
|
+
}).catch((error) => ctx.logger.warn(`model-switch: agent preset bridge failed: ${String(error)}`));
|
|
999
|
+
} catch (error) {
|
|
1000
|
+
ctx.logger.error("Model Switch: the host runtime could not finish installing; the modelSwitch service stays registered so dependent rows keep loading");
|
|
1001
|
+
ctx.logger.error(error);
|
|
1002
|
+
}
|
|
991
1003
|
}
|
|
992
1004
|
currentSettings() {
|
|
993
1005
|
return { ...this.source() };
|