ArtifactRender

Group agentprimitives.authzed.com · Scope Namespaced · Short names arender

ArtifactRender is one request to turn agent-supplied bytes into a deliverable artifact -- an HTML page, an SVG, an image -- through a named renderer plug-in. The agent creates it; the rendered output is persisted to the artifactstore and referenced from status.

Namespaced. Reconciled by pkg/controllers/artifactrender, which drives the phase machine Pending -> Rendering -> Ready/Failed by dispatching to the renderer registered under spec.kind (pkg/channels/channelassets/registry).

Spec

FieldTypeDescription
spec.altTextstringAltText is the accessibility / channel-side preview text shown when the artifact can't render. Required for image-MIME renderer outputs; optional otherwise (the runner enforces in prepare_artifact).
spec.cspobjectCSP is a widget's declared _meta.ui.csp (mcp-ui / MCP Apps protocol), carried from the MCP tool result so the session-view page's per-widget CSP can honor domains the widget says it needs instead of falling back to the restrictive same-origin default. nil when the widget declared none, and always nil for non-mcpui renders. MCP-server-authored and therefore UNTRUSTED: every consumer sanitizes each domain before use.
spec.csp.connectDomains[]stringConnectDomains lists the origins the widget needs XHR/fetch/WebSocket access to (maps to the CSP connect-src directive).
spec.csp.frameDomains[]stringFrameDomains lists the origins the widget may embed as a nested frame (maps to frame-src).
spec.csp.resourceDomains[]stringResourceDomains lists the origins the widget loads scripts, styles, and images from (maps to script-src/style-src/img-src).
spec.filenamestringFilename is a delivery hint for the channel's file-upload primitive. Renderers may rewrite (e.g. force ".html" extension).
spec.kind *stringKind names the renderer plug-in (matches the registered Kind() value). Pattern: lowercase, dash-separated. Example: "html".
spec.payloadstring (byte)Payload is the raw input bytes. Exactly one of Payload (inline, ≤256 KiB) or PayloadRef (artifactstore) MUST be set.
spec.payloadRefstringPayloadRef is an artifactstore.Ref the controller fetches the input bytes from, for payloads too large to inline. Deleted with the CR.
spec.timeoutSecondsinteger (int32)TimeoutSeconds is the agent-requested per-render budget. Operator caps at 300; default 30. (default: 30; min 1; max 300)
* required

Status

Status is controller-owned (observed state).

FieldTypeDescription
status.conditions[]objectConditions carries Ready; see ArtifactRenderConditionReady.
status.conditions[].lastTransitionTime *string (date-time)lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
status.conditions[].message *stringmessage is a human readable message indicating details about the transition. This may be an empty string.
status.conditions[].observedGenerationinteger (int64)observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. (min 0)
status.conditions[].reason *stringreason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
status.conditions[].status *stringstatus of the condition, one of True, False, Unknown. (enum: True | False | Unknown)
status.conditions[].type *stringtype of condition in CamelCase or in foo.example.com/CamelCase.
status.failureMessagestringFailureMessage is the human-readable detail behind FailureReason.
status.failureReasonstringFailureReason is the machine-readable failure code. Set when phase=Failed.
status.finishedAtstring (date-time)FinishedAt is when rendering reached Ready or Failed.
status.observedGenerationinteger (int64)ObservedGeneration is the spec generation this status reflects.
status.outputFilenamestringOutputFilename is the delivery filename, after any renderer rewrite.
status.outputMIMEstringOutputMIME is the rendered artifact's content type.
status.outputRefstringOutputRef is the artifactstore ref the rendered bytes landed under. Set when phase=Ready.
status.outputSizeinteger (int64)OutputSize is the rendered artifact's size in bytes.
status.phasestringPhase is the render lifecycle position. (enum: Pending | Rendering | Ready | Failed)
status.startedAtstring (date-time)StartedAt is when rendering began.
status.warnings[]objectWarnings are the sanitizer's findings, surfaced so the agent can fix its source; a non-empty list does not mean the render failed.
status.warnings[].action *stringaction is "unwrapped", "removed", "stripped", or "kept".
status.warnings[].count *integercount is the number of occurrences.
status.warnings[].kind *stringkind is "tag", "attr", or "css".
status.warnings[].name *stringname is the element, attribute, or CSS construct affected.
status.warnings[].notestringnote is an optional actionable hint.
* required