ArtifactsRuntimeCapability exposes ArtifactsApi under platform.artifacts. It manages durable deliverables generated by plugins and Agents, including HTML, Markdown, PDF, PowerPoint, images, files, Sites, and presentations.
Artifact content bytes live in Workspace Files. The Artifact service adds stable business identity, immutable version history, governed access links, lifecycle state, and access counters.
Data model
An Artifact flow has three layers:- Artifact container — stable plugin-owned identity defined by
pluginName,resourceType, andresourceId. - Artifact version — immutable content described by a
WorkspacePortableFileReference, MIME type, checksums, and metadata. - Artifact link — an open/share/download entrypoint with a version policy, access mode, expiration, and presentation policy.
html, markdown, pdf, pptx, image, file, site, and presentation.
Container and version methods
Container status is
active, archived, or deleted. Version status is active or deleted.
Link and share methods
Link status is
active, revoked, or expired. versionMode: 'latest' follows the current Artifact version; versionMode: 'version' pins an immutable version.
Access modes are:
owner_onlyworkspace_allorganization_allcustom_principalspublic_linksigned_preview
inline or attachment, can allow or disallow download, and can apply the strict or interactive safe-HTML profile.
Publish a generated file
Write bytes to Workspace Files first, then create or reuse the Artifact version and share:idempotencyKey that represents the same immutable content. ensureArtifactVersion() reports created or reused; ensureArtifactShare() reports created, reused, or replaced.
Security and lifecycle rules
- Do not store content bytes in Artifact metadata. Store them in Workspace Files and pass the portable reference.
- Require explicit user confirmation before requesting
public_link; setuserConfirmedPublicLinkin the access input. - Use
createSignedPreviewLink()only for short-lived previews. Store ashareKeyand useensureArtifactShare()for a durable share policy. - Pin a version for review, approval, audit, and reproducible delivery. Use
latestonly when readers should always see the current version. - Choose
strictHTML unless the deliverable needs the platform’s interactive HTML allowance. - Revoke links or share slots when access should end. Archiving the business object should also drive the plugin’s Artifact lifecycle policy.