LEXWEAVEREFERENCE
LEXWEAVEREFERENCE
Engine homePackagesLexposer

Get started

ActivityPlan the next exposureTerminalQuickstart

Architecture

Packages

Specification

Quickstart

Run the complete compile and render loop locally in one minute.

Run the offline demo

The repository includes a mock provider, sample text, and glossary. No API key is required.

git clone https://github.com/lexweave-hq/lexweave
cd lexweave
npm install
npm run build
npm run demo

The command succeeds when it exits with code 0 and creates both of these files:

  • examples/demo/sample-book.lexweave.json — the portable reading program.
  • examples/demo/sample-book.html — the rendered adaptive reading view.

Open the HTML output and tap a highlighted target-language word. The word should reveal its source-language support without making a network request.

open examples/demo/sample-book.html

Verify that reader state changes the output

Render the same source at two mastery levels. The first command should include more source-language support; the second should render familiar targets with less support.

node packages/cli/dist/lexweave.cjs render examples/demo/sample-book.txt \
  --bundle examples/demo/sample-book.lexweave.json --format text --mastery 0

node packages/cli/dist/lexweave.cjs render examples/demo/sample-book.txt \
  --bundle examples/demo/sample-book.lexweave.json --format text --mastery 3

If the two outputs are identical, the mastery input did not affect the selected render path; inspect the bundle before integrating the renderer.

Compile your own text

node packages/cli/dist/lexweave.cjs compile book.txt \
  --source zh \
  --target en \
  -o book.lexweave.json

Configure an Anthropic or OpenAI provider for a real compile. The provider is used only to produce the bundle.

Render and inspect

node packages/cli/dist/lexweave.cjs render book.txt \
  --bundle book.lexweave.json \
  -o book.html

node packages/cli/dist/lexweave.cjs inspect book.lexweave.json

Rendering does not require the original model provider or a network connection.

Common failure boundaries

Failure objectObservable conditionCheck
Build outputpackages/cli/dist/lexweave.cjs is missingRun npm run build from the repository root.
Provider configurationA real compile reports a missing provider credentialUse --provider mock for the offline demo or configure the selected provider.
Source and bundleRender reports spans that do not match the sourceRender the exact source used to create the bundle.
Render resultThe HTML exists but has no replacementsRun inspect and verify that the bundle contains candidate assets and annotations.

Plan the next exposure

Turn reader-local signals into a deterministic replacement plan.

Compile and read boundary

Keep semantic analysis ahead of reading and deterministic decisions inside it.

Table of Contents

Run the offline demo
Verify that reader state changes the output
Compile your own text
Render and inspect
Common failure boundaries