@recapt/mcp 0.0.19-beta → 0.0.20
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/dist/cli/index.d.ts +0 -11
- package/dist/cli/index.js +1059 -21
- package/dist/index.d.ts +0 -19
- package/dist/index.js +3210 -89
- package/package.json +5 -3
- package/dist/api/client.d.ts +0 -6
- package/dist/api/client.js +0 -6
- package/dist/cli/commands/setup-self-improvement-gh.d.ts +0 -7
- package/dist/cli/commands/setup-self-improvement-gh.js +0 -310
- package/dist/cli/commands/setup.d.ts +0 -7
- package/dist/cli/commands/setup.js +0 -178
- package/dist/cli/commands/skill.d.ts +0 -24
- package/dist/cli/commands/skill.js +0 -264
- package/dist/cli/utils/ide-config.d.ts +0 -31
- package/dist/cli/utils/ide-config.js +0 -294
- package/dist/cli/utils/prompts.d.ts +0 -22
- package/dist/cli/utils/prompts.js +0 -71
- package/dist/tools/analyzeFlow.d.ts +0 -7
- package/dist/tools/analyzeFlow.js +0 -68
- package/dist/tools/analyzeFunnel.d.ts +0 -7
- package/dist/tools/analyzeFunnel.js +0 -63
- package/dist/tools/catalog/callTool.d.ts +0 -22
- package/dist/tools/catalog/callTool.js +0 -92
- package/dist/tools/catalog/index.d.ts +0 -11
- package/dist/tools/catalog/index.js +0 -11
- package/dist/tools/catalog/searchTools.d.ts +0 -22
- package/dist/tools/catalog/searchTools.js +0 -194
- package/dist/tools/compareCohorts.d.ts +0 -6
- package/dist/tools/compareCohorts.js +0 -84
- package/dist/tools/comparePeriods.d.ts +0 -6
- package/dist/tools/comparePeriods.js +0 -54
- package/dist/tools/detectDrift.d.ts +0 -6
- package/dist/tools/detectDrift.js +0 -55
- package/dist/tools/detectRegressions.d.ts +0 -6
- package/dist/tools/detectRegressions.js +0 -63
- package/dist/tools/diagnostic.d.ts +0 -6
- package/dist/tools/diagnostic.js +0 -109
- package/dist/tools/discoverPersonas.d.ts +0 -6
- package/dist/tools/discoverPersonas.js +0 -50
- package/dist/tools/getActionableIssues.d.ts +0 -7
- package/dist/tools/getActionableIssues.js +0 -55
- package/dist/tools/getAnomalies.d.ts +0 -6
- package/dist/tools/getAnomalies.js +0 -53
- package/dist/tools/getConsoleErrors.d.ts +0 -6
- package/dist/tools/getConsoleErrors.js +0 -61
- package/dist/tools/getDeadClicks.d.ts +0 -6
- package/dist/tools/getDeadClicks.js +0 -42
- package/dist/tools/getDomains.d.ts +0 -6
- package/dist/tools/getDomains.js +0 -34
- package/dist/tools/getElementFriction.d.ts +0 -6
- package/dist/tools/getElementFriction.js +0 -45
- package/dist/tools/getFlowFriction.d.ts +0 -7
- package/dist/tools/getFlowFriction.js +0 -57
- package/dist/tools/getFormFriction.d.ts +0 -6
- package/dist/tools/getFormFriction.js +0 -42
- package/dist/tools/getIssues.d.ts +0 -6
- package/dist/tools/getIssues.js +0 -82
- package/dist/tools/getJourneyPatterns.d.ts +0 -7
- package/dist/tools/getJourneyPatterns.js +0 -50
- package/dist/tools/getPageMetrics.d.ts +0 -6
- package/dist/tools/getPageMetrics.js +0 -47
- package/dist/tools/getPageTrends.d.ts +0 -6
- package/dist/tools/getPageTrends.js +0 -46
- package/dist/tools/getSessionDetails.d.ts +0 -6
- package/dist/tools/getSessionDetails.js +0 -70
- package/dist/tools/getSessionPages.d.ts +0 -7
- package/dist/tools/getSessionPages.js +0 -74
- package/dist/tools/getUxHealthReport.d.ts +0 -7
- package/dist/tools/getUxHealthReport.js +0 -50
- package/dist/tools/improvementRun.d.ts +0 -6
- package/dist/tools/improvementRun.js +0 -386
- package/dist/tools/knowledge.d.ts +0 -6
- package/dist/tools/knowledge.js +0 -186
- package/dist/tools/listPages.d.ts +0 -6
- package/dist/tools/listPages.js +0 -50
- package/dist/tools/listSessions.d.ts +0 -7
- package/dist/tools/listSessions.js +0 -67
- package/dist/tools/memory.d.ts +0 -7
- package/dist/tools/memory.js +0 -119
- package/dist/tools/predictOutcomes.d.ts +0 -6
- package/dist/tools/predictOutcomes.js +0 -66
- package/dist/tools/remediation.d.ts +0 -6
- package/dist/tools/remediation.js +0 -335
- package/dist/tools/scanSite.d.ts +0 -6
- package/dist/tools/scanSite.js +0 -51
- package/dist/tools/searchSessions.d.ts +0 -6
- package/dist/tools/searchSessions.js +0 -51
- package/dist/tools/triage.d.ts +0 -6
- package/dist/tools/triage.js +0 -114
- package/dist/tools/triageSessions.d.ts +0 -8
- package/dist/tools/triageSessions.js +0 -197
- package/dist/tools/upgradeOptions.d.ts +0 -7
- package/dist/tools/upgradeOptions.js +0 -67
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_flow_friction tool
|
|
3
|
-
*
|
|
4
|
-
* Discovers high-friction user flows by analyzing navigation patterns
|
|
5
|
-
* and behavioral data. Thin proxy to external-api /flow-friction endpoint.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import { apiGet, isApiConfigured } from "../api/client.js";
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export function registerGetFlowFriction(server) {
|
|
11
|
-
server.registerTool("get_flow_friction", {
|
|
12
|
-
description: "Discover user flows with behavioral metrics. Returns navigation transitions " +
|
|
13
|
-
"with frustration, confusion, and health scores for each page in the flow. " +
|
|
14
|
-
"Also flags backtrack hotspots (pages users return to) and dropoff pages. " +
|
|
15
|
-
"Use this to find which flows need optimization.",
|
|
16
|
-
inputSchema: z.object({
|
|
17
|
-
page_path: z
|
|
18
|
-
.string()
|
|
19
|
-
.optional()
|
|
20
|
-
.describe("Focus on flows involving this page (e.g., /checkout)"),
|
|
21
|
-
days: z
|
|
22
|
-
.number()
|
|
23
|
-
.optional()
|
|
24
|
-
.default(7)
|
|
25
|
-
.describe("Number of days to analyze (default: 7)"),
|
|
26
|
-
limit: z
|
|
27
|
-
.number()
|
|
28
|
-
.optional()
|
|
29
|
-
.default(10)
|
|
30
|
-
.describe("Maximum number of flows to return (default: 10)"),
|
|
31
|
-
}),
|
|
32
|
-
}, async ({ page_path, days, limit, }) => {
|
|
33
|
-
if (!isApiConfigured()) {
|
|
34
|
-
return {
|
|
35
|
-
content: [
|
|
36
|
-
{
|
|
37
|
-
type: "text",
|
|
38
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
isError: true,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const { data, error } = await apiGet("/flow-friction", {
|
|
45
|
-
page_path,
|
|
46
|
-
days: days ?? 7,
|
|
47
|
-
limit: limit ?? 10,
|
|
48
|
-
});
|
|
49
|
-
if (error) {
|
|
50
|
-
return {
|
|
51
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
52
|
-
isError: true,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_form_friction tool
|
|
3
|
-
*
|
|
4
|
-
* Analyze which form fields cause friction.
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { apiGet, isApiConfigured } from "../api/client.js";
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
-
export function registerGetFormFriction(server) {
|
|
10
|
-
server.registerTool("get_form_friction", {
|
|
11
|
-
description: "Analyze which form fields cause friction on a page. " +
|
|
12
|
-
"Returns per-field metrics including dwell time, correction rate, and abandonment rate. " +
|
|
13
|
-
"Use this to identify problematic form fields in checkout, signup, or other forms.",
|
|
14
|
-
inputSchema: z.object({
|
|
15
|
-
page_path: z
|
|
16
|
-
.string()
|
|
17
|
-
.describe("Page path containing the form to analyze (required)"),
|
|
18
|
-
}),
|
|
19
|
-
}, async ({ page_path }) => {
|
|
20
|
-
if (!isApiConfigured()) {
|
|
21
|
-
return {
|
|
22
|
-
content: [
|
|
23
|
-
{
|
|
24
|
-
type: "text",
|
|
25
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
isError: true,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const { data, error } = await apiGet("/forms/friction", {
|
|
32
|
-
page_path,
|
|
33
|
-
});
|
|
34
|
-
if (error) {
|
|
35
|
-
return {
|
|
36
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
37
|
-
isError: true,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
41
|
-
});
|
|
42
|
-
}
|
package/dist/tools/getIssues.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_issues tool
|
|
3
|
-
*
|
|
4
|
-
* Returns detected UX issues.
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { apiGet, isApiConfigured } from "../api/client.js";
|
|
8
|
-
const VALID_CATEGORIES = [
|
|
9
|
-
"code_error",
|
|
10
|
-
"dead_click",
|
|
11
|
-
"rage_click",
|
|
12
|
-
"ux_friction",
|
|
13
|
-
"performance",
|
|
14
|
-
"form_issue",
|
|
15
|
-
"behavioral_anomaly",
|
|
16
|
-
"structural_issue",
|
|
17
|
-
];
|
|
18
|
-
const VALID_SEVERITIES = ["critical", "high", "medium", "low", "info"];
|
|
19
|
-
const VALID_STATUSES = [
|
|
20
|
-
"pending",
|
|
21
|
-
"active",
|
|
22
|
-
"escalated",
|
|
23
|
-
"resolved",
|
|
24
|
-
"dismissed",
|
|
25
|
-
"expired",
|
|
26
|
-
];
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
-
export function registerGetIssues(server) {
|
|
29
|
-
server.registerTool("get_issues", {
|
|
30
|
-
description: "Get detected UX issues. Issues are automatically detected from session recordings and include rage clicks, dead clicks, form issues, and behavioral anomalies.",
|
|
31
|
-
inputSchema: z.object({
|
|
32
|
-
page_path: z
|
|
33
|
-
.string()
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("Filter issues to a specific page path"),
|
|
36
|
-
category: z
|
|
37
|
-
.enum(VALID_CATEGORIES)
|
|
38
|
-
.optional()
|
|
39
|
-
.describe("Filter by issue category"),
|
|
40
|
-
severity: z
|
|
41
|
-
.enum(VALID_SEVERITIES)
|
|
42
|
-
.optional()
|
|
43
|
-
.describe("Filter by severity level"),
|
|
44
|
-
status: z
|
|
45
|
-
.enum(VALID_STATUSES)
|
|
46
|
-
.optional()
|
|
47
|
-
.default("active")
|
|
48
|
-
.describe("Filter by status (default: active)"),
|
|
49
|
-
limit: z
|
|
50
|
-
.number()
|
|
51
|
-
.optional()
|
|
52
|
-
.default(20)
|
|
53
|
-
.describe("Maximum number of issues to return (default: 20)"),
|
|
54
|
-
}),
|
|
55
|
-
}, async ({ page_path, category, severity, status, limit, }) => {
|
|
56
|
-
if (!isApiConfigured()) {
|
|
57
|
-
return {
|
|
58
|
-
content: [
|
|
59
|
-
{
|
|
60
|
-
type: "text",
|
|
61
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
isError: true,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
const { data, error } = await apiGet("/issues", {
|
|
68
|
-
page_path,
|
|
69
|
-
category,
|
|
70
|
-
severity,
|
|
71
|
-
status: status ?? "active",
|
|
72
|
-
limit: limit ?? 20,
|
|
73
|
-
});
|
|
74
|
-
if (error) {
|
|
75
|
-
return {
|
|
76
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
77
|
-
isError: true,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
81
|
-
});
|
|
82
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_journey_patterns tool
|
|
3
|
-
*
|
|
4
|
-
* Discovers navigation patterns across sessions.
|
|
5
|
-
* Thin proxy to external-api /flows/patterns endpoint.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import { apiGet, isApiConfigured } from "../api/client.js";
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export function registerGetJourneyPatterns(server) {
|
|
11
|
-
server.registerTool("get_journey_patterns", {
|
|
12
|
-
description: "Discover navigation patterns across sessions. Returns top page transitions, " +
|
|
13
|
-
"backtrack hotspots (pages users return to), and dropoff pages (where sessions end). " +
|
|
14
|
-
"Use this to understand organic user navigation.",
|
|
15
|
-
inputSchema: z.object({
|
|
16
|
-
page_path: z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe("Filter to transitions involving this page (e.g., /pricing)"),
|
|
20
|
-
days: z
|
|
21
|
-
.number()
|
|
22
|
-
.optional()
|
|
23
|
-
.default(7)
|
|
24
|
-
.describe("Number of days to analyze (default: 7)"),
|
|
25
|
-
}),
|
|
26
|
-
}, async ({ page_path, days }) => {
|
|
27
|
-
if (!isApiConfigured()) {
|
|
28
|
-
return {
|
|
29
|
-
content: [
|
|
30
|
-
{
|
|
31
|
-
type: "text",
|
|
32
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
isError: true,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const { data, error } = await apiGet("/flows/patterns", {
|
|
39
|
-
page_path,
|
|
40
|
-
days: days ?? 7,
|
|
41
|
-
});
|
|
42
|
-
if (error) {
|
|
43
|
-
return {
|
|
44
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
45
|
-
isError: true,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
49
|
-
});
|
|
50
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_page_metrics tool
|
|
3
|
-
*
|
|
4
|
-
* Returns aggregated behavioral metrics for a specific page or all pages.
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { apiGet, isApiConfigured } from "../api/client.js";
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
-
export function registerGetPageMetrics(server) {
|
|
10
|
-
server.registerTool("get_page_metrics", {
|
|
11
|
-
description: "Get aggregated behavioral metrics for a page. Returns frustration, confusion, confidence, energy scores, and health score. If page_path is omitted, returns metrics for all pages.",
|
|
12
|
-
inputSchema: z.object({
|
|
13
|
-
page_path: z
|
|
14
|
-
.string()
|
|
15
|
-
.optional()
|
|
16
|
-
.describe("Page path to get metrics for (e.g., /checkout). Omit to get all pages."),
|
|
17
|
-
days: z
|
|
18
|
-
.number()
|
|
19
|
-
.optional()
|
|
20
|
-
.default(7)
|
|
21
|
-
.describe("Number of days to look back (default: 7)"),
|
|
22
|
-
}),
|
|
23
|
-
}, async ({ page_path, days }) => {
|
|
24
|
-
if (!isApiConfigured()) {
|
|
25
|
-
return {
|
|
26
|
-
content: [
|
|
27
|
-
{
|
|
28
|
-
type: "text",
|
|
29
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
isError: true,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
const { data, error } = await apiGet("/pages", {
|
|
36
|
-
page_path,
|
|
37
|
-
days,
|
|
38
|
-
});
|
|
39
|
-
if (error) {
|
|
40
|
-
return {
|
|
41
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
42
|
-
isError: true,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
46
|
-
});
|
|
47
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_page_trends tool
|
|
3
|
-
*
|
|
4
|
-
* Returns daily behavioral trends for a page.
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { apiGet, isApiConfigured } from "../api/client.js";
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
-
export function registerGetPageTrends(server) {
|
|
10
|
-
server.registerTool("get_page_trends", {
|
|
11
|
-
description: "Get daily behavioral trends for a page. Shows how frustration, confusion, and confidence change over time.",
|
|
12
|
-
inputSchema: z.object({
|
|
13
|
-
page_path: z
|
|
14
|
-
.string()
|
|
15
|
-
.describe("Page path to analyze (e.g., /checkout)"),
|
|
16
|
-
days: z
|
|
17
|
-
.number()
|
|
18
|
-
.optional()
|
|
19
|
-
.default(14)
|
|
20
|
-
.describe("Number of days to look back (default: 14)"),
|
|
21
|
-
}),
|
|
22
|
-
}, async ({ page_path, days }) => {
|
|
23
|
-
if (!isApiConfigured()) {
|
|
24
|
-
return {
|
|
25
|
-
content: [
|
|
26
|
-
{
|
|
27
|
-
type: "text",
|
|
28
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
isError: true,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const { data, error } = await apiGet("/trends", {
|
|
35
|
-
page_path,
|
|
36
|
-
days: days ?? 14,
|
|
37
|
-
});
|
|
38
|
-
if (error) {
|
|
39
|
-
return {
|
|
40
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
41
|
-
isError: true,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
45
|
-
});
|
|
46
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_session_details tool
|
|
3
|
-
*
|
|
4
|
-
* Returns behavioral timeline for one or more sessions.
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { apiGet, apiPost, isApiConfigured } from "../api/client.js";
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
-
export function registerGetSessionDetails(server) {
|
|
10
|
-
server.registerTool("get_session_details", {
|
|
11
|
-
description: "Get behavioral timeline for one or more sessions. Shows how frustration, confusion, and confidence evolved over time. Accepts a single session_id or an array of session_ids (max 20).",
|
|
12
|
-
inputSchema: z.object({
|
|
13
|
-
session_id: z
|
|
14
|
-
.string()
|
|
15
|
-
.optional()
|
|
16
|
-
.describe("Single session ID to get details for"),
|
|
17
|
-
session_ids: z
|
|
18
|
-
.array(z.string())
|
|
19
|
-
.max(20)
|
|
20
|
-
.optional()
|
|
21
|
-
.describe("Array of session IDs to get details for (max 20)"),
|
|
22
|
-
}),
|
|
23
|
-
}, async ({ session_id, session_ids, }) => {
|
|
24
|
-
if (!isApiConfigured()) {
|
|
25
|
-
return {
|
|
26
|
-
content: [
|
|
27
|
-
{
|
|
28
|
-
type: "text",
|
|
29
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
isError: true,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
if (!session_id && (!session_ids || session_ids.length === 0)) {
|
|
36
|
-
return {
|
|
37
|
-
content: [
|
|
38
|
-
{
|
|
39
|
-
type: "text",
|
|
40
|
-
text: JSON.stringify({
|
|
41
|
-
error: "Either session_id or session_ids must be provided",
|
|
42
|
-
}),
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
isError: true,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
if (session_id && !session_ids) {
|
|
49
|
-
const { data, error } = await apiGet(`/sessions/${session_id}`);
|
|
50
|
-
if (error) {
|
|
51
|
-
return {
|
|
52
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
53
|
-
isError: true,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
57
|
-
}
|
|
58
|
-
const ids = session_ids ?? [session_id];
|
|
59
|
-
const { data, error } = await apiPost("/sessions/details", {
|
|
60
|
-
session_ids: ids,
|
|
61
|
-
});
|
|
62
|
-
if (error) {
|
|
63
|
-
return {
|
|
64
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
65
|
-
isError: true,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
69
|
-
});
|
|
70
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_session_pages tool
|
|
3
|
-
*
|
|
4
|
-
* Returns the pages visited within one or more sessions.
|
|
5
|
-
* Thin proxy to external-api /sessions/:id/pages and /sessions/pages endpoints.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import { apiGet, apiPost, isApiConfigured } from "../api/client.js";
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export function registerGetSessionPages(server) {
|
|
11
|
-
server.registerTool("get_session_pages", {
|
|
12
|
-
description: "Get the pages visited within one or more sessions. Returns navigation history " +
|
|
13
|
-
"with timestamps, source pages, and dwell times. Use this to understand the " +
|
|
14
|
-
"user's journey through the site during a session. Accepts a single session_id " +
|
|
15
|
-
"or an array of session_ids (max 20).",
|
|
16
|
-
inputSchema: z.object({
|
|
17
|
-
session_id: z
|
|
18
|
-
.string()
|
|
19
|
-
.optional()
|
|
20
|
-
.describe("Single session ID to get pages for"),
|
|
21
|
-
session_ids: z
|
|
22
|
-
.array(z.string())
|
|
23
|
-
.max(20)
|
|
24
|
-
.optional()
|
|
25
|
-
.describe("Array of session IDs to get pages for (max 20)"),
|
|
26
|
-
}),
|
|
27
|
-
}, async ({ session_id, session_ids, }) => {
|
|
28
|
-
if (!isApiConfigured()) {
|
|
29
|
-
return {
|
|
30
|
-
content: [
|
|
31
|
-
{
|
|
32
|
-
type: "text",
|
|
33
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
isError: true,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (!session_id && (!session_ids || session_ids.length === 0)) {
|
|
40
|
-
return {
|
|
41
|
-
content: [
|
|
42
|
-
{
|
|
43
|
-
type: "text",
|
|
44
|
-
text: JSON.stringify({
|
|
45
|
-
error: "Either session_id or session_ids must be provided",
|
|
46
|
-
}),
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
isError: true,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
if (session_id && !session_ids) {
|
|
53
|
-
const { data, error } = await apiGet(`/sessions/${session_id}/pages`);
|
|
54
|
-
if (error) {
|
|
55
|
-
return {
|
|
56
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
57
|
-
isError: true,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
61
|
-
}
|
|
62
|
-
const ids = session_ids ?? [session_id];
|
|
63
|
-
const { data, error } = await apiPost("/sessions/pages", {
|
|
64
|
-
session_ids: ids,
|
|
65
|
-
});
|
|
66
|
-
if (error) {
|
|
67
|
-
return {
|
|
68
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
69
|
-
isError: true,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
73
|
-
});
|
|
74
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_ux_health_report tool
|
|
3
|
-
*
|
|
4
|
-
* Returns a comprehensive UX health report for the website or a specific page.
|
|
5
|
-
* Thin proxy to external-api /health-report endpoint.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import { apiGet, isApiConfigured } from "../api/client.js";
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export function registerGetUxHealthReport(server) {
|
|
11
|
-
server.registerTool("get_ux_health_report", {
|
|
12
|
-
description: "Get a comprehensive UX health report combining page metrics, issues, and anomalies. " +
|
|
13
|
-
"Returns overall health score, per-page breakdown, active issues, and frustration spikes. " +
|
|
14
|
-
"Use this as a starting point to understand overall UX state before diving deeper.",
|
|
15
|
-
inputSchema: z.object({
|
|
16
|
-
page_path: z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe("Focus on a specific page (omit for site-wide report)"),
|
|
20
|
-
days: z
|
|
21
|
-
.number()
|
|
22
|
-
.optional()
|
|
23
|
-
.default(7)
|
|
24
|
-
.describe("Number of days to analyze (default: 7)"),
|
|
25
|
-
}),
|
|
26
|
-
}, async ({ page_path, days }) => {
|
|
27
|
-
if (!isApiConfigured()) {
|
|
28
|
-
return {
|
|
29
|
-
content: [
|
|
30
|
-
{
|
|
31
|
-
type: "text",
|
|
32
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
isError: true,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const { data, error } = await apiGet("/health-report", {
|
|
39
|
-
page_path,
|
|
40
|
-
days: days ?? 7,
|
|
41
|
-
});
|
|
42
|
-
if (error) {
|
|
43
|
-
return {
|
|
44
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
45
|
-
isError: true,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
49
|
-
});
|
|
50
|
-
}
|