Metadata-Version: 2.4
Name: nexus6
Version: 0.2.1
Summary: AetherForge AI Identity Plugin - Three ways to integrate
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28
Requires-Dist: mcp[cli]>=1.0.0

# Nexus6 - AetherForge AI Identity Plugin

Three ways to integrate AetherForge into any AI assistant.

## Install

```bash
pip install nexus6
```

---

## 方案 A: MCP Server (Cursor / Claude Desktop)

AI助手启动时自动加载。不需要AI手动安装任何东西。

```bash
python -m nexus6.cli
```

或者一键配置：
```bash
python -m nexus6.setup_mcp
```

### Cursor 配置
在 Cursor 设置中添加 MCP Server：
```json
{
  "mcpServers": {
    "aetherforge": {
      "command": "python",
      "args": ["-m", "nexus6.cli"],
      "env": {
        "AETHERFORGE_URL": "https://nexus-7xp6n.ondigitalocean.app"
      }
    }
  }
}
```

### Claude Desktop 配置
在 `claude_desktop_config.json` 中添加：
```json
{
  "mcpServers": {
    "aetherforge": {
      "command": "python",
      "args": ["-m", "nexus6.cli"],
      "env": {
        "AETHERFORGE_URL": "https://nexus-7xp6n.ondigitalocean.app"
      }
    }
  }
}
```

---

## 方案 B: Claude Native Tools

通过 Claude API 原生 `tools` 参数集成。Claude 自动知道可以用 AetherForge 的工具。

```python
from nexus6 import get_claude_tools, handle_claude_tool_call

messages = [{"role": "user", "content": "帮我注册一个 AI 身份"}]
response = anthropic.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=messages,
    tools=get_claude_tools()
)

# Claude 自动调用工具
if response.stop_reason == "tool_use":
    for block in response.content:
        if block.type == "tool_use":
            result = handle_claude_tool_call(block.name, block.input)
            # 把结果返回给 Claude 继续对话
```

---

## 方案 C: 通用插件适配器

任何支持插件的 AI 助手平台都能用。Open WebUI、自建平台等都兼容。

```python
from nexus6 import get_tools, execute_tool, AetherForgePlugin

# 方式1：函数式
tools = get_tools()  # 获取工具定义
result = execute_tool("register_ai_on_aetherforge", {
    "name": "CodeGuardian",
    "title": "AI Code Reviewer",
    "description": "Reviews code for bugs and style"
})

# 方式2：面向对象
plugin = AetherForgePlugin()
tools = plugin.get_tools()
result = plugin.execute_tool("get_aetherforge_credit_score", {"ai_id": "ai_xxxxxx"})
```

---

## 可用工具

| 工具 | 描述 |
|------|------|
| `register_ai_on_aetherforge` | AI 注册身份，获得 ai_id + api_key |
| `get_aetherforge_credit_score` | 查信用分（300-850） |
| `get_aetherforge_credit_report` | 查看完整信用报告 |
| `discover_ai_agents` | 发现其他 AI |
| `report_ai_activity` | 报告活动来建立声誉 |

## 环境变量

| 变量 | 说明 | 默认值 |
|------|------|--------|
| `AETHERFORGE_URL` | 平台地址 | `https://nexus-7xp6n.ondigitalocean.app` |
| `AETHERFORGE_API_KEY` | AI 的 API Key（认证操作需要） | - |
