Metadata-Version: 2.4
Name: fred-capability-ppt-filler
Version: 4.5.2
Summary: Fred agent capability: fill an uploaded PowerPoint template from chat (ppt_filler).
Author-email: Thales <noreply@thalesgroup.com>
License: Apache-2.0
Project-URL: Homepage, https://site.fredlab.dev
Project-URL: Repository, https://github.com/ThalesGroup/fred
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: <3.13,>=3.12
Description-Content-Type: text/markdown
Requires-Dist: fred-core>=4.5.7
Requires-Dist: fred-sdk[agents]>=4.5.7
Requires-Dist: pydantic<3.0.0,>=2.7.0
Requires-Dist: python-pptx>=1.0.2
Requires-Dist: Pillow>=13.0.0
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: langchain>=0.3.0
Requires-Dist: fastapi>=0.110
Requires-Dist: python-multipart>=0.0.9
Provides-Extra: dev
Requires-Dist: bandit>=1.8.6; extra == "dev"
Requires-Dist: basedpyright==1.31.0; extra == "dev"
Requires-Dist: detect-secrets>=1.5.0; extra == "dev"
Requires-Dist: pytest>=8.4.2; extra == "dev"
Requires-Dist: pytest-asyncio>=1.2.0; extra == "dev"
Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
Requires-Dist: pytest-socket>=0.7.0; extra == "dev"
Requires-Dist: ruff>=0.12.5; extra == "dev"

# fred-capability-ppt-filler

Fred agent capability that fills an uploaded PowerPoint template from chat.

An author uploads a `.pptx` whose slides carry `{key}` or `{{key}}` placeholders and whose
slide notes describe each key (a `{key}:` or `{{key}}:` header plus prose, optional
`- type: image` / `- folder: ...` metadata for picture keys). The capability
parses and validates the template, then gives the agent a fill tool that
substitutes the keys - honoring inline Markdown (`**bold**` / `*italic*`) in the
substituted values - and produces a downloadable, filled deck.

This package holds the pure, offline core: the template parser/validator, the
shared text-frame traversal (list + replace), the image-anchor geometry seam, and
the folder-resolution / image-location validation layer.

## Template markers

Single and double braces identify the same case-sensitive key. Mix either form
between slides and notes, including multi-key headers such as `{first}, {{last}}:`
and image markers. Leading/trailing key whitespace is ignored. The single-brace
form requires at least one character and no braces inside the key. Double-brace recognition retains its legacy rule: the key is everything
up to the first closing brace, followed by two closing braces. No extra syntax
validation is introduced for existing templates.

Markers split across runs in one paragraph are supported in text boxes, table
text, and grouped shapes. Images use the containing shape's placement box;
table cells remain invalid image locations. Chart text and SmartArt are unsupported.

## Spec

The current template contract is in
[`openspec/specs/ppt-filler/spec.md`](../../../openspec/specs/ppt-filler/spec.md).
Author help: [English](../../../apps/frontend/public/ppt-filler-help.md) and
[French](../../../apps/frontend/public/ppt-filler-help.fr.md).

## Registration

Installing this package *is* the registration: the fred-agents pod auto-discovers
the capability at boot via the `fred.capabilities` entry point declared in
`pyproject.toml` (`ppt_filler = "fred_capability_ppt_filler.capability:PptFillerCapability"`).

## Validation memory and admission

Selection and save each independently open the deck once. One marker walk supplies
field discovery and table-cell image checks, without allocating image anchors or
computing coordinates. Generation retains its geometry path. Only the schema survives
into asynchronous folder lookup; worker cleanup collects cyclic presentation objects
after validation and generation,
including failed processing. Collection runs in the worker but can pause other Python
threads while holding the GIL. The existing per-pod limit remains four heavy jobs with
fail-fast busy feedback. This count is not a memory budget: four large decks can still
exceed a deployment's limit, and cancelling an awaiting request can release its slot
before its worker stops.

Save transport failures distinguish an unreachable runtime (503), operation timeout
(504), and interrupted communication (502). The form translates their stable codes;
transport logs include exception type and duration with the current request context,
without service URLs or raw exception messages. A dropped connection does not identify
an OOM kill or require Kubernetes access.
