diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index 4665ede..bf8b482 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -1,4 +1,4 @@ -name: TuyaOpenClaw Check Build +name: TClaw Check Build run-name: ${{ github.actor }} triggered build check on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8bf6e12..1c7cd7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: TuyaOpenClaw Release +name: TClaw Release run-name: Release ${{ github.ref_name }} on: @@ -10,11 +10,11 @@ permissions: contents: write env: - GITEE_REPO: tuya-open/TuyaOpenClaw + GITEE_REPO: tuya-open/TClaw jobs: sync-gitee: - if: github.repository == 'tuya/TuyaOpenClaw' + if: github.repository == 'tuya/TClaw' runs-on: ubuntu-latest steps: - name: Checkout GitHub code @@ -126,7 +126,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} gitee-release: - if: github.repository == 'tuya/TuyaOpenClaw' + if: github.repository == 'tuya/TClaw' runs-on: ubuntu-latest needs: - sync-gitee @@ -174,7 +174,7 @@ jobs: "tag_name": os.environ["TAG_NAME"], "target_commitish": os.environ["TARGET_COMMITISH"], "name": "Release " + os.environ["TAG_NAME"], - "body": "See release notes at https://github.com/tuya/TuyaOpenClaw/releases/tag/" + os.environ["TAG_NAME"], + "body": "See release notes at https://github.com/tuya/TClaw/releases/tag/" + os.environ["TAG_NAME"], "draft": False, "prerelease": False, }))' diff --git a/.github/workflows/sync-to-gitee.yml b/.github/workflows/sync-to-gitee.yml index 2a5151d..1ce7a1d 100644 --- a/.github/workflows/sync-to-gitee.yml +++ b/.github/workflows/sync-to-gitee.yml @@ -5,7 +5,7 @@ on: jobs: sync: - if: github.repository == 'tuya/TuyaOpenClaw' + if: github.repository == 'tuya/TClaw' runs-on: ubuntu-latest name: Git Repo Sync steps: @@ -14,6 +14,6 @@ jobs: fetch-depth: 0 - uses: tuya/TuyaOpen@master with: - target-url: 'https://gitee.com/tuya-open/TuyaOpenClaw.git' + target-url: 'https://gitee.com/tuya-open/TClaw.git' target-username: 'flyingcys' target-token: ${{ secrets.GITEE_TOKEN }} diff --git a/AGENTS.md b/AGENTS.md index ded2148..4e0f06e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,4 +1,4 @@ -# AGENTS.md — TuyaOpenClaw Project Guide +# AGENTS.md — TClaw Project Guide > This file provides project-level context for AI coding assistants and new contributors: > business logic, technical architecture, directory layout, and coding guidelines. @@ -7,7 +7,7 @@ ## 1. Business Logic -TuyaOpenClaw is a **hardware-oriented AI agent running on edge devices**. Its core value is enabling users to interact with IoT devices through natural language via IM channels (Telegram / Discord / Feishu). The on-device agent receives instructions, invokes local MCP tools to perform real actions, and replies through the same channel. +TClaw is a **hardware-oriented AI agent running on edge devices**. Its core value is enabling users to interact with IoT devices through natural language via IM channels (Telegram / Discord / Feishu). The on-device agent receives instructions, invokes local MCP tools to perform real actions, and replies through the same channel. **Typical user scenarios:** @@ -69,7 +69,7 @@ TuyaOpenClaw is a **hardware-oriented AI agent running on edge devices**. Its co 1. **Inbound**: IM channel (or WS/cron/ACP) builds an `im_msg_t` → `message_bus_push_inbound()` 2. **Agent consumes**: `agent_loop_task` blocks on `message_bus_pop_inbound()` 3. **Inner loop**: `context_build_system_prompt()` assembles system prompt + history → `ai_agent_send_text()` sends to cloud -4. **AI callback**: `tuyaopen_claw_chat.c`'s `__ai_chat_handle_event` receives stream events: +4. **AI callback**: `tclaw_chat.c`'s `__ai_chat_handle_event` receives stream events: - `STREAM_START/DATA/STOP`: accumulate text → record in history - `END`: calls `agent_loop_set_last_response()` + `agent_loop_notify_turn_done()` (posts semaphore) 5. **Tool execution**: Cloud AI triggers MCP tool call → `__on_tool_executed` hook records result → sets `s_turn.tool_called = true` @@ -90,7 +90,7 @@ TuyaOpenClaw is a **hardware-oriented AI agent running on edge devices**. Its co ### 2.4 Synchronization -- **Agent loop ↔ AI callback**: Binary semaphore `s_turn.sem` (`agent_loop_task` waits, `tuyaopen_claw_chat` posts) +- **Agent loop ↔ AI callback**: Binary semaphore `s_turn.sem` (`agent_loop_task` waits, `tclaw_chat` posts) - **Shared history**: `s_history_mutex` protects `s_history_json` (cJSON array, sliding window ≤ 10 entries) - **Tool state**: `s_turn.lock` protects `tool_called` / `tool_result` - **Message bus**: `tal_queue` is inherently thread-safe @@ -100,7 +100,7 @@ TuyaOpenClaw is a **hardware-oriented AI agent running on edge devices**. Its co ## 3. Directory Layout ``` -TuyaOpenClaw/ (git repo: tuya/TuyaOpenClaw, a.k.a. Ducky) +TClaw/ (git repo: tuya/TClaw, a.k.a. Ducky) ├── agent/ # Core agent loop and context builder │ ├── agent_loop.c/h # Outer + inner tool-iteration loop (semaphore sync) │ └── context_builder.c/h # System prompt assembly (rules, memory, skills, personality) @@ -141,7 +141,7 @@ TuyaOpenClaw/ (git repo: tuya/TuyaOpenClaw, a.k.a. Ducky) │ ├── src/ # Application glue layer │ ├── tuya_app_main.c # Entry point user_main(), initialization orchestration -│ ├── tuyaopen_claw_chat.c # AI stream event handling, semaphore bridge to agent_loop +│ ├── tclaw_chat.c # AI stream event handling, semaphore bridge to agent_loop │ ├── app_im.c # IM init, outbound dispatch, channel switching │ ├── cli_cmd.c # Extended CLI commands │ └── reset_netcfg.c # Network config reset logic @@ -150,7 +150,7 @@ TuyaOpenClaw/ (git repo: tuya/TuyaOpenClaw, a.k.a. Ducky) │ ├── tuya_app_config.h # Product ID, channel tokens, gateway config defaults │ ├── tuya_app_config_secrets.h(.example) # Sensitive credentials (gitignored) │ ├── app_im.h # IM application interface -│ └── tuyaopen_claw_chat.h # Chat module interface +│ └── tclaw_chat.h # Chat module interface │ ├── ai_components/ # TuyaOpen AI component adapters (sub-CMake) ├── config/ # Board-level Kconfig snapshots @@ -176,7 +176,7 @@ user_main() ├── tuya_iot_init() // Tuya IoT client ├── netmgr_init() // Network manager ├── board_register_hardware() - ├── tuyaopen_claw_chat_init() // Register AI stream event callback + ├── tclaw_chat_init() // Register AI stream event callback ├── app_im_init() // Subscribe to MQTT connected event (deferred IM init) ├── ws_server_start() // Start WebSocket server ├── tool_registry_init() // Subscribe to MQTT connected → one-shot MCP tool chain init diff --git a/CLAUDE.md b/CLAUDE.md index 3f29ab4..8d90718 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,11 +4,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project Overview -TuyaOpenClaw is a hardware-oriented AI agent built on the TuyaOpen C SDK. It runs a Claw-style agent loop on edge devices (Tuya T5AI, ESP32, Raspberry Pi, Linux) that communicates with users via IM channels (Telegram, Discord, Feishu) and executes MCP-style tools on the device. +TClaw is a hardware-oriented AI agent built on the TuyaOpen C SDK. It runs a Claw-style agent loop on edge devices (Tuya T5AI, ESP32, Raspberry Pi, Linux) that communicates with users via IM channels (Telegram, Discord, Feishu) and executes MCP-style tools on the device. ## Build Commands -TuyaOpenClaw builds as a TuyaOpen application. From the repo root: +TClaw builds as a TuyaOpen application. From the repo root: ```bash # Initialize TuyaOpen environment (creates .venv, exports OPEN_SDK_ROOT) @@ -20,7 +20,7 @@ cp config/RaspberryPi.config app_default.config # Raspberry Pi cp config/TUYA_T5AI_BOARD_LCD_3.5_CAMERA.config app_default.config # Tuya T5AI cp config/ESP32S3_BREAD_COMPACT_WIFI.config app_default.config # ESP32-S3 -# Build (from TuyaOpen directory, pointing to TuyaOpenClaw as the app) +# Build (from TuyaOpen directory, pointing to TClaw as the app) cd TuyaOpen python3 tos.py build @@ -48,7 +48,7 @@ The secrets file is gitignored. Defaults live in `include/tuya_app_config.h`. The core is a synchronous outer+inner loop in `agent_loop.c`: - **Outer loop**: blocks on `message_bus_pop_inbound()` waiting for user messages from any IM channel - **Inner loop** (up to `TOOL_LOOP_MAX=10` iterations): sends prompt to cloud AI via `ai_agent_send_text()`, blocks on a semaphore until the AI turn completes, checks if a tool was called, and either loops (feeding tool result back) or forwards the final response to IM -- Synchronization: `tuyaopen_claw_chat.c` receives streaming AI events and calls `agent_loop_notify_turn_done()` on `AI_USER_EVT_END` +- Synchronization: `tclaw_chat.c` receives streaming AI events and calls `agent_loop_notify_turn_done()` on `AI_USER_EVT_END` - Tool results are captured by `__on_tool_executed` hook (registered via `ai_mcp_server_set_tool_exec_hook`) ### Context Builder (`agent/context_builder.c`) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8f8a45..55531c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,17 +84,17 @@ if(_APP_NEW_LIBS) endif() ######################################## -# TuyaOpenClaw ai_components overlay +# TClaw ai_components overlay ######################################## # Surgically replace individual translation units inside the upstream # TuyaOpen ai_components library targets (ai_mcp, ai_agent) with -# TuyaOpenClaw-side patches kept under overlay/. The SDK submodule stays +# TClaw-side patches kept under overlay/. The SDK submodule stays # pristine; only this app's CMake graph diverges. TuyaOpen processes # src/ai_components/ before this file is `include`d, so the upstream targets # already exist when we reach here. # # Note: ai_main and ai_audio used to be overlayed too, but those diffs have -# been folded back into upstream / proven trivial — TuyaOpenClaw now consumes +# been folded back into upstream / proven trivial — TClaw now consumes # them straight from TuyaOpen/src/ai_components/ai_{main,audio}/. set(_DC_OVERLAY ${APP_PATH}/overlay/ai_components) @@ -134,8 +134,8 @@ endfunction() # include paths from the COMPONENT_PUBINC variable that was snapshotted in # the lib's own CMakeLists BEFORE our overlay ran, so EXAMPLE_LIB also needs # the overlay path explicitly — otherwise app sources that compile into -# EXAMPLE_LIB (agent_loop.c, ducky_claw_chat.c, app_im.c, …) keep seeing the -# upstream headers without TuyaOpenClaw's added declarations. +# EXAMPLE_LIB (agent_loop.c, tclaw_chat.c, app_im.c, …) keep seeing the +# upstream headers without TClaw's added declarations. foreach(_lib_hdir ai_mcp ai_agent) if(TARGET ${_lib_hdir}) target_include_directories(${_lib_hdir} BEFORE PUBLIC ${_DC_OVERLAY}/${_lib_hdir}/include) diff --git a/Kconfig b/Kconfig index 0bc403e..0132383 100644 --- a/Kconfig +++ b/Kconfig @@ -1,4 +1,4 @@ -menu "configure app (TuyaOpenClaw) " +menu "configure app (TClaw) " config SYS_BUS_OUTBOUND_STACK_SIZE int "SYS bus outbound thread stack size (bytes)" @@ -12,20 +12,20 @@ menu "configure app (TuyaOpenClaw) " help Stack size in bytes for the IM bridge thread (default 4*1024). -config TUYAOPENCLAW_USE_AI_COMPONENTS +config TCLAW_USE_AI_COMPONENTS bool default y select ENABLE_AI_COMPONENTS -# TuyaOpenClaw moves large app-level buffers (acp_client / ws_server / IM dedup rings) +# TClaw moves large app-level buffers (acp_client / ws_server / IM dedup rings) # from static .bss into PSRAM heap via claw_malloc / im_calloc, which only does # anything when ENABLE_EXT_RAM is on at the SDK level. Some board Kconfigs # (e.g. ESP32S3_BREAD_COMPACT_WIFI in upstream TuyaOpen) don't `select -# ENABLE_EXT_RAM` on their own — opt into it from the app side so TuyaOpenClaw +# ENABLE_EXT_RAM` on their own — opt into it from the app side so TClaw # doesn't have to patch the submodule. Boards that already select it # (DNESP32S3 family, WAVESHARE_ESP32S3, T5AI variants with PSRAM) are unaffected. -config TUYAOPENCLAW_USE_EXT_RAM - bool "TuyaOpenClaw: enable external PSRAM heap" +config TCLAW_USE_EXT_RAM + bool "TClaw: enable external PSRAM heap" default y select ENABLE_EXT_RAM help diff --git a/README.md b/README.md index b93c5f6..de65b01 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# TuyaOpenClaw +# TClaw > **Ducky** — TuyaOpen's hardware mascot — runs the Claw on every board. > *(Formerly known as DuckyClaw.)* -TuyaOpenClaw is a hardware-oriented AI agent built on the TuyaOpen C SDK. It runs a Claw-style agent loop on edge devices (Tuya T5AI, ESP32, Raspberry Pi, Linux) that communicates with users via IM channels (Telegram, Discord, Feishu, WeChat, QQ Bot) and executes MCP-style tools directly on the device. +TClaw is a hardware-oriented AI agent built on the TuyaOpen C SDK. It runs a Claw-style agent loop on edge devices (Tuya T5AI, ESP32, Raspberry Pi, Linux) that communicates with users via IM channels (Telegram, Discord, Feishu, WeChat, QQ Bot) and executes MCP-style tools directly on the device. ## Deployable to Hardware @@ -25,17 +25,17 @@ This project is built on top of the TuyaOpen C SDK, which offers flexible cross > **🚧 Under Active Development** — This project is in heavy development and things will break. Running it now may spoil the experience we're building for you. Please visit or open Issues if you encounter any problem. -## ❓ Why TuyaOpenClaw? -Most AI agent frameworks are powerful but cumbersome. They often come with costly subscriptions, complicated setups, and are layered on top of other frameworks and APIs. TuyaOpenClaw offers a different path. +## ❓ Why TClaw? +Most AI agent frameworks are powerful but cumbersome. They often come with costly subscriptions, complicated setups, and are layered on top of other frameworks and APIs. TClaw offers a different path. -Built on a commercial-grade device–cloud AI agent foundation, TuyaOpenClaw uniquely fuses on-device agents with the power of the cloud. +Built on a commercial-grade device–cloud AI agent foundation, TClaw uniquely fuses on-device agents with the power of the cloud. With a single TuyaOpen Key, you gain seamless access to the Tuya Cloud Platform and its next-generation device–cloud AI agents. It's lightweight and effortlessly deployable to almost any edge hardware — from WiFi-connected MCUs to ARM SoCs to PC Ubuntu. -| | TuyaOpenClaw | OpenClaw / MimiClaw / others | +| | TClaw | OpenClaw / MimiClaw / others | |---|---|---| | **Architecture** | Hardware-oriented Claw agent on TuyaOpen C SDK; device–cloud fusion | OpenClaw: Node.js, 24/7 desktop/server agent. MimiClaw: bare-metal C on ESP32-S3 only. Others: framework stacks (Pi, Claude Code, etc.) | | **Deployment** | MCUs (Tuya T5AI, ESP32-S3), SoCs (RPi 4/5, ARM Linux), PC (Ubuntu x64); one codebase | OpenClaw: Mac mini, Pi, VPS. MimiClaw: single $5 ESP32-S3. Others: server/desktop only, no edge MCU | @@ -54,16 +54,16 @@ It's lightweight and effortlessly deployable to almost any edge hardware — fro ## 💡 Philosophy -**Ducky is TuyaOpen's hardware mascot** — a duck that thrives in any environment, from the tiniest MCU to a full desktop Linux box. TuyaOpenClaw inherits that spirit: one codebase, every board, zero compromise. +**Ducky is TuyaOpen's hardware mascot** — a duck that thrives in any environment, from the tiniest MCU to a full desktop Linux box. TClaw inherits that spirit: one codebase, every board, zero compromise. -The name tells the whole story. **TuyaOpen** is the foundation — the commercial-grade C SDK that bridges chip-level hardware, IoT cloud, and AI in a single unified key. **Claw** is the agent paradigm — the loop of reasoning, tool use, and action borrowed from OpenClaw, adapted for the physical world. Put Ducky in the middle and you get an always-on hardware companion that gets smarter the more you use it. +The name tells the whole story. **T** stands for TuyaOpen — the foundation, the commercial-grade C SDK that bridges chip-level hardware, IoT cloud, and AI in a single unified key. **Claw** is the agent paradigm — the loop of reasoning, tool use, and action borrowed from OpenClaw, adapted for the physical world. Add Ducky, and you get an always-on hardware companion that gets smarter the more you use it. -**Why a duck and a claw?** Ducks are omnipresent, adaptable, and thrive in almost any environment — just like TuyaOpenClaw's software, which you can deploy from microcontrollers to desktop Linux. The "claw" symbolizes precision, dexterity, and direct command over both your real-world devices and digital agents. With TuyaOpen, hardware integration is much more flexible, allowing you to easily connect a wide range of hardware features and capabilities directly into your agent. +**Why a duck and a claw?** Ducks are omnipresent, adaptable, and thrive in almost any environment — just like TClaw's software, which you can deploy from microcontrollers to desktop Linux. The "claw" symbolizes precision, dexterity, and direct command over both your real-world devices and digital agents. With TuyaOpen, hardware integration is much more flexible, allowing you to easily connect a wide range of hardware features and capabilities directly into your agent. ### Core Principles -- **Personal-first, not enterprise.** TuyaOpenClaw is made for individuals and makers. Your workflows and day-to-day life come first — no bureaucracy or corporate bloat. +- **Personal-first, not enterprise.** TClaw is made for individuals and makers. Your workflows and day-to-day life come first — no bureaucracy or corporate bloat. - **Lean core, plugin power.** Everything outside the essential C core — channels, providers, tools — is a plugin you can swap and extend. - **Self-tuning and adaptive.** Learns via real episode memory and periodic self-review, with memory fading that keeps it relevant. - **Config by conversation.** No thick config files: set up and modify your agent simply by chatting, both on hardware and in the cloud. @@ -119,7 +119,7 @@ The name tells the whole story. **TuyaOpen** is the foundation — the commercia ![Architecture](https://images.tuyacn.com/fe-static/docs/img/62c1ad75-9f01-4911-9d30-c7bac463faec.png) -The TuyaOpenClaw architecture combines local device agents and cloud agents under a unified system. At its core, it uses the TuyaOpen AI-Agent framework to handle messaging, automation, and control. Local hardware (Raspberry Pi, ESP32, T5AI, or Linux) runs a Claw-style agent loop, communicating with users via IM channels and executing MCP tools directly on-device. +The TClaw architecture combines local device agents and cloud agents under a unified system. At its core, it uses the TuyaOpen AI-Agent framework to handle messaging, automation, and control. Local hardware (Raspberry Pi, ESP32, T5AI, or Linux) runs a Claw-style agent loop, communicating with users via IM channels and executing MCP tools directly on-device. **Agent loop flow:** 1. Outer loop blocks on `message_bus_pop_inbound()` — waits for any IM message @@ -133,8 +133,8 @@ The TuyaOpenClaw architecture combines local device agents and cloud agents unde ### Clone ```shell -git clone https://github.com/tuya/TuyaOpenClaw.git -cd TuyaOpenClaw +git clone https://github.com/tuya/TClaw.git +cd TClaw git submodule update --init ``` @@ -177,9 +177,9 @@ tos.py build Output goes to the `dist/` directory. ### Development Guides -- Tuya T5AI: [TuyaOpenClaw Quick Start (T5-AI)](https://tuyaopen.ai/docs/duckyclaw/ducky-quick-start-T5AI) -- Raspberry Pi: [TuyaOpenClaw Quick Start (Raspberry Pi 5)](https://tuyaopen.ai/docs/duckyclaw/ducky-quick-start-raspberry-pi-5) -- ESP32-S3: [TuyaOpenClaw Quick Start (ESP32-S3)](https://tuyaopen.ai/docs/duckyclaw/ducky-quick-start-ESP32S3) +- Tuya T5AI: [TClaw Quick Start (T5-AI)](https://tuyaopen.ai/docs/tclaw/ducky-quick-start-T5AI) +- Raspberry Pi: [TClaw Quick Start (Raspberry Pi 5)](https://tuyaopen.ai/docs/tclaw/ducky-quick-start-raspberry-pi-5) +- ESP32-S3: [TClaw Quick Start (ESP32-S3)](https://tuyaopen.ai/docs/tclaw/ducky-quick-start-ESP32S3) ## 🔌 Skills Development @@ -209,14 +209,14 @@ Add skills: put a new `name.md` in the `skills/` directory (e.g., via the `write ## 📁 Project Structure ``` -TuyaOpenClaw/ +TClaw/ ├── agent/ # Agent core logic │ ├── agent_loop.c/h # Claw-style outer+inner loop (tool use, context, semaphore sync) │ └── context_builder.c/h # Assembles system prompt each turn ├── components/ │ └── lua/ # Embedded Lua 5.5 sandboxed runtime │ ├── lua/ # Lua 5.5 core sources (vendored) -│ ├── port/ # TuyaOpenClaw glue: sandbox init, runtime, module registry +│ ├── port/ # TClaw glue: sandbox init, runtime, module registry │ └── modules/ # Hardware Lua modules (gpio, delay) ├── config/ # Board/platform Kconfig selections │ ├── TUYA_T5AI_BOARD_LCD_3.5_CAMERA.config # Tuya T5AI 3.5" LCD + camera @@ -252,7 +252,7 @@ TuyaOpenClaw/ │ └── skill_loader.c/h # Scans skills/, builds summary for system prompt ├── src/ # App entry and business logic │ ├── tuya_app_main.c # TuyaOpen app entry, init, event loop -│ ├── tuyaopen_claw_chat.c # AI stream event bridge (notifies agent loop on turn end) +│ ├── tclaw_chat.c # AI stream event bridge (notifies agent loop on turn end) │ ├── app_im.c # IM–Agent bridge │ └── app_cli_cmd.c # CLI and runtime config commands ├── tools/ # MCP-style device tools @@ -271,7 +271,7 @@ TuyaOpenClaw/ ## 🐛 Issues -Please report any issues and bugs by [creating a new issue here](https://github.com/tuya/TuyaOpenClaw/issues), also make sure you're reporting an issue that doesn't exist. Any help to improve the project would be appreciated. Thanks! 🙏✨ +Please report any issues and bugs by [creating a new issue here](https://github.com/tuya/TClaw/issues), also make sure you're reporting an issue that doesn't exist. Any help to improve the project would be appreciated. Thanks! 🙏✨ ## 🙏🙏🙏 Follow us @@ -294,8 +294,8 @@ This project is licensed under the [Apache License 2.0](https://www.apache.org/l ## 📝 Author -This project is created by [TuyaOpen Team](https://tuyaopen.ai/), with the help of awesome [contributors](https://github.com/tuya/TuyaOpenClaw/graphs/contributors). +This project is created by [TuyaOpen Team](https://tuyaopen.ai/), with the help of awesome [contributors](https://github.com/tuya/TClaw/graphs/contributors). -[![contributors](https://contrib.rocks/image?repo=tuya/TuyaOpenClaw)](https://github.com/tuya/TuyaOpenClaw/graphs/contributors) +[![contributors](https://contrib.rocks/image?repo=tuya/TuyaOpenClaw)](https://github.com/tuya/TClaw/graphs/contributors) --- diff --git a/README_zh.md b/README_zh.md index 0388232..028ed60 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,9 +1,9 @@ -# TuyaOpenClaw +# TClaw > **Ducky** —— TuyaOpen 的硬件吉祥物 —— 在每一块板子上运行 Claw。 > *(前身为 DuckyClaw。)* -TuyaOpenClaw 是基于 TuyaOpen C SDK 构建的硬件导向 AI Agent。它在边缘设备(Tuya T5AI、ESP32、Raspberry Pi、Linux)上运行 Claw 风格的 Agent 循环,通过 IM 通道(Telegram、Discord、飞书、微信、QQ 机器人)与用户通信,并直接在设备端执行 MCP 风格的工具调用。 +TClaw 是基于 TuyaOpen C SDK 构建的硬件导向 AI Agent。它在边缘设备(Tuya T5AI、ESP32、Raspberry Pi、Linux)上运行 Claw 风格的 Agent 循环,通过 IM 通道(Telegram、Discord、飞书、微信、QQ 机器人)与用户通信,并直接在设备端执行 MCP 风格的工具调用。 ## 支持的硬件 @@ -25,18 +25,18 @@ TuyaOpenClaw 是基于 TuyaOpen C SDK 构建的硬件导向 AI Agent。它在边 > **🚧 积极开发中** —— 项目处于高强度开发阶段,随时可能出现问题。现在运行可能影响最终体验。遇到任何问题请提 Issue。 -## ❓ 为什么选择 TuyaOpenClaw? +## ❓ 为什么选择 TClaw? -大多数 AI Agent 框架虽然强大,但却繁琐。它们往往需要昂贵的订阅费、复杂的配置,并叠加在各种框架和 API 之上。TuyaOpenClaw 提供了一条不同的路。 +大多数 AI Agent 框架虽然强大,但却繁琐。它们往往需要昂贵的订阅费、复杂的配置,并叠加在各种框架和 API 之上。TClaw 提供了一条不同的路。 -基于商业级设备–云端 AI Agent 底座,TuyaOpenClaw 将设备端 Agent 与云端能力无缝融合。 +基于商业级设备–云端 AI Agent 底座,TClaw 将设备端 Agent 与云端能力无缝融合。 只需一个 TuyaOpen Key,即可畅享涂鸦云平台及其新一代设备–云端 AI Agent。 轻量、易部署,适配几乎所有边缘硬件——从 WiFi MCU 到 ARM SoC,再到 Ubuntu PC。 -| | TuyaOpenClaw | OpenClaw / MimiClaw / 其他 | +| | TClaw | OpenClaw / MimiClaw / 其他 | |---|---|---| | **架构** | 基于 TuyaOpen C SDK 的硬件导向 Claw Agent;设备–云端融合 | OpenClaw:Node.js 全天候桌面/服务器 Agent。MimiClaw:ESP32-S3 裸机 C。其他:框架栈(Pi、Claude Code 等)| | **部署目标** | MCU(T5AI、ESP32-S3)、SoC(RPi 4/5、ARM Linux)、PC(Ubuntu x64);单一代码库 | OpenClaw:Mac mini、Pi、VPS。MimiClaw:5 美元 ESP32-S3。其他:仅服务器/桌面 | @@ -54,16 +54,16 @@ TuyaOpenClaw 是基于 TuyaOpen C SDK 构建的硬件导向 AI Agent。它在边 ## 💡 设计理念 -**Ducky 是 TuyaOpen 的硬件吉祥物** —— 一只能在任何环境中如鱼得水的鸭子,从最小的 MCU 到完整的桌面 Linux 系统。TuyaOpenClaw 继承了这种精神:一套代码,适配所有板子,零妥协。 +**Ducky 是 TuyaOpen 的硬件吉祥物** —— 一只能在任何环境中如鱼得水的鸭子,从最小的 MCU 到完整的桌面 Linux 系统。TClaw 继承了这种精神:一套代码,适配所有板子,零妥协。 -项目名称本身就是完整的故事。**TuyaOpen** 是底座 —— 将芯片级硬件、IoT 云和 AI 统一于单一 Key 的商业级 C SDK。**Claw** 是 Agent 范式 —— 从 OpenClaw 借鉴的推理–工具调用–行动循环,经过改造以适应物理世界。Ducky 在中间,构成一个越用越聪明的全天候硬件伴侣。 +项目名称本身就是完整的故事。**T** 代表 TuyaOpen —— 底座,将芯片级硬件、IoT 云和 AI 统一于单一 Key 的商业级 C SDK。**Claw** 是 Agent 范式 —— 从 OpenClaw 借鉴的推理–工具调用–行动循环,经过改造以适应物理世界。再加上 Ducky,构成一个越用越聪明的全天候硬件伴侣。 -**为什么是鸭子和爪子?** 鸭子无处不在、适应力强,几乎在任何环境中都能生存——正如 TuyaOpenClaw 的软件,可以从微控制器部署到桌面 Linux。"爪子"象征精准、灵巧,以及对真实世界设备和数字 Agent 的直接掌控。借助 TuyaOpen,硬件集成更加灵活,让你轻松将各种硬件能力直接接入 Agent。 +**为什么是鸭子和爪子?** 鸭子无处不在、适应力强,几乎在任何环境中都能生存——正如 TClaw 的软件,可以从微控制器部署到桌面 Linux。"爪子"象征精准、灵巧,以及对真实世界设备和数字 Agent 的直接掌控。借助 TuyaOpen,硬件集成更加灵活,让你轻松将各种硬件能力直接接入 Agent。 ### 核心理念 -- **个人优先,非企业导向。** TuyaOpenClaw 为个人和创客而生。你的工作流和日常生活优先,没有官僚主义和企业冗余。 +- **个人优先,非企业导向。** TClaw 为个人和创客而生。你的工作流和日常生活优先,没有官僚主义和企业冗余。 - **精简核心,插件扩展。** 必要 C 核心之外的一切——通道、提供商、工具——都是可替换和扩展的插件。 - **自调优与自适应。** 通过真实情节记忆和定期自我回顾持续学习,记忆衰减机制帮助它保持时效性。 - **对话式配置。** 无需厚重的配置文件:直接通过聊天完成 Agent 的设置和修改,硬件端和云端均适用。 @@ -119,7 +119,7 @@ TuyaOpenClaw 是基于 TuyaOpen C SDK 构建的硬件导向 AI Agent。它在边 ![Architecture](https://images.tuyacn.com/fe-static/docs/img/62c1ad75-9f01-4911-9d30-c7bac463faec.png) -TuyaOpenClaw 架构将本地设备 Agent 和云端 Agent 统一在同一个系统下。其核心使用 TuyaOpen AI-Agent 框架处理消息、自动化和控制。本地硬件(Raspberry Pi、ESP32、T5AI 或 Linux)运行 Claw 风格的 Agent 循环,通过 IM 通道与用户通信,并直接在设备端执行 MCP 工具。 +TClaw 架构将本地设备 Agent 和云端 Agent 统一在同一个系统下。其核心使用 TuyaOpen AI-Agent 框架处理消息、自动化和控制。本地硬件(Raspberry Pi、ESP32、T5AI 或 Linux)运行 Claw 风格的 Agent 循环,通过 IM 通道与用户通信,并直接在设备端执行 MCP 工具。 **Agent 循环流程:** 1. 外循环阻塞在 `message_bus_pop_inbound()` —— 等待任意 IM 消息 @@ -133,8 +133,8 @@ TuyaOpenClaw 架构将本地设备 Agent 和云端 Agent 统一在同一个系 ### 克隆仓库 ```shell -git clone https://github.com/tuya/TuyaOpenClaw.git -cd TuyaOpenClaw +git clone https://github.com/tuya/TClaw.git +cd TClaw git submodule update --init ``` @@ -177,9 +177,9 @@ tos.py build 编译产物输出至 `dist/` 目录。 ### 开发指南 -- Tuya T5AI:[TuyaOpenClaw 快速开始(T5-AI)](https://tuyaopen.ai/zh/docs/duckyclaw/ducky-quick-start-T5AI) -- Raspberry Pi:[TuyaOpenClaw 快速开始(Raspberry Pi 5)](https://tuyaopen.ai/zh/docs/duckyclaw/ducky-quick-start-raspberry-pi-5) -- ESP32-S3:[TuyaOpenClaw 快速开始(ESP32-S3)](https://tuyaopen.ai/zh/docs/duckyclaw/ducky-quick-start-ESP32S3) +- Tuya T5AI:[TClaw 快速开始(T5-AI)](https://tuyaopen.ai/zh/docs/tclaw/ducky-quick-start-T5AI) +- Raspberry Pi:[TClaw 快速开始(Raspberry Pi 5)](https://tuyaopen.ai/zh/docs/tclaw/ducky-quick-start-raspberry-pi-5) +- ESP32-S3:[TClaw 快速开始(ESP32-S3)](https://tuyaopen.ai/zh/docs/tclaw/ducky-quick-start-ESP32S3) ## 🔌 技能(Skills)开发 @@ -209,14 +209,14 @@ tos.py build ## 📁 项目结构 ``` -TuyaOpenClaw/ +TClaw/ ├── agent/ # Agent 核心逻辑 │ ├── agent_loop.c/h # Claw 风格外循环+内循环(工具调用、上下文、信号量同步) │ └── context_builder.c/h # 每轮组装系统提示 ├── components/ │ └── lua/ # 嵌入式 Lua 5.5 沙箱运行时 │ ├── lua/ # Lua 5.5 核心源码(vendored) -│ ├── port/ # TuyaOpenClaw 胶合层:沙箱初始化、运行时、模块注册 +│ ├── port/ # TClaw 胶合层:沙箱初始化、运行时、模块注册 │ └── modules/ # 硬件 Lua 模块(gpio、delay) ├── config/ # 板型 / 平台 Kconfig 配置 │ ├── TUYA_T5AI_BOARD_LCD_3.5_CAMERA.config # Tuya T5AI 3.5" LCD + 摄像头 @@ -252,7 +252,7 @@ TuyaOpenClaw/ │ └── skill_loader.c/h # 扫描 skills/,为系统提示构建摘要 ├── src/ # 应用入口与业务逻辑 │ ├── tuya_app_main.c # TuyaOpen 应用入口,初始化,事件循环 -│ ├── tuyaopen_claw_chat.c # AI 流式事件桥接(轮次结束时通知 Agent 循环) +│ ├── tclaw_chat.c # AI 流式事件桥接(轮次结束时通知 Agent 循环) │ ├── app_im.c # IM–Agent 桥接 │ └── app_cli_cmd.c # CLI 和运行时配置命令 ├── tools/ # MCP 风格设备工具 @@ -271,7 +271,7 @@ TuyaOpenClaw/ ## 🐛 问题反馈 -请通过[新建 Issue](https://github.com/tuya/TuyaOpenClaw/issues) 反馈问题,提交前请确认该问题尚未被报告。欢迎任何改进贡献,感谢!🙏✨ +请通过[新建 Issue](https://github.com/tuya/TClaw/issues) 反馈问题,提交前请确认该问题尚未被报告。欢迎任何改进贡献,感谢!🙏✨ ## 🙏🙏🙏 关注我们 @@ -294,8 +294,8 @@ TuyaOpenClaw/ ## 📝 作者 -本项目由 [TuyaOpen 团队](https://tuyaopen.ai/) 创建,感谢所有[贡献者](https://github.com/tuya/TuyaOpenClaw/graphs/contributors)的帮助。 +本项目由 [TuyaOpen 团队](https://tuyaopen.ai/) 创建,感谢所有[贡献者](https://github.com/tuya/TClaw/graphs/contributors)的帮助。 -[![contributors](https://contrib.rocks/image?repo=tuya/TuyaOpenClaw)](https://github.com/tuya/TuyaOpenClaw/graphs/contributors) +[![contributors](https://contrib.rocks/image?repo=tuya/TuyaOpenClaw)](https://github.com/tuya/TClaw/graphs/contributors) --- diff --git a/TODOs.md b/TODOs.md index 46d2d33..25fed9c 100644 --- a/TODOs.md +++ b/TODOs.md @@ -19,10 +19,10 @@ ## Docs TODOs - [x] Free Lic Guide -- [ ] Tuya T5 TuyaOpenClaw Quick Start +- [ ] Tuya T5 TClaw Quick Start - [ ] ESP32 Ducky Claw -- [ ] Raspberry Pi TuyaOpenClaw Quick Start +- [ ] Raspberry Pi TClaw Quick Start - [ ] Device MCP Quick Guide ### TuyaOpen.ai -- [ ] TuyaOpenClaw Landing Page -- [ ] Main TuyaOpenClaw README EN/CN +- [ ] TClaw Landing Page +- [ ] Main TClaw README EN/CN diff --git a/TuyaOpen b/TuyaOpen index 4e6d0e7..e82840d 160000 --- a/TuyaOpen +++ b/TuyaOpen @@ -1 +1 @@ -Subproject commit 4e6d0e7e6f8766a1668998bc7f5634e11165acfc +Subproject commit e82840dc9b629cb77fa922fb04e3f820dc2e78b4 diff --git a/agent/Kconfig b/agent/Kconfig index e61e587..cf2f0d3 100644 --- a/agent/Kconfig +++ b/agent/Kconfig @@ -1,17 +1,17 @@ -menu "TuyaOpenClaw Agent Config" - config TUYAOPEN_CLAW_AGENT_STACK +menu "TClaw Agent Config" + config TCLAW_AGENT_STACK int "Agent loop thread stack size (bytes)" default 24576 help Stack size in bytes for the agent loop thread (default 24*1024). - config TUYAOPEN_CLAW_CONTEXT_BUF_SIZE + config TCLAW_CONTEXT_BUF_SIZE int "Agent context buffer size (bytes)" default 32768 help Size in bytes for the context/prompt buffer (default 32*1024). - config TUYAOPEN_CLAW_HISTORY_MAX_COUNT + config TCLAW_HISTORY_MAX_COUNT int "Max history message count" default 10 help diff --git a/agent/agent_loop.c b/agent/agent_loop.c index ea2e899..8eacbd4 100644 --- a/agent/agent_loop.c +++ b/agent/agent_loop.c @@ -40,16 +40,16 @@ /*********************************************************** ************************macro define************************ ***********************************************************/ -#ifndef TUYAOPEN_CLAW_AGENT_STACK -#define TUYAOPEN_CLAW_AGENT_STACK (24*1024) +#ifndef TCLAW_AGENT_STACK +#define TCLAW_AGENT_STACK (24*1024) #endif -#ifndef TUYAOPEN_CLAW_CONTEXT_BUF_SIZE -#define TUYAOPEN_CLAW_CONTEXT_BUF_SIZE (32 * 1024) +#ifndef TCLAW_CONTEXT_BUF_SIZE +#define TCLAW_CONTEXT_BUF_SIZE (32 * 1024) #endif -#ifndef TUYAOPEN_CLAW_HISTORY_MAX_COUNT -#define TUYAOPEN_CLAW_HISTORY_MAX_COUNT 10 +#ifndef TCLAW_HISTORY_MAX_COUNT +#define TCLAW_HISTORY_MAX_COUNT 10 #endif /* Maximum inner-loop iterations per user turn (mirrors MIMI_AGENT_MAX_TOOL_ITER) */ @@ -66,7 +66,7 @@ #define TOOL_RESULT_BUF_SIZE (512) /* Buffer holding the last complete AI text stream, set by - * agent_loop_set_last_response() called from tuyaopen_claw_chat.c on STREAM_STOP. + * agent_loop_set_last_response() called from tclaw_chat.c on STREAM_STOP. * The inner loop forwards it to IM when no tool was called. */ #define LAST_RESPONSE_MAX (16 * 1024) /*********************************************************** @@ -110,7 +110,7 @@ static char *s_last_response = NULL; static MUTEX_HANDLE s_last_response_lock = NULL; /* True while the inner loop is active (i.e. we are in a tool-use iteration). - * tuyaopen_claw_chat.c uses this to suppress mid-stream overflow flushes. */ + * tclaw_chat.c uses this to suppress mid-stream overflow flushes. */ static volatile bool s_in_tool_loop = false; /*********************************************************** @@ -241,7 +241,7 @@ OPERATE_RET build_current_context(const char *role, const char *content) } int count = cJSON_GetArraySize(s_history_json); - if (count >= TUYAOPEN_CLAW_HISTORY_MAX_COUNT) { + if (count >= TCLAW_HISTORY_MAX_COUNT) { cJSON_DeleteItemFromArray(s_history_json, 0); } @@ -256,7 +256,7 @@ OPERATE_RET build_current_context(const char *role, const char *content) /** * agent_loop_in_tool_loop - Returns true while the inner tool loop is active. * - * Used by tuyaopen_claw_chat.c to suppress intermediate IM flushes. + * Used by tclaw_chat.c to suppress intermediate IM flushes. */ bool agent_loop_in_tool_loop(void) { @@ -266,7 +266,7 @@ bool agent_loop_in_tool_loop(void) /** * agent_loop_set_last_response - Store the completed AI text stream. * - * Called by tuyaopen_claw_chat.c on AI_USER_EVT_TEXT_STREAM_STOP before + * Called by tclaw_chat.c on AI_USER_EVT_TEXT_STREAM_STOP before * calling agent_loop_notify_turn_done(). The inner loop reads this to * forward the final response to IM. */ @@ -282,7 +282,7 @@ void agent_loop_set_last_response(const char *text) } /** - * agent_loop_notify_turn_done - Called by tuyaopen_claw_chat.c on STREAM_STOP. + * agent_loop_notify_turn_done - Called by tclaw_chat.c on STREAM_STOP. * * Posts the semaphore so the blocked inner loop can proceed to the next * iteration check. @@ -307,11 +307,11 @@ void agent_loop_notify_turn_done(void) */ static void __build_and_send(const char *content, bool is_tool, bool summarize) { - memset(s_total_prompt, 0, TUYAOPEN_CLAW_CONTEXT_BUF_SIZE); + memset(s_total_prompt, 0, TCLAW_CONTEXT_BUF_SIZE); size_t off = 0; if (!is_tool) { /* First iteration: include full system prompt (tools, rules, memory, skills) */ - off = context_build_system_prompt(s_total_prompt, TUYAOPEN_CLAW_CONTEXT_BUF_SIZE); + off = context_build_system_prompt(s_total_prompt, TCLAW_CONTEXT_BUF_SIZE); if (off == 0) { PR_ERR("context_build_system_prompt failed"); return; @@ -322,14 +322,14 @@ static void __build_and_send(const char *content, bool is_tool, bool summarize) tal_mutex_lock(s_history_mutex); int count = cJSON_GetArraySize(s_history_json); if (count > 0) { - off += snprintf(s_total_prompt + off, TUYAOPEN_CLAW_CONTEXT_BUF_SIZE - off, + off += snprintf(s_total_prompt + off, TCLAW_CONTEXT_BUF_SIZE - off, "\r\n\n# Recent Memory History\r\n"); for (int j = 0; j < count; j++) { cJSON *e = cJSON_GetArrayItem(s_history_json, j); const char *role = __json_get_string(cJSON_GetObjectItem(e, "role")); const char *text = __json_get_string(cJSON_GetObjectItem(e, "content")); if (role && text) { - off += snprintf(s_total_prompt + off, TUYAOPEN_CLAW_CONTEXT_BUF_SIZE - off, + off += snprintf(s_total_prompt + off, TCLAW_CONTEXT_BUF_SIZE - off, "\n- %s: %s", role, text); } } @@ -359,11 +359,11 @@ static void __build_and_send(const char *content, bool is_tool, bool summarize) } size_t needed = strlen(content) + strlen(header) + 1; - if (off + needed > TUYAOPEN_CLAW_CONTEXT_BUF_SIZE) { + if (off + needed > TCLAW_CONTEXT_BUF_SIZE) { PR_ERR("Prompt buffer overflow"); return; } - off += snprintf(s_total_prompt + off, TUYAOPEN_CLAW_CONTEXT_BUF_SIZE - off, + off += snprintf(s_total_prompt + off, TCLAW_CONTEXT_BUF_SIZE - off, "%s%s", header, content); // PR_NOTICE("Sending prompt (len=%u, is_tool=%d): %s ...", (unsigned)off, is_tool, s_total_prompt); @@ -426,7 +426,7 @@ static void agent_loop_task(void *arg) /* Notify the user via IM that the agent is still working. * Sent at the start of every iteration so the user sees progress * even when tool calls take a long time. */ - app_im_bot_send_message("TuyaOpenClaw is working..."); + app_im_bot_send_message("TClaw is working..."); /* Reset per-round tool state */ if (s_turn.lock) { @@ -523,14 +523,14 @@ OPERATE_RET agent_loop_init_evt_cb(void *data) } #if defined(ENABLE_EXT_RAM) && (ENABLE_EXT_RAM == 1) - s_total_prompt = tal_psram_malloc(TUYAOPEN_CLAW_CONTEXT_BUF_SIZE); + s_total_prompt = tal_psram_malloc(TCLAW_CONTEXT_BUF_SIZE); #else - s_total_prompt = tal_malloc(TUYAOPEN_CLAW_CONTEXT_BUF_SIZE); + s_total_prompt = tal_malloc(TCLAW_CONTEXT_BUF_SIZE); #endif if (!s_total_prompt) { return OPRT_MALLOC_FAILED; } - memset(s_total_prompt, 0, TUYAOPEN_CLAW_CONTEXT_BUF_SIZE); + memset(s_total_prompt, 0, TCLAW_CONTEXT_BUF_SIZE); s_history_json = cJSON_CreateArray(); if (!s_history_json) { @@ -559,7 +559,7 @@ OPERATE_RET agent_loop_init_evt_cb(void *data) PR_DEBUG("Agent loop initialized"); THREAD_CFG_T thrd_param = {0}; - thrd_param.stackDepth = TUYAOPEN_CLAW_AGENT_STACK; + thrd_param.stackDepth = TCLAW_AGENT_STACK; thrd_param.priority = THREAD_PRIO_1; thrd_param.thrdname = "agent_loop"; #if defined(ENABLE_EXT_RAM) && (ENABLE_EXT_RAM == 1) diff --git a/agent/agent_loop.h b/agent/agent_loop.h index 4dae282..6ee398e 100644 --- a/agent/agent_loop.h +++ b/agent/agent_loop.h @@ -29,7 +29,7 @@ OPERATE_RET build_current_context(const char *role, const char *content); /** * agent_loop_set_last_response - Store the completed AI text stream. * - * Must be called from tuyaopen_claw_chat.c on AI_USER_EVT_TEXT_STREAM_STOP + * Must be called from tclaw_chat.c on AI_USER_EVT_TEXT_STREAM_STOP * before agent_loop_notify_turn_done(). The inner loop uses this text * to forward the final response to IM. */ @@ -38,7 +38,7 @@ void agent_loop_set_last_response(const char *text); /** * agent_loop_notify_turn_done - Signal that the cloud AI has finished one round. * - * Must be called from tuyaopen_claw_chat.c on AI_USER_EVT_TEXT_STREAM_STOP. + * Must be called from tclaw_chat.c on AI_USER_EVT_TEXT_STREAM_STOP. * Posts the internal semaphore so the blocked inner loop can proceed. */ void agent_loop_notify_turn_done(void); @@ -46,7 +46,7 @@ void agent_loop_notify_turn_done(void); /** * agent_loop_in_tool_loop - Returns true while the inner tool loop is active. * - * Used by tuyaopen_claw_chat.c to suppress intermediate IM flushes during + * Used by tclaw_chat.c to suppress intermediate IM flushes during * tool-use iterations. */ bool agent_loop_in_tool_loop(void); diff --git a/agent/context_builder.c b/agent/context_builder.c index 972d87b..cfa20c1 100644 --- a/agent/context_builder.c +++ b/agent/context_builder.c @@ -76,8 +76,8 @@ size_t off = 0; off += snprintf(buf + off, size - off, - "# TuyaOpenClaw\n\n" - "You are TuyaOpenClaw (a.k.a. Ducky), a personal AI assistant running on a TuyaOpen device.\n" + "# TClaw\n\n" + "You are TClaw (a.k.a. Ducky), a personal AI assistant running on a TuyaOpen device.\n" "You communicate through Telegram, Discord, and Feishu.\n" "Be helpful, accurate, and concise.\n\n"); diff --git a/components/lua/CMakeLists.txt b/components/lua/CMakeLists.txt index 894ba13..3fdb39b 100644 --- a/components/lua/CMakeLists.txt +++ b/components/lua/CMakeLists.txt @@ -1,6 +1,6 @@ ## # @file CMakeLists.txt -# @brief Embedded Lua 5.5 component for TuyaOpenClaw +# @brief Embedded Lua 5.5 component for TClaw # # Vendored from upstream Lua 5.5 (originally via the esp-idf-component-lua # managed component). Sources liolib.c / loslib.c / loadlib.c / linit.c / @@ -48,7 +48,7 @@ set(LUA_CORE_SRCS ) # ---------------------------------------------------------------------------- -# TuyaOpenClaw port glue +# TClaw port glue # ---------------------------------------------------------------------------- set(LUA_PORT_SRCS ${MODULE_PATH}/port/linit_sandbox.c diff --git a/components/lua/include/luaconf.h b/components/lua/include/luaconf.h index 047613c..3275789 100644 --- a/components/lua/include/luaconf.h +++ b/components/lua/include/luaconf.h @@ -759,7 +759,7 @@ ** space and to reserve some numbers for pseudo-indices. ** (It must fit into max(int)/2.) */ -/* TuyaOpenClaw: keep this conservative; was CONFIG_LUA_MAXSTACK on ESP-IDF. */ +/* TClaw: keep this conservative; was CONFIG_LUA_MAXSTACK on ESP-IDF. */ #if !defined(LUAI_MAXSTACK) #if 1000000 < (INT_MAX / 2) #define LUAI_MAXSTACK 15000 diff --git a/components/lua/port/lua_runtime.c b/components/lua/port/lua_runtime.c index 80f6e96..296cef2 100644 --- a/components/lua/port/lua_runtime.c +++ b/components/lua/port/lua_runtime.c @@ -1,6 +1,6 @@ /** * @file lua_runtime.c - * @brief Embedded Lua 5.5 runtime for the TuyaOpenClaw lua_run_script tool. + * @brief Embedded Lua 5.5 runtime for the TClaw lua_run_script tool. * * Per-call lifecycle: * 1. lua_newstate with a claw_malloc-backed allocator (PSRAM-aware via diff --git a/components/lua/port_include/lua_module_registry.h b/components/lua/port_include/lua_module_registry.h index 012c68d..6d2fd58 100644 --- a/components/lua/port_include/lua_module_registry.h +++ b/components/lua/port_include/lua_module_registry.h @@ -1,6 +1,6 @@ /** * @file lua_module_registry.h - * @brief Lightweight Lua C module registry for TuyaOpenClaw. + * @brief Lightweight Lua C module registry for TClaw. * * Hardware / board-specific Lua modules (gpio, i2c, uart, etc.) register * themselves here during init. When a sandboxed Lua script runs, diff --git a/components/lua/port_include/lua_runtime.h b/components/lua/port_include/lua_runtime.h index 9b4aa45..aaf6a06 100644 --- a/components/lua/port_include/lua_runtime.h +++ b/components/lua/port_include/lua_runtime.h @@ -1,6 +1,6 @@ /** * @file lua_runtime.h - * @brief Embedded Lua 5.5 runtime entry point for TuyaOpenClaw. + * @brief Embedded Lua 5.5 runtime entry point for TClaw. * * Exposes a single synchronous function that creates a fresh sandboxed * lua_State, executes an inline source string, captures print() output diff --git a/config/ESP32S3_BREAD_COMPACT_WIFI.config b/config/ESP32S3_BREAD_COMPACT_WIFI.config index 2211848..4e6ed28 100755 --- a/config/ESP32S3_BREAD_COMPACT_WIFI.config +++ b/config/ESP32S3_BREAD_COMPACT_WIFI.config @@ -5,7 +5,7 @@ CONFIG_BUTTON_NAME="ai_chat_button" CONFIG_AI_HEAP_IN_PSRAM=y CONFIG_AI_STACK_IN_PSRAM=y CONFIG_ENABLE_SERIAL_CLI_CMD=y -CONFIG_TUYAOPEN_CLAW_CONTEXT_BUF_SIZE=16384 +CONFIG_TCLAW_CONTEXT_BUF_SIZE=16384 CONFIG_CLAW_WS_MAX_CLIENTS=2 CONFIG_BOARD_CHOICE_ESP32=y CONFIG_BOARD_CHOICE_BREAD_COMPACT_WIFI=y diff --git a/cron_service/cron_service.c b/cron_service/cron_service.c index 9c75cd6..1a91d77 100644 --- a/cron_service/cron_service.c +++ b/cron_service/cron_service.c @@ -1,6 +1,6 @@ /** * @file cron_service.c - * @brief Cron (scheduled task) service for TuyaOpenClaw + * @brief Cron (scheduled task) service for TClaw * @version 0.1 * @date 2025-03-25 * diff --git a/cron_service/cron_service.h b/cron_service/cron_service.h index 8498f26..037360c 100644 --- a/cron_service/cron_service.h +++ b/cron_service/cron_service.h @@ -1,6 +1,6 @@ /** * @file cron_service.h - * @brief Cron (scheduled task) service for TuyaOpenClaw + * @brief Cron (scheduled task) service for TClaw * @version 0.1 * @date 2025-03-25 * diff --git a/docs/lua-module-porting.md b/docs/lua-module-porting.md index 1139544..f136f7f 100644 --- a/docs/lua-module-porting.md +++ b/docs/lua-module-porting.md @@ -1,18 +1,18 @@ -# TuyaOpenClaw Lua 模块移植实现文档 +# TClaw Lua 模块移植实现文档 -本文档记录 TuyaOpenClaw(基于 TuyaOpen C SDK 的硬件 AI Agent)中 Lua 5.5 沙盒运行时及硬件模块的实现方案,目的是让其它开发者能够: +本文档记录 TClaw(基于 TuyaOpen C SDK 的硬件 AI Agent)中 Lua 5.5 沙盒运行时及硬件模块的实现方案,目的是让其它开发者能够: -1. 理解 TuyaOpenClaw 中 Lua 子系统的整体架构; +1. 理解 TClaw 中 Lua 子系统的整体架构; 2. 复用现有沙盒/注册器模式给设备增加新的硬件模块(PWM、I2C、UART、ADC 等); 3. 在其它 TuyaOpen 板型上重新启用本子系统。 ## 0. 背景 -[TuyaOpenClaw](https://github.com/tuya/TuyaOpenClaw)([官网](https://tuyaopen.ai/zh/tuyaopenclaw))是 [TuyaOpen](https://tuyaopen.ai) 上的开源硬件 AI Agent,主战平台是 Tuya T5AI 开发板(也支持 ESP32、Linux、Raspberry Pi)。其核心是一个端侧 Agent 循环,通过 IM 通道(Telegram/Discord/Feishu)与用户交互,并通过 MCP 风格的工具协议在设备上执行操作。 +[TClaw](https://github.com/tuya/TClaw)([官网](https://tuyaopen.ai/zh/tclaw))是 [TuyaOpen](https://tuyaopen.ai) 上的开源硬件 AI Agent,主战平台是 Tuya T5AI 开发板(也支持 ESP32、Linux、Raspberry Pi)。其核心是一个端侧 Agent 循环,通过 IM 通道(Telegram/Discord/Feishu)与用户交互,并通过 MCP 风格的工具协议在设备上执行操作。 -为了让云端 LLM 能够"动态写一段小代码,在设备上运行后拿结果",TuyaOpenClaw 引入了 [esp-claw](https://esp-claw.com/zh-cn/)(参考实现)的 Lua 子系统设计:把 Lua 5.5 解释器嵌入设备,作为一个名为 `lua_run_script` 的 MCP 工具暴露给 LLM。沙盒里只开放安全的标准库子集 + 设备硬件模块(GPIO、延时等),让 LLM 既能做计算/字符串处理,也能直接控 IO、调时序。 +为了让云端 LLM 能够"动态写一段小代码,在设备上运行后拿结果",TClaw 引入了 [esp-claw](https://esp-claw.com/zh-cn/)(参考实现)的 Lua 子系统设计:把 Lua 5.5 解释器嵌入设备,作为一个名为 `lua_run_script` 的 MCP 工具暴露给 LLM。沙盒里只开放安全的标准库子集 + 设备硬件模块(GPIO、延时等),让 LLM 既能做计算/字符串处理,也能直接控 IO、调时序。 -与 esp-claw 不同的是,TuyaOpenClaw 的硬件 API 走 TuyaOpen 的 `tkl_*` / `tal_*` 抽象层,因此模块代码全部按 TuyaOpen 接口重写;架构(沙盒 + 模块注册器 + 三层目录)则与 esp-claw 一致。 +与 esp-claw 不同的是,TClaw 的硬件 API 走 TuyaOpen 的 `tkl_*` / `tal_*` 抽象层,因此模块代码全部按 TuyaOpen 接口重写;架构(沙盒 + 模块注册器 + 三层目录)则与 esp-claw 一致。 ## 1. 整体架构 @@ -52,7 +52,7 @@ ## 2. 目录结构 ``` -TuyaOpenClaw/ +TClaw/ ├── tools/ │ └── tool_lua.{c,h} # MCP 工具:lua_run_script ├── components/lua/ @@ -61,7 +61,7 @@ TuyaOpenClaw/ │ ├── lua/ # Lua 5.5 上游源码(精简 — 见 §3.1) │ ├── include/ │ │ └── luaconf.h # 上游默认配置 -│ ├── port/ # TuyaOpenClaw 集成层 +│ ├── port/ # TClaw 集成层 │ │ ├── linit_sandbox.c # 替换上游 linit.c:仅打开安全库 │ │ ├── lua_module_os_safe.c # 安全 os 子集 (time/date) │ │ ├── lua_module_registry.c # 模块注册器 @@ -478,7 +478,7 @@ LLM 看到的"Lua 能力"通过两个途径合成: ### 5.2 Skills 摘要(弱信号 + 完整文档) -TuyaOpenClaw 的 `skill_loader` 会扫描设备 SD 卡 `/sdcard/skills/*.md`,把每个 `.md` 的标题+第一段聚合到 system prompt,并提示 LLM "use read_file to load full instructions"。 +TClaw 的 `skill_loader` 会扫描设备 SD 卡 `/sdcard/skills/*.md`,把每个 `.md` 的标题+第一段聚合到 system prompt,并提示 LLM "use read_file to load full instructions"。 为此项目维护三份配套的 skill 文档: @@ -490,7 +490,7 @@ TuyaOpenClaw 的 `skill_loader` 会扫描设备 SD 卡 `/sdcard/skills/*.md`,把 并把精简版同步进 `skills/skill_loader.c` 的 `BUILTIN_LUA_RUN`/`BUILTIN_LUA_GPIO`/`BUILTIN_LUA_DELAY` 内置串中,首次启动 `skill_loader_init()` 会自动写到 `/sdcard/skills/lua_*.md`(已存在则跳过)。 -参见 [hardware-skill 文档](https://tuyaopen.ai/zh/docs/tuyaopenclaw/hardware-skill)。 +参见 [hardware-skill 文档](https://tuyaopen.ai/zh/docs/tclaw/hardware-skill)。 ## 6. Lua 端 API 参考 @@ -709,10 +709,10 @@ CONFIG_ENABLE_LUA_MODULE_PWM=y ## 10. 参考资料 -- TuyaOpenClaw 项目主页: -- TuyaOpenClaw 源码: +- TClaw 项目主页: +- TClaw 源码: - Claw 平台: -- TuyaOpenClaw 硬件 Skill 指南: +- TClaw 硬件 Skill 指南: - T5AI 引脚映射: - esp-claw 主页: - esp-claw lua_modules 参考(本移植的设计原型): diff --git a/gateway/acp_client.c b/gateway/acp_client.c index ac42f54..a907ffe 100755 --- a/gateway/acp_client.c +++ b/gateway/acp_client.c @@ -523,7 +523,7 @@ static OPERATE_RET __acp_connect(int fd, char *session_key, size_t sk_size) cJSON_AddStringToObject(client, "mode", "ui"); cJSON_AddStringToObject(client, "version", "1.0.0"); cJSON_AddStringToObject(client, "platform", "embedded"); - cJSON_AddStringToObject(client, "deviceFamily", "TuyaOpenClaw"); + cJSON_AddStringToObject(client, "deviceFamily", "TClaw"); cJSON_AddStringToObject(client, "displayName", s_device_id); cJSON_AddItemToObject(params, "client", client); diff --git a/gateway/acp_client.h b/gateway/acp_client.h index 1257c8b..4038e62 100755 --- a/gateway/acp_client.h +++ b/gateway/acp_client.h @@ -1,6 +1,6 @@ /** * @file acp_client.h - * @brief ACP (Agent Client Protocol) WebSocket client for TuyaOpenClaw. + * @brief ACP (Agent Client Protocol) WebSocket client for TClaw. * * @version 2.0 * @date 2026-03-19 @@ -62,7 +62,7 @@ void acp_client_set_reply_cb(acp_reply_cb_t cb, void *user_data); * @brief Initialise the ACP client and start the background task. * * Reads connection parameters from OPENCLAW_GATEWAY_HOST, OPENCLAW_GATEWAY_PORT, - * OPENCLAW_GATEWAY_TOKEN, and TUYAOPENCLAW_DEVICE_ID (all defined in tuya_app_config.h). + * OPENCLAW_GATEWAY_TOKEN, and TCLAW_DEVICE_ID (all defined in tuya_app_config.h). * The background task handles connection, reconnection, and frame I/O. * * @return OPRT_OK on success, error code on failure. diff --git a/gateway/ws_server.c b/gateway/ws_server.c index 60ac3eb..9de2cb7 100644 --- a/gateway/ws_server.c +++ b/gateway/ws_server.c @@ -1,6 +1,6 @@ /** * @file ws_server.c - * @brief WebSocket server implementation for TuyaOpenClaw gateway + * @brief WebSocket server implementation for TClaw gateway * * Ported from TuyaOpen/apps/mimiclaw/gateway/ws_server.c. * Key adaptations: diff --git a/gateway/ws_server.h b/gateway/ws_server.h index c83f8cf..dae738c 100644 --- a/gateway/ws_server.h +++ b/gateway/ws_server.h @@ -1,6 +1,6 @@ /** * @file ws_server.h - * @brief WebSocket server for TuyaOpenClaw gateway + * @brief WebSocket server for TClaw gateway * * Provides a lightweight WebSocket server that accepts external client * connections. Text messages received from clients are forwarded to the diff --git a/heartbeat/heartbeat.c b/heartbeat/heartbeat.c index 5151be9..8285de8 100644 --- a/heartbeat/heartbeat.c +++ b/heartbeat/heartbeat.c @@ -1,6 +1,6 @@ /** * @file heartbeat.c - * @brief Heartbeat service for TuyaOpenClaw + * @brief Heartbeat service for TClaw * @version 0.1 * @date 2025-03-25 * diff --git a/heartbeat/heartbeat.h b/heartbeat/heartbeat.h index 3864739..079ec8c 100644 --- a/heartbeat/heartbeat.h +++ b/heartbeat/heartbeat.h @@ -1,6 +1,6 @@ /** * @file heartbeat.h - * @brief Heartbeat service for TuyaOpenClaw + * @brief Heartbeat service for TClaw * @version 0.1 * @date 2025-03-25 * diff --git a/include/app_base_config.h b/include/app_base_config.h index a67d4b3..a776166 100644 --- a/include/app_base_config.h +++ b/include/app_base_config.h @@ -1,6 +1,6 @@ /** * @file app_base_config.h - * @brief Base configuration macros and helpers for TuyaOpenClaw. + * @brief Base configuration macros and helpers for TClaw. * * Consolidates: * - Filesystem type selection, root paths, and claw_f* / claw_fs_* macros @@ -219,7 +219,7 @@ static inline void app_cfg_get_gw_token(char *out, size_t out_size) static inline void app_cfg_get_device_id(char *out, size_t out_size) { - app_kv_get_string(APP_KV_DEVICE_ID, TUYAOPENCLAW_DEVICE_ID, out, out_size); + app_kv_get_string(APP_KV_DEVICE_ID, TCLAW_DEVICE_ID, out, out_size); } #ifdef __cplusplus diff --git a/include/tuyaopen_claw_chat.h b/include/tclaw_chat.h similarity index 74% rename from include/tuyaopen_claw_chat.h rename to include/tclaw_chat.h index c9689d5..dfa3271 100755 --- a/include/tuyaopen_claw_chat.h +++ b/include/tclaw_chat.h @@ -1,12 +1,12 @@ /** - * @file tuyaopen_claw_chat.h - * @brief tuyaopen_claw_chat module: AI stream event bridge for TuyaOpenClaw + * @file tclaw_chat.h + * @brief tclaw_chat module: AI stream event bridge for TClaw * @version 0.1 * @date 2025-03-25 */ -#ifndef __TUYAOPEN_CLAW_CHAT_H__ -#define __TUYAOPEN_CLAW_CHAT_H__ +#ifndef __TCLAW_CHAT_H__ +#define __TCLAW_CHAT_H__ #include "tuya_cloud_types.h" #include "ai_chat_main.h" @@ -26,10 +26,10 @@ extern "C" { /*********************************************************** ********************function declaration******************** ***********************************************************/ -OPERATE_RET tuyaopen_claw_chat_init(void); +OPERATE_RET tclaw_chat_init(void); #ifdef __cplusplus } #endif -#endif /* __TUYAOPEN_CLAW_CHAT_H__ */ +#endif /* __TCLAW_CHAT_H__ */ diff --git a/include/tuya_app_config.h b/include/tuya_app_config.h index f8d4bed..f107446 100755 --- a/include/tuya_app_config.h +++ b/include/tuya_app_config.h @@ -84,8 +84,8 @@ extern "C" { #define OPENCLAW_GATEWAY_TOKEN "" /* Set in tuya_app_config_secrets.h */ #endif -#ifndef TUYAOPENCLAW_DEVICE_ID -#define TUYAOPENCLAW_DEVICE_ID "tuyaopenclaw-001" /* Unique per device, e.g. MAC address */ +#ifndef TCLAW_DEVICE_ID +#define TCLAW_DEVICE_ID "tclaw-001" /* Unique per device, e.g. MAC address */ #endif #ifdef __cplusplus diff --git a/include/tuya_app_config_secrets.h.example b/include/tuya_app_config_secrets.h.example index e9b5e25..9f26e65 100644 --- a/include/tuya_app_config_secrets.h.example +++ b/include/tuya_app_config_secrets.h.example @@ -43,7 +43,7 @@ extern "C" { #define OPENCLAW_GATEWAY_HOST "xxx.xxx.xxx.xxx" #define OPENCLAW_GATEWAY_PORT 18789 #define OPENCLAW_GATEWAY_TOKEN "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -#define TUYAOPENCLAW_DEVICE_ID "tuyaopenclaw-001" +#define TCLAW_DEVICE_ID "tclaw-001" #ifdef __cplusplus } diff --git a/memory/memory_manager.c b/memory/memory_manager.c index 24e991d..9f4ffa8 100644 --- a/memory/memory_manager.c +++ b/memory/memory_manager.c @@ -1,6 +1,6 @@ /** * @file memory_manager.c - * @brief Long-term memory and daily notes manager for TuyaOpenClaw + * @brief Long-term memory and daily notes manager for TClaw * @version 0.1 * @date 2026-03-04 * diff --git a/memory/memory_manager.h b/memory/memory_manager.h index bceb361..94631a9 100644 --- a/memory/memory_manager.h +++ b/memory/memory_manager.h @@ -1,6 +1,6 @@ /** * @file memory_manager.h - * @brief Long-term memory and daily notes manager for TuyaOpenClaw + * @brief Long-term memory and daily notes manager for TClaw * @version 0.1 * @date 2026-03-04 * diff --git a/memory/session_manager.c b/memory/session_manager.c index f1a4ecc..c2c8018 100644 --- a/memory/session_manager.c +++ b/memory/session_manager.c @@ -1,6 +1,6 @@ /** * @file session_manager.c - * @brief Multi-session conversation history manager for TuyaOpenClaw + * @brief Multi-session conversation history manager for TClaw * @version 0.1 * @date 2026-03-04 * diff --git a/memory/session_manager.h b/memory/session_manager.h index d9940f2..9350aa9 100644 --- a/memory/session_manager.h +++ b/memory/session_manager.h @@ -1,6 +1,6 @@ /** * @file session_manager.h - * @brief Multi-session conversation history manager for TuyaOpenClaw + * @brief Multi-session conversation history manager for TClaw * @version 0.1 * @date 2026-03-04 * diff --git a/skills/skill_loader.c b/skills/skill_loader.c index 3865e23..8059bd6 100644 --- a/skills/skill_loader.c +++ b/skills/skill_loader.c @@ -1,6 +1,6 @@ /** * @file skill_loader.c - * @brief Skill loader implementation for TuyaOpenClaw + * @brief Skill loader implementation for TClaw * * Ported from TuyaOpen/apps/mimiclaw/skills/skill_loader.c. * Key adaptations: @@ -72,7 +72,7 @@ #define BUILTIN_SKILL_CREATOR \ "# Skill Creator\n" \ "\n" \ - "Create new skills for TuyaOpenClaw.\n" \ + "Create new skills for TClaw.\n" \ "\n" \ "## When to use\n" \ "When the user asks to create a new skill, teach the bot " \ diff --git a/skills/skill_loader.h b/skills/skill_loader.h index 171c444..bb4e7dc 100644 --- a/skills/skill_loader.h +++ b/skills/skill_loader.h @@ -1,6 +1,6 @@ /** * @file skill_loader.h - * @brief Skill loader for TuyaOpenClaw + * @brief Skill loader for TClaw * * Manages skill files (.md) on the filesystem. Built-in skills are * installed on first boot; users / the AI can create custom skills diff --git a/src/app_cli_cmd.c b/src/app_cli_cmd.c index 59223b5..86bc0cc 100644 --- a/src/app_cli_cmd.c +++ b/src/app_cli_cmd.c @@ -1,6 +1,6 @@ /** * @file cli_cmd.c - * @brief Unified CLI implementation for TuyaOpenClaw (config commands only) + * @brief Unified CLI implementation for TClaw (config commands only) * @version 0.1 * @date 2026-04-08 * @copyright Copyright (c) Tuya Inc. All Rights Reserved. @@ -401,7 +401,7 @@ static void cmd_help(int argc, char *argv[]) (void)argc; (void)argv; - tal_cli_echo("=== TuyaOpenClaw CLI (config) ==="); + tal_cli_echo("=== TClaw CLI (config) ==="); tal_cli_echo(""); tal_cli_echo("[Config]"); cli_echof_(" %-28s %s", "cfg_show", "Show effective config (KV > build)"); @@ -412,7 +412,7 @@ static void cmd_help(int argc, char *argv[]) cli_echof_(" %-28s %s", "cfg_set_gw_host ", "Set OpenClaw gateway host"); cli_echof_(" %-28s %s", "cfg_set_gw_port ", "Set OpenClaw gateway port"); cli_echof_(" %-28s %s", "cfg_set_gw_token ", "Set OpenClaw gateway token"); - cli_echof_(" %-28s %s", "cfg_set_device_id ", "Set TuyaOpenClaw device ID"); + cli_echof_(" %-28s %s", "cfg_set_device_id ", "Set TClaw device ID"); cli_echof_(" %-28s %s", "cfg_set_channel_mode ", "Set IM channel mode (telegram|discord|feishu|weixin|qqbot|OFF)"); cli_echof_(" %-28s %s", "cfg_set_tg_token ", "Set Telegram token"); cli_echof_(" %-28s %s", "cfg_set_dc_token ", "Set Discord token"); @@ -477,7 +477,7 @@ static void cmd_cfg_show(int argc, char *argv[]) snprintf(port_text, sizeof(port_text), "%u", (unsigned)OPENCLAW_GATEWAY_PORT); cli_print_app_cfg_item_("gw_port", APP_KV_GW_PORT, port_text, false); cli_print_app_cfg_item_("gw_token", APP_KV_GW_TOKEN, OPENCLAW_GATEWAY_TOKEN, true); - cli_print_app_cfg_item_("device_id", APP_KV_DEVICE_ID, TUYAOPENCLAW_DEVICE_ID, true); + cli_print_app_cfg_item_("device_id", APP_KV_DEVICE_ID, TCLAW_DEVICE_ID, true); tal_cli_echo("[IM]"); cli_print_im_cfg_item_("channel_mode", IM_NVS_BOT, IM_NVS_KEY_CHANNEL_MODE, IM_SECRET_CHANNEL_MODE, false); diff --git a/src/tuyaopen_claw_chat.c b/src/tclaw_chat.c similarity index 98% rename from src/tuyaopen_claw_chat.c rename to src/tclaw_chat.c index a5baf5a..cfceecf 100755 --- a/src/tuyaopen_claw_chat.c +++ b/src/tclaw_chat.c @@ -1,6 +1,6 @@ /** - * @file tuyaopen_claw_chat.c - * @brief AI stream event bridge for TuyaOpenClaw + * @file tclaw_chat.c + * @brief AI stream event bridge for TClaw * @version 0.1 * @date 2025-03-25 */ @@ -17,7 +17,7 @@ #if defined(ENABLE_COMP_AI_VIDEO) && (ENABLE_COMP_AI_VIDEO == 1) #include "ai_video_input.h" #endif -#include "tuyaopen_claw_chat.h" +#include "tclaw_chat.h" #include "agent_loop.h" #include "acp_client.h" @@ -226,7 +226,7 @@ static void __ai_chat_handle_event(AI_NOTIFY_EVENT_T *event) extern void app_ui_action_register(void); #endif -OPERATE_RET tuyaopen_claw_chat_init(void) +OPERATE_RET tclaw_chat_init(void) { OPERATE_RET rt = OPRT_OK; diff --git a/src/tuya_app_main.c b/src/tuya_app_main.c index 175c9fd..722a186 100755 --- a/src/tuya_app_main.c +++ b/src/tuya_app_main.c @@ -47,7 +47,7 @@ #include "ble_mgr.h" #endif -#include "tuyaopen_claw_chat.h" +#include "tclaw_chat.h" #include "reset_netcfg.h" #include "app_im.h" #include "sys_bus.h" @@ -390,9 +390,9 @@ void user_main(void) PR_ERR("sys_bus_init failed rt:%d", ret); } - ret = tuyaopen_claw_chat_init(); + ret = tclaw_chat_init(); if (ret != OPRT_OK) { - PR_ERR("tuyaopen_claw_chat_init failed rt:%d", ret); + PR_ERR("tclaw_chat_init failed rt:%d", ret); } ret = app_im_init(); diff --git a/tools/tool_cron.c b/tools/tool_cron.c index dcc6783..4c6e823 100644 --- a/tools/tool_cron.c +++ b/tools/tool_cron.c @@ -1,6 +1,6 @@ /** * @file tool_cron.c - * @brief MCP cron (scheduled task) tools for TuyaOpenClaw + * @brief MCP cron (scheduled task) tools for TClaw * @version 0.1 * @date 2025-03-25 * diff --git a/tools/tool_cron.h b/tools/tool_cron.h index df89207..84d542b 100644 --- a/tools/tool_cron.h +++ b/tools/tool_cron.h @@ -1,6 +1,6 @@ /** * @file tool_cron.h - * @brief MCP cron (scheduled task) tools for TuyaOpenClaw + * @brief MCP cron (scheduled task) tools for TClaw * @version 0.1 * @date 2025-03-25 * diff --git a/tools/tool_exec.c b/tools/tool_exec.c index 0e51ccf..4010013 100644 --- a/tools/tool_exec.c +++ b/tools/tool_exec.c @@ -1,6 +1,6 @@ /** * @file tool_exec.c - * @brief MCP exec/system tools for TuyaOpenClaw + * @brief MCP exec/system tools for TClaw * @version 0.2 * @date 2026 -04-20 * diff --git a/tools/tool_exec.h b/tools/tool_exec.h index f361610..8ee3b3b 100644 --- a/tools/tool_exec.h +++ b/tools/tool_exec.h @@ -1,6 +1,6 @@ /** * @file tool_exec.h - * @brief MCP exec/system tools for TuyaOpenClaw + * @brief MCP exec/system tools for TClaw * @version 0.1 * @date 2025-03-25 * diff --git a/tools/tool_files.c b/tools/tool_files.c index 99c6721..b21505e 100644 --- a/tools/tool_files.c +++ b/tools/tool_files.c @@ -1,6 +1,6 @@ /** * @file tool_files.c - * @brief MCP file operation tools for TuyaOpenClaw + * @brief MCP file operation tools for TClaw * @version 0.1 * @date 2025-03-25 * diff --git a/tools/tool_files.h b/tools/tool_files.h index 453fce1..2eb2baa 100644 --- a/tools/tool_files.h +++ b/tools/tool_files.h @@ -1,6 +1,6 @@ /** * @file tool_files.h - * @brief MCP file operation tools for TuyaOpenClaw + * @brief MCP file operation tools for TClaw * @version 0.2 * @date 2025-03-25 * diff --git a/tools/tool_hw.c b/tools/tool_hw.c index 8708c56..2866129 100644 --- a/tools/tool_hw.c +++ b/tools/tool_hw.c @@ -1,6 +1,6 @@ /** * @file tool_hw.c - * @brief MCP hardware peripheral tools for TuyaOpenClaw (T5 platform) + * @brief MCP hardware peripheral tools for TClaw (T5 platform) * @version 0.2 * @date 2026-03-31 * diff --git a/tools/tool_hw.h b/tools/tool_hw.h index acef83d..a559e62 100644 --- a/tools/tool_hw.h +++ b/tools/tool_hw.h @@ -1,6 +1,6 @@ /** * @file tool_hw.h - * @brief MCP hardware peripheral tools for TuyaOpenClaw + * @brief MCP hardware peripheral tools for TClaw * @version 0.1 * @date 2026-03-31 * diff --git a/tools/tools_register.c b/tools/tools_register.c index 4b61fa9..c164903 100644 --- a/tools/tools_register.c +++ b/tools/tools_register.c @@ -1,6 +1,6 @@ /** * @file tools_register.c - * @brief MCP tools registration for TuyaOpenClaw + * @brief MCP tools registration for TClaw * @version 0.1 * @date 2025-03-25 * @@ -48,7 +48,7 @@ static OPERATE_RET __ai_mcp_init(void *data) OPERATE_RET rt = OPRT_OK; #if defined(PLATFORM_LINUX) && (PLATFORM_LINUX == 1) - rt = ai_mcp_server_init("TuyaOpenClaw MCP Server", "1.0"); + rt = ai_mcp_server_init("TClaw MCP Server", "1.0"); if (rt != OPRT_OK) { return rt; } @@ -113,7 +113,7 @@ static OPERATE_RET __ai_mcp_init(void *data) * @brief Initialize and register all MCP tools * * This function is called during MCP server initialization to register - * all custom tools for the TuyaOpenClaw project. + * all custom tools for the TClaw project. * * @return OPERATE_RET OPRT_OK on success, error code on failure */ @@ -123,7 +123,7 @@ OPERATE_RET tool_registry_init(void) tal_event_subscribe(EVENT_MQTT_CONNECTED, "ai_mcp_init", __ai_mcp_init, SUBSCRIBE_TYPE_ONETIME); - PR_DEBUG("TuyaOpenClaw MCP tools registered successfully"); + PR_DEBUG("TClaw MCP tools registered successfully"); return rt; }