Skip to content

JavaScript / @yai-xlai/xlai

The npm package @yai-xlai/xlai is a Vite-friendly TypeScript layer on top of the xlai-wasm crate. It ships a bundled library plus generated wasm bindings under pkg/ during build (not committed).

Scripts (from the repository root)

CommandPurpose
pnpm --filter @yai-xlai/xlai devRebuild wasm and start the Vite dev server
pnpm --filter @yai-xlai/xlai buildRebuild wasm and emit the library bundle
pnpm --filter @yai-xlai/xlai testRebuild wasm and run Vitest
pnpm --filter @yai-xlai/xlai test:e2ePlaywright smoke test against the demo page

Requirements

  • Node.js and pnpm
  • wasm-pack
  • Rust with wasm32-unknown-unknown

WASM surface

The WebAssembly package mirrors the Rust split between chat and agent APIs (chat, createChatSession, agent, createAgentSession) and supports the same streaming and context-compressor semantics as documented under Rust / Chat, agents, and tools.

Peer dependencies and export maps are defined in packages/xlai/package.json.

For package-local developer notes, see packages/xlai/README.md.

Released under the Apache License 2.0.