Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  config-compat.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import type { OpenClawConfig } from "../api.js";

type LegacyConfigRule = {
  path: Array<string | number>;
  message: string;
  match: (value: unknown) => boolean;
};

function asRecord(value: unknown): Record<string, unknown> | null {
  return value && typeof value === "object" && !Array.isArray(value)
    ? (value as Record<string, unknown>)
    : null;
}

function hasLegacyBridgeArtifactToggle(value: unknown): boolean {
  return Object.prototype.hasOwnProperty.call(asRecord(value) ?? {}, "readMemoryCore");
}

export const legacyConfigRules: LegacyConfigRule[] = [
  {
    path: ["plugins", "entries", "memory-wiki", "config", "bridge"],
    message:
      'plugins.entries.memory-wiki.config.bridge.readMemoryCore is legacy; use plugins.entries.memory-wiki.config.bridge.readMemoryArtifacts. Run "openclaw doctor --fix".',
    match: hasLegacyBridgeArtifactToggle,
  },
];

export function migrateMemoryWikiLegacyConfig(config: OpenClawConfig): {
  config: OpenClawConfig;
  changes: string[];
} | null {
  const rawEntry = asRecord(config.plugins?.entries?.["memory-wiki"]);
  const rawPluginConfig = asRecord(rawEntry?.config);
  const rawBridge = asRecord(rawPluginConfig?.bridge);
  if (!rawBridge || !hasLegacyBridgeArtifactToggle(rawBridge)) {
    return null;
  }

  const nextConfig = structuredClone(config);
  const nextPlugins = asRecord(nextConfig.plugins) ?? {};
  nextConfig.plugins = nextPlugins;
  const nextEntries = asRecord(nextPlugins.entries) ?? {};
  nextPlugins.entries = nextEntries;
  const nextEntry = asRecord(nextEntries["memory-wiki"]) ?? {};
  nextEntries["memory-wiki"] = nextEntry;
  const nextPluginConfig = asRecord(nextEntry.config) ?? {};
  nextEntry.config = nextPluginConfig;
  const nextBridge = asRecord(nextPluginConfig.bridge) ?? {};
  nextPluginConfig.bridge = nextBridge;

  const legacyValue = nextBridge.readMemoryCore;
  const hasCanonical = Object.prototype.hasOwnProperty.call(nextBridge, "readMemoryArtifacts");
  if (!hasCanonical) {
    nextBridge.readMemoryArtifacts = legacyValue;
  }
  delete nextBridge.readMemoryCore;

  return {
    config: nextConfig,
    changes: hasCanonical
      ? [
          "Removed legacy plugins.entries.memory-wiki.config.bridge.readMemoryCore; kept explicit plugins.entries.memory-wiki.config.bridge.readMemoryArtifacts.",
        ]
      : [
          "Moved plugins.entries.memory-wiki.config.bridge.readMemoryCore → plugins.entries.memory-wiki.config.bridge.readMemoryArtifacts.",
        ],
  };
}

export function normalizeCompatibilityConfig({ cfg }: { cfg: OpenClawConfig }): {
  config: OpenClawConfig;
  changes: string[];
} {
  return migrateMemoryWikiLegacyConfig(cfg) ?? { config: cfg, changes: [] };
}

¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge