Content
# AIRP
AIRP is an AI Agent client specializing in Role Play, with the current repository converging into a "two-box" structure:
- **engine**: Headless AIRP engine, crate `airp-core`. Responsible for RP data layer, context assembly, LLM calls, streaming output, agent loop skeleton, and HTTP/SSE API.
- **ui**: Tauri + Vue desktop client, crate `airp-ui`. Responsible for Blueprint/widget rendering, state patching, character list, character card import entry, and calling engine through Tauri bridge.
- **protocol**: Crate `airp-state-protocol`. Provides shared wire protocol types such as Envelope/Blueprint/Widget/capability between UI and engine.
The old `gateway` and `mcp-server` are no longer part of this workspace. They are retained as independent repositories/component sources: Gateway's transport, security, and MCP client capabilities are absorbed as needed; MCP-Server's data management plane is integrated into the engine following the `M_AGENT-2` route.
AIRP-State-Protocol is also treated as a component source: it must absorb mature assets like Blueprint, Widget, state patch, guard, virtual scrolling, and consent/sandbox, but does not inherit its product positioning prioritizing "universal Agent UI standards". See [docs/UI-PROTOCOL-DECISION.md](docs/UI-PROTOCOL-DECISION.md).
The four source projects are unified under the principle of "absorbing assets, not inheriting product north star", detailed in [docs/SOURCE-PROJECT-DECISIONS.md](docs/SOURCE-PROJECT-DECISIONS.md).
## Project Orientation
Code should be more open, transparent, easier to correct in the future, and more iterative. Specific meanings include: clear and open interfaces and extension points; observable state, decision-making, and errors; low coupling and replaceable module boundaries; versioned protocols and data structures with incremental evolution.
## Directory
```text
D:\AIRP-Dev/
├── Cargo.toml # workspace: engine, protocol, ui/src-tauri
├── Cargo.lock
├── engine/ # airp-core: RP engine / HTTP daemon / agent loop
├── protocol/ # airp-state-protocol: Rust wire types + validator CLI
├── ui/ # Tauri + Vue desktop UI
├── data/ # runtime/sample RP data; personal card/session dirs ignored
├── docs/ # design, development guide, risk register
└── AGENTS.md # local toolchain and audit instructions
```
## Current Status
- Phase 0 completed: UI `BusRelay` directly connects to engine `/v1/chat/completions`, allowing streaming chat responses.
- Phase 1 Task 1.1 implemented: UI imports character cards via Tauri dialog path-first, and engine reads and parses them.
- Phase 1 Task 1.2 completed: chat state changed to id-keyed `{messages, order}`, `BusRelay` no longer depends on `chat_lock`, and each `chat.send` creates user/assistant lines atomically with a single patch envelope.
- 2026-07-03 audit follow-up completed: Tauri build scripts, default settings, sandbox `postMessage` target, RFC6902 `test` pre-validation, and repository metadata have been synchronized and corrected.
- PR #13 completed Tauri engine sidecar packaging, producing Windows installers containing the engine; still requires GUI smoke testing and long-term UI experience polishing under real configurations.
- WebUI serves only as a temporary backend validation interface: using browser/HTTP to quickly stress test the engine, verify data layer and inference loop; not a long-term product route replacing Tauri/Vue desktop UI.
- Outstanding/pending items listed in [docs/DOC-AUDIT.md](docs/DOC-AUDIT.md) and [docs/DEV-GUIDE.md](docs/DEV-GUIDE.md).
## Local Environment
This Windows workspace requires Rust, Cargo, Node, and npm to be globally and cache-configured on `D:`, avoiding writes to `C:`.
PowerShell setup before running Rust commands:
```powershell
$env:RUSTUP_HOME = "D:\.rustup"
$env:CARGO_HOME = "D:\.cargo"
$env:PATH = "D:\.cargo\bin;D:\msys64\mingw64\bin;D:\nodejs;" + $env:PATH
```
Additional npm settings to cache on D:
```powershell
$env:npm_config_prefix = "D:\npm-global"
$env:npm_config_cache = "D:\npm-global\npm-cache"
```
## Verification
```powershell
# engine
cargo test -p airp-core
cargo test -p airp-core subagent_context_has_no_orchestrator_noise
# Tauri Rust shell
cargo test -p airp-ui
# frontend
cd ui
npm run typecheck
npm run test
```
This repository has a manual GitHub Actions build workflow but it's not a PR gate. Local testing and human review remain the primary checkpoints. `subagent_context_has_no_orchestrator_noise` is an invariant for clean prompts and must not be removed or weakened.
## Running
Start engine:
```powershell
cargo run -p airp-core -- daemon --port 8000
```
Start frontend development server:
```powershell
cd ui
npm run dev
```
Full Tauri desktop application:
```powershell
cd ui
npm run tauri dev
```
UI defaults to connecting to `http://127.0.0.1:8000`, overridable with `AIRP_ENGINE_URL`.
## Manual CI Build
Fork and run **Manual build** workflow in GitHub Actions. It executes Rust/UI tests, packages Tauri desktop, and uploads artifacts on a Windows runner:
- `airp-ui.exe`
- `AIRP UI_0.1.0_x64-setup.exe`
Current workflow focuses on Windows due to existing sidecar and bundle targets; macOS/Linux require additional sidecar naming and Tauri bundle targets.
## Key Documents
- [docs/DEV-GUIDE.md](docs/DEV-GUIDE.md): Current development handover and engineering discipline
- [docs/PLAN.md](docs/PLAN.md): Long-term design plan
- [docs/WEBUI-BACKEND-VALIDATION.md](docs/WEBUI-BACKEND-VALIDATION.md): Temporary WebUI backend validation route
- [docs/SOURCE-PROJECT-DECISIONS.md](docs/SOURCE-PROJECT-DECISIONS.md): Asset absorption/north star downgrade decisions for four source projects
- [docs/UI-PROTOCOL-DECISION.md](docs/UI-PROTOCOL-DECISION.md): UI protocol and widget adoption/downgrade decisions
- [docs/PARTS.md](docs/PARTS.md): Disassembly list of old warehouse capabilities
- [docs/MCP-SERVER-ABSORPTION.md](docs/MCP-SERVER-ABSORPTION.md): MCP-Server capability integration into engine route
- [docs/RISK-REGISTER.md](docs/RISK-REGISTER.md): Known risk registry
- [docs/DOC-AUDIT.md](docs/DOC-AUDIT.md): Post-document audit items to confirm
## Agent UI Test Surface and User Control
`ui/src/agent-test.ts` is a temporary development/test surface for automated UI validation. It exposes `window.__AIRP_AGENT_TEST__` only in dev/test and when explicitly enabled, allowing Codex browser control or Playwright test runners to drive UI and read state snapshots.
It's not a regular user feature or required for RP usage. It's disabled by default and should only be used for testing. To completely remove the agent control surface, delete this runtime module before manual build:
```powershell
Remove-Item ui\src\agent-test.ts
```
Then run **Manual build**. `ui/src/App.vue` loads this module only if the file exists; related unit tests won't block builds if the module is absent, so no other source code changes are needed; produced artifacts won't include this test surface.
## License
MIT OR Apache-2.0.
Connection Info
You Might Also Like
No recommendations available