@husile/clawnet
v0.5.4
Published
Relation-Driven Multi-Node Intelligent Collaboration Network
Maintainers
Readme
ClawNet
🤖 Relation-Driven Multi-Node Intelligent Collaboration Network
ClawNet | 中文版 | Windows 安装 | CLI 指南
📖 Overview
ClawNet is a multi-node intelligent collaboration system based on relation networks, featuring:
- Multi-platform message routing (WeChat, Telegram, etc.)
- Node relationship management and permission control
- Intelligent message distribution and processing
- Flexible plugin architecture
🚀 Key Features
- ✅ Multi-platform adapters (WeChat Official Account, Telegram Bot)
- ✅ Relation graph topology management
- ✅ Role-based permission control
- ✅ WebSocket real-time communication
- ✅ SQLite local storage
- ✅ Extensible plugin system
🛠️ Tech Stack
- Runtime: Node.js 20+
- Framework: Express.js
- Database: SQLite (better-sqlite3)
- Language: TypeScript
- Protocol: WebSocket, HTTP
📦 Installation
🪟 Windows Users: See Windows Installation Guide for detailed instructions.
# Using npm (recommended)
npm install @husile/clawnet
# If you encounter issues on Windows with better-sqlite3, use:
npm install @husile/clawnet --ignore-scripts
# Or use the memory mode (no database required):
const clawnet = new ClawNet({ storage: 'memory' });
# Using yarn
yarn add @husile/clawnet
# Using pnpm
pnpm add @husile/clawnet
# Or clone the repository
git clone https://github.com/Bsheepcoder/ClawNet.git
cd ClawNet
npm install⚙️ Configuration
Method 1: Environment Variables
export PORT=3000
export HOST=0.0.0.0
npm startMethod 2: .env File (Recommended)
# Create .env file
cat > .env << EOF
PORT=3000
HOST=0.0.0.0
EOF
# Start the server
npm start📁 Project Structure
ClawNet/
├── dist/ # Compiled JavaScript
├── src/ # TypeScript source code
│ ├── adapters/ # Platform adapters
│ ├── index.ts # Entry point
│ ├── server.ts # HTTP server
│ ├── websocket.ts # WebSocket server
│ ├── graph.ts # Relation graph
│ ├── permission.ts # Permission management
│ └── ...
├── bin/ # Executable files
├── cli/ # CLI tools
├── skill/ # OpenClaw skill integration
├── scripts/ # Utility scripts
└── package.json🚀 Quick Start
Build & Run
# Development mode
npm run dev
# Production mode
npm run build
npm start
# Or use the start script
./start.shUsage Example
const { Graph, Node } = require('@husile/clawnet');
// Create a relation graph
const graph = new Graph();
// Add nodes
const alice = graph.addNode('alice', { name: 'Alice', role: 'admin' });
const bob = graph.addNode('bob', { name: 'Bob', role: 'user' });
// Establish relationship
graph.addRelation(alice, bob, 'friend');
// Send message
graph.sendMessage(alice, bob, 'Hello, Bob!');Integration with OpenClaw
See skill/SKILL.md for details.
🌐 API Documentation
HTTP API
GET /health # Health check
POST /message # Send message
GET /nodes # Get node list
GET /relations # Get relation listWebSocket API
// Connect
const ws = new WebSocket('ws://localhost:3000/ws');
// Listen for messages
ws.onmessage = (event) => {
console.log('Received:', event.data);
};
// Send message
ws.send(JSON.stringify({
type: 'message',
from: 'alice',
to: 'bob',
content: 'Hello!'
}));🔒 Security
Important:
- This project does not include any configuration files or credentials
- All sensitive information must be configured by the user
- Do not commit
.envfiles to version control - Use environment variables or secret management services in production
🧪 Testing
# Run tests
npm test📄 License
MIT License - See LICENSE file for details
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📊 Project Status
- ✅ Version: 0.5.0
- ✅ Status: Active Development
- ✅ Node.js: >=20.0.0
- ✅ License: MIT
📝 Changelog
See CHANGELOG.md for a list of changes.
📮 Contact & Support
- GitHub: @Bsheepcoder
- Project: https://github.com/Bsheepcoder/ClawNet
- Issues: https://github.com/Bsheepcoder/ClawNet/issues
- npm: https://www.npmjs.com/package/@husile/clawnet
🙏 Acknowledgments
- OpenClaw - AI Agent Framework
- Express.js - Web Framework
- Better-SQLite3 - SQLite Database
⭐ If this project helps you, please give it a star! ⭐
🤝 Contributions, issues, and feature requests are welcome!
📋 Quick Reference
| Item | Value | |------|-------| | Package Name | @husile/clawnet | | Current Version | 0.5.0 | | Node.js | >= 20.0.0 | | License | MIT | | Repository | GitHub | | npm | npmjs.com |
Built with ❤️ by the ClawNet Team
