Skip to main content

canopy-artifacts

canopy's local artifact store (DESIGN §38): pages workers publish for people to read, and the comments people leave on them, served as MCP tools over stdio. Louvre, the hosted store, serves the same tools over MCP's streamable HTTP behind its token, so a skill written for one works against the other. This file is the contract both serve.

canopy-artifacts serve --store DIR [--namespace NS] [--agent NAME] [--origin KEY=VALUE ...] [--read-only]

The agent runtime's MCP config starts it, and it serves until stdin closes. It opens no socket. --store is a directory of the operator's that nobody else can read, made if it is not there: canopy's state directory in use, never the journal. A symlink, another owner's directory, or one open to group or others is refused (D053), with exit 2.

The options are the scope a Louvre token carries, set by whoever writes the MCP config, never by a tool's caller:

  • --namespace (default local): where artifacts are made, and the only namespace a call reads or writes.
  • --agent (default agent): every comment and resolution written here is the author agent:NAME, kind: agent, on behalf of operator. The local store's tools never write as a person: a comment through them is an agent's, as one written with a Louvre token is, so it is never authority (§38, D069).
  • --origin KEY=VALUE, repeated: pairs set on every artifact made here, over the caller's and the run's.
  • --read-only: every write is refused with read_only, as a read token's are.

canopy gives each run whose agent may publish its origin in CANOPY_ARTIFACT_ORIGIN, a JSON object of strings: canopy.workspace, canopy.ticket, and canopy.run. The server inherits it from the agent before any tool is called, and sets its pairs over the caller's, so canopy, not the worker, names the ticket an artifact is for. A value that is not such an object is refused with exit 2. A hosted store takes the same pairs as its MCP config passes them on; one that does not leaves the ticket the worker's word.

canopy-artifacts feed --store DIR [--namespace NS] [--origin KEY=VALUE ...] [--most N]

canopy's artifacts source (DESIGN §30), configured as [connect.sources.<name>] with kind = "artifacts". Given {"since": SEQ} on stdin, it prints the comment feed's changes after SEQ, a JSON object to a line, paging the feed until a page is not full or --most (default 1,000) are printed, then the last page's end line, which names where the next run reads from. --origin reads only the artifacts whose origin holds the pair. It never writes, as a read token cannot. A request it cannot read, or a store it cannot open, prints nothing and exits 2.

Records

Record Fields
Artifact id, title, namespace, origin (at most 16 string pairs; canopy sets canopy.workspace, canopy.ticket, canopy.run), latest_version, created_at
Version artifact_id, n, content_type (text/html, text/markdown), sha256, text (the rendered page's visible text, what anchors resolve against), created_at; immutable
Thread id, artifact_id, anchor (null for the whole artifact), anchored_version, state (open, resolved)
Comment id, thread_id, seq, author, body (at most 4,000 characters), created_at, edited_at, deleted_at, via (web, mcp)
Author id (stable, from the store's sign-in), display_name, kind (person, agent), on_behalf_of

An artifact's origin is set when it is made, and a new version keeps it; its title is its latest version's. A comment's seq is that of the latest change to it. Times are ISO 8601, in UTC.

Anchors

An anchor is a W3C Web Annotation TextQuoteSelector over a version's text: exact, and prefix and suffix of at most 32 characters, each with its whitespace collapsed, as a plan's comments are. HTML anchors are taken inside the sandboxed frame and checked against text, never markup.

  • A version's text is what a reader sees, each run of whitespace one space. For HTML it is read from the markup: tags are no text, a block's tags part words, and script, style, template, and title show nothing. The local store takes Markdown's text as its source until it renders Markdown.
  • An anchor is found by its words. Where they are more than once, the copy whose prefix and suffix match best wins, and the first of those that tie. Words found nowhere are passage_gone, and never move to other words.
  • comment_create anchors on the latest version, and refuses words not in it with anchor_not_found.

Tools

Tool Input Returns Writes
artifact_publish title, content_type, content, origin, artifact_id (to add a version) artifact_id, version, url yes
artifact_read artifact_id, version artifact, version, content, text no
artifact_list an origin filter, cursor artifacts, newest first, and next_cursor (null on the last page) no
thread_list artifact_id, state, version threads, each with its comments and its anchor_status (found, passage_gone; null with no anchor) no
comment_feed an origin filter, since, limit (at most 200) the changes after since, then an end line no
comment_reply thread_id, body comment_id, seq yes
comment_create artifact_id, anchor, body thread_id, comment_id, seq yes
thread_resolve thread_id, resolved state yes

A tool's result is one JSON object, or for comment_feed one JSON object to a line. The local store also lists each tool's result as its output schema, and returns it as structured content too, the same values, with comment_feed's as one object, {"changes": [...], "through": SEQ}; a client that reads text alone loses nothing. An origin filter matches an artifact whose origin holds every pair of it. A version omitted is the latest. The local store's url names a version, canopy-artifacts:ID/N, and opens nothing: it serves no page yet.

A refusal is a tool error whose text is {"code": ..., "message": ...}, with a code: not_found, out_of_scope (outside the token's namespace), too_long, anchor_not_found, read_only, or invalid (arguments the tool cannot take, such as a field it does not have, a blank body, or an origin given with artifact_id). No tool deletes an artifact or shares one.

The comment feed

  • The cursor. seq is one sequence across the store, given in commit order to every change (a comment created, edited, or deleted; a thread resolved or reopened), and only once the change is visible, so nothing appears below a cursor a reader has passed. Resolving a thread already resolved, or reopening one open, is no change. A deleted comment keeps its row with its body empty.
  • Each page holds at most limit changes, oldest first, and ends {"kind": "end", "through": <seq>}; a page without one is incomplete. through is the last change's seq when the page is full, and otherwise the store's newest, past changes the filter or the namespace left out; the next page reads from it.
  • A change carries its kind, seq, and at; the artifact's id and origin; the thread's id, anchor, anchored_version, state, and anchor_status in the artifact's latest version, as thread_list gives it; the comment's id, body, and times, null for a thread's change; and the author and via of the change. The comment and thread are as they are when read, so a deleted comment's body is empty in every change to it, and a passage reworded since reads passage_gone in each. Never the artifact's content.

Louvre's tokens

The operator mints canopy's token in Louvre, bound to their account and one namespace, with scopes read, publish, and comment; the comment source's is read only. It lives in an operator-only file the runtime's MCP config reads, never in canopy's config, journal, or logs (TRUST_MODEL T2). A comment written with it is kind: agent, and canopy adds its comment marks (D069) too.

Not in the local store yet

The web channel: people's comments (via: web, kind: person), editing and deleting a comment, and rendering a version's HTML, which the web UI will do from a second loopback origin in a sandboxed frame (TRUST_MODEL T8). The schema and the feed already hold edits and deletions.

Metadata

Release files for eddieland-canopy-artifacts 0.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eddieland-canopy-artifacts 0.14.0
File Size Uploaded Provenance Actions
eddieland_canopy_artifacts-0.14.0.tar.gz 26.3 kB Without provenance Details for eddieland_canopy_artifacts-0.14.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eddieland-canopy-artifacts 0.14.0
File Interpreter ABI Platform Actions
eddieland_canopy_artifacts-0.14.0-py3-none-any.whl Python 3 none any Details for eddieland_canopy_artifacts-0.14.0-py3-none-any.whl

Total release size: 54.6 kB

Release files / eddieland_canopy_artifacts-0.14.0.tar.gz

Download URL eddieland_canopy_artifacts-0.14.0.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0b44a1614b277b679a00447d70a49881810b8bf6d9529339c4656cf7292d9d13
BLAKE2b-256 checksum
How to use checksums
a9a3b07832afd95a5b6d6921d1296ac6a74df6329548c7213a224b0493224a88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / eddieland_canopy_artifacts-0.14.0-py3-none-any.whl

Download URL eddieland_canopy_artifacts-0.14.0-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ff24c3cc74164796a8a0f4fd624698d13b58f2b8e69f81bda04911ea601c585
BLAKE2b-256 checksum
How to use checksums
e5fc563e89c719211c16aa516b5f5e44c20e5879f9087f81eaaaba358c410318
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Security for eddieland-canopy-artifacts 0.14.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.14.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page