@sentientui/mcp 0.9.2 → 0.11.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 +1 -0
- package/dist/{chunk-KUOPKVVD.js → chunk-4TM3SCHF.js} +68 -2
- package/dist/index.cjs +68 -2
- package/dist/index.js +1 -1
- package/dist/lib.cjs +68 -2
- package/dist/lib.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,6 +93,7 @@ A sandboxed demo token is provisioned automatically — 10 calls/month, read-onl
|
|
|
93
93
|
| `refresh_insights` | Trigger fresh AI insight generation |
|
|
94
94
|
| `get_persona_breakdown` | Visitor cluster distribution with reliability scores |
|
|
95
95
|
| `get_goal_funnel` | Goal hit counts and conversion rates per variant |
|
|
96
|
+
| `list_goals` | Defined goals (id, role, event, status) — includes goals with no conversions yet, so agents can wire a dashboard-defined goal into code |
|
|
96
97
|
| `list_guardrail_events` | Variants auto-paused by the guardrail (last 24h) |
|
|
97
98
|
| `get_layout_stats` | Per-persona section layout rankings and reward weights |
|
|
98
99
|
| `get_integration_guide` | SentientUI adaptive-ladder setup guide (static — same for every project) |
|
|
@@ -787,6 +787,62 @@ function registerGoalTools(server, client) {
|
|
|
787
787
|
return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
|
|
788
788
|
})
|
|
789
789
|
);
|
|
790
|
+
server.registerTool(
|
|
791
|
+
"list_goals",
|
|
792
|
+
{
|
|
793
|
+
title: "List goal definitions",
|
|
794
|
+
description: `List the project's defined goals \u2014 including ones with no conversions yet, which get_goal_funnel cannot see. Returns each goal's stable id, display name, role (primary/secondary/guardrail), event type, and status. Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`,
|
|
795
|
+
inputSchema: { projectId: projectIdSchema },
|
|
796
|
+
outputSchema: {
|
|
797
|
+
goals: z6.array(
|
|
798
|
+
z6.object({
|
|
799
|
+
goalId: z6.string().describe("Stable id \u2014 use this exact string when firing the goal from code"),
|
|
800
|
+
displayName: z6.string(),
|
|
801
|
+
role: z6.string().describe("primary | secondary | guardrail"),
|
|
802
|
+
event: z6.string().describe("click | form_submit | url_reached"),
|
|
803
|
+
urlPattern: z6.string().nullable().describe("Only for url_reached goals"),
|
|
804
|
+
status: z6.string().describe("active | archived")
|
|
805
|
+
})
|
|
806
|
+
).describe("Defined goals (empty if none)")
|
|
807
|
+
},
|
|
808
|
+
annotations: {
|
|
809
|
+
readOnlyHint: true,
|
|
810
|
+
idempotentHint: true,
|
|
811
|
+
openWorldHint: false
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
withApiErrorGuidance(async ({ projectId }) => {
|
|
815
|
+
const id = encodeURIComponent(projectId);
|
|
816
|
+
const data = await client.get(`/projects/${id}/goal-definitions`);
|
|
817
|
+
const structuredContent = {
|
|
818
|
+
goals: data.goals.map((g) => {
|
|
819
|
+
var _a;
|
|
820
|
+
return {
|
|
821
|
+
goalId: g.goal_id,
|
|
822
|
+
displayName: g.display_name,
|
|
823
|
+
role: g.role,
|
|
824
|
+
event: g.event,
|
|
825
|
+
urlPattern: (_a = g.url_pattern) != null ? _a : null,
|
|
826
|
+
status: g.status
|
|
827
|
+
};
|
|
828
|
+
})
|
|
829
|
+
};
|
|
830
|
+
if (!structuredContent.goals.length) {
|
|
831
|
+
return {
|
|
832
|
+
content: [{
|
|
833
|
+
type: "text",
|
|
834
|
+
text: "No goal definitions yet. Define one in the dashboard (Goals page or onboarding chat), or fire client.goal('<name>') from code and it will appear in get_goal_funnel once it converts."
|
|
835
|
+
}],
|
|
836
|
+
structuredContent
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
const lines = structuredContent.goals.map(
|
|
840
|
+
(g) => `${g.goalId} (${g.role}, ${g.event}${g.status === "archived" ? ", archived" : ""}) \u2014 ${g.displayName}`
|
|
841
|
+
);
|
|
842
|
+
lines.push("", `Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`);
|
|
843
|
+
return { content: [{ type: "text", text: lines.join("\n") }], structuredContent };
|
|
844
|
+
})
|
|
845
|
+
);
|
|
790
846
|
}
|
|
791
847
|
|
|
792
848
|
// src/tools/guardrails.ts
|
|
@@ -1475,6 +1531,11 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1475
1531
|
cta: z13.boolean(),
|
|
1476
1532
|
notes: z13.array(z13.string())
|
|
1477
1533
|
}),
|
|
1534
|
+
fixes: z13.array(z13.object({
|
|
1535
|
+
check: z13.string(),
|
|
1536
|
+
advice: z13.string(),
|
|
1537
|
+
snippet: z13.string().optional()
|
|
1538
|
+
})).optional().describe("Concrete Next.js remediation per failing check"),
|
|
1478
1539
|
lastChecked: z13.string()
|
|
1479
1540
|
})
|
|
1480
1541
|
),
|
|
@@ -1498,7 +1559,12 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1498
1559
|
const failed = ["price", "name", "positioning", "cta"].filter((k) => !p.checks[k]);
|
|
1499
1560
|
return `- ${p.path}: ${p.score}/100${failed.length ? ` \u2014 missing: ${failed.join(", ")}` : " \u2014 fully legible"}`;
|
|
1500
1561
|
}),
|
|
1501
|
-
...l.paths.flatMap(
|
|
1562
|
+
...l.paths.flatMap(
|
|
1563
|
+
(p) => {
|
|
1564
|
+
var _a;
|
|
1565
|
+
return ((_a = p.fixes) == null ? void 0 : _a.length) ? p.fixes.map((f) => ` fix (${p.path}): ${f.advice}`) : p.checks.notes.map((n) => ` fix (${p.path}): ${n}`);
|
|
1566
|
+
}
|
|
1567
|
+
)
|
|
1502
1568
|
];
|
|
1503
1569
|
if (l.emptyBlocks.length > 0) {
|
|
1504
1570
|
lines.push("", "Agent API blocks served without agent data (add agentDataByVariant):");
|
|
@@ -1510,7 +1576,7 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1510
1576
|
}
|
|
1511
1577
|
|
|
1512
1578
|
// src/server.ts
|
|
1513
|
-
var PKG_VERSION = true ? "0.
|
|
1579
|
+
var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
|
|
1514
1580
|
function createMcpServer(client) {
|
|
1515
1581
|
const server = new McpServer(
|
|
1516
1582
|
{
|
package/dist/index.cjs
CHANGED
|
@@ -791,6 +791,62 @@ function registerGoalTools(server, client) {
|
|
|
791
791
|
return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
|
|
792
792
|
})
|
|
793
793
|
);
|
|
794
|
+
server.registerTool(
|
|
795
|
+
"list_goals",
|
|
796
|
+
{
|
|
797
|
+
title: "List goal definitions",
|
|
798
|
+
description: `List the project's defined goals \u2014 including ones with no conversions yet, which get_goal_funnel cannot see. Returns each goal's stable id, display name, role (primary/secondary/guardrail), event type, and status. Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`,
|
|
799
|
+
inputSchema: { projectId: projectIdSchema },
|
|
800
|
+
outputSchema: {
|
|
801
|
+
goals: import_zod6.z.array(
|
|
802
|
+
import_zod6.z.object({
|
|
803
|
+
goalId: import_zod6.z.string().describe("Stable id \u2014 use this exact string when firing the goal from code"),
|
|
804
|
+
displayName: import_zod6.z.string(),
|
|
805
|
+
role: import_zod6.z.string().describe("primary | secondary | guardrail"),
|
|
806
|
+
event: import_zod6.z.string().describe("click | form_submit | url_reached"),
|
|
807
|
+
urlPattern: import_zod6.z.string().nullable().describe("Only for url_reached goals"),
|
|
808
|
+
status: import_zod6.z.string().describe("active | archived")
|
|
809
|
+
})
|
|
810
|
+
).describe("Defined goals (empty if none)")
|
|
811
|
+
},
|
|
812
|
+
annotations: {
|
|
813
|
+
readOnlyHint: true,
|
|
814
|
+
idempotentHint: true,
|
|
815
|
+
openWorldHint: false
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
withApiErrorGuidance(async ({ projectId }) => {
|
|
819
|
+
const id = encodeURIComponent(projectId);
|
|
820
|
+
const data = await client.get(`/projects/${id}/goal-definitions`);
|
|
821
|
+
const structuredContent = {
|
|
822
|
+
goals: data.goals.map((g) => {
|
|
823
|
+
var _a2;
|
|
824
|
+
return {
|
|
825
|
+
goalId: g.goal_id,
|
|
826
|
+
displayName: g.display_name,
|
|
827
|
+
role: g.role,
|
|
828
|
+
event: g.event,
|
|
829
|
+
urlPattern: (_a2 = g.url_pattern) != null ? _a2 : null,
|
|
830
|
+
status: g.status
|
|
831
|
+
};
|
|
832
|
+
})
|
|
833
|
+
};
|
|
834
|
+
if (!structuredContent.goals.length) {
|
|
835
|
+
return {
|
|
836
|
+
content: [{
|
|
837
|
+
type: "text",
|
|
838
|
+
text: "No goal definitions yet. Define one in the dashboard (Goals page or onboarding chat), or fire client.goal('<name>') from code and it will appear in get_goal_funnel once it converts."
|
|
839
|
+
}],
|
|
840
|
+
structuredContent
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
const lines = structuredContent.goals.map(
|
|
844
|
+
(g) => `${g.goalId} (${g.role}, ${g.event}${g.status === "archived" ? ", archived" : ""}) \u2014 ${g.displayName}`
|
|
845
|
+
);
|
|
846
|
+
lines.push("", `Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`);
|
|
847
|
+
return { content: [{ type: "text", text: lines.join("\n") }], structuredContent };
|
|
848
|
+
})
|
|
849
|
+
);
|
|
794
850
|
}
|
|
795
851
|
|
|
796
852
|
// src/tools/guardrails.ts
|
|
@@ -1479,6 +1535,11 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1479
1535
|
cta: import_zod13.z.boolean(),
|
|
1480
1536
|
notes: import_zod13.z.array(import_zod13.z.string())
|
|
1481
1537
|
}),
|
|
1538
|
+
fixes: import_zod13.z.array(import_zod13.z.object({
|
|
1539
|
+
check: import_zod13.z.string(),
|
|
1540
|
+
advice: import_zod13.z.string(),
|
|
1541
|
+
snippet: import_zod13.z.string().optional()
|
|
1542
|
+
})).optional().describe("Concrete Next.js remediation per failing check"),
|
|
1482
1543
|
lastChecked: import_zod13.z.string()
|
|
1483
1544
|
})
|
|
1484
1545
|
),
|
|
@@ -1502,7 +1563,12 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1502
1563
|
const failed = ["price", "name", "positioning", "cta"].filter((k) => !p.checks[k]);
|
|
1503
1564
|
return `- ${p.path}: ${p.score}/100${failed.length ? ` \u2014 missing: ${failed.join(", ")}` : " \u2014 fully legible"}`;
|
|
1504
1565
|
}),
|
|
1505
|
-
...l.paths.flatMap(
|
|
1566
|
+
...l.paths.flatMap(
|
|
1567
|
+
(p) => {
|
|
1568
|
+
var _a2;
|
|
1569
|
+
return ((_a2 = p.fixes) == null ? void 0 : _a2.length) ? p.fixes.map((f) => ` fix (${p.path}): ${f.advice}`) : p.checks.notes.map((n) => ` fix (${p.path}): ${n}`);
|
|
1570
|
+
}
|
|
1571
|
+
)
|
|
1506
1572
|
];
|
|
1507
1573
|
if (l.emptyBlocks.length > 0) {
|
|
1508
1574
|
lines.push("", "Agent API blocks served without agent data (add agentDataByVariant):");
|
|
@@ -1514,7 +1580,7 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1514
1580
|
}
|
|
1515
1581
|
|
|
1516
1582
|
// src/server.ts
|
|
1517
|
-
var PKG_VERSION = true ? "0.
|
|
1583
|
+
var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
|
|
1518
1584
|
function createMcpServer(client) {
|
|
1519
1585
|
const server = new import_mcp.McpServer(
|
|
1520
1586
|
{
|
package/dist/index.js
CHANGED
package/dist/lib.cjs
CHANGED
|
@@ -816,6 +816,62 @@ function registerGoalTools(server, client) {
|
|
|
816
816
|
return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
|
|
817
817
|
})
|
|
818
818
|
);
|
|
819
|
+
server.registerTool(
|
|
820
|
+
"list_goals",
|
|
821
|
+
{
|
|
822
|
+
title: "List goal definitions",
|
|
823
|
+
description: `List the project's defined goals \u2014 including ones with no conversions yet, which get_goal_funnel cannot see. Returns each goal's stable id, display name, role (primary/secondary/guardrail), event type, and status. Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`,
|
|
824
|
+
inputSchema: { projectId: projectIdSchema },
|
|
825
|
+
outputSchema: {
|
|
826
|
+
goals: import_zod6.z.array(
|
|
827
|
+
import_zod6.z.object({
|
|
828
|
+
goalId: import_zod6.z.string().describe("Stable id \u2014 use this exact string when firing the goal from code"),
|
|
829
|
+
displayName: import_zod6.z.string(),
|
|
830
|
+
role: import_zod6.z.string().describe("primary | secondary | guardrail"),
|
|
831
|
+
event: import_zod6.z.string().describe("click | form_submit | url_reached"),
|
|
832
|
+
urlPattern: import_zod6.z.string().nullable().describe("Only for url_reached goals"),
|
|
833
|
+
status: import_zod6.z.string().describe("active | archived")
|
|
834
|
+
})
|
|
835
|
+
).describe("Defined goals (empty if none)")
|
|
836
|
+
},
|
|
837
|
+
annotations: {
|
|
838
|
+
readOnlyHint: true,
|
|
839
|
+
idempotentHint: true,
|
|
840
|
+
openWorldHint: false
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
withApiErrorGuidance(async ({ projectId }) => {
|
|
844
|
+
const id = encodeURIComponent(projectId);
|
|
845
|
+
const data = await client.get(`/projects/${id}/goal-definitions`);
|
|
846
|
+
const structuredContent = {
|
|
847
|
+
goals: data.goals.map((g) => {
|
|
848
|
+
var _a;
|
|
849
|
+
return {
|
|
850
|
+
goalId: g.goal_id,
|
|
851
|
+
displayName: g.display_name,
|
|
852
|
+
role: g.role,
|
|
853
|
+
event: g.event,
|
|
854
|
+
urlPattern: (_a = g.url_pattern) != null ? _a : null,
|
|
855
|
+
status: g.status
|
|
856
|
+
};
|
|
857
|
+
})
|
|
858
|
+
};
|
|
859
|
+
if (!structuredContent.goals.length) {
|
|
860
|
+
return {
|
|
861
|
+
content: [{
|
|
862
|
+
type: "text",
|
|
863
|
+
text: "No goal definitions yet. Define one in the dashboard (Goals page or onboarding chat), or fire client.goal('<name>') from code and it will appear in get_goal_funnel once it converts."
|
|
864
|
+
}],
|
|
865
|
+
structuredContent
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
const lines = structuredContent.goals.map(
|
|
869
|
+
(g) => `${g.goalId} (${g.role}, ${g.event}${g.status === "archived" ? ", archived" : ""}) \u2014 ${g.displayName}`
|
|
870
|
+
);
|
|
871
|
+
lines.push("", `Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`);
|
|
872
|
+
return { content: [{ type: "text", text: lines.join("\n") }], structuredContent };
|
|
873
|
+
})
|
|
874
|
+
);
|
|
819
875
|
}
|
|
820
876
|
|
|
821
877
|
// src/tools/guardrails.ts
|
|
@@ -1504,6 +1560,11 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1504
1560
|
cta: import_zod13.z.boolean(),
|
|
1505
1561
|
notes: import_zod13.z.array(import_zod13.z.string())
|
|
1506
1562
|
}),
|
|
1563
|
+
fixes: import_zod13.z.array(import_zod13.z.object({
|
|
1564
|
+
check: import_zod13.z.string(),
|
|
1565
|
+
advice: import_zod13.z.string(),
|
|
1566
|
+
snippet: import_zod13.z.string().optional()
|
|
1567
|
+
})).optional().describe("Concrete Next.js remediation per failing check"),
|
|
1507
1568
|
lastChecked: import_zod13.z.string()
|
|
1508
1569
|
})
|
|
1509
1570
|
),
|
|
@@ -1527,7 +1588,12 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1527
1588
|
const failed = ["price", "name", "positioning", "cta"].filter((k) => !p.checks[k]);
|
|
1528
1589
|
return `- ${p.path}: ${p.score}/100${failed.length ? ` \u2014 missing: ${failed.join(", ")}` : " \u2014 fully legible"}`;
|
|
1529
1590
|
}),
|
|
1530
|
-
...l.paths.flatMap(
|
|
1591
|
+
...l.paths.flatMap(
|
|
1592
|
+
(p) => {
|
|
1593
|
+
var _a;
|
|
1594
|
+
return ((_a = p.fixes) == null ? void 0 : _a.length) ? p.fixes.map((f) => ` fix (${p.path}): ${f.advice}`) : p.checks.notes.map((n) => ` fix (${p.path}): ${n}`);
|
|
1595
|
+
}
|
|
1596
|
+
)
|
|
1531
1597
|
];
|
|
1532
1598
|
if (l.emptyBlocks.length > 0) {
|
|
1533
1599
|
lines.push("", "Agent API blocks served without agent data (add agentDataByVariant):");
|
|
@@ -1539,7 +1605,7 @@ function registerAgentTrafficTools(server, client) {
|
|
|
1539
1605
|
}
|
|
1540
1606
|
|
|
1541
1607
|
// src/server.ts
|
|
1542
|
-
var PKG_VERSION = true ? "0.
|
|
1608
|
+
var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
|
|
1543
1609
|
function createMcpServer(client) {
|
|
1544
1610
|
const server = new import_mcp.McpServer(
|
|
1545
1611
|
{
|
package/dist/lib.js
CHANGED