The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Viewing files at commit 68f53f7907caCommit detailsView latest

tests/mcp.test.ts 52 lines · 3.2 KB · typescript
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(47);
16
    expect(HOSTED_OPENCLASP_TOOL_NAMES).toHaveLength(46);
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(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_generate_assurance_probe');
35
    expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_list_assurance_probes');
36
    expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_submit_assurance_response');
37
    expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_get_assurance_comparisons');
38
    expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_get_assurance_brief');
39
    expect(HOSTED_OPENCLASP_TOOL_NAMES).toContain('openclasp_decide_assurance_safeguard');
40
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_assess_counterparty');
41
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_verify_receipt');
42
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_setup');
43
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_get_identity');
44
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_switch_agent');
45
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_save_contract');
46
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_permit_mediation');
47
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_find_agent');
48
    expect(OPENCLASP_TOOL_NAMES).toContain('openclasp_search_agents');
49
    expect(OPENCLASP_MCP_INSTRUCTIONS.length).toBeLessThanOrEqual(512);
50
    expect(OPENCLASP_MCP_INSTRUCTIONS).toContain('openclasp_connection_status');
51
  });
52
});