@sentientui/mcp 0.18.2 → 0.18.4

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.
@@ -1905,6 +1905,31 @@ combined tag contains the site's config, so its hash differs per site; the split
1905
1905
  byte-identical everywhere, so one hash covers it. Existing three-tag and config + loader installs
1906
1906
  keep working.
1907
1907
 
1908
+ ## Capture AI assistants (server-side, any framework)
1909
+
1910
+ AI assistants that fetch pages for their users (ChatGPT-User, Claude-User, Perplexity-User)
1911
+ and AI crawlers (GPTBot, ClaudeBot, \u2026) run no JavaScript, so the snippet and the React SDK never
1912
+ see them. Only your server does. Without server-side capture the dashboard's agent line reads
1913
+ "not measured", not zero. Capture only observes: it never changes what is served.
1914
+
1915
+ - Next.js with AdaptiveRoot: already on (captureAgents defaults to true).
1916
+ - Edge (Vercel Routing Middleware, Cloudflare Workers, Netlify Edge) \u2014 covers ANY framework on
1917
+ those hosts, static sites included:
1918
+ import { captureAgentRequest } from '@sentientui/core/server';
1919
+ captureAgentRequest(request, { apiKey: 'pk_...', source: 'edge', waitUntil });
1920
+ waitUntil is required on edge runtimes (ctx.waitUntil.bind(ctx) on Workers; waitUntil from
1921
+ '@vercel/functions' on Vercel), or the platform drops the request when the response returns.
1922
+ - Node servers (Express, Nuxt/Nitro on Node, any (req, res, next) stack):
1923
+ import { sentientAgentMiddleware } from '@sentientui/core/server';
1924
+ app.use(sentientAgentMiddleware({ apiKey: 'pk_...' }));
1925
+ - Hono / Remix / React Router / Astro / SvelteKit: call captureAgentRequest(request, { apiKey })
1926
+ from the request hook.
1927
+
1928
+ Only the path is sent (never the query string), with the user agent. The API re-derives the
1929
+ agent itself and collapses the same fetch reported twice (e.g. edge + SSR), so running two
1930
+ capture paths does not double-count. Hosted builders (Shopify themes, Webflow, Squarespace, Wix)
1931
+ give no per-request hook and stay unmeasured.
1932
+
1908
1933
  ## Testing the integration
1909
1934
 
1910
1935
  Use '@sentientui/react/testing': renderWithSentient(ui, { variants, slots, persona }) forces
@@ -2115,18 +2140,23 @@ function registerCellTools(server, client) {
2115
2140
  personas: z15.array(personaOutput),
2116
2141
  cells: z15.array(cellOutput),
2117
2142
  autoFill: z15.boolean(),
2118
- personaSource: z15.string().describe("Active persona-set source: default | declared | discovered"),
2143
+ // Nullable: a project with no persona set at all reports null, not a
2144
+ // string. That is the NORMAL state since the default vocabulary was
2145
+ // emptied, so a non-nullable schema failed output validation on most
2146
+ // projects and the tool returned nothing but a zod error.
2147
+ personaSource: z15.string().nullable().describe('Active persona-set source: default | declared | discovered, or null when the project has no persona set (one "everyone" row)'),
2119
2148
  undecidedShare: z15.number()
2120
2149
  },
2121
2150
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
2122
2151
  },
2123
2152
  withApiErrorGuidance(async ({ projectId }) => {
2153
+ var _a;
2124
2154
  const id = encodeURIComponent(projectId);
2125
2155
  const data = await client.get(`/projects/${id}/cells`);
2126
2156
  const byCell = new Map(data.cells.map((c) => [`${c.slotId}::${c.persona}`, c]));
2127
2157
  const lines = [
2128
2158
  `Slots: ${data.slots.map((s) => `${untrusted(s.displayName)}${s.live === false ? " [draft]" : ""}`).join(", ") || "(none published)"}`,
2129
- `Auto-fill on first miss: ${data.autoFill ? "ON" : "off"} \xB7 persona source: ${data.personaSource}`
2159
+ `Auto-fill on first miss: ${data.autoFill ? "ON" : "off"} \xB7 persona source: ${(_a = data.personaSource) != null ? _a : 'none (one "everyone" row)'}`
2130
2160
  ];
2131
2161
  for (const p of data.personas) {
2132
2162
  const states = data.slots.map((s) => {
@@ -2241,7 +2271,7 @@ function registerCellTools(server, client) {
2241
2271
  }
2242
2272
 
2243
2273
  // src/server.ts
2244
- var PKG_VERSION = true ? "0.18.2" : "0.0.0-dev";
2274
+ var PKG_VERSION = true ? "0.18.4" : "0.0.0-dev";
2245
2275
  function createMcpServer(client) {
2246
2276
  const server = new McpServer(
2247
2277
  {
package/dist/index.cjs CHANGED
@@ -1911,6 +1911,31 @@ combined tag contains the site's config, so its hash differs per site; the split
1911
1911
  byte-identical everywhere, so one hash covers it. Existing three-tag and config + loader installs
1912
1912
  keep working.
1913
1913
 
1914
+ ## Capture AI assistants (server-side, any framework)
1915
+
1916
+ AI assistants that fetch pages for their users (ChatGPT-User, Claude-User, Perplexity-User)
1917
+ and AI crawlers (GPTBot, ClaudeBot, \u2026) run no JavaScript, so the snippet and the React SDK never
1918
+ see them. Only your server does. Without server-side capture the dashboard's agent line reads
1919
+ "not measured", not zero. Capture only observes: it never changes what is served.
1920
+
1921
+ - Next.js with AdaptiveRoot: already on (captureAgents defaults to true).
1922
+ - Edge (Vercel Routing Middleware, Cloudflare Workers, Netlify Edge) \u2014 covers ANY framework on
1923
+ those hosts, static sites included:
1924
+ import { captureAgentRequest } from '@sentientui/core/server';
1925
+ captureAgentRequest(request, { apiKey: 'pk_...', source: 'edge', waitUntil });
1926
+ waitUntil is required on edge runtimes (ctx.waitUntil.bind(ctx) on Workers; waitUntil from
1927
+ '@vercel/functions' on Vercel), or the platform drops the request when the response returns.
1928
+ - Node servers (Express, Nuxt/Nitro on Node, any (req, res, next) stack):
1929
+ import { sentientAgentMiddleware } from '@sentientui/core/server';
1930
+ app.use(sentientAgentMiddleware({ apiKey: 'pk_...' }));
1931
+ - Hono / Remix / React Router / Astro / SvelteKit: call captureAgentRequest(request, { apiKey })
1932
+ from the request hook.
1933
+
1934
+ Only the path is sent (never the query string), with the user agent. The API re-derives the
1935
+ agent itself and collapses the same fetch reported twice (e.g. edge + SSR), so running two
1936
+ capture paths does not double-count. Hosted builders (Shopify themes, Webflow, Squarespace, Wix)
1937
+ give no per-request hook and stay unmeasured.
1938
+
1914
1939
  ## Testing the integration
1915
1940
 
1916
1941
  Use '@sentientui/react/testing': renderWithSentient(ui, { variants, slots, persona }) forces
@@ -2121,18 +2146,23 @@ function registerCellTools(server, client) {
2121
2146
  personas: import_zod15.z.array(personaOutput),
2122
2147
  cells: import_zod15.z.array(cellOutput),
2123
2148
  autoFill: import_zod15.z.boolean(),
2124
- personaSource: import_zod15.z.string().describe("Active persona-set source: default | declared | discovered"),
2149
+ // Nullable: a project with no persona set at all reports null, not a
2150
+ // string. That is the NORMAL state since the default vocabulary was
2151
+ // emptied, so a non-nullable schema failed output validation on most
2152
+ // projects and the tool returned nothing but a zod error.
2153
+ personaSource: import_zod15.z.string().nullable().describe('Active persona-set source: default | declared | discovered, or null when the project has no persona set (one "everyone" row)'),
2125
2154
  undecidedShare: import_zod15.z.number()
2126
2155
  },
2127
2156
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
2128
2157
  },
2129
2158
  withApiErrorGuidance(async ({ projectId }) => {
2159
+ var _a2;
2130
2160
  const id = encodeURIComponent(projectId);
2131
2161
  const data = await client.get(`/projects/${id}/cells`);
2132
2162
  const byCell = new Map(data.cells.map((c) => [`${c.slotId}::${c.persona}`, c]));
2133
2163
  const lines = [
2134
2164
  `Slots: ${data.slots.map((s) => `${untrusted(s.displayName)}${s.live === false ? " [draft]" : ""}`).join(", ") || "(none published)"}`,
2135
- `Auto-fill on first miss: ${data.autoFill ? "ON" : "off"} \xB7 persona source: ${data.personaSource}`
2165
+ `Auto-fill on first miss: ${data.autoFill ? "ON" : "off"} \xB7 persona source: ${(_a2 = data.personaSource) != null ? _a2 : 'none (one "everyone" row)'}`
2136
2166
  ];
2137
2167
  for (const p of data.personas) {
2138
2168
  const states = data.slots.map((s) => {
@@ -2247,7 +2277,7 @@ function registerCellTools(server, client) {
2247
2277
  }
2248
2278
 
2249
2279
  // src/server.ts
2250
- var PKG_VERSION = true ? "0.18.2" : "0.0.0-dev";
2280
+ var PKG_VERSION = true ? "0.18.4" : "0.0.0-dev";
2251
2281
  function createMcpServer(client) {
2252
2282
  const server = new import_mcp.McpServer(
2253
2283
  {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ApiClient,
4
4
  createMcpServer
5
- } from "./chunk-5TEQLWMW.js";
5
+ } from "./chunk-X3CXBGWM.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/dist/lib.cjs CHANGED
@@ -1935,6 +1935,31 @@ combined tag contains the site's config, so its hash differs per site; the split
1935
1935
  byte-identical everywhere, so one hash covers it. Existing three-tag and config + loader installs
1936
1936
  keep working.
1937
1937
 
1938
+ ## Capture AI assistants (server-side, any framework)
1939
+
1940
+ AI assistants that fetch pages for their users (ChatGPT-User, Claude-User, Perplexity-User)
1941
+ and AI crawlers (GPTBot, ClaudeBot, \u2026) run no JavaScript, so the snippet and the React SDK never
1942
+ see them. Only your server does. Without server-side capture the dashboard's agent line reads
1943
+ "not measured", not zero. Capture only observes: it never changes what is served.
1944
+
1945
+ - Next.js with AdaptiveRoot: already on (captureAgents defaults to true).
1946
+ - Edge (Vercel Routing Middleware, Cloudflare Workers, Netlify Edge) \u2014 covers ANY framework on
1947
+ those hosts, static sites included:
1948
+ import { captureAgentRequest } from '@sentientui/core/server';
1949
+ captureAgentRequest(request, { apiKey: 'pk_...', source: 'edge', waitUntil });
1950
+ waitUntil is required on edge runtimes (ctx.waitUntil.bind(ctx) on Workers; waitUntil from
1951
+ '@vercel/functions' on Vercel), or the platform drops the request when the response returns.
1952
+ - Node servers (Express, Nuxt/Nitro on Node, any (req, res, next) stack):
1953
+ import { sentientAgentMiddleware } from '@sentientui/core/server';
1954
+ app.use(sentientAgentMiddleware({ apiKey: 'pk_...' }));
1955
+ - Hono / Remix / React Router / Astro / SvelteKit: call captureAgentRequest(request, { apiKey })
1956
+ from the request hook.
1957
+
1958
+ Only the path is sent (never the query string), with the user agent. The API re-derives the
1959
+ agent itself and collapses the same fetch reported twice (e.g. edge + SSR), so running two
1960
+ capture paths does not double-count. Hosted builders (Shopify themes, Webflow, Squarespace, Wix)
1961
+ give no per-request hook and stay unmeasured.
1962
+
1938
1963
  ## Testing the integration
1939
1964
 
1940
1965
  Use '@sentientui/react/testing': renderWithSentient(ui, { variants, slots, persona }) forces
@@ -2145,18 +2170,23 @@ function registerCellTools(server, client) {
2145
2170
  personas: import_zod15.z.array(personaOutput),
2146
2171
  cells: import_zod15.z.array(cellOutput),
2147
2172
  autoFill: import_zod15.z.boolean(),
2148
- personaSource: import_zod15.z.string().describe("Active persona-set source: default | declared | discovered"),
2173
+ // Nullable: a project with no persona set at all reports null, not a
2174
+ // string. That is the NORMAL state since the default vocabulary was
2175
+ // emptied, so a non-nullable schema failed output validation on most
2176
+ // projects and the tool returned nothing but a zod error.
2177
+ personaSource: import_zod15.z.string().nullable().describe('Active persona-set source: default | declared | discovered, or null when the project has no persona set (one "everyone" row)'),
2149
2178
  undecidedShare: import_zod15.z.number()
2150
2179
  },
2151
2180
  annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false }
2152
2181
  },
2153
2182
  withApiErrorGuidance(async ({ projectId }) => {
2183
+ var _a;
2154
2184
  const id = encodeURIComponent(projectId);
2155
2185
  const data = await client.get(`/projects/${id}/cells`);
2156
2186
  const byCell = new Map(data.cells.map((c) => [`${c.slotId}::${c.persona}`, c]));
2157
2187
  const lines = [
2158
2188
  `Slots: ${data.slots.map((s) => `${untrusted(s.displayName)}${s.live === false ? " [draft]" : ""}`).join(", ") || "(none published)"}`,
2159
- `Auto-fill on first miss: ${data.autoFill ? "ON" : "off"} \xB7 persona source: ${data.personaSource}`
2189
+ `Auto-fill on first miss: ${data.autoFill ? "ON" : "off"} \xB7 persona source: ${(_a = data.personaSource) != null ? _a : 'none (one "everyone" row)'}`
2160
2190
  ];
2161
2191
  for (const p of data.personas) {
2162
2192
  const states = data.slots.map((s) => {
@@ -2271,7 +2301,7 @@ function registerCellTools(server, client) {
2271
2301
  }
2272
2302
 
2273
2303
  // src/server.ts
2274
- var PKG_VERSION = true ? "0.18.2" : "0.0.0-dev";
2304
+ var PKG_VERSION = true ? "0.18.4" : "0.0.0-dev";
2275
2305
  function createMcpServer(client) {
2276
2306
  const server = new import_mcp.McpServer(
2277
2307
  {
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-5TEQLWMW.js";
7
+ } from "./chunk-X3CXBGWM.js";
8
8
  export {
9
9
  ApiClient,
10
10
  ApiError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentientui/mcp",
3
- "version": "0.18.2",
3
+ "version": "0.18.4",
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",