PageSourceSearch

https://leleli-qwenpaw.hf.space/assets/ChannelDrawer-b5XPzPZ2.js

js leleli-qwenpaw.hf.space collected 2026-10-03 17:04:11 UTC 30,655 bytes, 1 lines download raw bytes

1import{r as J,j as e}from"./react-vendor-Dc5dhXQW.js";import{y as Z,g as K,x as ee,W as f,X as Q}from"./index-CzokpXub.js";import{QrcodeAuthBlock as q}from"./QrcodeAuthBlock-BkIgClwj.js";import{u as se}from"./i18n-vendor-CyU1p4Oa.js";import{S as n,B as S,a6 as O,a7 as ne,f as o,k as l,g as I,a8 as w,A as g,j as i}from"./ui-vendor-Is6G0tdy.js";import"./utils-vendor-BcdFrGdH.js";import"./markdown-vendor-elH94dlU.js";import"./dnd-vendor-zA92mhJ9.js";import"./useChannelQrcode-CpyvA5AR.js";const le=["telegram","dingtalk","discord","feishu","wecom","mattermost","matrix","wechat","imessage","onebot","qq","mqtt","xiaoyi","yuanbao","slack"],N={dingtalk:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#DingTalk-recommended",feishu:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#Feishu-Lark",imessage:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#iMessage-macOS-only",discord:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#Discord",qq:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#QQ",telegram:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#Telegram",mqtt:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#MQTT",mattermost:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#Mattermost",matrix:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#Matrix",sip:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#SIP",wecom:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#WeCom-WeChat-Work",wechat:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#WeChat-Personal-iLink",xiaoyi:"https://developer.huawei.com/consumer/cn/doc/service/openclaw-0000002518410344",yuanbao:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#Yuanbao",onebot:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#OneBot-v11-NapCat--QQ-full-protocol",slack:"https://qwenpaw.agentscope.io/docs/channels/?lang=en#Slack"},B={dingtalk:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#钉钉推荐",feishu:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#飞书",imessage:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#iMessage仅-macOS",discord:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#Discord",qq:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#QQ",telegram:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#Telegram",mqtt:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#MQTT",mattermost:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#Mattermost",matrix:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#Matrix",sip:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#SIP",wecom:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#企业微信",wechat:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#微信个人iLink",xiaoyi:"https://developer.huawei.com/consumer/cn/doc/service/openclaw-0000002518410344",yuanbao:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#腾讯元宝Yuanbao",onebot:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#OneBot-v11NapCat--QQ-完整协议",slack:"https://qwenpaw.agentscope.io/docs/channels/?lang=zh#Slack"},ae="https://console.twilio.com",te=["enabled","bot_prefix","filter_tool_messages","filter_thinking","isBuiltin"];function E(u,r){if(u==null)return"";if(typeof u=="string")return u;if(typeof u!="object")return String(u);const m=u,d=r||"en",v=d.split("-")[0].toLowerCase(),j=Object.keys(m).find(k=>k.split("-")[0].toLowerCase()===v&&!!m[k]),L=m[d],x=m[v],C=j?m[j]:void 0,P=m["en-US"]||m.en,s=m["zh-CN"]||m.zh,_=Object.values(m).find(k=>!!k);return L||x||C||P||s||_||""}function je({open:u,activeKey:r,activeLabel:m,form:d,saving:v,initialValues:j,isBuiltin:L,channelSchema:x,onClose:C,onSubmit:P}){var z;const{t:s,i18n:_}=se(),{selectedAgent:k,agents:R}=Z(),A=R.find(c=>c.id===k),T=A!=null&&A.workspace_dir?`${A.workspace_dir}/media`:"~/.qwenpaw/media",G=(z=_.language)!=null&&z.startsWith("zh")?"zh":"en",D=r?K(r,s):m,{message:h}=ee(),y=n.useWatch("auth_method",d)==="password",U=n.useWatch("domain",d)||"feishu";J.useEffect(()=>{if(!u||r!=="matrix")return;const c=j==null?void 0:j.password;typeof c=="string"&&c.trim().length>0&&d.setFieldsValue({auth_method:"password"})},[u,r,j,d]);const W=()=>e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"access_control_dm",label:s("channels.accessControlDm"),valuePropName:"checked",tooltip:s("channels.accessControlDmTooltip"),children:e.jsx(o,{})}),e.jsx(n.Item,{name:"access_control_group",label:s("channels.accessControlGroup"),valuePropName:"checked",tooltip:s("channels.accessControlGroupTooltip"),children:e.jsx(o,{})}),e.jsx(n.Item,{name:"require_mention",label:s("channels.requireMention"),valuePropName:"checked",tooltip:s("channels.requireMentionTooltip"),children:e.jsx(o,{})})]}),V=c=>{switch(c){case"matrix":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"homeserver",label:"Homeserver URL",rules:[{required:!0}],children:e.jsx(l,{placeholder:"https://matrix.org"})}),e.jsx(n.Item,{name:"user_id",label:"User ID",tooltip:"Accepts a full MXID (e.g. @bot:matrix.org) or just the localpart (e.g. bot).",rules:[{required:!0,message:"Please enter User ID"}],children:e.jsx(l,{placeholder:"@bot:matrix.org"})}),e.jsx(n.Item,{name:"auth_method",label:"Auth Method",initialValue:"token",children:e.jsx(i,{options:[{value:"token",label:"Token"},{value:"password",label:"Password"}]})}),e.jsx(n.Item,{name:"access_token",label:"Access Token",rules:[{required:!y,message:"Please enter access token"}],hidden:y,children:e.jsx(l.Password,{placeholder:"syt_..."})}),e.jsx(n.Item,{name:"password",label:"Password",rules:[{required:y,message:"Please enter password"}],hidden:!y,children:e.jsx(l.Password,{placeholder:"Account password for login"})}),e.jsx(n.Item,{name:"encryption",label:"Enable End-to-End Encryption",tooltip:"After enabling, you must verify the device in a Matrix client (e.g. Element). E2EE requires manually installing matrix-nio[e2e] (pip install matrix-nio[e2e]).",valuePropName:"checked",hidden:!y,children:e.jsx(o,{})}),e.jsx(n.Item,{name:"device_name",label:"Device Name",tooltip:"A stable device identity for the Matrix client. Defaults to 'qwenpaw-worker' if left empty.",children:e.jsx(l,{placeholder:"qwenpaw-worker"})}),e.jsx(n.Item,{name:"dm_disabled",label:s("channels.dmDisabled"),valuePropName:"checked",tooltip:s("channels.dmDisabledTooltip"),children:e.jsx(o,{})}),e.jsx(n.Item,{name:"group_disabled",label:s("channels.groupDisabled"),valuePropName:"checked",tooltip:s("channels.groupDisabledTooltip"),children:e.jsx(o,{})})]});case"imessage":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"db_path",label:"DB Path",rules:[{required:!0,message:"Please input DB path"}],children:e.jsx(l,{placeholder:"~/Library/Messages/chat.db"})}),e.jsx(n.Item,{name:"poll_sec",label:"Poll Interval (sec)",rules:[{required:!0,message:"Please input poll interval"}],children:e.jsx(I,{min:.1,step:.1,style:{width:"100%"}})})]});case"discord":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"bot_token",label:"Bot Token",rules:[{required:!0}],children:e.jsx(l.Password,{placeholder:"Discord bot token"})}),e.jsx(n.Item,{name:"http_proxy",label:"HTTP Proxy",children:e.jsx(l,{placeholder:"http://127.0.0.1:18118"})}),e.jsx(n.Item,{name:"http_proxy_auth",label:"HTTP Proxy Auth",children:e.jsx(l,{placeholder:"user:password"})}),e.jsx(n.Item,{name:"accept_bot_messages",label:s("channels.acceptBotMessages"),valuePropName:"checked",tooltip:s("channels.acceptBotMessagesTooltip"),children:e.jsx(o,{})}),e.jsx(n.Item,{name:"media_dir",label:s("channels.wechatMediaDir"),children:e.jsx(l,{placeholder:T})})]});case"dingtalk":return e.jsxs(e.Fragment,{children:[e.jsx(w,{prefixCls:"ant",children:e.jsx(g,{type:"info",showIcon:!0,message:s("channels.dingtalkSetupGuide"),style:{marginBottom:16}})}),e.jsx(q,{label:s("channels.dingtalkScanAuth"),buttonText:s("channels.dingtalkGetQrcode"),imageAlt:"DingTalk QR Code",hintText:s("channels.dingtalkScanHint"),channel:"dingtalk",successStatus:"success",successCredentialKey:"client_id",pollInterval:5e3,onSuccess:a=>{d.setFieldsValue({client_id:a.client_id,client_secret:a.client_secret}),h.success(s("channels.dingtalkAuthSuccess"))},onError:a=>{a==="expired"?h.warning(s("channels.dingtalkQrcodeExpired")):h.error(s("channels.dingtalkQrcodeFailed"))}}),e.jsx(n.Item,{name:"client_id",label:"Client ID",rules:[{required:!0}],children:e.jsx(l,{placeholder:"dingxxxxx"})}),e.jsx(n.Item,{name:"client_secret",label:"Client Secret",rules:[{required:!0}],children:e.jsx(l.Password,{})}),e.jsx(n.Item,{name:"message_type",label:"Message Type",tooltip:"markdown: regular messages; card: AI interactive card",children:e.jsx(i,{options:[{label:"markdown",value:"markdown"},{label:"card",value:"card"}]})}),e.jsx(n.Item,{name:"cron_message_type",label:"Cron Message Type",tooltip:"Message type for cron/scheduled task sends. Independent from the chat message type above.",children:e.jsx(i,{options:[{label:"markdown",value:"markdown"},{label:"card",value:"card"}]})}),e.jsx(n.Item,{noStyle:!0,shouldUpdate:(a,t)=>a.message_type!==t.message_type||a.cron_message_type!==t.cron_message_type,children:({getFieldValue:a})=>a("message_type")==="card"||a("cron_message_type")==="card"?e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"card_template_id",label:"Card Template ID",rules:[{required:!0,message:"Please input card template id when message_type=card"}],children:e.jsx(l,{placeholder:"dt_card_template_xxx"})}),e.jsx(n.Item,{name:"card_template_key",label:"Card Template Key",tooltip:"Must exactly match the template variable name",children:e.jsx(l,{placeholder:"content"})}),e.jsx(n.Item,{name:"robot_code",label:"Robot Code",tooltip:"Recommended to configure explicitly for group chats",children:e.jsx(l,{placeholder:"robot code (default client_id)"})})]}):null}),e.jsx(n.Item,{name:"endpoint",label:s("channels.dingtalkEndpoint"),tooltip:s("channels.dingtalkEndpointTooltip"),children:e.jsx(l,{placeholder:"https://api.dingtalk.com"})}),e.jsx(n.Item,{name:"at_sender_on_reply",label:s("channels.atSenderOnReply"),tooltip:s("channels.atSenderOnReplyTooltip"),valuePropName:"checked",children:e.jsx(o,{})})]});case"feishu":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"domain",label:s("channels.feishuRegion"),initialValue:"feishu",tooltip:s("channels.feishuRegionTooltip"),children:e.jsxs(i,{children:[e.jsx(i.Option,{value:"feishu",children:s("channels.feishuChina")}),e.jsx(i.Option,{value:"lark",children:s("channels.feishuInternational")})]})}),e.jsx(w,{prefixCls:"ant",children:e.jsx(g,{type:"info",showIcon:!0,message:s("channels.feishu
1ScanGuide"),style:{marginBottom:16}})}),e.jsx(q,{label:s("channels.feishuScanLogin"),buttonText:s("channels.feishuGetQrcode"),imageAlt:"Feishu QR Code",hintText:s("channels.feishuScanHint"),channel:"feishu",successStatus:"success",successCredentialKey:"app_id",pollInterval:2e3,params:{domain:U},onSuccess:a=>{d.setFieldsValue({app_id:a.app_id,app_secret:a.app_secret}),h.success(s("channels.feishuAuthSuccess"))},onError:a=>{a==="expired"?h.warning(s("channels.feishuQrcodeExpired")):h.error(s("channels.feishuQrcodeFailed"))}}),e.jsx(n.Item,{name:"app_id",label:"App ID",rules:[{required:!0}],children:e.jsx(l,{placeholder:"cli_xxx"})}),e.jsx(n.Item,{name:"app_secret",label:"App Secret",rules:[{required:!0}],children:e.jsx(l.Password,{placeholder:"App Secret"})}),e.jsx(n.Item,{name:"encrypt_key",label:"Encrypt Key",children:e.jsx(l,{placeholder:"Optional, for event encryption"})}),e.jsx(n.Item,{name:"verification_token",label:"Verification Token",children:e.jsx(l,{placeholder:"Optional"})}),e.jsx(n.Item,{name:"media_dir",label:s("channels.wechatMediaDir"),children:e.jsx(l,{placeholder:T})}),e.jsx(n.Item,{name:"share_session_in_group",label:s("channels.shareSessionInGroup"),valuePropName:"checked",tooltip:s("channels.shareSessionInGroupTooltip"),children:e.jsx(o,{})})]});case"qq":return e.jsxs(e.Fragment,{children:[e.jsx(w,{prefixCls:"ant",children:e.jsx(g,{type:"info",showIcon:!0,message:s("channels.qqSetupGuide"),style:{marginBottom:16}})}),e.jsx(q,{label:s("channels.qqScanAuth"),buttonText:s("channels.qqGetQrcode"),imageAlt:"QQ QR Code",hintText:s("channels.qqScanHint"),channel:"qq",successStatus:"success",successCredentialKey:"app_id",pollInterval:2e3,pollTimeout:3e5,maxPollCount:180,onSuccess:a=>{d.setFieldsValue({app_id:a.app_id,client_secret:a.client_secret,user_openid:a.user_openid}),h.success(s("channels.qqAuthSuccess"))},onError:a=>{a==="expired"?h.warning(s("channels.qqQrcodeExpired")):h.error(s("channels.qqQrcodeFailed"))}}),e.jsx(n.Item,{name:"app_id",label:"App ID",rules:[{required:!0}],children:e.jsx(l,{})}),e.jsx(n.Item,{name:"client_secret",label:"Client Secret",rules:[{required:!0}],children:e.jsx(l.Password,{})}),e.jsx(n.Item,{name:"user_openid",hidden:!0,children:e.jsx(l,{})}),e.jsx(n.Item,{name:"ack_message",label:s("channels.ackMessage"),tooltip:s("channels.ackMessageTooltip"),children:e.jsx(l,{placeholder:s("channels.ackMessagePlaceholder")})})]});case"telegram":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"bot_token",label:"Bot Token",rules:[{required:!0}],children:e.jsx(l.Password,{placeholder:"Telegram bot token from BotFather"})}),e.jsx(n.Item,{name:"base_url",label:"API Base URL",children:e.jsx(l,{placeholder:"https://tg-api.yourdomain.com"})}),e.jsx(n.Item,{name:"http_proxy",label:"HTTP Proxy",children:e.jsx(l,{placeholder:"http://127.0.0.1:18118"})}),e.jsx(n.Item,{name:"http_proxy_auth",label:"HTTP Proxy Auth",children:e.jsx(l,{placeholder:"user:password"})}),e.jsx(n.Item,{name:"show_typing",label:"Show Typing",valuePropName:"checked",children:e.jsx(o,{})})]});case"slack":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"bot_token",label:"Bot Token",rules:[{required:!0}],tooltip:s("channels.slackBotTokenTooltip"),children:e.jsx(l.Password,{placeholder:"xoxb-..."})}),e.jsx(n.Item,{name:"app_token",label:"App Token",rules:[{required:!0}],tooltip:s("channels.slackAppTokenTooltip"),children:e.jsx(l.Password,{placeholder:"xapp-..."})}),e.jsx(n.Item,{name:"proxy",label:"HTTP Proxy",tooltip:s("channels.slackProxyTooltip"),children:e.jsx(l,{placeholder:"http://127.0.0.1:18118"})})]});case"mqtt":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"host",label:"MQTT Host",rules:[{required:!0}],children:e.jsx(l,{placeholder:"127.0.0.1"})}),e.jsx(n.Item,{name:"port",label:"MQTT Port",rules:[{required:!0},{type:"number",min:1,max:65535,message:"Port must be between 1 and 65535"}],children:e.jsx(I,{min:1,max:65535,style:{width:"100%"},placeholder:"1883"})}),e.jsx(n.Item,{name:"transport",label:"Transport",initialValue:"tcp",rules:[{required:!0}],children:e.jsxs(i,{children:[e.jsx(i.Option,{value:"tcp",children:"MQTT (tcp)"}),e.jsx(i.Option,{value:"websockets",children:"WS (websockets)"})]})}),e.jsx(n.Item,{name:"clean_session",label:"Clean Session",valuePropName:"checked",children:e.jsx(o,{defaultChecked:!0})}),e.jsx(n.Item,{name:"qos",label:"QoS",initialValue:"2",rules:[{required:!0}],children:e.jsxs(i,{children:[e.jsx(i.Option,{value:"0",children:"At Most Once (0)"}),e.jsx(i.Option,{value:"1",children:"At Least Once (1)"}),e.jsx(i.Option,{value:"2",children:"Exactly Once (2)"})]})}),e.jsx(n.Item,{name:"username",label:"MQTT Username",children:e.jsx(l,{placeholder:"Leave blank to disable / not use"})}),e.jsx(n.Item,{name:"password",label:"MQTT Password",children:e.jsx(l.Password,{placeholder:"Leave blank to disable / not use"})}),e.jsx(n.Item,{name:"subscribe_topic",label:"Subscribe Topic",rules:[{required:!0}],children:e.jsx(l,{placeholder:"server/+/up"})}),e.jsx(n.Item,{name:"publish_topic",label:"Publish Topic",rules:[{required:!0}],children:e.jsx(l,{placeholder:"client/{client_id}/down"})}),e.jsx(n.Item,{name:"tls_enabled",label:"TLS Enabled",valuePropName:"checked",children:e.jsx(o,{})}),e.jsx(n.Item,{name:"tls_ca_certs",label:"TLS CA Certs",children:e.jsx(l,{placeholder:"Path to CA certificates file"})}),e.jsx(n.Item,{name:"tls_certfile",label:"TLS Certfile",children:e.jsx(l,{placeholder:"Path to client certificate file"})}),e.jsx(n.Item,{name:"tls_keyfile",label:"TLS Keyfile",children:e.jsx(l,{placeholder:"Path to client private key file"})})]});case"mattermost":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"url",label:"Mattermost URL",rules:[{required:!0}],children:e.jsx(l,{placeholder:"https://mattermost.example.com"})}),e.jsx(n.Item,{name:"bot_token",label:"Bot Token",rules:[{required:!0}],children:e.jsx(l.Password,{placeholder:"Mattermost bot token"})}),e.jsx(n.Item,{name:"media_dir",label:s("channels.wechatMediaDir"),children:e.jsx(l,{placeholder:T})}),e.jsx(n.Item,{name:"show_typing",label:"Show Typing",valuePropName:"checked",children:e.jsx(o,{})}),e.jsx(n.Item,{name:"thread_follow_without_mention",label:"Thread Follow Without Mention",valuePropName:"checked",children:e.jsx(o,{})})]});case"voice":return e.jsxs(e.Fragment,{children:[e.jsx(w,{prefixCls:"ant",children:e.jsx(g,{type:"info",showIcon:!0,message:s("channels.voiceSetupGuide"),style:{marginBottom:16}})}),e.jsx(n.Item,{name:"twilio_account_sid",label:s("channels.twilioAccountSid"),rules:[{required:!0}],children:e.jsx(l,{placeholder:"ACxxxxxxxx"})}),e.jsx(n.Item,{name:"twilio_auth_token",label:s("channels.twilioAuthToken"),rules:[{required:!0}],children:e.jsx(l.Password,{})}),e.jsx(n.Item,{name:"phone_number",label:s("channels.phoneNumber"),children:e.jsx(l,{placeholder:"+15551234567"})}),e.jsx(n.Item,{name:"phone_number_sid",label:s("channels.phoneNumberSid"),tooltip:s("channels.phoneNumberSidHelp"),children:e.jsx(l,{placeholder:"PNxxxxxxxx"})}),e.jsx(n.Item,{name:"tts_provider",label:s("channels.ttsProvider"),children:e.jsx(l,{placeholder:"google"})}),e.jsx(n.Item,{name:"tts_voice",label:s("channels.ttsVoice"),children:e.jsx(l,{placeholder:"en-US-Journey-D"})}),e.jsx(n.Item,{name:"stt_provider",label:s("channels.sttProvider"),children:e.jsx(l,{placeholder:"deepgram"})}),e.jsx(n.Item,{name:"language",label:s("channels.language"),children:e.jsx(l,{placeholder:"en-US"})}),e.jsx(n.Item,{name:"welcome_greeting",label:s("channels.welcomeGreeting"),children:e.jsx(l.TextArea,{rows:2})})]});case"sip":return e.jsxs(e.Fragment,{children:[e.jsx(w,{prefixCls:"ant",children:e.jsx(g,{type:"info",showIcon:!0,message:s("channels.sipSetupGuide"),style:{marginBottom:16}})}),e.jsx(n.Item,{name:"sip_mode",label:s("channels.sipMode"),tooltip:s("channels.sipModeTooltip"),initialValue:"dev",children:e.jsx(i,{options:[{value:"dev",label:"Dev (pyVoIP)"},{value:"livekit",label:"Production (LiveKit)"}]})}),e.jsx(n.Item,{shouldUpdate:(a,t)=>a.sip_mode!==t.sip_mode,noStyle:!0,children:({getFieldValue:a})=>e.jsx(n.Item,{name:"sip_server",label:s("channels.sipServer"),children:e.jsx(l,{placeholder:a("sip_mode")==="livekit"?s("channels.sipServerPlaceholderLivekit"):s("channels.sipServerPlaceholder")})})}),e.jsx(n.Item,{name:"sip_username",label:s("channels.sipUsername"),children:e.jsx(l,{placeholder:"1001"})}),e.jsx(n.Item,{name:"sip_password",label:s("channels.sipPassword"),children:e.jsx(l.Password,{})}),e.jsx(n.Item,{name:"sip_port",label:s("channels.sipPort"),rules:[{type:"number",min:1,max:65535}],children:e.jsx(I,{min:1,max:65535,style:{width:"100%"},placeholder:"5061"})}),e.jsx(n.Item,{name:"sip_transport",label:s("channels.sipTransport"),initialValue:"UDP",children:e.jsx(i,{options:[{value:"UDP",label:"UDP"},{value:"TCP",label:"TCP"},{value:"TLS",label:"TLS"}]})}),e.jsx(n.Item,{name:"dashscope_api_key",label:s("channels.sipDashscopeApiKey"),tooltip:s("channels.sipDashscopeApiKeyTooltip"),children:e.jsx(l.Password,{placeholder:"sk-..."})}),e.jsx(n.Item,{name:"tts_provider",label:s("channels.ttsProvider"),children:e.jsx(l,{placeholder:"aliyun"})}),e.jsx(n.Item,{name:"tts_voice",label:s("channels.ttsVoice"),children:e.jsx(l,{placeholder:"longxiaochun"})}),e.jsx(n.Item,{name:"stt_provider",label:s("channels.sttProvider"),children:e.jsx(l,{placeholder:"aliyun"})}),e.jsx(n.Item,{name:"language",label:s("channels.language"),children:e.jsx(l,{placeholder:"zh-CN"})}),e.jsx(n.Item,{name:"welcome_greeting",label:s("channels.welcomeGreeting"),children:e.jsx(l.TextArea,{rows:2})}),e.jsx(n.Item,{noStyle:!0,shouldUpdate:(a,t)=>a.sip_mode!==t.sip_mode,children:({getFieldValue:a})=>a("sip_mode")!=="livekit"?null:e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"livekit_url",label:s("channels.livekitUrl"),rules:[{required:!0}],children:e.jsx(l,{placeholder:"ws://localhost:7880"})}),e.jsx(n.Item,{name:"livekit_api_key",label:s("channels.livekitApiKey"),rules:[{required:!0}],children:e.jsx(l,{})}),e.jsx(n.Item,{name:"livekit_api_secret",label:s("channels.livekitApiSecret"),rules:[{required:!0}],children:e.jsx(l.Password,{})}
1),e.jsx(n.Item,{name:"livekit_sip_trunk_id",label:s("channels.livekitSipTrunkId"),children:e.jsx(l,{placeholder:"ST_xxxx"})}),e.jsx(n.Item,{name:"livekit_room_name",label:s("channels.livekitRoomName"),tooltip:s("channels.livekitRoomNameTooltip"),children:e.jsx(l,{placeholder:"sip-inbound"})})]})})]});case"wecom":return e.jsxs(e.Fragment,{children:[e.jsx(w,{prefixCls:"ant",children:e.jsx(g,{type:"warning",showIcon:!0,message:s("channels.wecomSetupGuide"),style:{marginBottom:16}})}),e.jsx(q,{label:s("channels.wecomScanAuth"),buttonText:s("channels.loginWeCom"),imageAlt:"WeCom QR Code",hintText:s("channels.wecomAuthHint"),channel:"wecom",successStatus:"success",successCredentialKey:"bot_id",pollInterval:3e3,onSuccess:a=>{d.setFieldsValue({bot_id:a.bot_id,secret:a.secret}),h.success(s("channels.wecomAuthSuccess"))},onError:()=>{h.error(s("channels.wecomQrcodeFailed"))}}),e.jsx(n.Item,{name:"bot_id",label:"Bot ID",rules:[{required:!0,message:"Please input Bot ID"}],children:e.jsx(l,{placeholder:"Bot ID from WeCom backend"})}),e.jsx(n.Item,{name:"secret",label:"Secret",rules:[{required:!0,message:"Please input Secret"}],children:e.jsx(l.Password,{placeholder:"Secret from WeCom backend"})}),e.jsx(n.Item,{name:"media_dir",label:s("channels.wechatMediaDir"),children:e.jsx(l,{placeholder:T})}),e.jsx(n.Item,{name:"welcome_text",label:s("channels.welcomeText"),tooltip:s("channels.welcomeTextTooltip"),children:e.jsx(l,{placeholder:s("channels.welcomeTextPlaceholder")})}),e.jsx(n.Item,{name:"share_session_in_group",label:s("channels.shareSessionInGroup"),valuePropName:"checked",tooltip:s("channels.shareSessionInGroupTooltip"),children:e.jsx(o,{})})]});case"xiaoyi":return e.jsxs(e.Fragment,{children:[e.jsx(w,{prefixCls:"ant",children:e.jsx(g,{type:"info",showIcon:!0,message:s("channels.xiaoyiSetupGuide"),style:{marginBottom:16}})}),e.jsx(n.Item,{name:"ak",label:"Access Key (AK)",rules:[{required:!0,message:"Please input Access Key"}],children:e.jsx(l,{placeholder:"Access Key from Huawei Developer Platform"})}),e.jsx(n.Item,{name:"sk",label:"Secret Key (SK)",rules:[{required:!0,message:"Please input Secret Key"}],children:e.jsx(l.Password,{placeholder:"Secret Key from Huawei Developer Platform"})}),e.jsx(n.Item,{name:"agent_id",label:"Agent ID",rules:[{required:!0,message:"Please input Agent ID"}],children:e.jsx(l,{placeholder:"Agent ID from XiaoYi platform"})})]});case"wechat":return e.jsxs(e.Fragment,{children:[e.jsxs(w,{prefixCls:"ant",children:[e.jsx(g,{type:"info",showIcon:!0,message:s("channels.wechatSetupGuide"),style:{marginBottom:16}}),e.jsx(g,{type:"warning",showIcon:!0,message:s("channels.wechatContextTokenLimit"),style:{marginBottom:16}})]}),e.jsx(q,{label:s("channels.wechatScanLogin"),buttonText:s("channels.wechatGetQrcode"),imageAlt:"WeChat QR Code",hintText:s("channels.wechatScanHint"),channel:"wechat",successStatus:"confirmed",successCredentialKey:"bot_token",pollInterval:2e3,onSuccess:a=>{d.setFieldsValue({bot_token:a.bot_token}),h.success(s("channels.wechatLoginSuccess"))},onError:a=>{a==="expired"?h.warning(s("channels.wechatQrcodeExpired")):h.error(s("channels.wechatQrcodeFailed"))}}),e.jsx(n.Item,{name:"bot_token",label:s("channels.wechatBotToken"),tooltip:s("channels.wechatBotTokenTooltip"),children:e.jsx(l.Password,{placeholder:s("channels.wechatBotTokenPlaceholder")})}),e.jsx(n.Item,{name:"bot_token_file",label:s("channels.wechatBotTokenFile"),tooltip:s("channels.wechatBotTokenFileTooltip"),children:e.jsx(l,{placeholder:"~/.qwenpaw/wechat_bot_token"})}),e.jsx(n.Item,{name:"media_dir",label:s("channels.wechatMediaDir"),children:e.jsx(l,{placeholder:T})}),e.jsx(n.Item,{name:"message_merge_enabled",label:s("channels.wechatMessageMerge"),valuePropName:"checked",tooltip:s("channels.wechatMessageMergeTooltip"),children:e.jsx(o,{})}),e.jsx(n.Item,{noStyle:!0,shouldUpdate:(a,t)=>a.message_merge_enabled!==t.message_merge_enabled,children:({getFieldValue:a})=>a("message_merge_enabled")?e.jsx(n.Item,{name:"message_merge_delay_ms",label:s("channels.wechatMessageMergeDelayMs"),tooltip:s("channels.wechatMessageMergeDelayMsTooltip"),initialValue:0,rules:[{validator:(t,p)=>
1{if(p==null||p==="")return Promise.resolve();const b=Number(p);return!Number.isInteger(b)||b<0?Promise.reject(new Error(s("channels.wechatMessageMergeDelayMsValidation"))):Promise.resolve()}}],children:e.jsx(I,{min:0,step:100,style:{width:"100%"},placeholder:"0"})}):null})]});case"yuanbao":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"app_id",label:"App ID",rules:[{required:!0,message:"Please input App ID"}],children:e.jsx(l,{placeholder:"App ID from Yuanbao platform"})}),e.jsx(n.Item,{name:"app_secret",label:"App Secret",rules:[{required:!0,message:"Please input App Secret"}],children:e.jsx(l.Password,{placeholder:"App Secret from Yuanbao platform"})}),e.jsx(n.Item,{name:"api_domain",label:"API Domain",tooltip:"REST API domain for sign-token auth (default: bot.yuanbao.tencent.com)",children:e.jsx(l,{placeholder:"bot.yuanbao.tencent.com"})}),e.jsx(n.Item,{name:"media_dir",label:s("channels.wechatMediaDir"),children:e.jsx(l,{placeholder:T})}),e.jsx(n.Item,{name:"accept_bot_messages",label:s("channels.acceptBotMessages"),valuePropName:"checked",tooltip:s("channels.acceptBotMessagesTooltip"),children:e.jsx(o,{})})]});case"onebot":return e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"ws_host",label:"WebSocket Host",rules:[{required:!0}],children:e.jsx(l,{placeholder:"0.0.0.0"})}),e.jsx(n.Item,{name:"ws_port",label:"WebSocket Port",rules:[{required:!0},{type:"number",min:1,max:65535,message:"Port must be between 1 and 65535"}],children:e.jsx(I,{min:1,max:65535,style:{width:"100%"},placeholder:"6199"})}),e.jsx(n.Item,{name:"access_token",label:"Access Token",children:e.jsx(l.Password,{placeholder:"Access token for authentication"})}),e.jsx(n.Item,{name:"share_session_in_group",label:s("channels.shareSessionInGroup"),valuePropName:"checked",tooltip:s("channels.shareSessionInGroupTooltip"),children:e.jsx(o,{})})]});default:return null}},Y=c=>{if(x&&x.config_fields.length>0)return e.jsxs(e.Fragment,{children:[x.description&&e.jsx("div",{className:f.schemaDescription,children:x.description}),x.config_fields.map(t=>{const p=E(t.label,_.language),b=E(t.help,_.language)||void 0,M=E(t.placeholder,_.language),F=t.required?[{required:!0,message:`Please enter ${p}`}]:void 0;switch(t.type){case"password":return e.jsx(n.Item,{name:t.name,label:p,rules:F,tooltip:b,initialValue:t.default,children:e.jsx(l.Password,{placeholder:M})},t.name);case"number":return e.jsx(n.Item,{name:t.name,label:p,rules:F,tooltip:b,initialValue:t.default,children:e.jsx(I,{style:{width:"100%"},placeholder:M})},t.name);case"switch":return e.jsx(n.Item,{name:t.name,label:p,valuePropName:"checked",tooltip:b,initialValue:t.default,children:e.jsx(o,{})},t.name);case"select":return e.jsx(n.Item,{name:t.name,label:p,rules:F,tooltip:b,initialValue:t.default,children:e.jsx(i,{placeholder:M,options:(t.options||[]).map(H=>({label:H,value:H}))})},t.name);default:return e.jsx(n.Item,{name:t.name,label:p,rules:F,tooltip:b,initialValue:t.default,children:e.jsx(l,{placeholder:M})},t.name)}})]});if(!c)return null;const a=Object.keys(c).filter(t=>!te.includes(t));return a.length===0?null:e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{marginBottom:8,fontWeight:500},children:"Custom Fields"}),a.map(t=>{const p=c[t];return e.jsx(n.Item,{name:t,label:t,children:typeof p=="boolean"?e.jsx(o,{}):typeof p=="number"?e.jsx(I,{style:{width:"100%"}}):e.jsx(l,{})},t)})]})},$=e.jsxs("div",{className:f.drawerTitle,children:[e.jsx("span",{children:D?`${D} ${s("channels.settings")}`:s("channels.channelSettings")}),r&&N[r]&&B[r]&&e.jsxs(S,{type:"text",size:"small",icon:e.jsx(O,{}),onClick:()=>{const t=(N[r]||B[r]).includes("qwenpaw.agentscope.io/docs/channels/")&&G==="zh"?B[r]:N[r];Q(t)},className:f.dingtalkDocBtn,style:{color:"#FF7F16"},children:[D," Doc"]}),(()=>{if(!r||N[r]||B[r])return null;const c=E(x==null?void 0:x.doc_url,_.language);return/^https?:\/\//i.test(c)?e.jsxs(S,{type:"text",size:"small",icon:e.jsx(O,{}),onClick:()=>Q(c),className:f.dingtalkDocBtn,style:{color:"#FF7F16"},children:[D," Doc"]}):null})(),r==="voice"&&e.jsx(S,{type:"text",size:"small",icon:e.jsx(O,{}),onClick:()=>Q(ae),className:f.dingtalkDocBtn,style:{color:"#FF7F16"},children:s("channels.voiceSetupLink")})]}),X=e.jsxs("div",{className:f.formActions,children:[e.jsx(S,{onClick:C,children:s("common.cancel")}),e.jsx(S,{type:"primary",loading:v,onClick:()=>d.submit(),children:s("common.save")})]});return e.jsx(ne,{width:420,placement:"right",title:$,open:u,onClose:C,destroyOnHidden:!0,footer:X,children:r&&e.jsxs(n,{form:d,layout:"vertical",initialValues:j,onFinish:c=>{if(r!=="matrix"){P(c);return}const{auth_method:a,...t}=c;P(a==="password"?{...t,access_token:""}:{...t,password:"",encryption:!1})},children:[e.jsx(n.Item,{name:"enabled",label:s("common.enabled"),valuePropName:"checked",children:e.jsx(o,{})}),r!=="voice"&&e.jsx(n.Item,{name:"bot_prefix",label:"Bot Prefix",children:e.jsx(l,{placeholder:"@bot"})}),r!=="console"&&e.jsxs(e.Fragment,{children:[e.jsx(n.Item,{name:"filter_tool_messages",label:s("channels.filterToolMe
1ssages"),valuePropName:"checked",tooltip:s("channels.filterToolMessagesTooltip"),children:e.jsx(o,{})}),e.jsx(n.Item,{name:"filter_thinking",label:s("channels.filterThinking"),valuePropName:"checked",tooltip:s("channels.filterThinkingTooltip"),children:e.jsx(o,{})})]}),(r==="wecom"||r==="telegram"||r==="dingtalk"||r==="feishu"||r==="discord"||r==="slack"||r==="matrix")&&e.jsx(n.Item,{name:"streaming_enabled",label:s("channels.streamingEnabled"),valuePropName:"checked",tooltip:r==="dingtalk"?s("channels.streamingEnabledDingtalkHint"):r==="feishu"?s("channels.streamingEnabledFeishuHint"):void 0,children:e.jsx(o,{})}),L?V(r):Y(j),le.includes(r)&&W(),r!=="console"&&e.jsx(n.Item,{name:"no_text_debounce",label:s("channels.noTextDebounce"),valuePropName:"checked",tooltip:s("channels.noTextDebounceTooltip"),initialValue:!0,children:e.jsx(o,{})})]})},r)}export{je as ChannelDrawer};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.