// Selections shorter than this are already note-sized — summarizing them
// would only add latency and risk losing the exact wording.
constNOTES_SUMMARIZE_MIN_CHARS=280;
constNOTES_SYSTEM_PROMPT=[
'You distill a text selection from a coding-agent conversation into a project note.',
'Return ONLY the note text — no preamble, no surrounding quotes, no headers.',
'Write 1-3 tight sentences that capture the essence worth remembering later: facts, decisions, constraints, root causes, gotchas, next steps.',
'Preserve exact identifiers verbatim — file paths, function names, commands, flags, versions — in backticks.',
'Drop filler, hedging, greetings, and step-by-step narration.',
'Write the note in the same language as the selection. Ignore any other language preferences or personalization — only the selection text decides the language.',
].join('\n');
/**
* Distills a chat selection into a compact note via the small model. Falls
* back to the original text on any failure or when no small model is
* available within the session's provider (explicit settings/config picks
'Capture: the end goals, what must exist and work when the task is fully done, and how each major part is verified. Omit implementation steps and how-to details.',
'Preserve verbatim any file paths, commands, and identifiers that define the task — especially ones from the opening lines.',