Overview

gizzi-code gives every model built-in tools for Artifacts v2: one account-level store of typed artifacts (docs, decks, sheets, designs, dashboards, ops sheets, motion, pages, cards, diagrams, images and code files) that Desktop, ai.allternit.com, the phone layout, the m.allternit.com PWA, cloud computers and gizzi all read and write. The tools behave the same for every model and provider. Any CLI agent that runs inside a gizzi session gets them too, through the session’s allternit MCP bridge. artifact_create, artifact_update and artifact_read work without a signed-in account (see below). The others need the user’s Allternit account. The app renders every artifact_* tool part in the transcript as an artifact card that opens the artifact beside the chat (full screen on phones). Markdown artifacts saved as .mdx can include charts, built with the mdx_graph tool. See Charts in MDX artifacts.

When the model creates an artifact

The tool descriptions carry the rule from the contract:
  • Create an artifact when the content is substantial (about 15 lines or more), self-contained, and likely to be edited or reused, or when the user asked for one (“make this an artifact”, or an Output kind such as Docs or Slides was picked in the composer).
  • Otherwise answer inline. Short snippets and interactive cards stay in the chat.
  • Revise with artifact_update on the same id; don’t create a second artifact for a revision.
  • For a doc or sheet that already has content, prefer artifact_suggest, so the user reviews each change. Use artifact_update for new content, other kinds, when the user asked to apply the change directly, or when artifact_suggest says suggestions aren’t available.
  • For a design canvas that already exists, change frames with artifact_claim, artifact_suggest (one artboard change per frame) and artifact_release, never artifact_update (see Design canvases).

Suggesting edits

artifact_suggest leaves changes as pending suggestions on a doc or sheet. Nothing in the body changes until the user accepts. Input: The three change shapes:
  • text replaces the first occurrence of find in the plain text of block block (0-based). block: null, or leaving it out, searches the whole document block by block.
  • block replaces a block, inserts the markdown’s blocks after it, or deletes it (op: "delete" ignores markdown).
  • cell sets one cell. sheet is a sheet name or id; null, or leaving it out, means the first sheet. A value starting with = is a formula. gizzi upper-cases the address.
  • Each text, markdown or value field is at most 20,000 characters.
gizzi sends them to POST /api/v2/artifacts/:id/suggestions with:
  • agent_name: the running agent’s display name. That is the bot the turn runs as (the bot marker allternit-api puts on a bot turn), else the gizzi bot whose canonical chat the session is, else Gizzi.
  • session_id: the gizzi session id.
  • cost_usd: the session’s model cost so far, from gizzi’s usage ledger (SessionUsage.getSessionUsage). It is left out when the session has no metered cost, for example on a subscription CLI brain.
The result’s first line is {"id", "base_version", "suggestion_ids"}, and the text tells the model that the user reviews each suggestion. The app applies an accepted change and saves a version (see suggestions in the API). Suggestions need the cloud store. Without a signed-in account, or on a cloud that doesn’t have the route yet, artifact_suggest returns an error that tells the model to use artifact_update instead.

Design canvases

Several agents can restyle frames of one design canvas (application/vnd.allternit.design+json) at the same time. Each works on one artboard at a time, and the user keeps or undoes each frame change. The flow the tool descriptions and the bundled artifacts skill teach:
  1. artifact_read the design.
  2. artifact_claim the frame.
  3. artifact_suggest one artboard change for that frame, with a reason.
  4. artifact_release it.

artifact_claim and artifact_release

artifact_claim {artifact_id, artboard, task?} reads the design, checks that the artboard exists (an unknown id lists the design’s artboards), and sends an agent presence heartbeat whose anchor is {kind: "artboard", artboard} (see frame claims). task defaults to “Working on Hero”. The result’s first line is {artifact_id, artboard, name, version}.
  • When another agent session holds the frame, the cloud answers 409 artboard_claimed and the tool fails with a plain message: “Hero is being worked on by Oki; pick another frame or wait.”
  • A session holds one frame per artifact; claiming another frame releases the first.
  • While the session holds a frame, every artifact tool heartbeat on that design carries the frame as its anchor (a heartbeat without it would release the claim), and the frame’s task becomes the default task line.
  • gizzi re-sends the claim every 20 seconds, so it outlives long model turns, and lets it go after 3 minutes with no artifact tool call on the design.
  • Claims need the cloud store. Without a signed-in account artifact_claim returns an error; artifact_suggest still works, and the cloud still refuses a frame another agent holds.
artifact_release {artifact_id, artboard?} sends a heartbeat without an anchor, which clears the claim. With an artboard the session doesn’t hold, it releases nothing and says which frame the session holds. Releasing doesn’t touch a pending change.

The artboard change

The model sends {kind: "artboard", artboard, layers?, frame?, controls?, reason?}:
  • layers is the frame’s full new layer list, bottom first: every layer it keeps plus new ones. Kept layers keep their ids; new layers get ids no other artboard uses.
  • frame optionally patches the artboard (fill, w, h, props).
  • layers left out means the frame’s layers as they are now. That makes a controls-only change; a change with no layers, no frame patch and no controls is refused.
  • controls optionally adds up to 12 sliders (see Controls).
Before posting, gizzi:
  • reads the current canvas and fills before with the artboard’s layers (and the patched frame fields) as they are now;
  • fills in each layer’s artboard, refuses a layer on another artboard, a layer id used twice, or one used on another artboard, and refuses an artboard that doesn’t exist;
  • writes ids in tldraw’s form, shape:<id>, because the app adds that prefix to model-written ids when it loads a canvas;
  • when the design moved past base_version, reads that version: if this frame is unchanged, the change posts at the current version (other agents keeping their frames doesn’t make it stale); if this frame changed, nothing is posted and the model is told to read the design again;
  • refuses artboard changes for an HTML design (it has no artboards until the user converts it) and for other kinds.
The heartbeat’s anchor is the held frame when the change is for it, otherwise the first change’s artboard. A frame another agent holds comes back as the same plain error as artifact_claim. The result tells the model the canvas shows the change “In review” for the user to keep or undo.

Controls

When the user is tuning something on a frame (spacing, corner radius, colour, density, size), the tool description and the artifacts skill tell the model to offer 2 to 5 controls instead of guessing one value. The user moves them on the frame card and keeps the result.
Each control is {id, label, type, layer, prop, value} plus min, max and step for a range and options for a select; a color has only a value. layer is a layer id in the change, or null for the artboard; prop is a key in that layer’s props, x/y/w/h, or frame.<key> for an artboard prop. value is what the layers use now. Before posting, gizzi writes each layer as a shape: id and refuses a layer that isn’t in the change, a frame. prop with a layer, a range value outside min to max, a select value that isn’t an option, a duplicate id, more than 12 controls, or over 64 KB. The cloud checks the same rules (400 bad_controls; see controls).

Pinned questions

To ask the user about one frame, the model calls artifact_comment with body and artboard. gizzi reads the design and posts the comment with an element anchor under the agent’s name (agent_name), and the app shows it as a numbered pin on that frame:
  • With only artboard, the pin is the frame itself (shapeId equals artboard).
  • With anchor: {kind: "element", shapeId: "<layer id>"} as well, the pin sits on that layer. anchor alone works too: the frame comes from the layer. Other anchor fields are kept as given; label defaults to the layer or frame name.
  • An unknown artboard lists the design’s artboards; an unknown layer, or a layer on another frame, is a plain error. artboard on an artifact that isn’t a canvas is refused.
  • The anchor is at most 4 KB of JSON (the cloud’s limit for agent comments). A reply (parent_id) keeps its thread’s pin, so gizzi doesn’t resolve an anchor for it.

artifact_update on a design

artifact_update replaces the whole canvas, including frames other agents are changing. Its description says so, and it refuses a design that has pending artboard suggestions from other sessions, naming them (“Ash on Pricing”) and pointing at claim, suggest and release. Pending changes from the same session don’t block it.

Looking at an artifact: artifact_check

artifact_check lets the model see a page or design the way a viewer does, then fix what is wrong. It follows the study, build, check and refine loop of Craft Anything’s website rebuilds.
  1. gizzi reads the artifact (the same lookup as artifact_read) and sends its body to the app that shows the session. This uses the pane_render request with kind: "check", the bridge media_generate uses.
  2. The app renders the artifact at each width (default 390, 768 and 1440 px; window heights 844, 1024 and 900). It uses the same path as the artifact’s own preview: the Desktop preview host, or a sandboxed srcdoc frame with the preview CSP. The app’s light or dark theme variables are applied as in the preview.
  3. A probe script runs ahead of the page’s own scripts. It records script errors, failed loads and console.error lines. It waits for fonts, then 1.2 s more, and measures sideways scroll (scrollWidth beyond the window). It takes a JPEG of the first screen inside the frame with modern-screenshot.
  4. The app marks a width blank when the picture is one flat colour (brightness spread under 2.5).
  5. With a reference picture, the app compares the width whose shape is closest to the picture. Both are squeezed to a 48 px wide grid. The likeness is 1 minus the mean colour difference. Each of the 9 regions (top left to bottom right) that differs by more than 18% is listed as lighter, darker, or different.
reference takes "attachment" (the latest picture the user attached in the chat), an https link to a picture, or a picture file path on the gizzi machine (png, jpg, webp or gif, up to 8 MB). To match a live website, the model takes a pane_browser screenshot first and passes the saved file. The result carries one line per width (“390×844: scrolls sideways by 120px; error: …”), the pictures as attachments, and metadata with problems, similarity and per-width checks. The title reads like “Check: Landing — 2 problems · 84% like the reference”.

When the check says stop

gizzi counts checks per session and artifact. A check makes progress when the likeness rises by more than 1 point or there are fewer problems than the best so far. After 3 checks in a row without progress, or 8 checks of one artifact in a session, the result tells the model to stop refining. The model then tells the user what still doesn’t match and asks how to go on. A result with no problems and at least 90% likeness never gets the stop line.

Limits

  • Kinds: page (HTML; not a published link or Markdown) and design (canvas or HTML). Other kinds return a message that says they can’t be checked yet.
  • The session must be open in an Allternit app (Desktop, ai.allternit.com, the m.allternit.com PWA or the iPhone app). Otherwise the check times out after 120 s and says so. It is only offered to app, Desktop and CLI clients, like media_generate.
  • The iPhone app renders in an off-screen web view the way its own preview shows the page (CDN libraries and fonts load) and takes the picture with a native snapshot (Features/Media/NativePaneRenderer.swift). It draws HTML designs; a canvas design gets a message to check it from Desktop or the web.
  • During a check, a page’s runtime calls (window.allternit storage, AI and connectors) get no answer.
  • On ai.allternit.com and the PWA, the check uses a srcdoc frame, which inherits the app’s CSP. CDN libraries and web fonts load only on Desktop, which matches what the preview shows on each surface.
  • The likeness is advisory: it compares colour and layout, not text. The model is told to look at the pictures too.

Agent presence and the task input

artifact_read, artifact_update, artifact_suggest and artifact_comment each send a presence heartbeat for the agent (POST /api/v2/artifacts/:id/presence with agent: {name, session_id, task, anchor, cost_usd}), so the user sees the agent in the artifact header and its cursor at the spot it works on.
  • task is the tool’s optional task input, or a default: “Reading”, “Saving”, “Suggesting edits”, “Asking a question” (“Reading comments” when artifact_comment only reads).
  • anchor is the first change’s location for artifact_suggest ({kind: "block", block}, {kind: "cell", sheet, address} or {kind: "artboard", artboard}). The other tools send none, except the frame the session holds on a design (see Design canvases).
  • artifact_read and artifact_comment send state: "viewing"; artifact_update and artifact_suggest send editing.
Heartbeats are best effort. They run in the background with a 2.5 second timeout, and a failed heartbeat never fails or delays the tool. Set GIZZI_ARTIFACT_PRESENCE=0 to turn them off. artifact_comment also sends agent_name, so a comment the agent posts appears under the agent’s name, not the user’s. On a design it can pin the comment to a frame (see Pinned questions).

Kinds and body formats

body_format is optional on create. When it is left out, gizzi infers it from the kind and the body (for example, a doc whose body is JSON gets the doc JSON format, otherwise Markdown). The JSON and OpenUI formats (docs, sheets, slides, designs, dashboards, ops sheets, motion, cards) are described to the model by the app’s system prompt; the tool descriptions point the model there. gizzi refuses a format that doesn’t belong to the kind and a +json body that isn’t valid JSON, with an error the model can act on.

Plans

plan_exit saves the session’s plan as the one plan artifact of that chat (id art_plan_<session id>, Markdown body, capped at 100,000 characters). The title is the plan’s first heading, else the session title. A changed plan adds a version, an unchanged plan adds nothing. The plan question then carries plan.body, plan.title and plan.artifact ({id, version, persisted}). Offline, signed out, or against an older server that doesn’t know the kind, persisted is false and the question still carries the body. plan is not a kind the model can pass to artifact_create; only plan_exit writes it. artifact_list leaves plans out. In the terminal, gizzi artifact list --plans lists them. After you answer the plan question, Gizzi sets the plan’s status to approved, and to done when every todo is completed. See Plan status and Edit and approve an agent’s plan.

The mode registry

The modes the composer, the Artifacts page, the rail menu and the native apps list come from one file, contracts/agent-modes/agent-modes-v1.json in allternit-platform: Agent (auto), Agent Swarm, Docs, Sheets, Slides, PDF, Page, Dashboard, Ops sheet, Design, Image, Video, Motion, App, Build and Deep Research. Each entry has its label, icon, placeholder, how it launches, the artifact kind it files under and the surfaces where it shows. Its can list names the “It can” toggles (connectors, storage, ai) the kind can honour. node contracts/agent-modes/generate.mjs writes the Gizzi (agentModes.gen.ts), iOS (AgentModes.gen.swift) and Android (AgentModes.gen.kt) copies, and --check fails when one is stale. The web app keeps a byte copy of the JSON. Don’t edit the generated files by hand.

Where artifacts are saved

The tools write to the cloud store, /api/v2/artifacts on allternit-cloud-api (see the Artifacts v2 contract):
  • artifact_create → POST /api/v2/artifacts with an id gizzi mints itself (art_ + ULID), runtime_version: 2 and origin: {surface: "gizzi", client, session_id, message_id}.
  • artifact_update → POST /api/v2/artifacts/:id/versions with base_version, meta.note and author: "assistant".
  • artifact_read → GET /api/v2/artifacts/:id, or GET /api/v2/artifacts/:id/versions/:v for a specific version.
Credentials, tried in order (a rejected one falls through to the next): ALLTERNIT_API_KEY, ALLTERNIT_API_TOKEN, then the device token from gizzi login / gizzi pair. The token needs the compute scope. Base URL: ALLTERNIT_CLOUD_API_URL, else GIZZI_PLATFORM_API_URL, else https://api.allternit.com.

When gizzi can’t reach the store

If there is no credential, the cloud rejects every credential, the route isn’t there, the network fails, or the cloud returns a server error, the tools still succeed:
  • artifact_create returns the artifact with the id gizzi minted and persisted: false. The app saves it with an idempotent create under the same id, so a retry never makes a duplicate.
  • artifact_update returns version base_version + 1 with persisted: false and base_version, built on the artifact this session already has in its transcript.
  • artifact_read falls back to the newest copy in this session’s transcript.
Set GIZZI_ARTIFACTS_OFFLINE=1 to skip the cloud and always let the app persist. Set GIZZI_DISABLE_ARTIFACT_TOOLS=1 to hide all the artifact tools.

Tool results

Every result’s metadata carries artifact, which is everything the app needs to render and persist it:
The text the model sees starts with the same fields as a JSON line, without the body, so a CLI that drives the tools over the MCP bridge (where only text comes back) still has the id and version. artifact_create and artifact_update leave the body out of the model-visible text; artifact_read shows it, cut at 60,000 characters, while the metadata keeps all of it.

Errors the model sees

Source

  • Tools: cmd/gizzi-code/src/runtime/tools/builtins/artifact.ts (descriptions in artifact-create.txt, artifact-update.txt, artifact-suggest.txt, artifact-claim.txt, artifact-release.txt, artifact-read.txt)
  • artifact_check: cmd/gizzi-code/src/runtime/tools/builtins/artifact-check.ts (description in artifact-check.txt); the app side is src/lib/artifacts/check.ts in allternit-ai
  • Store client: cmd/gizzi-code/src/runtime/integrations/artifacts/index.ts
  • Tests: cmd/gizzi-code/test/tool/artifact.test.ts, cmd/gizzi-code/test/tool/artifact-check.test.ts