Skip to content

Artifact windows: download the standalone HTML #707

Description

@dotdevdotdev

Goal

Artifacts (~/.agentwire/artifacts/<slug>/, rendered in sandboxed iframe windows) are self-contained HTML, but the portal offers no way to save one out — no download affordance exists anywhere in static JS or routes today. Add a download button to the artifact window chrome that serves the file with Content-Disposition: attachment so any artifact can be pulled out as a standalone .html (shareable, archivable). Needed generally, and specifically by the council-minutes artifact (#next).

Scope

  • Route: authenticated download endpoint for an artifact's HTML (reuse the existing artifact-serving path + token model — mind the Isolate artifact iframes in an opaque origin (srcdoc) — portal token-theft hardening #645 hardening: keep the iframe srcdoc/sandbox model untouched, download is a separate top-level fetch via apiFetch/token, path-validated to the artifacts root).
  • UI: download icon in the artifact WinBox titlebar/controls (agentwire-desktop-ui skill conventions).
  • Multi-file artifact dirs: download the entry HTML (index/entry file); if assets exist alongside, either inline or zip — pick simplest honest option and document it.
  • Tests for the route (auth required, traversal rejected).

Verification

Open an artifact window → click download → get a working standalone .html; unauthenticated/traversal requests 401/400.

Built by dotdev.dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions