// src/plugin-id.ts
var PLUGIN_ID = "openclaw-remnic";
var LEGACY_PLUGIN_ID = "openclaw-engram";
var REMNIC_PLUGIN_IDS = /* @__PURE__ */ new Set([PLUGIN_ID, LEGACY_PLUGIN_ID]);
function resolveRemnicPluginEntry(raw, preferredId) {
  if (!raw || typeof raw !== "object") return void 0;
  const r = raw;
  const plugins = r["plugins"] && typeof r["plugins"] === "object" ? r["plugins"] : void 0;
  const entries = plugins && plugins["entries"] && typeof plugins["entries"] === "object" ? plugins["entries"] : void 0;
  if (!entries) return void 0;
  const rawSlot = plugins && plugins["slots"] && typeof plugins["slots"] === "object" ? plugins["slots"]["memory"] : void 0;
  const activeId = typeof rawSlot === "string" && REMNIC_PLUGIN_IDS.has(rawSlot) ? rawSlot : void 0;
  const ownId = !activeId && typeof preferredId === "string" && REMNIC_PLUGIN_IDS.has(preferredId) ? preferredId : void 0;
  const candidateIds = [activeId, ownId, PLUGIN_ID, LEGACY_PLUGIN_ID].filter(
    (id) => typeof id === "string"
  );
  for (const id of candidateIds) {
    const entry = entries[id];
    if (entry !== void 0) {
      return entry;
    }
  }
  return void 0;
}

export {
  PLUGIN_ID,
  LEGACY_PLUGIN_ID,
  resolveRemnicPluginEntry
};
//# sourceMappingURL=chunk-U66YHYC7.js.map