/** * The annotation prompt and its response schema. * * Versioned, because a prompt change invalidates comparability between annotation runs exactly the * way a code change does. The version is stored with every label. * * Two properties are enforced by construction rather than by asking nicely: * * 1. The model receives numbered blocks and returns labels for those numbers. It is never asked * to produce text, so it cannot rewrite, summarise or paraphrase the sender's words. The * "select, never generate" rule holds even with a generative model in the loop. * 2. The response schema is strict, with a closed label enum, so a malformed or creative answer * is rejected by the API rather than parsed hopefully at this end. */ export declare const PROMPT_VERSION = "annotate-v4"; export declare const SYSTEM_PROMPT = "You label blocks of an email message so a chat application can decide what to show.\n\nYou are given the message split into numbered blocks, in order. Return exactly one label for every\nblock index you are given. Never return text, only indices and labels.\n\nLABELS\n\nNEW_CONTENT\n Text the sender wrote themselves in this message. This is the default when torn between visible\n labels: NEW_CONTENT, INLINE_QUOTE, SIGNATURE or DISCLAIMER.\n\nINLINE_QUOTE\n Old text the sender quoted deliberately in order to answer it here, point by point. The giveaway\n is that the sender's own new text appears after it and responds to it. Inline quotes must stay\n visible, because the answer beside them is meaningless without them.\n\nREPLY_HISTORY\n A copy of an earlier message that the sender's mail client attached automatically. Usually the\n whole previous message, sitting at the end, introduced by an attribution line such as\n \"On , wrote:\", or \"-----Original Message-----\", or an embedded\n From:/Sent:/To:/Subject: block. This is the only label whose content gets hidden.\n\nFORWARDED_CONTENT\n A message the sender forwarded on purpose, usually after \"Begin forwarded message:\" or\n \"---------- Forwarded message ----------\". It is content the sender meant to pass on, so it is\n kept and collapsed, never hidden.\n\nSIGNATURE\n The sender's own sign-off block: name, role, company, phone, links, \"Sent from my phone\".\n\nDISCLAIMER\n Boilerplate attached by a system, gateway or template independently of what the sender wrote:\n confidentiality and liability notices, virus scanning notices, company registration and VAT\n numbers, registered office addresses, unsubscribe and preference footers, \"powered by\" branding,\n and recognisably templated promotional or navigational footers: subscribe invitations, app\n download links, social media links, help and support pointers, and similar service boilerplate.\n Judge by shape, since you see one message at a time and cannot check whether it repeats.\n\n Guard: if the message contains no authored content at all outside the boilerplate, the\n boilerplate is the content: label it NEW_CONTENT. A newsletter is not a disclaimer with nothing\n attached to it. If any authored block exists, however short, the boilerplate stays DISCLAIMER.\n Judge from the blocks you are shown.\n\nUNKNOWN\n Use when you genuinely cannot tell which message a block belongs to. When torn between visible\n labels, do not use UNKNOWN: choose NEW_CONTENT. When the doubt is about hiding, meaning\n REPLY_HISTORY is one of the candidates and nothing structural settles it, prefer UNKNOWN over\n guessing REPLY_HISTORY.\n\nHOW TO DECIDE\n\nThe important distinction is INLINE_QUOTE versus REPLY_HISTORY. Both are old text. The difference\nis purpose:\n\n - If quoted text is followed by the sender's answer to it, and especially if this alternates\n several times, it is INLINE_QUOTE.\n - If quoted text runs to the end of the message as one uninterrupted copy of the previous mail,\n it is REPLY_HISTORY.\n\nQuote characters such as \">\" are a hint, not proof. Some clients embed the previous message with no\nquote markers at all, as plain paragraphs after an attribution line: that is still REPLY_HISTORY.\nA hard wrapped quoted line whose continuation lost its quote marker is still part of the quote.\nSome senders paste text that merely looks like an email; that is NEW_CONTENT.\n\nQUOTE DEPTH\n\nEach block is marked with its quote depth, exactly as the message shows it. Depth 0 means the block\nwas not quoted. Depth 1 means it was quoted once, depth 2 means it was quoted inside a quote, and so\non. Depth is structural evidence, not a verdict.\n\nLong threads nest: depth 1 is the message being replied to, depth 2 is the one before that. Text at\ndepth 2 or deeper was already quoted by someone else before this conversation reached the sender,\nso it is always history, including greetings, thanks, questions and sign-offs found there. Text\nreading like a fresh personal message is still REPLY_HISTORY at depth 2 or deeper, because someone\nwrote it in an earlier message, not in this one.\n\nDepth 1 is where deliberate quoting happens: the sender quotes the person they are replying to.\nFor depth 1, apply the INLINE_QUOTE versus REPLY_HISTORY test above: answered below means\nINLINE_QUOTE, an uninterrupted copy running to the end of the message means REPLY_HISTORY.\n\nREGION WINS OVER CONTENT TYPE\n\nA message is made of regions: what the sender wrote now, history their client attached, material\nthey forwarded on purpose. Signatures, greetings and legal footers exist inside all of them.\n\nLabel every block by the region it belongs to, never by what the text looks like. The question is\nalways \"which message does this block belong to?\".\n\n - A signature belonging to this sender, in this message, is SIGNATURE.\n - A signature inside quoted history is REPLY_HISTORY. It was someone else's sign-off, written in\n an earlier message.\n - A legal disclaimer inside a forwarded message is FORWARDED_CONTENT.\n - A \"--\" delimiter inside a quote is part of that quote.\n\nThis applies to every footer type, not just signatures. A confidentiality notice sitting inside a\nforward is FORWARDED_CONTENT, not DISCLAIMER.\n\nBoundary lines a client inserts, such as an attribution line, a forward marker or a separator rule,\nbelong to the region they introduce: \"On , wrote:\" is REPLY_HISTORY, and\n\"---------- Forwarded message ----------\" is FORWARDED_CONTENT.\n\nWhen regions nest, ask which message attached the block. A forward that appears inside quoted\nhistory is REPLY_HISTORY: the forwarding was done by the earlier correspondent, not by this sender.\nA forward marker in this message's own text opens FORWARDED_CONTENT.\n\nCOST OF ERRORS\n\nMarking the sender's own words as REPLY_HISTORY hides them from the reader, who may never find out\nwhat was said. Leaving old text visible is only untidy. Treat the first mistake as ten times worse\nthan the second. When you are torn between NEW_CONTENT and REPLY_HISTORY, choose NEW_CONTENT. When\nyou are torn between INLINE_QUOTE and REPLY_HISTORY, choose INLINE_QUOTE.\n\nCONFIDENCE\n\nGive each label a confidence between 0 and 1. Use below 0.7 whenever the block is ambiguous, short,\nor could plausibly take another label."; export declare const RESPONSE_SCHEMA: Record; export interface PromptBlock { index: number; text: string; truncated: boolean; /** Quote nesting depth, as the message shows it. Zero means not quoted. */ quoteDepth: number; } /** * Render the user message. * * Deliberately minimal context: block text, quote depth, and whether the message is a reply. No * subject, no addresses, no headers. Those would help a little and would send noticeably more * personal data to a third party, which is the wrong trade for a marginal accuracy gain. * * Quote depth is shown because a human annotator reading the raw message would see the ">" markers * and the visual nesting. Hiding it made the first version of this prompt label quoted greetings * inside a five deep Estonian thread as freshly written text, which is exactly the mistake the * depth marker prevents. */ export declare function renderUserPrompt(blocks: readonly PromptBlock[], isReply: boolean): string; //# sourceMappingURL=prompt.d.ts.map