Building artifacts
This page is for whoever publishes an artifact:
usually an agent in a session, sometimes a person in a session terminal. Every
command here is nori-sessions artifacts. In a session it acts as the person
who asked for the current turn (see Who can publish).
Artifacts are enabled per organization. When they are on, agents get the
publishing-artifacts skill, which teaches them when and how to publish.
When agents publish
Section titled “When agents publish”Agents publish an artifact when you ask for a deliverable (a doc, report, PDF, deck, dashboard, or tool), when the output will be revisited or shared, when it holds state, or when a project asks for it. Quick views that answer a question in the conversation, such as a diff page or a scratch chart, stay on the session’s own preview URL and end with the session. When unsure, the agent offers to publish.
Who can publish
Section titled “Who can publish”| Action | Role on the artifact |
|---|---|
| Create an artifact | any member (you own it) |
| Publish a version, roll back, pull the source | editor |
| Share, transfer, delete | owner |
An agent acts as whoever sent the current message, even in a shared
conversation someone else started, such as a Slack thread. That person must be
an active org member, owns what the agent creates, and must be an editor to
publish a new version. A new artifact the agent creates this way is shared as
editor with the other org members who sent prompts in the conversation; this
happens once, at creation. Turns no person sent, such as automation runs and
Discord conversations, cannot create or publish artifacts (human_required).
A project coordinator acts as the project’s creator: it publishes when that person is an editor of the artifact, and owns the artifacts it creates. An agent cannot start another agent for an artifact, request access, or allow integrations; those need a person.
Publish a single file
Section titled “Publish a single file”A report, document, PDF, image, or one self-contained HTML page needs no build:
nori-sessions artifacts create --title "Weekly errors"nori-sessions artifacts publish <id> --file report.md --note "Week 47"--file takes HTML, Markdown, PDF, PNG, JPEG, GIF, WebP, AVIF, or SVG.
Markdown is rendered as a page, and raw HTML inside it shows as text. The
output includes the artifact’s dashboard link, /a/<id>.
Build with the kit
Section titled “Build with the kit”For an interactive tool with several files, a build step, or saved data, use the authoring kit:
nori-sessions artifacts kit --dir my-toolcd my-tool && npm installnpm run preview # serves the build under the production sandbox on port 4319nori-sessions artifacts publish <id> --dir my-tool/dist --note "First version"The kit is a Vite template with a starter page, the artifact SDK and its guide
(nori-kit/SDK.md), and a preview server that applies Nori’s own content
headers. A built directory needs index.html at its root and relative URLs
only.
Publishing from the kit also keeps the kit project (without node_modules,
dotfiles, or the build) as that version’s source, so a later agent can run
nori-sessions artifacts pull <id> and rebuild it. Editors can pull the
source, so never keep secrets in the kit directory. Pass --source <dir> to
keep a different directory, or --no-source to keep none.
What a page can do
Section titled “What a page can do”Every page runs in a sandbox with no network access. Everything it shows must
be in the bundle or come through the SDK. Nori adds the SDK to every HTML page
it serves, available as globalThis.nori:
| SDK | Does |
|---|---|
nori.open(url) |
open a link, after the viewer confirms |
nori.download(...) |
save a file, after the viewer confirms |
nori.theme |
follow the viewer’s light or dark theme |
nori.store |
read and write the artifact’s store, and subscribe to live changes |
nori.presence |
read who else is viewing |
nori.integrations |
call the viewer’s integrations (see below) |
nori.agent.ask |
ask an agent for a change, after the viewer confirms the text |
Cookies, localStorage, and network requests do not work.
The manifest
Section titled “The manifest”nori-artifact.json at the root of the build declares what the page needs.
Nori checks it at publish and refuses an invalid one (bundle_invalid).
{ "schema": 1, "title": "Team tracker", "store": { "collections": { "claims": { "read": "viewer", "create": "viewer", "update": "author", "delete": "author" }, "prefs": { "personal": true } } }, "integrations": [{ "name": "linear", "tools": ["list_issues"] }], "presets": ["github"], "agent": { "ask": true }}storeturns on the artifact’s store and sets its rules. Each collection’sread,create,update, anddeletetake a minimum role (viewer,commenter,editor,owner),author, ornone; an operation left out of a listed collection isnone.personal: truegives each viewer private items. Adefaultrule covers unlisted collections; without one, every viewer may read and write them. Rules bind everyone in the page, the owner included.integrationslists each remote MCP integration, by the name it is connected under, and the tools the page calls.presetslistsgithub(the GitHub REST API) orgoogle(Google APIs on*.googleapis.com).agent.ask: truelets the page’s own buttons send requests to an agent.
Saved data
Section titled “Saved data”Give an artifact a store only when people add or change data in the page:
nori-sessions artifacts create --store, artifacts update <id> --store, or a
store section in the manifest. Without one, store calls fail with
store_not_enabled.
The store holds collections of JSON items by key. Lists filter only by key
prefix, so put what you filter on first in the key. Agents and automations can
write the same data with nori-sessions artifacts store put|update|cas|delete,
and every open page sees the change live; artifacts store watch <id> prints
the change feed for a bounded time. Editor and owner writes from the terminal
are maintenance writes and pass the store rules.
Integrations
Section titled “Integrations”Calls run as the viewer, with the same connections their own sessions get.
Nori refuses anything the manifest does not list (capability_not_declared).
Each viewer allows the list once per artifact, and again when a new version
changes it. A viewer who has not connected an integration gets
credential_missing and a Connect link, so handle that and
consent_denied with a clear empty state. Integration calls are not
available in the kit preview, so check them in the published artifact.
When data must be the same for everyone, or stay current without anyone opening the page, an automation can write it into the store on a schedule.
Update a published artifact
Section titled “Update a published artifact”nori-sessions artifacts pull <id> --dir workcd work && npm install --ignore-scripts && npm run buildnori-sessions artifacts publish <id> --dir work/dist --note "What changed"When someone uses Ask agent or Send to agent, a new conversation starts as that person with the request and the artifact’s history. Publishing from that conversation records the new version as the answer, and History links the request to the conversation.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| Bundle size | 50 MB, up to 2,000 files, 20 MB per file |
| Source kept per version | 20 MB |
| Manifest size | 64 KB |
| Publishes | 60 per hour per artifact |
| Store item | 350 KB |
| Store size per artifact | 100 MB |
| Store calls per viewer per artifact | 20 reads and 10 writes a second |
| Integration calls per viewer per artifact | 10 a second, bursts up to 50 |
Commands
Section titled “Commands”| Command | What it does |
|---|---|
artifacts create --title <title> [--project <id>] [--store] |
create an empty private artifact |
artifacts update <id> [--title] [--description] [--project <id> | --no-project] [--store] |
change details |
artifacts publish <id> (--dir <dir> | --file <file>) --note <text> |
publish the next version |
artifacts versions <id> / artifacts rollback <id> --to <n> |
list versions, or serve an earlier one |
artifacts pull <id> [--at <n>] |
unpack a version’s source |
artifacts kit |
unpack the authoring kit |
artifacts store get|list|put|update|cas|delete <id> <collection> [<key>] |
read and write the store |
artifacts store watch <id> |
read the live change feed |
artifacts comments list|add|resolve|reopen <id> |
read and answer comments |
Prefix each with nori-sessions. Run nori-sessions artifacts --help for the
full list.
Troubleshooting
Section titled “Troubleshooting”“This artifact did not start.” The page did not connect to Nori within 10 seconds. Check the preview for Content-Security-Policy errors, and make sure every URL in the bundle is relative.
store_not_enabled. Turn on the store with artifacts update <id> --store
or a store section in the manifest.
human_required. Only people can start agents for an artifact, request
access, or allow integrations, and an agent can create or publish only during
a turn a person asked for, not from an automation run or Discord.
this page as markdown: /sessions/guides/building-artifacts.md· index for agents: /llms.txt