feat: loadable openclaw channel plugin v1 (agent=account)

Rewritten against the real openclaw v2026.5.7 plugin SDK (generic
third-party channel path): createChannelPluginBase + createChatChannelPlugin
with required capabilities, minimal ChannelSetupAdapter, agent=account
config resolution, attached outbound -> Fabric POST, inbound socket per
account -> runtime.channel.turn (wakeup->admission). Compat notes mark
SDK-coupled seams for future openclaw upgrades. Verified: builds clean,
installs, 'openclaw channels list' -> Fabric installed/configured/enabled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
h z
2026-05-15 17:54:32 +01:00
parent 7fed6d07f6
commit ece77ff2c7
8 changed files with 412 additions and 159 deletions

View File

@@ -7,17 +7,22 @@ export class FabricInbound {
client;
identity;
log;
accounts;
sockets = [];
timers = [];
seen = new Set();
constructor(runtime, client, identity, log) {
constructor(runtime, client, identity, log, accounts = []) {
this.runtime = runtime;
this.client = client;
this.identity = identity;
this.log = log;
this.accounts = accounts;
}
async start() {
for (const entry of this.identity.list()) {
const entries = this.accounts.length > 0
? this.accounts.map((a) => ({ agentId: a.agentId, fabricApiKey: a.fabricApiKey }))
: this.identity.list();
for (const entry of entries) {
try {
const session = await this.client.agentLogin(entry.fabricApiKey);
this.identity.upsert({