Skip to content

Commit 0c8fb61

Browse files
committed
docs: rebrand user-facing naming to MathClaw
1 parent c4a8c28 commit 0c8fb61

13 files changed

Lines changed: 60 additions & 54 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ MATHCLAW_CONSOLE_WORKSPACE=../workspace python serve.py
181181

182182
这里的 `../workspace` 指向仓库根目录下的 `workspace/`,因为命令是在 `console/` 目录里执行的。
183183

184-
控制台默认会读取 `~/.mathclaw/config.json`如果你还在沿用旧配置,也会自动回退到 `~/.nanobot/config.json`。旧环境变量前缀 `NANOBOT_CONSOLE_*` 也仍然兼容
184+
控制台默认会读取 `~/.mathclaw/config.json`如果你还在沿用旧版目录结构或旧环境变量命名,控制台也会自动兼容
185185

186186
默认控制台地址:
187187

README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ MATHCLAW_CONSOLE_WORKSPACE=../workspace python serve.py
174174

175175
Here `../workspace` points to the repository-level `workspace/` directory, because the command runs inside `console/`.
176176

177-
The console reads `~/.mathclaw/config.json` by default; if you still keep the legacy layout, it automatically falls back to `~/.nanobot/config.json`. The old `NANOBOT_CONSOLE_*` environment variables remain supported as well.
177+
The console reads `~/.mathclaw/config.json` by default; if you still keep the legacy directory layout or legacy environment variable naming, the console remains backward compatible.
178178

179179
Default console address:
180180

bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nanobot-whatsapp-bridge",
33
"version": "0.1.0",
4-
"description": "WhatsApp bridge for nanobot using Baileys",
4+
"description": "WhatsApp bridge for MathClaw using Baileys",
55
"type": "module",
66
"main": "dist/index.js",
77
"scripts": {

bridge/src/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env node
22
/**
3-
* nanobot WhatsApp Bridge
3+
* MathClaw WhatsApp Bridge
44
*
5-
* This bridge connects WhatsApp Web to nanobot's Python backend
5+
* This bridge connects WhatsApp Web to MathClaw's Python backend
66
* via WebSocket. It handles authentication, message forwarding,
77
* and reconnection logic.
88
*
99
* Usage:
1010
* npm run build && npm start
1111
*
1212
* Or with custom settings:
13-
* BRIDGE_PORT=3001 AUTH_DIR=~/.nanobot/whatsapp npm start
13+
* BRIDGE_PORT=3001 AUTH_DIR=~/.mathclaw/whatsapp-auth npm start
1414
*/
1515

1616
// Polyfill crypto for Baileys in ESM
@@ -20,14 +20,20 @@ if (!globalThis.crypto) {
2020
}
2121

2222
import { BridgeServer } from './server.js';
23+
import { existsSync } from 'fs';
2324
import { homedir } from 'os';
2425
import { join } from 'path';
2526

2627
const PORT = parseInt(process.env.BRIDGE_PORT || '3001', 10);
27-
const AUTH_DIR = process.env.AUTH_DIR || join(homedir(), '.nanobot', 'whatsapp-auth');
28+
const DEFAULT_AUTH_DIR = (() => {
29+
const preferred = join(homedir(), '.mathclaw', 'whatsapp-auth');
30+
const legacy = join(homedir(), '.nanobot', 'whatsapp-auth');
31+
return existsSync(preferred) || !existsSync(legacy) ? preferred : legacy;
32+
})();
33+
const AUTH_DIR = process.env.AUTH_DIR || DEFAULT_AUTH_DIR;
2834
const TOKEN = process.env.BRIDGE_TOKEN || undefined;
2935

30-
console.log('🐈 nanobot WhatsApp Bridge');
36+
console.log('?? MathClaw WhatsApp Bridge');
3137
console.log('========================\n');
3238

3339
const server = new BridgeServer(PORT, AUTH_DIR, TOKEN);

bridge/src/whatsapp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class WhatsAppClient {
9090
version,
9191
logger,
9292
printQRInTerminal: false,
93-
browser: ['nanobot', 'cli', VERSION],
93+
browser: ['MathClaw', 'cli', VERSION],
9494
syncFullHistory: false,
9595
markOnlineOnConnect: false,
9696
});

console/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nanobot console shell
1+
# MathClaw console shell
22

33
Minimal static frontend shell copied in spirit from the MathClaw console layout.
44

core_agent_lines.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
# Count core agent lines (excluding channels/, cli/, providers/ adapters)
33
cd "$(dirname "$0")" || exit 1
44

5-
echo "nanobot core agent line count"
5+
echo "mathclaw core agent line count"
66
echo "================================"
77
echo ""
88

99
for dir in agent agent/tools bus config cron heartbeat session utils; do
10-
count=$(find "nanobot/$dir" -maxdepth 1 -name "*.py" -exec cat {} + | wc -l)
10+
count=$(find "mathclaw/$dir" -maxdepth 1 -name "*.py" -exec cat {} + | wc -l)
1111
printf " %-16s %5s lines\n" "$dir/" "$count"
1212
done
1313

14-
root=$(cat nanobot/__init__.py nanobot/__main__.py | wc -l)
14+
root=$(cat mathclaw/__init__.py nanobot/__init__.py nanobot/__main__.py | wc -l)
1515
printf " %-16s %5s lines\n" "(root)" "$root"
1616

1717
echo ""
18-
total=$(find nanobot -name "*.py" ! -path "*/channels/*" ! -path "*/cli/*" ! -path "*/command/*" ! -path "*/providers/*" ! -path "*/skills/*" | xargs cat | wc -l)
18+
total=$(find mathclaw -name "*.py" ! -path "*/channels/*" ! -path "*/cli/*" ! -path "*/command/*" ! -path "*/providers/*" ! -path "*/skills/*" | xargs cat | wc -l)
1919
echo " Core total: $total lines"
2020
echo ""
2121
echo " (excludes: channels/, cli/, command/, providers/, skills/)"

docs/CHANNEL_PLUGIN_GUIDE.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Channel Plugin Guide
22

3-
Build a custom nanobot channel in three steps: subclass, package, install.
3+
Build a custom MathClaw channel in three steps: subclass, package, install.
44

5-
> **Note:** We recommend developing channel plugins against a source checkout of nanobot (`pip install -e .`) rather than a PyPI release, so you always have access to the latest base-channel features and APIs.
5+
> **Note:** We recommend developing channel plugins against a source checkout of MathClaw (`pip install -e .`) rather than a PyPI release, so you always have access to the latest base-channel features and APIs.
66
77
## How It Works
88

9-
nanobot discovers channel plugins via Python [entry points](https://packaging.python.org/en/latest/specifications/entry-points/). When `nanobot gateway` starts, it scans:
9+
MathClaw discovers channel plugins via Python [entry points](https://packaging.python.org/en/latest/specifications/entry-points/). When `mathclaw gateway` starts, it scans:
1010

11-
1. Built-in channels in `nanobot/channels/`
12-
2. External packages registered under the `nanobot.channels` entry point group
11+
1. Built-in channels in `mathclaw/channels/`
12+
2. External packages registered under the `mathclaw.channels` entry point group
1313

1414
If a matching config section has `"enabled": true`, the channel is instantiated and started.
1515

@@ -20,8 +20,8 @@ We'll build a minimal webhook channel that receives messages via HTTP POST and s
2020
### Project Structure
2121

2222
```
23-
nanobot-channel-webhook/
24-
├── nanobot_channel_webhook/
23+
mathclaw-channel-webhook/
24+
├── mathclaw_channel_webhook/
2525
│ ├── __init__.py # re-export WebhookChannel
2626
│ └── channel.py # channel implementation
2727
└── pyproject.toml
@@ -30,22 +30,22 @@ nanobot-channel-webhook/
3030
### 1. Create Your Channel
3131

3232
```python
33-
# nanobot_channel_webhook/__init__.py
34-
from nanobot_channel_webhook.channel import WebhookChannel
33+
# mathclaw_channel_webhook/__init__.py
34+
from mathclaw_channel_webhook.channel import WebhookChannel
3535

3636
__all__ = ["WebhookChannel"]
3737
```
3838

3939
```python
40-
# nanobot_channel_webhook/channel.py
40+
# mathclaw_channel_webhook/channel.py
4141
import asyncio
4242
from typing import Any
4343

4444
from aiohttp import web
4545
from loguru import logger
4646

47-
from nanobot.channels.base import BaseChannel
48-
from nanobot.bus.events import OutboundMessage
47+
from mathclaw.channels.base import BaseChannel
48+
from mathclaw.bus.events import OutboundMessage
4949

5050

5151
class WebhookChannel(BaseChannel):
@@ -118,12 +118,12 @@ class WebhookChannel(BaseChannel):
118118
```toml
119119
# pyproject.toml
120120
[project]
121-
name = "nanobot-channel-webhook"
121+
name = "mathclaw-channel-webhook"
122122
version = "0.1.0"
123-
dependencies = ["nanobot", "aiohttp"]
123+
dependencies = ["mathclaw", "aiohttp"]
124124

125-
[project.entry-points."nanobot.channels"]
126-
webhook = "nanobot_channel_webhook:WebhookChannel"
125+
[project.entry-points."mathclaw.channels"]
126+
webhook = "mathclaw_channel_webhook:WebhookChannel"
127127

128128
[build-system]
129129
requires = ["setuptools"]
@@ -136,11 +136,11 @@ The key (`webhook`) becomes the config section name. The value points to your `B
136136

137137
```bash
138138
pip install -e .
139-
nanobot plugins list # verify "Webhook" shows as "plugin"
140-
nanobot onboard # auto-adds default config for detected plugins
139+
mathclaw plugins list # verify "Webhook" shows as "plugin"
140+
mathclaw onboard # auto-adds default config for detected plugins
141141
```
142142

143-
Edit `~/.nanobot/config.json`:
143+
Edit `~/.mathclaw/config.json`:
144144

145145
```json
146146
{
@@ -157,7 +157,7 @@ Edit `~/.nanobot/config.json`:
157157
### 4. Run & Test
158158

159159
```bash
160-
nanobot gateway
160+
mathclaw gateway
161161
```
162162

163163
In another terminal:
@@ -205,8 +205,8 @@ Channels that don't need interactive login (e.g. Telegram with bot token, Discor
205205

206206
Users trigger interactive login via:
207207
```bash
208-
nanobot channels login <channel_name>
209-
nanobot channels login <channel_name> --force # re-authenticate
208+
mathclaw channels login <channel_name>
209+
mathclaw channels login <channel_name> --force # re-authenticate
210210
```
211211

212212
### Provided by Base
@@ -215,7 +215,7 @@ nanobot channels login <channel_name> --force # re-authenticate
215215
|-------------------|-------------|
216216
| `_handle_message(sender_id, chat_id, content, media?, metadata?, session_key?)` | **Call this when you receive a message.** Checks `is_allowed()`, then publishes to the bus. Automatically sets `_wants_stream` if `supports_streaming` is true. |
217217
| `is_allowed(sender_id)` | Checks against `config["allowFrom"]`; `"*"` allows all, `[]` denies all. |
218-
| `default_config()` (classmethod) | Returns default config dict for `nanobot onboard`. Override to declare your fields. |
218+
| `default_config()` (classmethod) | Returns default config dict for `mathclaw onboard`. Override to declare your fields. |
219219
| `transcribe_audio(file_path)` | Transcribes audio via Groq Whisper (if configured). |
220220
| `supports_streaming` (property) | `True` when config has `"streaming": true` **and** subclass overrides `send_delta()`. |
221221
| `is_running` | Returns `self._running`. |
@@ -343,7 +343,7 @@ async def start(self) -> None:
343343

344344
`allowFrom` is handled automatically by `_handle_message()` — you don't need to check it yourself.
345345

346-
Override `default_config()` so `nanobot onboard` auto-populates `config.json`:
346+
Override `default_config()` so `mathclaw onboard` auto-populates `config.json`:
347347

348348
```python
349349
@classmethod
@@ -357,25 +357,25 @@ If not overridden, the base class returns `{"enabled": false}`.
357357

358358
| What | Format | Example |
359359
|------|--------|---------|
360-
| PyPI package | `nanobot-channel-{name}` | `nanobot-channel-webhook` |
360+
| PyPI package | `mathclaw-channel-{name}` | `mathclaw-channel-webhook` |
361361
| Entry point key | `{name}` | `webhook` |
362362
| Config section | `channels.{name}` | `channels.webhook` |
363-
| Python package | `nanobot_channel_{name}` | `nanobot_channel_webhook` |
363+
| Python package | `mathclaw_channel_{name}` | `mathclaw_channel_webhook` |
364364

365365
## Local Development
366366

367367
```bash
368-
git clone https://github.com/you/nanobot-channel-webhook
369-
cd nanobot-channel-webhook
368+
git clone https://github.com/you/mathclaw-channel-webhook
369+
cd mathclaw-channel-webhook
370370
pip install -e .
371-
nanobot plugins list # should show "Webhook" as "plugin"
372-
nanobot gateway # test end-to-end
371+
mathclaw plugins list # should show "Webhook" as "plugin"
372+
mathclaw gateway # test end-to-end
373373
```
374374

375375
## Verify
376376

377377
```bash
378-
$ nanobot plugins list
378+
$ mathclaw plugins list
379379

380380
Name Source Enabled
381381
telegram builtin yes

mathclaw/channels/dingtalk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
class NanobotDingTalkHandler(CallbackHandler):
4242
"""
4343
Standard DingTalk Stream SDK Callback Handler.
44-
Parses incoming messages and forwards them to the Nanobot channel.
44+
Parses incoming messages and forwards them to the MathClaw channel.
4545
"""
4646

4747
def __init__(self, channel: "DingTalkChannel"):
@@ -124,7 +124,7 @@ async def process(self, message: CallbackMessage):
124124

125125
logger.info("Received DingTalk message from {} ({}): {}", sender_name, sender_id, content)
126126

127-
# Forward to Nanobot via _on_message (non-blocking).
127+
# Forward to MathClaw via _on_message (non-blocking).
128128
# Store reference to prevent GC before task completes.
129129
task = asyncio.create_task(
130130
self.channel._on_message(
@@ -418,7 +418,7 @@ async def _send_markdown_text(self, token: str, chat_id: str, content: str) -> b
418418
token,
419419
chat_id,
420420
"sampleMarkdown",
421-
{"text": content, "title": "Nanobot Reply"},
421+
{"text": content, "title": "MathClaw Reply"},
422422
)
423423

424424
async def _send_media_ref(self, token: str, chat_id: str, media_ref: str) -> bool:
@@ -510,7 +510,7 @@ async def _on_message(
510510
conversation_type: str | None = None,
511511
conversation_id: str | None = None,
512512
) -> None:
513-
"""Handle incoming message (called by NanobotDingTalkHandler).
513+
"""Handle incoming message (called by the DingTalk handler).
514514
515515
Delegates to BaseChannel._handle_message() which enforces allow_from
516516
permission checks before publishing to the bus.

mathclaw/providers/openai_compat_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _extract_tc_extras(tc: Any) -> tuple[
9595

9696

9797
def _uses_openrouter_attribution(spec: "ProviderSpec | None", api_base: str | None) -> bool:
98-
"""Apply Nanobot attribution headers to OpenRouter requests by default."""
98+
"""Apply MathClaw attribution headers to OpenRouter requests by default."""
9999
if spec and spec.name == "openrouter":
100100
return True
101101
return bool(api_base and "openrouter" in api_base.lower())

0 commit comments

Comments
 (0)