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:
@@ -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;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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.).
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user