import {
  canonicalize
} from "./chunk-VSMTAMNK.js";
import {
  ValidationError
} from "./chunk-3BFEG2F6.js";

// src/agent-profile.ts
import { createHash } from "crypto";
function agentProfileHash(profile) {
  if (typeof profile.model !== "string" || profile.model.trim().length === 0) {
    throw new ValidationError(`AgentProfile "${profile.id}" has no model \u2014 cannot hash`);
  }
  const behaviour = {
    model: profile.model.trim(),
    skills: [...profile.skills ?? []].sort(),
    promptVersion: profile.promptVersion ?? null,
    tools: [...profile.tools ?? []].sort(),
    metadata: profile.metadata ?? {}
  };
  return createHash("sha256").update(JSON.stringify(canonicalize(behaviour))).digest("hex");
}

export {
  agentProfileHash
};
//# sourceMappingURL=chunk-PQV2TKC3.js.map