@sealmetrics/mcp 0.1.0 → 1.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/README.md +149 -0
- package/dist/client.d.ts +45 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +136 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +55 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +1 -6
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -781
- package/dist/index.js.map +1 -0
- package/dist/resources/tracking-guide.d.ts +13 -0
- package/dist/resources/tracking-guide.d.ts.map +1 -0
- package/dist/resources/tracking-guide.js +479 -0
- package/dist/resources/tracking-guide.js.map +1 -0
- package/dist/tools/alerts.d.ts +5 -0
- package/dist/tools/alerts.d.ts.map +1 -0
- package/dist/tools/alerts.js +80 -0
- package/dist/tools/alerts.js.map +1 -0
- package/dist/tools/audience.d.ts +7 -0
- package/dist/tools/audience.d.ts.map +1 -0
- package/dist/tools/audience.js +146 -0
- package/dist/tools/audience.js.map +1 -0
- package/dist/tools/bots.d.ts +4 -0
- package/dist/tools/bots.d.ts.map +1 -0
- package/dist/tools/bots.js +52 -0
- package/dist/tools/bots.js.map +1 -0
- package/dist/tools/channels.d.ts +5 -0
- package/dist/tools/channels.d.ts.map +1 -0
- package/dist/tools/channels.js +88 -0
- package/dist/tools/channels.js.map +1 -0
- package/dist/tools/content.d.ts +3 -0
- package/dist/tools/content.d.ts.map +1 -0
- package/dist/tools/content.js +47 -0
- package/dist/tools/content.js.map +1 -0
- package/dist/tools/conversions.d.ts +6 -0
- package/dist/tools/conversions.d.ts.map +1 -0
- package/dist/tools/conversions.js +178 -0
- package/dist/tools/conversions.js.map +1 -0
- package/dist/tools/funnel.d.ts +3 -0
- package/dist/tools/funnel.d.ts.map +1 -0
- package/dist/tools/funnel.js +27 -0
- package/dist/tools/funnel.js.map +1 -0
- package/dist/tools/index.d.ts +16 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +79 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/manage.d.ts +3 -0
- package/dist/tools/manage.d.ts.map +1 -0
- package/dist/tools/manage.js +55 -0
- package/dist/tools/manage.js.map +1 -0
- package/dist/tools/overview.d.ts +3 -0
- package/dist/tools/overview.d.ts.map +1 -0
- package/dist/tools/overview.js +26 -0
- package/dist/tools/overview.js.map +1 -0
- package/dist/tools/pages.d.ts +7 -0
- package/dist/tools/pages.d.ts.map +1 -0
- package/dist/tools/pages.js +207 -0
- package/dist/tools/pages.js.map +1 -0
- package/dist/tools/properties.d.ts +5 -0
- package/dist/tools/properties.d.ts.map +1 -0
- package/dist/tools/properties.js +107 -0
- package/dist/tools/properties.js.map +1 -0
- package/dist/tools/segments.d.ts +4 -0
- package/dist/tools/segments.d.ts.map +1 -0
- package/dist/tools/segments.js +49 -0
- package/dist/tools/segments.js.map +1 -0
- package/dist/tools/shared.d.ts +45 -0
- package/dist/tools/shared.d.ts.map +1 -0
- package/dist/tools/shared.js +139 -0
- package/dist/tools/shared.js.map +1 -0
- package/dist/tools/sites.d.ts +4 -0
- package/dist/tools/sites.d.ts.map +1 -0
- package/dist/tools/sites.js +36 -0
- package/dist/tools/sites.js.map +1 -0
- package/dist/tools/tracking.d.ts +3 -0
- package/dist/tools/tracking.d.ts.map +1 -0
- package/dist/tools/tracking.js +220 -0
- package/dist/tools/tracking.js.map +1 -0
- package/dist/tools/traffic.d.ts +10 -0
- package/dist/tools/traffic.d.ts.map +1 -0
- package/dist/tools/traffic.js +273 -0
- package/dist/tools/traffic.js.map +1 -0
- package/dist/tools/webhooks.d.ts +5 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +101 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/types.d.ts +118 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/package.json +35 -27
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a period string (e.g. "30d", "this_month") to start_date / end_date.
|
|
3
|
+
* Needed for endpoints that don't accept the `period` shorthand.
|
|
4
|
+
*/
|
|
5
|
+
export declare function periodToDateRange(period: string): {
|
|
6
|
+
start_date: string;
|
|
7
|
+
end_date: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const PERIOD_SCHEMA: {
|
|
10
|
+
readonly type: "string";
|
|
11
|
+
readonly description: "Time period for the report. Examples: \"today\", \"yesterday\", \"7d\", \"30d\", \"90d\", \"this_month\", \"last_month\", \"this_year\". Default: \"30d\".";
|
|
12
|
+
readonly enum: readonly ["today", "yesterday", "7d", "30d", "90d", "12m", "this_week", "wtd", "last_week", "this_month", "mtd", "last_month", "this_quarter", "qtd", "last_quarter", "this_year", "ytd", "last_year"];
|
|
13
|
+
readonly default: "30d";
|
|
14
|
+
};
|
|
15
|
+
export declare const COMPARE_SCHEMA: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "Comparison mode. \"previous\" compares with the prior period of the same length. \"yoy\" compares with the same dates last year.";
|
|
18
|
+
readonly enum: readonly ["previous", "yoy"];
|
|
19
|
+
};
|
|
20
|
+
export declare const LIMIT_SCHEMA: {
|
|
21
|
+
readonly type: "number";
|
|
22
|
+
readonly description: "Maximum number of rows to return (default: 20, max: 100).";
|
|
23
|
+
readonly default: 20;
|
|
24
|
+
};
|
|
25
|
+
export declare const SORT_ORDER_SCHEMA: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly description: "Sort direction: \"asc\" or \"desc\" (default: \"desc\").";
|
|
28
|
+
readonly enum: readonly ["asc", "desc"];
|
|
29
|
+
readonly default: "desc";
|
|
30
|
+
};
|
|
31
|
+
export declare const PAGE_SCHEMA: {
|
|
32
|
+
readonly type: "number";
|
|
33
|
+
readonly description: "Page number for paginated results (default: 1).";
|
|
34
|
+
readonly default: 1;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Validate a freeform string input: reject control characters and enforce length limit.
|
|
38
|
+
*/
|
|
39
|
+
export declare function sanitizeInput(value: unknown, name: string, maxLen?: number): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Resolve site_id from tool args or SEALMETRICS_SITE_ID env var.
|
|
42
|
+
* Throws if neither is available.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveSiteId(args: Record<string, unknown>): string;
|
|
45
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CA6E1F;AAED,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;CAKjB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAIX;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAmB,GAAG,MAAM,GAAG,SAAS,CAUzG;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAYnE"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { VALID_PERIODS } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Convert a period string (e.g. "30d", "this_month") to start_date / end_date.
|
|
4
|
+
* Needed for endpoints that don't accept the `period` shorthand.
|
|
5
|
+
*/
|
|
6
|
+
export function periodToDateRange(period) {
|
|
7
|
+
const today = new Date();
|
|
8
|
+
const fmt = (d) => d.toISOString().slice(0, 10);
|
|
9
|
+
const end = fmt(today);
|
|
10
|
+
const sub = (days) => {
|
|
11
|
+
const d = new Date(today);
|
|
12
|
+
d.setDate(d.getDate() - days);
|
|
13
|
+
return fmt(d);
|
|
14
|
+
};
|
|
15
|
+
switch (period) {
|
|
16
|
+
case "today":
|
|
17
|
+
return { start_date: end, end_date: end };
|
|
18
|
+
case "yesterday": {
|
|
19
|
+
const y = sub(1);
|
|
20
|
+
return { start_date: y, end_date: y };
|
|
21
|
+
}
|
|
22
|
+
case "7d":
|
|
23
|
+
return { start_date: sub(6), end_date: end };
|
|
24
|
+
case "14d":
|
|
25
|
+
return { start_date: sub(13), end_date: end };
|
|
26
|
+
case "30d":
|
|
27
|
+
return { start_date: sub(29), end_date: end };
|
|
28
|
+
case "60d":
|
|
29
|
+
return { start_date: sub(59), end_date: end };
|
|
30
|
+
case "90d":
|
|
31
|
+
return { start_date: sub(89), end_date: end };
|
|
32
|
+
case "180d":
|
|
33
|
+
return { start_date: sub(179), end_date: end };
|
|
34
|
+
case "365d":
|
|
35
|
+
return { start_date: sub(364), end_date: end };
|
|
36
|
+
case "this_week": {
|
|
37
|
+
const dow = today.getDay() || 7; // Monday=1
|
|
38
|
+
return { start_date: sub(dow - 1), end_date: end };
|
|
39
|
+
}
|
|
40
|
+
case "last_week": {
|
|
41
|
+
const dow = today.getDay() || 7;
|
|
42
|
+
const lastMonday = new Date(today);
|
|
43
|
+
lastMonday.setDate(today.getDate() - dow - 6);
|
|
44
|
+
const lastSunday = new Date(lastMonday);
|
|
45
|
+
lastSunday.setDate(lastMonday.getDate() + 6);
|
|
46
|
+
return { start_date: fmt(lastMonday), end_date: fmt(lastSunday) };
|
|
47
|
+
}
|
|
48
|
+
case "this_month": {
|
|
49
|
+
const start = new Date(today.getFullYear(), today.getMonth(), 1);
|
|
50
|
+
return { start_date: fmt(start), end_date: end };
|
|
51
|
+
}
|
|
52
|
+
case "last_month": {
|
|
53
|
+
const start = new Date(today.getFullYear(), today.getMonth() - 1, 1);
|
|
54
|
+
const e = new Date(today.getFullYear(), today.getMonth(), 0);
|
|
55
|
+
return { start_date: fmt(start), end_date: fmt(e) };
|
|
56
|
+
}
|
|
57
|
+
case "this_quarter": {
|
|
58
|
+
const q = Math.floor(today.getMonth() / 3) * 3;
|
|
59
|
+
const start = new Date(today.getFullYear(), q, 1);
|
|
60
|
+
return { start_date: fmt(start), end_date: end };
|
|
61
|
+
}
|
|
62
|
+
case "last_quarter": {
|
|
63
|
+
const q = Math.floor(today.getMonth() / 3) * 3;
|
|
64
|
+
const start = new Date(today.getFullYear(), q - 3, 1);
|
|
65
|
+
const e = new Date(today.getFullYear(), q, 0);
|
|
66
|
+
return { start_date: fmt(start), end_date: fmt(e) };
|
|
67
|
+
}
|
|
68
|
+
case "this_year": {
|
|
69
|
+
const start = new Date(today.getFullYear(), 0, 1);
|
|
70
|
+
return { start_date: fmt(start), end_date: end };
|
|
71
|
+
}
|
|
72
|
+
case "last_year": {
|
|
73
|
+
const start = new Date(today.getFullYear() - 1, 0, 1);
|
|
74
|
+
const e = new Date(today.getFullYear() - 1, 11, 31);
|
|
75
|
+
return { start_date: fmt(start), end_date: fmt(e) };
|
|
76
|
+
}
|
|
77
|
+
default:
|
|
78
|
+
// Fallback to 30 days
|
|
79
|
+
return { start_date: sub(29), end_date: end };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export const PERIOD_SCHEMA = {
|
|
83
|
+
type: "string",
|
|
84
|
+
description: `Time period for the report. Examples: "today", "yesterday", "7d", "30d", "90d", "this_month", "last_month", "this_year". Default: "30d".`,
|
|
85
|
+
enum: [...VALID_PERIODS],
|
|
86
|
+
default: "30d",
|
|
87
|
+
};
|
|
88
|
+
export const COMPARE_SCHEMA = {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: 'Comparison mode. "previous" compares with the prior period of the same length. "yoy" compares with the same dates last year.',
|
|
91
|
+
enum: ["previous", "yoy"],
|
|
92
|
+
};
|
|
93
|
+
export const LIMIT_SCHEMA = {
|
|
94
|
+
type: "number",
|
|
95
|
+
description: "Maximum number of rows to return (default: 20, max: 100).",
|
|
96
|
+
default: 20,
|
|
97
|
+
};
|
|
98
|
+
export const SORT_ORDER_SCHEMA = {
|
|
99
|
+
type: "string",
|
|
100
|
+
description: 'Sort direction: "asc" or "desc" (default: "desc").',
|
|
101
|
+
enum: ["asc", "desc"],
|
|
102
|
+
default: "desc",
|
|
103
|
+
};
|
|
104
|
+
export const PAGE_SCHEMA = {
|
|
105
|
+
type: "number",
|
|
106
|
+
description: "Page number for paginated results (default: 1).",
|
|
107
|
+
default: 1,
|
|
108
|
+
};
|
|
109
|
+
const MAX_INPUT_LENGTH = 256;
|
|
110
|
+
/**
|
|
111
|
+
* Validate a freeform string input: reject control characters and enforce length limit.
|
|
112
|
+
*/
|
|
113
|
+
export function sanitizeInput(value, name, maxLen = MAX_INPUT_LENGTH) {
|
|
114
|
+
if (value == null || value === "")
|
|
115
|
+
return undefined;
|
|
116
|
+
const s = String(value);
|
|
117
|
+
if (s.length > maxLen) {
|
|
118
|
+
throw new Error(`${name} exceeds maximum length of ${maxLen} characters.`);
|
|
119
|
+
}
|
|
120
|
+
if (/[\r\n\0]/.test(s)) {
|
|
121
|
+
throw new Error(`${name} contains invalid characters.`);
|
|
122
|
+
}
|
|
123
|
+
return s;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Resolve site_id from tool args or SEALMETRICS_SITE_ID env var.
|
|
127
|
+
* Throws if neither is available.
|
|
128
|
+
*/
|
|
129
|
+
export function resolveSiteId(args) {
|
|
130
|
+
const siteId = args.site_id ?? process.env.SEALMETRICS_SITE_ID;
|
|
131
|
+
if (!siteId) {
|
|
132
|
+
throw new Error('site_id is required. Either pass it as a parameter or set the SEALMETRICS_SITE_ID environment variable.');
|
|
133
|
+
}
|
|
134
|
+
if (siteId.length > 128 || /[\r\n\0/\\]/.test(siteId)) {
|
|
135
|
+
throw new Error('Invalid site_id format.');
|
|
136
|
+
}
|
|
137
|
+
return siteId;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,GAAG,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACtD,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;IAEvB,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE;QAC3B,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QAC9B,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC,CAAC;IAEF,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;QAC5C,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YACjB,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;QACxC,CAAC;QACD,KAAK,IAAI;YACP,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;QAC/C,KAAK,KAAK;YACR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AACX,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAA6B;IACzD,MAAM,MAAM,GACT,IAAI,CAAC,OAA8B,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAC1E,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,yGAAyG,CAC1G,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/tools/sites.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,aAAa,EAAE,OAiB3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,OAiBzB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { resolveSiteId } from "./shared.js";
|
|
2
|
+
export const listSitesTool = {
|
|
3
|
+
name: "list_sites",
|
|
4
|
+
description: "List all sites (web properties) accessible with your API key. Returns site IDs, names, and domains. Use this to find the site_id needed for other tools.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {},
|
|
8
|
+
},
|
|
9
|
+
handler: async (client) => {
|
|
10
|
+
const data = await client.request("/sites");
|
|
11
|
+
return data.sites.map((s) => ({
|
|
12
|
+
site_id: s.id,
|
|
13
|
+
name: s.name,
|
|
14
|
+
domains: s.domains,
|
|
15
|
+
timezone: s.timezone,
|
|
16
|
+
}));
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const getSiteTool = {
|
|
20
|
+
name: "get_site",
|
|
21
|
+
description: "Get detailed information about a specific site: name, domains, timezone, configuration, and tracking status. Use list_sites first to find available site IDs.",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
site_id: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
handler: async (client, args) => {
|
|
32
|
+
const siteId = resolveSiteId(args);
|
|
33
|
+
return client.request(`/sites/${encodeURIComponent(siteId)}`);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=sites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../src/tools/sites.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,0JAA0J;IAC5J,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE,EAAE;KACf;IACD,OAAO,EAAE,KAAK,EAAE,MAAyB,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAmB,QAAQ,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5B,OAAO,EAAE,CAAC,CAAC,EAAE;YACb,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC,CAAC,CAAC;IACN,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAY;IAClC,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,+JAA+J;IACjK,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;aACxE;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,MAAyB,EAAE,IAA6B,EAAE,EAAE;QAC1E,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC,OAAO,CAAU,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/tools/tracking.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAoN1C,eAAO,MAAM,mBAAmB,EAAE,OA+BjC,CAAC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { resolveSiteId } from "./shared.js";
|
|
2
|
+
const JS_API_REFERENCE = {
|
|
3
|
+
pageview: {
|
|
4
|
+
description: "Tracked automatically on load and SPA navigation. Manual call rarely needed.",
|
|
5
|
+
signatures: [
|
|
6
|
+
{ call: "sealmetrics()", description: "Manual pageview" },
|
|
7
|
+
{
|
|
8
|
+
call: "sealmetrics({ group: 'blog' })",
|
|
9
|
+
description: "Pageview with content grouping",
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
conversion: {
|
|
14
|
+
description: "Track conversions with monetary value. Use for purchases, signups, leads.",
|
|
15
|
+
signatures: [
|
|
16
|
+
{
|
|
17
|
+
call: "sealmetrics.conv('purchase', 99.99)",
|
|
18
|
+
description: "Basic conversion",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
call: "sealmetrics.conv('purchase', 149.99, { currency: 'EUR' })",
|
|
22
|
+
description: "Conversion with properties",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
call: "sealmetrics.conv('lead', 0, { source: 'contact_form' })",
|
|
26
|
+
description: "Lead without monetary value",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
microconversion: {
|
|
31
|
+
description: "Track funnel steps and engagement events. Use for add_to_cart, scroll milestones, video plays, newsletter signups.",
|
|
32
|
+
signatures: [
|
|
33
|
+
{
|
|
34
|
+
call: "sealmetrics.micro('add_to_cart')",
|
|
35
|
+
description: "Basic microconversion",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
call: "sealmetrics.micro('add_to_cart', { product_id: 'SKU-123', price: 49.99 })",
|
|
39
|
+
description: "Microconversion with properties",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
const IMPLEMENTATION_GUIDE = {
|
|
45
|
+
installation: [
|
|
46
|
+
"Add the <script> tag in the <head> of every page, before </head>.",
|
|
47
|
+
"Use the 'defer' attribute — the script loads async and never blocks rendering.",
|
|
48
|
+
"Pageviews are tracked automatically on load and SPA navigation (pushState, replaceState, popstate).",
|
|
49
|
+
"No cookies, no localStorage, no consent banner needed (GDPR-friendly).",
|
|
50
|
+
],
|
|
51
|
+
content_grouping: {
|
|
52
|
+
description: "Categorize pages into sections for better analysis. Add via URL param or JS call.",
|
|
53
|
+
via_url_param: '<script src="https://t.sealmetrics.com/t.js?id=SITE_ID&group=blog" defer></script>',
|
|
54
|
+
via_js: "sealmetrics({ group: 'blog' })",
|
|
55
|
+
recommended_groups: [
|
|
56
|
+
"blog",
|
|
57
|
+
"product",
|
|
58
|
+
"category",
|
|
59
|
+
"checkout",
|
|
60
|
+
"docs",
|
|
61
|
+
"app",
|
|
62
|
+
"landing",
|
|
63
|
+
"support",
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
naming_conventions: [
|
|
67
|
+
"Use snake_case for conversion and microconversion types: 'add_to_cart', not 'addToCart'.",
|
|
68
|
+
"Use descriptive names: 'begin_checkout', not 'step2'.",
|
|
69
|
+
"Do NOT include order IDs or user IDs in the type name — use properties instead.",
|
|
70
|
+
"Keep types stable — changing names breaks historical data continuity.",
|
|
71
|
+
],
|
|
72
|
+
spa_support: "Automatic. Works with React Router, Vue Router, Next.js, Nuxt, Angular, and any History API-based routing. No extra config.",
|
|
73
|
+
debugging: "Add ?debug=1 to any page URL to enable console logging of all tracking events.",
|
|
74
|
+
};
|
|
75
|
+
const EXAMPLES = {
|
|
76
|
+
ecommerce: {
|
|
77
|
+
description: "E-commerce site with product pages, cart, and checkout",
|
|
78
|
+
code: `<!-- In <head> of all pages -->
|
|
79
|
+
<script src="https://t.sealmetrics.com/t.js?id=SITE_ID&group=product" defer></script>
|
|
80
|
+
|
|
81
|
+
<script>
|
|
82
|
+
// Add to cart button
|
|
83
|
+
document.querySelector('.add-to-cart').addEventListener('click', function() {
|
|
84
|
+
sealmetrics.micro('add_to_cart', {
|
|
85
|
+
product_id: this.dataset.productId,
|
|
86
|
+
price: parseFloat(this.dataset.price)
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Begin checkout
|
|
91
|
+
document.querySelector('.checkout-btn').addEventListener('click', function() {
|
|
92
|
+
sealmetrics.micro('begin_checkout', { cart_value: getCartTotal() });
|
|
93
|
+
});
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<!-- On thank-you page (group=checkout) -->
|
|
97
|
+
<script src="https://t.sealmetrics.com/t.js?id=SITE_ID&group=checkout" defer></script>
|
|
98
|
+
<script>
|
|
99
|
+
sealmetrics.conv('purchase', 189.99, {
|
|
100
|
+
currency: 'EUR',
|
|
101
|
+
payment_method: 'credit_card'
|
|
102
|
+
});
|
|
103
|
+
</script>`,
|
|
104
|
+
},
|
|
105
|
+
saas: {
|
|
106
|
+
description: "SaaS / lead generation site",
|
|
107
|
+
code: `<!-- In <head> -->
|
|
108
|
+
<script src="https://t.sealmetrics.com/t.js?id=SITE_ID&group=marketing" defer></script>
|
|
109
|
+
|
|
110
|
+
<script>
|
|
111
|
+
// Demo request form
|
|
112
|
+
document.querySelector('#demo-form').addEventListener('submit', function() {
|
|
113
|
+
sealmetrics.conv('lead', 0, { form_name: 'demo_request' });
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Newsletter signup
|
|
117
|
+
document.querySelector('#newsletter').addEventListener('submit', function() {
|
|
118
|
+
sealmetrics.micro('newsletter_signup', { position: 'footer' });
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<!-- On signup success page -->
|
|
123
|
+
<script>
|
|
124
|
+
sealmetrics.conv('signup', 0, { plan: 'trial' });
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
<!-- On upgrade/payment -->
|
|
128
|
+
<script>
|
|
129
|
+
sealmetrics.conv('purchase', 49, { plan: 'pro_monthly', currency: 'USD' });
|
|
130
|
+
</script>`,
|
|
131
|
+
},
|
|
132
|
+
blog_media: {
|
|
133
|
+
description: "Blog or media site with content engagement tracking",
|
|
134
|
+
code: `<!-- In <head> -->
|
|
135
|
+
<script src="https://t.sealmetrics.com/t.js?id=SITE_ID&group=blog" defer></script>
|
|
136
|
+
|
|
137
|
+
<script>
|
|
138
|
+
// Video engagement
|
|
139
|
+
document.querySelector('video')?.addEventListener('play', function() {
|
|
140
|
+
sealmetrics.micro('video_play', { video_id: this.dataset.videoId });
|
|
141
|
+
});
|
|
142
|
+
document.querySelector('video')?.addEventListener('ended', function() {
|
|
143
|
+
sealmetrics.micro('video_complete', { video_id: this.dataset.videoId });
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// Scroll depth milestones
|
|
147
|
+
var tracked = {};
|
|
148
|
+
window.addEventListener('scroll', function() {
|
|
149
|
+
var pct = Math.round(window.scrollY / (document.body.scrollHeight - window.innerHeight) * 100);
|
|
150
|
+
[25, 50, 75, 100].forEach(function(m) {
|
|
151
|
+
if (pct >= m && !tracked[m]) {
|
|
152
|
+
tracked[m] = true;
|
|
153
|
+
sealmetrics.micro('scroll_' + m);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
</script>`,
|
|
158
|
+
},
|
|
159
|
+
react_nextjs: {
|
|
160
|
+
description: "React / Next.js application",
|
|
161
|
+
code: `// In layout.tsx or _app.tsx — add the script tag
|
|
162
|
+
import Script from 'next/script';
|
|
163
|
+
|
|
164
|
+
export default function RootLayout({ children }) {
|
|
165
|
+
return (
|
|
166
|
+
<html>
|
|
167
|
+
<head>
|
|
168
|
+
<Script
|
|
169
|
+
src="https://t.sealmetrics.com/t.js?id=SITE_ID"
|
|
170
|
+
strategy="afterInteractive"
|
|
171
|
+
/>
|
|
172
|
+
</head>
|
|
173
|
+
<body>{children}</body>
|
|
174
|
+
</html>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// In any component — track conversions/microconversions
|
|
179
|
+
function CheckoutButton({ total, currency }) {
|
|
180
|
+
const handlePurchase = () => {
|
|
181
|
+
window.sealmetrics?.conv('purchase', total, { currency });
|
|
182
|
+
};
|
|
183
|
+
return <button onClick={handlePurchase}>Complete Purchase</button>;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Track microconversions
|
|
187
|
+
function AddToCartButton({ productId, price }) {
|
|
188
|
+
const handleClick = () => {
|
|
189
|
+
window.sealmetrics?.micro('add_to_cart', { product_id: productId, price });
|
|
190
|
+
};
|
|
191
|
+
return <button onClick={handleClick}>Add to Cart</button>;
|
|
192
|
+
}`,
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
export const getTrackingCodeTool = {
|
|
196
|
+
name: "get_tracking_code",
|
|
197
|
+
description: "Get the tracking pixel code for a site and the full JavaScript API reference for implementing pageviews, conversions, microconversions, and content grouping. Returns the site-specific <script> tag plus implementation guide with examples for e-commerce, SaaS, blog, and React/Next.js.",
|
|
198
|
+
inputSchema: {
|
|
199
|
+
type: "object",
|
|
200
|
+
properties: {
|
|
201
|
+
site_id: {
|
|
202
|
+
type: "string",
|
|
203
|
+
description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
handler: async (client, args) => {
|
|
208
|
+
const siteId = resolveSiteId(args);
|
|
209
|
+
const pixel = await client.request(`/sites/${encodeURIComponent(siteId)}/pixel`);
|
|
210
|
+
return {
|
|
211
|
+
site_id: pixel.site_id ?? pixel.account_id,
|
|
212
|
+
script_tag: pixel.script_tag,
|
|
213
|
+
tracker_url: pixel.tracker_url,
|
|
214
|
+
js_api: JS_API_REFERENCE,
|
|
215
|
+
implementation_guide: IMPLEMENTATION_GUIDE,
|
|
216
|
+
examples: EXAMPLES,
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=tracking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../src/tools/tracking.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAY5C,MAAM,gBAAgB,GAAG;IACvB,QAAQ,EAAE;QACR,WAAW,EAAE,8EAA8E;QAC3F,UAAU,EAAE;YACV,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE;YACzD;gBACE,IAAI,EAAE,gCAAgC;gBACtC,WAAW,EAAE,gCAAgC;aAC9C;SACF;KACF;IACD,UAAU,EAAE;QACV,WAAW,EACT,2EAA2E;QAC7E,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,qCAAqC;gBAC3C,WAAW,EAAE,kBAAkB;aAChC;YACD;gBACE,IAAI,EAAE,2DAA2D;gBACjE,WAAW,EAAE,4BAA4B;aAC1C;YACD;gBACE,IAAI,EAAE,yDAAyD;gBAC/D,WAAW,EAAE,6BAA6B;aAC3C;SACF;KACF;IACD,eAAe,EAAE;QACf,WAAW,EACT,oHAAoH;QACtH,UAAU,EAAE;YACV;gBACE,IAAI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AAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;aACxE;SACF;KACF;IACD,OAAO,EAAE,KAAK,EACZ,MAAyB,EACzB,IAA6B,EAC7B,EAAE;QACF,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,OAAO,CAChC,UAAU,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAC7C,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,UAAU;YAC1C,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,MAAM,EAAE,gBAAgB;YACxB,oBAAoB,EAAE,oBAAoB;YAC1C,QAAQ,EAAE,QAAQ;SACnB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToolDef } from "./index.js";
|
|
2
|
+
export declare const getTrafficSourcesTool: ToolDef;
|
|
3
|
+
export declare const getTrafficMediumsTool: ToolDef;
|
|
4
|
+
export declare const getCampaignsTool: ToolDef;
|
|
5
|
+
export declare const getTermsTool: ToolDef;
|
|
6
|
+
export declare const getTopSourcesTool: ToolDef;
|
|
7
|
+
export declare const getTopCampaignsTool: ToolDef;
|
|
8
|
+
export declare const getTopTermsTool: ToolDef;
|
|
9
|
+
export declare const getTopReferrersTool: ToolDef;
|
|
10
|
+
//# sourceMappingURL=traffic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traffic.d.ts","sourceRoot":"","sources":["../../src/tools/traffic.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAqB1C,eAAO,MAAM,qBAAqB,EAAE,OAsBnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,OAsBnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAiC9B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OA2C1B,CAAC;AAYF,eAAO,MAAM,iBAAiB,EAAE,OA6B/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAkCjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAuC7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAwBjC,CAAC"}
|