firebase-tools 14.20.0 → 14.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/appUtils.js +2 -1
- package/lib/command.js +5 -9
- package/lib/commands/dataconnect-sdk-generate.js +66 -11
- package/lib/commands/deploy.js +6 -4
- package/lib/commands/firestore-databases-clone.js +99 -0
- package/lib/commands/functions-secrets-set.js +19 -1
- package/lib/commands/hosting-sites-create.js +4 -3
- package/lib/commands/index.js +1 -0
- package/lib/commands/init.js +12 -8
- package/lib/commands/internaltesting-functions-discover.js +1 -3
- package/lib/dataconnect/provisionCloudSql.js +3 -2
- package/lib/deploy/extensions/prepare.js +3 -1
- package/lib/deploy/functions/checkIam.js +1 -1
- package/lib/deploy/functions/functionsDeployHelper.js +8 -7
- package/lib/deploy/functions/params.js +15 -5
- package/lib/deploy/functions/prepare.js +9 -6
- package/lib/detectProjectRoot.js +1 -1
- package/lib/emulator/downloadableEmulatorInfo.json +18 -18
- package/lib/emulator/hubExport.js +5 -0
- package/lib/experiments.js +0 -7
- package/lib/firestore/api.js +15 -0
- package/lib/firestore/util.js +22 -1
- package/lib/frameworks/angular/index.js +1 -1
- package/lib/frameworks/flutter/index.js +1 -1
- package/lib/frameworks/next/index.js +1 -1
- package/lib/frameworks/nuxt/index.js +1 -1
- package/lib/frameworks/vite/index.js +5 -2
- package/lib/functions/projectConfig.js +5 -1
- package/lib/functions/secrets.js +14 -1
- package/lib/hosting/interactive.js +14 -19
- package/lib/init/features/dataconnect/index.js +21 -20
- package/lib/init/features/dataconnect/sdk.js +44 -21
- package/lib/init/features/functions/index.js +1 -0
- package/lib/init/features/hosting/index.js +96 -93
- package/lib/init/features/index.js +3 -2
- package/lib/init/index.js +7 -3
- package/lib/mcp/index.js +46 -18
- package/lib/mcp/prompt.js +4 -1
- package/lib/mcp/prompts/core/consult.js +1 -1
- package/lib/mcp/prompts/core/deploy.js +1 -1
- package/lib/mcp/prompts/core/init.js +1 -1
- package/lib/mcp/prompts/crashlytics/connect.js +1 -1
- package/lib/mcp/prompts/dataconnect/schema.js +1 -1
- package/lib/mcp/prompts/index.js +20 -10
- package/lib/mcp/resources/guides/init_backend.js +3 -26
- package/lib/mcp/resources/guides/init_hosting.js +15 -10
- package/lib/mcp/tool.js +17 -2
- package/lib/mcp/tools/apphosting/fetch_logs.js +1 -1
- package/lib/mcp/tools/apphosting/list_backends.js +1 -1
- package/lib/mcp/tools/auth/get_users.js +1 -1
- package/lib/mcp/tools/auth/set_sms_region_policy.js +1 -1
- package/lib/mcp/tools/auth/update_user.js +1 -1
- package/lib/mcp/tools/core/create_android_sha.js +1 -1
- package/lib/mcp/tools/core/create_app.js +1 -1
- package/lib/mcp/tools/core/create_project.js +1 -1
- package/lib/mcp/tools/core/get_environment.js +1 -1
- package/lib/mcp/tools/core/get_project.js +1 -1
- package/lib/mcp/tools/core/get_sdk_config.js +1 -1
- package/lib/mcp/tools/core/get_security_rules.js +1 -1
- package/lib/mcp/tools/core/init.js +30 -2
- package/lib/mcp/tools/core/list_apps.js +1 -1
- package/lib/mcp/tools/core/list_projects.js +1 -1
- package/lib/mcp/tools/core/login.js +1 -1
- package/lib/mcp/tools/core/logout.js +1 -1
- package/lib/mcp/tools/core/read_resources.js +1 -1
- package/lib/mcp/tools/core/update_environment.js +1 -1
- package/lib/mcp/tools/core/validate_security_rules.js +15 -1
- package/lib/mcp/tools/crashlytics/events.js +3 -3
- package/lib/mcp/tools/crashlytics/issues.js +3 -3
- package/lib/mcp/tools/crashlytics/notes.js +4 -4
- package/lib/mcp/tools/crashlytics/reports.js +6 -6
- package/lib/mcp/tools/dataconnect/compile.js +1 -1
- package/lib/mcp/tools/dataconnect/execute.js +1 -1
- package/lib/mcp/tools/dataconnect/generate_operation.js +1 -1
- package/lib/mcp/tools/dataconnect/generate_schema.js +1 -1
- package/lib/mcp/tools/dataconnect/list_services.js +1 -1
- package/lib/mcp/tools/firestore/delete_document.js +1 -1
- package/lib/mcp/tools/firestore/get_documents.js +1 -1
- package/lib/mcp/tools/firestore/list_collections.js +1 -1
- package/lib/mcp/tools/firestore/query_collection.js +1 -1
- package/lib/mcp/tools/functions/get_logs.js +1 -1
- package/lib/mcp/tools/index.js +14 -4
- package/lib/mcp/tools/messaging/send_message.js +1 -1
- package/lib/mcp/tools/realtime_database/get_data.js +1 -1
- package/lib/mcp/tools/realtime_database/set_data.js +1 -1
- package/lib/mcp/tools/remoteconfig/get_template.js +1 -1
- package/lib/mcp/tools/remoteconfig/update_template.js +1 -1
- package/lib/mcp/tools/storage/get_download_url.js +1 -1
- package/lib/mcp/util/availability.js +22 -0
- package/lib/mcp/util/crashlytics/availability.js +81 -0
- package/lib/mcp/util.js +26 -6
- package/package.json +1 -1
- package/schema/firebase-config.json +3 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init_hosting = void 0;
|
|
4
|
+
const getDefaultHostingSite_1 = require("../../../getDefaultHostingSite");
|
|
4
5
|
const resource_1 = require("../../resource");
|
|
5
6
|
exports.init_hosting = (0, resource_1.resource)({
|
|
6
7
|
uri: "firebase://guides/init/hosting",
|
|
7
8
|
name: "hosting_init_guide",
|
|
8
9
|
title: "Firebase Hosting Deployment Guide",
|
|
9
10
|
description: "guides the coding agent through deploying to Firebase Hosting in the current project",
|
|
10
|
-
}, async (uri) => {
|
|
11
|
+
}, async (uri, ctx) => {
|
|
12
|
+
const defaultHostingSite = await (0, getDefaultHostingSite_1.getDefaultHostingSite)(ctx);
|
|
11
13
|
return {
|
|
12
14
|
contents: [
|
|
13
15
|
{
|
|
@@ -15,18 +17,21 @@ exports.init_hosting = (0, resource_1.resource)({
|
|
|
15
17
|
type: "text",
|
|
16
18
|
text: `
|
|
17
19
|
### Configure Firebase Hosting
|
|
20
|
+
Default hosting site for ${ctx.projectId}: ${defaultHostingSite || "Does not exist"}
|
|
21
|
+
If there is not a default hosting site configured, ask the user what the site ID should be, and suggest ${ctx.projectId} as a good choice.
|
|
22
|
+
Next, use the 'firebase_init' tool to set up hosting. Below is an example of what the arguments to do so look like;
|
|
23
|
+
however, you should change the values to match the user's choices and project structure:
|
|
24
|
+
{
|
|
25
|
+
features: {
|
|
26
|
+
hosting: {
|
|
27
|
+
site_id: ${ctx.projectId},
|
|
28
|
+
public_directory: public,
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
18
32
|
|
|
19
33
|
**Security Warning:**
|
|
20
34
|
- Files included in the public folder of a hosting site are publicly accessible. Do not include sensitive API keys for services other than Firebase in these files.
|
|
21
|
-
|
|
22
|
-
**When to Deploy:**
|
|
23
|
-
- Introduce Firebase Hosting when developers are ready to deploy their application to production.
|
|
24
|
-
- Alternative: Developers can deploy later using the \`/firebase:deploy\` command.
|
|
25
|
-
|
|
26
|
-
**Deployment Process:**
|
|
27
|
-
- Request developer's permission before implementing Firebase Hosting
|
|
28
|
-
- Request developer's permission before deploying Firebase Hosting app to production.
|
|
29
|
-
- Configure Firebase Hosting and deploy the application to production
|
|
30
35
|
`.trim(),
|
|
31
36
|
},
|
|
32
37
|
],
|
package/lib/mcp/tool.js
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.tool = void 0;
|
|
4
15
|
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
5
16
|
const util_1 = require("./util");
|
|
6
|
-
|
|
17
|
+
const availability_1 = require("./util/availability");
|
|
18
|
+
function tool(feature, options, fn) {
|
|
19
|
+
const { isAvailable } = options, mcpOptions = __rest(options, ["isAvailable"]);
|
|
20
|
+
const isAvailableFunc = isAvailable || (0, availability_1.getDefaultFeatureAvailabilityCheck)(feature);
|
|
7
21
|
return {
|
|
8
|
-
mcp: Object.assign(Object.assign({},
|
|
22
|
+
mcp: Object.assign(Object.assign({}, mcpOptions), { inputSchema: (0, util_1.cleanSchema)((0, zod_to_json_schema_1.zodToJsonSchema)(options.inputSchema)) }),
|
|
9
23
|
fn,
|
|
24
|
+
isAvailable: isAvailableFunc,
|
|
10
25
|
};
|
|
11
26
|
}
|
|
12
27
|
exports.tool = tool;
|
|
@@ -9,7 +9,7 @@ const utils_1 = require("../../../utils");
|
|
|
9
9
|
const error_1 = require("../../../error");
|
|
10
10
|
const run_1 = require("../../../gcp/run");
|
|
11
11
|
const cloudlogging_1 = require("../../../gcp/cloudlogging");
|
|
12
|
-
exports.fetch_logs = (0, tool_1.tool)({
|
|
12
|
+
exports.fetch_logs = (0, tool_1.tool)("apphosting", {
|
|
13
13
|
name: "fetch_logs",
|
|
14
14
|
description: "Use this to fetch the most recent logs for a specified App Hosting backend. If `buildLogs` is specified, the logs from the build process for the latest build are returned. The most recent logs are listed first.",
|
|
15
15
|
inputSchema: zod_1.z.object({
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const apphosting_1 = require("../../../gcp/apphosting");
|
|
8
|
-
exports.list_backends = (0, tool_1.tool)({
|
|
8
|
+
exports.list_backends = (0, tool_1.tool)("apphosting", {
|
|
9
9
|
name: "list_backends",
|
|
10
10
|
description: "Use this to retrieve a list of App Hosting backends in the current project. An empty list means that there are no backends. " +
|
|
11
11
|
"The `uri` is the public URL of the backend. " +
|
|
@@ -16,7 +16,7 @@ const zod_1 = require("zod");
|
|
|
16
16
|
const tool_1 = require("../../tool");
|
|
17
17
|
const util_1 = require("../../util");
|
|
18
18
|
const auth_1 = require("../../../gcp/auth");
|
|
19
|
-
exports.get_users = (0, tool_1.tool)({
|
|
19
|
+
exports.get_users = (0, tool_1.tool)("auth", {
|
|
20
20
|
name: "get_users",
|
|
21
21
|
description: "Use this to retrieve one or more Firebase Auth users based on a list of UIDs or a list of emails.",
|
|
22
22
|
inputSchema: zod_1.z.object({
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const auth_1 = require("../../../gcp/auth");
|
|
8
|
-
exports.set_sms_region_policy = (0, tool_1.tool)({
|
|
8
|
+
exports.set_sms_region_policy = (0, tool_1.tool)("auth", {
|
|
9
9
|
name: "set_sms_region_policy",
|
|
10
10
|
description: "Use this to set an SMS region policy for Firebase Authentication to restrict the regions which can receive text messages based on an ALLOW or DENY list of country codes. This policy will override any existing policies when set.",
|
|
11
11
|
inputSchema: zod_1.z.object({
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const auth_1 = require("../../../gcp/auth");
|
|
8
|
-
exports.update_user = (0, tool_1.tool)({
|
|
8
|
+
exports.update_user = (0, tool_1.tool)("auth", {
|
|
9
9
|
name: "update_user",
|
|
10
10
|
description: "Use this to disable, enable, or set a custom claim on a specific user's account.",
|
|
11
11
|
inputSchema: zod_1.z.object({
|
|
@@ -14,7 +14,7 @@ function getCertHashType(shaHash) {
|
|
|
14
14
|
return apps_1.ShaCertificateType.SHA_256.toString();
|
|
15
15
|
return apps_1.ShaCertificateType.SHA_CERTIFICATE_TYPE_UNSPECIFIED.toString();
|
|
16
16
|
}
|
|
17
|
-
exports.create_android_sha = (0, tool_1.tool)({
|
|
17
|
+
exports.create_android_sha = (0, tool_1.tool)("core", {
|
|
18
18
|
name: "create_android_sha",
|
|
19
19
|
description: "Use this to add the specified SHA certificate hash to the specified Firebase Android App.",
|
|
20
20
|
inputSchema: zod_1.z.object({
|
|
@@ -7,7 +7,7 @@ const util_1 = require("../../util");
|
|
|
7
7
|
const apps_1 = require("../../../management/apps");
|
|
8
8
|
const CREATE_APP_OUTUT_PREFIX = "Created app with the following details:\n\n";
|
|
9
9
|
const CREATE_APP_OUTUT_SUFFIX = "\n\nTo fetch the SDK configuration for this app, use the firebase_get_sdk_config tool.";
|
|
10
|
-
exports.create_app = (0, tool_1.tool)({
|
|
10
|
+
exports.create_app = (0, tool_1.tool)("core", {
|
|
11
11
|
name: "create_app",
|
|
12
12
|
description: "Use this to create a new Firebase App in the currently active Firebase Project. Firebase Apps can be iOS, Android, or Web.",
|
|
13
13
|
inputSchema: zod_1.z.object({
|
|
@@ -17,7 +17,7 @@ async function checkCloudProject(projectId) {
|
|
|
17
17
|
throw err;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
exports.create_project = (0, tool_1.tool)({
|
|
20
|
+
exports.create_project = (0, tool_1.tool)("core", {
|
|
21
21
|
name: "create_project",
|
|
22
22
|
description: "Use this to create a new Firebase Project.",
|
|
23
23
|
inputSchema: zod_1.z.object({
|
|
@@ -9,7 +9,7 @@ const js_yaml_1 = require("js-yaml");
|
|
|
9
9
|
const auth_1 = require("../../../auth");
|
|
10
10
|
const configstore_1 = require("../../../configstore");
|
|
11
11
|
const appUtils_1 = require("../../../appUtils");
|
|
12
|
-
exports.get_environment = (0, tool_1.tool)({
|
|
12
|
+
exports.get_environment = (0, tool_1.tool)("core", {
|
|
13
13
|
name: "get_environment",
|
|
14
14
|
description: "Use this to retrieve the current Firebase **environment** configuration for the Firebase CLI and Firebase MCP server, including current authenticated user, project directory, active Firebase Project, and more.",
|
|
15
15
|
inputSchema: zod_1.z.object({}),
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
6
|
const projects_1 = require("../../../management/projects");
|
|
7
7
|
const util_1 = require("../../util");
|
|
8
|
-
exports.get_project = (0, tool_1.tool)({
|
|
8
|
+
exports.get_project = (0, tool_1.tool)("core", {
|
|
9
9
|
name: "get_project",
|
|
10
10
|
description: "Use this to retrieve information about the currently active Firebase Project.",
|
|
11
11
|
inputSchema: zod_1.z.object({}),
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const apps_1 = require("../../../management/apps");
|
|
8
|
-
exports.get_sdk_config = (0, tool_1.tool)({
|
|
8
|
+
exports.get_sdk_config = (0, tool_1.tool)("core", {
|
|
9
9
|
name: "get_sdk_config",
|
|
10
10
|
description: "Use this to retrieve the Firebase configuration information for a Firebase App. " +
|
|
11
11
|
"You must specify EITHER a platform OR the Firebase App ID for a Firebase App registered in the currently active Firebase Project.",
|
|
@@ -7,7 +7,7 @@ const tool_1 = require("../../tool");
|
|
|
7
7
|
const util_1 = require("../../util");
|
|
8
8
|
const rules_1 = require("../../../gcp/rules");
|
|
9
9
|
const getDefaultDatabaseInstance_1 = require("../../../getDefaultDatabaseInstance");
|
|
10
|
-
exports.get_security_rules = (0, tool_1.tool)({
|
|
10
|
+
exports.get_security_rules = (0, tool_1.tool)("core", {
|
|
11
11
|
name: "get_security_rules",
|
|
12
12
|
description: "Use this to retrieve the security rules for a specified Firebase service. " +
|
|
13
13
|
"If there are multiple instances of that service in the product, the rules for the defualt instance are returned.",
|
|
@@ -12,7 +12,7 @@ const error_1 = require("../../../error");
|
|
|
12
12
|
const utils_1 = require("../../../init/features/ailogic/utils");
|
|
13
13
|
const projects_1 = require("../../../management/projects");
|
|
14
14
|
const dataconnect_1 = require("../../../init/features/dataconnect");
|
|
15
|
-
exports.init = (0, tool_1.tool)({
|
|
15
|
+
exports.init = (0, tool_1.tool)("core", {
|
|
16
16
|
name: "init",
|
|
17
17
|
description: "Use this to initialize selected Firebase services in the workspace (Cloud Firestore database, Firebase Data Connect, Firebase Realtime Database, Firebase AI Logic). All services are optional; specify only the products you want to set up. " +
|
|
18
18
|
"You can initialize new features into an existing project directory, but re-initializing an existing feature may overwrite configuration. " +
|
|
@@ -115,6 +115,25 @@ exports.init = (0, tool_1.tool)({
|
|
|
115
115
|
})
|
|
116
116
|
.optional()
|
|
117
117
|
.describe("Enable Firebase AI Logic feature for existing app"),
|
|
118
|
+
hosting: zod_1.z
|
|
119
|
+
.object({
|
|
120
|
+
site_id: zod_1.z
|
|
121
|
+
.string()
|
|
122
|
+
.optional()
|
|
123
|
+
.describe("The ID of the hosting site to configure. If omitted and there is a default hosting site, that will be used."),
|
|
124
|
+
public_directory: zod_1.z
|
|
125
|
+
.string()
|
|
126
|
+
.optional()
|
|
127
|
+
.default("public")
|
|
128
|
+
.describe("The directory containing public files that will be served. If using a build tool, this likely should be the output directory of that tool."),
|
|
129
|
+
single_page_app: zod_1.z
|
|
130
|
+
.boolean()
|
|
131
|
+
.optional()
|
|
132
|
+
.default(false)
|
|
133
|
+
.describe("Configure as a single-page app."),
|
|
134
|
+
})
|
|
135
|
+
.optional()
|
|
136
|
+
.describe("Provide this object to initialize Firebase Hosting in this project directory."),
|
|
118
137
|
}),
|
|
119
138
|
}),
|
|
120
139
|
annotations: {
|
|
@@ -157,8 +176,9 @@ exports.init = (0, tool_1.tool)({
|
|
|
157
176
|
return err;
|
|
158
177
|
}
|
|
159
178
|
featuresList.push("dataconnect");
|
|
179
|
+
featureInfo.dataconnectSource = "mcp_init";
|
|
160
180
|
featureInfo.dataconnect = {
|
|
161
|
-
|
|
181
|
+
flow: "",
|
|
162
182
|
appDescription: features.dataconnect.app_description || "",
|
|
163
183
|
serviceId: features.dataconnect.service_id || "",
|
|
164
184
|
locationId: features.dataconnect.location_id || "",
|
|
@@ -184,6 +204,14 @@ exports.init = (0, tool_1.tool)({
|
|
|
184
204
|
displayName: appData.displayName,
|
|
185
205
|
};
|
|
186
206
|
}
|
|
207
|
+
if (features.hosting) {
|
|
208
|
+
featuresList.push("hosting");
|
|
209
|
+
featureInfo.hosting = {
|
|
210
|
+
newSiteId: features.hosting.site_id,
|
|
211
|
+
public: features.hosting.public_directory,
|
|
212
|
+
spa: features.hosting.single_page_app,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
187
215
|
const setup = {
|
|
188
216
|
config: config === null || config === void 0 ? void 0 : config.src,
|
|
189
217
|
rcfile: rc === null || rc === void 0 ? void 0 : rc.data,
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const apps_1 = require("../../../management/apps");
|
|
8
|
-
exports.list_apps = (0, tool_1.tool)({
|
|
8
|
+
exports.list_apps = (0, tool_1.tool)("core", {
|
|
9
9
|
name: "list_apps",
|
|
10
10
|
description: "Use this to retrieve a list of the Firebase Apps registered in the currently active Firebase project. Firebase Apps can be iOS, Android, or Web.",
|
|
11
11
|
inputSchema: zod_1.z.object({
|
|
@@ -6,7 +6,7 @@ const tool_1 = require("../../tool");
|
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const projects_1 = require("../../../management/projects");
|
|
8
8
|
const PROJECT_LIST_PAGE_SIZE = 20;
|
|
9
|
-
exports.list_projects = (0, tool_1.tool)({
|
|
9
|
+
exports.list_projects = (0, tool_1.tool)("core", {
|
|
10
10
|
name: "list_projects",
|
|
11
11
|
description: "Use this to retrieve a list of Firebase Projects that the signed-in user has access to.",
|
|
12
12
|
inputSchema: zod_1.z.object({
|
|
@@ -8,7 +8,7 @@ const util_1 = require("../../util");
|
|
|
8
8
|
const LoginInputSchema = zod_1.z.object({
|
|
9
9
|
authCode: zod_1.z.string().optional().describe("The authorization code from the login flow"),
|
|
10
10
|
});
|
|
11
|
-
exports.login = (0, tool_1.tool)({
|
|
11
|
+
exports.login = (0, tool_1.tool)("core", {
|
|
12
12
|
name: "login",
|
|
13
13
|
description: "Use this to sign the user into the Firebase CLI and Firebase MCP server. This requires a Google Account, and sign in is required to create and work with Firebase Projects.",
|
|
14
14
|
inputSchema: LoginInputSchema,
|
|
@@ -6,7 +6,7 @@ const tool_1 = require("../../tool");
|
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const auth_1 = require("../../../auth");
|
|
8
8
|
const logger_1 = require("../../../logger");
|
|
9
|
-
exports.logout = (0, tool_1.tool)({
|
|
9
|
+
exports.logout = (0, tool_1.tool)("core", {
|
|
10
10
|
name: "logout",
|
|
11
11
|
description: "Use this to sign the user out of the Firebase CLI and Firebase MCP server.",
|
|
12
12
|
inputSchema: zod_1.z.object({
|
|
@@ -6,7 +6,7 @@ const tool_1 = require("../../tool");
|
|
|
6
6
|
const resources_1 = require("../../resources");
|
|
7
7
|
const util_1 = require("../../util");
|
|
8
8
|
const track_1 = require("../../../track");
|
|
9
|
-
exports.read_resources = (0, tool_1.tool)({
|
|
9
|
+
exports.read_resources = (0, tool_1.tool)("core", {
|
|
10
10
|
name: "read_resources",
|
|
11
11
|
description: "Use this to read the contents of `firebase://` resources or list available resources",
|
|
12
12
|
annotations: {
|
|
@@ -8,7 +8,7 @@ const use_1 = require("../../../commands/use");
|
|
|
8
8
|
const auth_1 = require("../../../auth");
|
|
9
9
|
const node_fs_1 = require("node:fs");
|
|
10
10
|
const configstore_1 = require("../../../configstore");
|
|
11
|
-
exports.update_environment = (0, tool_1.tool)({
|
|
11
|
+
exports.update_environment = (0, tool_1.tool)("core", {
|
|
12
12
|
name: "update_environment",
|
|
13
13
|
description: "Use this to update environment config for the Firebase CLI and Firebase MCP server, such as project directory, active project, active user account, accept terms of service, and more. Use `firebase_get_environment` to see the currently configured environment.",
|
|
14
14
|
inputSchema: zod_1.z.object({
|
|
@@ -42,7 +42,7 @@ function formatRulesetIssues(issues, rulesSource) {
|
|
|
42
42
|
}
|
|
43
43
|
return formattedOutput.join("\n\n");
|
|
44
44
|
}
|
|
45
|
-
exports.validate_security_rules = (0, tool_1.tool)({
|
|
45
|
+
exports.validate_security_rules = (0, tool_1.tool)("core", {
|
|
46
46
|
name: "validate_security_rules",
|
|
47
47
|
description: "Use this to check Firebase Security Rules for Firestore, Storage, or Realtime Database for syntax and validation errors.",
|
|
48
48
|
inputSchema: zod_1.z.object({
|
|
@@ -64,6 +64,20 @@ exports.validate_security_rules = (0, tool_1.tool)({
|
|
|
64
64
|
requiresProject: true,
|
|
65
65
|
requiresAuth: true,
|
|
66
66
|
},
|
|
67
|
+
isAvailable: async (ctx) => {
|
|
68
|
+
const [rtdbActive, storageActive, firestoreActive] = await Promise.all([
|
|
69
|
+
(0, util_1.checkFeatureActive)("database", ctx.projectId, {
|
|
70
|
+
config: ctx.config,
|
|
71
|
+
}),
|
|
72
|
+
(0, util_1.checkFeatureActive)("storage", ctx.projectId, {
|
|
73
|
+
config: ctx.config,
|
|
74
|
+
}),
|
|
75
|
+
(0, util_1.checkFeatureActive)("firestore", ctx.projectId, {
|
|
76
|
+
config: ctx.config,
|
|
77
|
+
}),
|
|
78
|
+
]);
|
|
79
|
+
return rtdbActive || storageActive || firestoreActive;
|
|
80
|
+
},
|
|
67
81
|
}, async ({ type, source, source_file }, { projectId, config, host }) => {
|
|
68
82
|
var _a, _b;
|
|
69
83
|
let rulesSourceContent;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.batch_get_events = exports.list_events = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
|
-
const util_1 = require("../../util");
|
|
7
6
|
const events_1 = require("../../../crashlytics/events");
|
|
8
7
|
const types_1 = require("../../../crashlytics/types");
|
|
9
8
|
const filters_1 = require("../../../crashlytics/filters");
|
|
9
|
+
const util_1 = require("../../util");
|
|
10
10
|
function pruneThreads(sample) {
|
|
11
11
|
var _a, _b, _c;
|
|
12
12
|
if (((_a = sample.issue) === null || _a === void 0 ? void 0 : _a.errorType) === types_1.ErrorType.FATAL || ((_b = sample.issue) === null || _b === void 0 ? void 0 : _b.errorType) === types_1.ErrorType.ANR) {
|
|
@@ -14,7 +14,7 @@ function pruneThreads(sample) {
|
|
|
14
14
|
}
|
|
15
15
|
return sample;
|
|
16
16
|
}
|
|
17
|
-
exports.list_events = (0, tool_1.tool)({
|
|
17
|
+
exports.list_events = (0, tool_1.tool)("crashlytics", {
|
|
18
18
|
name: "list_events",
|
|
19
19
|
description: `Use this to list the most recent events matching the given filters.
|
|
20
20
|
Can be used to fetch sample crashes and exceptions for an issue,
|
|
@@ -40,7 +40,7 @@ exports.list_events = (0, tool_1.tool)({
|
|
|
40
40
|
response.events = response.events ? response.events.map((e) => pruneThreads(e)) : [];
|
|
41
41
|
return (0, util_1.toContent)(response);
|
|
42
42
|
});
|
|
43
|
-
exports.batch_get_events = (0, tool_1.tool)({
|
|
43
|
+
exports.batch_get_events = (0, tool_1.tool)("crashlytics", {
|
|
44
44
|
name: "batch_get_events",
|
|
45
45
|
description: `Gets specific events by resource name.
|
|
46
46
|
Can be used to fetch sample crashes and exceptions for an issue,
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.update_issue = exports.get_issue = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
|
-
const util_1 = require("../../util");
|
|
7
6
|
const issues_1 = require("../../../crashlytics/issues");
|
|
8
7
|
const types_1 = require("../../../crashlytics/types");
|
|
9
8
|
const filters_1 = require("../../../crashlytics/filters");
|
|
10
|
-
|
|
9
|
+
const util_1 = require("../../util");
|
|
10
|
+
exports.get_issue = (0, tool_1.tool)("crashlytics", {
|
|
11
11
|
name: "get_issue",
|
|
12
12
|
description: `Gets data for a Crashlytics issue, which can be used as a starting point for debugging.`,
|
|
13
13
|
inputSchema: zod_1.z.object({
|
|
@@ -28,7 +28,7 @@ exports.get_issue = (0, tool_1.tool)({
|
|
|
28
28
|
return (0, util_1.mcpError)(`Must specify 'issueId' parameter.`);
|
|
29
29
|
return (0, util_1.toContent)(await (0, issues_1.getIssue)(appId, issueId));
|
|
30
30
|
});
|
|
31
|
-
exports.update_issue = (0, tool_1.tool)({
|
|
31
|
+
exports.update_issue = (0, tool_1.tool)("crashlytics", {
|
|
32
32
|
name: "update_issue",
|
|
33
33
|
description: "Use this to update the state of Crashlytics issue.",
|
|
34
34
|
inputSchema: zod_1.z.object({
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.delete_note = exports.list_notes = exports.create_note = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
|
-
const util_1 = require("../../util");
|
|
7
6
|
const notes_1 = require("../../../crashlytics/notes");
|
|
8
7
|
const filters_1 = require("../../../crashlytics/filters");
|
|
9
|
-
|
|
8
|
+
const util_1 = require("../../util");
|
|
9
|
+
exports.create_note = (0, tool_1.tool)("crashlytics", {
|
|
10
10
|
name: "create_note",
|
|
11
11
|
description: "Add a note to an issue from crashlytics.",
|
|
12
12
|
inputSchema: zod_1.z.object({
|
|
@@ -30,7 +30,7 @@ exports.create_note = (0, tool_1.tool)({
|
|
|
30
30
|
return (0, util_1.mcpError)(`Must specify 'note' parameter.`);
|
|
31
31
|
return (0, util_1.toContent)(await (0, notes_1.createNote)(appId, issueId, note));
|
|
32
32
|
});
|
|
33
|
-
exports.list_notes = (0, tool_1.tool)({
|
|
33
|
+
exports.list_notes = (0, tool_1.tool)("crashlytics", {
|
|
34
34
|
name: "list_notes",
|
|
35
35
|
description: "Use this to list all notes for an issue in Crashlytics.",
|
|
36
36
|
inputSchema: zod_1.z.object({
|
|
@@ -52,7 +52,7 @@ exports.list_notes = (0, tool_1.tool)({
|
|
|
52
52
|
return (0, util_1.mcpError)(`Must specify 'issueId' parameter.`);
|
|
53
53
|
return (0, util_1.toContent)(await (0, notes_1.listNotes)(appId, issueId, pageSize));
|
|
54
54
|
});
|
|
55
|
-
exports.delete_note = (0, tool_1.tool)({
|
|
55
|
+
exports.delete_note = (0, tool_1.tool)("crashlytics", {
|
|
56
56
|
name: "delete_note",
|
|
57
57
|
description: "Delete a note from a Crashlytics issue.",
|
|
58
58
|
inputSchema: zod_1.z.object({
|
|
@@ -28,7 +28,7 @@ function getReportContent(report, additionalPrompt) {
|
|
|
28
28
|
return (0, util_1.toContent)(reportResponse);
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
exports.get_top_issues = (0, tool_1.tool)({
|
|
31
|
+
exports.get_top_issues = (0, tool_1.tool)("crashlytics", {
|
|
32
32
|
name: "get_top_issues",
|
|
33
33
|
description: `Use this to count events and distinct impacted users, grouped by *issue*.
|
|
34
34
|
Groups are sorted by event count, in descending order.
|
|
@@ -45,7 +45,7 @@ exports.get_top_issues = (0, tool_1.tool)({
|
|
|
45
45
|
Pass the sampleEvent in the names field.
|
|
46
46
|
The crashlytics_list_events tool can retrieve a list of events for an issue in this response.
|
|
47
47
|
Pass the issue.id in the filter.issueId field.`));
|
|
48
|
-
exports.get_top_variants = (0, tool_1.tool)({
|
|
48
|
+
exports.get_top_variants = (0, tool_1.tool)("crashlytics", {
|
|
49
49
|
name: "get_top_variants",
|
|
50
50
|
description: `Counts events and distinct impacted users, grouped by issue *variant*.
|
|
51
51
|
Groups are sorted by event count, in descending order.
|
|
@@ -61,7 +61,7 @@ exports.get_top_variants = (0, tool_1.tool)({
|
|
|
61
61
|
}, getReportContent(reports_1.CrashlyticsReport.TopVariants, `The crashlytics_get_top_issues tool can report the top issues for the variants in this response.
|
|
62
62
|
Pass the variant.displayName in the filter.variantDisplayNames field.
|
|
63
63
|
The crashlytics_list_events tool can retrieve a list of events for a variant in this response.`));
|
|
64
|
-
exports.get_top_versions = (0, tool_1.tool)({
|
|
64
|
+
exports.get_top_versions = (0, tool_1.tool)("crashlytics", {
|
|
65
65
|
name: "get_top_versions",
|
|
66
66
|
description: `Counts events and distinct impacted users, grouped by *version*.
|
|
67
67
|
Groups are sorted by event count, in descending order.
|
|
@@ -77,7 +77,7 @@ exports.get_top_versions = (0, tool_1.tool)({
|
|
|
77
77
|
}, getReportContent(reports_1.CrashlyticsReport.TopVersions, `The crashlytics_get_top_issues tool can report the top issues for the versions in this response.
|
|
78
78
|
Pass the version.displayName in the filter.versionDisplayNames field.
|
|
79
79
|
The crashlytics_list_events tool can retrieve a list of events for a version in this response.`));
|
|
80
|
-
exports.get_top_apple_devices = (0, tool_1.tool)({
|
|
80
|
+
exports.get_top_apple_devices = (0, tool_1.tool)("crashlytics", {
|
|
81
81
|
name: "get_top_apple_devices",
|
|
82
82
|
description: `Counts events and distinct impacted users, grouped by apple *device*.
|
|
83
83
|
Groups are sorted by event count, in descending order.
|
|
@@ -94,7 +94,7 @@ exports.get_top_apple_devices = (0, tool_1.tool)({
|
|
|
94
94
|
}, getReportContent(reports_1.CrashlyticsReport.TopAppleDevices, `The crashlytics_get_top_issues tool can report the top issues for the devices in this response.
|
|
95
95
|
Pass the device.displayName in the filter.deviceDisplayNames field.
|
|
96
96
|
The crashlytics_list_events tool can retrieve a list of events for a device in this response.`));
|
|
97
|
-
exports.get_top_android_devices = (0, tool_1.tool)({
|
|
97
|
+
exports.get_top_android_devices = (0, tool_1.tool)("crashlytics", {
|
|
98
98
|
name: "get_top_android_devices",
|
|
99
99
|
description: `Counts events and distinct impacted users, grouped by android *device*.
|
|
100
100
|
Groups are sorted by event count, in descending order.
|
|
@@ -111,7 +111,7 @@ exports.get_top_android_devices = (0, tool_1.tool)({
|
|
|
111
111
|
}, getReportContent(reports_1.CrashlyticsReport.TopAndroidDevices, `The crashlytics_get_top_issues tool can report the top issues for the devices in this response.
|
|
112
112
|
Pass the device.displayName in the filter.deviceDisplayNames field.
|
|
113
113
|
The crashlytics_list_events tool can retrieve a list of events for a device in this response.`));
|
|
114
|
-
exports.get_top_operating_systems = (0, tool_1.tool)({
|
|
114
|
+
exports.get_top_operating_systems = (0, tool_1.tool)("crashlytics", {
|
|
115
115
|
name: "get_top_operating_systems",
|
|
116
116
|
description: `Counts events and distinct impacted users, grouped by *operating system*.
|
|
117
117
|
Groups are sorted by event count, in descending order.
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
6
|
const load_1 = require("../../../dataconnect/load");
|
|
7
7
|
const compile_1 = require("../../util/dataconnect/compile");
|
|
8
|
-
exports.compile = (0, tool_1.tool)({
|
|
8
|
+
exports.compile = (0, tool_1.tool)("dataconnect", {
|
|
9
9
|
name: "build",
|
|
10
10
|
description: "Use this to compile Firebase Data Connect schema, operations, and/or connectors and check for build errors.",
|
|
11
11
|
inputSchema: zod_1.z.object({
|
|
@@ -7,7 +7,7 @@ const dataplane = require("../../../dataconnect/dataplaneClient");
|
|
|
7
7
|
const load_1 = require("../../../dataconnect/load");
|
|
8
8
|
const converter_1 = require("../../util/dataconnect/converter");
|
|
9
9
|
const emulator_1 = require("../../util/dataconnect/emulator");
|
|
10
|
-
exports.execute = (0, tool_1.tool)({
|
|
10
|
+
exports.execute = (0, tool_1.tool)("dataconnect", {
|
|
11
11
|
name: "execute",
|
|
12
12
|
description: "Use this to execute a GraphQL operation against a Data Connect service or its emulator.",
|
|
13
13
|
inputSchema: zod_1.z.object({
|
|
@@ -6,7 +6,7 @@ const tool_1 = require("../../tool");
|
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const fdcExperience_1 = require("../../../gemini/fdcExperience");
|
|
8
8
|
const load_1 = require("../../../dataconnect/load");
|
|
9
|
-
exports.generate_operation = (0, tool_1.tool)({
|
|
9
|
+
exports.generate_operation = (0, tool_1.tool)("dataconnect", {
|
|
10
10
|
name: "generate_operation",
|
|
11
11
|
description: "Use this to generate a single Firebase Data Connect query or mutation based on the currently deployed schema and the provided prompt.",
|
|
12
12
|
inputSchema: zod_1.z.object({
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const tool_1 = require("../../tool");
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const fdcExperience_1 = require("../../../gemini/fdcExperience");
|
|
8
|
-
exports.generate_schema = (0, tool_1.tool)({
|
|
8
|
+
exports.generate_schema = (0, tool_1.tool)("dataconnect", {
|
|
9
9
|
name: "generate_schema",
|
|
10
10
|
description: "Use this to generate a Firebase Data Connect Schema based on the users description of an app.",
|
|
11
11
|
inputSchema: zod_1.z.object({
|
|
@@ -9,7 +9,7 @@ const client = require("../../../dataconnect/client");
|
|
|
9
9
|
const load_1 = require("../../../dataconnect/load");
|
|
10
10
|
const js_yaml_1 = require("js-yaml");
|
|
11
11
|
const logger_1 = require("../../../logger");
|
|
12
|
-
exports.list_services = (0, tool_1.tool)({
|
|
12
|
+
exports.list_services = (0, tool_1.tool)("dataconnect", {
|
|
13
13
|
name: "list_services",
|
|
14
14
|
description: "Use this to list existing local and backend Firebase Data Connect services",
|
|
15
15
|
inputSchema: zod_1.z.object({}),
|
|
@@ -7,7 +7,7 @@ const util_1 = require("../../util");
|
|
|
7
7
|
const firestore_1 = require("../../../gcp/firestore");
|
|
8
8
|
const delete_1 = require("../../../firestore/delete");
|
|
9
9
|
const types_1 = require("../../../emulator/types");
|
|
10
|
-
exports.delete_document = (0, tool_1.tool)({
|
|
10
|
+
exports.delete_document = (0, tool_1.tool)("firestore", {
|
|
11
11
|
name: "delete_document",
|
|
12
12
|
description: "Use this to delete a Firestore documents from a database in the current project by full document paths. Use this if you know the exact path of a document.",
|
|
13
13
|
inputSchema: zod_1.z.object({
|
|
@@ -7,7 +7,7 @@ const util_1 = require("../../util");
|
|
|
7
7
|
const firestore_1 = require("../../../gcp/firestore");
|
|
8
8
|
const converter_1 = require("./converter");
|
|
9
9
|
const types_1 = require("../../../emulator/types");
|
|
10
|
-
exports.get_documents = (0, tool_1.tool)({
|
|
10
|
+
exports.get_documents = (0, tool_1.tool)("firestore", {
|
|
11
11
|
name: "get_documents",
|
|
12
12
|
description: "Use this to retrieve one or more Firestore documents from a database in the current project by full document paths. Use this if you know the exact path of a document.",
|
|
13
13
|
inputSchema: zod_1.z.object({
|
|
@@ -6,7 +6,7 @@ const tool_1 = require("../../tool");
|
|
|
6
6
|
const util_1 = require("../../util");
|
|
7
7
|
const firestore_1 = require("../../../gcp/firestore");
|
|
8
8
|
const types_1 = require("../../../emulator/types");
|
|
9
|
-
exports.list_collections = (0, tool_1.tool)({
|
|
9
|
+
exports.list_collections = (0, tool_1.tool)("firestore", {
|
|
10
10
|
name: "list_collections",
|
|
11
11
|
description: "Use this to retrieve a list of collections from a Firestore database in the current project.",
|
|
12
12
|
inputSchema: zod_1.z.object({
|
|
@@ -7,7 +7,7 @@ const util_1 = require("../../util");
|
|
|
7
7
|
const firestore_1 = require("../../../gcp/firestore");
|
|
8
8
|
const converter_1 = require("./converter");
|
|
9
9
|
const types_1 = require("../../../emulator/types");
|
|
10
|
-
exports.query_collection = (0, tool_1.tool)({
|
|
10
|
+
exports.query_collection = (0, tool_1.tool)("firestore", {
|
|
11
11
|
name: "query_collection",
|
|
12
12
|
description: "Use this to retrieve one or more Firestore documents from a collection is a database in the current project by a collection with a full document path. Use this if you know the exact path of a collection and the filtering clause you would like for the document.",
|
|
13
13
|
inputSchema: zod_1.z.object({
|
|
@@ -38,7 +38,7 @@ function validateTimestamp(label, value) {
|
|
|
38
38
|
}
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
exports.get_logs = (0, tool_1.tool)({
|
|
41
|
+
exports.get_logs = (0, tool_1.tool)("functions", {
|
|
42
42
|
name: "get_logs",
|
|
43
43
|
description: "Use this to retrieve a page of Cloud Functions log entries using Google Cloud Logging advanced filters.",
|
|
44
44
|
inputSchema: zod_1.z.object({
|