Skip to content

Agents can show HTML pages inline in the transcript #505

Description

@yogesharc

Agents can only answer in markdown, so a chart, a table of numbers or three variations of a component side by side means leaving the chat to look at them.

Let an agent publish a self-contained HTML page that draws inline in the transcript, the way a dray browser record video already does.

  • dray render <file.html> copies the page into ~/.dray/renders/<session>/ and prints the path. The agent names that path in its reply, and the transcript draws the page there. Works on every harness, and the page survives the source being edited or deleted. The agent can check it with dray browser first.
  • Inline, with a full-screen button. The frame sizes itself to the page.
  • Sandboxed: <iframe sandbox="allow-scripts"> with an opaque origin, so a page can't reach the app, invoke, storage or Dray's DOM.
  • Network: a CSP allows https scripts, styles, fonts and images (chart libraries, Tailwind CDN) and blocks fetch/XHR and plain http.
  • Theme: Dray's colours are handed to the page as CSS variables, so a page can match light/dark.
  • Renders are deleted with the session.

Reference: t3code's version, pingdotgg/t3code#15968.

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions