| 105 | } |
| 106 | |
| 107 | function getDefaultNotifyTarget( |
| 108 | adapter: RuntimePlatform, |
| 109 | channelId: string, |
| 110 | ): { adapter: NotifyTargetPlatform; channelId: string } | null { |
| 111 | if (adapter === "telegram" && channelId.startsWith("telegram-")) { |
| 112 | return { adapter: "telegram", channelId }; |
| 113 | } |
| 114 | |
| 115 | if (adapter === "slack" && channelId.startsWith("slack-")) { |
| 116 | return { adapter: "slack", channelId }; |
| 117 | } |
| 118 | |
| 119 | if (adapter === "feishu" && channelId.startsWith("feishu-")) { |
| 120 | return { adapter: "feishu", channelId }; |
| 121 | } |
| 122 | |
| 123 | if (adapter === "web") { |
| 124 | return { adapter: "web", channelId }; |
| 125 | } |
| 126 | |
| 127 | return null; |
| 128 | } |
| 129 | |
| 130 | // --------------------------------------------------------------------------- |
| 131 | // Tool Definition |