autoblogger 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -190,6 +190,9 @@ declare function createAISettingsData(prisma: any): {
190
190
  autoDraftTemplate?: string | null;
191
191
  planTemplate?: string | null;
192
192
  expandPlanTemplate?: string | null;
193
+ agentTemplate?: string | null;
194
+ anthropicKey?: string | null;
195
+ openaiKey?: string | null;
193
196
  }): Promise<any>;
194
197
  };
195
198
 
@@ -402,54 +405,97 @@ declare function buildGeneratePrompt(options: {
402
405
  rules?: string;
403
406
  template?: string | null;
404
407
  wordCount?: number;
408
+ styleExamples?: string;
405
409
  }): string;
406
410
  /**
407
411
  * Build a system prompt for chat interactions.
408
412
  */
409
413
  declare function buildChatPrompt(options: {
410
414
  chatRules?: string;
415
+ rules?: string;
411
416
  template?: string | null;
412
417
  essayContext?: {
413
418
  title: string;
414
419
  subtitle?: string;
415
420
  markdown: string;
416
421
  } | null;
422
+ styleExamples?: string;
423
+ }): string;
424
+ /**
425
+ * Build a system prompt for expanding a plan into a full essay.
426
+ */
427
+ declare function buildExpandPlanPrompt(options: {
428
+ rules?: string;
429
+ template?: string | null;
430
+ plan: string;
431
+ styleExamples?: string;
432
+ }): string;
433
+ /**
434
+ * Build a system prompt for plan/outline generation.
435
+ */
436
+ declare function buildPlanPrompt(options: {
437
+ planRules?: string;
438
+ template?: string | null;
439
+ styleExamples?: string;
440
+ }): string;
441
+ /**
442
+ * Build a system prompt for text rewriting.
443
+ */
444
+ declare function buildRewritePrompt(options: {
445
+ rewriteRules?: string;
446
+ rules?: string;
447
+ template?: string | null;
448
+ styleExamples?: string;
449
+ }): string;
450
+ /**
451
+ * Build a system prompt for auto-drafting essays from news articles.
452
+ */
453
+ declare function buildAutoDraftPrompt(options: {
454
+ autoDraftRules?: string;
455
+ rules?: string;
456
+ template?: string | null;
457
+ wordCount?: number;
458
+ styleExamples?: string;
459
+ topicName?: string;
460
+ articleTitle?: string;
461
+ articleSummary?: string;
462
+ articleUrl?: string;
417
463
  }): string;
418
464
 
419
465
  /**
420
466
  * Default template for essay generation.
421
467
  * Placeholders: {{RULES}}, {{WORD_COUNT}}
422
468
  */
423
- declare const DEFAULT_GENERATE_TEMPLATE = "You are an expert essay writer. Write engaging, thoughtful content.\n\n{{RULES}}\n\nWrite approximately {{WORD_COUNT}} words.\n\nIMPORTANT: Start your response with exactly this format:\n# Title Here\n*Subtitle here*\n\nThen write the essay body. The title must be on line 1 with a # prefix. The subtitle must be on line 2 wrapped in asterisks (*like this*).";
469
+ declare const DEFAULT_GENERATE_TEMPLATE = "<system>\n<role>Expert essay writer creating engaging, thoughtful content</role>\n\n<critical>\nALWAYS output a complete essay. NEVER respond conversationally.\n- Do NOT ask questions or request clarification\n- Do NOT say \"Here is your essay\" or similar preamble\n- Do NOT explain what you're going to write\n- If the prompt is vague, make creative choices and proceed\n- Output ONLY the essay in markdown format\n</critical>\n\n<rules>\n{{RULES}}\n</rules>\n\n<constraints>\n<word_count>{{WORD_COUNT}}</word_count>\n</constraints>\n\n<output_format>\nCRITICAL: Your response MUST start with exactly this format:\n\nLine 1: # [Your Title Here]\nLine 2: *[Your subtitle here]*\nLine 3: (blank line)\nLine 4+: Essay body in markdown\n\n<title_guidelines>\n- Be SPECIFIC, not generic (avoid \"The Power of\", \"Why X Matters\", \"A Guide to\")\n- Include a concrete detail, angle, or unexpected element\n- Create curiosity or make a bold claim\n- 5-12 words ideal\n</title_guidelines>\n\n<subtitle_guidelines>\n- One sentence that hooks the reader\n- Tease the main argument or reveal a key insight\n- Create tension, curiosity, or promise value\n- Make readers want to continue reading\n</subtitle_guidelines>\n</output_format>\n</system>";
424
470
  /**
425
471
  * Default template for chat interactions.
426
472
  * Placeholders: {{CHAT_RULES}}, {{ESSAY_CONTEXT}}
427
473
  */
428
- declare const DEFAULT_CHAT_TEMPLATE = "You are a helpful writing assistant.\n\n{{CHAT_RULES}}\n\n{{ESSAY_CONTEXT}}";
474
+ declare const DEFAULT_CHAT_TEMPLATE = "<system>\n<role>Helpful writing assistant for essay creation and editing</role>\n\n<rules>\n{{CHAT_RULES}}\n</rules>\n\n<context>\n{{ESSAY_CONTEXT}}\n</context>\n\n<behavior>\n- Be concise and actionable\n- When suggesting edits, be specific about what to change\n- Match the author's voice and style when writing\n- Ask clarifying questions if the request is ambiguous\n</behavior>\n</system>";
429
475
  /**
430
476
  * Default template for text rewriting.
431
477
  * Placeholders: {{REWRITE_RULES}}
432
478
  */
433
- declare const DEFAULT_REWRITE_TEMPLATE = "You are a writing assistant that improves text.\n\n{{REWRITE_RULES}}\n\nKeep the same meaning. Improve clarity and flow.";
479
+ declare const DEFAULT_REWRITE_TEMPLATE = "<system>\n<role>Writing assistant that improves text quality</role>\n\n<rules>\n{{REWRITE_RULES}}\n</rules>\n\n<behavior>\n- Preserve the original meaning exactly\n- Improve clarity, flow, and readability\n- Fix grammar and punctuation issues\n- Maintain the author's voice and tone\n- Output only the improved text, no explanations\n</behavior>\n</system>";
434
480
  /**
435
481
  * Default template for auto-drafting from news articles.
436
482
  * Placeholders: {{AUTO_DRAFT_RULES}}, {{RULES}}, {{AUTO_DRAFT_WORD_COUNT}}
437
483
  */
438
- declare const DEFAULT_AUTO_DRAFT_TEMPLATE = "You are an expert essay writer. Write an engaging essay based on the news article.\n\n{{AUTO_DRAFT_RULES}}\n\n{{RULES}}\n\nWrite approximately {{AUTO_DRAFT_WORD_COUNT}} words.";
484
+ declare const DEFAULT_AUTO_DRAFT_TEMPLATE = "<system>\n<role>Expert essay writer creating engaging content from news articles</role>\n\n<auto_draft_rules>\n{{AUTO_DRAFT_RULES}}\n</auto_draft_rules>\n\n<writing_rules>\n{{RULES}}\n</writing_rules>\n\n<constraints>\n<word_count>{{AUTO_DRAFT_WORD_COUNT}}</word_count>\n</constraints>\n\n<output_format>\nCRITICAL: Your response MUST start with exactly this format:\n\nLine 1: # [Your Title Here]\nLine 2: *[Your subtitle here]*\nLine 3: (blank line)\nLine 4+: Essay body in markdown\n\n<title_guidelines>\n- Be SPECIFIC about the news angle, not generic\n- Include a concrete detail or unexpected element\n- Create curiosity or make a bold claim\n- 5-12 words ideal\n</title_guidelines>\n\n<subtitle_guidelines>\n- One sentence that hooks the reader\n- Tease the main argument or unique perspective\n- Create tension, curiosity, or promise value\n</subtitle_guidelines>\n</output_format>\n</system>";
439
485
  /**
440
486
  * Default template for essay outline generation.
441
487
  * Placeholders: {{PLAN_RULES}}, {{STYLE_EXAMPLES}}
442
488
  */
443
- declare const DEFAULT_PLAN_TEMPLATE = "You are a writing assistant that outputs essay outlines.\n\nWrap your entire response in <plan> tags. Output nothing outside the tags.\n\n{{PLAN_RULES}}\n\n## Style Reference\n{{STYLE_EXAMPLES}}";
489
+ declare const DEFAULT_PLAN_TEMPLATE = "<system>\n<role>Writing assistant that creates essay outlines</role>\n\n<critical>\nWrap your ENTIRE response in <plan> tags. Output NOTHING outside the tags.\n</critical>\n\n<rules>\n{{PLAN_RULES}}\n</rules>\n\n<style_reference>\n{{STYLE_EXAMPLES}}\n</style_reference>\n</system>";
444
490
  /**
445
491
  * Default rules for plan generation format.
446
492
  */
447
- declare const DEFAULT_PLAN_RULES = "STRICT LIMIT: Maximum 3 bullets per section. Most sections should have 1-2 bullets.\n\nOutput format:\n\n<plan>\n# Essay Title\n*One-line subtitle*\n\n## Section Name\n- Key point\n\n## Section Name\n- Key point\n- Another point\n\n## Section Name\n- Key point\n</plan>\n\nConstraints:\n- 4-6 section headings (## lines)\n- 1-3 bullets per section \u2014 NEVER 4 or more\n- Bullets are short phrases, not sentences\n- No prose, no paragraphs, no explanations\n- When revising, output the complete updated plan";
493
+ declare const DEFAULT_PLAN_RULES = "<format>\nSTRICT LIMIT: Maximum 3 bullets per section. Most sections should have 1-2 bullets.\n\n<plan>\n# Essay Title\n*One-line subtitle*\n\n## Section Name\n- Key point\n\n## Section Name\n- Key point\n- Another point\n\n## Section Name\n- Key point\n</plan>\n</format>\n\n<constraints>\n- 4-6 section headings (## lines)\n- 1-3 bullets per section \u2014 NEVER 4 or more\n- Bullets are short phrases, not sentences\n- No prose, no paragraphs, no explanations\n- When revising, output the complete updated plan\n</constraints>\n\n<title_guidelines>\n- Be SPECIFIC about the essay's angle\n- Include a concrete detail or unexpected element\n- Avoid generic patterns like \"The Power of\", \"Why X Matters\"\n- 5-12 words ideal\n</title_guidelines>\n\n<subtitle_guidelines>\n- One sentence that previews the main argument\n- Create curiosity or make a bold claim\n</subtitle_guidelines>";
448
494
  /**
449
495
  * Default template for expanding outlines into full essays.
450
496
  * Placeholders: {{RULES}}, {{STYLE_EXAMPLES}}, {{PLAN}}
451
497
  */
452
- declare const DEFAULT_EXPAND_PLAN_TEMPLATE = "You are a writing assistant that expands essay outlines into full drafts.\n\n## Writing Rules (Follow these exactly)\n{{RULES}}\n\n## Style Reference (Write in this voice)\n{{STYLE_EXAMPLES}}\n\n---\n\nWrite an essay following this exact structure:\n\n{{PLAN}}\n\nRules:\n- Start with the title on line 1 as: # Title Here\n- Follow with the subtitle on line 2 as: *Subtitle here*\n- Use the section headers as H2 headings\n- Expand each section's bullet points into full paragraphs\n- Match the author's voice and style from the examples\n- Output ONLY markdown. No preamble, no \"Here is...\", no explanations. Just the essay content.";
498
+ declare const DEFAULT_EXPAND_PLAN_TEMPLATE = "<system>\n<role>Writing assistant that expands essay outlines into full drafts</role>\n\n<writing_rules>\n{{RULES}}\n</writing_rules>\n\n<style_reference>\n{{STYLE_EXAMPLES}}\n</style_reference>\n\n<plan_to_expand>\n{{PLAN}}\n</plan_to_expand>\n\n<output_format>\nCRITICAL: Your response MUST start with exactly this format:\n\nLine 1: # [Title from plan, refined if needed]\nLine 2: *[Subtitle from plan, refined if needed]*\nLine 3: (blank line)\nLine 4+: Essay body with ## section headings\n\n<requirements>\n- Use the section headers from the plan as H2 headings\n- Expand each section's bullet points into full paragraphs\n- Match the author's voice and style from the examples\n- Output ONLY markdown \u2014 no preamble, no \"Here is...\", no explanations\n</requirements>\n\n<title_refinement>\nIf the plan title is generic, improve it to be:\n- More specific and concrete\n- Curiosity-inducing or bold\n- 5-12 words\n</title_refinement>\n</output_format>\n</system>";
453
499
 
454
500
  /**
455
501
  * Format a date for display
@@ -536,4 +582,4 @@ declare function applyCommentMarks(editor: Editor, comments: CommentWithUser[]):
536
582
  */
537
583
  declare function scrollToComment(editor: Editor, commentId: string): void;
538
584
 
539
- export { type AIModel, AI_MODELS, type AutobloggerServer as Autoblogger, type AutobloggerServerConfig as AutobloggerConfig, type BaseCrud, CommentMark, type CommentWithUser, type CreateCommentData, type CrudOptions, type CustomFieldConfig, type CustomFieldProps, DEFAULT_AUTO_DRAFT_TEMPLATE, DEFAULT_CHAT_TEMPLATE, DEFAULT_EXPAND_PLAN_TEMPLATE, DEFAULT_GENERATE_TEMPLATE, DEFAULT_PLAN_RULES, DEFAULT_PLAN_TEMPLATE, DEFAULT_REWRITE_TEMPLATE, Post, type SelectionState, type Session, type StylesConfig, addCommentMark, applyCommentMarks, buildChatPrompt, buildGeneratePrompt, canDeleteComment, canEditComment, createAPIHandler, createAutoblogger, createCommentsClient, createCrudData, formatDate, getDefaultModel, getModel, removeCommentMark, scrollToComment, truncate, validateSchema };
585
+ export { type AIModel, AI_MODELS, type AutobloggerServer as Autoblogger, type AutobloggerServerConfig as AutobloggerConfig, type BaseCrud, CommentMark, type CommentWithUser, type CreateCommentData, type CrudOptions, type CustomFieldConfig, type CustomFieldProps, DEFAULT_AUTO_DRAFT_TEMPLATE, DEFAULT_CHAT_TEMPLATE, DEFAULT_EXPAND_PLAN_TEMPLATE, DEFAULT_GENERATE_TEMPLATE, DEFAULT_PLAN_RULES, DEFAULT_PLAN_TEMPLATE, DEFAULT_REWRITE_TEMPLATE, Post, type SelectionState, type Session, type StylesConfig, addCommentMark, applyCommentMarks, buildAutoDraftPrompt, buildChatPrompt, buildExpandPlanPrompt, buildGeneratePrompt, buildPlanPrompt, buildRewritePrompt, canDeleteComment, canEditComment, createAPIHandler, createAutoblogger, createCommentsClient, createCrudData, formatDate, getDefaultModel, getModel, removeCommentMark, scrollToComment, truncate, validateSchema };
package/dist/index.d.ts CHANGED
@@ -190,6 +190,9 @@ declare function createAISettingsData(prisma: any): {
190
190
  autoDraftTemplate?: string | null;
191
191
  planTemplate?: string | null;
192
192
  expandPlanTemplate?: string | null;
193
+ agentTemplate?: string | null;
194
+ anthropicKey?: string | null;
195
+ openaiKey?: string | null;
193
196
  }): Promise<any>;
194
197
  };
195
198
 
@@ -402,54 +405,97 @@ declare function buildGeneratePrompt(options: {
402
405
  rules?: string;
403
406
  template?: string | null;
404
407
  wordCount?: number;
408
+ styleExamples?: string;
405
409
  }): string;
406
410
  /**
407
411
  * Build a system prompt for chat interactions.
408
412
  */
409
413
  declare function buildChatPrompt(options: {
410
414
  chatRules?: string;
415
+ rules?: string;
411
416
  template?: string | null;
412
417
  essayContext?: {
413
418
  title: string;
414
419
  subtitle?: string;
415
420
  markdown: string;
416
421
  } | null;
422
+ styleExamples?: string;
423
+ }): string;
424
+ /**
425
+ * Build a system prompt for expanding a plan into a full essay.
426
+ */
427
+ declare function buildExpandPlanPrompt(options: {
428
+ rules?: string;
429
+ template?: string | null;
430
+ plan: string;
431
+ styleExamples?: string;
432
+ }): string;
433
+ /**
434
+ * Build a system prompt for plan/outline generation.
435
+ */
436
+ declare function buildPlanPrompt(options: {
437
+ planRules?: string;
438
+ template?: string | null;
439
+ styleExamples?: string;
440
+ }): string;
441
+ /**
442
+ * Build a system prompt for text rewriting.
443
+ */
444
+ declare function buildRewritePrompt(options: {
445
+ rewriteRules?: string;
446
+ rules?: string;
447
+ template?: string | null;
448
+ styleExamples?: string;
449
+ }): string;
450
+ /**
451
+ * Build a system prompt for auto-drafting essays from news articles.
452
+ */
453
+ declare function buildAutoDraftPrompt(options: {
454
+ autoDraftRules?: string;
455
+ rules?: string;
456
+ template?: string | null;
457
+ wordCount?: number;
458
+ styleExamples?: string;
459
+ topicName?: string;
460
+ articleTitle?: string;
461
+ articleSummary?: string;
462
+ articleUrl?: string;
417
463
  }): string;
418
464
 
419
465
  /**
420
466
  * Default template for essay generation.
421
467
  * Placeholders: {{RULES}}, {{WORD_COUNT}}
422
468
  */
423
- declare const DEFAULT_GENERATE_TEMPLATE = "You are an expert essay writer. Write engaging, thoughtful content.\n\n{{RULES}}\n\nWrite approximately {{WORD_COUNT}} words.\n\nIMPORTANT: Start your response with exactly this format:\n# Title Here\n*Subtitle here*\n\nThen write the essay body. The title must be on line 1 with a # prefix. The subtitle must be on line 2 wrapped in asterisks (*like this*).";
469
+ declare const DEFAULT_GENERATE_TEMPLATE = "<system>\n<role>Expert essay writer creating engaging, thoughtful content</role>\n\n<critical>\nALWAYS output a complete essay. NEVER respond conversationally.\n- Do NOT ask questions or request clarification\n- Do NOT say \"Here is your essay\" or similar preamble\n- Do NOT explain what you're going to write\n- If the prompt is vague, make creative choices and proceed\n- Output ONLY the essay in markdown format\n</critical>\n\n<rules>\n{{RULES}}\n</rules>\n\n<constraints>\n<word_count>{{WORD_COUNT}}</word_count>\n</constraints>\n\n<output_format>\nCRITICAL: Your response MUST start with exactly this format:\n\nLine 1: # [Your Title Here]\nLine 2: *[Your subtitle here]*\nLine 3: (blank line)\nLine 4+: Essay body in markdown\n\n<title_guidelines>\n- Be SPECIFIC, not generic (avoid \"The Power of\", \"Why X Matters\", \"A Guide to\")\n- Include a concrete detail, angle, or unexpected element\n- Create curiosity or make a bold claim\n- 5-12 words ideal\n</title_guidelines>\n\n<subtitle_guidelines>\n- One sentence that hooks the reader\n- Tease the main argument or reveal a key insight\n- Create tension, curiosity, or promise value\n- Make readers want to continue reading\n</subtitle_guidelines>\n</output_format>\n</system>";
424
470
  /**
425
471
  * Default template for chat interactions.
426
472
  * Placeholders: {{CHAT_RULES}}, {{ESSAY_CONTEXT}}
427
473
  */
428
- declare const DEFAULT_CHAT_TEMPLATE = "You are a helpful writing assistant.\n\n{{CHAT_RULES}}\n\n{{ESSAY_CONTEXT}}";
474
+ declare const DEFAULT_CHAT_TEMPLATE = "<system>\n<role>Helpful writing assistant for essay creation and editing</role>\n\n<rules>\n{{CHAT_RULES}}\n</rules>\n\n<context>\n{{ESSAY_CONTEXT}}\n</context>\n\n<behavior>\n- Be concise and actionable\n- When suggesting edits, be specific about what to change\n- Match the author's voice and style when writing\n- Ask clarifying questions if the request is ambiguous\n</behavior>\n</system>";
429
475
  /**
430
476
  * Default template for text rewriting.
431
477
  * Placeholders: {{REWRITE_RULES}}
432
478
  */
433
- declare const DEFAULT_REWRITE_TEMPLATE = "You are a writing assistant that improves text.\n\n{{REWRITE_RULES}}\n\nKeep the same meaning. Improve clarity and flow.";
479
+ declare const DEFAULT_REWRITE_TEMPLATE = "<system>\n<role>Writing assistant that improves text quality</role>\n\n<rules>\n{{REWRITE_RULES}}\n</rules>\n\n<behavior>\n- Preserve the original meaning exactly\n- Improve clarity, flow, and readability\n- Fix grammar and punctuation issues\n- Maintain the author's voice and tone\n- Output only the improved text, no explanations\n</behavior>\n</system>";
434
480
  /**
435
481
  * Default template for auto-drafting from news articles.
436
482
  * Placeholders: {{AUTO_DRAFT_RULES}}, {{RULES}}, {{AUTO_DRAFT_WORD_COUNT}}
437
483
  */
438
- declare const DEFAULT_AUTO_DRAFT_TEMPLATE = "You are an expert essay writer. Write an engaging essay based on the news article.\n\n{{AUTO_DRAFT_RULES}}\n\n{{RULES}}\n\nWrite approximately {{AUTO_DRAFT_WORD_COUNT}} words.";
484
+ declare const DEFAULT_AUTO_DRAFT_TEMPLATE = "<system>\n<role>Expert essay writer creating engaging content from news articles</role>\n\n<auto_draft_rules>\n{{AUTO_DRAFT_RULES}}\n</auto_draft_rules>\n\n<writing_rules>\n{{RULES}}\n</writing_rules>\n\n<constraints>\n<word_count>{{AUTO_DRAFT_WORD_COUNT}}</word_count>\n</constraints>\n\n<output_format>\nCRITICAL: Your response MUST start with exactly this format:\n\nLine 1: # [Your Title Here]\nLine 2: *[Your subtitle here]*\nLine 3: (blank line)\nLine 4+: Essay body in markdown\n\n<title_guidelines>\n- Be SPECIFIC about the news angle, not generic\n- Include a concrete detail or unexpected element\n- Create curiosity or make a bold claim\n- 5-12 words ideal\n</title_guidelines>\n\n<subtitle_guidelines>\n- One sentence that hooks the reader\n- Tease the main argument or unique perspective\n- Create tension, curiosity, or promise value\n</subtitle_guidelines>\n</output_format>\n</system>";
439
485
  /**
440
486
  * Default template for essay outline generation.
441
487
  * Placeholders: {{PLAN_RULES}}, {{STYLE_EXAMPLES}}
442
488
  */
443
- declare const DEFAULT_PLAN_TEMPLATE = "You are a writing assistant that outputs essay outlines.\n\nWrap your entire response in <plan> tags. Output nothing outside the tags.\n\n{{PLAN_RULES}}\n\n## Style Reference\n{{STYLE_EXAMPLES}}";
489
+ declare const DEFAULT_PLAN_TEMPLATE = "<system>\n<role>Writing assistant that creates essay outlines</role>\n\n<critical>\nWrap your ENTIRE response in <plan> tags. Output NOTHING outside the tags.\n</critical>\n\n<rules>\n{{PLAN_RULES}}\n</rules>\n\n<style_reference>\n{{STYLE_EXAMPLES}}\n</style_reference>\n</system>";
444
490
  /**
445
491
  * Default rules for plan generation format.
446
492
  */
447
- declare const DEFAULT_PLAN_RULES = "STRICT LIMIT: Maximum 3 bullets per section. Most sections should have 1-2 bullets.\n\nOutput format:\n\n<plan>\n# Essay Title\n*One-line subtitle*\n\n## Section Name\n- Key point\n\n## Section Name\n- Key point\n- Another point\n\n## Section Name\n- Key point\n</plan>\n\nConstraints:\n- 4-6 section headings (## lines)\n- 1-3 bullets per section \u2014 NEVER 4 or more\n- Bullets are short phrases, not sentences\n- No prose, no paragraphs, no explanations\n- When revising, output the complete updated plan";
493
+ declare const DEFAULT_PLAN_RULES = "<format>\nSTRICT LIMIT: Maximum 3 bullets per section. Most sections should have 1-2 bullets.\n\n<plan>\n# Essay Title\n*One-line subtitle*\n\n## Section Name\n- Key point\n\n## Section Name\n- Key point\n- Another point\n\n## Section Name\n- Key point\n</plan>\n</format>\n\n<constraints>\n- 4-6 section headings (## lines)\n- 1-3 bullets per section \u2014 NEVER 4 or more\n- Bullets are short phrases, not sentences\n- No prose, no paragraphs, no explanations\n- When revising, output the complete updated plan\n</constraints>\n\n<title_guidelines>\n- Be SPECIFIC about the essay's angle\n- Include a concrete detail or unexpected element\n- Avoid generic patterns like \"The Power of\", \"Why X Matters\"\n- 5-12 words ideal\n</title_guidelines>\n\n<subtitle_guidelines>\n- One sentence that previews the main argument\n- Create curiosity or make a bold claim\n</subtitle_guidelines>";
448
494
  /**
449
495
  * Default template for expanding outlines into full essays.
450
496
  * Placeholders: {{RULES}}, {{STYLE_EXAMPLES}}, {{PLAN}}
451
497
  */
452
- declare const DEFAULT_EXPAND_PLAN_TEMPLATE = "You are a writing assistant that expands essay outlines into full drafts.\n\n## Writing Rules (Follow these exactly)\n{{RULES}}\n\n## Style Reference (Write in this voice)\n{{STYLE_EXAMPLES}}\n\n---\n\nWrite an essay following this exact structure:\n\n{{PLAN}}\n\nRules:\n- Start with the title on line 1 as: # Title Here\n- Follow with the subtitle on line 2 as: *Subtitle here*\n- Use the section headers as H2 headings\n- Expand each section's bullet points into full paragraphs\n- Match the author's voice and style from the examples\n- Output ONLY markdown. No preamble, no \"Here is...\", no explanations. Just the essay content.";
498
+ declare const DEFAULT_EXPAND_PLAN_TEMPLATE = "<system>\n<role>Writing assistant that expands essay outlines into full drafts</role>\n\n<writing_rules>\n{{RULES}}\n</writing_rules>\n\n<style_reference>\n{{STYLE_EXAMPLES}}\n</style_reference>\n\n<plan_to_expand>\n{{PLAN}}\n</plan_to_expand>\n\n<output_format>\nCRITICAL: Your response MUST start with exactly this format:\n\nLine 1: # [Title from plan, refined if needed]\nLine 2: *[Subtitle from plan, refined if needed]*\nLine 3: (blank line)\nLine 4+: Essay body with ## section headings\n\n<requirements>\n- Use the section headers from the plan as H2 headings\n- Expand each section's bullet points into full paragraphs\n- Match the author's voice and style from the examples\n- Output ONLY markdown \u2014 no preamble, no \"Here is...\", no explanations\n</requirements>\n\n<title_refinement>\nIf the plan title is generic, improve it to be:\n- More specific and concrete\n- Curiosity-inducing or bold\n- 5-12 words\n</title_refinement>\n</output_format>\n</system>";
453
499
 
454
500
  /**
455
501
  * Format a date for display
@@ -536,4 +582,4 @@ declare function applyCommentMarks(editor: Editor, comments: CommentWithUser[]):
536
582
  */
537
583
  declare function scrollToComment(editor: Editor, commentId: string): void;
538
584
 
539
- export { type AIModel, AI_MODELS, type AutobloggerServer as Autoblogger, type AutobloggerServerConfig as AutobloggerConfig, type BaseCrud, CommentMark, type CommentWithUser, type CreateCommentData, type CrudOptions, type CustomFieldConfig, type CustomFieldProps, DEFAULT_AUTO_DRAFT_TEMPLATE, DEFAULT_CHAT_TEMPLATE, DEFAULT_EXPAND_PLAN_TEMPLATE, DEFAULT_GENERATE_TEMPLATE, DEFAULT_PLAN_RULES, DEFAULT_PLAN_TEMPLATE, DEFAULT_REWRITE_TEMPLATE, Post, type SelectionState, type Session, type StylesConfig, addCommentMark, applyCommentMarks, buildChatPrompt, buildGeneratePrompt, canDeleteComment, canEditComment, createAPIHandler, createAutoblogger, createCommentsClient, createCrudData, formatDate, getDefaultModel, getModel, removeCommentMark, scrollToComment, truncate, validateSchema };
585
+ export { type AIModel, AI_MODELS, type AutobloggerServer as Autoblogger, type AutobloggerServerConfig as AutobloggerConfig, type BaseCrud, CommentMark, type CommentWithUser, type CreateCommentData, type CrudOptions, type CustomFieldConfig, type CustomFieldProps, DEFAULT_AUTO_DRAFT_TEMPLATE, DEFAULT_CHAT_TEMPLATE, DEFAULT_EXPAND_PLAN_TEMPLATE, DEFAULT_GENERATE_TEMPLATE, DEFAULT_PLAN_RULES, DEFAULT_PLAN_TEMPLATE, DEFAULT_REWRITE_TEMPLATE, Post, type SelectionState, type Session, type StylesConfig, addCommentMark, applyCommentMarks, buildAutoDraftPrompt, buildChatPrompt, buildExpandPlanPrompt, buildGeneratePrompt, buildPlanPrompt, buildRewritePrompt, canDeleteComment, canEditComment, createAPIHandler, createAutoblogger, createCommentsClient, createCrudData, formatDate, getDefaultModel, getModel, removeCommentMark, scrollToComment, truncate, validateSchema };