- 添加MinIO用户文件系统配置选项(BEAVER_MINIO_ROOT_USER等) - 更新外部连接器配置结构,包括BASE_URL和认证令牌设置 - 改进connector provider支持更多类型(official, feishu_bot等) - 实现Mistral模型推理模式支持reasoning_effort参数 - 增强外部连接器策略配置和运行时配置管理 - 添加connector bridge事件验证和安全保护机制 - 优化任务路由逻辑,区分simple_chat和new_task场景 - 更新初始技能工具提示配置,分离authoring admin功能
61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { connectorChannelForKind, runtimeBridgeEnabledForPath, visibleConnectorCards } from '@/lib/channel-connector-state';
|
|
import type { ChannelConnectorDescriptor, ChannelStatus } from '@/types';
|
|
|
|
|
|
function channel(overrides: Partial<ChannelStatus>): ChannelStatus {
|
|
return {
|
|
channel_id: 'weixin-main',
|
|
kind: 'weixin',
|
|
mode: 'polling',
|
|
account_id: 'wx-main',
|
|
display_name: 'Weixin Main',
|
|
enabled: false,
|
|
state: 'disabled',
|
|
capabilities: [],
|
|
connected_peers: 0,
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
|
|
describe('connector channel cards', () => {
|
|
it('does not let a disabled static channel block connector onboarding', () => {
|
|
expect(connectorChannelForKind('weixin', [channel({})])).toBeUndefined();
|
|
});
|
|
|
|
it('selects a running connector channel', () => {
|
|
const running = channel({ enabled: true, state: 'running' });
|
|
|
|
expect(connectorChannelForKind('weixin', [running])).toEqual(running);
|
|
});
|
|
|
|
it('selects a running terminal channel', () => {
|
|
const running = channel({
|
|
channel_id: 'terminal-dev',
|
|
kind: 'terminal',
|
|
mode: 'websocket',
|
|
display_name: 'Terminal Dev',
|
|
enabled: true,
|
|
state: 'running',
|
|
connected_peers: 1,
|
|
});
|
|
|
|
expect(connectorChannelForKind('terminal', [running])).toEqual(running);
|
|
});
|
|
|
|
it('always includes terminal as a local connector card fallback', () => {
|
|
const connectors: ChannelConnectorDescriptor[] = [{ kind: 'weixin', authType: 'qr' }, { kind: 'feishu', authType: 'plugin' }];
|
|
|
|
expect(visibleConnectorCards(connectors).map((connector) => connector.kind)).toEqual(['weixin', 'feishu', 'terminal']);
|
|
});
|
|
});
|
|
|
|
|
|
describe('app runtime bridge', () => {
|
|
it('stays enabled on settings pages so the global connection status is accurate', () => {
|
|
expect(runtimeBridgeEnabledForPath('/settings')).toBe(true);
|
|
});
|
|
});
|