feat(channels): add DingTalk via bundled plugin mirror and pure Node deploy (#215)
This commit is contained in:
committed by
GitHub
Unverified
parent
d4f77a442c
commit
d63810f54b
@@ -111,6 +111,38 @@
|
||||
"The system will automatically identify your phone number"
|
||||
]
|
||||
},
|
||||
"dingtalk": {
|
||||
"description": "Connect DingTalk via OpenClaw channel plugin (Stream mode)",
|
||||
"docsUrl": "https://github.com/soimy/openclaw-channel-dingtalk",
|
||||
"fields": {
|
||||
"clientId": {
|
||||
"label": "Client ID (AppKey)",
|
||||
"placeholder": "dingxxxxxx"
|
||||
},
|
||||
"clientSecret": {
|
||||
"label": "Client Secret (AppSecret)",
|
||||
"placeholder": "Your app secret"
|
||||
},
|
||||
"robotCode": {
|
||||
"label": "Robot Code (optional)",
|
||||
"placeholder": "Usually same as Client ID"
|
||||
},
|
||||
"corpId": {
|
||||
"label": "Corp ID (optional)",
|
||||
"placeholder": "dingxxxxxx"
|
||||
},
|
||||
"agentId": {
|
||||
"label": "Agent ID (optional)",
|
||||
"placeholder": "123456789"
|
||||
}
|
||||
},
|
||||
"instructions": [
|
||||
"Install and enable the dingtalk plugin in OpenClaw",
|
||||
"Create a DingTalk internal app and enable Stream mode",
|
||||
"Fill in Client ID and Client Secret (required)",
|
||||
"Fill in Robot Code / Corp ID / Agent ID if your setup requires them"
|
||||
]
|
||||
},
|
||||
"signal": {
|
||||
"description": "Connect Signal using signal-cli",
|
||||
"docsUrl": "https://docs.openclaw.ai/channels/signal",
|
||||
|
||||
@@ -108,6 +108,38 @@
|
||||
"システムが自動的に電話番号を識別します"
|
||||
]
|
||||
},
|
||||
"dingtalk": {
|
||||
"description": "OpenClaw のチャンネルプラグイン経由で DingTalk に接続します(Stream モード)",
|
||||
"docsUrl": "https://github.com/soimy/openclaw-channel-dingtalk",
|
||||
"fields": {
|
||||
"clientId": {
|
||||
"label": "Client ID (AppKey)",
|
||||
"placeholder": "dingxxxxxx"
|
||||
},
|
||||
"clientSecret": {
|
||||
"label": "Client Secret (AppSecret)",
|
||||
"placeholder": "アプリのシークレット"
|
||||
},
|
||||
"robotCode": {
|
||||
"label": "Robot Code(任意)",
|
||||
"placeholder": "通常は Client ID と同じ"
|
||||
},
|
||||
"corpId": {
|
||||
"label": "Corp ID(任意)",
|
||||
"placeholder": "dingxxxxxx"
|
||||
},
|
||||
"agentId": {
|
||||
"label": "Agent ID(任意)",
|
||||
"placeholder": "123456789"
|
||||
}
|
||||
},
|
||||
"instructions": [
|
||||
"まず OpenClaw に dingtalk プラグインをインストールして有効化します",
|
||||
"DingTalk 開発者コンソールで社内アプリを作成し Stream モードを有効にします",
|
||||
"Client ID と Client Secret を入力します(必須)",
|
||||
"必要に応じて Robot Code / Corp ID / Agent ID を入力します"
|
||||
]
|
||||
},
|
||||
"signal": {
|
||||
"description": "signal-cli を使用して Signal に接続します",
|
||||
"fields": {
|
||||
|
||||
@@ -111,6 +111,38 @@
|
||||
"系统将自动识别您的手机号"
|
||||
]
|
||||
},
|
||||
"dingtalk": {
|
||||
"description": "通过 OpenClaw 渠道插件连接钉钉(Stream 模式)",
|
||||
"docsUrl": "https://github.com/soimy/openclaw-channel-dingtalk",
|
||||
"fields": {
|
||||
"clientId": {
|
||||
"label": "Client ID (AppKey)",
|
||||
"placeholder": "dingxxxxxx"
|
||||
},
|
||||
"clientSecret": {
|
||||
"label": "Client Secret (AppSecret)",
|
||||
"placeholder": "您的应用密钥"
|
||||
},
|
||||
"robotCode": {
|
||||
"label": "Robot Code(可选)",
|
||||
"placeholder": "通常与 Client ID 相同"
|
||||
},
|
||||
"corpId": {
|
||||
"label": "Corp ID(可选)",
|
||||
"placeholder": "dingxxxxxx"
|
||||
},
|
||||
"agentId": {
|
||||
"label": "Agent ID(可选)",
|
||||
"placeholder": "123456789"
|
||||
}
|
||||
},
|
||||
"instructions": [
|
||||
"先在 OpenClaw 安装并启用 dingtalk 插件",
|
||||
"在钉钉开发者后台创建企业内部应用并开启 Stream 模式",
|
||||
"填写 Client ID 和 Client Secret(必填)",
|
||||
"根据你的应用配置按需填写 Robot Code / Corp ID / Agent ID"
|
||||
]
|
||||
},
|
||||
"signal": {
|
||||
"description": "使用 signal-cli 连接 Signal",
|
||||
"docsUrl": "https://docs.openclaw.ai/zh-CN/channels/signal",
|
||||
|
||||
@@ -570,7 +570,17 @@ function AddChannelDialog({ selectedType, onSelectType, onClose, onChannelAdded
|
||||
|
||||
// Step 2: Save channel configuration via IPC
|
||||
const config: Record<string, unknown> = { ...configValues };
|
||||
await window.electron.ipcRenderer.invoke('channel:saveConfig', selectedType, config);
|
||||
const saveResult = await window.electron.ipcRenderer.invoke('channel:saveConfig', selectedType, config) as {
|
||||
success?: boolean;
|
||||
warning?: string;
|
||||
pluginInstalled?: boolean;
|
||||
};
|
||||
if (!saveResult?.success) {
|
||||
throw new Error('Failed to save channel config');
|
||||
}
|
||||
if (typeof saveResult.warning === 'string' && saveResult.warning) {
|
||||
toast.warning(saveResult.warning);
|
||||
}
|
||||
|
||||
// Step 3: Add a local channel entry for the UI
|
||||
await addChannel({
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
export type ChannelType =
|
||||
| 'whatsapp'
|
||||
| 'dingtalk'
|
||||
| 'telegram'
|
||||
| 'discord'
|
||||
| 'signal'
|
||||
@@ -78,6 +79,7 @@ export interface ChannelMeta {
|
||||
*/
|
||||
export const CHANNEL_ICONS: Record<ChannelType, string> = {
|
||||
whatsapp: '📱',
|
||||
dingtalk: '💬',
|
||||
telegram: '✈️',
|
||||
discord: '🎮',
|
||||
signal: '🔒',
|
||||
@@ -95,6 +97,7 @@ export const CHANNEL_ICONS: Record<ChannelType, string> = {
|
||||
*/
|
||||
export const CHANNEL_NAMES: Record<ChannelType, string> = {
|
||||
whatsapp: 'WhatsApp',
|
||||
dingtalk: 'DingTalk',
|
||||
telegram: 'Telegram',
|
||||
discord: 'Discord',
|
||||
signal: 'Signal',
|
||||
@@ -111,6 +114,58 @@ export const CHANNEL_NAMES: Record<ChannelType, string> = {
|
||||
* Channel metadata with configuration information
|
||||
*/
|
||||
export const CHANNEL_META: Record<ChannelType, ChannelMeta> = {
|
||||
dingtalk: {
|
||||
id: 'dingtalk',
|
||||
name: 'DingTalk',
|
||||
icon: '💬',
|
||||
description: 'channels:meta.dingtalk.description',
|
||||
connectionType: 'token',
|
||||
docsUrl: 'channels:meta.dingtalk.docsUrl',
|
||||
configFields: [
|
||||
{
|
||||
key: 'clientId',
|
||||
label: 'channels:meta.dingtalk.fields.clientId.label',
|
||||
type: 'text',
|
||||
placeholder: 'channels:meta.dingtalk.fields.clientId.placeholder',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
key: 'clientSecret',
|
||||
label: 'channels:meta.dingtalk.fields.clientSecret.label',
|
||||
type: 'password',
|
||||
placeholder: 'channels:meta.dingtalk.fields.clientSecret.placeholder',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
key: 'robotCode',
|
||||
label: 'channels:meta.dingtalk.fields.robotCode.label',
|
||||
type: 'text',
|
||||
placeholder: 'channels:meta.dingtalk.fields.robotCode.placeholder',
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
key: 'corpId',
|
||||
label: 'channels:meta.dingtalk.fields.corpId.label',
|
||||
type: 'text',
|
||||
placeholder: 'channels:meta.dingtalk.fields.corpId.placeholder',
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
key: 'agentId',
|
||||
label: 'channels:meta.dingtalk.fields.agentId.label',
|
||||
type: 'text',
|
||||
placeholder: 'channels:meta.dingtalk.fields.agentId.placeholder',
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
instructions: [
|
||||
'channels:meta.dingtalk.instructions.0',
|
||||
'channels:meta.dingtalk.instructions.1',
|
||||
'channels:meta.dingtalk.instructions.2',
|
||||
'channels:meta.dingtalk.instructions.3',
|
||||
],
|
||||
isPlugin: true,
|
||||
},
|
||||
telegram: {
|
||||
id: 'telegram',
|
||||
name: 'Telegram',
|
||||
@@ -441,7 +496,7 @@ export const CHANNEL_META: Record<ChannelType, ChannelMeta> = {
|
||||
* Get primary supported channels (non-plugin, commonly used)
|
||||
*/
|
||||
export function getPrimaryChannels(): ChannelType[] {
|
||||
return ['telegram', 'discord', 'whatsapp', 'feishu'];
|
||||
return ['telegram', 'discord', 'whatsapp', 'dingtalk', 'feishu'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user