qorrelate-mcp-server 0.1.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.
Files changed (50) hide show
  1. package/README.md +197 -0
  2. package/dist/client.d.ts +293 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +358 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/index.d.ts +26 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +242 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/tools/alerts.d.ts +14 -0
  11. package/dist/tools/alerts.d.ts.map +1 -0
  12. package/dist/tools/alerts.js +381 -0
  13. package/dist/tools/alerts.js.map +1 -0
  14. package/dist/tools/dashboards.d.ts +14 -0
  15. package/dist/tools/dashboards.d.ts.map +1 -0
  16. package/dist/tools/dashboards.js +409 -0
  17. package/dist/tools/dashboards.js.map +1 -0
  18. package/dist/tools/data-control.d.ts +19 -0
  19. package/dist/tools/data-control.d.ts.map +1 -0
  20. package/dist/tools/data-control.js +213 -0
  21. package/dist/tools/data-control.js.map +1 -0
  22. package/dist/tools/logs.d.ts +14 -0
  23. package/dist/tools/logs.d.ts.map +1 -0
  24. package/dist/tools/logs.js +191 -0
  25. package/dist/tools/logs.js.map +1 -0
  26. package/dist/tools/metrics.d.ts +14 -0
  27. package/dist/tools/metrics.d.ts.map +1 -0
  28. package/dist/tools/metrics.js +217 -0
  29. package/dist/tools/metrics.js.map +1 -0
  30. package/dist/tools/organizations.d.ts +16 -0
  31. package/dist/tools/organizations.d.ts.map +1 -0
  32. package/dist/tools/organizations.js +378 -0
  33. package/dist/tools/organizations.js.map +1 -0
  34. package/dist/tools/services.d.ts +14 -0
  35. package/dist/tools/services.d.ts.map +1 -0
  36. package/dist/tools/services.js +218 -0
  37. package/dist/tools/services.js.map +1 -0
  38. package/dist/tools/sessions.d.ts +14 -0
  39. package/dist/tools/sessions.d.ts.map +1 -0
  40. package/dist/tools/sessions.js +221 -0
  41. package/dist/tools/sessions.js.map +1 -0
  42. package/dist/tools/setup.d.ts +17 -0
  43. package/dist/tools/setup.d.ts.map +1 -0
  44. package/dist/tools/setup.js +304 -0
  45. package/dist/tools/setup.js.map +1 -0
  46. package/dist/tools/traces.d.ts +14 -0
  47. package/dist/tools/traces.d.ts.map +1 -0
  48. package/dist/tools/traces.js +350 -0
  49. package/dist/tools/traces.js.map +1 -0
  50. package/package.json +48 -0
@@ -0,0 +1,378 @@
1
+ "use strict";
2
+ /**
3
+ * Organization Management Tools
4
+ *
5
+ * Tools for managing organizations, members, invitations, and API keys.
6
+ * Enables AI agents to fully automate the setup and onboarding process.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.registerOrganizationTools = registerOrganizationTools;
10
+ exports.handleOrganizationTool = handleOrganizationTool;
11
+ function registerOrganizationTools() {
12
+ return [
13
+ {
14
+ name: "list_organizations",
15
+ description: "List all organizations the current user/API key has access to",
16
+ inputSchema: {
17
+ type: "object",
18
+ properties: {},
19
+ required: [],
20
+ },
21
+ },
22
+ {
23
+ name: "get_organization_members",
24
+ description: "List all members of an organization",
25
+ inputSchema: {
26
+ type: "object",
27
+ properties: {
28
+ organization_id: {
29
+ type: "string",
30
+ description: "Organization ID",
31
+ },
32
+ },
33
+ required: ["organization_id"],
34
+ },
35
+ },
36
+ {
37
+ name: "invite_user",
38
+ description: "Invite a user to join an organization by email",
39
+ inputSchema: {
40
+ type: "object",
41
+ properties: {
42
+ organization_id: {
43
+ type: "string",
44
+ description: "Organization ID",
45
+ },
46
+ email: {
47
+ type: "string",
48
+ description: "Email address of the user to invite",
49
+ },
50
+ },
51
+ required: ["organization_id", "email"],
52
+ },
53
+ },
54
+ {
55
+ name: "list_invitations",
56
+ description: "List pending invitations for an organization",
57
+ inputSchema: {
58
+ type: "object",
59
+ properties: {
60
+ organization_id: {
61
+ type: "string",
62
+ description: "Organization ID",
63
+ },
64
+ },
65
+ required: ["organization_id"],
66
+ },
67
+ },
68
+ {
69
+ name: "create_api_key",
70
+ description: "Create a new API key for an organization. Returns the key which should be stored securely.",
71
+ inputSchema: {
72
+ type: "object",
73
+ properties: {
74
+ organization_id: {
75
+ type: "string",
76
+ description: "Organization ID",
77
+ },
78
+ name: {
79
+ type: "string",
80
+ description: "Descriptive name for the API key (e.g., 'production-backend', 'staging-collector')",
81
+ },
82
+ expires_days: {
83
+ type: "number",
84
+ description: "Number of days until the key expires (default: 365)",
85
+ },
86
+ },
87
+ required: ["organization_id", "name"],
88
+ },
89
+ },
90
+ {
91
+ name: "list_api_keys",
92
+ description: "List all API keys for an organization (key values are hidden)",
93
+ inputSchema: {
94
+ type: "object",
95
+ properties: {
96
+ organization_id: {
97
+ type: "string",
98
+ description: "Organization ID",
99
+ },
100
+ },
101
+ required: ["organization_id"],
102
+ },
103
+ },
104
+ {
105
+ name: "revoke_api_key",
106
+ description: "Revoke an API key by name",
107
+ inputSchema: {
108
+ type: "object",
109
+ properties: {
110
+ organization_id: {
111
+ type: "string",
112
+ description: "Organization ID",
113
+ },
114
+ key_name: {
115
+ type: "string",
116
+ description: "Name of the API key to revoke",
117
+ },
118
+ },
119
+ required: ["organization_id", "key_name"],
120
+ },
121
+ },
122
+ {
123
+ name: "get_usage",
124
+ description: `Get organization usage statistics (logs, traces, metrics counts) over a time period.
125
+
126
+ Returns daily breakdown of:
127
+ - Logs: count and GB ingested
128
+ - Traces: count and estimated GB
129
+ - Metrics: count and estimated GB
130
+ - Session replays: count
131
+
132
+ Useful for understanding usage trends and forecasting costs.`,
133
+ inputSchema: {
134
+ type: "object",
135
+ properties: {
136
+ organization_id: {
137
+ type: "string",
138
+ description: "Organization ID",
139
+ },
140
+ start_date: {
141
+ type: "string",
142
+ description: "Start date (ISO format, e.g., '2026-01-01'). Default: 30 days ago",
143
+ },
144
+ end_date: {
145
+ type: "string",
146
+ description: "End date (ISO format). Default: today",
147
+ },
148
+ },
149
+ required: ["organization_id"],
150
+ },
151
+ },
152
+ {
153
+ name: "get_billing",
154
+ description: `Get billing information for an organization.
155
+
156
+ Returns:
157
+ - Usage totals for the billing period
158
+ - Calculated costs based on pricing tiers
159
+ - Pricing details (per GB for logs, per 1000 for metrics)
160
+
161
+ Useful for cost monitoring and budget planning.`,
162
+ inputSchema: {
163
+ type: "object",
164
+ properties: {
165
+ organization_id: {
166
+ type: "string",
167
+ description: "Organization ID",
168
+ },
169
+ month: {
170
+ type: "string",
171
+ description: "Billing month in YYYY-MM format (e.g., '2026-01'). Default: current month",
172
+ },
173
+ },
174
+ required: ["organization_id"],
175
+ },
176
+ },
177
+ {
178
+ name: "get_data_usage_summary",
179
+ description: `Get detailed data usage summary with breakdown by service and data type.
180
+
181
+ Returns comprehensive usage analytics including:
182
+ - Total ingestion by data type
183
+ - Per-service breakdown
184
+ - Usage trends over time
185
+ - Query statistics
186
+
187
+ Useful for identifying high-volume services and optimization opportunities.`,
188
+ inputSchema: {
189
+ type: "object",
190
+ properties: {
191
+ organization_id: {
192
+ type: "string",
193
+ description: "Organization ID",
194
+ },
195
+ days: {
196
+ type: "number",
197
+ description: "Number of days to analyze (1-365, default: 30)",
198
+ },
199
+ },
200
+ required: ["organization_id"],
201
+ },
202
+ },
203
+ {
204
+ name: "get_unused_metrics",
205
+ description: `Find metrics that haven't been queried recently.
206
+
207
+ Returns a list of metrics that are being ingested but not used in:
208
+ - Dashboards
209
+ - Alerts
210
+ - API queries
211
+
212
+ This helps identify cost-saving opportunities by dropping unused metrics.`,
213
+ inputSchema: {
214
+ type: "object",
215
+ properties: {
216
+ organization_id: {
217
+ type: "string",
218
+ description: "Organization ID",
219
+ },
220
+ days: {
221
+ type: "number",
222
+ description: "Lookback period for 'unused' detection (1-90 days, default: 7)",
223
+ },
224
+ },
225
+ required: ["organization_id"],
226
+ },
227
+ },
228
+ ];
229
+ }
230
+ async function handleOrganizationTool(client, name, args) {
231
+ switch (name) {
232
+ case "list_organizations": {
233
+ const result = await client.listOrganizations();
234
+ return {
235
+ content: [
236
+ {
237
+ type: "text",
238
+ text: JSON.stringify(result, null, 2),
239
+ },
240
+ ],
241
+ };
242
+ }
243
+ case "get_organization_members": {
244
+ const orgId = args.organization_id;
245
+ const result = await client.getOrganizationMembers(orgId);
246
+ return {
247
+ content: [
248
+ {
249
+ type: "text",
250
+ text: JSON.stringify(result, null, 2),
251
+ },
252
+ ],
253
+ };
254
+ }
255
+ case "invite_user": {
256
+ const orgId = args.organization_id;
257
+ const email = args.email;
258
+ const result = await client.inviteUser(orgId, email);
259
+ return {
260
+ content: [
261
+ {
262
+ type: "text",
263
+ text: JSON.stringify(result, null, 2),
264
+ },
265
+ ],
266
+ };
267
+ }
268
+ case "list_invitations": {
269
+ const orgId = args.organization_id;
270
+ const result = await client.listInvitations(orgId);
271
+ return {
272
+ content: [
273
+ {
274
+ type: "text",
275
+ text: JSON.stringify(result, null, 2),
276
+ },
277
+ ],
278
+ };
279
+ }
280
+ case "create_api_key": {
281
+ const orgId = args.organization_id;
282
+ const name = args.name;
283
+ const expires_days = args.expires_days || 365;
284
+ const result = await client.createApiKey(orgId, name, expires_days);
285
+ return {
286
+ content: [
287
+ {
288
+ type: "text",
289
+ text: `API Key Created!\n\n${JSON.stringify(result, null, 2)}\n\n⚠️ IMPORTANT: Store this key securely. It will not be shown again.`,
290
+ },
291
+ ],
292
+ };
293
+ }
294
+ case "list_api_keys": {
295
+ const orgId = args.organization_id;
296
+ const result = await client.listApiKeys(orgId);
297
+ return {
298
+ content: [
299
+ {
300
+ type: "text",
301
+ text: JSON.stringify(result, null, 2),
302
+ },
303
+ ],
304
+ };
305
+ }
306
+ case "revoke_api_key": {
307
+ const orgId = args.organization_id;
308
+ const keyName = args.key_name;
309
+ const result = await client.revokeApiKey(orgId, keyName);
310
+ return {
311
+ content: [
312
+ {
313
+ type: "text",
314
+ text: JSON.stringify(result, null, 2),
315
+ },
316
+ ],
317
+ };
318
+ }
319
+ case "get_usage": {
320
+ const orgId = args.organization_id;
321
+ const params = {
322
+ start_date: args.start_date,
323
+ end_date: args.end_date,
324
+ };
325
+ const result = await client.getOrganizationUsage(orgId, params);
326
+ return {
327
+ content: [
328
+ {
329
+ type: "text",
330
+ text: JSON.stringify(result, null, 2),
331
+ },
332
+ ],
333
+ };
334
+ }
335
+ case "get_billing": {
336
+ const orgId = args.organization_id;
337
+ const month = args.month;
338
+ const result = await client.getOrganizationBilling(orgId, month);
339
+ return {
340
+ content: [
341
+ {
342
+ type: "text",
343
+ text: JSON.stringify(result, null, 2),
344
+ },
345
+ ],
346
+ };
347
+ }
348
+ case "get_data_usage_summary": {
349
+ const orgId = args.organization_id;
350
+ const days = args.days;
351
+ const result = await client.getDataUsageSummary(orgId, days);
352
+ return {
353
+ content: [
354
+ {
355
+ type: "text",
356
+ text: JSON.stringify(result, null, 2),
357
+ },
358
+ ],
359
+ };
360
+ }
361
+ case "get_unused_metrics": {
362
+ const orgId = args.organization_id;
363
+ const days = args.days;
364
+ const result = await client.getUnusedMetrics(orgId, days);
365
+ return {
366
+ content: [
367
+ {
368
+ type: "text",
369
+ text: JSON.stringify(result, null, 2),
370
+ },
371
+ ],
372
+ };
373
+ }
374
+ default:
375
+ throw new Error(`Unknown organization tool: ${name}`);
376
+ }
377
+ }
378
+ //# sourceMappingURL=organizations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../src/tools/organizations.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAKH,8DA0NC;AAED,wDAkKC;AA9XD,SAAgB,yBAAyB;IACvC,OAAO;QACL;YACE,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,+DAA+D;YAC5E,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE,EAAE;aACb;SACF;QACD;YACE,IAAI,EAAE,0BAA0B;YAChC,WAAW,EAAE,qCAAqC;YAClD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,eAAe,EAAE;wBACf,IAAI,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MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Service-related MCP tools
3
+ */
4
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
5
+ import type { QorrelateClient } from "../client.js";
6
+ export declare function registerServiceTools(): Tool[];
7
+ export declare function handleServiceTool(client: QorrelateClient, toolName: string, args: Record<string, unknown> | undefined): Promise<{
8
+ content: Array<{
9
+ type: string;
10
+ text: string;
11
+ }>;
12
+ isError?: boolean;
13
+ }>;
14
+ //# sourceMappingURL=services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/tools/services.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,wBAAgB,oBAAoB,IAAI,IAAI,EAAE,CAoD7C;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACxC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA6JhF"}
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ /**
3
+ * Service-related MCP tools
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.registerServiceTools = registerServiceTools;
7
+ exports.handleServiceTool = handleServiceTool;
8
+ function registerServiceTools() {
9
+ return [
10
+ {
11
+ name: "list_services",
12
+ description: "List all services sending telemetry. Shows service names and last seen timestamps.",
13
+ inputSchema: {
14
+ type: "object",
15
+ properties: {},
16
+ },
17
+ },
18
+ {
19
+ name: "get_service_health",
20
+ description: `Get health status for a specific service. Shows error rate, latency percentiles, and recent errors.
21
+
22
+ Examples:
23
+ - Check API health: get_service_health with service="api-gateway"
24
+ - Check payment service: get_service_health with service="payment-service"`,
25
+ inputSchema: {
26
+ type: "object",
27
+ properties: {
28
+ service: {
29
+ type: "string",
30
+ description: "Service name to check",
31
+ },
32
+ },
33
+ required: ["service"],
34
+ },
35
+ },
36
+ {
37
+ name: "services_compare_health",
38
+ description: "Compare health metrics across multiple services. Useful for identifying which services are having issues.",
39
+ inputSchema: {
40
+ type: "object",
41
+ properties: {
42
+ services: {
43
+ type: "array",
44
+ items: { type: "string" },
45
+ description: "List of service names to compare",
46
+ },
47
+ },
48
+ required: ["services"],
49
+ },
50
+ },
51
+ {
52
+ name: "services_overview",
53
+ description: "Get an overview of all services with their health status. Highlights any services with issues.",
54
+ inputSchema: {
55
+ type: "object",
56
+ properties: {},
57
+ },
58
+ },
59
+ ];
60
+ }
61
+ async function handleServiceTool(client, toolName, args) {
62
+ const params = args || {};
63
+ switch (toolName) {
64
+ case "list_services": {
65
+ const result = await client.listServices();
66
+ return {
67
+ content: [{
68
+ type: "text",
69
+ text: JSON.stringify({
70
+ count: result.services.length,
71
+ services: result.services.map(s => ({
72
+ name: s.name,
73
+ last_seen: s.last_seen,
74
+ log_count: s.log_count,
75
+ trace_count: s.trace_count,
76
+ })),
77
+ }, null, 2),
78
+ }],
79
+ };
80
+ }
81
+ case "get_service_health": {
82
+ const service = params.service;
83
+ if (!service) {
84
+ return {
85
+ content: [{ type: "text", text: "service is required" }],
86
+ isError: true,
87
+ };
88
+ }
89
+ const health = await client.getServiceHealth(service);
90
+ // Determine health status emoji
91
+ const statusEmoji = {
92
+ healthy: '✅',
93
+ degraded: '⚠️',
94
+ unhealthy: '❌',
95
+ unknown: '❓',
96
+ }[health.status];
97
+ return {
98
+ content: [{
99
+ type: "text",
100
+ text: JSON.stringify({
101
+ service: health.service,
102
+ status: `${statusEmoji} ${health.status}`,
103
+ metrics: {
104
+ error_rate_percent: health.error_rate,
105
+ avg_latency_ms: health.avg_latency_ms,
106
+ p95_latency_ms: health.p95_latency_ms,
107
+ request_count_last_hour: health.request_count,
108
+ },
109
+ last_error: health.last_error ? {
110
+ operation: health.last_error,
111
+ time: health.last_error_time,
112
+ } : null,
113
+ recommendations: getHealthRecommendations(health),
114
+ }, null, 2),
115
+ }],
116
+ };
117
+ }
118
+ case "services_compare_health": {
119
+ const services = params.services;
120
+ if (!services || services.length === 0) {
121
+ return {
122
+ content: [{ type: "text", text: "services array is required" }],
123
+ isError: true,
124
+ };
125
+ }
126
+ const healthResults = await Promise.all(services.map(service => client.getServiceHealth(service)));
127
+ const comparison = healthResults.map(health => ({
128
+ service: health.service,
129
+ status: health.status,
130
+ error_rate_percent: health.error_rate,
131
+ avg_latency_ms: health.avg_latency_ms,
132
+ p95_latency_ms: health.p95_latency_ms,
133
+ request_count: health.request_count,
134
+ }));
135
+ // Sort by error rate descending (worst first)
136
+ comparison.sort((a, b) => b.error_rate_percent - a.error_rate_percent);
137
+ return {
138
+ content: [{
139
+ type: "text",
140
+ text: JSON.stringify({
141
+ comparison,
142
+ summary: {
143
+ healthiest: comparison[comparison.length - 1]?.service,
144
+ most_issues: comparison[0]?.service,
145
+ services_with_errors: comparison.filter(s => s.error_rate_percent > 0).length,
146
+ },
147
+ }, null, 2),
148
+ }],
149
+ };
150
+ }
151
+ case "services_overview": {
152
+ const servicesResult = await client.listServices();
153
+ // Get health for all services (limit to first 20 to avoid too many requests)
154
+ const servicesToCheck = servicesResult.services.slice(0, 20);
155
+ const healthResults = await Promise.all(servicesToCheck.map(s => client.getServiceHealth(s.name)));
156
+ // Categorize by status
157
+ const healthy = healthResults.filter(h => h.status === 'healthy');
158
+ const degraded = healthResults.filter(h => h.status === 'degraded');
159
+ const unhealthy = healthResults.filter(h => h.status === 'unhealthy');
160
+ const unknown = healthResults.filter(h => h.status === 'unknown');
161
+ return {
162
+ content: [{
163
+ type: "text",
164
+ text: JSON.stringify({
165
+ total_services: servicesResult.services.length,
166
+ checked: servicesToCheck.length,
167
+ summary: {
168
+ healthy: healthy.length,
169
+ degraded: degraded.length,
170
+ unhealthy: unhealthy.length,
171
+ unknown: unknown.length,
172
+ },
173
+ issues: [
174
+ ...unhealthy.map(h => ({
175
+ service: h.service,
176
+ status: '❌ unhealthy',
177
+ error_rate: `${h.error_rate}%`,
178
+ last_error: h.last_error,
179
+ })),
180
+ ...degraded.map(h => ({
181
+ service: h.service,
182
+ status: '⚠️ degraded',
183
+ error_rate: `${h.error_rate}%`,
184
+ avg_latency_ms: h.avg_latency_ms,
185
+ })),
186
+ ],
187
+ healthy_services: healthy.map(h => h.service),
188
+ }, null, 2),
189
+ }],
190
+ };
191
+ }
192
+ default:
193
+ return {
194
+ content: [{ type: "text", text: `Unknown services tool: ${toolName}` }],
195
+ isError: true,
196
+ };
197
+ }
198
+ }
199
+ function getHealthRecommendations(health) {
200
+ const recommendations = [];
201
+ if (health.error_rate > 5) {
202
+ recommendations.push("High error rate detected. Check logs for error patterns using query_logs with severity='ERROR'");
203
+ }
204
+ if (health.p95_latency_ms > 1000) {
205
+ recommendations.push("High P95 latency. Analyze slow traces using traces_analyze_latency");
206
+ }
207
+ if (health.avg_latency_ms > 500) {
208
+ recommendations.push("Elevated average latency. Consider checking database queries or downstream dependencies");
209
+ }
210
+ if (health.request_count === 0) {
211
+ recommendations.push("No recent requests. Service may be down or not receiving traffic");
212
+ }
213
+ if (recommendations.length === 0) {
214
+ recommendations.push("Service appears healthy. No immediate action needed");
215
+ }
216
+ return recommendations;
217
+ }
218
+ //# sourceMappingURL=services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.js","sour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CAAC;qBACZ,CAAC;aACH,CAAC;QACJ,CAAC;QAED;YACE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,QAAQ,EAAE,EAAE,CAAC;gBACvE,OAAO,EAAE,IAAI;aACd,CAAC;IACN,CAAC;AACH,CAAC;AAED,SAAS,wBAAwB,CAAC,MAMjC;IACC,MAAM,eAAe,GAAa,EAAE,CAAC;IAErC,IAAI,MAAM,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;QAC1B,eAAe,CAAC,IAAI,CAAC,gGAAgG,CAAC,CAAC;IACzH,CAAC;IAED,IAAI,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,CAAC;QACjC,eAAe,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;IAC7F,CAAC;IAED,IAAI,MAAM,CAAC,cAAc,GAAG,GAAG,EAAE,CAAC;QAChC,eAAe,CAAC,IAAI,CAAC,yFAAyF,CAAC,CAAC;IAClH,CAAC;IAED,IAAI,MAAM,CAAC,aAAa,KAAK,CAAC,EAAE,CAAC;QAC/B,eAAe,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,eAAe,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Session replay-related MCP tools
3
+ */
4
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
5
+ import type { QorrelateClient } from "../client.js";
6
+ export declare function registerSessionTools(): Tool[];
7
+ export declare function handleSessionTool(client: QorrelateClient, toolName: string, args: Record<string, unknown> | undefined): Promise<{
8
+ content: Array<{
9
+ type: string;
10
+ text: string;
11
+ }>;
12
+ isError?: boolean;
13
+ }>;
14
+ //# sourceMappingURL=sessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../src/tools/sessions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,wBAAgB,oBAAoB,IAAI,IAAI,EAAE,CAqE7C;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACxC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA4KhF"}