@sentientui/mcp 0.25.0 → 0.25.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/{chunk-U54H74Y7.js → chunk-QF2U745P.js} +48 -6
- package/dist/index.cjs +48 -6
- package/dist/index.js +1 -1
- package/dist/lib.cjs +48 -6
- package/dist/lib.js +1 -1
- package/package.json +1 -1
|
@@ -2628,11 +2628,12 @@ project has its own persona vocabulary (dashboard -> Settings -> Personas), and
|
|
|
2628
2628
|
EMPTY: every visitor is 'unknown' until a persona exists, and the optimizer learns across all
|
|
2629
2629
|
traffic pooled in the meantime. Personas are DISCOVERED from behavior \u2014 or, far faster,
|
|
2630
2630
|
DECLARED by the app when it already knows the visitor's role: init({ persona: 'admin' }) /
|
|
2631
|
-
<AdaptiveProvider persona=...> / window.sentient.persona. Declared beats
|
|
2631
|
+
<AdaptiveProvider persona=...> / window.sentient.persona. Declared beats discovered and serves
|
|
2632
2632
|
at full confidence; unrecognized values are ignored server-side and surfaced in the dashboard
|
|
2633
2633
|
so the operator can add them. Keep persona a low-cardinality role slug \u2014 never a user id.
|
|
2634
|
-
Decisions are locked per
|
|
2635
|
-
|
|
2634
|
+
Decisions are locked per visit: a first visit usually sees the original and the return visit adapts \u2014 the
|
|
2635
|
+
exception is a visitor arriving on a campaign link, whose first page can already show the campaign's version
|
|
2636
|
+
(see Campaigns). Integrate one rung at a time.
|
|
2636
2637
|
|
|
2637
2638
|
## Setup (60 seconds, no account)
|
|
2638
2639
|
|
|
@@ -2656,10 +2657,13 @@ time.
|
|
|
2656
2657
|
|
|
2657
2658
|
## Rung 1 \u2014 Style (CSS only)
|
|
2658
2659
|
|
|
2659
|
-
Persona attributes on <html> (zero declaration
|
|
2660
|
-
|
|
2660
|
+
Persona attributes on <html> (zero declaration). The attribute carries the key the visit is
|
|
2661
|
+
SERVED as: a declared key as-is ('admin'), a discovered group with its d- prefix
|
|
2662
|
+
('d-content'), a campaign ('c-spring') or retargeting group ('r-spring'), or 'unknown'. CSS for a discovered group must target the d- key \u2014 a rule
|
|
2663
|
+
written against a bare 'content' stops matching once the group carries its prefix:
|
|
2661
2664
|
|
|
2662
2665
|
html[data-sentient-persona='admin'] .admin-tools { display: block; }
|
|
2666
|
+
html[data-sentient-persona='d-content'] .reading-list { display: block; }
|
|
2663
2667
|
html[data-sentient-confidence='low'] .admin-tools { display: none; }
|
|
2664
2668
|
|
|
2665
2669
|
Learned style tokens (element-scoped, SSR-safe):
|
|
@@ -2749,6 +2753,44 @@ Consent: add consentFrom (same presets as above) to window.sentient when the sit
|
|
|
2749
2753
|
banner, or consent: false plus SentientSnippet.grantConsent() on accept. On Shopify, snippet 0.32
|
|
2750
2754
|
and later follows Shopify's Customer Privacy API automatically.
|
|
2751
2755
|
|
|
2756
|
+
## Campaigns \u2014 ad and email links
|
|
2757
|
+
|
|
2758
|
+
A campaign is named in the dashboard (Settings -> Campaigns -> Prepare a campaign): its name, the
|
|
2759
|
+
utm_campaign its links carry (optionally utm_source / utm_medium, or the ad platform), what the ad
|
|
2760
|
+
promises, any discount code, and its landing page. Visitors arriving on its links are served as the
|
|
2761
|
+
campaign \u2014 persona 'c-spring' for a campaign named "Spring" \u2014 with versions written for it, from the
|
|
2762
|
+
FIRST page of the visit; a visitor who comes back without a tagged link within 30 days is still the
|
|
2763
|
+
campaign's until it ends. A visitor the site already knows (a declared persona or a discovered group)
|
|
2764
|
+
keeps that audience; the click still counts on the campaign card, as "already known". After a
|
|
2765
|
+
campaign, its visitors who did not convert can be moved into a retargeting group ('r-spring') with
|
|
2766
|
+
its own versions and its own result.
|
|
2767
|
+
|
|
2768
|
+
What the integration must do is get the landing URL to the first decision:
|
|
2769
|
+
|
|
2770
|
+
- Tag every ad and email link: ?utm_campaign=spring&utm_source=newsletter&utm_medium=email.
|
|
2771
|
+
utm_campaign is required \u2014 it is what a campaign matches on; an untagged link is served like any
|
|
2772
|
+
other visit.
|
|
2773
|
+
- Snippet, Shopify theme embed, AdaptiveProvider, and AdaptiveRoot in app/layout.tsx with no server
|
|
2774
|
+
preload: nothing to add. The browser's first decision carries the page URL.
|
|
2775
|
+
- Next.js server preload (ANY of registrySlotIds, registrySlots, components, sections or slots on
|
|
2776
|
+
AdaptiveRoot): the server decides before the browser runs, and a Server Component cannot read
|
|
2777
|
+
the request URL. Next.js never passes searchParams to a layout, so preload in app/layout.tsx decides a campaign visitor's
|
|
2778
|
+
first page as everyone else's (the campaign starts on their next visit, and that first click is not
|
|
2779
|
+
on the campaign card). Where a page renders AdaptiveRoot itself, pass the page's own:
|
|
2780
|
+
|
|
2781
|
+
export default async function Page({ searchParams }: { searchParams: Promise<Record<string, string | string[] | undefined>> }) {
|
|
2782
|
+
return (
|
|
2783
|
+
<AdaptiveRoot apiKey={process.env.NEXT_PUBLIC_SENTIENT_API_KEY ?? ''}
|
|
2784
|
+
searchParams={await searchParams} pathname="/spring">
|
|
2785
|
+
\u2026
|
|
2786
|
+
</AdaptiveRoot>
|
|
2787
|
+
);
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
- Verify with a tagged link in a fresh browser profile: once the page has decided, <html
|
|
2791
|
+
data-sentient-persona> reads the campaign's key ('c-spring'). The React SDK always sets it; the
|
|
2792
|
+
snippet only with personaAttributes: true in window.sentient.
|
|
2793
|
+
|
|
2752
2794
|
## Capture AI assistants (server-side, any framework)
|
|
2753
2795
|
|
|
2754
2796
|
AI assistants that fetch pages for their users (ChatGPT-User, Claude-User, Perplexity-User)
|
|
@@ -3290,7 +3332,7 @@ function registerCellTools(server, client) {
|
|
|
3290
3332
|
}
|
|
3291
3333
|
|
|
3292
3334
|
// src/server.ts
|
|
3293
|
-
var PKG_VERSION = true ? "0.25.
|
|
3335
|
+
var PKG_VERSION = true ? "0.25.1" : "0.0.0-dev";
|
|
3294
3336
|
function createMcpServer(client) {
|
|
3295
3337
|
const server = new McpServer(
|
|
3296
3338
|
{
|
package/dist/index.cjs
CHANGED
|
@@ -2632,11 +2632,12 @@ project has its own persona vocabulary (dashboard -> Settings -> Personas), and
|
|
|
2632
2632
|
EMPTY: every visitor is 'unknown' until a persona exists, and the optimizer learns across all
|
|
2633
2633
|
traffic pooled in the meantime. Personas are DISCOVERED from behavior \u2014 or, far faster,
|
|
2634
2634
|
DECLARED by the app when it already knows the visitor's role: init({ persona: 'admin' }) /
|
|
2635
|
-
<AdaptiveProvider persona=...> / window.sentient.persona. Declared beats
|
|
2635
|
+
<AdaptiveProvider persona=...> / window.sentient.persona. Declared beats discovered and serves
|
|
2636
2636
|
at full confidence; unrecognized values are ignored server-side and surfaced in the dashboard
|
|
2637
2637
|
so the operator can add them. Keep persona a low-cardinality role slug \u2014 never a user id.
|
|
2638
|
-
Decisions are locked per
|
|
2639
|
-
|
|
2638
|
+
Decisions are locked per visit: a first visit usually sees the original and the return visit adapts \u2014 the
|
|
2639
|
+
exception is a visitor arriving on a campaign link, whose first page can already show the campaign's version
|
|
2640
|
+
(see Campaigns). Integrate one rung at a time.
|
|
2640
2641
|
|
|
2641
2642
|
## Setup (60 seconds, no account)
|
|
2642
2643
|
|
|
@@ -2660,10 +2661,13 @@ time.
|
|
|
2660
2661
|
|
|
2661
2662
|
## Rung 1 \u2014 Style (CSS only)
|
|
2662
2663
|
|
|
2663
|
-
Persona attributes on <html> (zero declaration
|
|
2664
|
-
|
|
2664
|
+
Persona attributes on <html> (zero declaration). The attribute carries the key the visit is
|
|
2665
|
+
SERVED as: a declared key as-is ('admin'), a discovered group with its d- prefix
|
|
2666
|
+
('d-content'), a campaign ('c-spring') or retargeting group ('r-spring'), or 'unknown'. CSS for a discovered group must target the d- key \u2014 a rule
|
|
2667
|
+
written against a bare 'content' stops matching once the group carries its prefix:
|
|
2665
2668
|
|
|
2666
2669
|
html[data-sentient-persona='admin'] .admin-tools { display: block; }
|
|
2670
|
+
html[data-sentient-persona='d-content'] .reading-list { display: block; }
|
|
2667
2671
|
html[data-sentient-confidence='low'] .admin-tools { display: none; }
|
|
2668
2672
|
|
|
2669
2673
|
Learned style tokens (element-scoped, SSR-safe):
|
|
@@ -2753,6 +2757,44 @@ Consent: add consentFrom (same presets as above) to window.sentient when the sit
|
|
|
2753
2757
|
banner, or consent: false plus SentientSnippet.grantConsent() on accept. On Shopify, snippet 0.32
|
|
2754
2758
|
and later follows Shopify's Customer Privacy API automatically.
|
|
2755
2759
|
|
|
2760
|
+
## Campaigns \u2014 ad and email links
|
|
2761
|
+
|
|
2762
|
+
A campaign is named in the dashboard (Settings -> Campaigns -> Prepare a campaign): its name, the
|
|
2763
|
+
utm_campaign its links carry (optionally utm_source / utm_medium, or the ad platform), what the ad
|
|
2764
|
+
promises, any discount code, and its landing page. Visitors arriving on its links are served as the
|
|
2765
|
+
campaign \u2014 persona 'c-spring' for a campaign named "Spring" \u2014 with versions written for it, from the
|
|
2766
|
+
FIRST page of the visit; a visitor who comes back without a tagged link within 30 days is still the
|
|
2767
|
+
campaign's until it ends. A visitor the site already knows (a declared persona or a discovered group)
|
|
2768
|
+
keeps that audience; the click still counts on the campaign card, as "already known". After a
|
|
2769
|
+
campaign, its visitors who did not convert can be moved into a retargeting group ('r-spring') with
|
|
2770
|
+
its own versions and its own result.
|
|
2771
|
+
|
|
2772
|
+
What the integration must do is get the landing URL to the first decision:
|
|
2773
|
+
|
|
2774
|
+
- Tag every ad and email link: ?utm_campaign=spring&utm_source=newsletter&utm_medium=email.
|
|
2775
|
+
utm_campaign is required \u2014 it is what a campaign matches on; an untagged link is served like any
|
|
2776
|
+
other visit.
|
|
2777
|
+
- Snippet, Shopify theme embed, AdaptiveProvider, and AdaptiveRoot in app/layout.tsx with no server
|
|
2778
|
+
preload: nothing to add. The browser's first decision carries the page URL.
|
|
2779
|
+
- Next.js server preload (ANY of registrySlotIds, registrySlots, components, sections or slots on
|
|
2780
|
+
AdaptiveRoot): the server decides before the browser runs, and a Server Component cannot read
|
|
2781
|
+
the request URL. Next.js never passes searchParams to a layout, so preload in app/layout.tsx decides a campaign visitor's
|
|
2782
|
+
first page as everyone else's (the campaign starts on their next visit, and that first click is not
|
|
2783
|
+
on the campaign card). Where a page renders AdaptiveRoot itself, pass the page's own:
|
|
2784
|
+
|
|
2785
|
+
export default async function Page({ searchParams }: { searchParams: Promise<Record<string, string | string[] | undefined>> }) {
|
|
2786
|
+
return (
|
|
2787
|
+
<AdaptiveRoot apiKey={process.env.NEXT_PUBLIC_SENTIENT_API_KEY ?? ''}
|
|
2788
|
+
searchParams={await searchParams} pathname="/spring">
|
|
2789
|
+
\u2026
|
|
2790
|
+
</AdaptiveRoot>
|
|
2791
|
+
);
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
- Verify with a tagged link in a fresh browser profile: once the page has decided, <html
|
|
2795
|
+
data-sentient-persona> reads the campaign's key ('c-spring'). The React SDK always sets it; the
|
|
2796
|
+
snippet only with personaAttributes: true in window.sentient.
|
|
2797
|
+
|
|
2756
2798
|
## Capture AI assistants (server-side, any framework)
|
|
2757
2799
|
|
|
2758
2800
|
AI assistants that fetch pages for their users (ChatGPT-User, Claude-User, Perplexity-User)
|
|
@@ -3294,7 +3336,7 @@ function registerCellTools(server, client) {
|
|
|
3294
3336
|
}
|
|
3295
3337
|
|
|
3296
3338
|
// src/server.ts
|
|
3297
|
-
var PKG_VERSION = true ? "0.25.
|
|
3339
|
+
var PKG_VERSION = true ? "0.25.1" : "0.0.0-dev";
|
|
3298
3340
|
function createMcpServer(client) {
|
|
3299
3341
|
const server = new import_mcp.McpServer(
|
|
3300
3342
|
{
|
package/dist/index.js
CHANGED
package/dist/lib.cjs
CHANGED
|
@@ -2658,11 +2658,12 @@ project has its own persona vocabulary (dashboard -> Settings -> Personas), and
|
|
|
2658
2658
|
EMPTY: every visitor is 'unknown' until a persona exists, and the optimizer learns across all
|
|
2659
2659
|
traffic pooled in the meantime. Personas are DISCOVERED from behavior \u2014 or, far faster,
|
|
2660
2660
|
DECLARED by the app when it already knows the visitor's role: init({ persona: 'admin' }) /
|
|
2661
|
-
<AdaptiveProvider persona=...> / window.sentient.persona. Declared beats
|
|
2661
|
+
<AdaptiveProvider persona=...> / window.sentient.persona. Declared beats discovered and serves
|
|
2662
2662
|
at full confidence; unrecognized values are ignored server-side and surfaced in the dashboard
|
|
2663
2663
|
so the operator can add them. Keep persona a low-cardinality role slug \u2014 never a user id.
|
|
2664
|
-
Decisions are locked per
|
|
2665
|
-
|
|
2664
|
+
Decisions are locked per visit: a first visit usually sees the original and the return visit adapts \u2014 the
|
|
2665
|
+
exception is a visitor arriving on a campaign link, whose first page can already show the campaign's version
|
|
2666
|
+
(see Campaigns). Integrate one rung at a time.
|
|
2666
2667
|
|
|
2667
2668
|
## Setup (60 seconds, no account)
|
|
2668
2669
|
|
|
@@ -2686,10 +2687,13 @@ time.
|
|
|
2686
2687
|
|
|
2687
2688
|
## Rung 1 \u2014 Style (CSS only)
|
|
2688
2689
|
|
|
2689
|
-
Persona attributes on <html> (zero declaration
|
|
2690
|
-
|
|
2690
|
+
Persona attributes on <html> (zero declaration). The attribute carries the key the visit is
|
|
2691
|
+
SERVED as: a declared key as-is ('admin'), a discovered group with its d- prefix
|
|
2692
|
+
('d-content'), a campaign ('c-spring') or retargeting group ('r-spring'), or 'unknown'. CSS for a discovered group must target the d- key \u2014 a rule
|
|
2693
|
+
written against a bare 'content' stops matching once the group carries its prefix:
|
|
2691
2694
|
|
|
2692
2695
|
html[data-sentient-persona='admin'] .admin-tools { display: block; }
|
|
2696
|
+
html[data-sentient-persona='d-content'] .reading-list { display: block; }
|
|
2693
2697
|
html[data-sentient-confidence='low'] .admin-tools { display: none; }
|
|
2694
2698
|
|
|
2695
2699
|
Learned style tokens (element-scoped, SSR-safe):
|
|
@@ -2779,6 +2783,44 @@ Consent: add consentFrom (same presets as above) to window.sentient when the sit
|
|
|
2779
2783
|
banner, or consent: false plus SentientSnippet.grantConsent() on accept. On Shopify, snippet 0.32
|
|
2780
2784
|
and later follows Shopify's Customer Privacy API automatically.
|
|
2781
2785
|
|
|
2786
|
+
## Campaigns \u2014 ad and email links
|
|
2787
|
+
|
|
2788
|
+
A campaign is named in the dashboard (Settings -> Campaigns -> Prepare a campaign): its name, the
|
|
2789
|
+
utm_campaign its links carry (optionally utm_source / utm_medium, or the ad platform), what the ad
|
|
2790
|
+
promises, any discount code, and its landing page. Visitors arriving on its links are served as the
|
|
2791
|
+
campaign \u2014 persona 'c-spring' for a campaign named "Spring" \u2014 with versions written for it, from the
|
|
2792
|
+
FIRST page of the visit; a visitor who comes back without a tagged link within 30 days is still the
|
|
2793
|
+
campaign's until it ends. A visitor the site already knows (a declared persona or a discovered group)
|
|
2794
|
+
keeps that audience; the click still counts on the campaign card, as "already known". After a
|
|
2795
|
+
campaign, its visitors who did not convert can be moved into a retargeting group ('r-spring') with
|
|
2796
|
+
its own versions and its own result.
|
|
2797
|
+
|
|
2798
|
+
What the integration must do is get the landing URL to the first decision:
|
|
2799
|
+
|
|
2800
|
+
- Tag every ad and email link: ?utm_campaign=spring&utm_source=newsletter&utm_medium=email.
|
|
2801
|
+
utm_campaign is required \u2014 it is what a campaign matches on; an untagged link is served like any
|
|
2802
|
+
other visit.
|
|
2803
|
+
- Snippet, Shopify theme embed, AdaptiveProvider, and AdaptiveRoot in app/layout.tsx with no server
|
|
2804
|
+
preload: nothing to add. The browser's first decision carries the page URL.
|
|
2805
|
+
- Next.js server preload (ANY of registrySlotIds, registrySlots, components, sections or slots on
|
|
2806
|
+
AdaptiveRoot): the server decides before the browser runs, and a Server Component cannot read
|
|
2807
|
+
the request URL. Next.js never passes searchParams to a layout, so preload in app/layout.tsx decides a campaign visitor's
|
|
2808
|
+
first page as everyone else's (the campaign starts on their next visit, and that first click is not
|
|
2809
|
+
on the campaign card). Where a page renders AdaptiveRoot itself, pass the page's own:
|
|
2810
|
+
|
|
2811
|
+
export default async function Page({ searchParams }: { searchParams: Promise<Record<string, string | string[] | undefined>> }) {
|
|
2812
|
+
return (
|
|
2813
|
+
<AdaptiveRoot apiKey={process.env.NEXT_PUBLIC_SENTIENT_API_KEY ?? ''}
|
|
2814
|
+
searchParams={await searchParams} pathname="/spring">
|
|
2815
|
+
\u2026
|
|
2816
|
+
</AdaptiveRoot>
|
|
2817
|
+
);
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
- Verify with a tagged link in a fresh browser profile: once the page has decided, <html
|
|
2821
|
+
data-sentient-persona> reads the campaign's key ('c-spring'). The React SDK always sets it; the
|
|
2822
|
+
snippet only with personaAttributes: true in window.sentient.
|
|
2823
|
+
|
|
2782
2824
|
## Capture AI assistants (server-side, any framework)
|
|
2783
2825
|
|
|
2784
2826
|
AI assistants that fetch pages for their users (ChatGPT-User, Claude-User, Perplexity-User)
|
|
@@ -3320,7 +3362,7 @@ function registerCellTools(server, client) {
|
|
|
3320
3362
|
}
|
|
3321
3363
|
|
|
3322
3364
|
// src/server.ts
|
|
3323
|
-
var PKG_VERSION = true ? "0.25.
|
|
3365
|
+
var PKG_VERSION = true ? "0.25.1" : "0.0.0-dev";
|
|
3324
3366
|
function createMcpServer(client) {
|
|
3325
3367
|
const server = new import_mcp.McpServer(
|
|
3326
3368
|
{
|
package/dist/lib.js
CHANGED