feat(tools): fabric-send-message + fabric-channel-list + fabric-message-history #4

Merged
hzhang merged 1 commits from feat/fabric-send-and-discover-tools into main 2026-05-22 22:11:07 +00:00
Contributor

Plugin had no way for an agent to send text into a specific channel proactively — outbound only went through the channel-reply path. discussion-complete calls client.postMessage internally but only for close-time summary.

Adds 3 new tools + declares 2 existing-but-silent ones in contracts.tools:

  • fabric-send-message {guildNodeId, channelId, content}{ok, messageId, seq}. Author = calling agent
  • fabric-channel-list {guildNodeId, nameFilter?, xType?, includeClosed?}{ok, count, channels[]}. Backend filters to public + member channels; client-side nameFilter is case-insensitive substring
  • fabric-message-history {guildNodeId, channelId, seqFrom?, seqTo?, limit?}{ok, page, messages[]}. Tail-by-default: omit seqFrom/seqTo and it fetches channel head from listChannels then asks for [head-limit+1, head]. Limit default 20, max 200

Also adds fabric-canvas and fabric-channel to contracts.tools — they were already registered but openclaw silently dropped them per the manifest contract (verified by sim log plugin tool is undeclared (fabric): fabric-canvas).

2 supporting FabricClient helpers (listChannels, listMessages).

🤖 Generated with Claude Code

Plugin had no way for an agent to send text into a specific channel proactively — outbound only went through the channel-reply path. `discussion-complete` calls `client.postMessage` internally but only for close-time summary. Adds 3 new tools + declares 2 existing-but-silent ones in `contracts.tools`: - `fabric-send-message {guildNodeId, channelId, content}` → `{ok, messageId, seq}`. Author = calling agent - `fabric-channel-list {guildNodeId, nameFilter?, xType?, includeClosed?}` → `{ok, count, channels[]}`. Backend filters to public + member channels; client-side nameFilter is case-insensitive substring - `fabric-message-history {guildNodeId, channelId, seqFrom?, seqTo?, limit?}` → `{ok, page, messages[]}`. Tail-by-default: omit seqFrom/seqTo and it fetches channel head from listChannels then asks for `[head-limit+1, head]`. Limit default 20, max 200 Also adds `fabric-canvas` and `fabric-channel` to `contracts.tools` — they were already registered but openclaw silently dropped them per the manifest contract (verified by sim log `plugin tool is undeclared (fabric): fabric-canvas`). 2 supporting `FabricClient` helpers (`listChannels`, `listMessages`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
hzhang added 1 commit 2026-05-22 22:11:02 +00:00
Plugin previously had no way for an agent to send text into a specific
channel proactively — outbound went only through the channel-reply
path (responds to the channel that woke the agent). discussion-complete
internally called client.postMessage but only for the close-time
summary, no general-purpose surface.

Three new tools (+ declare existing fabric-canvas / fabric-channel that
were registered but missing from contracts.tools so agents couldn't
see them per the openclaw plugin contract):

  * fabric-send-message {guildNodeId, channelId, content}
      → {ok, messageId, seq}
    Author = calling agent. Use for ARD broadcasts, follow-ups in a
    different channel, etc.

  * fabric-channel-list {guildNodeId, nameFilter?, xType?, includeClosed?}
      → {ok, count, channels[]}
    Backend filters to public + member channels; nameFilter is client-
    side case-insensitive substring; xType / includeClosed apply post-
    fetch. Returns id/name/xType/lastSeq so callers can pipe into the
    other tools.

  * fabric-message-history {guildNodeId, channelId, seqFrom?, seqTo?, limit?}
      → {ok, page, messages[]}
    Tail-by-default: omit seqFrom/seqTo and the tool fetches the
    channel head from listChannels then asks for [head-limit+1, head].
    Limit default 20, max 200. Backend rejects non-participants.

Plus 3 supporting client methods (listChannels, listMessages — both
GET via existing req helper).

contracts.tools updated to declare these 5 (3 new + 2 previously-
silent ones). Verified earlier in sim restart logs: openclaw warned
'plugin tool is undeclared (fabric): fabric-canvas / fabric-channel'
so agents couldn't use them despite registerTool firing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hzhang merged commit 86e8d2ac8d into main 2026-05-22 22:11:07 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nav/Fabric.OpenclawPlugin#4