Skip to content

ArtifactInput

Base classes

Name Children Inherits
dict
builtins
dict() -> new empty dictionary

⋔ Inheritance diagram

graph TD
  637298216["input_types.ArtifactInput"]
  2645524081["builtins.dict"]
  2751680898["builtins.object"]
  2645524081 --> 637298216
  2751680898 --> 2645524081

🛈 DocStrings

Bases: TypedDict

Input for the Artifact tool.

Source code in src/clawd_code_sdk/models/input_types.py
@_extra_allow
class ArtifactInput(TypedDict):
    """Input for the Artifact tool."""

    action: NotRequired[
        Literal[
            "publish",
            "list",
            "read",
            "list_types",
            "watch",
            "unwatch",
            "status",
            "upload_asset",
            "list_assets",
            "read_asset",
            "delete_asset",
            "pin",
            "unpin",
        ]
    ]
    """Omit (or 'publish') to publish file_path.

    'list' enumerates artifacts — the user's own by default, see `scope`; only `limit`, `scope` and
    `page_token` may accompany it. 'read' returns the content of the published artifact at `url`
    (raw HTML for the user's own; an isolated summary, steered by the optional `prompt`, for one
    someone else owns, though a page published in this session's own Slack channel can come back in
    full as untrusted content) — see **Calls**. 'watch', 'unwatch', and 'status' manage live-update
    subscriptions through which a session keeps track of new versions of an artifact published
    elsewhere, and those aren't available in this session: 'watch' only reports that — this session
    does not keep track of new versions — and 'status' lists this session's artifact watches (pass
    `url` to check one). 'upload_asset' adds one local media, PDF, font, or text file to an existing
    artifact — pass `url` and `file_path` (or `file_paths` for several in one call). 'list_assets'
    lists the files in an artifact's asset store (pass `url`; `after` continues a listing),
    'read_asset' saves one of them to a local file named by its id (pass `url` and `asset_id`,
    optionally `out_dir`), and 'delete_asset' permanently removes one (pass `url` and `asset_id`).
    See **Artifact assets** above. 'pin' adds the artifact at `url` to the user's pinned list in
    their claude.ai sidebar and 'unpin' removes it (nothing else may accompany either) — private to
    the user, reversible, and no change to who can see the artifact.
    """
    file_path: NotRequired[str]
    """Path to the .html file to render.

    Required to publish (the default action). Use a short, distinctive basename — it is the last-
    resort title when the HTML has no `<title>` and no `title` parameter is given. For
    'upload_asset', the local image, video, PDF, font, stylesheet (CSS), script (JS), or text (CSV,
    Markdown, JSON, plain text) file to upload.
    """
    favicon: NotRequired[str]
    """Deprecated; omit it. Use `icon`."""
    icon: NotRequired[str]
    """One short generic word for the artifact's browser-tab icon, such as chart, calendar, recipe,
    code or map — a plain signifier, not a product or brand name.

    Include it on every page's first publish; omit when republishing to keep the current icon, and
    pass a new one only when the user asks.
    """
    limit: NotRequired[int]
    """list only: maximum artifacts to return (default 25)."""
    page_token: NotRequired[str]
    """list only: the `next_page_token` a listing of the same scope gave, to list the artifacts
    after it.
    """
    scope: NotRequired[Literal["mine", "shared", "all"]]
    """list only: 'mine' (default) lists artifacts the user owns; 'shared' lists artifacts other
    people shared with the user; 'all' lists both.

    Rows are labeled (mine)/(shared) whenever scope is not 'mine'.
    """
    title: NotRequired[str]
    """Title for the artifact — the name shown in the browser tab and gallery.

    A short, distinctive noun-phrase name — not a generic label, a summary, or a name with an
    appended explainer. Prefer a `<title>` tag at the top of the HTML itself; this parameter fills
    in only when the file lacks one in the first 8KB of the file, and never overrides the tag. HTML
    publishes only — Markdown pages keep their filename identity. Content always comes from
    file_path — there is no inline content parameter.
    """
    description: NotRequired[str]
    """One-sentence subtitle shown on the gallery card. Say what the page is or does."""
    label: NotRequired[str]
    """A short name for this publish, max 60 chars (e.g.

    "Draft to legal"). Optional — a few words, not a description.
    """
    url: NotRequired[str]
    """An existing artifact's claude.ai link (claude.ai/artifact/{id} or
    claude.ai/code/artifact/{uuid}; a chat, project or session link is not one) to update in
    place.

    Pass whenever the user wants to update an artifact this conversation did not publish — "update
    my artifact", "keep the same link", a pasted artifact URL — and find the URL with action: "list"
    or ask the user for the link if you don't have it; without this, the publish creates a separate
    artifact instead of updating the existing one. Omit for new artifacts and same-conversation
    redeploys. Must be an artifact the user owns or was given edit access to (a read of it says
    "writer"). Before publishing to an artifact this conversation has neither read nor published,
    read it (action: "read") and build on what comes back; a publish sent without that read is
    refused. A refusal that hands you the live version counts as that read: merge your edits into
    that version and publish that; never resend the refused content unchanged. For 'read' and the
    other url-addressed actions: the artifact to act on.
    """
    prompt: NotRequired[str]
    """read only: what to extract from an artifact shared with the user — its content reaches you as
    an isolated summary answering this.

    Ignored for artifacts the user owns and for a page published in this session's own Slack channel
    (raw content is returned); optional.
    """
    force: NotRequired[bool]
    """Last-resort overwrite that DISCARDS the newer published version's page — another session's
    publish, or someone's save from a page that can publish new versions of itself.

    On a conflict the fix is to merge your changes onto the newer content (handed to you in the
    rejection, or re-read) and publish again — not force. Pass force:true only when the user has
    explicitly said to discard that specific version; never to get past a conflict on your own
    judgment. The tracked baseVersion is still sent; with force:true the server treats it as
    informational and overwrites, unless it refuses force over a version saved from inside the page.
    Omit (or false) so a concurrent write conflicts instead of being silently clobbered.
    """
    pin: NotRequired[bool]
    """publish only: true also pins the published artifact to the user's claude.ai sidebar once it
    is published — pass it only when the user asked for that; a pin that fails never fails the
    publish (the result says so).
    """
    out_dir: NotRequired[str]
    """read_asset: directory to save into — default: this artifact's folder in your scratchpad
    directory, where saving needs no approval and which you can Read from.

    read_asset names the file by the asset id plus the extension for its type; saving to any
    directory other than the default is an ordinary file save the user may be asked to approve.
    """
    file_paths: NotRequired[list[list[str] | str]]
    """upload_asset: several local image, video, PDF, font, stylesheet or script files in place of
    `file_path`, up to 25 in one call, all into the artifact that `url` names; one approval
    covers the call, and the result lists each file's id and url, or why it was not uploaded.

    A CSV, Markdown, JSON or plain-text file, a symbolic or hard link, and a file outside the
    working directory each go in a call of their own with `file_path`. @minItems 1 @maxItems 25
    """
    asset_id: NotRequired[str]
    """read_asset and delete_asset: the asset's id (32 hex characters), from a list_assets or
    upload_asset result.
    """
    after: NotRequired[str]
    """list_assets only: the `next` value from a previous list_assets result, to continue that
    listing.
    """
    capabilities: NotRequired[dict[str, Any]]
    """Runtime capabilities this page declares, as {name: config}.

    The control plane is the authority on valid names and config shapes. An empty object clears any
    previously stored declaration; omit the field on a redeploy to carry the stored declaration
    forward unchanged. Before declaring any capability, load the `artifact-capabilities` skill for
    the current contract and per-capability guidance.
    """
    contract: NotRequired[Literal["latest"] | str]  # noqa: PYI051
    """The artifact's runtime version.

    Omit to keep its current version (the default); 'latest' to upgrade; a specific version to pin
    or roll back. Changing it changes how the published page behaves — pass only when the author
    explicitly intends the change, never as a side effect of editing.
    """

action instance-attribute

action: NotRequired[
    Literal[
        "publish",
        "list",
        "read",
        "list_types",
        "watch",
        "unwatch",
        "status",
        "upload_asset",
        "list_assets",
        "read_asset",
        "delete_asset",
        "pin",
        "unpin",
    ]
]

Omit (or 'publish') to publish file_path.

'list' enumerates artifacts — the user's own by default, see scope; only limit, scope and page_token may accompany it. 'read' returns the content of the published artifact at url (raw HTML for the user's own; an isolated summary, steered by the optional prompt, for one someone else owns, though a page published in this session's own Slack channel can come back in full as untrusted content) — see Calls. 'watch', 'unwatch', and 'status' manage live-update subscriptions through which a session keeps track of new versions of an artifact published elsewhere, and those aren't available in this session: 'watch' only reports that — this session does not keep track of new versions — and 'status' lists this session's artifact watches (pass url to check one). 'upload_asset' adds one local media, PDF, font, or text file to an existing artifact — pass url and file_path (or file_paths for several in one call). 'list_assets' lists the files in an artifact's asset store (pass url; after continues a listing), 'read_asset' saves one of them to a local file named by its id (pass url and asset_id, optionally out_dir), and 'delete_asset' permanently removes one (pass url and asset_id). See Artifact assets above. 'pin' adds the artifact at url to the user's pinned list in their claude.ai sidebar and 'unpin' removes it (nothing else may accompany either) — private to the user, reversible, and no change to who can see the artifact.

after instance-attribute

after: NotRequired[str]

list_assets only: the next value from a previous list_assets result, to continue that listing.

asset_id instance-attribute

asset_id: NotRequired[str]

read_asset and delete_asset: the asset's id (32 hex characters), from a list_assets or upload_asset result.

capabilities instance-attribute

capabilities: NotRequired[dict[str, Any]]

Runtime capabilities this page declares, as {name: config}.

The control plane is the authority on valid names and config shapes. An empty object clears any previously stored declaration; omit the field on a redeploy to carry the stored declaration forward unchanged. Before declaring any capability, load the artifact-capabilities skill for the current contract and per-capability guidance.

contract instance-attribute

contract: NotRequired[Literal['latest'] | str]

The artifact's runtime version.

Omit to keep its current version (the default); 'latest' to upgrade; a specific version to pin or roll back. Changing it changes how the published page behaves — pass only when the author explicitly intends the change, never as a side effect of editing.

description instance-attribute

description: NotRequired[str]

One-sentence subtitle shown on the gallery card. Say what the page is or does.

favicon instance-attribute

favicon: NotRequired[str]

Deprecated; omit it. Use icon.

file_path instance-attribute

file_path: NotRequired[str]

Path to the .html file to render.

Required to publish (the default action). Use a short, distinctive basename — it is the last- resort title when the HTML has no <title> and no title parameter is given. For 'upload_asset', the local image, video, PDF, font, stylesheet (CSS), script (JS), or text (CSV, Markdown, JSON, plain text) file to upload.

file_paths instance-attribute

file_paths: NotRequired[list[list[str] | str]]

upload_asset: several local image, video, PDF, font, stylesheet or script files in place of file_path, up to 25 in one call, all into the artifact that url names; one approval covers the call, and the result lists each file's id and url, or why it was not uploaded.

A CSV, Markdown, JSON or plain-text file, a symbolic or hard link, and a file outside the working directory each go in a call of their own with file_path. @minItems 1 @maxItems 25

force instance-attribute

force: NotRequired[bool]

Last-resort overwrite that DISCARDS the newer published version's page — another session's publish, or someone's save from a page that can publish new versions of itself.

On a conflict the fix is to merge your changes onto the newer content (handed to you in the rejection, or re-read) and publish again — not force. Pass force:true only when the user has explicitly said to discard that specific version; never to get past a conflict on your own judgment. The tracked baseVersion is still sent; with force:true the server treats it as informational and overwrites, unless it refuses force over a version saved from inside the page. Omit (or false) so a concurrent write conflicts instead of being silently clobbered.

icon instance-attribute

icon: NotRequired[str]

One short generic word for the artifact's browser-tab icon, such as chart, calendar, recipe, code or map — a plain signifier, not a product or brand name.

Include it on every page's first publish; omit when republishing to keep the current icon, and pass a new one only when the user asks.

label instance-attribute

label: NotRequired[str]

A short name for this publish, max 60 chars (e.g.

"Draft to legal"). Optional — a few words, not a description.

limit instance-attribute

limit: NotRequired[int]

list only: maximum artifacts to return (default 25).

out_dir instance-attribute

out_dir: NotRequired[str]

read_asset: directory to save into — default: this artifact's folder in your scratchpad directory, where saving needs no approval and which you can Read from.

read_asset names the file by the asset id plus the extension for its type; saving to any directory other than the default is an ordinary file save the user may be asked to approve.

page_token instance-attribute

page_token: NotRequired[str]

list only: the next_page_token a listing of the same scope gave, to list the artifacts after it.

pin instance-attribute

pin: NotRequired[bool]

publish only: true also pins the published artifact to the user's claude.ai sidebar once it is published — pass it only when the user asked for that; a pin that fails never fails the publish (the result says so).

prompt instance-attribute

prompt: NotRequired[str]

read only: what to extract from an artifact shared with the user — its content reaches you as an isolated summary answering this.

Ignored for artifacts the user owns and for a page published in this session's own Slack channel (raw content is returned); optional.

scope instance-attribute

scope: NotRequired[Literal['mine', 'shared', 'all']]

list only: 'mine' (default) lists artifacts the user owns; 'shared' lists artifacts other people shared with the user; 'all' lists both.

Rows are labeled (mine)/(shared) whenever scope is not 'mine'.

title instance-attribute

title: NotRequired[str]

Title for the artifact — the name shown in the browser tab and gallery.

A short, distinctive noun-phrase name — not a generic label, a summary, or a name with an appended explainer. Prefer a <title> tag at the top of the HTML itself; this parameter fills in only when the file lacks one in the first 8KB of the file, and never overrides the tag. HTML publishes only — Markdown pages keep their filename identity. Content always comes from file_path — there is no inline content parameter.

url instance-attribute

url: NotRequired[str]

An existing artifact's claude.ai link (claude.ai/artifact/{id} or claude.ai/code/artifact/{uuid}; a chat, project or session link is not one) to update in place.

Pass whenever the user wants to update an artifact this conversation did not publish — "update my artifact", "keep the same link", a pasted artifact URL — and find the URL with action: "list" or ask the user for the link if you don't have it; without this, the publish creates a separate artifact instead of updating the existing one. Omit for new artifacts and same-conversation redeploys. Must be an artifact the user owns or was given edit access to (a read of it says "writer"). Before publishing to an artifact this conversation has neither read nor published, read it (action: "read") and build on what comes back; a publish sent without that read is refused. A refusal that hands you the live version counts as that read: merge your edits into that version and publish that; never resend the refused content unchanged. For 'read' and the other url-addressed actions: the artifact to act on.

:fa-brands-github: Show source on GitHub