@sentientui/mcp 0.11.0 → 0.12.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.
@@ -734,12 +734,16 @@ function registerGoalTools(server, client) {
734
734
  inputSchema: { projectId: projectIdSchema },
735
735
  _meta: uiMeta("goal-funnel"),
736
736
  outputSchema: {
737
+ currency: z6.string().describe("Project display currency (ISO-4217) for the revenue fields"),
737
738
  goals: z6.array(
738
739
  z6.object({
739
740
  goalName: z6.string(),
740
741
  hits: z6.number(),
741
742
  uniqueSessions: z6.number(),
742
743
  conversionRate: z6.number().describe("Unique-session conversion rate (0-1)"),
744
+ revenue: z6.number().nullable().describe("Total revenue from valued conversions, in the project currency (null for valueless goals)"),
745
+ avgOrderValue: z6.number().nullable().describe("Average value per valued conversion (null for valueless goals)"),
746
+ revenuePerSession: z6.number().nullable().describe("Revenue divided by all project sessions (null for valueless goals)"),
743
747
  variants: z6.array(
744
748
  z6.object({
745
749
  componentId: z6.string(),
@@ -757,20 +761,28 @@ function registerGoalTools(server, client) {
757
761
  }
758
762
  },
759
763
  withApiErrorGuidance(async ({ projectId }) => {
764
+ var _a, _b;
760
765
  const id = encodeURIComponent(projectId);
761
766
  const data = await client.get(`/projects/${id}/goals`);
762
767
  const structuredContent = {
763
- goals: data.goals.map((g) => ({
764
- goalName: g.goalName,
765
- hits: g.hits,
766
- uniqueSessions: g.uniqueSessions,
767
- conversionRate: g.pct,
768
- variants: g.variants.map((v) => ({
769
- componentId: v.componentId,
770
- variantId: v.variantId,
771
- completionRate: v.completionRate
772
- }))
773
- }))
768
+ currency: (_a = data.currency) != null ? _a : "USD",
769
+ goals: data.goals.map((g) => {
770
+ var _a2, _b2, _c;
771
+ return {
772
+ goalName: g.goalName,
773
+ hits: g.hits,
774
+ uniqueSessions: g.uniqueSessions,
775
+ conversionRate: g.pct,
776
+ revenue: (_a2 = g.revenue) != null ? _a2 : null,
777
+ avgOrderValue: (_b2 = g.avgOrderValue) != null ? _b2 : null,
778
+ revenuePerSession: (_c = g.revenuePerSession) != null ? _c : null,
779
+ variants: g.variants.map((v) => ({
780
+ componentId: v.componentId,
781
+ variantId: v.variantId,
782
+ completionRate: v.completionRate
783
+ }))
784
+ };
785
+ })
774
786
  };
775
787
  if (!data.goals.length) {
776
788
  return {
@@ -779,11 +791,15 @@ function registerGoalTools(server, client) {
779
791
  _meta: uiMeta("goal-funnel")
780
792
  };
781
793
  }
782
- const lines = data.goals.flatMap((g) => [
783
- `${g.goalName}: ${g.hits} hits, ${g.uniqueSessions} unique sessions, ${(g.pct * 100).toFixed(1)}% conversion`,
784
- ...g.variants.map((v) => ` ${v.componentId}/${v.variantId}: ${(v.completionRate * 100).toFixed(1)}% per assigned session`),
785
- ""
786
- ]);
794
+ const currency = (_b = data.currency) != null ? _b : "USD";
795
+ const lines = data.goals.flatMap((g) => {
796
+ var _a2;
797
+ return [
798
+ `${g.goalName}: ${g.hits} hits, ${g.uniqueSessions} unique sessions, ${(g.pct * 100).toFixed(1)}% conversion` + (g.revenue != null ? `, ${g.revenue.toFixed(2)} ${currency} revenue (${((_a2 = g.avgOrderValue) != null ? _a2 : 0).toFixed(2)} avg order)` : ""),
799
+ ...g.variants.map((v) => ` ${v.componentId}/${v.variantId}: ${(v.completionRate * 100).toFixed(1)}% per assigned session`),
800
+ ""
801
+ ];
802
+ });
787
803
  return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
788
804
  })
789
805
  );
@@ -801,7 +817,8 @@ function registerGoalTools(server, client) {
801
817
  role: z6.string().describe("primary | secondary | guardrail"),
802
818
  event: z6.string().describe("click | form_submit | url_reached"),
803
819
  urlPattern: z6.string().nullable().describe("Only for url_reached goals"),
804
- status: z6.string().describe("active | archived")
820
+ status: z6.string().describe("active | archived"),
821
+ defaultValue: z6.number().nullable().describe("Fixed worth applied when a conversion carries no explicit value (project currency); null when unset")
805
822
  })
806
823
  ).describe("Defined goals (empty if none)")
807
824
  },
@@ -823,7 +840,10 @@ function registerGoalTools(server, client) {
823
840
  role: g.role,
824
841
  event: g.event,
825
842
  urlPattern: (_a = g.url_pattern) != null ? _a : null,
826
- status: g.status
843
+ status: g.status,
844
+ // NUMERIC arrives serialized as a string; coerce and tolerate its
845
+ // absence from an older API deploy.
846
+ defaultValue: g.default_value != null ? Number(g.default_value) : null
827
847
  };
828
848
  })
829
849
  };
@@ -1576,7 +1596,7 @@ function registerAgentTrafficTools(server, client) {
1576
1596
  }
1577
1597
 
1578
1598
  // src/server.ts
1579
- var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
1599
+ var PKG_VERSION = true ? "0.12.0" : "0.0.0-dev";
1580
1600
  function createMcpServer(client) {
1581
1601
  const server = new McpServer(
1582
1602
  {
package/dist/index.cjs CHANGED
@@ -738,12 +738,16 @@ function registerGoalTools(server, client) {
738
738
  inputSchema: { projectId: projectIdSchema },
739
739
  _meta: uiMeta("goal-funnel"),
740
740
  outputSchema: {
741
+ currency: import_zod6.z.string().describe("Project display currency (ISO-4217) for the revenue fields"),
741
742
  goals: import_zod6.z.array(
742
743
  import_zod6.z.object({
743
744
  goalName: import_zod6.z.string(),
744
745
  hits: import_zod6.z.number(),
745
746
  uniqueSessions: import_zod6.z.number(),
746
747
  conversionRate: import_zod6.z.number().describe("Unique-session conversion rate (0-1)"),
748
+ revenue: import_zod6.z.number().nullable().describe("Total revenue from valued conversions, in the project currency (null for valueless goals)"),
749
+ avgOrderValue: import_zod6.z.number().nullable().describe("Average value per valued conversion (null for valueless goals)"),
750
+ revenuePerSession: import_zod6.z.number().nullable().describe("Revenue divided by all project sessions (null for valueless goals)"),
747
751
  variants: import_zod6.z.array(
748
752
  import_zod6.z.object({
749
753
  componentId: import_zod6.z.string(),
@@ -761,20 +765,28 @@ function registerGoalTools(server, client) {
761
765
  }
762
766
  },
763
767
  withApiErrorGuidance(async ({ projectId }) => {
768
+ var _a2, _b;
764
769
  const id = encodeURIComponent(projectId);
765
770
  const data = await client.get(`/projects/${id}/goals`);
766
771
  const structuredContent = {
767
- goals: data.goals.map((g) => ({
768
- goalName: g.goalName,
769
- hits: g.hits,
770
- uniqueSessions: g.uniqueSessions,
771
- conversionRate: g.pct,
772
- variants: g.variants.map((v) => ({
773
- componentId: v.componentId,
774
- variantId: v.variantId,
775
- completionRate: v.completionRate
776
- }))
777
- }))
772
+ currency: (_a2 = data.currency) != null ? _a2 : "USD",
773
+ goals: data.goals.map((g) => {
774
+ var _a3, _b2, _c;
775
+ return {
776
+ goalName: g.goalName,
777
+ hits: g.hits,
778
+ uniqueSessions: g.uniqueSessions,
779
+ conversionRate: g.pct,
780
+ revenue: (_a3 = g.revenue) != null ? _a3 : null,
781
+ avgOrderValue: (_b2 = g.avgOrderValue) != null ? _b2 : null,
782
+ revenuePerSession: (_c = g.revenuePerSession) != null ? _c : null,
783
+ variants: g.variants.map((v) => ({
784
+ componentId: v.componentId,
785
+ variantId: v.variantId,
786
+ completionRate: v.completionRate
787
+ }))
788
+ };
789
+ })
778
790
  };
779
791
  if (!data.goals.length) {
780
792
  return {
@@ -783,11 +795,15 @@ function registerGoalTools(server, client) {
783
795
  _meta: uiMeta("goal-funnel")
784
796
  };
785
797
  }
786
- const lines = data.goals.flatMap((g) => [
787
- `${g.goalName}: ${g.hits} hits, ${g.uniqueSessions} unique sessions, ${(g.pct * 100).toFixed(1)}% conversion`,
788
- ...g.variants.map((v) => ` ${v.componentId}/${v.variantId}: ${(v.completionRate * 100).toFixed(1)}% per assigned session`),
789
- ""
790
- ]);
798
+ const currency = (_b = data.currency) != null ? _b : "USD";
799
+ const lines = data.goals.flatMap((g) => {
800
+ var _a3;
801
+ return [
802
+ `${g.goalName}: ${g.hits} hits, ${g.uniqueSessions} unique sessions, ${(g.pct * 100).toFixed(1)}% conversion` + (g.revenue != null ? `, ${g.revenue.toFixed(2)} ${currency} revenue (${((_a3 = g.avgOrderValue) != null ? _a3 : 0).toFixed(2)} avg order)` : ""),
803
+ ...g.variants.map((v) => ` ${v.componentId}/${v.variantId}: ${(v.completionRate * 100).toFixed(1)}% per assigned session`),
804
+ ""
805
+ ];
806
+ });
791
807
  return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
792
808
  })
793
809
  );
@@ -805,7 +821,8 @@ function registerGoalTools(server, client) {
805
821
  role: import_zod6.z.string().describe("primary | secondary | guardrail"),
806
822
  event: import_zod6.z.string().describe("click | form_submit | url_reached"),
807
823
  urlPattern: import_zod6.z.string().nullable().describe("Only for url_reached goals"),
808
- status: import_zod6.z.string().describe("active | archived")
824
+ status: import_zod6.z.string().describe("active | archived"),
825
+ defaultValue: import_zod6.z.number().nullable().describe("Fixed worth applied when a conversion carries no explicit value (project currency); null when unset")
809
826
  })
810
827
  ).describe("Defined goals (empty if none)")
811
828
  },
@@ -827,7 +844,10 @@ function registerGoalTools(server, client) {
827
844
  role: g.role,
828
845
  event: g.event,
829
846
  urlPattern: (_a2 = g.url_pattern) != null ? _a2 : null,
830
- status: g.status
847
+ status: g.status,
848
+ // NUMERIC arrives serialized as a string; coerce and tolerate its
849
+ // absence from an older API deploy.
850
+ defaultValue: g.default_value != null ? Number(g.default_value) : null
831
851
  };
832
852
  })
833
853
  };
@@ -1580,7 +1600,7 @@ function registerAgentTrafficTools(server, client) {
1580
1600
  }
1581
1601
 
1582
1602
  // src/server.ts
1583
- var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
1603
+ var PKG_VERSION = true ? "0.12.0" : "0.0.0-dev";
1584
1604
  function createMcpServer(client) {
1585
1605
  const server = new import_mcp.McpServer(
1586
1606
  {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ApiClient,
4
4
  createMcpServer
5
- } from "./chunk-4TM3SCHF.js";
5
+ } from "./chunk-BMOKDBGH.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/dist/lib.cjs CHANGED
@@ -763,12 +763,16 @@ function registerGoalTools(server, client) {
763
763
  inputSchema: { projectId: projectIdSchema },
764
764
  _meta: uiMeta("goal-funnel"),
765
765
  outputSchema: {
766
+ currency: import_zod6.z.string().describe("Project display currency (ISO-4217) for the revenue fields"),
766
767
  goals: import_zod6.z.array(
767
768
  import_zod6.z.object({
768
769
  goalName: import_zod6.z.string(),
769
770
  hits: import_zod6.z.number(),
770
771
  uniqueSessions: import_zod6.z.number(),
771
772
  conversionRate: import_zod6.z.number().describe("Unique-session conversion rate (0-1)"),
773
+ revenue: import_zod6.z.number().nullable().describe("Total revenue from valued conversions, in the project currency (null for valueless goals)"),
774
+ avgOrderValue: import_zod6.z.number().nullable().describe("Average value per valued conversion (null for valueless goals)"),
775
+ revenuePerSession: import_zod6.z.number().nullable().describe("Revenue divided by all project sessions (null for valueless goals)"),
772
776
  variants: import_zod6.z.array(
773
777
  import_zod6.z.object({
774
778
  componentId: import_zod6.z.string(),
@@ -786,20 +790,28 @@ function registerGoalTools(server, client) {
786
790
  }
787
791
  },
788
792
  withApiErrorGuidance(async ({ projectId }) => {
793
+ var _a, _b;
789
794
  const id = encodeURIComponent(projectId);
790
795
  const data = await client.get(`/projects/${id}/goals`);
791
796
  const structuredContent = {
792
- goals: data.goals.map((g) => ({
793
- goalName: g.goalName,
794
- hits: g.hits,
795
- uniqueSessions: g.uniqueSessions,
796
- conversionRate: g.pct,
797
- variants: g.variants.map((v) => ({
798
- componentId: v.componentId,
799
- variantId: v.variantId,
800
- completionRate: v.completionRate
801
- }))
802
- }))
797
+ currency: (_a = data.currency) != null ? _a : "USD",
798
+ goals: data.goals.map((g) => {
799
+ var _a2, _b2, _c;
800
+ return {
801
+ goalName: g.goalName,
802
+ hits: g.hits,
803
+ uniqueSessions: g.uniqueSessions,
804
+ conversionRate: g.pct,
805
+ revenue: (_a2 = g.revenue) != null ? _a2 : null,
806
+ avgOrderValue: (_b2 = g.avgOrderValue) != null ? _b2 : null,
807
+ revenuePerSession: (_c = g.revenuePerSession) != null ? _c : null,
808
+ variants: g.variants.map((v) => ({
809
+ componentId: v.componentId,
810
+ variantId: v.variantId,
811
+ completionRate: v.completionRate
812
+ }))
813
+ };
814
+ })
803
815
  };
804
816
  if (!data.goals.length) {
805
817
  return {
@@ -808,11 +820,15 @@ function registerGoalTools(server, client) {
808
820
  _meta: uiMeta("goal-funnel")
809
821
  };
810
822
  }
811
- const lines = data.goals.flatMap((g) => [
812
- `${g.goalName}: ${g.hits} hits, ${g.uniqueSessions} unique sessions, ${(g.pct * 100).toFixed(1)}% conversion`,
813
- ...g.variants.map((v) => ` ${v.componentId}/${v.variantId}: ${(v.completionRate * 100).toFixed(1)}% per assigned session`),
814
- ""
815
- ]);
823
+ const currency = (_b = data.currency) != null ? _b : "USD";
824
+ const lines = data.goals.flatMap((g) => {
825
+ var _a2;
826
+ return [
827
+ `${g.goalName}: ${g.hits} hits, ${g.uniqueSessions} unique sessions, ${(g.pct * 100).toFixed(1)}% conversion` + (g.revenue != null ? `, ${g.revenue.toFixed(2)} ${currency} revenue (${((_a2 = g.avgOrderValue) != null ? _a2 : 0).toFixed(2)} avg order)` : ""),
828
+ ...g.variants.map((v) => ` ${v.componentId}/${v.variantId}: ${(v.completionRate * 100).toFixed(1)}% per assigned session`),
829
+ ""
830
+ ];
831
+ });
816
832
  return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
817
833
  })
818
834
  );
@@ -830,7 +846,8 @@ function registerGoalTools(server, client) {
830
846
  role: import_zod6.z.string().describe("primary | secondary | guardrail"),
831
847
  event: import_zod6.z.string().describe("click | form_submit | url_reached"),
832
848
  urlPattern: import_zod6.z.string().nullable().describe("Only for url_reached goals"),
833
- status: import_zod6.z.string().describe("active | archived")
849
+ status: import_zod6.z.string().describe("active | archived"),
850
+ defaultValue: import_zod6.z.number().nullable().describe("Fixed worth applied when a conversion carries no explicit value (project currency); null when unset")
834
851
  })
835
852
  ).describe("Defined goals (empty if none)")
836
853
  },
@@ -852,7 +869,10 @@ function registerGoalTools(server, client) {
852
869
  role: g.role,
853
870
  event: g.event,
854
871
  urlPattern: (_a = g.url_pattern) != null ? _a : null,
855
- status: g.status
872
+ status: g.status,
873
+ // NUMERIC arrives serialized as a string; coerce and tolerate its
874
+ // absence from an older API deploy.
875
+ defaultValue: g.default_value != null ? Number(g.default_value) : null
856
876
  };
857
877
  })
858
878
  };
@@ -1605,7 +1625,7 @@ function registerAgentTrafficTools(server, client) {
1605
1625
  }
1606
1626
 
1607
1627
  // src/server.ts
1608
- var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
1628
+ var PKG_VERSION = true ? "0.12.0" : "0.0.0-dev";
1609
1629
  function createMcpServer(client) {
1610
1630
  const server = new import_mcp.McpServer(
1611
1631
  {
package/dist/lib.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  ApiClient,
4
4
  ApiError,
5
5
  createMcpServer
6
- } from "./chunk-4TM3SCHF.js";
6
+ } from "./chunk-BMOKDBGH.js";
7
7
  export {
8
8
  ApiClient,
9
9
  ApiError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentientui/mcp",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "MCP server for SentientUI — exposes project data and actions to AI agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://sentient-ui.com",