JSPM

@weaveworm/core

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q62828F
  • License MIT

Framework-agnostic state machines and adapter contracts for AI-native UI patterns.

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

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