Files
wechat-access-unqclawed/websocket/index.ts
HenryXiaoYang ba754ccc31 feat: add WeChat QR code login and AGP WebSocket channel plugin
- Auth module: WeChat OAuth2 scan-to-login flow with terminal QR code
- Token persistence to ~/.openclaw/wechat-access-auth.json (chmod 600)
- Token resolution: config > saved state > interactive login
- Invite code verification (configurable bypass)
- Production/test environment support
- AGP WebSocket client with heartbeat, reconnect, wake detection
- Message handler: Agent dispatch with streaming text and tool calls
- Random device GUID generation (persisted, no real machine ID)
2026-03-10 02:29:06 +08:00

41 lines
863 B
TypeScript

// ============================================
// WebSocket 模块导出
// ============================================
// 类型定义
export type {
AGPEnvelope,
AGPMethod,
ContentBlock,
ToolCall,
ToolCallKind,
ToolCallStatus,
ToolLocation,
PromptPayload,
CancelPayload,
UpdatePayload,
UpdateType,
PromptResponsePayload,
StopReason,
PromptMessage,
CancelMessage,
UpdateMessage,
PromptResponseMessage,
WebSocketClientConfig,
ConnectionState,
WebSocketClientCallbacks,
} from "./types.js";
// WebSocket 客户端
export { WechatAccessWebSocketClient } from "./websocket-client.js";
// 消息处理器
export { handlePrompt, handleCancel } from "./message-handler.js";
// 消息适配器
export {
extractTextFromContent,
promptPayloadToFuwuhaoMessage,
buildWebSocketMessageContext,
} from "./message-adapter.js";