Skip to content

Latest commit

 

History

History
82 lines (69 loc) · 4.25 KB

File metadata and controls

82 lines (69 loc) · 4.25 KB

mtwRequest Documentation

mtwRequest is a Rust-based modular real-time framework that unifies WebSocket, HTTP/API, and AI agents into a single high-performance core with bindings for Node.js, Python, PHP, and Browser (WASM).


Table of Contents

Document Description
Getting Started Installation, quick start guides, project overview
Server Guide Server configuration, builder pattern, lifecycle, shutdown
Modules Guide Creating modules, the MtwModule trait, manifests, marketplace
Protocol Guide Wire format, message types, binary frames, streaming
Channels Guide Pub/sub channels, patterns, history, presence
AI Agents Guide AI providers, agents, tool calling, orchestration
Auth Guide JWT, API keys, OAuth2, auth middleware
Frontend Guide React, Svelte, Vue, Three.js client SDKs
HTTP Pipeline Guide Response pipeline, stages, retry, caching
Integrations Guide 20 API integrations, OAuth2, AI providers
Bindings Guide Node.js, Python, PHP, WASM bindings
API Reference Complete trait, struct, and enum reference by crate

Architecture Overview

+------------------------------------------------------------------+
|                    mtwRequest Core (Rust)                         |
|                                                                  |
|  +------------+  +------------+  +------------+  +-----------+   |
|  | Transport  |  |  Router    |  |  AI Engine |  |  Module   |   |
|  |  Layer     |  |            |  |            |  |  Runtime  |   |
|  |            |  | - paths    |  | - agents   |  |           |   |
|  | - ws       |  | - channels |  | - streams  |  | - load    |   |
|  | - http     |  | - rooms    |  | - tools    |  | - isolate |   |
|  | - sse      |  | - middleware| | - memory   |  | - sandbox |   |
|  | - quic     |  |            |  | - providers|  | - hooks   |   |
|  +------------+  +------------+  +------------+  +-----------+   |
|                                                                  |
|  +------------+  +------------+  +------------+  +-----------+   |
|  | Codec      |  |  State     |  |  Auth      |  |  Registry |   |
|  |            |  |  Store     |  |            |  |  Client   |   |
|  | - json     |  |            |  | - jwt      |  |           |   |
|  | - msgpack  |  | - memory   |  | - api keys |  | - resolve |   |
|  | - protobuf |  | - redis    |  | - oauth    |  | - install |   |
|  | - binary   |  | - custom   |  | - custom   |  | - update  |   |
|  +------------+  +------------+  +------------+  +-----------+   |
|                                                                  |
|  +------------------------------------------------------------+  |
|  |                Module API (Trait System)                    |  |
|  |  MtwModule - MtwTransport - MtwMiddleware - MtwAIProvider  |  |
|  |  MtwCodec - MtwAuth - MtwStateStore - MtwAgent             |  |
|  +------------------------------------------------------------+  |
+----------+----------+----------+----------+-------------------+
           |          |          |          |
    +------v---+ +----v----+ +--v-----+ +-v------+
    | NAPI-RS  | |  PyO3   | |PHP FFI | |  WASM  |
    | Node.js  | | Python  | |  PHP   | |Browser |
    +----------+ +---------+ +--------+ +--------+

Quick Links

  • Source code: crates/ (Rust), packages/ (TypeScript), bindings/ (FFI)
  • Examples: examples/demo_server.rs, examples/demo_client.rs
  • Configuration: mtw.toml (see Server Guide)
  • Module manifest: mtw-module.toml (see Modules Guide)

Current Status

Phase Status
Phase 1 -- Foundation (protocol, core, transport, router, codec) Complete
Phase 2 -- AI and Auth (providers, agents, JWT, state) Complete
Phase 3 -- Ecosystem (registry, SDK, test harness, marketplace) Complete
Phase 4 -- Bindings and Scale (Node.js, Python, PHP, WASM, frontend SDKs) In Progress