// Force strict mode and setup for ESM
"use strict";
import {
  scanForSecrets
} from "./chunk-RAKX2BKU.js";
import {
  isTeamAutoMemPath
} from "./chunk-JD3MKVKL.js";
import {
  createDebugLogger
} from "./chunk-C27BYUX6.js";
import {
  init_esbuild_shims
} from "./chunk-5O2XNYP6.js";
import {
  __name
} from "./chunk-J2S4EL5Y.js";

// packages/core/src/memory/team-memory-secret-guard.ts
init_esbuild_shims();
var debugLogger = createDebugLogger("TEAM_MEMORY_SECRET_GUARD");
function checkTeamMemorySecrets(filePath, content, projectRoot) {
  if (!isTeamAutoMemPath(filePath, projectRoot)) {
    return null;
  }
  const matches = scanForSecrets(content);
  if (matches.length === 0) {
    return null;
  }
  debugLogger.debug(
    `Blocked team-memory write; matched rules: ${matches.map((m) => m.ruleId).join(", ")}`
  );
  const labels = matches.map((m) => m.label).join(", ");
  return `Content contains potential secrets (${labels}) and cannot be written to team memory. Team memory is shared with all repository collaborators. Remove the sensitive content and try again.`;
}
__name(checkTeamMemorySecrets, "checkTeamMemorySecrets");

export {
  checkTeamMemorySecrets
};
/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
