Skip to content

Specification

WCI version 1.0 extends HTML with data-wci-* attributes and three optional site root files.

data-wci-* attributes

AttributeRequiredTypeDescription
data-wci-idrecommendedstringStable unique ID for dispatch and distillation
data-wci-rolerecommendedenumaction · form · display · nav · status · landmark
data-wci-descrecommendedstringLLM-oriented description of purpose and constraints
data-wci-actionfor interactive nodesenumclick · fill · select · check · upload · submit · navigate · focus · clear
data-wci-staterecommendedJSON objectObservable state snapshot (updated by Bridge)
data-wci-preconditionoptionalstringNatural-language guard; Bridge checks disabled
data-wci-requiredoptionalboolean"true" if required before form submit
data-wci-optionsoptionalJSON arrayChoices for select/radio groups
data-wci-emitoptionalstringCustom event name fired after successful action
data-wci-scopeoptionalstringParent landmark data-wci-id
data-wci-hiddenoptionalboolean"true" — exclude from distilled output
data-wci-priorityoptional1–5Sort key (1 = highest, e.g. primary CTA)

Roles

RoleUse for
landmarkBounded task zone (form, checkout, modal)
actionButtons, CTAs with side effects
formInputs, textarea, select
displayRead-only values (price, status text)
navLinks that change route/page
statusLoading, error, success indicators

State JSON

Keep state small and serializable. Example for an email field:

json
{"value": "", "valid": null, "touched": false}

The Bridge merges patches into data-wci-state after each action.

Distilled view (WciView)

JSON output shape (from @webcontextinterface/distiller):

json
{
  "wci_version": "1.0",
  "page_title": "Register",
  "scope": "registration-form",
  "scope_desc": "New user registration",
  "distilled_at": "2026-05-22T12:00:00.000Z",
  "node_count": 5,
  "site_context": { "name": "...", "purpose": "..." },
  "nodes": [ { "id": "email-input", "role": "form", "desc": "...", "state": {} } ]
}

Site root files

wci.txt

Robots.txt-style directives. Key fields:

KeyMeaning
Site-Name / Site-PurposeIdentity for agents
Allow-Scope / Deny-ScopeComma-separated scope IDs
Rate-Limit-Actions / Rate-Limit-DistilPer-minute limits
Auth-RequiredScopes needing authentication
Require-Human-ConfirmationScopes that must not auto-execute
Manifest / ContextURLs to wci.json and wci.md

wci.json

Structured manifest: site, capabilities, authentication, task_flows, scopes, denied_scopes, rate_limits. Types: SiteManifest, TaskFlow, ScopeDescriptor in @webcontextinterface/spec.

wci.md

Free-form Markdown injected into the LLM system prompt (policies, tone, domain glossary).

Discovery order

WciContextLoader resolves file URLs in this priority:

  1. HTTP response headers: X-WCI-Directives, X-WCI-Manifest, X-WCI-Context
  2. <meta name="wci:directives"> (and manifest/context) in the page
  3. /.well-known/wci/* (RFC 8615)
  4. /wci.txt, /wci.json, /wci.md

Events

EventTargetDetail
wci:state-changedocument{ nodeId, action, stateAfter }
Custom (data-wci-emit)target element{ nodeId, action, value, stateAfter }

Versioning

  • Attribute and JSON view version: 1.0 (wci_version field)
  • Packages use semver; spec breaking changes bump major