# Library

The library holds everything durable in a workspace: documents, uploaded files, links, memories, and published HTML apps. Skills live in their own Skills section (see the `authoring-skills` platform skill). Every item is an **artifact**, referenced everywhere else by an `aios://artifact/<id>` URI.

## Artifact types

- **document** — a markdown body you write or edit.
- **folder** — an organizational container for other artifacts.
- **link** — a pointer at an external URL, with a title and description.
- **html** — a complete, self-contained HTML app (see publishing, below).
- **file** — an uploaded or agent-saved file (PDF, image, spreadsheet, anything with real bytes).
- **memory** — durable facts and preferences an agent wrote (see the `knowledge-keeper` platform skill for how to use these well).

Creating, editing (append, replace the whole body, or find-and-replace one exact match), moving, and deleting documents/folders/links/HTML goes through one built-in tool. Memories and skills have their own lifecycles (`memory.remember`, and the `skills` and `files` tools) — that tool deliberately excludes them.

## `aios://artifact/<id>` pointers

Tool results and search hand you these URIs; pass them back into anything that accepts one (`view`, `skills.equip`, `memory.remember`'s `memory_uri`). To read what's behind a URI, `view` it with a `{ type: "artifact", id }` target.

## Moving files between a sandbox and the library

- **Save from sandbox to library** — give a sandbox path (and optionally a title); up to 100 files in one call.
- **Download a URL into the library** — give a public http(s) URL; same batching and limits.
- **Load a library file into your sandbox** — pull a library file artifact into your active sandbox as a real file, at a path you choose or the file's own name by default.

## Attachments on messages

An agent can attach library file artifacts directly to its own current reply — up to 10 per call — so they render as attachment pills in the chat, viewable the same way a human-sent attachment is. This is the in-conversation counterpart to sending a file over an external channel; attaching stays inside the chat.

## `library.get_shareable_file_url` and the `{{shareable_file_url:<id>:<ttl>}}` placeholder

Some destinations (an external API, a webhook body) need a real, fetchable URL to a file rather than an artifact id. `library.get_shareable_file_url` doesn't hand back a URL directly — it returns a placeholder token, `{{shareable_file_url:<artifact_id>:<ttl_minutes>}}`. Put that placeholder anywhere in a later `api_call`'s path, query, or body, and it's substituted with a real, time-boxed signed URL immediately before that request is sent — minted fresh, at the moment of use, never when the placeholder was created. Your ability to read the artifact is re-checked at substitution time, not assumed from when you asked for the placeholder. The real URL is never shown back to you, logged, or echoed into any response — even one that tries to quote it back.

## Publishing an app

Publish a complete, self-contained HTML file from your sandbox into the library as an artifact workspace members can open. It runs in a strictly sandboxed iframe — its own scripts execute, with no cookies or tokens. It can read workspace databases live through named, approved queries: see [live data](/docs/live-data). Publishing (and republishing an existing app in place) always needs approval — see [approvals](/docs/approvals).
