| 1 | import { describe, expect, it } from 'vitest';
|
| 2 | import {
|
| 3 | HOSTED_OPENCLASP_TOOL_NAMES,
|
| 4 | OPENCLASP_MCP_INSTRUCTIONS,
|
| 5 | OPENCLASP_TOOL_NAMES,
|
| 6 | buildMcpServer,
|
| 7 | } from '../packages/mcp-server/src/server.js';
|
| 8 |
|
| 9 | describe('MCP surface', () => {
|
| 10 | it('constructs the complete server without schema composition failures', () => {
|
| 11 | expect(() => buildMcpServer()).not.toThrow();
|
| 12 | });
|
| 13 |
|
| 14 | it('exposes the complete documented tool set', () => {
|
| 15 | expect(OPENCLASP_TOOL_NAMES).toHaveLength(41);
|
| 16 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toHaveLength(40);
|
| 17 | expect(HOSTED_OPENCLASP_TOOL_NAMES).not.toContain('openclasp_create_identity');
|
| 18 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_connect_to_agent');
|
| 19 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_respond_invitation');
|
| 20 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_get_live_session');
|
| 21 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_record_session_event');
|
| 22 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_heartbeat');
|
| 23 | expect(HOSTED_OPENCLASP_TOOL_NAMES).not.toContain('openclasp_send_message');
|
| 24 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_submit_completion_report');
|
| 25 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_list_feedback_requests');
|
| 26 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_submit_interaction_feedback');
|
| 27 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_checkpoint');
|
| 28 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_complete_live_session');
|
| 29 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_resolve_agent');
|
| 30 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_propose_contract_revision');
|
| 31 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_respond_contract_revision');
|
| 32 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_get_contextual_intelligence');
|
| 33 | expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_recommend_agents');
|
| 34 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_assess_counterparty');
|
| 35 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_verify_receipt');
|
| 36 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_setup');
|
| 37 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_get_identity');
|
| 38 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_switch_agent');
|
| 39 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_save_contract');
|
| 40 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_permit_mediation');
|
| 41 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_find_agent');
|
| 42 | expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_search_agents');
|
| 43 | expect(OPENCLASP_MCP_INSTRUCTIONS.length).toBeLessThanOrEqual(512);
|
| 44 | expect(OPENCLASP_MCP_INSTRUCTIONS).toContain('openclasp_connection_status');
|
| 45 | });
|
| 46 | });
|