|
1 | 1 | import { getPlatformFromFolder } from "../../../dataconnect/appFinder";
|
2 | 2 | import { Platform } from "../../../dataconnect/types";
|
3 | 3 | import { prompt } from "../../prompt";
|
4 |
| -import { init_ai } from "../../resources/guides/init_ai"; |
5 |
| -import { init_backend } from "../../resources/guides/init_backend"; |
6 |
| -import { ServerResource } from "../../resource"; |
7 |
| - |
8 |
| -const GUIDE_PARAMS: Record<string, ServerResource> = { |
9 |
| - "ai-logic": init_ai, |
10 |
| - backend: init_backend, |
11 |
| -}; |
12 | 4 |
|
13 | 5 | export const init = prompt(
|
14 | 6 | {
|
15 | 7 | name: "init",
|
16 | 8 | description: "Use this command to setup Firebase for the current workspace.",
|
17 |
| - arguments: [ |
18 |
| - { |
19 |
| - name: "prompt", |
20 |
| - description: "any Firebase products you want to use or the problems you're trying to solve", |
21 |
| - required: false, |
22 |
| - }, |
23 |
| - ], |
24 | 9 | annotations: {
|
25 | 10 | title: "Initialize Firebase",
|
26 | 11 | },
|
27 | 12 | },
|
28 |
| - async ({ prompt }, mcp) => { |
| 13 | + async (_, mcp) => { |
29 | 14 | const { config, projectId, accountEmail } = mcp;
|
30 | 15 |
|
31 |
| - // This allows a "short circuit" feature where you can pass a specific |
32 |
| - // name, like "ai-logic" into the prompt and get a specific guide |
33 |
| - const resourceDefinition = prompt ? GUIDE_PARAMS[prompt] : undefined; |
34 |
| - if (resourceDefinition) { |
35 |
| - const resource = await resourceDefinition.fn(resourceDefinition.mcp.uri, mcp); |
36 |
| - return resource.contents |
37 |
| - .filter((resContents) => !!resContents.text) |
38 |
| - .map((resContents) => ({ |
39 |
| - role: "user" as const, |
40 |
| - content: { |
41 |
| - type: "text", |
42 |
| - text: String(resContents.text), |
43 |
| - }, |
44 |
| - })); |
45 |
| - } |
46 |
| - |
47 | 16 | const platform = await getPlatformFromFolder(config.projectDir);
|
48 | 17 |
|
49 | 18 | return [
|
@@ -72,9 +41,6 @@ Contents of \`firebase.json\` config file:
|
72 | 41 | ${config.readProjectFile("firebase.json", { fallback: "<FILE DOES NOT EXIST>" })}
|
73 | 42 | \`\`\`
|
74 | 43 |
|
75 |
| -## User Instructions |
76 |
| -
|
77 |
| -${prompt || "<the user didn't supply specific instructions>"} |
78 | 44 |
|
79 | 45 | ## Steps
|
80 | 46 |
|
|
0 commit comments