Files
beaver_project/app-instance/frontend/lib/channel-connector-state.ts
steven_li 2c5205b06e feat: 添加MinIO文件系统支持并优化外部连接器功能
- 添加MinIO用户文件系统配置选项(BEAVER_MINIO_ROOT_USER等)
- 更新外部连接器配置结构,包括BASE_URL和认证令牌设置
- 改进connector provider支持更多类型(official, feishu_bot等)
- 实现Mistral模型推理模式支持reasoning_effort参数
- 增强外部连接器策略配置和运行时配置管理
- 添加connector bridge事件验证和安全保护机制
- 优化任务路由逻辑,区分simple_chat和new_task场景
- 更新初始技能工具提示配置,分离authoring admin功能
2026-06-05 11:46:40 +08:00

29 lines
1.0 KiB
TypeScript

import type { ChannelConnectorDescriptor, ChannelStatus } from '@/types';
const CONNECTOR_CARD_KINDS = ['weixin', 'feishu', 'terminal'];
export function connectorChannelForKind(kind: string, channels: ChannelStatus[]): ChannelStatus | undefined {
const matches = channels.filter((channel) => channel.kind === kind);
return (
matches.find((channel) => channel.state === 'running') ||
matches.find((channel) => channel.enabled && channel.state !== 'disabled' && channel.state !== 'stopped')
);
}
export function visibleConnectorCards(connectors: ChannelConnectorDescriptor[]): ChannelConnectorDescriptor[] {
const byKind = new Map<string, ChannelConnectorDescriptor>();
connectors.forEach((connector) => {
if (CONNECTOR_CARD_KINDS.includes(connector.kind) && !byKind.has(connector.kind)) {
byKind.set(connector.kind, connector);
}
});
return CONNECTOR_CARD_KINDS.map((kind) => byKind.get(kind) || { kind });
}
export function runtimeBridgeEnabledForPath(_pathname: string): boolean {
return true;
}