"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/analytics/count-resources.js
var count_resources_exports = {};
__export(count_resources_exports, {
  countResources: () => countResources,
  serializeCounts: () => serializeCounts
});
module.exports = __toCommonJS(count_resources_exports);
var import_glob = require("glob");
var RESOURCE_PATTERNS = {
  adrs: ["**/adrs/*/index.@(md|mdx)"],
  agents: ["**/agents/*/index.@(md|mdx)"],
  events: ["**/events/*/index.@(md|mdx)"],
  commands: ["**/commands/*/index.@(md|mdx)"],
  queries: ["**/queries/*/index.@(md|mdx)"],
  services: ["**/services/*/index.@(md|mdx)"],
  domains: ["domains/*/index.@(md|mdx)", "domains/*/subdomains/*/index.@(md|mdx)"],
  flows: ["**/flows/*/index.@(md|mdx)"],
  channels: ["**/channels/**/index.@(md|mdx)"],
  entities: ["**/entities/*/index.@(md|mdx)"],
  containers: ["**/containers/**/index.@(md|mdx)"],
  "data-products": ["**/data-products/*/index.@(md|mdx)"],
  teams: ["teams/*.@(md|mdx)"],
  users: ["users/*.@(md|mdx)"],
  designs: ["**/*.ecstudio"],
  diagrams: ["**/diagrams/**/index.@(md|mdx)"],
  ubiquitousLanguages: ["domains/*/ubiquitous-language.@(md|mdx)", "domains/*/subdomains/*/ubiquitous-language.@(md|mdx)"]
};
async function countResources(projectDir) {
  const counts = {};
  for (const [type, patterns] of Object.entries(RESOURCE_PATTERNS)) {
    let total = 0;
    for (const pattern of patterns) {
      const files = await (0, import_glob.glob)(pattern, {
        cwd: projectDir,
        ignore: ["**/versioned/**", "**/dist/**", "**/node_modules/**"]
      });
      total += files.length;
    }
    counts[type] = total;
  }
  return counts;
}
function serializeCounts(counts) {
  return Object.entries(counts).map(([k, v]) => `${k}:${v}`).join(",");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  countResources,
  serializeCounts
});
