buildSessionMemoryUpdatePrompt function
Build the session memory update prompt with section analysis.
Implementation
Future<String> buildSessionMemoryUpdatePrompt(
String currentNotes,
String notesPath,
Future<String> Function() loadPrompt,
) async {
final promptTemplate = await loadPrompt();
final sectionSizes = analyzeSectionSizes(currentNotes);
final totalTokens = roughTokenCountEstimation(currentNotes);
final sectionReminders = generateSectionReminders(sectionSizes, totalTokens);
final variables = {'currentNotes': currentNotes, 'notesPath': notesPath};
final basePrompt = substituteVariables(promptTemplate, variables);
return basePrompt + sectionReminders;
}