openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
71 lines (70 loc) • 3.65 kB
TypeScript
import { i as OpenClawConfig } from "./types.openclaw-DBHlrrVj.js";
import { n as ChannelConfigSchema } from "./types.config-D1pSqbn8.js";
import { $n as PluginRuntime } from "./types-C0dQmare.js";
import { a as ClickClackMessage, c as ClickClackWorkspace, i as ClickClackEvent, l as CoreConfig, o as ClickClackTarget, r as ClickClackChannel, s as ClickClackUser, u as ResolvedClickClackAccount } from "./channel-BCfSVIpP.js";
import { WebSocket as WebSocket$1 } from "ws";
//#region extensions/clickclack/src/accounts.d.ts
declare const listClickClackAccountIds: (cfg: OpenClawConfig) => string[], resolveDefaultClickClackAccountId: (cfg: OpenClawConfig) => string;
/**
* Builds the normalized account snapshot used by gateway, outbound delivery,
* status reporting, and channel routing.
*/
declare function resolveClickClackAccount(params: {
cfg: CoreConfig;
accountId?: string | null;
env?: NodeJS.ProcessEnv;
}): ResolvedClickClackAccount;
/**
* Returns all enabled accounts, including the implicit default account when
* legacy top-level ClickClack config is present.
*/
declare function listEnabledClickClackAccounts(cfg: CoreConfig): ResolvedClickClackAccount[];
//#endregion
//#region extensions/clickclack/src/config-schema.d.ts
/**
* Config schema exported to core so `openclaw doctor` and config validation
* understand both default and named ClickClack accounts.
*/
declare const clickClackConfigSchema: ChannelConfigSchema;
//#endregion
//#region extensions/clickclack/src/http-client.d.ts
type ClientOptions = {
baseUrl: string;
token: string;
fetch?: typeof fetch;
};
/**
* Creates a typed client for the ClickClack API using bearer-token auth.
*/
declare function createClickClackClient(options: ClientOptions): {
me: () => Promise<ClickClackUser>;
workspaces: () => Promise<ClickClackWorkspace[]>;
channels: (workspaceId: string) => Promise<ClickClackChannel[]>;
channelMessages: (channelId: string, afterSeq: number, limit?: number) => Promise<ClickClackMessage[]>;
directMessages: (conversationId: string, afterSeq: number, limit?: number) => Promise<ClickClackMessage[]>;
thread: (messageId: string) => Promise<{
root: ClickClackMessage;
replies: ClickClackMessage[];
}>;
createChannelMessage: (channelId: string, body: string) => Promise<ClickClackMessage>;
createThreadReply: (messageId: string, body: string) => Promise<ClickClackMessage>;
createDirectConversation: (workspaceId: string, memberIds: string[]) => Promise<{
id: string;
}>;
createDirectMessage: (conversationId: string, body: string) => Promise<ClickClackMessage>;
events: (workspaceId: string, afterCursor?: string) => Promise<ClickClackEvent[]>;
websocket: (workspaceId: string, afterCursor?: string) => WebSocket$1;
};
//#endregion
//#region extensions/clickclack/src/runtime.d.ts
declare const setClickClackRuntime: (next: PluginRuntime) => void, getClickClackRuntime: () => PluginRuntime;
//#endregion
//#region extensions/clickclack/src/target.d.ts
/**
* Parses `channel:name`, `thread:msg_id`, `dm:usr_id`, or a bare channel name.
*/
declare function parseClickClackTarget(raw: string): ClickClackTarget;
/** Formats a parsed ClickClack target back into canonical target syntax. */
declare function buildClickClackTarget(target: ClickClackTarget): string;
//#endregion
export { createClickClackClient as a, listEnabledClickClackAccounts as c, setClickClackRuntime as i, resolveClickClackAccount as l, parseClickClackTarget as n, clickClackConfigSchema as o, getClickClackRuntime as r, listClickClackAccountIds as s, buildClickClackTarget as t, resolveDefaultClickClackAccountId as u };