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:
9
dist/fabric/src/inbound.js
vendored
9
dist/fabric/src/inbound.js
vendored
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user