# @loomic/runtime

> **Start here.** This is the core of the Loomic framework.

The cross-platform agentic runtime that powers the run loop: signal intake → context assembly → AI planning → governor approval → tool execution → UI composition. Works in any JavaScript environment (React Native, Node, web).

## What it does

- **`createAgenticRuntime(config)`** — the single factory that wires everything together
- **`ToolRegistry`** — register typed tools the agent can call
- **`SignalQueue`** — async ingestion of signals (user actions, lifecycle events, etc.)
- **`UIComposer`** — translates agent plans into incremental UI operations
- **`Governor`** — enforces policies, budgets, and approval rules before execution
- **`Journal`** — structured event log of every run-loop cycle
- **`ProviderRouter`** — routes between cloud and local AI providers

## Install

```bash
npm install @loomic/runtime @loomic/types
```

## Minimal setup

```ts
import { createAgenticRuntime } from '@loomic/runtime';
import { createOpenAIProvider } from '@loomic/openai';

const runtime = createAgenticRuntime({
  provider: createOpenAIProvider({ apiKey: process.env.OPENAI_API_KEY }),
});

await runtime.start();
```

See [`@loomic/react-native`](../react-native/README.md) to connect the runtime to your React Native app.

