API

API Reference

37 packages

Typed signatures for every public export across the aihu monorepo — one datasheet per package. Terracotta is the human/experience surface; graphite marks the agent-discoverable, governed surface.

packages
37
exports
841
tiers
6
output
datasheet

Runtime core

  • @aihu/arborReactive component tree (the rendering layer that consumes @aihu/signals).agent20
  • @aihu/contextAsync-context-friendly request/SSR context primitives for aihu.10
  • @aihu/css-engineaihu CSS engine — Tailwind v4 hard fork with WC-native scoped output.18
  • @aihu/primitivesaihu headless behavior primitives — WAI-ARIA APG patterns as vanilla custom elements, zero CSS.81
  • @aihu/runtimeSingle File Component (.aihu) runtime — registers custom elements compiled by @aihu/compiler.agent39
  • @aihu/signalsTiny reactive signals — the reactive primitive at the core of aihu.14
  • @aihu/storePinia-style global stores on aihu signals — defineStore, SSR-safe per-request instances, registry-based serialize/hydrate, plugins.agent29

App & routing

  • @aihu/adapter-cloudflareCloudflare Workers/Pages deployment adapter for @aihu/app.2
  • @aihu/adapter-vercelVercel deployment adapter for @aihu/app.2
  • @aihu/appTop-level app integration — wires runtime, router, and adapters into a Vite app.agent21
  • @aihu/routerFile-based router for the aihu meta-framework.agent44
  • @aihu/seoDEPRECATED compatibility shim over @aihu-plugin/agent-readiness (sitemap.xml, robots.txt, llms.txt, JSON-LD).8
  • @aihu/serverServer runtime + native renderer (napi-rs) for aihu SSR.agent110

Authoring & UI

  • @aihu/editorHand-rolled, dependency-free, GX-governed rich-text editor — JSON doc model, invertible transactions, markdown (web-v1 dialect) round-trip, contenteditable view with IME-safe read-back, agent read/suggest/write surface.agent65
  • @aihu/magnaaihu bridge for Magna GraphQL — dep-free fetch, resource composition, JWT relayagent11
  • @aihu/uiaihu styled-recipe registry — copy-paste .aihu recipes distributed as source via `aihu add` (no runtime bundle).5

Compiler & tooling

  • @aihu/cliAihu CLI (`aihu`, `create-aihu`) — scaffolding, dev, build commands.28
  • @aihu/compilerSingle File Component (.aihu) compiler — Rust binary + JS glue.agent40
  • @aihu/language-serverCross-editor Language Server (aihu-language-server) for .aihu Single File Components — diagnostics, hover, completion, and quick-fix code actions.25
  • @aihu/scrapingO(1) sliding-window rate limiter and bot-detection middleware for aihu agent services.agent6
  • @aihu/tscaihu-tsc — `tsc` for projects containing .aihu Single File Components. Type-checks .aihu sources as virtual TypeScript, with no .aihu.ts files written to disk.agent9
  • create-aihuScaffold a new Aihu app — the `npm create aihu` / `npx create-aihu` entry point. Thin delegator to @aihu/cli.0
  • vscode-aihuSyntax highlighting, snippets, and language support for .aihu Single File Components0

Agents & governance

  • @aihu/agentAgent primitives — the foundation of aihu agent-readiness.agent9
  • @aihu/agent-a2aA2A (Agent2Agent) protocol bindings (spec v1.0.1, JSON-RPC) for @aihu/agent-service.agent22
  • @aihu/agent-acpDEPRECATED — use @aihu/agent-a2a. BeeAI ACP merged into A2A under the Linux Foundation (Aug 2025); this adapter's invented ACP shape has no spec to conform to.agent4
  • @aihu/agent-serverServer-side glue: mount an aihu component server-side and let an MCP client drive it through the agent-service live-dispatch gate, forwarding approved invocations to a browser bridge.agent22
  • @aihu/agent-serviceService-side agent runtime (server-hosted agent endpoints).agent38
  • @aihu/aiThin adapters from AI SDK stream types to ReadableStream<string> for aihu $stream collections.agent4
  • @aihu/authJWT scope checks, ScopeSignal, and server middleware for aihu auth.agent25
  • @aihu/mcpMCP server for aihu — exposes aihu_example and aihu_validate tools via stdio transport.agent2

Plugins

  • @aihu-plugin/agent-readinessDiscovery + readiness manifest emitter so agents can introspect aihu apps.agent53
  • @aihu-plugin/dataReactive data loaders and resource primitives for aihu.10
  • @aihu-plugin/drizzleDrizzle ORM data adapter for aihu — typed createResource fetchers and defineLoader helpers (Postgres / SQLite / libSQL).7
  • @aihu-plugin/kindly-noteRuntime syntax highlighting + markdown rendering for aihu — <aihu-code>/<aihu-markdown> custom elements + signal-aware highlight()/renderMarkdown() helpers, powered by published @kindly-note/* packages with lazy loading.17
  • @aihu/pluginPlugin substrate shared by @aihu/server and the meta-framework — runtime hook surface.36
  • @aihu/plugin-demoCanonical proof-of-life for the @aihu/plugin API — exercises macros, middleware, and transforms.agent5