feat: working v1 — full Fabric<->openclaw round-trip verified
Real channel-turn dispatch (resolveAgentRoute + finalizeInboundContext + dispatchInboundReplyWithBase), wakeup->drop/dispatch, messaging target grammar (fabric:<id>) + outbound.sendText, tools use execute/parameters. Verified live: human msg in Fabric -> wakeup -> openclaw agent runs -> reply posted back into the Fabric channel as the agent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
12
src/tools.ts
12
src/tools.ts
@@ -37,7 +37,7 @@ export function registerFabricTools(
|
||||
api.registerTool((ctx: Ctx) => ({
|
||||
name: 'fabric-register',
|
||||
description: "Register this agent's Fabric API key (minted via Center CLI `user apikey`).",
|
||||
inputSchema: {
|
||||
parameters: {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
required: ['fabricApiKey'],
|
||||
@@ -45,7 +45,7 @@ export function registerFabricTools(
|
||||
fabricApiKey: { type: 'string', description: 'Fabric Center API key (fak_…)' },
|
||||
},
|
||||
},
|
||||
handler: async (params: { fabricApiKey: string }) => {
|
||||
execute: async (params: { fabricApiKey: string }) => {
|
||||
const agentId = ctx.agentId;
|
||||
if (!agentId) return { ok: false, error: 'no agent context' };
|
||||
const session = await client.agentLogin(params.fabricApiKey);
|
||||
@@ -63,7 +63,7 @@ export function registerFabricTools(
|
||||
api.registerTool((ctx: Ctx) => ({
|
||||
name: `create-${kind}-channel`,
|
||||
description: `Create a Fabric ${kind} channel (x_type=${X_BY_KIND[kind]}).`,
|
||||
inputSchema: {
|
||||
parameters: {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
required: ['guildNodeId', 'name'],
|
||||
@@ -76,7 +76,7 @@ export function registerFabricTools(
|
||||
listeners: { type: 'array', items: { type: 'string' } },
|
||||
},
|
||||
},
|
||||
handler: async (p: {
|
||||
execute: async (p: {
|
||||
guildNodeId: string;
|
||||
name: string;
|
||||
isPublic?: boolean;
|
||||
@@ -106,7 +106,7 @@ export function registerFabricTools(
|
||||
api.registerTool((ctx: Ctx) => ({
|
||||
name: 'discussion-complete',
|
||||
description: 'Conclude a discussion: post a summary then close the channel.',
|
||||
inputSchema: {
|
||||
parameters: {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
required: ['guildNodeId', 'channelId', 'summary'],
|
||||
@@ -117,7 +117,7 @@ export function registerFabricTools(
|
||||
callbackChannelId: { type: 'string', description: 'optional channel to also post the summary to' },
|
||||
},
|
||||
},
|
||||
handler: async (p: {
|
||||
execute: async (p: {
|
||||
guildNodeId: string;
|
||||
channelId: string;
|
||||
summary: string;
|
||||
|
||||
Reference in New Issue
Block a user