@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,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* detect_drift tool
|
|
3
|
-
*
|
|
4
|
-
* Detect behavioral drift over time.
|
|
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 registerDetectDrift(server) {
|
|
10
|
-
server.registerTool("detect_drift", {
|
|
11
|
-
description: "Detect behavioral drift over time by analyzing how user behavior patterns change. " +
|
|
12
|
-
"Splits data into time windows and measures centroid shift between consecutive periods. " +
|
|
13
|
-
"Use this for long-term monitoring to detect gradual UX degradation.",
|
|
14
|
-
inputSchema: z.object({
|
|
15
|
-
page_path: z
|
|
16
|
-
.string()
|
|
17
|
-
.optional()
|
|
18
|
-
.describe("Scope drift detection to a specific page"),
|
|
19
|
-
days: z
|
|
20
|
-
.number()
|
|
21
|
-
.optional()
|
|
22
|
-
.default(30)
|
|
23
|
-
.describe("Number of days to analyze (default 30)"),
|
|
24
|
-
window_size: z
|
|
25
|
-
.number()
|
|
26
|
-
.optional()
|
|
27
|
-
.default(7)
|
|
28
|
-
.describe("Size of each time window in days (default 7)"),
|
|
29
|
-
}),
|
|
30
|
-
}, async ({ page_path, days, window_size, }) => {
|
|
31
|
-
if (!isApiConfigured()) {
|
|
32
|
-
return {
|
|
33
|
-
content: [
|
|
34
|
-
{
|
|
35
|
-
type: "text",
|
|
36
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
isError: true,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
const { data, error } = await apiGet("/drift", {
|
|
43
|
-
page_path,
|
|
44
|
-
days: days ?? 30,
|
|
45
|
-
window_size: window_size ?? 7,
|
|
46
|
-
});
|
|
47
|
-
if (error) {
|
|
48
|
-
return {
|
|
49
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
50
|
-
isError: true,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
54
|
-
});
|
|
55
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* detect_regressions tool
|
|
3
|
-
*
|
|
4
|
-
* Detect behavioral regressions by comparing recent data against baselines.
|
|
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 registerDetectRegressions(server) {
|
|
10
|
-
server.registerTool("detect_regressions", {
|
|
11
|
-
description: "Detect behavioral regressions by comparing recent data against rolling 7-day baselines. " +
|
|
12
|
-
"By default analyzes top 50 pages by traffic. Use sort_by='low_traffic' to check low-traffic " +
|
|
13
|
-
"pages that might otherwise be missed. Use offset/limit to paginate through all pages. " +
|
|
14
|
-
"Returns pages where frustration, confusion, or rage click rate have deviated significantly.",
|
|
15
|
-
inputSchema: z.object({
|
|
16
|
-
window_hours: z
|
|
17
|
-
.number()
|
|
18
|
-
.optional()
|
|
19
|
-
.default(24)
|
|
20
|
-
.describe("How many recent hours to compare against baseline (default 24)"),
|
|
21
|
-
limit: z
|
|
22
|
-
.number()
|
|
23
|
-
.optional()
|
|
24
|
-
.default(50)
|
|
25
|
-
.describe("Number of pages to check per request (default 50, max 100)"),
|
|
26
|
-
offset: z
|
|
27
|
-
.number()
|
|
28
|
-
.optional()
|
|
29
|
-
.default(0)
|
|
30
|
-
.describe("Skip this many pages for pagination (default 0)"),
|
|
31
|
-
sort_by: z
|
|
32
|
-
.enum(["traffic", "low_traffic"])
|
|
33
|
-
.optional()
|
|
34
|
-
.default("traffic")
|
|
35
|
-
.describe("Sort order: 'traffic' (default) or 'low_traffic' to check overlooked pages"),
|
|
36
|
-
}),
|
|
37
|
-
}, async ({ window_hours, limit, offset, sort_by, }) => {
|
|
38
|
-
if (!isApiConfigured()) {
|
|
39
|
-
return {
|
|
40
|
-
content: [
|
|
41
|
-
{
|
|
42
|
-
type: "text",
|
|
43
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
isError: true,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const { data, error } = await apiGet("/regressions", {
|
|
50
|
-
window_hours: window_hours ?? 24,
|
|
51
|
-
limit: limit ?? 50,
|
|
52
|
-
offset: offset ?? 0,
|
|
53
|
-
sort_by: sort_by ?? "traffic",
|
|
54
|
-
});
|
|
55
|
-
if (error) {
|
|
56
|
-
return {
|
|
57
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
58
|
-
isError: true,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
62
|
-
});
|
|
63
|
-
}
|
package/dist/tools/diagnostic.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Diagnostic tools for self-improvement workflow.
|
|
3
|
-
*
|
|
4
|
-
* Provides comprehensive site diagnostics, issue investigation, and validation.
|
|
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 registerDiagnosticTools(server) {
|
|
10
|
-
server.registerTool("run_full_diagnostic", {
|
|
11
|
-
description: "Get a quick site health overview with prioritized issues and problem pages. " +
|
|
12
|
-
"This is a lightweight entry point — it does NOT include regression detection. " +
|
|
13
|
-
"For a complete analysis, call detect_regressions separately after this. " +
|
|
14
|
-
"Returns: health score, top issues, pages needing attention, and investigation order.",
|
|
15
|
-
inputSchema: z.object({
|
|
16
|
-
days: z
|
|
17
|
-
.number()
|
|
18
|
-
.optional()
|
|
19
|
-
.default(7)
|
|
20
|
-
.describe("Number of days to analyze (default: 7)"),
|
|
21
|
-
}),
|
|
22
|
-
}, async ({ 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("/diagnostic/full", { days: days ?? 7 });
|
|
35
|
-
if (error) {
|
|
36
|
-
return {
|
|
37
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
38
|
-
isError: true,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
42
|
-
});
|
|
43
|
-
server.registerTool("investigate_issue", {
|
|
44
|
-
description: "Deep-dive into a specific issue. Returns affected sessions, element friction data, " +
|
|
45
|
-
"related console errors, similar issues, and page context. Use after identifying an " +
|
|
46
|
-
"issue to understand root cause. NOTE: Free tier users get issue summary and page " +
|
|
47
|
-
"context only. Detailed investigation data (affected sessions, element friction, " +
|
|
48
|
-
"related errors) requires a paid plan (Starter+).",
|
|
49
|
-
inputSchema: z.object({
|
|
50
|
-
issue_id: z.string().describe("The ID of the issue to investigate"),
|
|
51
|
-
days: z
|
|
52
|
-
.number()
|
|
53
|
-
.optional()
|
|
54
|
-
.default(7)
|
|
55
|
-
.describe("Number of days to look back (default: 7)"),
|
|
56
|
-
}),
|
|
57
|
-
}, async ({ issue_id, days }) => {
|
|
58
|
-
if (!isApiConfigured()) {
|
|
59
|
-
return {
|
|
60
|
-
content: [
|
|
61
|
-
{
|
|
62
|
-
type: "text",
|
|
63
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
isError: true,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
const { data, error } = await apiGet(`/issues/${issue_id}/investigate`, { days: days ?? 7 });
|
|
70
|
-
if (error) {
|
|
71
|
-
return {
|
|
72
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
73
|
-
isError: true,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
77
|
-
});
|
|
78
|
-
server.registerTool("validate_issue", {
|
|
79
|
-
description: "Check if an issue is still actively occurring. Returns staleness info and recommendation (investigate, dismiss_stale, or monitor). Use to filter out stale issues before proposing fixes.",
|
|
80
|
-
inputSchema: z.object({
|
|
81
|
-
issue_id: z.string().describe("The ID of the issue to validate"),
|
|
82
|
-
lookback_days: z
|
|
83
|
-
.number()
|
|
84
|
-
.optional()
|
|
85
|
-
.default(3)
|
|
86
|
-
.describe("Number of days to look back for recent occurrences (default: 3)"),
|
|
87
|
-
}),
|
|
88
|
-
}, async ({ issue_id, lookback_days, }) => {
|
|
89
|
-
if (!isApiConfigured()) {
|
|
90
|
-
return {
|
|
91
|
-
content: [
|
|
92
|
-
{
|
|
93
|
-
type: "text",
|
|
94
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
isError: true,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const { data, error } = await apiPost(`/issues/${issue_id}/validate`, { lookback_days: lookback_days ?? 3 });
|
|
101
|
-
if (error) {
|
|
102
|
-
return {
|
|
103
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
104
|
-
isError: true,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
108
|
-
});
|
|
109
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* discover_personas tool
|
|
3
|
-
*
|
|
4
|
-
* Discover behavioral personas - groups of users who behave similarly.
|
|
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 registerDiscoverPersonas(server) {
|
|
10
|
-
server.registerTool("discover_personas", {
|
|
11
|
-
description: "Discover behavioral personas - groups of users who behave similarly " +
|
|
12
|
-
"(e.g. confident completers, frustrated battlers, lost explorers). " +
|
|
13
|
-
"Returns rich profiles with descriptions, risk factors, and recommended interventions. " +
|
|
14
|
-
"Uses K-means clustering on behavioral embeddings. Optionally scope to a specific page.",
|
|
15
|
-
inputSchema: z.object({
|
|
16
|
-
page_path: z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe("Scope persona discovery to a specific page"),
|
|
20
|
-
num_personas: z
|
|
21
|
-
.number()
|
|
22
|
-
.optional()
|
|
23
|
-
.default(4)
|
|
24
|
-
.describe("Number of personas to discover (default 4, max 8)"),
|
|
25
|
-
}),
|
|
26
|
-
}, async ({ page_path, num_personas, }) => {
|
|
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("/personas", {
|
|
39
|
-
page_path,
|
|
40
|
-
num_personas: num_personas ?? 4,
|
|
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,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_actionable_issues tool
|
|
3
|
-
*
|
|
4
|
-
* Returns UX issues with element context for investigation.
|
|
5
|
-
* Thin proxy to external-api /actionable-issues 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 registerGetActionableIssues(server) {
|
|
11
|
-
server.registerTool("get_actionable_issues", {
|
|
12
|
-
description: "Get UX issues with element context. Returns detected issues (rage clicks, dead clicks, " +
|
|
13
|
-
"errors, etc.) along with the most affected elements on each page. " +
|
|
14
|
-
"Use this when you want to understand and fix specific UX problems.",
|
|
15
|
-
inputSchema: z.object({
|
|
16
|
-
page_path: z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe("Filter to a specific page path (e.g., /checkout)"),
|
|
20
|
-
severity: z
|
|
21
|
-
.enum(["critical", "high", "medium", "low", "info"])
|
|
22
|
-
.optional()
|
|
23
|
-
.describe("Minimum severity level to include"),
|
|
24
|
-
limit: z
|
|
25
|
-
.number()
|
|
26
|
-
.optional()
|
|
27
|
-
.default(10)
|
|
28
|
-
.describe("Maximum number of issues to return (default: 10)"),
|
|
29
|
-
}),
|
|
30
|
-
}, async ({ page_path, severity, limit, }) => {
|
|
31
|
-
if (!isApiConfigured()) {
|
|
32
|
-
return {
|
|
33
|
-
content: [
|
|
34
|
-
{
|
|
35
|
-
type: "text",
|
|
36
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
isError: true,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
const { data, error } = await apiGet("/actionable-issues", {
|
|
43
|
-
page_path,
|
|
44
|
-
severity,
|
|
45
|
-
limit: limit ?? 10,
|
|
46
|
-
});
|
|
47
|
-
if (error) {
|
|
48
|
-
return {
|
|
49
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
50
|
-
isError: true,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
54
|
-
});
|
|
55
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_anomalies tool
|
|
3
|
-
*
|
|
4
|
-
* Detects anomalous sessions and frustration spikes.
|
|
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 registerGetAnomalies(server) {
|
|
10
|
-
server.registerTool("get_anomalies", {
|
|
11
|
-
description: "Detect anomalous sessions and frustration spikes. Finds sessions that deviate from normal behavior patterns.",
|
|
12
|
-
inputSchema: z.object({
|
|
13
|
-
threshold: z
|
|
14
|
-
.number()
|
|
15
|
-
.optional()
|
|
16
|
-
.default(0.35)
|
|
17
|
-
.describe("Anomaly threshold (0-1, default: 0.35)"),
|
|
18
|
-
days: z
|
|
19
|
-
.number()
|
|
20
|
-
.optional()
|
|
21
|
-
.default(7)
|
|
22
|
-
.describe("Days to analyze for frustration spikes (default: 7)"),
|
|
23
|
-
page_path: z
|
|
24
|
-
.string()
|
|
25
|
-
.optional()
|
|
26
|
-
.describe("Optional: filter to a specific page"),
|
|
27
|
-
}),
|
|
28
|
-
}, async ({ threshold, days, page_path, }) => {
|
|
29
|
-
if (!isApiConfigured()) {
|
|
30
|
-
return {
|
|
31
|
-
content: [
|
|
32
|
-
{
|
|
33
|
-
type: "text",
|
|
34
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
isError: true,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
const { data, error } = await apiGet("/anomalies", {
|
|
41
|
-
threshold: threshold ?? 0.35,
|
|
42
|
-
days: days ?? 7,
|
|
43
|
-
page_path,
|
|
44
|
-
});
|
|
45
|
-
if (error) {
|
|
46
|
-
return {
|
|
47
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
48
|
-
isError: true,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
52
|
-
});
|
|
53
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_console_errors tool
|
|
3
|
-
*
|
|
4
|
-
* Query JavaScript console errors and warnings from user sessions.
|
|
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 registerGetConsoleErrors(server) {
|
|
10
|
-
server.registerTool("get_console_errors", {
|
|
11
|
-
description: "Query JavaScript console errors and warnings from user sessions. " +
|
|
12
|
-
"Use this when you suspect page unresponsiveness, broken buttons, or rendering issues. " +
|
|
13
|
-
"Returns the most common errors grouped by message, with session impact counts. " +
|
|
14
|
-
"High rage clicks on root/body elements often correlate with JS errors.",
|
|
15
|
-
inputSchema: z.object({
|
|
16
|
-
page_path: z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe("Filter errors to a specific page path"),
|
|
20
|
-
session_id: z
|
|
21
|
-
.string()
|
|
22
|
-
.optional()
|
|
23
|
-
.describe("Filter errors to a specific session"),
|
|
24
|
-
severity: z
|
|
25
|
-
.enum(["error", "warn", "all"])
|
|
26
|
-
.optional()
|
|
27
|
-
.default("error")
|
|
28
|
-
.describe('Filter by severity: "error" (default), "warn", or "all"'),
|
|
29
|
-
limit: z
|
|
30
|
-
.number()
|
|
31
|
-
.optional()
|
|
32
|
-
.default(200)
|
|
33
|
-
.describe("Max log documents to scan (default 200)"),
|
|
34
|
-
}),
|
|
35
|
-
}, async ({ page_path, session_id, severity, limit, }) => {
|
|
36
|
-
if (!isApiConfigured()) {
|
|
37
|
-
return {
|
|
38
|
-
content: [
|
|
39
|
-
{
|
|
40
|
-
type: "text",
|
|
41
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
isError: true,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const { data, error } = await apiGet("/console-errors", {
|
|
48
|
-
page_path,
|
|
49
|
-
session_id,
|
|
50
|
-
severity: severity ?? "error",
|
|
51
|
-
limit: limit ?? 200,
|
|
52
|
-
});
|
|
53
|
-
if (error) {
|
|
54
|
-
return {
|
|
55
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
56
|
-
isError: true,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
60
|
-
});
|
|
61
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_dead_clicks tool
|
|
3
|
-
*
|
|
4
|
-
* Find buttons and links that users click but nothing happens (dead clicks).
|
|
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 registerGetDeadClicks(server) {
|
|
10
|
-
server.registerTool("get_dead_clicks", {
|
|
11
|
-
description: "Find buttons and links that users click but nothing happens (dead clicks). " +
|
|
12
|
-
"These are interactive elements where the click produced no visible DOM change. " +
|
|
13
|
-
"Use this to identify BROKEN or UNRESPONSIVE UI elements that frustrate users.",
|
|
14
|
-
inputSchema: z.object({
|
|
15
|
-
page_path: z
|
|
16
|
-
.string()
|
|
17
|
-
.describe("Page path to check for dead clicks (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("/dead-clicks", {
|
|
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/getDomains.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_domains tool
|
|
3
|
-
*
|
|
4
|
-
* Returns the list of domains configured for the organization.
|
|
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 registerGetDomains(server) {
|
|
10
|
-
server.registerTool("get_domains", {
|
|
11
|
-
description: "Get the list of domains configured for the organization. Domains represent different websites or applications being tracked.",
|
|
12
|
-
inputSchema: z.object({}),
|
|
13
|
-
}, async () => {
|
|
14
|
-
if (!isApiConfigured()) {
|
|
15
|
-
return {
|
|
16
|
-
content: [
|
|
17
|
-
{
|
|
18
|
-
type: "text",
|
|
19
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
isError: true,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const { data, error } = await apiGet("/domains");
|
|
26
|
-
if (error) {
|
|
27
|
-
return {
|
|
28
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
29
|
-
isError: true,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_element_friction tool
|
|
3
|
-
*
|
|
4
|
-
* Returns per-element friction data for a specific 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 registerGetElementFriction(server) {
|
|
10
|
-
server.registerTool("get_element_friction", {
|
|
11
|
-
description: "Get per-element friction data for a page. Shows which elements cause user frustration, with click counts and dominant frustration signals.",
|
|
12
|
-
inputSchema: z.object({
|
|
13
|
-
page_path: z
|
|
14
|
-
.string()
|
|
15
|
-
.describe("Page path to analyze (e.g., /checkout)"),
|
|
16
|
-
selector_filter: z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe("Optional: filter elements by selector substring"),
|
|
20
|
-
}),
|
|
21
|
-
}, async ({ page_path, selector_filter, }) => {
|
|
22
|
-
if (!isApiConfigured()) {
|
|
23
|
-
return {
|
|
24
|
-
content: [
|
|
25
|
-
{
|
|
26
|
-
type: "text",
|
|
27
|
-
text: JSON.stringify({ error: "API not configured" }),
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
isError: true,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const { data, error } = await apiGet("/elements", {
|
|
34
|
-
page_path,
|
|
35
|
-
selector_filter,
|
|
36
|
-
});
|
|
37
|
-
if (error) {
|
|
38
|
-
return {
|
|
39
|
-
content: [{ type: "text", text: JSON.stringify({ error }) }],
|
|
40
|
-
isError: true,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
44
|
-
});
|
|
45
|
-
}
|