@sentientui/mcp 0.17.3 → 0.17.4
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/{chunk-PUMG7EQ2.js → chunk-CEZJQSKB.js} +35 -5
- package/dist/index.cjs +35 -5
- package/dist/index.js +1 -1
- package/dist/lib.cjs +35 -5
- package/dist/lib.js +1 -1
- package/package.json +1 -1
|
@@ -348,8 +348,8 @@ function rangeInputSchema(defaultRange) {
|
|
|
348
348
|
}
|
|
349
349
|
function rangeQuery(args) {
|
|
350
350
|
const p = new URLSearchParams();
|
|
351
|
-
if (args.from) {
|
|
352
|
-
p.set("from", args.from);
|
|
351
|
+
if (args.from || args.to) {
|
|
352
|
+
if (args.from) p.set("from", args.from);
|
|
353
353
|
if (args.to) p.set("to", args.to);
|
|
354
354
|
} else if (args.range) {
|
|
355
355
|
p.set("range", args.range);
|
|
@@ -369,10 +369,27 @@ var windowOutputSchema = z.object({
|
|
|
369
369
|
function windowLine(window) {
|
|
370
370
|
if (!window) return "";
|
|
371
371
|
if (window.start && window.end) {
|
|
372
|
-
|
|
372
|
+
const from = localDate(window.start, window.timezone);
|
|
373
|
+
const lastIncluded = localDate(
|
|
374
|
+
new Date(new Date(window.end).getTime() - 1).toISOString(),
|
|
375
|
+
window.timezone
|
|
376
|
+
);
|
|
377
|
+
return `Window: ${from} through ${lastIncluded} inclusive (${window.timezone})`;
|
|
373
378
|
}
|
|
374
379
|
return `Window: all retained data (${window.retentionDays}-day retention)`;
|
|
375
380
|
}
|
|
381
|
+
function localDate(iso, timeZone) {
|
|
382
|
+
try {
|
|
383
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
384
|
+
timeZone,
|
|
385
|
+
year: "numeric",
|
|
386
|
+
month: "2-digit",
|
|
387
|
+
day: "2-digit"
|
|
388
|
+
}).format(new Date(iso));
|
|
389
|
+
} catch (e) {
|
|
390
|
+
return iso.slice(0, 10);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
376
393
|
function apiErrorGuidance(err, extra) {
|
|
377
394
|
if (extra && Object.prototype.hasOwnProperty.call(extra, err.message)) {
|
|
378
395
|
return extra[err.message];
|
|
@@ -393,6 +410,12 @@ function apiErrorGuidance(err, extra) {
|
|
|
393
410
|
if (err.message === "invalid_range") {
|
|
394
411
|
return "Invalid time window. Use range '7d', '30d', '90d' or 'all', or from/to as YYYY-MM-DD dates.";
|
|
395
412
|
}
|
|
413
|
+
if (err.message === "plan_required" || err.message === "plan_upgrade_required") {
|
|
414
|
+
return "This feature is not included on the project\u2019s current plan. Upgrade the SentientUI plan to turn it on \u2014 re-authenticating will not help.";
|
|
415
|
+
}
|
|
416
|
+
if (err.message === "agent_analytics_requires_paid_plan") {
|
|
417
|
+
return "Agent analytics is available on paid plans only. Upgrade the SentientUI plan to read agent traffic for this project.";
|
|
418
|
+
}
|
|
396
419
|
if (err.status === 402) {
|
|
397
420
|
return `This feature requires a higher plan (${err.message}). Upgrade your SentientUI plan, then try again.`;
|
|
398
421
|
}
|
|
@@ -1011,6 +1034,13 @@ function registerGoalTools(server, client) {
|
|
|
1011
1034
|
// src/tools/funnels.ts
|
|
1012
1035
|
import { z as z7 } from "zod";
|
|
1013
1036
|
var funnelIdSchema = z7.string().describe('Funnel slug (from list_funnels), e.g. "checkout"');
|
|
1037
|
+
function stepChangeText(dropOffFromPrevious) {
|
|
1038
|
+
if (dropOffFromPrevious == null) return "";
|
|
1039
|
+
if (dropOffFromPrevious < 0) {
|
|
1040
|
+
return ` (${Math.round(-dropOffFromPrevious * 100)}% MORE than the previous step \u2014 some visitors reached it without the step before, or completed that step before this window)`;
|
|
1041
|
+
}
|
|
1042
|
+
return ` (${Math.round(dropOffFromPrevious * 100)}% drop-off from previous)`;
|
|
1043
|
+
}
|
|
1014
1044
|
function registerFunnelTools(server, client) {
|
|
1015
1045
|
server.registerTool(
|
|
1016
1046
|
"list_funnels",
|
|
@@ -1120,7 +1150,7 @@ function registerFunnelTools(server, client) {
|
|
|
1120
1150
|
const lines = [`${data.displayName} \u2014 last ${data.windowDays} days`];
|
|
1121
1151
|
for (const s of data.steps) {
|
|
1122
1152
|
lines.push(
|
|
1123
|
-
`${s.stepIndex + 1}. ${s.displayName}: ${s.reached} reached` + (s.dropOffFromPrevious
|
|
1153
|
+
`${s.stepIndex + 1}. ${s.displayName}: ${s.reached} reached` + stepChangeText(s.dropOffFromPrevious) + (s.neverFired ? " [never recorded \u2014 check the goal name]" : "")
|
|
1124
1154
|
);
|
|
1125
1155
|
for (const v of s.variants) {
|
|
1126
1156
|
lines.push(` ${v.componentId}/${v.variantId}: ${v.reached}/${v.assigned} assigned sessions reached this step`);
|
|
@@ -1897,7 +1927,7 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1897
1927
|
}
|
|
1898
1928
|
|
|
1899
1929
|
// src/server.ts
|
|
1900
|
-
var PKG_VERSION = true ? "0.17.
|
|
1930
|
+
var PKG_VERSION = true ? "0.17.4" : "0.0.0-dev";
|
|
1901
1931
|
function createMcpServer(client) {
|
|
1902
1932
|
const server = new McpServer(
|
|
1903
1933
|
{
|
package/dist/index.cjs
CHANGED
|
@@ -91,8 +91,8 @@ function rangeInputSchema(defaultRange) {
|
|
|
91
91
|
}
|
|
92
92
|
function rangeQuery(args) {
|
|
93
93
|
const p = new URLSearchParams();
|
|
94
|
-
if (args.from) {
|
|
95
|
-
p.set("from", args.from);
|
|
94
|
+
if (args.from || args.to) {
|
|
95
|
+
if (args.from) p.set("from", args.from);
|
|
96
96
|
if (args.to) p.set("to", args.to);
|
|
97
97
|
} else if (args.range) {
|
|
98
98
|
p.set("range", args.range);
|
|
@@ -112,10 +112,27 @@ var windowOutputSchema = import_zod.z.object({
|
|
|
112
112
|
function windowLine(window) {
|
|
113
113
|
if (!window) return "";
|
|
114
114
|
if (window.start && window.end) {
|
|
115
|
-
|
|
115
|
+
const from = localDate(window.start, window.timezone);
|
|
116
|
+
const lastIncluded = localDate(
|
|
117
|
+
new Date(new Date(window.end).getTime() - 1).toISOString(),
|
|
118
|
+
window.timezone
|
|
119
|
+
);
|
|
120
|
+
return `Window: ${from} through ${lastIncluded} inclusive (${window.timezone})`;
|
|
116
121
|
}
|
|
117
122
|
return `Window: all retained data (${window.retentionDays}-day retention)`;
|
|
118
123
|
}
|
|
124
|
+
function localDate(iso, timeZone) {
|
|
125
|
+
try {
|
|
126
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
127
|
+
timeZone,
|
|
128
|
+
year: "numeric",
|
|
129
|
+
month: "2-digit",
|
|
130
|
+
day: "2-digit"
|
|
131
|
+
}).format(new Date(iso));
|
|
132
|
+
} catch (e) {
|
|
133
|
+
return iso.slice(0, 10);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
119
136
|
function apiErrorGuidance(err, extra) {
|
|
120
137
|
if (extra && Object.prototype.hasOwnProperty.call(extra, err.message)) {
|
|
121
138
|
return extra[err.message];
|
|
@@ -136,6 +153,12 @@ function apiErrorGuidance(err, extra) {
|
|
|
136
153
|
if (err.message === "invalid_range") {
|
|
137
154
|
return "Invalid time window. Use range '7d', '30d', '90d' or 'all', or from/to as YYYY-MM-DD dates.";
|
|
138
155
|
}
|
|
156
|
+
if (err.message === "plan_required" || err.message === "plan_upgrade_required") {
|
|
157
|
+
return "This feature is not included on the project\u2019s current plan. Upgrade the SentientUI plan to turn it on \u2014 re-authenticating will not help.";
|
|
158
|
+
}
|
|
159
|
+
if (err.message === "agent_analytics_requires_paid_plan") {
|
|
160
|
+
return "Agent analytics is available on paid plans only. Upgrade the SentientUI plan to read agent traffic for this project.";
|
|
161
|
+
}
|
|
139
162
|
if (err.status === 402) {
|
|
140
163
|
return `This feature requires a higher plan (${err.message}). Upgrade your SentientUI plan, then try again.`;
|
|
141
164
|
}
|
|
@@ -1017,6 +1040,13 @@ function registerGoalTools(server, client) {
|
|
|
1017
1040
|
// src/tools/funnels.ts
|
|
1018
1041
|
var import_zod7 = require("zod");
|
|
1019
1042
|
var funnelIdSchema = import_zod7.z.string().describe('Funnel slug (from list_funnels), e.g. "checkout"');
|
|
1043
|
+
function stepChangeText(dropOffFromPrevious) {
|
|
1044
|
+
if (dropOffFromPrevious == null) return "";
|
|
1045
|
+
if (dropOffFromPrevious < 0) {
|
|
1046
|
+
return ` (${Math.round(-dropOffFromPrevious * 100)}% MORE than the previous step \u2014 some visitors reached it without the step before, or completed that step before this window)`;
|
|
1047
|
+
}
|
|
1048
|
+
return ` (${Math.round(dropOffFromPrevious * 100)}% drop-off from previous)`;
|
|
1049
|
+
}
|
|
1020
1050
|
function registerFunnelTools(server, client) {
|
|
1021
1051
|
server.registerTool(
|
|
1022
1052
|
"list_funnels",
|
|
@@ -1126,7 +1156,7 @@ function registerFunnelTools(server, client) {
|
|
|
1126
1156
|
const lines = [`${data.displayName} \u2014 last ${data.windowDays} days`];
|
|
1127
1157
|
for (const s of data.steps) {
|
|
1128
1158
|
lines.push(
|
|
1129
|
-
`${s.stepIndex + 1}. ${s.displayName}: ${s.reached} reached` + (s.dropOffFromPrevious
|
|
1159
|
+
`${s.stepIndex + 1}. ${s.displayName}: ${s.reached} reached` + stepChangeText(s.dropOffFromPrevious) + (s.neverFired ? " [never recorded \u2014 check the goal name]" : "")
|
|
1130
1160
|
);
|
|
1131
1161
|
for (const v of s.variants) {
|
|
1132
1162
|
lines.push(` ${v.componentId}/${v.variantId}: ${v.reached}/${v.assigned} assigned sessions reached this step`);
|
|
@@ -1903,7 +1933,7 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1903
1933
|
}
|
|
1904
1934
|
|
|
1905
1935
|
// src/server.ts
|
|
1906
|
-
var PKG_VERSION = true ? "0.17.
|
|
1936
|
+
var PKG_VERSION = true ? "0.17.4" : "0.0.0-dev";
|
|
1907
1937
|
function createMcpServer(client) {
|
|
1908
1938
|
const server = new import_mcp.McpServer(
|
|
1909
1939
|
{
|
package/dist/index.js
CHANGED
package/dist/lib.cjs
CHANGED
|
@@ -115,8 +115,8 @@ function rangeInputSchema(defaultRange) {
|
|
|
115
115
|
}
|
|
116
116
|
function rangeQuery(args) {
|
|
117
117
|
const p = new URLSearchParams();
|
|
118
|
-
if (args.from) {
|
|
119
|
-
p.set("from", args.from);
|
|
118
|
+
if (args.from || args.to) {
|
|
119
|
+
if (args.from) p.set("from", args.from);
|
|
120
120
|
if (args.to) p.set("to", args.to);
|
|
121
121
|
} else if (args.range) {
|
|
122
122
|
p.set("range", args.range);
|
|
@@ -136,10 +136,27 @@ var windowOutputSchema = import_zod.z.object({
|
|
|
136
136
|
function windowLine(window) {
|
|
137
137
|
if (!window) return "";
|
|
138
138
|
if (window.start && window.end) {
|
|
139
|
-
|
|
139
|
+
const from = localDate(window.start, window.timezone);
|
|
140
|
+
const lastIncluded = localDate(
|
|
141
|
+
new Date(new Date(window.end).getTime() - 1).toISOString(),
|
|
142
|
+
window.timezone
|
|
143
|
+
);
|
|
144
|
+
return `Window: ${from} through ${lastIncluded} inclusive (${window.timezone})`;
|
|
140
145
|
}
|
|
141
146
|
return `Window: all retained data (${window.retentionDays}-day retention)`;
|
|
142
147
|
}
|
|
148
|
+
function localDate(iso, timeZone) {
|
|
149
|
+
try {
|
|
150
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
151
|
+
timeZone,
|
|
152
|
+
year: "numeric",
|
|
153
|
+
month: "2-digit",
|
|
154
|
+
day: "2-digit"
|
|
155
|
+
}).format(new Date(iso));
|
|
156
|
+
} catch (e) {
|
|
157
|
+
return iso.slice(0, 10);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
143
160
|
function apiErrorGuidance(err, extra) {
|
|
144
161
|
if (extra && Object.prototype.hasOwnProperty.call(extra, err.message)) {
|
|
145
162
|
return extra[err.message];
|
|
@@ -160,6 +177,12 @@ function apiErrorGuidance(err, extra) {
|
|
|
160
177
|
if (err.message === "invalid_range") {
|
|
161
178
|
return "Invalid time window. Use range '7d', '30d', '90d' or 'all', or from/to as YYYY-MM-DD dates.";
|
|
162
179
|
}
|
|
180
|
+
if (err.message === "plan_required" || err.message === "plan_upgrade_required") {
|
|
181
|
+
return "This feature is not included on the project\u2019s current plan. Upgrade the SentientUI plan to turn it on \u2014 re-authenticating will not help.";
|
|
182
|
+
}
|
|
183
|
+
if (err.message === "agent_analytics_requires_paid_plan") {
|
|
184
|
+
return "Agent analytics is available on paid plans only. Upgrade the SentientUI plan to read agent traffic for this project.";
|
|
185
|
+
}
|
|
163
186
|
if (err.status === 402) {
|
|
164
187
|
return `This feature requires a higher plan (${err.message}). Upgrade your SentientUI plan, then try again.`;
|
|
165
188
|
}
|
|
@@ -1041,6 +1064,13 @@ function registerGoalTools(server, client) {
|
|
|
1041
1064
|
// src/tools/funnels.ts
|
|
1042
1065
|
var import_zod7 = require("zod");
|
|
1043
1066
|
var funnelIdSchema = import_zod7.z.string().describe('Funnel slug (from list_funnels), e.g. "checkout"');
|
|
1067
|
+
function stepChangeText(dropOffFromPrevious) {
|
|
1068
|
+
if (dropOffFromPrevious == null) return "";
|
|
1069
|
+
if (dropOffFromPrevious < 0) {
|
|
1070
|
+
return ` (${Math.round(-dropOffFromPrevious * 100)}% MORE than the previous step \u2014 some visitors reached it without the step before, or completed that step before this window)`;
|
|
1071
|
+
}
|
|
1072
|
+
return ` (${Math.round(dropOffFromPrevious * 100)}% drop-off from previous)`;
|
|
1073
|
+
}
|
|
1044
1074
|
function registerFunnelTools(server, client) {
|
|
1045
1075
|
server.registerTool(
|
|
1046
1076
|
"list_funnels",
|
|
@@ -1150,7 +1180,7 @@ function registerFunnelTools(server, client) {
|
|
|
1150
1180
|
const lines = [`${data.displayName} \u2014 last ${data.windowDays} days`];
|
|
1151
1181
|
for (const s of data.steps) {
|
|
1152
1182
|
lines.push(
|
|
1153
|
-
`${s.stepIndex + 1}. ${s.displayName}: ${s.reached} reached` + (s.dropOffFromPrevious
|
|
1183
|
+
`${s.stepIndex + 1}. ${s.displayName}: ${s.reached} reached` + stepChangeText(s.dropOffFromPrevious) + (s.neverFired ? " [never recorded \u2014 check the goal name]" : "")
|
|
1154
1184
|
);
|
|
1155
1185
|
for (const v of s.variants) {
|
|
1156
1186
|
lines.push(` ${v.componentId}/${v.variantId}: ${v.reached}/${v.assigned} assigned sessions reached this step`);
|
|
@@ -1927,7 +1957,7 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1927
1957
|
}
|
|
1928
1958
|
|
|
1929
1959
|
// src/server.ts
|
|
1930
|
-
var PKG_VERSION = true ? "0.17.
|
|
1960
|
+
var PKG_VERSION = true ? "0.17.4" : "0.0.0-dev";
|
|
1931
1961
|
function createMcpServer(client) {
|
|
1932
1962
|
const server = new import_mcp.McpServer(
|
|
1933
1963
|
{
|
package/dist/lib.js
CHANGED