fred-capability-html-artifact
A Fred agent capability (html_artifact) that lets an agent produce a static
HTML/CSS artifact rendered live in a sandboxed viewer beside the chat —
the "artifact" experience, scoped to static markup (no JavaScript) for v1.
Design: docs/swift/rfc/HTML-ARTIFACT-CAPABILITY-RFC.md (issue #2478).
What it ships
- Tool
render_html_artifact(title, html, css, artifact_id?)— HTML and CSS kept separate (for the viewer's tabs). Combined size is capped at 256 KB. - Chat part
HtmlArtifactPart(type="html_artifact") carrying the markup inline — no owned table, no router, no migration (v1 is read-only; chatui_partspersist across reload). - Prompt fragment steering the model to call the tool (static only) instead of pasting code into the chat.
- Side panel
html_artifact_pane(frontend): read-only tabs Preview (sandboxed<iframe srcdoc>) / HTML / CSS + download.
execution_models=("react",): the prompt overlay is a wrap_model_call hook, so
the tool is carried by the capability's middleware (mirrors writable_document).
Registration
Installing this package IS the registration — the fred.capabilities entry point
in pyproject.toml points the fred-agents pod at HtmlArtifactCapability. It is
wired into the pod as an editable path dependency of apps/fred-agents.
Security
The markup is untrusted LLM output; the backend carries only inert strings. Safe
rendering is a frontend concern (RFC §4.7): the Preview iframe uses sandbox
without allow-scripts/allow-same-origin and a restrictive CSP, so no
script runs and no network egress is possible.
Dev
make code-quality # ruff + format + type-check
make test # offline unit tests
Metadata
Release files for fred-capability-html-artifact 4.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fred_capability_html_artifact-4.4.3.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fred_capability_html_artifact-4.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / fred_capability_html_artifact-4.4.3.tar.gz
| Download URL | fred_capability_html_artifact-4.4.3.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
288948da12809874aca2251facaeb39be9d9b6b4d6fe0bb0080effd4873f4f96
|
|
BLAKE2b-256 checksum How to use checksums |
5f2d91e07dc8b4fbf07db87aa0fc0e0c1a09cc24bca5e6f108a8fe74c82d4770
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / fred_capability_html_artifact-4.4.3-py3-none-any.whl
| Download URL | fred_capability_html_artifact-4.4.3-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57ba22701bf4e9a8226c6a4c07395674d3a4a1d76fd6fa78193f41d470472bb0
|
|
BLAKE2b-256 checksum How to use checksums |
cfdeb567758b3e6c5bb2676f9f22f004513397bf0636e03356350cb740a26bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|