tutorial
Verified multistep task tutorial
connected 1.0.0 Apache-2.0
Install
docsloth component add @docsloth/tutorial@1.0.0 \
--registry https://registry.docsloth.devRun 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 925–942925 {926 "name": "@docsloth/tutorial",927 "version": "1.0.0",928 "kind": "block",929 "description": "Verified multistep task tutorial",930 "license": "Apache-2.0",931 "engine": ">=1 <2",932 "publisher": "docsloth",933 "digest": "sha256:d8935cd3b71884c7b5704305752a4a464fcd43a97e37e08aaeefbed5bc7897d2",934 "blocks": [935 "tutorial"936 ],937 "capabilities": [938 "render.html"939 ],940 "manifest_path": "packages/@docsloth/tutorial/1.0.0/manifest.json",941 "files_base": "packages/@docsloth/tutorial/1.0.0/files"942 },Trust signals
- Runtime trust class (catalog)
- connected. Reaches a service only through a capability the host grants explicitly, and never receives raw credentials.
- Install trust class
- interactive, derived from the declared
render.html. This is the classdocsloth component addanddocsloth component listreport; it installs under the default policy, with no trust policy. - Package
@docsloth/tutorial, version1.0.0- Package digest
sha256:d8935cd3b71884c7b5704305752a4a464fcd43a97e37e08aaeefbed5bc7897d2- 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
next,verify,reset- Built from
packages/contracts/component-props/tutorial.schema.jsonandpackages/contracts/component-specs/tutorial.mdin docsloth-registry
Props
The props schema is packages/contracts/component-props/tutorial.schema.json; props it does not list are rejected.
| Prop | Type | Required | Notes |
|---|---|---|---|
title | string | no | maxLength: 160 |
workflow_id | string | yes | maxLength: 256 |
steps | array<object> | yes | |
resource | object | no | additionalProperties: false |
resource.resource_id | string | yes | format: uuid |
resource.operation | string | yes | maxLength: 160 |
resource.environment | "test" | "staging" | "production" | yes | |
persist_progress | boolean | yes |
Required: workflow_id, steps, persist_progress.
Example props generated from the schema
{
"title": "example-title",
"workflow_id": "example-workflow_id",
"steps": [
{
"id": "example-id",
"title": "example-title",
"block_ids": [
"00000000-0000-4000-8000-000000000000"
],
"check_id": "example-check_id",
"required": true
}
],
"resource": {
"resource_id": "00000000-0000-4000-8000-000000000000",
"operation": "example-operation",
"environment": "test"
},
"persist_progress": true
}Preview
Rendered by @docsloth/renderer from a document block whose props are generated from the schema, so the values are placeholders.
Document block
{
"type": "tutorial",
"props": {
"title": "example-title",
"workflow_id": "example-workflow_id",
"steps": [
{
"id": "example-id",
"title": "example-title",
"block_ids": [
"00000000-0000-4000-8000-000000000000"
],
"check_id": "example-check_id",
"required": true
}
],
"resource": {
"resource_id": "00000000-0000-4000-8000-000000000000",
"operation": "example-operation",
"environment": "test"
},
"persist_progress": true
}
}example-title
- example-title (required) — verified by
example-check_id
- Workflow
example-workflow_id- Progress
- Saved between visits
- Runs
example-operationin the test environment
Step checks and saved progress need the live documentation site.
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-block ds-tutorial" data-component="tutorial" aria-labelledby="b-title">
<h3 class="ds-block-title" id="b-title">example-title</h3>
<ol class="ds-list">
<li>
<strong>example-title</strong> (required) — verified by <code>example-check_id</code>
</li>
</ol>
<dl class="ds-facts">
<div>
<dt>Workflow</dt>
<dd>
<code>example-workflow_id</code>
</dd>
</div>
<div>
<dt>Progress</dt>
<dd>Saved between visits</dd>
</div>
<div>
<dt>Runs</dt>
<dd>
<code>example-operation</code> in the test environment</dd>
</div>
</dl>
<p class="ds-live-note" role="note">Step checks and saved progress need the live documentation site.</p>
</section>Specification
From packages/contracts/component-specs/tutorial.md.
Contract
Production props are normative in ../contracts/component-props/tutorial.schema.json. The corresponding component-fixtures manifest is only a minimal protocol fixture; use the production props schema when building the published package. The packaged artifact ships exactly its generated component-package.json manifest plus props.schema.json (the production props schema, copied byte-for-byte) and spec.md (this spec, copied byte-for-byte); it contains no executable payload, fallback implementation, Storybook, test suite, SSR harness or README. Rendering behavior and the acceptance cases below belong to the renderer and the repository tests, not to the package. Installation pins the package version and the digest of every shipped byte.
Intended behavior
Durable scoped progress tied to publication/version; completion depends on actual configured checks.
Failure and fallback
Blocked step permits viewing next content but not false completion.
Required acceptance cases
Failed check remains failed after refresh; reset scoped session only. 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.
React tutorial adapter
Production workflow_id, steps, persist_progress and optional resource select a host binding from ComponentContentProvider.tutorials, keyed with tutorialKey(workflow_id, resource) from @docsloth/official-components/host. Step block_ids resolve only through this provider's already authorized blocks. All instructions and native step links work without JavaScript. Browsing later steps after failure is allowed and never changes check results. There are at most 100 steps, 50 block references per step and 1,000 references overall; duplicate step IDs and invalid inputs refuse. Missing content is labelled rather than fabricated.
An available adapter names the exact release ID, workflow ID/version, actor session ID, persistence mode (durable or session), and a progress snapshot. Snapshots include the same scope, a revision and a map keyed by step ID. Each result names the configured check_id and has not_run, passed, failed or blocked status, plus an optional public-safe message. Only matching configured passed checks count toward required completion. Missing, restricted, loading, wrong-scope or malformed progress never becomes success. Persisted failures are rendered on reload; persist_progress: true requires the host's durable mode, rather than silently using local storage.
Optional verify and reset callbacks receive the exact scope, expected progress revision, persistence choice and abort signal; verify additionally receives the selected step/check IDs. They return typed ok progress, permission_required, unsupported or failed. HTTP success or stdout is not a check result. Reset affects the bound tutorial session only and must return cleared checks. Failed or invalid replies retain previous results. Replacing workflow/release/session or host progress invalidates outstanding results; stopping aborts the adapter and discards late responses. The UI does not claim an already-started remote mutation was rolled back.
The host must independently authorize capability and audience, validate published steps/checks, reserve approved execution budget, compare revisions and persist results/reset atomically. Its durable declaration is a contract, not evidence that browser storage is durable. This component does not dispatch arbitrary /v1/executions requests, store proofs in localStorage, create grants, or manufacture passed outcomes. Actual core/cloud transport, durable storage and constrained agent-tool wiring remain host integration work; the browser acceptance fixture exercises the adapter over HTTP with scoped server state across reloads, not a production database deployment.
Runtime contract
The protocol fixture packages/contracts/component-fixtures/tutorial.json records what this component may ask of a host when it runs. It is a contract, not a shipped runtime: the installable package contains no executable code.
| Field | Value |
|---|---|
| Network hosts | none |
| Production writes | not allowed |
| Longest run | 120 seconds |
| Recording | blocked |
| Fallback output | html, markdown, json |
| Tool | Effect | Needs confirmation |
|---|---|---|
next | reads only | no |
verify | execute | no |
reset | changes local state | no |
Package files
Served under packages/@docsloth/tutorial/1.0.0/. The package digest covers manifest.json, which lists each file with its digest.
| File | sha256 digest | Bytes |
|---|---|---|
props.schema.json | sha256:2e857b8f4b0df3ca5860b4b860a626cbb4897a9148b5b3bde2aedc5013aefeb0 | 1794 |
spec.md | sha256:c3edfecb0100dee57100125b785984e30c63c15b48c3204c99955f66a0933928 | 4948 |
Sources
| Source | Location |
|---|---|
| Markdown twin | https://registry.docsloth.dev/docs/tutorial.md |
| JSON metadata | https://registry.docsloth.dev/api/v1/components/tutorial.json |
| Specification | packages/contracts/component-specs/tutorial.md |
| Props schema | packages/contracts/component-props/tutorial.schema.json |
| Protocol fixture | packages/contracts/component-fixtures/tutorial.json |
| Catalog | packages/contracts/component-catalog.json |