Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aipoch/open-science/llms.txt
Use this file to discover all available pages before exploring further.
window.api.artifacts manages the lifecycle of research outputs produced by the agent. Artifacts are files written during a run — plots, datasets, reports, generated scripts — stored under the project’s artifact directory. All file access goes through main-process path validation so the renderer never receives raw filesystem permissions.
Methods
finalizeRunArtifacts(request)
Moves pending run files from temporary run storage into the durable, message-owned artifact directory. Call this once the renderer has assigned a messageId to the response that produced the files. The method is idempotent for the same (claimId, messageId) pair — safe to retry on duplicate event delivery.
Promise<ArtifactFile[]> — the finalized list of artifact files.
openFile(request)
Opens an artifact file in the operating system’s default application for its MIME type (e.g., a PDF viewer for reports, the default image viewer for plots). The path is verified against the managed artifact store before shell.openPath is called — unmanaged paths are rejected.
Promise<void>
readPreview(request)
Reads up to maxBytes of an artifact file for inline display in the preview panel. Returns the content encoded as UTF-8 text or base64, a truncated flag, and the total file size so the UI can show a “file too large” notice without reading the whole file.
Promise<ArtifactPreviewResult>
The file content, encoded as specified by
encoding.The encoding used for
content.Total file size in bytes (not the length of
content).true when content is shorter than the full file because maxBytes was reached.Type reference
ArtifactFile
A renderer-safe description of one generated file. File bytes are never embedded — only metadata and a path are included.
| Field | Type | Description |
|---|---|---|
id | string | Unique artifact identifier |
projectName | string | Logical project bucket that owns this file |
sessionId | string | Session that produced this artifact |
messageId | string | undefined | Message the artifact is associated with (set after finalization) |
runId | string | undefined | Runtime run that wrote this file |
name | string | Display filename |
path | string | Absolute path on disk |
fileUrl | string | file:// URL for use in <img> and <iframe> tags |
mimeType | string | undefined | MIME type when known |
size | number | File size in bytes |
mtimeMs | number | Last-modified time (epoch milliseconds) |
ArtifactWriteEncoding
'utf8' for text-based artifacts (CSV, JSON, Markdown, Python scripts) and 'base64' for binary artifacts (PNG, PDF, Parquet).