From b70531bf24c07936d152432b3905e41c71184029 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 22 Apr 2026 06:46:58 +0100 Subject: [PATCH] docs: generalize core channel examples --- src/agents/tools/tts-tool.ts | 2 +- src/hooks/internal-hooks.ts | 6 +++--- src/infra/net/fetch-guard.ts | 2 +- src/logging/redact.test.ts | 8 ++++---- src/plugins/types.ts | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/agents/tools/tts-tool.ts b/src/agents/tools/tts-tool.ts index ba37c73e0c4..ff789f2787b 100644 --- a/src/agents/tools/tts-tool.ts +++ b/src/agents/tools/tts-tool.ts @@ -10,7 +10,7 @@ import { readStringParam } from "./common.js"; const TtsToolSchema = Type.Object({ text: Type.String({ description: "Text to convert to speech." }), channel: Type.Optional( - Type.String({ description: "Optional channel id to pick output format (e.g. telegram)." }), + Type.String({ description: "Optional channel id to pick output format." }), ), }); diff --git a/src/hooks/internal-hooks.ts b/src/hooks/internal-hooks.ts index 297987f19b2..9044fa8fa63 100644 --- a/src/hooks/internal-hooks.ts +++ b/src/hooks/internal-hooks.ts @@ -58,7 +58,7 @@ export type MessageReceivedHookContext = { content: string; /** Unix timestamp when the message was received */ timestamp?: number; - /** Channel identifier (e.g., "telegram", "whatsapp") */ + /** Channel identifier (for example "chat" or "support-chat") */ channelId: string; /** Provider account ID for multi-account setups */ accountId?: string; @@ -85,7 +85,7 @@ export type MessageSentHookContext = { success: boolean; /** Error message if sending failed */ error?: string; - /** Channel identifier (e.g., "telegram", "whatsapp") */ + /** Channel identifier (for example "chat" or "support-chat") */ channelId: string; /** Provider account ID for multi-account setups */ accountId?: string; @@ -116,7 +116,7 @@ type MessageEnrichedBodyHookContext = { bodyForAgent?: string; /** Unix timestamp when the message was received */ timestamp?: number; - /** Channel identifier (e.g., "telegram", "whatsapp") */ + /** Channel identifier (for example "chat" or "support-chat") */ channelId: string; /** Conversation/chat ID */ conversationId?: string; diff --git a/src/infra/net/fetch-guard.ts b/src/infra/net/fetch-guard.ts index ab010779e26..6c95d077eb4 100644 --- a/src/infra/net/fetch-guard.ts +++ b/src/infra/net/fetch-guard.ts @@ -177,7 +177,7 @@ async function assertExplicitProxyAllowed( // The proxy hostname is operator-configured, not user input. // Clear the target-scoped hostnameAllowlist so configured proxies // like localhost or internal hosts aren't rejected by an allowlist - // that was built for the target URL (e.g. api.telegram.org). + // that was built for the target URL (for example api.example.test). // Private-network IP checks still apply via allowPrivateNetwork. ...policy, allowPrivateNetwork: true, diff --git a/src/logging/redact.test.ts b/src/logging/redact.test.ts index dc92de0513e..3e3d0449850 100644 --- a/src/logging/redact.test.ts +++ b/src/logging/redact.test.ts @@ -54,7 +54,7 @@ describe("redactSensitiveText", () => { expect(output).toBe("Authorization: Bearer abcdef…ghij"); }); - it("masks Telegram-style tokens", () => { + it("masks bot-style tokens", () => { const input = "123456:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"; const output = redactSensitiveText(input, { mode: "tools", @@ -63,14 +63,14 @@ describe("redactSensitiveText", () => { expect(output).toBe("123456…cdef"); }); - it("masks Telegram Bot API URL tokens", () => { + it("masks bot API URL tokens", () => { const input = - "GET https://api.telegram.org/bot123456:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef/getMe HTTP/1.1"; + "GET https://api.example.test/bot123456:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef/getMe HTTP/1.1"; const output = redactSensitiveText(input, { mode: "tools", patterns: defaults, }); - expect(output).toBe("GET https://api.telegram.org/bot123456…cdef/getMe HTTP/1.1"); + expect(output).toBe("GET https://api.example.test/bot123456…cdef/getMe HTTP/1.1"); }); it("redacts short tokens fully", () => { diff --git a/src/plugins/types.ts b/src/plugins/types.ts index 90634ac1c08..179e2a7eeee 100644 --- a/src/plugins/types.ts +++ b/src/plugins/types.ts @@ -1675,11 +1675,11 @@ export type OpenClawPluginGatewayMethod = { * Context passed to plugin command handlers. */ export type PluginCommandContext = { - /** The sender's identifier (e.g., Telegram user ID) */ + /** The sender's identifier (for example a channel-scoped user ID) */ senderId?: string; - /** The channel/surface (e.g., "telegram", "discord") */ + /** The channel/surface (for example "chat" or "team-chat") */ channel: string; - /** Provider channel id (e.g., "telegram") */ + /** Provider channel id */ channelId?: ChannelId; /** Whether the sender is on the allowlist */ isAuthorizedSender: boolean; @@ -1735,7 +1735,7 @@ export type OpenClawPluginCommandDefinition = { /** * Optional native-command aliases for slash/menu surfaces. * `default` applies to all native providers unless a provider-specific - * override exists (for example `{ default: "talkvoice", discord: "voice2" }`). + * override exists (for example `{ default: "talkvoice", teamChat: "voice2" }`). */ nativeNames?: Partial> & { default?: string }; /**