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
| Field | Type | Description |
|---|---|---|
spec.altText | string | AltText 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.csp | object | CSP 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 | []string | ConnectDomains lists the origins the widget needs XHR/fetch/WebSocket access to (maps to the CSP connect-src directive). |
spec.csp.frameDomains | []string | FrameDomains lists the origins the widget may embed as a nested frame (maps to frame-src). |
spec.csp.resourceDomains | []string | ResourceDomains lists the origins the widget loads scripts, styles, and images from (maps to script-src/style-src/img-src). |
spec.filename | string | Filename is a delivery hint for the channel's file-upload primitive. Renderers may rewrite (e.g. force ".html" extension). |
spec.kind * | string | Kind names the renderer plug-in (matches the registered Kind() value). Pattern: lowercase, dash-separated. Example: "html". |
spec.payload | string (byte) | Payload is the raw input bytes. Exactly one of Payload (inline, ≤256 KiB) or PayloadRef (artifactstore) MUST be set. |
spec.payloadRef | string | PayloadRef is an artifactstore.Ref the controller fetches the input bytes from, for payloads too large to inline. Deleted with the CR. |
spec.timeoutSeconds | integer (int32) | TimeoutSeconds is the agent-requested per-render budget. Operator caps at 300; default 30. (default: 30; min 1; max 300) |
Status
Status is controller-owned (observed state).
| Field | Type | Description |
|---|---|---|
status.conditions | []object | Conditions 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 * | string | message is a human readable message indicating details about the transition. This may be an empty string. |
status.conditions[].observedGeneration | integer (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 * | string | reason 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 * | string | status of the condition, one of True, False, Unknown. (enum: True | False | Unknown) |
status.conditions[].type * | string | type of condition in CamelCase or in foo.example.com/CamelCase. |
status.failureMessage | string | FailureMessage is the human-readable detail behind FailureReason. |
status.failureReason | string | FailureReason is the machine-readable failure code. Set when phase=Failed. |
status.finishedAt | string (date-time) | FinishedAt is when rendering reached Ready or Failed. |
status.observedGeneration | integer (int64) | ObservedGeneration is the spec generation this status reflects. |
status.outputFilename | string | OutputFilename is the delivery filename, after any renderer rewrite. |
status.outputMIME | string | OutputMIME is the rendered artifact's content type. |
status.outputRef | string | OutputRef is the artifactstore ref the rendered bytes landed under. Set when phase=Ready. |
status.outputSize | integer (int64) | OutputSize is the rendered artifact's size in bytes. |
status.phase | string | Phase is the render lifecycle position. (enum: Pending | Rendering | Ready | Failed) |
status.startedAt | string (date-time) | StartedAt is when rendering began. |
status.warnings | []object | Warnings 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 * | string | action is "unwrapped", "removed", "stripped", or "kept". |
status.warnings[].count * | integer | count is the number of occurrences. |
status.warnings[].kind * | string | kind is "tag", "attr", or "css". |
status.warnings[].name * | string | name is the element, attribute, or CSS construct affected. |
status.warnings[].note | string | note is an optional actionable hint. |