> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wednesdayai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Developer overview

> Extend WednesdayAI: plugins, hooks, channels, tools, providers, and the plugin SDK.

# Developer overview

WednesdayAI is built to be extended. The core is intentionally lean; new capabilities belong in plugins, hooks, and channel adapters rather than in core.

## Architecture

```text theme={"dark"}
Core gateway (src/)
├── Plugin SDK (src/plugin-sdk/)  ← stable, importable as `wednesdayai/plugin-sdk`
├── Plugins (loaded in-process)   ← tools, channels, providers, hooks, routes
└── Standalone hooks (HOOK.md)    ← side-effect automation on coarse events
```

**Key principle:** everything that can be a plugin, should be. Plugins and hooks interact with the gateway through the stable SDK contract; they do not import from core internals.

## What a plugin can register

A plugin's `register(api)` function can attach any of the following. Each has a dedicated `api.register*` (or `api.on`) method on the `OpenClawPluginApi`:

> [card] [Agent tools](https://docs.wednesdayai.dev/next/developers/agent-tools.md)
>
> Actions the AI can invoke. `api.registerTool(...)`.

> [card] [Lifecycle hooks](https://docs.wednesdayai.dev/next/developers/hooks.md)
>
> Typed runtime callbacks — transform LLM input/output, gate tools, shape context. `api.on(...)`.

> [card] [Context engine hooks](https://docs.wednesdayai.dev/next/developers/context-engine.md)
>
> Collect, project, and prune per-turn context. `api.on("context.collect", ...)` and friends.

> [card] [Channel adapters](https://docs.wednesdayai.dev/next/developers/channel-adapters.md)
>
> A new messaging platform. `api.registerChannel(...)`.

> [card] [Providers](https://docs.wednesdayai.dev/next/developers/concepts/model-providers.md)
>
> Model providers and their auth methods. `api.registerProvider(...)`.

> [card] [HTTP routes + gateway methods](https://docs.wednesdayai.dev/next/developers/sdk.md)
>
> Custom endpoints and RPC methods. `api.registerHttpRoute(...)` / `api.registerGatewayMethod(...)`.

> [card] [Commands](https://docs.wednesdayai.dev/next/developers/sdk.md)
>
> Chat commands that bypass the LLM, and CLI commands. `api.registerCommand(...)` / `api.registerCli(...)`.

> [card] [Services](https://docs.wednesdayai.dev/next/developers/sdk.md)
>
> Start/stop background services. `api.registerService(...)`.

> [card] [Storage + search providers](https://docs.wednesdayai.dev/next/developers/sdk.md)
>
> Session store backends and web-search providers. `api.registerSessionStoreAdapter(...)` / `api.registerWebSearchProvider(...)`.

Standalone [HOOK.md hooks](https://docs.wednesdayai.dev/next/developers/hooks.md#standalone-hooks-hookmd) are a separate, simpler system for side-effect automation on coarse events (`/new`, `/reset`, gateway start).

## `api.runtime`

Plugins reach vetted runtime capabilities through `api.runtime` instead of importing core internals. Highlights:

* `runtime.analysis` — focused plugin-owned LLM analysis ([guide](https://docs.wednesdayai.dev/next/developers/analysis-runtime.md))
* `runtime.signals` — Agent Signals for non-user stimuli ([guide](https://docs.wednesdayai.dev/next/developers/agent-signals.md))
* `runtime.state.resolveStateDir()` — resolve the plugin state directory
* `runtime.config`, `runtime.media`, `runtime.tts` / `runtime.stt`, `runtime.system`, `runtime.events`, `runtime.logging`

See the [Plugin SDK reference](https://docs.wednesdayai.dev/next/developers/sdk.md) for the full surface.

## Plugin discovery and precedence

The gateway scans for plugins in this order, and the **first match for a given id wins** (lower-precedence copies are ignored):

1. **Config paths** — `plugins.load.paths` (file or directory)
2. **Workspace extensions** — `<workspace>/.openclaw/extensions/`
3. **Global extensions** — `~/.openclaw/extensions/` (where managed installs live)
4. **Bundled extensions** — shipped with WednesdayAI, **disabled by default**

Bundled plugins must be enabled explicitly (`openclaw plugins enable <id>`). Plugins installed via `openclaw plugins install` land in the global extensions directory and are enabled by default.

> [!WARNING]
>
> Never add the bundled extension path to `plugins.load.paths`. The bundled copy has no
> runtime dependencies installed; only the managed copy under `~/.openclaw/extensions/` does.

## Tech stack and getting started

See [Coding style](https://docs.wednesdayai.dev/next/developers/contributing/coding-style.md) for the toolchain, and [Contributing](https://docs.wednesdayai.dev/next/developers/contributing.md) for setup and the PR workflow. To build a plugin, follow [Your first plugin](https://docs.wednesdayai.dev/next/developers/plugins/your-first-plugin.md).

## Design principles

1. **Lean core** — if a capability can live in a plugin, it should.
2. **Stable contracts** — plugins import from `wednesdayai/plugin-sdk` (alias `openclaw/plugin-sdk`), never core internals.
3. **No `workspace:*` in `dependencies`** — `npm install --omit=dev` in plugin dirs must work.
4. **No `any` in SDK exports** — the plugin SDK surface must be fully typed.

Fork-base pinning, package scopes, and naming conventions are covered in [Contributing](https://docs.wednesdayai.dev/next/developers/contributing.md).

## Contributing

See [Contributing](https://docs.wednesdayai.dev/next/developers/contributing.md) for the full workflow, PR checklist, and maintainer guidelines.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.