Package Exports
- @weaveworm/core
- @weaveworm/core/adapters/ai-sdk
- @weaveworm/core/adapters/anthropic
- @weaveworm/core/adapters/mock
- @weaveworm/core/adapters/raw-sse
Readme
@weaveworm/core
Framework-agnostic state machines and adapter contracts for AI-native UI patterns — the headless layer of weaveworm.
Zero runtime dependencies. Patterns speak only a normalized StreamEvent
vocabulary (text-delta, reasoning-delta, tool-call, source, error,
finish); adapters map any backend into them. That seam is what breaks SDK
lock-in: swap the adapter, keep the UI.
import { createStreamMachine } from "@weaveworm/core";
import { createRawSSEAdapter } from "@weaveworm/core/adapters/raw-sse";
const adapter = createRawSSEAdapter({ url: "/api/chat" });Adapters
| Import | Backend |
|---|---|
@weaveworm/core/adapters/raw-sse |
Plain Server-Sent Events, no SDK |
@weaveworm/core/adapters/ai-sdk |
Vercel AI SDK |
@weaveworm/core/adapters/anthropic |
@anthropic-ai/sdk |
@weaveworm/core/adapters/mock |
Backend-free, for demos and tests |
All adapters are structurally typed, so importing one never pulls its SDK into your bundle.
Bindings
- React:
@weaveworm/react
The logic lives here in portable TypeScript, so a binding for another framework is a bounded contribution.
Canon
Each pattern ships with codified best practices — the why, not just the code. See the weaveworm canon.
MIT © Shan Nadige