@sentientui/mcp 0.5.1 → 0.5.2
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-TU6A7NHN.js → chunk-OPMHTLTY.js} +8 -4
- package/dist/index.cjs +8 -4
- package/dist/index.js +1 -1
- package/dist/lib.cjs +8 -4
- package/dist/lib.js +1 -1
- package/package.json +1 -1
|
@@ -809,8 +809,9 @@ function registerVariantBriefTools(server, client) {
|
|
|
809
809
|
},
|
|
810
810
|
async ({ projectId, componentId }) => {
|
|
811
811
|
const id = encodeURIComponent(projectId);
|
|
812
|
-
const [projects,
|
|
812
|
+
const [projects, componentsEnvelope, trends, portraits, insights] = await Promise.all([
|
|
813
813
|
settled(client.get("/projects")),
|
|
814
|
+
// mgmt API returns a paginated envelope: { components, total, page, limit }.
|
|
814
815
|
settled(client.get(`/projects/${id}/components`)),
|
|
815
816
|
settled(client.get(`/projects/${id}/trends`)),
|
|
816
817
|
settled(client.get(`/projects/${id}/portraits`)),
|
|
@@ -818,7 +819,8 @@ function registerVariantBriefTools(server, client) {
|
|
|
818
819
|
]);
|
|
819
820
|
const project = projects?.find((p) => p.id === projectId) ?? null;
|
|
820
821
|
const contextType = project?.context_type ?? "unknown";
|
|
821
|
-
const
|
|
822
|
+
const components = componentsEnvelope?.components ?? [];
|
|
823
|
+
const component = components.find((c) => c.component_id === componentId) ?? null;
|
|
822
824
|
const impressions = component?.total_impressions ?? 0;
|
|
823
825
|
const conversions = component?.total_conversions ?? 0;
|
|
824
826
|
const componentCvr = impressions > 0 ? conversions / impressions * 100 : 0;
|
|
@@ -946,11 +948,13 @@ function registerTestBriefTools(server, client) {
|
|
|
946
948
|
},
|
|
947
949
|
async ({ projectId, componentId }) => {
|
|
948
950
|
const id = encodeURIComponent(projectId);
|
|
949
|
-
const [
|
|
951
|
+
const [componentsEnvelope, goalsRes] = await Promise.all([
|
|
952
|
+
// mgmt API returns a paginated envelope: { components, total, page, limit }.
|
|
950
953
|
settled2(client.get(`/projects/${id}/components`)),
|
|
951
954
|
settled2(client.get(`/projects/${id}/goals`))
|
|
952
955
|
]);
|
|
953
|
-
const
|
|
956
|
+
const components = componentsEnvelope?.components ?? [];
|
|
957
|
+
const component = components.find((c) => c.component_id === componentId) ?? null;
|
|
954
958
|
const variantIds = component?.variants.map((v) => v.variant_id) ?? [];
|
|
955
959
|
const goals = Array.isArray(goalsRes) ? goalsRes : goalsRes?.goals ?? [];
|
|
956
960
|
const goalName = goals[0]?.goalName ?? "signup";
|
package/dist/index.cjs
CHANGED
|
@@ -817,8 +817,9 @@ function registerVariantBriefTools(server, client) {
|
|
|
817
817
|
},
|
|
818
818
|
async ({ projectId, componentId }) => {
|
|
819
819
|
const id = encodeURIComponent(projectId);
|
|
820
|
-
const [projects,
|
|
820
|
+
const [projects, componentsEnvelope, trends, portraits, insights] = await Promise.all([
|
|
821
821
|
settled(client.get("/projects")),
|
|
822
|
+
// mgmt API returns a paginated envelope: { components, total, page, limit }.
|
|
822
823
|
settled(client.get(`/projects/${id}/components`)),
|
|
823
824
|
settled(client.get(`/projects/${id}/trends`)),
|
|
824
825
|
settled(client.get(`/projects/${id}/portraits`)),
|
|
@@ -826,7 +827,8 @@ function registerVariantBriefTools(server, client) {
|
|
|
826
827
|
]);
|
|
827
828
|
const project = projects?.find((p) => p.id === projectId) ?? null;
|
|
828
829
|
const contextType = project?.context_type ?? "unknown";
|
|
829
|
-
const
|
|
830
|
+
const components = componentsEnvelope?.components ?? [];
|
|
831
|
+
const component = components.find((c) => c.component_id === componentId) ?? null;
|
|
830
832
|
const impressions = component?.total_impressions ?? 0;
|
|
831
833
|
const conversions = component?.total_conversions ?? 0;
|
|
832
834
|
const componentCvr = impressions > 0 ? conversions / impressions * 100 : 0;
|
|
@@ -954,11 +956,13 @@ function registerTestBriefTools(server, client) {
|
|
|
954
956
|
},
|
|
955
957
|
async ({ projectId, componentId }) => {
|
|
956
958
|
const id = encodeURIComponent(projectId);
|
|
957
|
-
const [
|
|
959
|
+
const [componentsEnvelope, goalsRes] = await Promise.all([
|
|
960
|
+
// mgmt API returns a paginated envelope: { components, total, page, limit }.
|
|
958
961
|
settled2(client.get(`/projects/${id}/components`)),
|
|
959
962
|
settled2(client.get(`/projects/${id}/goals`))
|
|
960
963
|
]);
|
|
961
|
-
const
|
|
964
|
+
const components = componentsEnvelope?.components ?? [];
|
|
965
|
+
const component = components.find((c) => c.component_id === componentId) ?? null;
|
|
962
966
|
const variantIds = component?.variants.map((v) => v.variant_id) ?? [];
|
|
963
967
|
const goals = Array.isArray(goalsRes) ? goalsRes : goalsRes?.goals ?? [];
|
|
964
968
|
const goalName = goals[0]?.goalName ?? "signup";
|
package/dist/index.js
CHANGED
package/dist/lib.cjs
CHANGED
|
@@ -842,8 +842,9 @@ function registerVariantBriefTools(server, client) {
|
|
|
842
842
|
},
|
|
843
843
|
async ({ projectId, componentId }) => {
|
|
844
844
|
const id = encodeURIComponent(projectId);
|
|
845
|
-
const [projects,
|
|
845
|
+
const [projects, componentsEnvelope, trends, portraits, insights] = await Promise.all([
|
|
846
846
|
settled(client.get("/projects")),
|
|
847
|
+
// mgmt API returns a paginated envelope: { components, total, page, limit }.
|
|
847
848
|
settled(client.get(`/projects/${id}/components`)),
|
|
848
849
|
settled(client.get(`/projects/${id}/trends`)),
|
|
849
850
|
settled(client.get(`/projects/${id}/portraits`)),
|
|
@@ -851,7 +852,8 @@ function registerVariantBriefTools(server, client) {
|
|
|
851
852
|
]);
|
|
852
853
|
const project = projects?.find((p) => p.id === projectId) ?? null;
|
|
853
854
|
const contextType = project?.context_type ?? "unknown";
|
|
854
|
-
const
|
|
855
|
+
const components = componentsEnvelope?.components ?? [];
|
|
856
|
+
const component = components.find((c) => c.component_id === componentId) ?? null;
|
|
855
857
|
const impressions = component?.total_impressions ?? 0;
|
|
856
858
|
const conversions = component?.total_conversions ?? 0;
|
|
857
859
|
const componentCvr = impressions > 0 ? conversions / impressions * 100 : 0;
|
|
@@ -979,11 +981,13 @@ function registerTestBriefTools(server, client) {
|
|
|
979
981
|
},
|
|
980
982
|
async ({ projectId, componentId }) => {
|
|
981
983
|
const id = encodeURIComponent(projectId);
|
|
982
|
-
const [
|
|
984
|
+
const [componentsEnvelope, goalsRes] = await Promise.all([
|
|
985
|
+
// mgmt API returns a paginated envelope: { components, total, page, limit }.
|
|
983
986
|
settled2(client.get(`/projects/${id}/components`)),
|
|
984
987
|
settled2(client.get(`/projects/${id}/goals`))
|
|
985
988
|
]);
|
|
986
|
-
const
|
|
989
|
+
const components = componentsEnvelope?.components ?? [];
|
|
990
|
+
const component = components.find((c) => c.component_id === componentId) ?? null;
|
|
987
991
|
const variantIds = component?.variants.map((v) => v.variant_id) ?? [];
|
|
988
992
|
const goals = Array.isArray(goalsRes) ? goalsRes : goalsRes?.goals ?? [];
|
|
989
993
|
const goalName = goals[0]?.goalName ?? "signup";
|
package/dist/lib.js
CHANGED