Skip to content

Add a PowerPoint agent that creates, edits, designs, previews and exports presentations - #225

Open
MikeAlhayek wants to merge 7 commits into
mainfrom
claude/powerpoint-agent
Open

MikeAlhayek wants to merge 7 commits into
mainfrom
claude/powerpoint-agent

Conversation

@MikeAlhayek

Copy link
Copy Markdown
Member

Closes #222.

Summary

Adds a Presentation Agent (presentation-agent) that creates, edits, designs, reviews, previews and exports PowerPoint decks, built the way the Tabular Data Agent is: a code-defined system agent that is always available to the primary model, exposed over A2A, and hidden from the agent pickers. AddOpenXml() registers it; AddPdf() adds PDF export.

  • Real .pptx files in a per-conversation workspace. Every tool call applies its edits as one all-or-nothing batch and saves a new version, so later turns, previews and exports see the same file. Uploads are copied in on first use and never changed; .potx templates are imported as designs. Recent versions are kept for undo and comparison, and the workspace is removed with the conversation, its history, or its upload.
  • 41 tools covering the issue's categories:
    • Understanding: outline, slide content with element #ids, theme, search, extract content.
    • Slides and elements: create a whole deck in one call, add, duplicate, delete, move and batch-update slides; insert, update, copy, group, arrange and delete elements; rewrite paragraphs in place.
    • Tables and charts: filled from tabular_sql over the tabular workspace, and kept linked for refresh. Charts carry an embedded workbook, so they stay editable in PowerPoint.
    • Design: format with a remembered house style, layouts, templates, backgrounds, theme, master, branding, footer, sections, and a linked agenda slide.
    • Visuals: 10 diagram kinds (process, chevron, cycle, timeline, hierarchy, pyramid, funnel, matrix, Venn, cards) built from editable, theme-coloured shapes; generated pictures.
    • Review: check_presentation (layout, consistency, accessibility, readability, links, media, file, rendering, each with a fix), analyze_presentation, compare_presentations, undo.
    • Delivery: SVG previews behind [fig:N] markers, bounded, with a text fallback, a non-requestable format, and labelled boxes for SmartArt, 3D and embedded objects; export as .pptx, or PDF with AddPdf(); outline, notes, presenter script, handout or all text.
  • One text layout is used to fit text into boxes (autofit) and to draw previews and PDF pages, so lines wrap at the same word everywhere.
  • Steering: a handler tells the primary model to delegate uploaded .pptx/.potx files, and generate_file sends deck requests to the agent while it is enabled.
  • A Markdown → .pptx IGeneratedFileWriter, for code that writes a deck in one step.

Shared plumbing is identical to the PDF agent branch (GeneratedFileContent.EncodedContent, GeneratedDocumentRequest.ContentType, IConversationWorkspaceCleanupHandler), and the other shared files were edited on lines that branch doesn't touch, so the two should merge cleanly.

Verification

  • Full suite: 4,094 passed, 0 failed, including 79 new tests. They cover the engine (every preset, layout, chart type and diagram kind validates with OpenXmlValidator, and a failing edit changes nothing), the tools end to end (a six-slide deck exports with 0 validation errors; an uploaded deck is listed and previewed; edits persist across calls; a chart and a table come from a CSV; PDF export has one page per slide), and the agent profile, registrations and cleanup handlers.
  • A gallery deck with every diagram kind and chart type was opened in PowerPoint via COM automation: its exported slides match the SVG previews and the PDF pages. Two chart differences this turned up were fixed (bar-chart axis position, axis step sizes).
  • Both sample hosts (MVC and Blazor) start with the new registrations under ValidateOnBuild.
  • Not done: a live-model run of the agent end to end.

Known limitations

  • PDF export embeds the fonts PDFsharp can resolve and uses Arial for the others (for example Segoe UI). PDF gradients keep only their first and last colours. The .pptx file is unaffected.
  • SmartArt, 3D models and embedded objects are kept in the file but shown as labelled boxes in previews and PDFs.

🤖 Generated with Claude Code

…-conversation workspaces

GeneratedFileContent.EncodedContent stores a file that is already encoded as
given, without resolving a writer, and GeneratedDocumentRequest.ContentType
overrides the media type it is served with. IConversationWorkspaceCleanupHandler
lets a feature that keeps working state per conversation remove it when the
conversation is deleted. These are the same changes the PDF agent makes, so the
two branches merge cleanly.
A resolved read model of a deck (slides, elements, text, tables, charts,
pictures, themes, masters, layouts), the edits the engine applies, the shared
text measurer and layout used both to fit text and to draw it, a display-list
slide renderer with an SVG writer, the diagram composer, theme presets, and the
per-conversation workspace that keeps decks and their earlier versions.
Creates decks from theme presets or templates, reads them into the model,
applies batches of edits all-or-nothing (slides, elements, text, tables,
charts with embedded workbooks, diagrams, themes, masters, templates,
backgrounds, footers, sections, logos), fits text the way autofit does, and
validates with OpenXmlValidator. Uploaded .pptx and .potx files are imported
through it, a Markdown .pptx writer is registered for generated files, and
.potx uploads are accepted and indexed like decks.
The presentation-agent is a hidden, always-available system agent exposed over
A2A, mirroring the Tabular Data Agent. Its tools understand, create, edit,
design, review, preview and export decks in a per-conversation workspace:
slides and elements in batches, paragraph rewrites that keep formatting, tables
and charts filled from tabular data and kept linked, theme, master, template and
branding changes, diagrams and generated pictures, quality checks, comparisons,
undo, SVG previews behind [fig:N] markers, and .pptx or PDF export.

Uploaded decks are imported on first use and never changed. The workspace is
removed with the conversation, its history or its upload, a steering handler
sends uploaded .pptx and .potx files to the agent, and generate_file sends deck
requests to it while it is enabled.
The PDF package registers a renderer that paints the same display lists the
preview paints into one PDF page per slide, so an exported PDF matches the
preview and the deck in PowerPoint.
Covers creating, reading, editing and validating decks with every theme,
layout, chart type and diagram kind; all-or-nothing edits; the Markdown writer;
template import and ingestion; SVG escaping; argument parsing; colours; the
workspace history; the quality checks; the agent profile and registrations;
workspace cleanup; and the tools end to end, including a six-slide deck that
validates, uploads, edits across calls, previews, tabular charts and PDF export.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a PowerPoint agent that creates, edits, colors, and styles presentations

1 participant