@sentientui/mcp 0.29.2 → 0.30.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.
package/dist/index.cjs CHANGED
@@ -3947,44 +3947,96 @@ function registerInternalTrafficTools(server, client) {
3947
3947
  );
3948
3948
  }
3949
3949
 
3950
- // src/tools/cells.ts
3950
+ // src/tools/site-areas.ts
3951
3951
  var import_v325 = require("zod/v3");
3952
- var personaOutput = import_v325.z.object({
3953
- key: import_v325.z.string(),
3954
- displayName: import_v325.z.string(),
3955
- description: import_v325.z.string().nullable(),
3956
- share: import_v325.z.number().describe("Fraction of 30-day decided sessions"),
3952
+ var SIDE_WORDS = { before: "before sign-up", after: "after sign-up" };
3953
+ function registerSiteAreasTools(server, client) {
3954
+ server.registerTool(
3955
+ "get_site_areas",
3956
+ {
3957
+ title: "Site areas (before and after sign-up)",
3958
+ description: "Read which parts of the site are before sign-up (anonymous visitors; the main goal is to convert them: a sign-up, a sale, a form) and which are after sign-up (inside the product, where the site knows who its users are) \u2014 dashboard Settings \u2192 Site areas. Each area is an allowed site, optionally narrowed to a path; a page no area covers is before sign-up. A component gets versions only for audiences of its own side, and serving follows the same line: campaign, arrival and retargeting audiences are before sign-up; declared personas are after sign-up only (they are people already using the product, so they never count toward winning new ones); discovered groups wherever their visits happen. An empty list means the site is not split and nothing is restricted. Also lists every allowed site with how many visitors were signed in (30 days) and a suggested side. To change: manage_settings set_site_areas.",
3959
+ inputSchema: { projectId: projectIdSchema },
3960
+ outputSchema: {
3961
+ split: import_v325.z.boolean().describe("True once the project has split its site into before and after sign-up"),
3962
+ areas: import_v325.z.array(import_v325.z.object({ origin: import_v325.z.string(), path: import_v325.z.string().nullable(), side: import_v325.z.enum(["before", "after"]) })).describe("The areas, as saved"),
3963
+ sites: import_v325.z.array(
3964
+ import_v325.z.object({
3965
+ origin: import_v325.z.string(),
3966
+ internal: import_v325.z.boolean().describe("Marked internal (Settings \u2192 Internal traffic): its visits never count"),
3967
+ visits30d: import_v325.z.number(),
3968
+ signedIn30d: import_v325.z.number().describe("Visits where the site passed a user id"),
3969
+ suggested: import_v325.z.enum(["before", "after"]).nullable().describe("After when most visitors were signed in; null with too few visits")
3970
+ })
3971
+ ).describe("Every allowed site")
3972
+ },
3973
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
3974
+ },
3975
+ withApiErrorGuidance(async ({ projectId }) => {
3976
+ var _a2, _b;
3977
+ const r = await client.get(`/projects/${encodeURIComponent(projectId)}/site-areas`);
3978
+ const areas = (_a2 = r.areas) != null ? _a2 : [];
3979
+ const sites = (_b = r.sites) != null ? _b : [];
3980
+ const lines = areas.length === 0 ? ["The site is not split into before and after sign-up: nothing is restricted."] : [
3981
+ "Site areas (a page no area covers is before sign-up):",
3982
+ ...areas.map((a2) => {
3983
+ var _a3;
3984
+ return `- ${a2.origin}${(_a3 = a2.path) != null ? _a3 : ""}: ${SIDE_WORDS[a2.side]}`;
3985
+ })
3986
+ ];
3987
+ const suggestions = sites.filter((s) => !s.internal && s.suggested !== null);
3988
+ if (suggestions.length > 0) {
3989
+ lines.push(
3990
+ "Signed-in share, last 30 days:",
3991
+ ...suggestions.map((s) => `- ${s.origin}: ${s.signedIn30d} of ${s.visits30d} visits signed in \u2192 suggested ${SIDE_WORDS[s.suggested]}`)
3992
+ );
3993
+ }
3994
+ return {
3995
+ content: [{ type: "text", text: lines.join("\n") }],
3996
+ structuredContent: { split: areas.length > 0, areas, sites }
3997
+ };
3998
+ })
3999
+ );
4000
+ }
4001
+
4002
+ // src/tools/cells.ts
4003
+ var import_v326 = require("zod/v3");
4004
+ var personaOutput = import_v326.z.object({
4005
+ key: import_v326.z.string(),
4006
+ displayName: import_v326.z.string(),
4007
+ description: import_v326.z.string().nullable(),
4008
+ share: import_v326.z.number().describe("Fraction of 30-day decided sessions"),
3957
4009
  // Both ride the API response; without them zod stripped them and an agent
3958
4010
  // reported a declared audience nothing declares as reachable.
3959
- state: import_v325.z.string().optional().describe("everyone | declared | unlocked | candidate | starter \u2014 why the row exists"),
3960
- declaredVisits14d: import_v325.z.number().nullable().optional().describe(
4011
+ state: import_v326.z.string().optional().describe("everyone | declared | unlocked | candidate | starter \u2014 why the row exists"),
4012
+ declaredVisits14d: import_v326.z.number().nullable().optional().describe(
3961
4013
  "Declared rows only: visits in 14 days whose site declared this persona. 0 = not declared yet \u2014 nobody sees versions written for it until the site sends it."
3962
4014
  )
3963
4015
  });
3964
- var blockedOutput = import_v325.z.enum(["variant_history"]).nullable().optional().describe(
4016
+ var blockedOutput = import_v326.z.enum(["variant_history"]).nullable().optional().describe(
3965
4017
  "variant_history: the component's code still runs its own variants test, so versions written here are approved but NOT showing until it is migrated (dashboard Components \u2192 Migrate; automatic once that test has assigned nobody a version for 14 days). Null when the column can serve."
3966
4018
  );
3967
4019
  var BLOCKED_LINE = "Not showing yet \u2014 your code's own test still runs here. Versions written for this part of the page are approved but no visitor sees them until it is migrated (Components \u2192 this component \u2192 Migrate) \u2014 Sentient does it by itself once that test has shown nobody a version for 14 days.";
3968
4020
  var NOT_DECLARED_LINE = "not declared yet \u2014 your site has not told us anyone is this persona in 14 days, so nobody sees versions written for them until your code sends it (the persona prop, init({ persona }) or window.sentient.persona)";
3969
- var cellOutput = import_v325.z.object({
3970
- slotId: import_v325.z.string(),
3971
- persona: import_v325.z.string(),
3972
- status: import_v325.z.string().describe("pending | generating | review (waiting for approval) | live | error | rejected"),
3973
- requestedBy: import_v325.z.string(),
3974
- armId: import_v325.z.string().nullable(),
3975
- rationale: import_v325.z.string().nullable(),
3976
- error: import_v325.z.string().nullable(),
3977
- updatedAt: import_v325.z.string(),
4021
+ var cellOutput = import_v326.z.object({
4022
+ slotId: import_v326.z.string(),
4023
+ persona: import_v326.z.string(),
4024
+ status: import_v326.z.string().describe("pending | generating | review (waiting for approval) | live | error | rejected"),
4025
+ requestedBy: import_v326.z.string(),
4026
+ armId: import_v326.z.string().nullable(),
4027
+ rationale: import_v326.z.string().nullable(),
4028
+ error: import_v326.z.string().nullable(),
4029
+ updatedAt: import_v326.z.string(),
3978
4030
  // These ride the API response too; omitting them from the schema made zod
3979
4031
  // STRIP them, so agents could never see refinement or retry state.
3980
- refinedFrom: import_v325.z.string().nullable().optional().describe("Incumbent arm this cell is improving on \u2014 a pending cell with this set still SERVES the incumbent"),
3981
- notBefore: import_v325.z.string().nullable().optional().describe("ISO time the queue will next consider this cell (retry backoff / daily-cap deferral); null when due now"),
3982
- attempts: import_v325.z.number().optional().describe("Generation attempts so far"),
3983
- performance: import_v325.z.object({
3984
- shown: import_v325.z.number(),
3985
- conversions: import_v325.z.number(),
3986
- deltaPct: import_v325.z.number().nullable().describe("Signed % vs the original conversion rate \u2014 a point estimate; only meaningful beside a winning/losing tier"),
3987
- tier: import_v325.z.string().describe(
4032
+ refinedFrom: import_v326.z.string().nullable().optional().describe("Incumbent arm this cell is improving on \u2014 a pending cell with this set still SERVES the incumbent"),
4033
+ notBefore: import_v326.z.string().nullable().optional().describe("ISO time the queue will next consider this cell (retry backoff / daily-cap deferral); null when due now"),
4034
+ attempts: import_v326.z.number().optional().describe("Generation attempts so far"),
4035
+ performance: import_v326.z.object({
4036
+ shown: import_v326.z.number(),
4037
+ conversions: import_v326.z.number(),
4038
+ deltaPct: import_v326.z.number().nullable().describe("Signed % vs the original conversion rate \u2014 a point estimate; only meaningful beside a winning/losing tier"),
4039
+ tier: import_v326.z.string().describe(
3988
4040
  'early | no_baseline (under 100 views) | winning | losing (posterior separated from the original, corrected across the slot column) | flat (NOT separated yet \u2014 not "equal")'
3989
4041
  )
3990
4042
  }).optional().describe("Present on live cells (and, mid-refinement, the incumbent arm): the at-a-glance readout")
@@ -3997,29 +4049,29 @@ function registerCellTools(server, client) {
3997
4049
  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,
3998
4050
  inputSchema: { projectId: projectIdSchema },
3999
4051
  outputSchema: {
4000
- slots: import_v325.z.array(
4001
- import_v325.z.object({
4002
- slotId: import_v325.z.string(),
4003
- displayName: import_v325.z.string(),
4004
- supportsForms: import_v325.z.boolean(),
4052
+ slots: import_v326.z.array(
4053
+ import_v326.z.object({
4054
+ slotId: import_v326.z.string(),
4055
+ displayName: import_v326.z.string(),
4056
+ supportsForms: import_v326.z.boolean(),
4005
4057
  // API sends this; without it zod stripped the draft-vs-live signal.
4006
- live: import_v325.z.boolean().optional().describe("False for an sdk-registered draft column \u2014 nothing serves until its first generation publishes it"),
4058
+ live: import_v326.z.boolean().optional().describe("False for an sdk-registered draft column \u2014 nothing serves until its first generation publishes it"),
4007
4059
  blocked: blockedOutput
4008
4060
  })
4009
4061
  ),
4010
- personas: import_v325.z.array(personaOutput),
4011
- cells: import_v325.z.array(cellOutput),
4012
- autoFill: import_v325.z.boolean(),
4062
+ personas: import_v326.z.array(personaOutput),
4063
+ cells: import_v326.z.array(cellOutput),
4064
+ autoFill: import_v326.z.boolean(),
4013
4065
  // The API has always sent this; without it in the schema zod stripped
4014
4066
  // it, and generate_cell had no way to know a version would wait for a
4015
4067
  // human instead of publishing.
4016
- reviewMode: import_v325.z.boolean().optional().describe("True when generated versions wait for approval (review_cell) instead of publishing automatically"),
4068
+ reviewMode: import_v326.z.boolean().optional().describe("True when generated versions wait for approval (review_cell) instead of publishing automatically"),
4017
4069
  // Nullable: a project with no persona set at all reports null, not a
4018
4070
  // string. That is the NORMAL state since the default vocabulary was
4019
4071
  // emptied, so a non-nullable schema failed output validation on most
4020
4072
  // projects and the tool returned nothing but a zod error.
4021
- personaSource: import_v325.z.string().nullable().describe('Active persona-set source: default | declared | discovered, or null when the project has no persona set (one "everyone" row)'),
4022
- undecidedShare: import_v325.z.number()
4073
+ personaSource: import_v326.z.string().nullable().describe('Active persona-set source: default | declared | discovered, or null when the project has no persona set (one "everyone" row)'),
4074
+ undecidedShare: import_v326.z.number()
4023
4075
  },
4024
4076
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
4025
4077
  },
@@ -4064,26 +4116,26 @@ function registerCellTools(server, client) {
4064
4116
  description: "One cell's full story: the generated option a visitor type sees in a slot, why it was written (the stored generation rationale), and how it is performing vs the original (deterministic plain-language verdict)." + UNTRUSTED_FIELDS_NOTE,
4065
4117
  inputSchema: {
4066
4118
  projectId: projectIdSchema,
4067
- slotId: import_v325.z.string().min(1).max(128).describe("The slot id (a matrix column)"),
4068
- persona: import_v325.z.string().min(1).max(64).describe("The persona key (a matrix row)")
4119
+ slotId: import_v326.z.string().min(1).max(128).describe("The slot id (a matrix column)"),
4120
+ persona: import_v326.z.string().min(1).max(64).describe("The persona key (a matrix row)")
4069
4121
  },
4070
4122
  outputSchema: {
4071
4123
  cell: cellOutput.nullable(),
4072
- arm: import_v325.z.object({
4073
- id: import_v325.z.string(),
4074
- displayName: import_v325.z.string().nullable(),
4075
- content: import_v325.z.string().nullable(),
4076
- blocks: import_v325.z.unknown().nullable()
4124
+ arm: import_v326.z.object({
4125
+ id: import_v326.z.string(),
4126
+ displayName: import_v326.z.string().nullable(),
4127
+ content: import_v326.z.string().nullable(),
4128
+ blocks: import_v326.z.unknown().nullable()
4077
4129
  }).nullable(),
4078
- performance: import_v325.z.object({
4079
- shown: import_v325.z.number(),
4080
- conversions: import_v325.z.number(),
4081
- conversionRate: import_v325.z.number(),
4082
- baselineShown: import_v325.z.number(),
4083
- baselineConversions: import_v325.z.number(),
4084
- baselineConversionRate: import_v325.z.number()
4130
+ performance: import_v326.z.object({
4131
+ shown: import_v326.z.number(),
4132
+ conversions: import_v326.z.number(),
4133
+ conversionRate: import_v326.z.number(),
4134
+ baselineShown: import_v326.z.number(),
4135
+ baselineConversions: import_v326.z.number(),
4136
+ baselineConversionRate: import_v326.z.number()
4085
4137
  }).nullable(),
4086
- verdict: import_v325.z.string(),
4138
+ verdict: import_v326.z.string(),
4087
4139
  blocked: blockedOutput
4088
4140
  },
4089
4141
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
@@ -4134,14 +4186,14 @@ function registerCellTools(server, client) {
4134
4186
  description: "Queue AI generation of a version for one (persona, slot) cell; the worker writes it asynchronously, brand-locked. If the project has review mode on, the finished version WAITS for approval (list_cell_reviews / review_cell) and serves nobody until approved; otherwise it publishes automatically as a named option the optimizer explores. Also regenerates or retries a failed cell. Generation volume is capped per plan (Free included). Check get_cell_matrix for progress. Confirm with the user before calling \u2014 each generation is a model call against the plan quota.",
4135
4187
  inputSchema: {
4136
4188
  projectId: projectIdSchema,
4137
- slotId: import_v325.z.string().min(1).max(128).describe("The slot id (a matrix column)"),
4138
- persona: import_v325.z.string().min(1).max(64).describe("The persona key (a matrix row)")
4189
+ slotId: import_v326.z.string().min(1).max(128).describe("The slot id (a matrix column)"),
4190
+ persona: import_v326.z.string().min(1).max(64).describe("The persona key (a matrix row)")
4139
4191
  },
4140
4192
  outputSchema: {
4141
- slotId: import_v325.z.string(),
4142
- persona: import_v325.z.string(),
4143
- status: import_v325.z.literal("pending").describe("Queued \u2014 check get_cell_matrix for progress"),
4144
- reviewMode: import_v325.z.boolean().nullable().describe("True: the version will wait for review_cell approval. False: it publishes automatically. Null: could not be read.")
4193
+ slotId: import_v326.z.string(),
4194
+ persona: import_v326.z.string(),
4195
+ status: import_v326.z.literal("pending").describe("Queued \u2014 check get_cell_matrix for progress"),
4196
+ reviewMode: import_v326.z.boolean().nullable().describe("True: the version will wait for review_cell approval. False: it publishes automatically. Null: could not be read.")
4145
4197
  },
4146
4198
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false }
4147
4199
  },
@@ -4169,20 +4221,20 @@ function registerCellTools(server, client) {
4169
4221
  description: "Generated versions waiting for approval (review mode): which slot and visitor type, the proposed text or layout, and why it was written. Approve or reject each with review_cell after the user decides." + UNTRUSTED_FIELDS_NOTE,
4170
4222
  inputSchema: { projectId: projectIdSchema },
4171
4223
  outputSchema: {
4172
- reviews: import_v325.z.array(
4173
- import_v325.z.object({
4174
- slotId: import_v325.z.string(),
4175
- slotName: import_v325.z.string(),
4176
- persona: import_v325.z.string(),
4177
- personaDisplay: import_v325.z.string(),
4178
- content: import_v325.z.string().nullable().describe("Proposed text, when the version is text (null for a block/layout version)"),
4179
- rationale: import_v325.z.string().nullable(),
4180
- refinedFrom: import_v325.z.string().nullable().describe("Live version this one would replace; that version keeps serving until approval"),
4181
- updatedAt: import_v325.z.string(),
4224
+ reviews: import_v326.z.array(
4225
+ import_v326.z.object({
4226
+ slotId: import_v326.z.string(),
4227
+ slotName: import_v326.z.string(),
4228
+ persona: import_v326.z.string(),
4229
+ personaDisplay: import_v326.z.string(),
4230
+ content: import_v326.z.string().nullable().describe("Proposed text, when the version is text (null for a block/layout version)"),
4231
+ rationale: import_v326.z.string().nullable(),
4232
+ refinedFrom: import_v326.z.string().nullable().describe("Live version this one would replace; that version keeps serving until approval"),
4233
+ updatedAt: import_v326.z.string(),
4182
4234
  blocked: blockedOutput
4183
4235
  })
4184
4236
  ),
4185
- total: import_v325.z.number().int().describe("How many versions are waiting in all. The list holds at most the oldest 200; decide those to see the rest.")
4237
+ total: import_v326.z.number().int().describe("How many versions are waiting in all. The list holds at most the oldest 200; decide those to see the rest.")
4186
4238
  },
4187
4239
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
4188
4240
  },
@@ -4234,17 +4286,17 @@ function registerCellTools(server, client) {
4234
4286
  description: "Approve or reject ONE generated version waiting for review (see list_cell_reviews). 'approve' publishes it to live visitors of that type; 'reject' discards it (a rejected refinement leaves the current live version in place). This is the human decision review mode exists for \u2014 only call it with the user's explicit go-ahead.",
4235
4287
  inputSchema: {
4236
4288
  projectId: projectIdSchema,
4237
- slotId: import_v325.z.string().min(1).max(128).describe("The slot id of the version under review"),
4238
- persona: import_v325.z.string().min(1).max(64).describe("The persona key of the version under review"),
4239
- action: import_v325.z.enum(["approve", "reject"]),
4240
- feedback: import_v325.z.string().max(2e3).optional().describe("On reject: what was wrong, in the user's words. The next version written for that square is told to address it.")
4289
+ slotId: import_v326.z.string().min(1).max(128).describe("The slot id of the version under review"),
4290
+ persona: import_v326.z.string().min(1).max(64).describe("The persona key of the version under review"),
4291
+ action: import_v326.z.enum(["approve", "reject"]),
4292
+ feedback: import_v326.z.string().max(2e3).optional().describe("On reject: what was wrong, in the user's words. The next version written for that square is told to address it.")
4241
4293
  },
4242
4294
  outputSchema: {
4243
- slotId: import_v325.z.string(),
4244
- persona: import_v325.z.string(),
4245
- action: import_v325.z.enum(["approve", "reject"]),
4246
- status: import_v325.z.string().describe("live (approved, or a rejected refinement whose incumbent keeps serving) | rejected"),
4247
- armId: import_v325.z.string().nullable().describe("The published option id, on approval"),
4295
+ slotId: import_v326.z.string(),
4296
+ persona: import_v326.z.string(),
4297
+ action: import_v326.z.enum(["approve", "reject"]),
4298
+ status: import_v326.z.string().describe("live (approved, or a rejected refinement whose incumbent keeps serving) | rejected"),
4299
+ armId: import_v326.z.string().nullable().describe("The published option id, on approval"),
4248
4300
  blocked: blockedOutput
4249
4301
  },
4250
4302
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false }
@@ -4273,7 +4325,7 @@ function registerCellTools(server, client) {
4273
4325
  }
4274
4326
 
4275
4327
  // src/tools/agent-reads.ts
4276
- var import_v326 = require("zod/v3");
4328
+ var import_v327 = require("zod/v3");
4277
4329
  var READ_ONLY = { readOnlyHint: true, idempotentHint: true, openWorldHint: false };
4278
4330
  var AREA_NAMES = {
4279
4331
  generate: "Generate",
@@ -4325,15 +4377,15 @@ function registerAgentReadTools(server, client) {
4325
4377
  description: "See which areas of this project a person has allowed agents to change: Generate, Approve and publish, Run tests, Goals and funnels, Campaigns and audiences, Project settings. Reading is always allowed; this tells you what a write tool will be refused for before you try it. Agents cannot change these switches \u2014 only a person can, in Settings \u2192 Agent access.",
4326
4378
  inputSchema: { projectId: projectIdSchema },
4327
4379
  outputSchema: {
4328
- areas: import_v326.z.object({
4329
- generate: import_v326.z.boolean(),
4330
- approve: import_v326.z.boolean(),
4331
- tests: import_v326.z.boolean(),
4332
- goals: import_v326.z.boolean(),
4333
- campaigns: import_v326.z.boolean(),
4334
- settings: import_v326.z.boolean()
4380
+ areas: import_v327.z.object({
4381
+ generate: import_v327.z.boolean(),
4382
+ approve: import_v327.z.boolean(),
4383
+ tests: import_v327.z.boolean(),
4384
+ goals: import_v327.z.boolean(),
4385
+ campaigns: import_v327.z.boolean(),
4386
+ settings: import_v327.z.boolean()
4335
4387
  }).describe("true = agents may act in this area"),
4336
- canEdit: import_v326.z.boolean().describe("Whether THIS credential could change the switches (always false for an agent)")
4388
+ canEdit: import_v327.z.boolean().describe("Whether THIS credential could change the switches (always false for an agent)")
4337
4389
  },
4338
4390
  annotations: READ_ONLY
4339
4391
  },
@@ -4360,35 +4412,35 @@ function registerAgentReadTools(server, client) {
4360
4412
  description: "List this project's named campaigns, their retargeting groups, and the campaigns seen in traffic. Pass campaignId to get one campaign's card instead: clicks, new people, how many came back, conversions per version, and the control group (visitors held back on the original site). Counts only \u2014 no lift is claimed." + UNTRUSTED_FIELDS_NOTE,
4361
4413
  inputSchema: __spreadValues({
4362
4414
  projectId: projectIdSchema,
4363
- campaignId: import_v326.z.string().optional().describe("A campaign id from this tool's list; returns that campaign's card")
4415
+ campaignId: import_v327.z.string().optional().describe("A campaign id from this tool's list; returns that campaign's card")
4364
4416
  }, rangeInputSchema("30d")),
4365
4417
  outputSchema: {
4366
- campaigns: import_v326.z.array(import_v326.z.object({
4367
- id: import_v326.z.string(),
4368
- name: import_v326.z.string(),
4369
- status: import_v326.z.string().nullable(),
4370
- arrivalType: import_v326.z.string().nullable(),
4371
- landingPaths: import_v326.z.array(import_v326.z.string())
4418
+ campaigns: import_v327.z.array(import_v327.z.object({
4419
+ id: import_v327.z.string(),
4420
+ name: import_v327.z.string(),
4421
+ status: import_v327.z.string().nullable(),
4422
+ arrivalType: import_v327.z.string().nullable(),
4423
+ landingPaths: import_v327.z.array(import_v327.z.string())
4372
4424
  })).optional(),
4373
- retargeting: import_v326.z.array(import_v326.z.object({
4374
- groupId: import_v326.z.string(),
4375
- campaignId: import_v326.z.string().nullable(),
4376
- name: import_v326.z.string(),
4377
- status: import_v326.z.string().nullable(),
4378
- endsAt: import_v326.z.string().nullable(),
4379
- memberCount: import_v326.z.number()
4425
+ retargeting: import_v327.z.array(import_v327.z.object({
4426
+ groupId: import_v327.z.string(),
4427
+ campaignId: import_v327.z.string().nullable(),
4428
+ name: import_v327.z.string(),
4429
+ status: import_v327.z.string().nullable(),
4430
+ endsAt: import_v327.z.string().nullable(),
4431
+ memberCount: import_v327.z.number()
4380
4432
  })).optional(),
4381
- observed: import_v326.z.array(import_v326.z.object({ campaign: import_v326.z.string(), sessions: import_v326.z.number(), channel: import_v326.z.string().nullable() })).optional(),
4382
- card: import_v326.z.object({
4383
- campaignId: import_v326.z.string(),
4384
- name: import_v326.z.string(),
4385
- status: import_v326.z.string().nullable(),
4386
- clicks: import_v326.z.number(),
4387
- people: import_v326.z.number().describe("New people served as the campaign"),
4388
- cameBack: import_v326.z.number(),
4389
- controlGroup: import_v326.z.number().describe("Matched visits held back on the original site"),
4390
- versions: import_v326.z.array(import_v326.z.object({ label: import_v326.z.string(), shown: import_v326.z.number(), conversions: import_v326.z.number() })).describe("Per section and version; one visitor can appear in several rows, so do not add them up"),
4391
- retargetingGroupId: import_v326.z.string().nullable()
4433
+ observed: import_v327.z.array(import_v327.z.object({ campaign: import_v327.z.string(), sessions: import_v327.z.number(), channel: import_v327.z.string().nullable() })).optional(),
4434
+ card: import_v327.z.object({
4435
+ campaignId: import_v327.z.string(),
4436
+ name: import_v327.z.string(),
4437
+ status: import_v327.z.string().nullable(),
4438
+ clicks: import_v327.z.number(),
4439
+ people: import_v327.z.number().describe("New people served as the campaign"),
4440
+ cameBack: import_v327.z.number(),
4441
+ controlGroup: import_v327.z.number().describe("Matched visits held back on the original site"),
4442
+ versions: import_v327.z.array(import_v327.z.object({ label: import_v327.z.string(), shown: import_v327.z.number(), conversions: import_v327.z.number() })).describe("Per section and version; one visitor can appear in several rows, so do not add them up"),
4443
+ retargetingGroupId: import_v327.z.string().nullable()
4392
4444
  }).optional().describe("Only when campaignId was given")
4393
4445
  },
4394
4446
  annotations: READ_ONLY
@@ -4471,17 +4523,17 @@ function registerAgentReadTools(server, client) {
4471
4523
  {
4472
4524
  title: "Retargeting report",
4473
4525
  description: "One retargeting group's numbers: how many people it started with, how many came back, clicks and conversions. These are counts, not lift. Get the group id from list_campaigns." + UNTRUSTED_FIELDS_NOTE,
4474
- inputSchema: { projectId: projectIdSchema, groupId: import_v326.z.string().describe("A retargeting group id from list_campaigns") },
4526
+ inputSchema: { projectId: projectIdSchema, groupId: import_v327.z.string().describe("A retargeting group id from list_campaigns") },
4475
4527
  outputSchema: {
4476
- groupId: import_v326.z.string(),
4477
- name: import_v326.z.string(),
4478
- status: import_v326.z.string().nullable(),
4479
- endsAt: import_v326.z.string().nullable(),
4480
- members: import_v326.z.number(),
4481
- cameBack: import_v326.z.number(),
4482
- converted: import_v326.z.number(),
4483
- clicks: import_v326.z.number(),
4484
- versions: import_v326.z.array(import_v326.z.object({ label: import_v326.z.string(), shown: import_v326.z.number(), conversions: import_v326.z.number() }))
4528
+ groupId: import_v327.z.string(),
4529
+ name: import_v327.z.string(),
4530
+ status: import_v327.z.string().nullable(),
4531
+ endsAt: import_v327.z.string().nullable(),
4532
+ members: import_v327.z.number(),
4533
+ cameBack: import_v327.z.number(),
4534
+ converted: import_v327.z.number(),
4535
+ clicks: import_v327.z.number(),
4536
+ versions: import_v327.z.array(import_v327.z.object({ label: import_v327.z.string(), shown: import_v327.z.number(), conversions: import_v327.z.number() }))
4485
4537
  },
4486
4538
  annotations: READ_ONLY
4487
4539
  },
@@ -4518,20 +4570,20 @@ function registerAgentReadTools(server, client) {
4518
4570
  description: "The audiences visitors are sorted into: the ones the site declares, the ones discovered from behaviour (with how many sessions, their share of traffic, and how much evidence there is), and whether the discovered set can be promoted to serving yet, with what is blocking it in plain words." + UNTRUSTED_FIELDS_NOTE,
4519
4571
  inputSchema: { projectId: projectIdSchema },
4520
4572
  outputSchema: {
4521
- declared: import_v326.z.object({
4522
- source: import_v326.z.string().nullable(),
4523
- members: import_v326.z.array(import_v326.z.object({ key: import_v326.z.string(), displayName: import_v326.z.string(), status: import_v326.z.string().nullable() }))
4573
+ declared: import_v327.z.object({
4574
+ source: import_v327.z.string().nullable(),
4575
+ members: import_v327.z.array(import_v327.z.object({ key: import_v327.z.string(), displayName: import_v327.z.string(), status: import_v327.z.string().nullable() }))
4524
4576
  }).nullable(),
4525
- discovered: import_v326.z.object({
4526
- members: import_v326.z.array(import_v326.z.object({
4527
- key: import_v326.z.string(),
4528
- displayName: import_v326.z.string(),
4529
- sessions: import_v326.z.number().nullable(),
4530
- share: import_v326.z.number().nullable(),
4531
- evidence: import_v326.z.string().describe("strong_evidence | moderate_evidence | no_clear_difference | not_enough_data | not_checked_yet")
4577
+ discovered: import_v327.z.object({
4578
+ members: import_v327.z.array(import_v327.z.object({
4579
+ key: import_v327.z.string(),
4580
+ displayName: import_v327.z.string(),
4581
+ sessions: import_v327.z.number().nullable(),
4582
+ share: import_v327.z.number().nullable(),
4583
+ evidence: import_v327.z.string().describe("strong_evidence | moderate_evidence | no_clear_difference | not_enough_data | not_checked_yet")
4532
4584
  }))
4533
4585
  }).nullable().describe("null when no discovered set exists yet"),
4534
- promotion: import_v326.z.object({ eligible: import_v326.z.boolean(), blockers: import_v326.z.array(import_v326.z.string()) }).nullable()
4586
+ promotion: import_v327.z.object({ eligible: import_v327.z.boolean(), blockers: import_v327.z.array(import_v327.z.string()) }).nullable()
4535
4587
  },
4536
4588
  annotations: READ_ONLY
4537
4589
  },
@@ -4597,18 +4649,18 @@ function registerAgentReadTools(server, client) {
4597
4649
  description: "The styles captured from the site (what generated sections borrow), grouped by role, whether their colors were actually measured, when the scan last ran, and the site audit score. Without measured colors a style cannot be checked for readable contrast." + UNTRUSTED_FIELDS_NOTE,
4598
4650
  inputSchema: { projectId: projectIdSchema },
4599
4651
  outputSchema: {
4600
- colorsMeasured: import_v326.z.boolean().describe("false when no captured style has a measured text or background color"),
4601
- roles: import_v326.z.array(import_v326.z.object({
4602
- role: import_v326.z.string(),
4603
- count: import_v326.z.number(),
4604
- measuredColors: import_v326.z.number().describe("How many of these styles have a measured color")
4652
+ colorsMeasured: import_v327.z.boolean().describe("false when no captured style has a measured text or background color"),
4653
+ roles: import_v327.z.array(import_v327.z.object({
4654
+ role: import_v327.z.string(),
4655
+ count: import_v327.z.number(),
4656
+ measuredColors: import_v327.z.number().describe("How many of these styles have a measured color")
4605
4657
  })),
4606
- lastScan: import_v326.z.object({ editorAt: import_v326.z.string().nullable(), crawlAt: import_v326.z.string().nullable() }),
4607
- audit: import_v326.z.object({
4608
- status: import_v326.z.string().nullable(),
4609
- score: import_v326.z.number().nullable(),
4610
- auditedAt: import_v326.z.string().nullable(),
4611
- checking: import_v326.z.boolean()
4658
+ lastScan: import_v327.z.object({ editorAt: import_v327.z.string().nullable(), crawlAt: import_v327.z.string().nullable() }),
4659
+ audit: import_v327.z.object({
4660
+ status: import_v327.z.string().nullable(),
4661
+ score: import_v327.z.number().nullable(),
4662
+ auditedAt: import_v327.z.string().nullable(),
4663
+ checking: import_v327.z.boolean()
4612
4664
  }).nullable().describe("null when the audit could not be read")
4613
4665
  },
4614
4666
  annotations: READ_ONLY
@@ -4664,13 +4716,13 @@ function registerAgentReadTools(server, client) {
4664
4716
  {
4665
4717
  title: "Region history",
4666
4718
  description: "A region's published versions over time (newest first, which one is live) and whether the region is still found on the live page. Get the region id from list_components." + UNTRUSTED_FIELDS_NOTE,
4667
- inputSchema: { projectId: projectIdSchema, regionId: import_v326.z.string().describe("The region's id (the slot id shown by list_components)") },
4719
+ inputSchema: { projectId: projectIdSchema, regionId: import_v327.z.string().describe("The region's id (the slot id shown by list_components)") },
4668
4720
  outputSchema: {
4669
- regionId: import_v326.z.string(),
4670
- currentVersion: import_v326.z.number(),
4671
- versions: import_v326.z.array(import_v326.z.object({ version: import_v326.z.number(), publishedAt: import_v326.z.string().nullable(), isCurrent: import_v326.z.boolean() })),
4672
- recentDecisions: import_v326.z.array(import_v326.z.object({ action: import_v326.z.string(), at: import_v326.z.string().nullable() })),
4673
- drift: import_v326.z.object({ verdict: import_v326.z.string(), message: import_v326.z.string(), checkedUrl: import_v326.z.string().nullable() }).nullable().describe("Whether the region is still found on the live page; null when the check could not run")
4721
+ regionId: import_v327.z.string(),
4722
+ currentVersion: import_v327.z.number(),
4723
+ versions: import_v327.z.array(import_v327.z.object({ version: import_v327.z.number(), publishedAt: import_v327.z.string().nullable(), isCurrent: import_v327.z.boolean() })),
4724
+ recentDecisions: import_v327.z.array(import_v327.z.object({ action: import_v327.z.string(), at: import_v327.z.string().nullable() })),
4725
+ drift: import_v327.z.object({ verdict: import_v327.z.string(), message: import_v327.z.string(), checkedUrl: import_v327.z.string().nullable() }).nullable().describe("Whether the region is still found on the live page; null when the check could not run")
4674
4726
  },
4675
4727
  annotations: READ_ONLY
4676
4728
  },
@@ -4704,7 +4756,7 @@ function registerAgentReadTools(server, client) {
4704
4756
  }
4705
4757
 
4706
4758
  // src/tools/manage.ts
4707
- var import_v327 = require("zod/v3");
4759
+ var import_v328 = require("zod/v3");
4708
4760
  var a = (method, route, extra = {}) => __spreadValues({ method, route }, extra);
4709
4761
  var ACTIONS = {
4710
4762
  manage_generation: {
@@ -4813,7 +4865,9 @@ var ACTIONS = {
4813
4865
  // the only thing in the way of "keep our staging site out of the numbers".
4814
4866
  set_internal_sites: a("PUT", "internal-traffic/origins", { body: "req" }),
4815
4867
  add_internal_email: a("POST", "internal-traffic/emails", { body: "req" }),
4816
- remove_internal_email: a("DELETE", "internal-traffic/emails", { body: "req" })
4868
+ remove_internal_email: a("DELETE", "internal-traffic/emails", { body: "req" }),
4869
+ // Which parts of the site are before and after sign-up (2026-11-21).
4870
+ set_site_areas: a("PUT", "site-areas", { body: "req" })
4817
4871
  }
4818
4872
  };
4819
4873
  var REFUSAL_NOTE = " If this project has turned off agent access for this area, the call is refused with a sentence saying so \u2014 tell the user, don't retry.";
@@ -4841,12 +4895,12 @@ var TOOLS = {
4841
4895
  manage_campaigns: {
4842
4896
  title: "Manage campaigns and audiences",
4843
4897
  destructive: true,
4844
- description: "Manage campaigns, retargeting and audiences: create, update or tag campaigns, start retargeting and change its group, declare or edit audiences, promote or roll back the discovered audiences, promote labels, and set the shopping-stage settings, search categories and stage serving. Promote and roll back change who sees what. Pick one `action`; pass the ids it needs." + REFUSAL_NOTE
4898
+ description: "Manage campaigns, retargeting and audiences: create, update or tag campaigns, start retargeting and change its group, declare or edit audiences, promote or roll back the discovered audiences, promote labels, and set the shopping-stage settings, search categories and stage serving. Promote and roll back change who sees what. A declared audience is after sign-up only (see get_site_areas). Pick one `action`; pass the ids it needs." + REFUSAL_NOTE
4845
4899
  },
4846
4900
  manage_settings: {
4847
4901
  title: "Manage project settings",
4848
4902
  destructive: true,
4849
- description: 'Change project settings: rename or edit the project, remove an allowed origin, add, remove or test a webhook, remove a captured style, rescan the site, set page meaning, create, refresh or remove a report share link, set previews and the layout and slot models, send a test event, and accept, dismiss or save a structured insight. Also who counts as already converted: set_gate_settings (body { identifiedIsConverted: boolean } \u2014 true only when reaching the main goal is what creates the account, i.e. the main goal is sign-up; not available on stores) and import_known_people (body { people: [{ userId, convertedAt?, converted?, orderCount?, totalSpent?, currency?, lastOrderAt?, customerSince?, tags? }] }, at most 2000 per call \u2014 the site\'s own user ids for people who already reached the main goal; never names, emails, phone numbers or addresses, which are refused). Who counts as your team or a test site (Settings \u2192 Internal traffic; read the rules first with get_internal_traffic_rules): set_internal_sites (body { origins: [...] } \u2014 the WHOLE list of internal sites, each one already an allowed origin; an origin left out stops being internal), add_internal_email (body { value } \u2014 a team email domain such as "@acme.com", or one exact address, which is stored only as a hash) and remove_internal_email (body { domain } or { hash } from get_internal_traffic_rules). Internal visits still see versions but never count or teach the optimizer, from the moment a rule is on; earlier visits are separated where the rule can tell. Confirm the list with the user first. Removals cannot be undone. The three insight actions (accept_insight, dismiss_insight, save_insight) are always allowed: the Project settings switch does not govern them. Pick one `action`; pass the ids it needs.' + REFUSAL_NOTE
4903
+ description: 'Change project settings: rename or edit the project, remove an allowed origin, add, remove or test a webhook, remove a captured style, rescan the site, set page meaning, create, refresh or remove a report share link, set previews and the layout and slot models, send a test event, and accept, dismiss or save a structured insight. Also who counts as already converted: set_gate_settings (body { identifiedIsConverted: boolean } \u2014 true only when reaching the main goal is what creates the account, i.e. the main goal is sign-up; not available on stores) and import_known_people (body { people: [{ userId, convertedAt?, converted?, orderCount?, totalSpent?, currency?, lastOrderAt?, customerSince?, tags? }] }, at most 2000 per call \u2014 the site\'s own user ids for people who already reached the main goal; never names, emails, phone numbers or addresses, which are refused). Who counts as your team or a test site (Settings \u2192 Internal traffic; read the rules first with get_internal_traffic_rules): set_internal_sites (body { origins: [...] } \u2014 the WHOLE list of internal sites, each one already an allowed origin; an origin left out stops being internal), add_internal_email (body { value } \u2014 a team email domain such as "@acme.com", or one exact address, which is stored only as a hash) and remove_internal_email (body { domain } or { hash } from get_internal_traffic_rules). Internal visits still see versions but never count or teach the optimizer, from the moment a rule is on; earlier visits are separated where the rule can tell. Confirm the list with the user first. Removals cannot be undone. Which parts of the site are before and after sign-up (read first with get_site_areas): set_site_areas (body { areas: [{ origin, path?, side: "before" | "after" }] } \u2014 the WHOLE list, each origin an allowed site; [] removes the split). Components then get versions only for audiences of their own side; confirm with the user first. The three insight actions (accept_insight, dismiss_insight, save_insight) are always allowed: the Project settings switch does not govern them. Pick one `action`; pass the ids it needs.' + REFUSAL_NOTE
4850
4904
  }
4851
4905
  };
4852
4906
  var pathParams = (route) => [...route.matchAll(/:([A-Za-z]+)/g)].map((m) => m[1]);
@@ -4864,13 +4918,13 @@ function registerManageTools(server, client) {
4864
4918
  const meta = TOOLS[tool];
4865
4919
  const shape = {
4866
4920
  projectId: projectIdSchema,
4867
- action: import_v327.z.enum(names).describe("What to do. Each action needs only the fields noted below."),
4868
- enabled: import_v327.z.boolean().optional().describe("For set_auto_fill, set_require_approval, set_observation_mode: on (true) or off (false)"),
4869
- body: import_v327.z.record(import_v327.z.unknown()).optional().describe("The fields to send, for actions that change several things at once; the API checks them and says what's wrong")
4921
+ action: import_v328.z.enum(names).describe("What to do. Each action needs only the fields noted below."),
4922
+ enabled: import_v328.z.boolean().optional().describe("For set_auto_fill, set_require_approval, set_observation_mode: on (true) or off (false)"),
4923
+ body: import_v328.z.record(import_v328.z.unknown()).optional().describe("The fields to send, for actions that change several things at once; the API checks them and says what's wrong")
4870
4924
  };
4871
- if (tool === "manage_generation") shape.depth = import_v327.z.enum(["auto", "rewrite", "redesign"]).optional().describe("For set_depth: how far a rewrite may go");
4872
- if (tool === "manage_settings") shape.origin = import_v327.z.string().optional().describe("For remove_origin: the origin to stop allowing, e.g. https://example.com");
4873
- for (const p of paramNames(tool)) shape[p] = import_v327.z.string().optional().describe(`Required by the actions whose route has :${p}`);
4925
+ if (tool === "manage_generation") shape.depth = import_v328.z.enum(["auto", "rewrite", "redesign"]).optional().describe("For set_depth: how far a rewrite may go");
4926
+ if (tool === "manage_settings") shape.origin = import_v328.z.string().optional().describe("For remove_origin: the origin to stop allowing, e.g. https://example.com");
4927
+ for (const p of paramNames(tool)) shape[p] = import_v328.z.string().optional().describe(`Required by the actions whose route has :${p}`);
4874
4928
  server.registerTool(
4875
4929
  tool,
4876
4930
  {
@@ -4932,6 +4986,8 @@ userId must be the id the site identifies the visitor with (<AdaptiveRoot userId
4932
4986
 
4933
4987
  Excluding the team and test sites (dashboard Settings -> Internal traffic): visits marked internal still see versions (QA works) but never count in any report and never teach the optimizer; get_traffic_breakdown lists them as "Your team / test sites". They are marked by internal sites (allowed domains such as staging or localhost), team emails and domains (they match visitors the site identifies with identify(userId, { email }); the SDK sends only a SHA-256 of the address and its domain, never the address), a browser link, or the code flag (the internal prop on <AdaptiveRoot>/<AdaptiveProvider>, init({ internal }), window.sentient.internal). There is no report filter or IP rule, and visits from before a rule was turned on cannot be separated. Read the rules with get_internal_traffic_rules; change them with manage_settings set_internal_sites / add_internal_email / remove_internal_email (Agent access: Project settings), after confirming the list with the user.
4934
4988
 
4989
+ Two sides of sign-up (dashboard Settings -> Site areas; read with get_site_areas): before sign-up the visitor is anonymous and the goal is to convert them; after sign-up the visitor is inside the product and known. Once a project splits its site, a component gets versions only for audiences of its own side: campaign, arrival and retargeting audiences are before sign-up, declared personas after sign-up only (people already using the product never count toward winning new ones), discovered groups wherever their visits happen. Serving follows the same line: on a before-sign-up page a declared persona is never in force (that visitor is Everyone or a campaign). A version, pin or approval across the line is refused (error other_side) \u2014 pick an audience of the component's side instead of retrying.
4990
+
4935
4991
  The main funnel (get_main_funnel): "how is my funnel doing" is answered by the one journey that ends at the project's main goal \u2014 Arrived, the marketer's own steps, the main goal \u2014 counted in people, with those who had already converted left out. It is chosen with manage_goals set_main_funnel and must end at the main goal; with none chosen it is just Arrived -> main goal. Stores get their checkout journey as the main funnel on connect. Use get_funnel_report only for a side journey: it counts one funnel's goals inside a window and includes people who had already converted, so its numbers and the main funnel's do not add up.
4936
4992
 
4937
4993
  Page groups (get_page_groups): "what runs where" is answered by page groups \u2014 the site's pages under names a marketer uses (Home, Product pages, Pricing), each placed on the main funnel, with the people who viewed them and the components and layouts that ran there. A component's place is where it was actually shown; a header shown everywhere is site-wide. A group's placement only organises the view: where a PERSON is in the funnel comes from get_main_funnel. Until a list is saved (manage_goals set_page_groups) the tool returns a suggestion.
@@ -4941,7 +4997,7 @@ Known people (get_known_people): a person is "known" once they have reached the
4941
4997
  Write tools change what real visitors see: confirm with the user first. Call get_agent_access before a manage_* write.`;
4942
4998
 
4943
4999
  // src/server.ts
4944
- var PKG_VERSION = true ? "0.29.2" : "0.0.0-dev";
5000
+ var PKG_VERSION = true ? "0.30.1" : "0.0.0-dev";
4945
5001
  function createMcpServer(client) {
4946
5002
  const server = new import_mcp.McpServer(
4947
5003
  {
@@ -4989,6 +5045,7 @@ function createMcpServer(client) {
4989
5045
  registerAgentTrafficTools(server, client);
4990
5046
  registerTrafficTools(server, client);
4991
5047
  registerInternalTrafficTools(server, client);
5048
+ registerSiteAreasTools(server, client);
4992
5049
  registerCellTools(server, client);
4993
5050
  registerAgentReadTools(server, client);
4994
5051
  registerManageTools(server, client);
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ApiClient,
4
4
  createMcpServer
5
- } from "./chunk-HTKHEGTY.js";
5
+ } from "./chunk-OTJE277E.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";