Skip to content

Commit 9c2d1e9

Browse files
apeynadojoehangemini-code-assist[bot]
authored
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>
1 parent 789263e commit 9c2d1e9

File tree

2 files changed

+119
-136
lines changed

2 files changed

+119
-136
lines changed

src/mcp/prompts/core/init.ts

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,35 @@ ${config.readProjectFile("firebase.json", { fallback: "<FILE DOES NOT EXIST>" })
4646
4747
Follow the steps below taking note of any user instructions provided above.
4848
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-
5149
1. If there is no active user, use the \`firebase_login\` tool to help them sign in.
5250
- 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
5462
- If they would like to create a project, use the firebase_create_project with the project ID
5563
- If they would like to use an existing project, use the firebase_update_environment tool with the active_project argument.
5664
- 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.
6176
- 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
6378
- Fetch the configuration for the specified app using the \`firebase_get_sdk_config\` tool.
6479
- Write the Firebase SDK config to a file
6580
- 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
7388
'''
7489
import { initializeApp } from 'https://www.gstatic.com/firebasejs/12.3.0/firebase-app.js'
7590
'''
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.
7791
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.
7895
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.
8796
`.trim(),
8897
},
8998
},

0 commit comments

Comments
 (0)