1- import { App , applyDocumentTheme , applyHostStyleVariables , applyHostFonts } from "@modelcontextprotocol/ext-apps" ;
1+ import {
2+ App ,
3+ applyDocumentTheme ,
4+ applyHostStyleVariables ,
5+ applyHostFonts ,
6+ } from "@modelcontextprotocol/ext-apps" ;
27
38const app = new App ( { name : "Update Firebase Environment" , version : "1.0.0" } ) ;
49
@@ -13,7 +18,6 @@ let selectedProjectId: string | null = null;
1318
1419const envProjectIdEl = document . getElementById ( "env-project-id" ) as HTMLSpanElement ;
1520const envUserEl = document . getElementById ( "env-user" ) as HTMLSpanElement ;
16- const currentEnvBox = document . getElementById ( "current-env" ) as HTMLDivElement ;
1721
1822function showStatus ( message : string , type : "success" | "error" | "info" ) {
1923 statusBox . textContent = message ;
@@ -99,10 +103,6 @@ submitBtn.onclick = async () => {
99103 }
100104} ;
101105
102- app . ontoolresult = ( result : any ) => {
103- // We can handle tool results if needed, but we rely on manual triggers for list_projects
104- } ;
105-
106106app . onhostcontextchanged = ( ctx : any ) => {
107107 if ( ctx . theme ) applyDocumentTheme ( ctx . theme ) ;
108108 if ( ctx . styles ?. variables ) applyHostStyleVariables ( ctx . styles . variables ) ;
@@ -120,7 +120,10 @@ app.onhostcontextchanged = (ctx: any) => {
120120
121121 // Fetch current environment
122122 try {
123- const envResult = await app . callServerTool ( { name : "firebase_get_environment" , arguments : { } } ) ;
123+ const envResult = await app . callServerTool ( {
124+ name : "firebase_get_environment" ,
125+ arguments : { } ,
126+ } ) ;
124127 const envData = envResult . structuredContent as any ;
125128 if ( envData ) {
126129 envProjectIdEl . textContent = envData . projectId || "<NONE>" ;
@@ -140,7 +143,9 @@ app.onhostcontextchanged = (ctx: any) => {
140143 filteredProjects = projects ;
141144 renderProjects ( ) ;
142145 showStatus ( "Projects loaded successfully." , "success" ) ;
143- setTimeout ( ( ) => { if ( statusBox . className === "status success" ) statusBox . style . display = "none" ; } , 3000 ) ;
146+ setTimeout ( ( ) => {
147+ if ( statusBox . className === "status success" ) statusBox . style . display = "none" ;
148+ } , 3000 ) ;
144149 } else {
145150 showStatus ( "No projects returned from server." , "error" ) ;
146151 }
0 commit comments