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.5.0
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.5.0.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fred_capability_html_artifact-4.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / fred_capability_html_artifact-4.5.0.tar.gz
| Download URL | fred_capability_html_artifact-4.5.0.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ee06aeda585c260f37d6227b41d2a6fa96b096b24cec17155ef45d2cf28a453
|
|
BLAKE2b-256 checksum How to use checksums |
12ed88f2b5aa295be504b27296704cec2781254d30421e8f7ea10695eac587c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.5.0-py3-none-any.whl
| Download URL | fred_capability_html_artifact-4.5.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5010d6ad773d94e65ef21fa0f17cf42cdf635cc91a15ca7a39bb33a72090881d
|
|
BLAKE2b-256 checksum How to use checksums |
16cf49e4051241084952f24eec828790056787ac7af8c50d612ad89f9d70287f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}
|