asset_add
Add a local image or font file to the CoDesign workspace, returning a workspace:// URI to embed the asset in designs.
Instructions
Add a local image or font file to the workspace so it can be used in a design. Copies the file bytes into the content-addressed asset store at assets/<sha>.<ext>. The bring-your-own arm of the asset family: asset_search finds an existing asset, asset_generate makes one, asset_add takes one off your disk — all three return a workspace:// uri to embed in edit. (To turn a design FILE into a new design, use import.)
Returns JSON: { uri, httpUrl, mimeType, kind, bytes, note? }. uri (a workspace:// URI) is the durable handle — embed it in a subsequent edit (image fill, or engine.asset.apply; for a font, as both setFont's uri and typeface.fonts[].uri), NEVER httpUrl and NEVER the original file:// path, so the design stays loadable after a restart or rewind. httpUrl is a fetch link for opening the asset now.
Files are classified by content (magic bytes) first, extension second: a misnamed file is stored under its actual type, and note explains any correction, rescue, or unverifiable content.
Make-available only: it never edits a scene and never creates a revision — do the placement in edit.
Source: { path } — an absolute path to a file the server can read. Local-only (this backend shares your disk); on a hosted server this arm is not offered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes |