内容
<p align="center">
<img src="https://raw.githubusercontent.com/aulinx/aulinx/main/assets/logo.svg" alt="Aulinx" width="200">
</p>
<p align="center"><strong>AI 原生 Linux. 从桌面到服务器.</strong></p>
<p align="center">其他 AI 代理监视您的屏幕. Aulinx 就是屏幕.</p>
<p align="center">
<a href="https://github.com/aulinx/aulinx/actions"><img src="https://github.com/aulinx/aulinx/workflows/CI/badge.svg" alt="CI"></a>
<a href="https://pypi.org/project/aulinx/"><img src="https://img.shields.io/pypi/v/aulinx" alt="PyPI"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="Python"></a>
<a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/rust-1.75+-orange.svg" alt="Rust"></a>
</p>
<p align="center">
<a href="#什么是Aulinx">什么是 Aulinx?</a> |
<a href="#工作原理">工作原理</a> |
<a href="#快速入门">快速入门</a> |
<a href="#合成器">合成器</a> |
<a href="#工具">工具</a> |
<a href="#路线图">路线图</a>
</p>
---
## 什么是 Aulinx?
Aulinx 是 Linux 的 AI 层,工作在三个级别:
```
┌─────────────────────────────────────────────────────────┐
│ 第三层: Aulinx 合成器 │
│ 自定义 Wayland 合成器,带有语义场景图 │
│ AI 看到了每个像素,因为它是渲染的 │
├─────────────────────────────────────────────────────────┤
│ 第二层: Aulinx 桌面 │
│ AT-SPI GUI 控制,适用于任何桌面 (GNOME/KDE/Sway) │
│ 点击按钮,读取菜单,输入文本 — 语义 │
├─────────────────────────────────────────────────────────┤
│ 第一层: Aulinx 核心 │
│ 文件,git,进程,网络,docker,系统,软件包 │
│ 无需屏幕 — 服务器,WSL,Docker,SSH │
└─────────────────────────────────────────────────────────┘
```
**187 种工具**,涵盖所有层级。一个 **Wayland 合成器** (Rust),带有 33 个 IPC 命令。**语义桌面理解** — 不是截图,不是 OCR。
```
aulinx > 为什么我的电脑现在很慢?
> process_list(sort_by=cpu)
┌─ 结果 (9ms) ────────────────────────────────────┐
│ firefox (42% CPU), code (18% CPU), slack (8% CPU) │
└────────────────────────────────────────────────────┘
Firefox 占用了 42% 的 CPU,共有 47 个标签页打开。
需要我关闭后台进程吗?
aulinx > 在 Firefox 中搜索 "wayland 合成器"
> atspi_set_text(app_name=firefox, element_name=Search, text=wayland 合成器)
┌─ 结果 (40ms) ──────────────────────────────────┐
│ "在 '搜索' 中设置文本: 'wayland 合成器'" │
└────────────────────────────────────────────────────┘
```
与其他使用截图的 AI 桌面代理不同,Aulinx 读取实际的 UI 结构 — **语义的,而不是基于像素的。无需 OCR.**
## 工作原理
Aulinx 有两种部署模式:
```
模式 1: 代理在任何桌面 模式 2: 完整的 AI 合成器
(目前可在 GNOME/KDE/Sway 上使用) (自定义 Wayland 合成器)
┌─────────────────────────────┐ ┌─────────────────────────────┐
│ CLI / Web UI / 语音 / MCP │ │ CLI / Web UI / 语音 / MCP │
├─────────────────────────────┤ ├─────────────────────────────┤
│ 代理(187 种工具 + LLM) │ │ 代理(187 种工具 + LLM) │
├─────────────────────────────┤ ├─────────────────────────────┤
│ aulinx-semanticd(守护进程) │ │ aulinx-compositor(Rust) │
│ AT-SPI → 场景图 → IPC │ │ Smithay + 场景图 │
├─────────────────────────────┤ │ + 输入注入 + IPC │
│ GNOME / KDE / Sway / Xfce │ │ Wayland 合成器是 AI 原生桌面 │
│ 现有桌面 │ │
└─────────────────────────────┘ └─────────────────────────────┘
```
**场景图** 是关键的抽象 — 桌面上每个窗口、UI 元素和操作的 structured 表示。两种模式都暴露相同的 IPC 协议:
```json
{"method": "scene.windows"} // 列出所有窗口及其元数据
{"method": "scene.find", "params": {"role": "button", "name": "保存"}}
{"method": "input.type", "params": {"text": "hello"}}
{"method": "input.key", "params": {"combo": "ctrl+s"}}
{"method": "window.focus", "params": {"window_id": 1}}
{"method": "window.close", "params": {"window_id": 1}}
```
## 快速入门
### 模式 1: 代理在现有桌面
> 适用于任何 Linux 桌面(GNOME,KDE,Sway,Xfce)。无需自定义合成器。
#### 要求
- 具有运行桌面的 Linux(Wayland 或 X11)
- Python 3.10+
- [Ollama](https://ollama.ai) 带有支持工具调用的模型
- `python3-pyatspi` 用于 GUI 控制(`apt install python3-pyatspi`)
#### 安装
```bash
git clone https://github.com/aulinx/aulinx.git
cd aulinx
pip install -e .
ollama pull qwen2.5:14b
```
#### 运行
```bash
# 交互模式
aulinx
# 一次性命令
aulinx -c "我有哪些窗口打开?"
# 使用特定模型
aulinx -m qwen2.5:14b
# 启动 Web UI
aulinx --serve
cd ui && npm install && npm run dev
# 打开 http://localhost:5173
# 恢复上一次对话
aulinx --resume
# 后台守护进程,带有全局热键(Super+Space)
aulinx --daemon
# 语音输入模式(需要 faster-whisper)
aulinx --voice
# MCP 服务器,用于 Claude Desktop
aulinx --mcp
# 检查系统依赖项
aulinx --doctor
```
### Docker(使用完整桌面进行测试)
```bash
docker compose -f docker/docker-compose.yml up
# 打开 http://localhost:6080/vnc.html(密码:aulinx)
# 容器内:aulinx -m qwen2.5:14b --base-url http://host.docker.internal:11434
```
### 模式 2: AI 合成器(Rust)
> 带有内置 AI 理解的自定义 Wayland 合成器。
#### 要求
- 具有 Wayland 支持的 Linux
- Rust 1.75+(推荐 nightly)
- 系统库:`libwayland-dev libinput-dev libudev-dev libgbm-dev libxkbcommon-dev libseat-dev`
#### 构建
```bash
cd compositor
cargo build -p aulinx-compositor -p aulinx-semanticd
```
#### 运行
```bash
# 在现有 Wayland 会话中(作为窗口打开)
WAYLAND_DISPLAY=wayland-0 ./target/debug/aulinx-compositor
# 在合成器中启动应用程序
WAYLAND_DISPLAY=wayland-1 foot # 终端
WAYLAND_DISPLAY=wayland-1 firefox # 浏览器
# 通过 IPC 连接 AI 代理
python3 test_client.py
```
## 合成器
Aulinx 合成器是一个 Wayland 合成器,基于 [Smithay](https://github.com/Smithay/smithay) 构建,内置语义场景图。每个窗口、UI 元素和布局更改都作为结构化数据通过 Unix 套接字 IPC 公开。
### 有何不同
| 特性 | 传统 WM | Aulinx 合成器 |
|---------|---------------|-------------------|
| 窗口信息 | EWMH/IPC 黑客 | 语义场景图 |
| UI 元素 | 无法访问 | 内置 AT-SPI 桥接 |
| AI 输入 | xdotool/ydotool | 原生键盘注入 |
| 事件 | 基于轮询 | 推送订阅 |
| 数据格式 | 混合协议 | 单一 JSON-RPC API |
### IPC 协议
```bash
# 连接到合成器的 IPC 套接字
# 默认:$XDG_RUNTIME_DIR/aulinx/semantic.sock
# 查询窗口
echo '{"jsonrpc":"2.0","id":1,"method":"scene.windows","params":{}}' | \
socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/aulinx/semantic.sock
# 响应:
# {"result": [{"id": 1, "app_id": "foot", "title": "foot",
# "geometry": {"x": 0, "y": 0, "width": 1280, "height": 800}}]}
# 将文本注入到聚焦窗口中
echo '{"jsonrpc":"2.0","id":2,"method":"input.type","params":{"text":"hello"}}' | ...
# 注入按键组合
echo '{"jsonrpc":"2.0","id":3,"method":"input.key","params":{"combo":"ctrl+s"}}' | ...
# 聚焦窗口
echo '{"jsonrpc":"2.0","id":4,"method":"window.focus","params":{"window_id":1}}' | ...
# 关闭窗口
echo '{"jsonrpc":"2.0","id":5,"method":"window.close","params":{"window_id":1}}' | ...
# 订阅窗口事件(打开/关闭/聚焦)
echo '{"jsonrpc":"2.0","id":6,"method":"scene.subscribe","params":{"filter":"*"}}' | ...
```
### 架构
```
aulinx-compositor(Rust,~7,900 LOC)
├── Smithay Wayland 合成器(winit + DRM 后端)
├── 语义桥(窗口 → 场景图同步)
├── IPC 服务器(Unix 套接字上的 JSON-RPC)
├── 输入注入(xkbcommon 键映射 → 键盘事件)
└── 平铺布局(等宽水平分割)
aulinx-semantic(Rust 库)
├── 场景图(窗口、元素、操作)
├── AT-SPI 源(读取 GNOME/KDE UI 树)
├── 直接源(合成器集成)
├── 差异引擎(在更改时推送事件)
└── 查询引擎(scene.windows, scene.find, 等)
```
## 工具
187 种工具,涵盖 43 个模块。下面精选了一些工具 — 运行 `aulinx --doctor` 或 `/tools` 获取完整列表:
| 类别 | 工具 | 数量 |
|----------|-------|-------|
| **窗口** | list, get_focused | 2 |
| **AT-SPI** | get_tree, find_elements, do_action, read_text, set_text, screenshot | 6 |
| **文件** | read, write, edit, move, trash, list, search | 7 |
| **文本** | count, grep, replace, head, tail | 5 |
| **Git** | status, log, diff, commit, branch, stash | 6 |
| **应用程序** | launch, list_running | 2 |
| **进程** | list, kill | 2 |
| **服务** | list, status, start, stop, restart | 5 |
| **网络** | status, wifi_list, wifi_connect, wifi_disconnect | 4 |
| **音频** | get_volume, set_volume, mute | 3 |
| **显示** | list, brightness | 2 |
| **电源** | status, profile, suspend, shutdown | 4 |
| **主题** | get, set_dark, wallpaper_set | 3 |
| **蓝牙** | status, scan, connect, disconnect, toggle | 5 |
| **输入** | key_combo, type_text | 2 |
| **会话** | who_am_i, uptime, disk_usage, env_get | 4 |
| **软件包** | search, install, list_installed | 3 |
| **XDG** | open, default_app_get, default_app_set, mime_type_of | 4 |
| **定时器** | set_timer, cancel_timer, list_timers | 3 |
| **剪贴板** | get, set | 2 |
| **通知** | send | 1 |
| **内存** | store, get, delete, list_namespaces | 4 |
| **D-Bus** | list_services, introspect, call | 3 |
| **OCR** | screenshot_ocr, image_ocr | 2 |
| **日期时间** | now, convert, calendar_show | 3 |
| **系统** | info, shell_exec | 2 |
| **工作流** | context_get, wait, audit_recent | 3 |
| **工作流程** | create, list, run, delete, toggle | 5 |
| **长期记忆** | remember, recall, recall_recent, forget, memory_count | 5 |
| **服务器** | journal_logs, docker_ps, docker_logs, port_list, firewall_status, cron_list, disk_health, system_logs_summary | 8 |
| **合成器** | summary, describe, ascii, suggest, status, config, ping, windows, focused, find_window, element_at, screenshot, annotated_screenshot, window_count, type, key, click, drag, scroll, spawn, focus, close, minimize, swap_master, set_ratio, set_gap, batch, diff, wait_for, run_and_type | 30 |
> 表格列出了每个类别的代表性工具;其余工具(剪贴板、存档、计算器、调度、系统管理、生产力、AI 等)总计 187 个。
### 权限层级
| 层级 | 行为 |
|------|----------|
| **读取** | 始终自动允许 |
| **低风险** | 自动允许,记录 |
| **修改** | 首次确认,然后自动 |
| **破坏性** | 始终确认 |
| **不可逆** | 始终确认,并带有额外警告 |
### 斜杠命令
```
/tools - 列出所有可用工具
/context - 显示当前桌面上下文
/history - 浏览过去的对话会话
/audit - 显示最近的工具调用和计时
/doctor - 检查系统依赖项
/clear - 清除对话历史
/help - 显示帮助
```
### 配置
在 `~/.config/aulinx/config.toml` 配置(首次运行时自动创建):
```toml
[llm]
model = "qwen2.5:14b"
base_url = "http://localhost:11434"
temperature = 0.3
[permissions]
# 覆盖工具权限层级
# shell_exec = "mutate" # 取消注释以降低确认要求
```
## 路线图
**已发布:**
- [x] **v0.1–v0.3**:92→103 种工具 + CLI + Web UI + 测试 + 审计 + 长期记忆 + 守护进程 + 语音 + MCP + 插件
- [x] **v0.4.0**:语义合成器 — 带有场景图、20 个 IPC 命令、输入注入、DRM/udev 后端的 Wayland 合成器
- [x] **v0.5.0**(当前):多提供商 LLM(Ollama/OpenAI/Anthropic/Gemini/Qwen)、ReAct 规划器、错误恢复、OSWorld 基准测试、混合感知、动作接地、动态工具选择、任务分解、沙盒执行、历史总结、从结果中学习、多代理委托、Python SDK、自主模式、门户优先屏幕捕获
**计划中:**
- [ ] **v1.0**:日常驱动的合成器、完整的 OSWorld-Verified 基准测试运行、跨平台存根、一键安装
参见 [CHANGELOG.md](CHANGELOG.md) 获取详细的版本历史记录。
## 名称
**Au** (金,元素 79)+ **linx** (Linux / lynx)。AI 驱动的 Linux 的黄金标准。
## 贡献
参见 [CONTRIBUTING.md](CONTRIBUTING.md) 获取开发设置、代码风格和如何添加新工具。
```bash
# Python 代理
pip install -e ".[dev]"
make test # 运行测试
make lint # 检查代码风格
# Rust 合成器
cd compositor
cargo build
cargo test
```
## 许可证
MIT — 参见 [LICENSE](LICENSE).
徽标的企鹅源自 [Tux](https://en.wikipedia.org/wiki/Tux_(mascot)),由 Larry Ewing 创建的 Linux 徽标。
MCP 配置
以下是此 MCP Server 的配置信息,可直接复制到 Cursor 或其他 MCP 客户端中使用。
mcp.json
连接信息
猜你喜欢
暂无推荐服务器