feat: add zalouser channel + directory CLI (#1032) (thanks @suminhthanh)

- Unified UX: channels login + message send; no plugin-specific top-level command\n- Added generic directory CLI for channel identity/groups\n- Docs: channel + plugin pages
This commit is contained in:
tsu
2026-01-16 13:28:18 -08:00
committed by GitHub
parent 16768a9998
commit 390bd11f33
28 changed files with 2820 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import type { RuntimeEnv } from "../../runtime.js";
import type {
ChannelAccountSnapshot,
ChannelAccountState,
ChannelDirectoryEntry,
ChannelGroupContext,
ChannelHeartbeatDeps,
ChannelLogSink,
@@ -219,6 +220,35 @@ export type ChannelHeartbeatAdapter = {
};
};
export type ChannelDirectoryAdapter = {
self?: (params: {
cfg: ClawdbotConfig;
accountId?: string | null;
runtime: RuntimeEnv;
}) => Promise<ChannelDirectoryEntry | null>;
listPeers?: (params: {
cfg: ClawdbotConfig;
accountId?: string | null;
query?: string | null;
limit?: number | null;
runtime: RuntimeEnv;
}) => Promise<ChannelDirectoryEntry[]>;
listGroups?: (params: {
cfg: ClawdbotConfig;
accountId?: string | null;
query?: string | null;
limit?: number | null;
runtime: RuntimeEnv;
}) => Promise<ChannelDirectoryEntry[]>;
listGroupMembers?: (params: {
cfg: ClawdbotConfig;
accountId?: string | null;
groupId: string;
limit?: number | null;
runtime: RuntimeEnv;
}) => Promise<ChannelDirectoryEntry[]>;
};
export type ChannelElevatedAdapter = {
allowFromFallback?: (params: {
cfg: ClawdbotConfig;

View File

@@ -216,6 +216,17 @@ export type ChannelMessagingAdapter = {
normalizeTarget?: (raw: string) => string | undefined;
};
export type ChannelDirectoryEntryKind = "user" | "group" | "channel";
export type ChannelDirectoryEntry = {
kind: ChannelDirectoryEntryKind;
id: string;
name?: string;
handle?: string;
avatarUrl?: string;
raw?: unknown;
};
export type ChannelMessageActionName = ChannelMessageActionNameFromList;
export type ChannelMessageActionContext = {

View File

@@ -3,6 +3,7 @@ import type {
ChannelAuthAdapter,
ChannelCommandAdapter,
ChannelConfigAdapter,
ChannelDirectoryAdapter,
ChannelElevatedAdapter,
ChannelGatewayAdapter,
ChannelGroupAdapter,
@@ -51,6 +52,7 @@ export type ChannelPlugin<ResolvedAccount = any> = {
streaming?: ChannelStreamingAdapter;
threading?: ChannelThreadingAdapter;
messaging?: ChannelMessagingAdapter;
directory?: ChannelDirectoryAdapter;
actions?: ChannelMessageActionAdapter;
heartbeat?: ChannelHeartbeatAdapter;
// Channel-owned agent tools (login flows, etc.).

View File

@@ -8,6 +8,7 @@ export type {
ChannelAuthAdapter,
ChannelCommandAdapter,
ChannelConfigAdapter,
ChannelDirectoryAdapter,
ChannelElevatedAdapter,
ChannelGatewayAdapter,
ChannelGatewayContext,
@@ -30,6 +31,8 @@ export type {
ChannelAgentTool,
ChannelAgentToolFactory,
ChannelCapabilities,
ChannelDirectoryEntry,
ChannelDirectoryEntryKind,
ChannelGroupContext,
ChannelHeartbeatDeps,
ChannelId,