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.
@@ -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-uu9lvAIZ.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-0qWCLB6y.js";
2
2
  export { apply, autoReviewGate, autoReviewRouteOf, autoReviewStatus, bindAutoReviewSessionCorrelation, defensivePermissionPresets, inject, installToolCallSafetyNet, isReviewerInfrastructureFailure, name, resolveSessionAutoReviewRoute, reviewLlm, reviewScope };
@@ -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", "modelSwitch"];
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(ctx) {
296
- const loader = ctx.get("loader", false);
297
- const settings = () => ctx.modelSwitch.currentSettings();
298
- const adapter = installAutomodeCompat(ctx, loader, settings);
299
- ctx.effect(function* () {
300
- yield adapter.dispose;
301
- yield ctx.on("model-switch/settings-update", () => {
302
- if (adapter.replay()) ctx.logger.info(`model-switch: re-applied the dsh-automode adaptation after a settings change (${lastSummary})`);
303
- });
304
- }, "model-switch: keep the dsh-automode adapter aligned with the settings");
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-uu9lvAIZ.js";
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-DXRFybFp.js";
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
- ctx.inject(["settings"], (scope) => scope.effect(() => scope.settings.configure({ auto: false }, ctx.fiber), "Model Switch: disable automatic settings form"));
975
- if (!allowDshRuntime(ctx.logger, "dsh-model-switch", ["@deepseek-ai/dsh-agent"])) return;
976
- installDeepSeekSearchAdapter(ctx);
977
- installModelSwitchSearchProvider(ctx, this);
978
- installCapabilitiesRpc(ctx, this.adapters, () => this.capabilities);
979
- const imageTool = installGenerateImageTool(ctx, this);
980
- ctx.on("loader/volatile-update", () => {
981
- imageTool.reconcile().catch((error) => {
982
- ctx.logger.error("Model Switch: failed to regenerate generate_image schema");
983
- ctx.logger.error(error);
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
- ctx.emit("model-switch/settings-update");
988
- bridgeAgentPresets(ctx).then((bridged) => {
989
- if (bridged.length > 0) ctx.logger.info(`model-switch: bridged agent preset compaction rows (${bridged.join(", ")})`);
990
- }).catch((error) => ctx.logger.warn(`model-switch: agent preset bridge failed: ${String(error)}`));
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() };