You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wholesale overwrites of init.ts and init_ai.ts based on the work that… (#9226)
* wholesale overwrites of init.ts and init_ai.ts based on the work that has been done over the past few weeks
* Apply suggestion from @gemini-code-assist[bot]
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Apply suggestion from @gemini-code-assist[bot]
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Apply suggestion from @gemini-code-assist[bot]
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Apply suggestion from @gemini-code-assist[bot]
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* fixing regressions introduced while dealing with git issues
---------
Co-authored-by: Joe Hanley <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/mcp/prompts/core/init.ts
+26-17Lines changed: 26 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -46,20 +46,35 @@ ${config.readProjectFile("firebase.json", { fallback: "<FILE DOES NOT EXIST>" })
46
46
47
47
Follow the steps below taking note of any user instructions provided above.
48
48
49
-
IMPORTANT: The backend setup guide is for web apps only. If the user requests backend setup for a mobile app (iOS, Android, or Flutter), inform them that this is not supported and do not use the backend setup guide. You can still assist with other requests.
50
-
51
49
1. If there is no active user, use the \`firebase_login\` tool to help them sign in.
52
50
- If you run into issues logging the user in, suggest that they run \`npx firebase-tools login --reauth\` in a separate terminal
53
-
2. If there is no active Firebase project, ask the user if they would like to create a project, or use an existing one, and ask them for the project ID
51
+
2.1 If the user supplied specific instructions, determine which of the services listed below are the best match for the user's needs. Skip to 2.2 if they didn't provide a prompt
52
+
1. Backend Services: Backend services for the user such as user authentication, database, or hosting.
53
+
2. Firebase AI Logic: Add AI features such as chat experiences, multimodal prompts, image generation and editing (via nano banana), etc.
54
+
- UNAVAILABLE SERVICES: Analytics, Remote Config (feature flagging), A/B testing, Crashlytics (crash reporting), and Cloud Messaging (push notifications) are not yet available for setup via this command.
55
+
2.2 Start by listing out the existing init options that are available to the user. Ask the user which set of services they would like to add to their app. Always enumerate them and list the options out explicitly for the user.
56
+
1. Backend Services: Backend services for the user such as user authentication, database, or cloud file hosting.
57
+
- IMPORTANT: The backend setup guide is for web apps only. If the user requests backend setup for a mobile app (iOS, Android, or Flutter), inform them that this is not supported and do not use the backend setup guide. You can still assist with other requests.
58
+
2. Firebase AI Logic: Add AI features such as chat experiences, multimodal prompts, image generation and editing (via nano banana), etc.
59
+
- IMPORTANT: The Firebase AI Logic setup guide is for web, flutter, and android apps only. If the user requests firebase setup for unsupported platforms (iOS, Unity, or anything else), inform them that this is not supported and direct the user to Firebase Docs to learn how to set up AI Logic for their application (share this link with the user https://firebase.google.com/docs/ai-logic/get-started?api=dev). You can still assist with other requests.
60
+
3. After the user chooses an init option, create a plan based on the remaining steps in this guide, share it with the user, and give them an opportunity to accept or adjust it.
61
+
4. If there is no active Firebase project, ask the user if they would like to create a project, or use an existing one, and ask them for the project ID
54
62
- If they would like to create a project, use the firebase_create_project with the project ID
55
63
- If they would like to use an existing project, use the firebase_update_environment tool with the active_project argument.
56
64
- If you run into issues creating the firebase project, ask the user to go to the [Firebase Console](http://console.firebase.google.com/) and create a project. Wait for the user to report back before continuing.
57
-
3. Ensure there is an active Firebase App for their platform
58
-
- Run the \`firebase_list_apps\` tool to list their apps, and find an app that matches their "Workspace platform"
59
-
- If there is no app that matches that criteria, use the \`firebase_create_app\` tool to create the app with the appropriate platform
60
-
4. Now that we have a working environment, print out 1) Active user 2) Firebase Project and 3) Firebase App & platform they are using for this process.
65
+
5. Ensure there is an active Firebase App for their platform
66
+
- Do the following only for Web and Android apps
67
+
- Run the \`firebase_list_apps\` tool to list their apps, and find an app that matches their "Workspace platform"
68
+
- If there is no app that matches that criteria, use the \`firebase_create_app\` tool to create the app with the appropriate platform
69
+
- Do the following only for Flutter apps
70
+
- Install the Flutterfire CLI
71
+
- Use the Flutterfire CLI tool to connect to the project
72
+
- Use the Flutterfire CLI to register the appropriate applications based on the user's input
73
+
- Let the developer know that you currently only support configuring web, ios, and android targets together in a bundle. Each of those targets will have appropriate apps registered in the project using the flutterfire CLI
74
+
- Execute flutterfire config using the following pattern: flutterfire config --yes --project=<aliasOrProjectId> --platforms=<platforms>
75
+
6. Now that we have a working environment, print out 1) Active user 2) Firebase Project and 3) Firebase App & platform they are using for this process.
61
76
- Ask the user to confirm this is correct before continuing
62
-
5. Set up the web Firebase SDK
77
+
7. Set up the web Firebase SDK. Skip straight to #8 for Flutter and Android apps
63
78
- Fetch the configuration for the specified app using the \`firebase_get_sdk_config\` tool.
64
79
- Write the Firebase SDK config to a file
65
80
- Check what the latest version of the SDK is by running the command 'npm view firebase version'
@@ -73,17 +88,11 @@ IMPORTANT: The backend setup guide is for web apps only. If the user requests ba
73
88
'''
74
89
import { initializeApp } from 'https://www.gstatic.com/firebasejs/12.3.0/firebase-app.js'
75
90
'''
76
-
7. Determine which of the services listed below are the best match for the user's needs based on their instructions or by asking them.
77
91
8. Read the guide for the appropriate services and follow the instructions. If no guides match the user's need, inform the user.
92
+
- Use the Firebase \`read_resources\` tool to load the instructions for the service the developer chose in step 2 of this guide
93
+
- [Backend Services](firebase://guides/init/backend): Read this resource to setup backend services for the user such as user authentication, database, or hosting.
94
+
- [Firebase AI Logic](firebase://guides/init/ai): Read this resource to add Gemini-powered AI features such as chat experiences, multimodal prompts, image generation, image editing (via nano banana), etc.
78
95
79
-
## Available Services
80
-
81
-
The following Firebase services are available to be configured. Use the Firebase \`read_resources\` tool to load their instructions for further guidance.
82
-
83
-
- [Backend Services](firebase://guides/init/backend): Read this resource to setup backend services for the user such as user authentication, database, or hosting.
84
-
- [GenAI Services](firebase://guides/init/ai): Read this resource to setup GenAI services for the user such as building agents, LLM usage, unstructured data analysis, image editing, video generation, etc.
85
-
86
-
UNAVAILABLE SERVICES: Analytics, Remote Config (feature flagging), A/B testing, Crashlytics (crash reporting), and Cloud Messaging (push notifications) are not yet available for setup via this command.
0 commit comments