//#region src/agent/prompt/system-reminder.ts
const DEFAULT_CONFIG = {
	enabled: true,
	defaultReminders: [],
	contextualReminders: {
		"file.write": ["💡 Tip: edit > write for small changes"],
		"file.delete": ["⚠️ Confirming: file deletion"],
		"shell.exec": ["🐚 Shell: use pty=true for interactive commands"],
		"web.fetch": ["🌐 Web: check for rate limits on repeated calls"]
	},
	appendToToolResults: true,
	maxRemindersPerTurn: 2
};
var SystemReminder = class {
	config;
	reminderCountThisTurn = 0;
	constructor(config = {}) {
		this.config = {
			...DEFAULT_CONFIG,
			...config
		};
	}
	/**
	* Append default reminders (when configured and under per-turn cap).
	*/
	getReminderText() {
		if (!this.config.enabled) return "";
		if (this.reminderCountThisTurn >= this.config.maxRemindersPerTurn) return "";
		if (this.config.defaultReminders.length === 0) return "";
		this.reminderCountThisTurn++;
		return this.config.defaultReminders.join("\n");
	}
	/**
	* Get contextual reminder based on tool name
	*/
	getContextualReminder(toolName) {
		if (!this.config.enabled) return "";
		if (this.reminderCountThisTurn >= this.config.maxRemindersPerTurn) return "";
		const reminders = this.config.contextualReminders[toolName];
		if (!reminders || reminders.length === 0) return "";
		this.reminderCountThisTurn++;
		return reminders[0];
	}
	/**
	* Append reminder to tool result content
	*/
	appendToResult(result, toolName) {
		if (!this.config.enabled || !this.config.appendToToolResults) return result;
		const reminderText = toolName ? this.getContextualReminder(toolName) : this.getReminderText();
		if (!reminderText) return result;
		if (result && typeof result === "object") {
			const res = result;
			if (res.content && Array.isArray(res.content)) res.content = [...res.content, {
				type: "text",
				text: `\n${reminderText}`
			}];
			else if (typeof res.content === "string") res.content = `${res.content}\n${reminderText}`;
			return res;
		}
		return result;
	}
	/**
	* Reset turn counter (called at end of turn)
	*/
	resetTurn() {
		this.reminderCountThisTurn = 0;
	}
	/**
	* Update configuration
	*/
	setConfig(config) {
		this.config = {
			...this.config,
			...config
		};
	}
	/**
	* Get current config
	*/
	getConfig() {
		return { ...this.config };
	}
};
//#endregion
export { SystemReminder };

//# sourceMappingURL=system-reminder.js.map