import { i as writeJsonFile, n as readJsonFile } from "./json-store-WWsFzXub.js";
import path from "path";
//#region src/core/tone.ts
function globalPath(dataDir) {
	return path.join(dataDir, ".agentic", "tone.json");
}
function customerPath(dataDir, slug) {
	return path.join(dataDir, "customers", slug, "tone.json");
}
function readProfile(p) {
	return readJsonFile(p, {});
}
function setTone(dataDir, profile, slug) {
	const p = slug ? customerPath(dataDir, slug) : globalPath(dataDir);
	writeJsonFile(p, {
		...readProfile(p),
		...profile
	});
}
/** Effective profile: global as base, customer fields override. */
function resolveTone(dataDir, slug) {
	const global = readProfile(globalPath(dataDir));
	if (!slug) return global;
	return {
		...global,
		...readProfile(customerPath(dataDir, slug))
	};
}
/** Render a tone profile into an instruction string ("" when blank). */
function toneInstruction(profile) {
	const parts = [];
	if (profile.formality) parts.push(`tone: ${profile.formality}`);
	if (profile.language) parts.push(`language: ${profile.language}`);
	if (profile.dos && profile.dos.length) parts.push(`prefer: ${profile.dos.join(", ")}`);
	if (profile.donts && profile.donts.length) parts.push(`avoid: ${profile.donts.join(", ")}`);
	return parts.join("; ");
}
//#endregion
export { resolveTone, setTone, toneInstruction };

//# sourceMappingURL=tone-C7bqK69y.js.map