{{/* Download cards shown at the end of an agent reply (see internal/handlers/deliverables.go). Data: []deliverableView. A card with DownloadURL is a real link to a workspace file; one without is a code-snippet card whose button is handled by app.js. */}} {{ define "deliverables" }}
{{ range . }}
{{ .Name }}
{{ .TypeLabel }}{{ if .Detail }} · {{ .Detail }}{{ end }}
{{ if .DownloadURL }} Download {{ else }} {{ end }}
{{ end }}
{{ end }} {{/* The SSE "deliverable" payload — one produced file's download card, sent as soon as the tool call that created or changed it completes (see internal/handlers/chat.go's TurnEvent_ToolCall case and liveDeliverable), not only once the whole turn finishes. Same hx-swap-oob mechanism as message.html's "tool_call_oob": "beforebegin" on the assistant row puts the card above the still-streaming bubble, right after the tool card that produced it. Data: StreamID, Views ([]deliverableView — always length 1 here, but "deliverables" above already ranges over a slice, so it's reused as-is). */}} {{ define "deliverable_oob" }}
{{ template "deliverables" .Views }}
{{ end }}