What's New
section() helper — section(id, render) is the single API for creating sections. Return a string to include, null to exclude.
- XML format —
builder.build(ctx, { format: 'xml' }) wraps each section in <id> tags. Both Claude and Gemini recommend this for structured prompts.
- Groups —
.group('tools', b => b.use(...)) nests sections under a named XML wrapper. Transparent in text mode. Supports nesting.
.useOneOf() — Mutually exclusive sections. First candidate that renders wins, the rest are excluded.
- Default type parameters —
PromptSection, PromptContext, and PromptBuilder all have defaults. Static sections work in any builder without type annotations.
PromptFormat type — Extensible format system with exhaustive switch for adding new output formats.
Install
pnpm add @anythingai/teleprompt@0.2.0