@agentlensai/mcp 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/server.test.d.ts +2 -0
- package/dist/server.test.d.ts.map +1 -0
- package/dist/server.test.js +72 -0
- package/dist/server.test.js.map +1 -0
- package/dist/tools.d.ts +7 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +268 -0
- package/dist/tools.js.map +1 -0
- package/dist/tools.test.d.ts +2 -0
- package/dist/tools.test.d.ts.map +1 -0
- package/dist/tools.test.js +366 -0
- package/dist/tools.test.js.map +1 -0
- package/dist/transport.d.ts +86 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +170 -0
- package/dist/transport.js.map +1 -0
- package/dist/transport.test.d.ts +2 -0
- package/dist/transport.test.d.ts.map +1 -0
- package/dist/transport.test.js +170 -0
- package/dist/transport.test.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for AgentLensTransport (Story 5.6)
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
5
|
+
import { AgentLensTransport } from './transport.js';
|
|
6
|
+
// Mock global fetch
|
|
7
|
+
const mockFetch = vi.fn();
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
vi.stubGlobal('fetch', mockFetch);
|
|
10
|
+
mockFetch.mockReset();
|
|
11
|
+
});
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
vi.unstubAllGlobals();
|
|
14
|
+
});
|
|
15
|
+
function okResponse(data = {}) {
|
|
16
|
+
return new Response(JSON.stringify(data), {
|
|
17
|
+
status: 200,
|
|
18
|
+
headers: { 'Content-Type': 'application/json' },
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function errorResponse(status, body) {
|
|
22
|
+
return new Response(body, { status });
|
|
23
|
+
}
|
|
24
|
+
describe('AgentLensTransport', () => {
|
|
25
|
+
describe('constructor', () => {
|
|
26
|
+
it('strips trailing slashes from baseUrl', () => {
|
|
27
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400///' });
|
|
28
|
+
// Verified indirectly via sendEventImmediate call
|
|
29
|
+
mockFetch.mockResolvedValue(okResponse());
|
|
30
|
+
void t.sendEventImmediate({
|
|
31
|
+
sessionId: 's1',
|
|
32
|
+
agentId: 'a1',
|
|
33
|
+
eventType: 'custom',
|
|
34
|
+
payload: {},
|
|
35
|
+
});
|
|
36
|
+
expect(mockFetch).toHaveBeenCalledWith('http://localhost:3400/api/events', expect.anything());
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('sendEventImmediate', () => {
|
|
40
|
+
it('sends a POST to /api/events with correct headers and wraps event in batch format', async () => {
|
|
41
|
+
mockFetch.mockResolvedValue(okResponse({ id: 'evt_1' }));
|
|
42
|
+
const t = new AgentLensTransport({
|
|
43
|
+
baseUrl: 'http://localhost:3400',
|
|
44
|
+
apiKey: 'test-key',
|
|
45
|
+
});
|
|
46
|
+
const event = {
|
|
47
|
+
sessionId: 'ses_123',
|
|
48
|
+
agentId: 'agent_1',
|
|
49
|
+
eventType: 'session_started',
|
|
50
|
+
payload: { agentName: 'Test' },
|
|
51
|
+
};
|
|
52
|
+
const resp = await t.sendEventImmediate(event);
|
|
53
|
+
expect(resp.ok).toBe(true);
|
|
54
|
+
expect(mockFetch).toHaveBeenCalledWith('http://localhost:3400/api/events', {
|
|
55
|
+
method: 'POST',
|
|
56
|
+
headers: {
|
|
57
|
+
'Content-Type': 'application/json',
|
|
58
|
+
Authorization: 'Bearer test-key',
|
|
59
|
+
},
|
|
60
|
+
body: JSON.stringify({ events: [event] }),
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
it('omits Authorization header when no apiKey', async () => {
|
|
64
|
+
mockFetch.mockResolvedValue(okResponse());
|
|
65
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
66
|
+
await t.sendEventImmediate({
|
|
67
|
+
sessionId: 's',
|
|
68
|
+
agentId: 'a',
|
|
69
|
+
eventType: 'custom',
|
|
70
|
+
payload: {},
|
|
71
|
+
});
|
|
72
|
+
const headers = mockFetch.mock.calls[0][1].headers;
|
|
73
|
+
expect(headers).not.toHaveProperty('Authorization');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('queryEvents', () => {
|
|
77
|
+
it('sends a GET with query parameters', async () => {
|
|
78
|
+
mockFetch.mockResolvedValue(okResponse({ events: [] }));
|
|
79
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
80
|
+
await t.queryEvents({ sessionId: 'ses_123', limit: 10, eventType: 'tool_call' });
|
|
81
|
+
const url = mockFetch.mock.calls[0][0];
|
|
82
|
+
expect(url).toContain('/api/events?');
|
|
83
|
+
expect(url).toContain('sessionId=ses_123');
|
|
84
|
+
expect(url).toContain('limit=10');
|
|
85
|
+
expect(url).toContain('eventType=tool_call');
|
|
86
|
+
});
|
|
87
|
+
it('omits optional params when not provided', async () => {
|
|
88
|
+
mockFetch.mockResolvedValue(okResponse({ events: [] }));
|
|
89
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
90
|
+
await t.queryEvents({ sessionId: 'ses_123' });
|
|
91
|
+
const url = mockFetch.mock.calls[0][0];
|
|
92
|
+
expect(url).toContain('sessionId=ses_123');
|
|
93
|
+
expect(url).not.toContain('limit=');
|
|
94
|
+
expect(url).not.toContain('eventType=');
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
describe('session-agent mapping', () => {
|
|
98
|
+
it('stores and retrieves agentId for a session', () => {
|
|
99
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
100
|
+
t.setSessionAgent('ses_123', 'agent-1');
|
|
101
|
+
expect(t.getSessionAgent('ses_123')).toBe('agent-1');
|
|
102
|
+
});
|
|
103
|
+
it('returns empty string for unknown sessions', () => {
|
|
104
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
105
|
+
expect(t.getSessionAgent('unknown')).toBe('');
|
|
106
|
+
});
|
|
107
|
+
it('clears session mapping', () => {
|
|
108
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
109
|
+
t.setSessionAgent('ses_123', 'agent-1');
|
|
110
|
+
t.clearSessionAgent('ses_123');
|
|
111
|
+
expect(t.getSessionAgent('ses_123')).toBe('');
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
describe('buffering and flush', () => {
|
|
115
|
+
it('buffers events via sendEvents', async () => {
|
|
116
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
117
|
+
await t.sendEvents([
|
|
118
|
+
{ sessionId: 's', agentId: 'a', eventType: 'custom', payload: { x: 1 } },
|
|
119
|
+
]);
|
|
120
|
+
expect(t.bufferedCount).toBe(1);
|
|
121
|
+
expect(t.bufferedBytes).toBeGreaterThan(0);
|
|
122
|
+
// No fetch call yet (below threshold)
|
|
123
|
+
expect(mockFetch).not.toHaveBeenCalled();
|
|
124
|
+
});
|
|
125
|
+
it('flushes buffered events to /api/events', async () => {
|
|
126
|
+
mockFetch.mockResolvedValue(okResponse());
|
|
127
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400', apiKey: 'key' });
|
|
128
|
+
await t.sendEvents([
|
|
129
|
+
{ sessionId: 's', agentId: 'a', eventType: 'custom', payload: { x: 1 } },
|
|
130
|
+
{ sessionId: 's', agentId: 'a', eventType: 'custom', payload: { x: 2 } },
|
|
131
|
+
]);
|
|
132
|
+
await t.flush();
|
|
133
|
+
expect(mockFetch).toHaveBeenCalledOnce();
|
|
134
|
+
expect(mockFetch).toHaveBeenCalledWith('http://localhost:3400/api/events', {
|
|
135
|
+
method: 'POST',
|
|
136
|
+
headers: {
|
|
137
|
+
'Content-Type': 'application/json',
|
|
138
|
+
Authorization: 'Bearer key',
|
|
139
|
+
},
|
|
140
|
+
body: expect.stringContaining('"events"'),
|
|
141
|
+
});
|
|
142
|
+
expect(t.bufferedCount).toBe(0);
|
|
143
|
+
});
|
|
144
|
+
it('re-buffers events on flush failure', async () => {
|
|
145
|
+
mockFetch.mockResolvedValue(errorResponse(500, 'Server error'));
|
|
146
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
147
|
+
await t.sendEvents([
|
|
148
|
+
{ sessionId: 's', agentId: 'a', eventType: 'custom', payload: { x: 1 } },
|
|
149
|
+
]);
|
|
150
|
+
await t.flush();
|
|
151
|
+
// Events should be re-buffered
|
|
152
|
+
expect(t.bufferedCount).toBe(1);
|
|
153
|
+
});
|
|
154
|
+
it('re-buffers events on network error', async () => {
|
|
155
|
+
mockFetch.mockRejectedValue(new Error('Network unreachable'));
|
|
156
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
157
|
+
await t.sendEvents([
|
|
158
|
+
{ sessionId: 's', agentId: 'a', eventType: 'custom', payload: { x: 1 } },
|
|
159
|
+
]);
|
|
160
|
+
await t.flush();
|
|
161
|
+
expect(t.bufferedCount).toBe(1);
|
|
162
|
+
});
|
|
163
|
+
it('does not flush when buffer is empty', async () => {
|
|
164
|
+
const t = new AgentLensTransport({ baseUrl: 'http://localhost:3400' });
|
|
165
|
+
await t.flush();
|
|
166
|
+
expect(mockFetch).not.toHaveBeenCalled();
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=transport.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.test.js","sourceRoot":"","sources":["../src/transport.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EA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AAC,KAAK,EAAE,CAAC;YAEhB,+BAA+B;YAC/B,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;YAClD,SAAS,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;YAE9D,MAAM,CAAC,GAAG,IAAI,kBAAkB,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC;YACvE,MAAM,CAAC,CAAC,UAAU,CAAC;gBACjB,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;aACzE,CAAC,CAAC;YAEH,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;YAEhB,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;YACnD,MAAM,CAAC,GAAG,IAAI,kBAAkB,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC;YACvE,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentlensai/mcp",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "MCP server for AgentLens — instrument AI agents with zero code changes",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Amit Paz",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/amitpaz/agentlens.git",
|
|
11
|
+
"directory": "packages/mcp"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/amitpaz/agentlens/tree/main/packages/mcp",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/amitpaz/agentlens/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"agentlens",
|
|
19
|
+
"mcp",
|
|
20
|
+
"mcp-server",
|
|
21
|
+
"ai-agents",
|
|
22
|
+
"observability",
|
|
23
|
+
"claude-desktop",
|
|
24
|
+
"cursor",
|
|
25
|
+
"model-context-protocol",
|
|
26
|
+
"instrumentation"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"main": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"bin": {
|
|
37
|
+
"agentlens-mcp": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
44
|
+
"zod": "^3.25.76",
|
|
45
|
+
"@agentlensai/core": "0.2.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc -b",
|
|
49
|
+
"dev": "tsc -b --watch",
|
|
50
|
+
"typecheck": "tsc --noEmit",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"test:watch": "vitest"
|
|
53
|
+
}
|
|
54
|
+
}
|