skynet-gateway
v0.1.0
Published
SkyNet multi-platform AI agent gateway for WeCom, DingTalk, Feishu, and WeChat
Readme
SkyNet Gateway
SkyNet Gateway is a multi-platform AI agent gateway for WeCom, DingTalk, Feishu, and WeChat iLink. It receives platform messages, normalizes them into a single inbound format, routes each chat to a Claude CLI session in tmux, and delivers replies back through the original platform.
This package is distributed as a single npm package. It includes the gateway runtime, CLI wrapper, reply helpers, TypeScript declarations, and the cross-border e-commerce utility exports.
Requirements
- Node.js 20 or newer
- tmux
- Claude Code authentication on the host. The package depends on
@anthropic-ai/claude-codeand starts that bundled CLI by default; setCLAUDE_CODE_BINif you want to use a customclaudebinary. - Bot credentials for the platform adapters you enable
Install
npm install -g skynet-gatewayFor local development from this repository:
cd wecom-gateway
npm install
npm run buildQuick Start
Create a local runtime config:
skynet-gateway initEdit the generated config:
~/.skynet-gateway/system_config.jsonThen start an instance:
skynet-gateway start --instance defaultCheck health:
skynet-gateway health --port 19980CLI
skynet-gateway init [--config <path>] [--force]
skynet-gateway start --instance <id> [--config <path>]
skynet-gateway health [--port <port>]The CLI sets SKYNET_CONFIG, SKYNET_INSTANCE, and SKYNET_PROJECT_ROOT
before launching the gateway. Runtime data should live outside the installed
package, normally under ~/.skynet-gateway.
Reply Helpers
The package also exposes executable reply helpers:
skynet-reply --text "reply text"
skynet-reply --markdown "**reply markdown**"
echo "long reply" | skynet-reply --stdinwecom-reply is retained as a backward-compatible alias.
Programmatic Exports
The package root is side-effect free:
import type { InboundEvent } from "skynet-gateway";
import { crossBorder } from "skynet-gateway";Cross-border tools can also be imported directly:
import { PriceCalculator, generateTitleFromTemplate } from "skynet-gateway/cross-border";Do not import dist/index.js directly; it starts the gateway process.
Configuration
A template is included at:
templates/system_config.example.jsonImportant fields:
reply_port: local HTTP reply server portdata_dir: runtime data directory; absolute paths and~/...are supportedchannels: platform bot credentialsadmins: verified sender identity mappinguser_access: regular user access and quota policy
Never publish or commit real bot secrets, instance configs, databases, logs, or credential vault files.
Publishing Checklist
npm ci
npm run typecheck
npm test
npm run build
npm pack --dry-run
npm publishBefore a public release, choose and record the legal license. This package is
currently marked UNLICENSED to avoid granting an unintended license.
