docslothregistry

versioned-content

Version-scoped content region

pure 1.0.0 Apache-2.0

Install

docsloth component add @docsloth/versioned-content@1.0.0 \
  --registry https://registry.docsloth.dev

Run it in a project that has a docsloth.config.json (docsloth init writes one). The docsloth CLI is not on npm yet: it runs from a checkout of the Docsloth engine, and the quickstart shows the setup. Every official component already renders in Docsloth sites; installing one vendors its props schema and specification and pins this exact version and digest.

What the CLI checks

docsloth component add reads this entry from index.json, recomputes the package digest from the manifest and the digest of every file, and writes nothing if one differs.

index.json, lines 961–978
961    {962      "name": "@docsloth/versioned-content",963      "version": "1.0.0",964      "kind": "block",965      "description": "Version-scoped content region",966      "license": "Apache-2.0",967      "engine": ">=1 <2",968      "publisher": "docsloth",969      "digest": "sha256:1e23f883a5debc8a859214dc206755936b9b9541f764618c5c1c7aea4ac88d9c",970      "blocks": [971        "versioned-content"972      ],973      "capabilities": [974        "render.html"975      ],976      "manifest_path": "packages/@docsloth/versioned-content/1.0.0/manifest.json",977      "files_base": "packages/@docsloth/versioned-content/1.0.0/files"978    },

Trust signals

Runtime trust class (catalog)
pure. Renders content only: no side effects, no network access and no permission prompts.
Install trust class
interactive, derived from the declared render.html. This is the class docsloth component add and docsloth component list report; it installs under the default policy, with no trust policy.
Package
@docsloth/versioned-content, version 1.0.0
Package digest
sha256:1e23f883a5debc8a859214dc206755936b9b9541f764618c5c1c7aea4ac88d9c
Files
2 files, each pinned by its own sha256 digest (listed under Package files)
Capabilities declared
render.html. A declaration, never a grant; every official package declares the same.
Publisher
docsloth, a publisher id rather than a verified identity
Licence
Apache-2.0
Engine range
>=1 <2
Index signature
Not signed. Digests prove the bytes match the index, not who published them.
Tools
none
Built from
packages/contracts/component-props/versioned-content.schema.json and packages/contracts/component-specs/versioned-content.md in docsloth-registry

Props

The props schema is packages/contracts/component-props/versioned-content.schema.json; props it does not list are rejected.

PropTypeRequiredNotes
versionstring | numberyes
labelstringnomaxLength: 200
contentstringnomaxLength: 20000

Required: version.

Example props generated from the schema
{
  "version": "2.0",
  "label": "Applies to v2",
  "content": "Use the v2 client."
}

Preview

Rendered by @docsloth/renderer from the example document block in the specification.

Document block
{
  "type": "versioned-content",
  "props": {
    "version": "2.0",
    "label": "Applies to v2",
    "content": "Use the v2 client."
  }
}

Version 2.0

Use the v2 client.

This is the renderer's real HTML with this registry's styles. Links and controls in the preview are inactive.

Rendered HTML
<section class="ds-versioned" data-component="versioned-content" data-version="2.0" aria-label="Applies to v2, version 2.0">
<p class="ds-version-label">Version 2.0</p>
<div class="ds-version-content">Use the v2 client.</div>
</section>

Specification

From packages/contracts/component-specs/versioned-content.md.

Contract

Packaged: this block ships as @docsloth/versioned-content@1.0.0 — an installable component package (kind block, capability render.html, Apache-2.0) whose production props schema is packages/contracts/component-props/versioned-content.schema.json and whose catalog entry is in packages/contracts/component-catalog.json. No protocol manifest fixture is published (manifest_fixture: null): the fixture models a packaged protocol runtime this block does not have.

Intended behavior

Scope content to a product or API version with an explicit visible label. The AI-native rule is stronger than for visual chrome: Markdown must never hide content, so the version is carried as a > Version: <version> blockquote followed by the full body regardless of which version a host page chooses to display.

Failure and fallback

A missing/empty version, or a body that has neither non-empty content nor child blocks, degrades the block to the labelled fallback. A non-string label is ignored (the version text remains). Content is never dropped: the fallback and the Markdown twin both keep the body.

Required acceptance cases

A version-scoped block must not silently disappear from the Markdown twin or the JSON view, and switching versions must not change content meaning. Also test empty data, loading, denied access, browser without JS, mobile 360px, keyboard navigation, dark mode and an explicit constrained agent tool call. The server independently authorizes capability requests; a package manifest cannot grant authority.

Data and maintenance

Data bindings resolve from a specific publication/release vector and permitted fact/evidence graph. Configuration edits create versioned component patches. Update invalidation uses dependency IDs, never indiscriminate whole-page regeneration. Human-owned props survive automatic updates unless invalidated with an explicit conflict. Missing optional resources leave an honest inert/readable fallback, not a broken page or fake success.

Cost and tools

Pure/local interaction must never invoke a model by accident. Any model, remote query or executor call must reserve approved budget before dispatch. Public visitors do not inherit owner resources. The component may call only named tools in its signed manifest with valid typed inputs. A cancelled job stops polling and closes resources. No component gets platform administration, raw credentials or an unlimited execution loop.

Native renderer block

packages/renderer renders a versioned-content block as a <section data-version="…"> with a visible Version <version> label and an accessible region name. props.label joins the accessible name (aria-label) rather than replacing the visible version text, so HTML and Markdown always expose the same version tokens. Markdown emits > Version: <version> followed by the content, and children stay visible after it.

Native block props

proptyperequiredbehaviour
versionstring | numberyesVisible version value, also written to data-version. Empty/non-finite values degrade to the fallback.
labelstringnoAccessible region name (e.g. "Applies to v2"); it does not replace the visible version.
contentstringnoBody text rendered as a paragraph; escaped in HTML, never hidden in Markdown.
childrenDocBlock[]noAdditional body blocks; the block needs content or at least one child.

Example

{
  "type": "versioned-content",
  "props": { "version": "2.0", "label": "Applies to v2", "content": "Use the v2 client." }
}

Package files

Served under packages/@docsloth/versioned-content/1.0.0/. The package digest covers manifest.json, which lists each file with its digest.

Filesha256 digestBytes
props.schema.jsonsha256:ada5de7457ac0622968da5bba8ad97ad7a4eee061832b97c646debc1c06dd93c765
spec.mdsha256:fb7dcf24a22bb6aa1daa2f57d91987f1ed283d0ffe763000e5b589d6e27229153664

Sources

SourceLocation
Markdown twinhttps://registry.docsloth.dev/docs/versioned-content.md
JSON metadatahttps://registry.docsloth.dev/api/v1/components/versioned-content.json
Specificationpackages/contracts/component-specs/versioned-content.md
Props schemapackages/contracts/component-props/versioned-content.schema.json
Catalogpackages/contracts/component-catalog.json