@sentientui/mcp 0.28.0 → 0.28.1

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.
@@ -870,7 +870,7 @@ var regionOutputSchema = z3.array(
870
870
  versions: z3.array(
871
871
  z3.object({
872
872
  versionId: z3.string().describe("The served arm id: baseline = the original, authored.<key> = a version written in code, anything else = generated or edited in the dashboard"),
873
- source: z3.enum(["original", "code", "generated"]),
873
+ source: z3.enum(["original", "code", "generated", "written"]).describe("written = by a person in the dashboard or the on-site editor"),
874
874
  timesShown: z3.number().describe("All-time times shown \u2014 the optimizer's own totals, NOT filtered by the requested window"),
875
875
  conversions: z3.number().describe("All-time conversions credited to this version (optimizer totals)"),
876
876
  conversionRate: z3.number().nullable().describe("conversions / timesShown; null at 0 shown"),
@@ -886,12 +886,16 @@ var regionOutputSchema = z3.array(
886
886
  )
887
887
  })
888
888
  ).describe("Regions: components served per visitor through Who sees what \u2014 versions written in code next to the original, or generated ones");
889
- function sourceOf(arm, baselineArm) {
889
+ function sourceOf(arm, baselineArm, known) {
890
+ if (known === "original" || known === "generated") return known;
891
+ if (known === "authored") return "code";
892
+ if (known === "manual") return "written";
893
+ if (known === "suggested") return "generated";
890
894
  if (arm === baselineArm) return "original";
891
895
  if (arm.startsWith("authored.")) return "code";
892
896
  return "generated";
893
897
  }
894
- function regionsFrom(body) {
898
+ function regionsFrom(body, sources) {
895
899
  var _a, _b;
896
900
  const totals = new Map(((_a = body == null ? void 0 : body.window_totals) != null ? _a : []).map((t) => [t.slotId, t]));
897
901
  return ((_b = body == null ? void 0 : body.slots) != null ? _b : []).map((s) => {
@@ -899,16 +903,16 @@ function regionsFrom(body) {
899
903
  const baselineArm = (_a2 = s.baselineArm) != null ? _a2 : "baseline";
900
904
  const t = totals.get(s.slotId);
901
905
  const versions = ((_b2 = s.arms) != null ? _b2 : []).map((a2) => {
902
- var _a3, _b3, _c;
906
+ var _a3, _b3, _c, _d;
903
907
  const shown = (_a3 = a2.timesShown) != null ? _a3 : 0;
904
908
  const conv = (_b3 = a2.conversions) != null ? _b3 : 0;
905
909
  return {
906
910
  versionId: a2.arm,
907
- source: sourceOf(a2.arm, baselineArm),
911
+ source: sourceOf(a2.arm, baselineArm, (_c = sources == null ? void 0 : sources.get(s.slotId)) == null ? void 0 : _c.get(a2.arm)),
908
912
  timesShown: shown,
909
913
  conversions: conv,
910
914
  conversionRate: shown > 0 ? conv / shown : null,
911
- evidence: ((_c = a2.personas) != null ? _c : []).map((p) => {
915
+ evidence: ((_d = a2.personas) != null ? _d : []).map((p) => {
912
916
  var _a4, _b4, _c2;
913
917
  return {
914
918
  audience: (_a4 = p.personaDisplay) != null ? _a4 : p.persona,
@@ -919,7 +923,7 @@ function regionsFrom(body) {
919
923
  })
920
924
  };
921
925
  });
922
- const rank = { original: 0, code: 1, generated: 2 };
926
+ const rank = { original: 0, code: 1, written: 2, generated: 3 };
923
927
  versions.sort((x, y) => rank[x.source] - rank[y.source] || x.versionId.localeCompare(y.versionId));
924
928
  return {
925
929
  componentId: s.slotId,
@@ -930,10 +934,21 @@ function regionsFrom(body) {
930
934
  });
931
935
  }
932
936
  async function fetchRegions(client, projectId, rangeArgs) {
933
- const body = await client.get(`/projects/${encodeURIComponent(projectId)}/slots${rangeQuery(rangeArgs)}`);
934
- return regionsFrom(body);
937
+ var _a, _b;
938
+ const id = encodeURIComponent(projectId);
939
+ const [body, defs] = await Promise.all([
940
+ client.get(`/projects/${id}/slots${rangeQuery(rangeArgs)}`),
941
+ // Sources are a label: without them the arm-id rule still answers.
942
+ client.get(`/projects/${id}/slot-definitions`).catch(() => null)
943
+ ]);
944
+ const sources = /* @__PURE__ */ new Map();
945
+ for (const d of (_a = defs == null ? void 0 : defs.slots) != null ? _a : []) {
946
+ if (typeof d.slot_id !== "string") continue;
947
+ sources.set(d.slot_id, new Map(((_b = d.arms) != null ? _b : []).filter((a2) => typeof a2.id === "string" && typeof a2.source === "string").map((a2) => [a2.id, a2.source])));
948
+ }
949
+ return regionsFrom(body, sources);
935
950
  }
936
- var SOURCE_LABEL = { original: "original", code: "written in code", generated: "generated" };
951
+ var SOURCE_LABEL = { original: "original", code: "written in code", generated: "generated", written: "written by a person" };
937
952
  function regionText(r, untrusted2) {
938
953
  var _a;
939
954
  const head = `${untrusted2(r.componentId)} \u2014 region, ${r.versions.length} version${r.versions.length === 1 ? "" : "s"}` + (r.windowVisitors !== null ? ` \xB7 ${r.windowVisitors} People served in this window, ${(_a = r.windowConversions) != null ? _a : 0} converted` : "");
@@ -3975,7 +3990,7 @@ function registerCellTools(server, client) {
3975
3990
  "get_cell_matrix",
3976
3991
  {
3977
3992
  title: "Persona \xD7 slot cell matrix",
3978
- description: 'The "Who sees what" matrix: which visitor types (personas) have an AI-generated version live in each personalizable region (slot), with per-persona traffic share and the first-miss auto-fill setting. A cell with no row means that visitor type sees the original.' + UNTRUSTED_FIELDS_NOTE,
3993
+ description: 'The "Who sees what" matrix: which visitor types (personas) have an AI-generated version live in each personalizable region (slot), with per-persona traffic share and the first-miss auto-fill setting. A cell with no row means nothing has been written for that visitor type in that region \u2014 not that it sees only the original: a region can still be testing shared versions (an editor or dashboard alternative) on everyone, which list_components lists with their numbers.' + UNTRUSTED_FIELDS_NOTE,
3979
3994
  inputSchema: { projectId: projectIdSchema },
3980
3995
  outputSchema: {
3981
3996
  slots: z25.array(
@@ -4916,7 +4931,7 @@ Known people (get_known_people): a person is "known" once they have reached the
4916
4931
  Write tools change what real visitors see: confirm with the user first. Call get_agent_access before a manage_* write.`;
4917
4932
 
4918
4933
  // src/server.ts
4919
- var PKG_VERSION = true ? "0.28.0" : "0.0.0-dev";
4934
+ var PKG_VERSION = true ? "0.28.1" : "0.0.0-dev";
4920
4935
  function createMcpServer(client) {
4921
4936
  const server = new McpServer(
4922
4937
  {
package/dist/index.cjs CHANGED
@@ -874,7 +874,7 @@ var regionOutputSchema = import_v33.z.array(
874
874
  versions: import_v33.z.array(
875
875
  import_v33.z.object({
876
876
  versionId: import_v33.z.string().describe("The served arm id: baseline = the original, authored.<key> = a version written in code, anything else = generated or edited in the dashboard"),
877
- source: import_v33.z.enum(["original", "code", "generated"]),
877
+ source: import_v33.z.enum(["original", "code", "generated", "written"]).describe("written = by a person in the dashboard or the on-site editor"),
878
878
  timesShown: import_v33.z.number().describe("All-time times shown \u2014 the optimizer's own totals, NOT filtered by the requested window"),
879
879
  conversions: import_v33.z.number().describe("All-time conversions credited to this version (optimizer totals)"),
880
880
  conversionRate: import_v33.z.number().nullable().describe("conversions / timesShown; null at 0 shown"),
@@ -890,12 +890,16 @@ var regionOutputSchema = import_v33.z.array(
890
890
  )
891
891
  })
892
892
  ).describe("Regions: components served per visitor through Who sees what \u2014 versions written in code next to the original, or generated ones");
893
- function sourceOf(arm, baselineArm) {
893
+ function sourceOf(arm, baselineArm, known) {
894
+ if (known === "original" || known === "generated") return known;
895
+ if (known === "authored") return "code";
896
+ if (known === "manual") return "written";
897
+ if (known === "suggested") return "generated";
894
898
  if (arm === baselineArm) return "original";
895
899
  if (arm.startsWith("authored.")) return "code";
896
900
  return "generated";
897
901
  }
898
- function regionsFrom(body) {
902
+ function regionsFrom(body, sources) {
899
903
  var _a2, _b;
900
904
  const totals = new Map(((_a2 = body == null ? void 0 : body.window_totals) != null ? _a2 : []).map((t) => [t.slotId, t]));
901
905
  return ((_b = body == null ? void 0 : body.slots) != null ? _b : []).map((s) => {
@@ -903,16 +907,16 @@ function regionsFrom(body) {
903
907
  const baselineArm = (_a3 = s.baselineArm) != null ? _a3 : "baseline";
904
908
  const t = totals.get(s.slotId);
905
909
  const versions = ((_b2 = s.arms) != null ? _b2 : []).map((a2) => {
906
- var _a4, _b3, _c;
910
+ var _a4, _b3, _c, _d;
907
911
  const shown = (_a4 = a2.timesShown) != null ? _a4 : 0;
908
912
  const conv = (_b3 = a2.conversions) != null ? _b3 : 0;
909
913
  return {
910
914
  versionId: a2.arm,
911
- source: sourceOf(a2.arm, baselineArm),
915
+ source: sourceOf(a2.arm, baselineArm, (_c = sources == null ? void 0 : sources.get(s.slotId)) == null ? void 0 : _c.get(a2.arm)),
912
916
  timesShown: shown,
913
917
  conversions: conv,
914
918
  conversionRate: shown > 0 ? conv / shown : null,
915
- evidence: ((_c = a2.personas) != null ? _c : []).map((p) => {
919
+ evidence: ((_d = a2.personas) != null ? _d : []).map((p) => {
916
920
  var _a5, _b4, _c2;
917
921
  return {
918
922
  audience: (_a5 = p.personaDisplay) != null ? _a5 : p.persona,
@@ -923,7 +927,7 @@ function regionsFrom(body) {
923
927
  })
924
928
  };
925
929
  });
926
- const rank = { original: 0, code: 1, generated: 2 };
930
+ const rank = { original: 0, code: 1, written: 2, generated: 3 };
927
931
  versions.sort((x, y) => rank[x.source] - rank[y.source] || x.versionId.localeCompare(y.versionId));
928
932
  return {
929
933
  componentId: s.slotId,
@@ -934,10 +938,21 @@ function regionsFrom(body) {
934
938
  });
935
939
  }
936
940
  async function fetchRegions(client, projectId, rangeArgs) {
937
- const body = await client.get(`/projects/${encodeURIComponent(projectId)}/slots${rangeQuery(rangeArgs)}`);
938
- return regionsFrom(body);
941
+ var _a2, _b;
942
+ const id = encodeURIComponent(projectId);
943
+ const [body, defs] = await Promise.all([
944
+ client.get(`/projects/${id}/slots${rangeQuery(rangeArgs)}`),
945
+ // Sources are a label: without them the arm-id rule still answers.
946
+ client.get(`/projects/${id}/slot-definitions`).catch(() => null)
947
+ ]);
948
+ const sources = /* @__PURE__ */ new Map();
949
+ for (const d of (_a2 = defs == null ? void 0 : defs.slots) != null ? _a2 : []) {
950
+ if (typeof d.slot_id !== "string") continue;
951
+ sources.set(d.slot_id, new Map(((_b = d.arms) != null ? _b : []).filter((a2) => typeof a2.id === "string" && typeof a2.source === "string").map((a2) => [a2.id, a2.source])));
952
+ }
953
+ return regionsFrom(body, sources);
939
954
  }
940
- var SOURCE_LABEL = { original: "original", code: "written in code", generated: "generated" };
955
+ var SOURCE_LABEL = { original: "original", code: "written in code", generated: "generated", written: "written by a person" };
941
956
  function regionText(r, untrusted2) {
942
957
  var _a2;
943
958
  const head = `${untrusted2(r.componentId)} \u2014 region, ${r.versions.length} version${r.versions.length === 1 ? "" : "s"}` + (r.windowVisitors !== null ? ` \xB7 ${r.windowVisitors} People served in this window, ${(_a2 = r.windowConversions) != null ? _a2 : 0} converted` : "");
@@ -3979,7 +3994,7 @@ function registerCellTools(server, client) {
3979
3994
  "get_cell_matrix",
3980
3995
  {
3981
3996
  title: "Persona \xD7 slot cell matrix",
3982
- description: 'The "Who sees what" matrix: which visitor types (personas) have an AI-generated version live in each personalizable region (slot), with per-persona traffic share and the first-miss auto-fill setting. A cell with no row means that visitor type sees the original.' + UNTRUSTED_FIELDS_NOTE,
3997
+ description: 'The "Who sees what" matrix: which visitor types (personas) have an AI-generated version live in each personalizable region (slot), with per-persona traffic share and the first-miss auto-fill setting. A cell with no row means nothing has been written for that visitor type in that region \u2014 not that it sees only the original: a region can still be testing shared versions (an editor or dashboard alternative) on everyone, which list_components lists with their numbers.' + UNTRUSTED_FIELDS_NOTE,
3983
3998
  inputSchema: { projectId: projectIdSchema },
3984
3999
  outputSchema: {
3985
4000
  slots: import_v325.z.array(
@@ -4920,7 +4935,7 @@ Known people (get_known_people): a person is "known" once they have reached the
4920
4935
  Write tools change what real visitors see: confirm with the user first. Call get_agent_access before a manage_* write.`;
4921
4936
 
4922
4937
  // src/server.ts
4923
- var PKG_VERSION = true ? "0.28.0" : "0.0.0-dev";
4938
+ var PKG_VERSION = true ? "0.28.1" : "0.0.0-dev";
4924
4939
  function createMcpServer(client) {
4925
4940
  const server = new import_mcp.McpServer(
4926
4941
  {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ApiClient,
4
4
  createMcpServer
5
- } from "./chunk-Q7RW5Q4X.js";
5
+ } from "./chunk-45KNPF7X.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/dist/lib.cjs CHANGED
@@ -900,7 +900,7 @@ var regionOutputSchema = import_v33.z.array(
900
900
  versions: import_v33.z.array(
901
901
  import_v33.z.object({
902
902
  versionId: import_v33.z.string().describe("The served arm id: baseline = the original, authored.<key> = a version written in code, anything else = generated or edited in the dashboard"),
903
- source: import_v33.z.enum(["original", "code", "generated"]),
903
+ source: import_v33.z.enum(["original", "code", "generated", "written"]).describe("written = by a person in the dashboard or the on-site editor"),
904
904
  timesShown: import_v33.z.number().describe("All-time times shown \u2014 the optimizer's own totals, NOT filtered by the requested window"),
905
905
  conversions: import_v33.z.number().describe("All-time conversions credited to this version (optimizer totals)"),
906
906
  conversionRate: import_v33.z.number().nullable().describe("conversions / timesShown; null at 0 shown"),
@@ -916,12 +916,16 @@ var regionOutputSchema = import_v33.z.array(
916
916
  )
917
917
  })
918
918
  ).describe("Regions: components served per visitor through Who sees what \u2014 versions written in code next to the original, or generated ones");
919
- function sourceOf(arm, baselineArm) {
919
+ function sourceOf(arm, baselineArm, known) {
920
+ if (known === "original" || known === "generated") return known;
921
+ if (known === "authored") return "code";
922
+ if (known === "manual") return "written";
923
+ if (known === "suggested") return "generated";
920
924
  if (arm === baselineArm) return "original";
921
925
  if (arm.startsWith("authored.")) return "code";
922
926
  return "generated";
923
927
  }
924
- function regionsFrom(body) {
928
+ function regionsFrom(body, sources) {
925
929
  var _a, _b;
926
930
  const totals = new Map(((_a = body == null ? void 0 : body.window_totals) != null ? _a : []).map((t) => [t.slotId, t]));
927
931
  return ((_b = body == null ? void 0 : body.slots) != null ? _b : []).map((s) => {
@@ -929,16 +933,16 @@ function regionsFrom(body) {
929
933
  const baselineArm = (_a2 = s.baselineArm) != null ? _a2 : "baseline";
930
934
  const t = totals.get(s.slotId);
931
935
  const versions = ((_b2 = s.arms) != null ? _b2 : []).map((a2) => {
932
- var _a3, _b3, _c;
936
+ var _a3, _b3, _c, _d;
933
937
  const shown = (_a3 = a2.timesShown) != null ? _a3 : 0;
934
938
  const conv = (_b3 = a2.conversions) != null ? _b3 : 0;
935
939
  return {
936
940
  versionId: a2.arm,
937
- source: sourceOf(a2.arm, baselineArm),
941
+ source: sourceOf(a2.arm, baselineArm, (_c = sources == null ? void 0 : sources.get(s.slotId)) == null ? void 0 : _c.get(a2.arm)),
938
942
  timesShown: shown,
939
943
  conversions: conv,
940
944
  conversionRate: shown > 0 ? conv / shown : null,
941
- evidence: ((_c = a2.personas) != null ? _c : []).map((p) => {
945
+ evidence: ((_d = a2.personas) != null ? _d : []).map((p) => {
942
946
  var _a4, _b4, _c2;
943
947
  return {
944
948
  audience: (_a4 = p.personaDisplay) != null ? _a4 : p.persona,
@@ -949,7 +953,7 @@ function regionsFrom(body) {
949
953
  })
950
954
  };
951
955
  });
952
- const rank = { original: 0, code: 1, generated: 2 };
956
+ const rank = { original: 0, code: 1, written: 2, generated: 3 };
953
957
  versions.sort((x, y) => rank[x.source] - rank[y.source] || x.versionId.localeCompare(y.versionId));
954
958
  return {
955
959
  componentId: s.slotId,
@@ -960,10 +964,21 @@ function regionsFrom(body) {
960
964
  });
961
965
  }
962
966
  async function fetchRegions(client, projectId, rangeArgs) {
963
- const body = await client.get(`/projects/${encodeURIComponent(projectId)}/slots${rangeQuery(rangeArgs)}`);
964
- return regionsFrom(body);
967
+ var _a, _b;
968
+ const id = encodeURIComponent(projectId);
969
+ const [body, defs] = await Promise.all([
970
+ client.get(`/projects/${id}/slots${rangeQuery(rangeArgs)}`),
971
+ // Sources are a label: without them the arm-id rule still answers.
972
+ client.get(`/projects/${id}/slot-definitions`).catch(() => null)
973
+ ]);
974
+ const sources = /* @__PURE__ */ new Map();
975
+ for (const d of (_a = defs == null ? void 0 : defs.slots) != null ? _a : []) {
976
+ if (typeof d.slot_id !== "string") continue;
977
+ sources.set(d.slot_id, new Map(((_b = d.arms) != null ? _b : []).filter((a2) => typeof a2.id === "string" && typeof a2.source === "string").map((a2) => [a2.id, a2.source])));
978
+ }
979
+ return regionsFrom(body, sources);
965
980
  }
966
- var SOURCE_LABEL = { original: "original", code: "written in code", generated: "generated" };
981
+ var SOURCE_LABEL = { original: "original", code: "written in code", generated: "generated", written: "written by a person" };
967
982
  function regionText(r, untrusted2) {
968
983
  var _a;
969
984
  const head = `${untrusted2(r.componentId)} \u2014 region, ${r.versions.length} version${r.versions.length === 1 ? "" : "s"}` + (r.windowVisitors !== null ? ` \xB7 ${r.windowVisitors} People served in this window, ${(_a = r.windowConversions) != null ? _a : 0} converted` : "");
@@ -4005,7 +4020,7 @@ function registerCellTools(server, client) {
4005
4020
  "get_cell_matrix",
4006
4021
  {
4007
4022
  title: "Persona \xD7 slot cell matrix",
4008
- description: 'The "Who sees what" matrix: which visitor types (personas) have an AI-generated version live in each personalizable region (slot), with per-persona traffic share and the first-miss auto-fill setting. A cell with no row means that visitor type sees the original.' + UNTRUSTED_FIELDS_NOTE,
4023
+ description: 'The "Who sees what" matrix: which visitor types (personas) have an AI-generated version live in each personalizable region (slot), with per-persona traffic share and the first-miss auto-fill setting. A cell with no row means nothing has been written for that visitor type in that region \u2014 not that it sees only the original: a region can still be testing shared versions (an editor or dashboard alternative) on everyone, which list_components lists with their numbers.' + UNTRUSTED_FIELDS_NOTE,
4009
4024
  inputSchema: { projectId: projectIdSchema },
4010
4025
  outputSchema: {
4011
4026
  slots: import_v325.z.array(
@@ -4946,7 +4961,7 @@ Known people (get_known_people): a person is "known" once they have reached the
4946
4961
  Write tools change what real visitors see: confirm with the user first. Call get_agent_access before a manage_* write.`;
4947
4962
 
4948
4963
  // src/server.ts
4949
- var PKG_VERSION = true ? "0.28.0" : "0.0.0-dev";
4964
+ var PKG_VERSION = true ? "0.28.1" : "0.0.0-dev";
4950
4965
  function createMcpServer(client) {
4951
4966
  const server = new import_mcp.McpServer(
4952
4967
  {
package/dist/lib.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  ApiError,
5
5
  PUBLIC_UI_RESOURCE_URIS,
6
6
  createMcpServer
7
- } from "./chunk-Q7RW5Q4X.js";
7
+ } from "./chunk-45KNPF7X.js";
8
8
 
9
9
  // src/tool-catalog.ts
10
10
  var TOOL_CATALOG = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentientui/mcp",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
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",