Omniscio

Decks (AI presentation builder) (part 2)

Part 2 of the Decks page: what each card is told when it is generated, how the topic colour and the 14-layout library work, publishing a deck to a web link, real images and generative art, presenter mode and speaker notes, PDF, HTML and PowerPoint export, and the data model, IPC surface and key files.

On this page

What it is

This is part 2 of the Decks (AI presentation builder) page. It covers what sits behind a finished deck — how each card is briefed, coloured and laid out, how a deck reaches the web or leaves as a file, and the data model, IPC surface and key files an agent needs in order to work on it.

Where to find it

Decks is the virtual project in the left sidebar, and the first half of this page walks through enabling it and running a generation. Everything here is reached from the deck editor once a deck exists: the theme picker sits in the editor header, the Share button publishes the open deck, and the Download menu saves it as a file.

How it behaves

Cost + credentials

Generation calls the Anthropic Messages API, which rejects OAuth tokens, so the service resolves an API-key account via resolveApiKeyForAiFeatures(). No key → a humanized error, never a crash. Every call is logged with trackApiCost(accountId, …) and checked against a per-day cap (decksDailyCostCapUsd, default $5/day), summed across the whole CLOSED set of decks billing labels — the cap gates on the SUM, so a paid decks call whose label is NOT a member would be neither counted toward the cap nor blocked by it. Every gate reads that pooled figure through the one pooledDecksSpendToday() helper, and that figure is per-account PLUS the deck charges a vendor key paid for (the ledger books those under the account vendor:<provider>, which belongs to no signed-in account), so the Claude path and the vendor path count the same spend against the same cap.

The decksPremiumModel setting does two things, and the second one costs money. It picks a stronger model for generation (default off = the cheaper model), and it switches on the visual self-review loop for artifact slides — render the slide, let vision judge its design, repair it, re-judge, for a bounded number of passes. So premium spends noticeably more per artifact slide than the model upgrade alone implies. That extra spend bills under decks-review inside the same daily cap, and the loop is fail-open: at the cap it skips rather than throwing, so a deck still finishes. The outline gets max_tokens: 4096 and each card 3072 — except an artifact card, which gets 8192 (it emits a whole HTML+CSS+SVG document rather than a few structured blocks).

What a card is actually told

A rule in the prompt is worth nothing unless the request carries what it refers to. For a long time the doctrine told the model "you are shown the previous and next slide, so do not reuse the previous slide's skeleton" while the request sent only the card's own title, summary, intent, layout and tone. Every card was therefore written in isolation from identical inputs, and came back the same shape — which is why generated decks looked machine-made no matter how the wording was tuned. It was an information failure, not a taste failure.

Each card request now carries the deck design brief, the previous and next slide (title + archetype — cards generate in parallel, so a neighbour's finished composition may not exist yet, but its planned shape always does), the deck accent, the card's assigned archetype, and — for artifact slides only — the worked exemplars. That last one roughly doubles the per-card prompt (~3.1k → ~5.2k tokens, about +$0.31 of input on a ten-slide premium deck), which is the price of the model seeing what "good" looks like instead of only being told.

Colour: chosen for the topic, overridable by the theme

The outline picks ONE accent for the deck's subject and returns it as a six-digit hex — amber for heat, red for a diagnosis, deep green for finance. Previously the doctrine forbade this outright ("never a hardcoded colour") and the accent was welded to the theme, so every deck came out the same indigo whatever the subject.

The slide applies it as --accent: var(--deck-accent, #hex), and that indirection is deliberate: on the default theme nothing defines --deck-accent, so the topic colour shows; the moment a reader picks a theme, --deck-accent is injected and the theme wins. A plain inline colour could never be reclaimed, because CSS gives an element's own declaration precedence over anything inherited. A malformed hex is dropped and the theme accent stands.

Presenter mode + speaker notes

Each card can carry speaker_notes. The generator now always writes them (2-4 talking-point lines that expand on the slide, never a restatement), they persist through CARD_UPDATE, and they surface in two places:

  • In the app — a notes strip under each card in the editor, editable inline.
  • In the published viewer — a single-screen presenter overlay (press S or the dock Notes button): current slide + next-slide preview + this slide's notes
    • an elapsed timer. It's an in-page overlay (not a second window.open, which is unreliable in the sandboxed Shares iframe) driven by the same slide engine.

Export (PDF + HTML + PowerPoint)

A Download menu in the editor saves the deck as a file (native Save dialog, so desktop-only — all three channels sit in web-access-ws.ts BLOCKED_CHANNELS):

  • PDF — a dedicated static render (renderDeckPrintHtml, no JavaScript — the shared htmlToPdf runs with JS disabled) lays every slide out as its own 16:9 page, then htmlToPdf(html, { preferCSSPageSize: true }) prints it. It reuses the shared slide engine, so the PDF matches the on-screen deck.
  • HTML — saves the self-contained published viewer document as-is.
  • PowerPoint (.pptx) — see below.

All three refuse a 0-card deck and humanize a write failure; a cancelled dialog returns { filePath: null } and never runs the render.

Export to PowerPoint (DECK_EXPORT_PPTX)

A real downloadable presentation that opens in PowerPoint / Google Slides / Keynote. It is image-fidelity: every slide is a full-bleed picture of the deck's OWN static print render, so the .pptx is pixel-identical to the on-screen deck and the PDF — charts, diagrams and artifact slides included.

The trade-off: slide text is a picture, not editable text. You can present and share the file, but you cannot edit its wording in PowerPoint. That is inherent to the approach, not a gap to be patched — editable text would be a different export.

  • Render — deck-pptx-render.ts captures each card via renderDeckPrintHtml(deck, [card]) in a hidden, JavaScript-disabled, sandboxed capturePage window, so an AI-authored artifact slide renders inert. Captures are single-flight with a 20 s per-slide timeout. Capture size is 1280×720 — deliberately not larger: a hidden window bigger than the display gets clamped by the OS, producing a short, non-16:9 image that then stretches. The capture also force-freezes the deck's entrance animations, because capturePage shoots one frame and would otherwise catch text mid-fade.
  • Package — pptx-builder.ts writes a 16:9 OOXML .pptx using Node's built-in zlib (adds no dependency), assembled in memory and written in ONE atomic save.
  • Never a hole — a slide that fails to render becomes a titled placeholder, so the .pptx always has exactly as many slides as the deck (deck-pptx-export.ts).
  • Honest about degraded output — because the render is fail-open, a fully failed export would otherwise save a valid file full of blank placeholders and report success. The export returns a { rendered, total } tally, and the editor warns when any slide fell back — naming it plainly when none rendered.
  • Costs nothing — pure local rendering, no model call.

Locked by deck-pptx-image-fidelity in .claude/memory/contracts/decks-contract.md.

The first half of this page covers what Decks is, how it is turned on, the two-stage generation flow and the four ways to start a deck. The plugin form described there is a Marketplace plugin, which is managed on the plugin settings page, and a deck built from a board pulls its material from the boards covered in mission control. The third and last part, Decks (part 3), covers installing Decks from the Marketplace, the sandboxed screen it runs in, what that screen may reach on the host and where its code lives.

Last verified 2026-10-06