agent-ecosystem/test/main/services/team/TeamMcpConfigBuilder.test.ts
iliya c93f3a4181 feat: enhance cross-team messaging with new parameters and recipient handling
- 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.
2026-03-10 15:40:42 +02:00

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`,
]);
});
});