@@ -86,14 +86,8 @@ const {
8686 } ;
8787} ) ;
8888
89- const mockClientConfigStoreState = {
90- draftConfig : undefined as
91- | {
92- version : 1 ;
93- clientCapabilities : Record < string , unknown > ;
94- hostContext : Record < string , unknown > ;
95- }
96- | undefined ,
89+ const mockHostContextStoreState = {
90+ draftHostContext : { } as Record < string , unknown > ,
9791} ;
9892
9993const mockPreferencesState = {
@@ -165,8 +159,8 @@ vi.mock("@/stores/ui-playground-store", () => ({
165159 selector ( mockPlaygroundStoreState ) ,
166160} ) ) ;
167161
168- vi . mock ( "@/stores/client-config -store" , ( ) => ( {
169- useClientConfigStore : ( selector : any ) => selector ( mockClientConfigStoreState ) ,
162+ vi . mock ( "@/stores/host-context -store" , ( ) => ( {
163+ useHostContextStore : ( selector : any ) => selector ( mockHostContextStoreState ) ,
170164} ) ) ;
171165
172166vi . mock ( "@/stores/traffic-log-store" , ( ) => ( {
@@ -230,7 +224,7 @@ const baseProps = {
230224describe ( "MCPAppsRenderer tool input streaming" , ( ) => {
231225 beforeEach ( ( ) => {
232226 vi . clearAllMocks ( ) ;
233- mockClientConfigStoreState . draftConfig = undefined ;
227+ mockHostContextStoreState . draftHostContext = { } ;
234228 Object . assign ( mockPlaygroundStoreState , {
235229 isPlaygroundActive : false ,
236230 mcpAppsCspMode : "permissive" ,
@@ -341,15 +335,11 @@ describe("MCPAppsRenderer tool input streaming", () => {
341335 } ) ;
342336
343337 it ( "clamps configured host display modes before sending host context" , async ( ) => {
344- mockClientConfigStoreState . draftConfig = {
345- version : 1 ,
346- clientCapabilities : { } ,
347- hostContext : {
348- displayMode : "fullscreen" ,
349- availableDisplayModes : [ "inline" ] ,
350- locale : "fr-FR" ,
351- timeZone : "Europe/Paris" ,
352- } ,
338+ mockHostContextStoreState . draftHostContext = {
339+ displayMode : "fullscreen" ,
340+ availableDisplayModes : [ "inline" ] ,
341+ locale : "fr-FR" ,
342+ timeZone : "Europe/Paris" ,
353343 } ;
354344
355345 render ( < MCPAppsRenderer { ...baseProps } /> ) ;
@@ -376,16 +366,12 @@ describe("MCPAppsRenderer tool input streaming", () => {
376366 } ) ;
377367
378368 it ( "filters non-standard host style variables out of the initialize payload" , async ( ) => {
379- mockClientConfigStoreState . draftConfig = {
380- version : 1 ,
381- clientCapabilities : { } ,
382- hostContext : {
383- styles : {
384- variables : {
385- "--font-sans" : "Custom Sans" ,
386- "--mcpjam-theme-preset" : "soft-pop" ,
387- "--totally-unknown" : "ignore-me" ,
388- } ,
369+ mockHostContextStoreState . draftHostContext = {
370+ styles : {
371+ variables : {
372+ "--font-sans" : "Custom Sans" ,
373+ "--mcpjam-theme-preset" : "soft-pop" ,
374+ "--totally-unknown" : "ignore-me" ,
389375 } ,
390376 } ,
391377 } ;
@@ -488,16 +474,12 @@ describe("MCPAppsRenderer tool input streaming", () => {
488474 ) ;
489475 } ) ;
490476
491- mockClientConfigStoreState . draftConfig = {
492- version : 1 ,
493- clientCapabilities : { } ,
494- hostContext : {
495- locale : "es-ES" ,
496- timeZone : "Europe/Madrid" ,
497- deviceCapabilities : {
498- hover : false ,
499- touch : true ,
500- } ,
477+ mockHostContextStoreState . draftHostContext = {
478+ locale : "es-ES" ,
479+ timeZone : "Europe/Madrid" ,
480+ deviceCapabilities : {
481+ hover : false ,
482+ touch : true ,
501483 } ,
502484 } ;
503485
0 commit comments