// src/consolidation-operator.ts
var CONSOLIDATION_OPERATORS = [
  "split",
  "merge",
  "update",
  "pattern-reinforcement"
];
var DERIVED_FROM_ENTRY_RE = /^(.+):(\d+)$/;
var DERIVED_FROM_MEMORY_ID_RE = /^[A-Za-z0-9][A-Za-z0-9_:-]*$/;
function looksLikeSnapshotEntry(entry) {
  const match = entry.match(DERIVED_FROM_ENTRY_RE);
  if (!match) return false;
  const pathPart = match[1];
  return pathPart.includes("/") || pathPart.includes(".");
}
function isValidDerivedFromEntry(entry) {
  if (typeof entry !== "string") return false;
  if (entry.length === 0) return false;
  if (looksLikeSnapshotEntry(entry)) {
    const match = entry.match(DERIVED_FROM_ENTRY_RE);
    if (!match) return false;
    const pathPart = match[1];
    if (pathPart.length === 0 || pathPart.trim().length === 0) return false;
    const versionNum = Number(match[2]);
    return Number.isInteger(versionNum) && versionNum >= 0;
  }
  return DERIVED_FROM_MEMORY_ID_RE.test(entry);
}
function isConsolidationOperator(value) {
  return typeof value === "string" && CONSOLIDATION_OPERATORS.includes(value);
}
var SEMANTIC_CONSOLIDATION_LLM_OPERATORS = [
  "split",
  "merge",
  "update"
];
function isSemanticConsolidationLlmOperator(value) {
  return typeof value === "string" && SEMANTIC_CONSOLIDATION_LLM_OPERATORS.includes(value);
}

export {
  CONSOLIDATION_OPERATORS,
  DERIVED_FROM_MEMORY_ID_RE,
  isValidDerivedFromEntry,
  isConsolidationOperator,
  isSemanticConsolidationLlmOperator
};
//# sourceMappingURL=chunk-G7D6GZ5J.js.map