//#region src/agent/service/session-context-report.ts
function formatSessionContextReport(input) {
	const { sessionKey, mode, model, workspacePath, agentId, messageCount, contextWindowNominal: cw, estimatedTranscriptTokens: estTokens, thinkingDefault, reasoningDefault, verboseDefault, compaction, toolsFlagsSummary, windowStats, compactionRunStats } = input;
	const payload = {
		sessionKey,
		model,
		workspacePath,
		agentId,
		messageCount,
		contextWindowNominal: cw,
		estimatedTranscriptTokens: estTokens,
		approxWindowUsage: cw > 0 ? estTokens / cw : null,
		thinkingDefault,
		reasoningDefault,
		verboseDefault,
		compaction,
		toolsFlagsOn: toolsFlagsSummary,
		windowStats,
		compactionRunStats
	};
	if (mode === "json") return JSON.stringify(payload, null, 2);
	const lines = [
		"📎 *Context overview*",
		"",
		`• Session: \`${sessionKey}\``,
		`• Model: \`${model}\``,
		`• Agent profile: \`${agentId}\``,
		`• Workspace: \`${workspacePath}\``,
		`• Messages: ${messageCount}`,
		`• Est. transcript tokens (rough): ${estTokens}`,
		`• Nominal context budget (4× maxTokens): ${cw}`
	];
	if (cw > 0) lines.push(`• Approx. usage vs budget: ${(estTokens / cw * 100).toFixed(1)}%`);
	lines.push(`• Thinking / reasoning / verbose defaults: ${thinkingDefault ?? "—"} / ${reasoningDefault ?? "—"} / ${verboseDefault ?? "—"}`, `• Tools (true flags): ${toolsFlagsSummary}`, "", "_Full system prompt, skills, and memory blocks are assembled at agent runtime; use Web settings or logs for deep inspection._");
	if (mode === "detail") {
		lines.push("", "*Compaction config (agents.defaults.compaction):*", "```json");
		lines.push(JSON.stringify(compaction ?? {}, null, 2));
		lines.push("```", "", "*Window stats:*", "```json");
		lines.push(JSON.stringify(windowStats ?? {}, null, 2));
		lines.push("```");
	}
	return lines.join("\n");
}
//#endregion
export { formatSessionContextReport };

//# sourceMappingURL=session-context-report.js.map