- Added optional parameters 'conversationId' and 'replyToConversationId' to the cross-team messaging tool for improved threading. - Updated the TeamMemberResolver to ignore tool-like cross-team inbox names, ensuring cleaner member resolution. - Enhanced TeamProvisioningService to handle explicit cross-team reply instructions and prevent relaying tool-like names. - Improved tests to validate new cross-team messaging features and recipient handling, ensuring robust functionality across services.
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { afterEach, describe, expect, it } from 'vitest';
|
|
import * as fs from 'fs';
|
|
|
|
import { TeamMcpConfigBuilder } from '@main/services/team/TeamMcpConfigBuilder';
|
|
|
|
describe('TeamMcpConfigBuilder', () => {
|
|
const createdPaths: string[] = [];
|
|
|
|
afterEach(() => {
|
|
for (const filePath of createdPaths.splice(0)) {
|
|
try {
|
|
fs.rmSync(filePath, { force: true });
|
|
} catch {
|
|
// ignore cleanup issues in temp dir
|
|
}
|
|
}
|
|
});
|
|
|
|
it('prefers the source MCP entry when workspace source is available', async () => {
|
|
const builder = new TeamMcpConfigBuilder();
|
|
|
|
const configPath = await builder.writeConfigFile();
|
|
createdPaths.push(configPath);
|
|
|
|
const raw = fs.readFileSync(configPath, 'utf8');
|
|
const parsed = JSON.parse(raw) as {
|
|
mcpServers?: Record<string, { command?: string; args?: string[] }>;
|
|
};
|
|
|
|
const server = parsed.mcpServers?.['agent-teams'];
|
|
expect(server?.command).toBe('pnpm');
|
|
expect(server?.args).toEqual([
|
|
'--dir',
|
|
`${process.cwd()}/mcp-server`,
|
|
'exec',
|
|
'tsx',
|
|
`${process.cwd()}/mcp-server/src/index.ts`,
|
|
]);
|
|
});
|
|
});
|