8b2691979091a0e2b4c5d04fde6a0a455e87126f
Yonexus.Client
Yonexus.Client is the follower-side plugin for a Yonexus network.
It runs on non-central OpenClaw instances and is responsible for:
- connecting outbound to
Yonexus.Server - managing local identifier + trust material
- generating a local Ed25519 keypair on first run
- completing out-of-band pairing
- authenticating on reconnect with signed proof
- sending periodic heartbeats
- dispatching inbound rule messages to locally registered handlers
Status
Current state: scaffold + core runtime MVP
Implemented in this repository today:
- config validation
- local state store for identifier / keypair / secret
- automatic first-run keypair generation
- WebSocket client transport with reconnect backoff
- hello / hello_ack handling
- pairing pending flow + pairing code submission
- auth_request generation and auth state transitions
- heartbeat loop
- rule registry + send-to-server APIs
Still pending before production use:
- automated Client unit/integration tests
- richer operator UX for entering pairing codes
- final OpenClaw lifecycle hook integration
- deployment/troubleshooting docs specific to follower instances
Configuration
Required config shape:
{
"mainHost": "wss://example.com/yonexus",
"identifier": "client-a",
"notifyBotToken": "<discord-bot-token>",
"adminUserId": "123456789012345678"
}
Field notes
mainHost: WebSocket URL of the Yonexus server (ws://orwss://)identifier: unique client identity inside the Yonexus networknotifyBotToken: currently kept aligned with system-level config expectationsadminUserId: admin reference used by the broader Yonexus pairing model
Runtime Overview
Startup flow:
- validate config
- load local state
- generate keypair if missing
- connect to
mainHost - send
hello - continue into pairing or auth depending on server response
Authentication flow:
- receive
hello_ack(auth_required)orpair_success - build proof from
secret + nonce + timestampusing canonical JSON bytes - sign with local Ed25519 private key
- send
auth_request - on success, enter authenticated state and start heartbeat loop
Pairing flow:
- receive
pair_requestmetadata from server - obtain pairing code from the human-admin out-of-band channel
- submit pairing code through
submitPairingCode() - persist returned secret after
pair_success
Public API Surface
Exported runtime helpers currently include:
sendMessageToServer(message: string): Promise<boolean>
sendRuleMessage(ruleIdentifier: string, content: string): Promise<boolean>
registerRule(rule: string, processor: (message: string) => unknown): void
submitPairingCode(pairingCode: string): Promise<boolean>
Rules:
- application messages must use
${rule_identifier}::${message_content} builtinis reserved and cannot be registered as an application rule
Local State
The client persists at least:
identifierprivateKeypublicKeysecret- key/auth/pair timestamps
This is enough to survive restarts and perform authenticated reconnects.
Development
Install dependencies and run type checks:
npm install
npm run check
Limitations
Current known limitations:
- no polished end-user pairing code entry UX yet
- no client unit/integration test suite yet
- no offline buffering/queueing
- no end-to-end encrypted payload channel beyond current pairing/auth model
Related Repos
- Umbrella:
../ - Shared protocol:
../Yonexus.Protocol - Server plugin:
../Yonexus.Server
Description
Languages
TypeScript
98.1%
JavaScript
1.9%