firebase-tools 14.11.1 → 14.12.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/api.js +3 -1
- package/lib/apptesting/ensureProjectConfigured.js +4 -3
- package/lib/command.js +9 -3
- package/lib/commands/ext-export.js +1 -1
- package/lib/commands/init.js +7 -5
- package/lib/commands/internaltesting-functions-discover.js +20 -5
- package/lib/commands/login.js +2 -2
- package/lib/commands/use.js +5 -0
- package/lib/dataconnect/ensureApis.js +1 -0
- package/lib/deploy/functions/params.js +4 -0
- package/lib/deploy/functions/prepare.js +5 -5
- package/lib/emulator/downloadableEmulatorInfo.json +18 -18
- package/lib/firestore/api-types.js +7 -1
- package/lib/firestore/pretty-print.js +5 -1
- package/lib/init/features/aitools/claude.js +7 -7
- package/lib/init/features/dataconnect/index.js +1 -1
- package/lib/init/features/dataconnect/sdk.js +1 -1
- package/lib/init/features/index.js +3 -1
- package/lib/init/index.js +8 -0
- package/lib/management/studio.js +120 -0
- package/lib/mcp/errors.js +7 -1
- package/lib/mcp/index.js +46 -45
- package/lib/mcp/tools/apphosting/fetch_logs.js +22 -22
- package/lib/mcp/tools/apphosting/list_backends.js +10 -10
- package/lib/mcp/tools/auth/disable_user.js +7 -7
- package/lib/mcp/tools/auth/get_user.js +6 -6
- package/lib/mcp/tools/auth/index.js +10 -10
- package/lib/mcp/tools/auth/list_users.js +6 -6
- package/lib/mcp/tools/auth/set_claims.js +7 -7
- package/lib/mcp/tools/auth/set_sms_region_policy.js +6 -6
- package/lib/mcp/tools/core/consult_assistant.js +13 -8
- package/lib/mcp/tools/core/create_android_sha.js +9 -9
- package/lib/mcp/tools/core/create_app.js +7 -7
- package/lib/mcp/tools/core/create_project.js +13 -13
- package/lib/mcp/tools/core/get_admin_sdk_config.js +7 -7
- package/lib/mcp/tools/core/get_environment.js +8 -8
- package/lib/mcp/tools/core/get_project.js +5 -5
- package/lib/mcp/tools/core/get_sdk_config.js +9 -9
- package/lib/mcp/tools/core/index.js +24 -24
- package/lib/mcp/tools/core/init.js +9 -9
- package/lib/mcp/tools/core/list_apps.js +6 -6
- package/lib/mcp/tools/core/list_projects.js +6 -6
- package/lib/mcp/tools/core/update_environment.js +10 -10
- package/lib/mcp/tools/crashlytics/index.js +2 -2
- package/lib/mcp/tools/crashlytics/list_top_issues.js +6 -6
- package/lib/mcp/tools/dataconnect/emulator.js +6 -6
- package/lib/mcp/tools/dataconnect/execute_graphql.js +10 -10
- package/lib/mcp/tools/dataconnect/execute_graphql_read.js +10 -10
- package/lib/mcp/tools/dataconnect/execute_mutation.js +13 -13
- package/lib/mcp/tools/dataconnect/execute_query.js +13 -13
- package/lib/mcp/tools/dataconnect/generate_operation.js +8 -8
- package/lib/mcp/tools/dataconnect/generate_schema.js +6 -6
- package/lib/mcp/tools/dataconnect/get_connector.js +8 -8
- package/lib/mcp/tools/dataconnect/get_schema.js +8 -8
- package/lib/mcp/tools/dataconnect/index.js +18 -18
- package/lib/mcp/tools/dataconnect/list_services.js +5 -5
- package/lib/mcp/tools/firestore/delete_document.js +13 -13
- package/lib/mcp/tools/firestore/get_documents.js +13 -13
- package/lib/mcp/tools/firestore/list_collections.js +9 -9
- package/lib/mcp/tools/firestore/query_collection.js +13 -13
- package/lib/mcp/tools/index.js +18 -18
- package/lib/mcp/tools/messaging/index.js +2 -2
- package/lib/mcp/tools/messaging/send_message.js +7 -7
- package/lib/mcp/tools/remoteconfig/get_template.js +5 -5
- package/lib/mcp/tools/remoteconfig/index.js +4 -4
- package/lib/mcp/tools/remoteconfig/publish_template.js +7 -7
- package/lib/mcp/tools/remoteconfig/rollback_template.js +6 -6
- package/lib/mcp/tools/rules/get_rules.js +8 -8
- package/lib/mcp/tools/rules/validate_rules.js +10 -10
- package/lib/mcp/tools/storage/get_download_url.js +8 -8
- package/lib/mcp/tools/storage/get_rules.js +8 -8
- package/lib/requireAuth.js +5 -1
- package/lib/scopes.js +2 -1
- package/package.json +1 -1
- package/prompts/FIREBASE.md +1 -2
- package/templates/init/dataconnect/mutations.gql +1 -1
- package/templates/init/dataconnect/queries.gql +3 -3
package/lib/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.storageOrigin = exports.runtimeconfigOrigin = exports.rulesOrigin = exports.resourceManagerOrigin = exports.crashlyticsApiOrigin = exports.messagingApiOrigin = exports.remoteConfigApiOrigin = exports.rtdbMetadataOrigin = exports.rtdbManagementOrigin = exports.realtimeOrigin = exports.extensionsTOSOrigin = exports.extensionsPublisherOrigin = exports.extensionsOrigin = exports.iamOrigin = exports.identityOrigin = exports.hostingOrigin = exports.googleOrigin = exports.pubsubOrigin = exports.cloudTasksOrigin = exports.cloudschedulerOrigin = exports.cloudbuildOrigin = exports.functionsDefaultRegion = exports.runOrigin = exports.functionsV2Origin = exports.functionsOrigin = exports.firestoreOrigin = exports.firestoreOriginOrEmulator = exports.firedataOrigin = exports.firebaseExtensionsRegistryOrigin = exports.firebaseApiOrigin = exports.eventarcOrigin = exports.dynamicLinksKey = exports.dynamicLinksOrigin = exports.consoleOrigin = exports.authManagementOrigin = exports.authOrigin = exports.apphostingGitHubAppInstallationURL = exports.apphostingP4SADomain = exports.apphostingOrigin = exports.appDistributionOrigin = exports.artifactRegistryDomain = exports.developerConnectP4SADomain = exports.developerConnectOrigin = exports.containerRegistryDomain = exports.cloudMonitoringOrigin = exports.cloudloggingOrigin = exports.cloudbillingOrigin = exports.clientSecret = exports.clientId = exports.authProxyOrigin = void 0;
|
|
4
|
-
exports.setScopes = exports.getScopes = exports.appTestingOrigin = exports.cloudAiCompanionOrigin = exports.vertexAIOrigin = exports.cloudSQLAdminOrigin = exports.dataConnectLocalConnString = exports.dataconnectP4SADomain = exports.dataconnectOrigin = exports.githubClientSecret = exports.githubClientId = exports.computeOrigin = exports.secretManagerOrigin = exports.githubApiOrigin = exports.githubOrigin = exports.serviceUsageOrigin = exports.cloudRunApiOrigin = exports.hostingApiOrigin = exports.firebaseStorageOrigin = void 0;
|
|
4
|
+
exports.setScopes = exports.getScopes = exports.appTestingOrigin = exports.cloudAiCompanionOrigin = exports.vertexAIOrigin = exports.cloudSQLAdminOrigin = exports.dataConnectLocalConnString = exports.dataconnectP4SADomain = exports.dataconnectOrigin = exports.githubClientSecret = exports.githubClientId = exports.computeOrigin = exports.secretManagerOrigin = exports.githubApiOrigin = exports.githubOrigin = exports.studioApiOrigin = exports.serviceUsageOrigin = exports.cloudRunApiOrigin = exports.hostingApiOrigin = exports.firebaseStorageOrigin = void 0;
|
|
5
5
|
const constants_1 = require("./emulator/constants");
|
|
6
6
|
const logger_1 = require("./logger");
|
|
7
7
|
const scopes = require("./scopes");
|
|
@@ -120,6 +120,8 @@ const cloudRunApiOrigin = () => utils.envOverride("CLOUD_RUN_API_URL", "https://
|
|
|
120
120
|
exports.cloudRunApiOrigin = cloudRunApiOrigin;
|
|
121
121
|
const serviceUsageOrigin = () => utils.envOverride("FIREBASE_SERVICE_USAGE_URL", "https://serviceusage.googleapis.com");
|
|
122
122
|
exports.serviceUsageOrigin = serviceUsageOrigin;
|
|
123
|
+
const studioApiOrigin = () => utils.envOverride("FIREBASE_STUDIO_URL", "https://monospace-pa.googleapis.com");
|
|
124
|
+
exports.studioApiOrigin = studioApiOrigin;
|
|
123
125
|
const githubOrigin = () => utils.envOverride("GITHUB_URL", "https://github.com");
|
|
124
126
|
exports.githubOrigin = githubOrigin;
|
|
125
127
|
const githubApiOrigin = () => utils.envOverride("GITHUB_API_URL", "https://api.github.com");
|
|
@@ -11,9 +11,10 @@ const prompt_1 = require("../prompt");
|
|
|
11
11
|
const TEST_RUNNER_ROLE = "roles/firebaseapptesting.testRunner";
|
|
12
12
|
const TEST_RUNNER_SERVICE_ACCOUNT_NAME = "firebaseapptesting-test-runner";
|
|
13
13
|
async function ensureProjectConfigured(projectId) {
|
|
14
|
-
await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.appTestingOrigin)(), "
|
|
15
|
-
await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.
|
|
16
|
-
await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.
|
|
14
|
+
await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.appTestingOrigin)(), "Firebase App Testing", false);
|
|
15
|
+
await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.cloudRunApiOrigin)(), "Cloud Run", false);
|
|
16
|
+
await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.storageOrigin)(), "Cloud Storage", false);
|
|
17
|
+
await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.artifactRegistryDomain)(), "Artifact Registry", false);
|
|
17
18
|
const serviceAccount = runnerServiceAccount(projectId);
|
|
18
19
|
const serviceAccountExistsAndIsRunner = await (0, resourceManager_1.serviceAccountHasRoles)(projectId, serviceAccount, [TEST_RUNNER_ROLE], true);
|
|
19
20
|
if (!serviceAccountExistsAndIsRunner) {
|
package/lib/command.js
CHANGED
|
@@ -12,8 +12,10 @@ const detectProjectRoot_1 = require("./detectProjectRoot");
|
|
|
12
12
|
const track_1 = require("./track");
|
|
13
13
|
const auth_1 = require("./auth");
|
|
14
14
|
const projects_1 = require("./management/projects");
|
|
15
|
+
const studio_1 = require("./management/studio");
|
|
15
16
|
const requireAuth_1 = require("./requireAuth");
|
|
16
17
|
const logger_1 = require("./logger");
|
|
18
|
+
const env_1 = require("./env");
|
|
17
19
|
class Command {
|
|
18
20
|
constructor(cmd) {
|
|
19
21
|
this.cmd = cmd;
|
|
@@ -184,19 +186,23 @@ class Command {
|
|
|
184
186
|
if (activeAccount) {
|
|
185
187
|
(0, auth_1.setActiveAccount)(options, activeAccount);
|
|
186
188
|
}
|
|
187
|
-
this.applyRC(options);
|
|
189
|
+
await this.applyRC(options);
|
|
188
190
|
if (options.project) {
|
|
189
191
|
await this.resolveProjectIdentifiers(options);
|
|
190
192
|
validateProjectId(options.projectId);
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
|
-
applyRC(options) {
|
|
195
|
+
async applyRC(options) {
|
|
194
196
|
var _a, _b;
|
|
195
197
|
const rc = (0, rc_1.loadRC)(options);
|
|
196
198
|
options.rc = rc;
|
|
197
|
-
|
|
199
|
+
let activeProject = options.projectRoot
|
|
198
200
|
? ((_a = configstore_1.configstore.get("activeProjects")) !== null && _a !== void 0 ? _a : {})[options.projectRoot]
|
|
199
201
|
: undefined;
|
|
202
|
+
const isUseCommand = process.argv.includes("use");
|
|
203
|
+
if ((0, env_1.isFirebaseStudio)() && !options.project && !isUseCommand) {
|
|
204
|
+
activeProject = await (0, studio_1.reconcileStudioFirebaseProject)(options, activeProject);
|
|
205
|
+
}
|
|
200
206
|
options.project = (_b = options.project) !== null && _b !== void 0 ? _b : activeProject;
|
|
201
207
|
if (options.config && !options.project) {
|
|
202
208
|
options.project = options.config.defaults.project;
|
|
@@ -45,7 +45,7 @@ exports.command = new command_1.Command("ext:export")
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
const manifestSpecs = withRefSubbed.map((spec) => {
|
|
48
|
-
const paramCopy = Object.assign({}, spec.params);
|
|
48
|
+
const paramCopy = Object.assign(Object.assign({}, spec.params), spec.systemParams);
|
|
49
49
|
if (spec.eventarcChannel) {
|
|
50
50
|
paramCopy.EVENTARC_CHANNEL = spec.eventarcChannel;
|
|
51
51
|
}
|
package/lib/commands/init.js
CHANGED
|
@@ -16,7 +16,6 @@ const utils = require("../utils");
|
|
|
16
16
|
const experiments_1 = require("../experiments");
|
|
17
17
|
const templates_1 = require("../templates");
|
|
18
18
|
const error_1 = require("../error");
|
|
19
|
-
const track_1 = require("../track");
|
|
20
19
|
const homeDir = os.homedir();
|
|
21
20
|
const BANNER_TEXT = (0, templates_1.readTemplateSync)("banner.txt");
|
|
22
21
|
const GITIGNORE_TEMPLATE = (0, templates_1.readTemplateSync)("_gitignore");
|
|
@@ -106,6 +105,12 @@ if ((0, experiments_1.isEnabled)("apptesting")) {
|
|
|
106
105
|
checked: false,
|
|
107
106
|
});
|
|
108
107
|
}
|
|
108
|
+
choices.push({
|
|
109
|
+
value: "aitools",
|
|
110
|
+
name: "AI Tools: Configure AI coding assistants to work with your Firebase project",
|
|
111
|
+
checked: false,
|
|
112
|
+
hidden: true,
|
|
113
|
+
});
|
|
109
114
|
const featureNames = choices.map((choice) => choice.value);
|
|
110
115
|
const HELP = `Interactively configure the current directory as a Firebase project or initialize new features in an already configured Firebase project directory.
|
|
111
116
|
|
|
@@ -122,14 +127,13 @@ exports.command = new command_1.Command("init [feature]")
|
|
|
122
127
|
.before(requireAuth_1.requireAuth)
|
|
123
128
|
.action(initAction);
|
|
124
129
|
async function initAction(feature, options) {
|
|
125
|
-
var _a
|
|
130
|
+
var _a;
|
|
126
131
|
if (feature && !featureNames.includes(feature)) {
|
|
127
132
|
return utils.reject(clc.bold(feature) +
|
|
128
133
|
" is not a supported feature; must be one of " +
|
|
129
134
|
featureNames.join(", ") +
|
|
130
135
|
".");
|
|
131
136
|
}
|
|
132
|
-
const start = process.uptime();
|
|
133
137
|
const cwd = options.cwd || process.cwd();
|
|
134
138
|
const warnings = [];
|
|
135
139
|
let warningText = "";
|
|
@@ -209,8 +213,6 @@ async function initAction(feature, options) {
|
|
|
209
213
|
if (!fsutils.fileExistsSync(config.path(".gitignore"))) {
|
|
210
214
|
config.writeProjectFile(".gitignore", GITIGNORE_TEMPLATE);
|
|
211
215
|
}
|
|
212
|
-
const duration = Math.floor((process.uptime() - start) * 1000);
|
|
213
|
-
await (0, track_1.trackGA4)("product_init", { products_initialized: (_b = setup.features) === null || _b === void 0 ? void 0 : _b.join(",") }, duration);
|
|
214
216
|
logger_1.logger.info();
|
|
215
217
|
utils.logSuccess("Firebase initialization complete!");
|
|
216
218
|
}
|
|
@@ -8,6 +8,10 @@ const projectConfig_1 = require("../functions/projectConfig");
|
|
|
8
8
|
const adminSdkConfig_1 = require("../emulator/adminSdkConfig");
|
|
9
9
|
const projectUtils_1 = require("../projectUtils");
|
|
10
10
|
const error_1 = require("../error");
|
|
11
|
+
const ensureApiEnabled = require("../ensureApiEnabled");
|
|
12
|
+
const api_1 = require("../api");
|
|
13
|
+
const experiments = require("../experiments");
|
|
14
|
+
const prepareFunctionsUpload_1 = require("../deploy/functions/prepareFunctionsUpload");
|
|
11
15
|
exports.command = new command_1.Command("internaltesting:functions:discover")
|
|
12
16
|
.description("discover function triggers defined in the current project directory")
|
|
13
17
|
.action(async (options) => {
|
|
@@ -17,9 +21,20 @@ exports.command = new command_1.Command("internaltesting:functions:discover")
|
|
|
17
21
|
if (!firebaseConfig) {
|
|
18
22
|
throw new error_1.FirebaseError("Admin SDK config unexpectedly undefined - have you run firebase init?");
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
let runtimeConfig = { firebase: firebaseConfig };
|
|
25
|
+
const allowFunctionsConfig = experiments.isEnabled("dangerouslyAllowFunctionsConfig");
|
|
26
|
+
if (allowFunctionsConfig) {
|
|
27
|
+
try {
|
|
28
|
+
const runtimeConfigApiEnabled = await ensureApiEnabled.check(projectId, (0, api_1.runtimeconfigOrigin)(), "runtimeconfig", true);
|
|
29
|
+
if (runtimeConfigApiEnabled) {
|
|
30
|
+
runtimeConfig = Object.assign(Object.assign({}, runtimeConfig), (await (0, prepareFunctionsUpload_1.getFunctionsConfig)(projectId)));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
logger_1.logger.debug("Could not check Runtime Config API status, assuming disabled:", err);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const wantBuilds = await (0, prepare_1.loadCodebases)(fnConfig, options, firebaseConfig, runtimeConfig, undefined);
|
|
38
|
+
logger_1.logger.info(JSON.stringify(wantBuilds, null, 2));
|
|
39
|
+
return wantBuilds;
|
|
25
40
|
});
|
package/lib/commands/login.js
CHANGED
|
@@ -22,7 +22,7 @@ exports.command = new command_1.Command("login")
|
|
|
22
22
|
}
|
|
23
23
|
const user = options.user;
|
|
24
24
|
const tokens = options.tokens;
|
|
25
|
-
if (user && tokens && !options.reauth) {
|
|
25
|
+
if (user && (tokens === null || tokens === void 0 ? void 0 : tokens.refresh_token) && !options.reauth) {
|
|
26
26
|
logger_1.logger.info("Already logged in as", clc.bold(user.email));
|
|
27
27
|
return user;
|
|
28
28
|
}
|
|
@@ -37,7 +37,7 @@ exports.command = new command_1.Command("login")
|
|
|
37
37
|
configstore_1.configstore.set("usage", collectUsage);
|
|
38
38
|
if (geminiUsage || collectUsage) {
|
|
39
39
|
logger_1.logger.info();
|
|
40
|
-
utils.logBullet("To change your
|
|
40
|
+
utils.logBullet("To change your preferences at any time, run `firebase logout` and `firebase login` again.");
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
const useLocalhost = (0, utils_1.isCloudEnvironment)() ? false : options.localhost;
|
package/lib/commands/use.js
CHANGED
|
@@ -4,12 +4,14 @@ exports.command = exports.setNewActive = void 0;
|
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const command_1 = require("../command");
|
|
6
6
|
const projects_1 = require("../management/projects");
|
|
7
|
+
const studio_1 = require("../management/studio");
|
|
7
8
|
const logger_1 = require("../logger");
|
|
8
9
|
const prompt_1 = require("../prompt");
|
|
9
10
|
const requireAuth_1 = require("../requireAuth");
|
|
10
11
|
const command_2 = require("../command");
|
|
11
12
|
const utils = require("../utils");
|
|
12
13
|
const error_1 = require("../error");
|
|
14
|
+
const env_1 = require("../env");
|
|
13
15
|
function listAliases(options) {
|
|
14
16
|
if (options.rc.hasProjects) {
|
|
15
17
|
logger_1.logger.info("Project aliases for", clc.bold(options.projectRoot || "") + ":");
|
|
@@ -41,6 +43,9 @@ async function setNewActive(projectOrAlias, aliasOpt, rc, projectRoot) {
|
|
|
41
43
|
catch (_a) {
|
|
42
44
|
throw new error_1.FirebaseError("Invalid project selection, " + verifyMessage(projectOrAlias));
|
|
43
45
|
}
|
|
46
|
+
if ((0, env_1.isFirebaseStudio)()) {
|
|
47
|
+
await (0, studio_1.updateStudioFirebaseProject)(resolvedProject);
|
|
48
|
+
}
|
|
44
49
|
if (aliasOpt) {
|
|
45
50
|
if (!project) {
|
|
46
51
|
throw new error_1.FirebaseError(`Cannot create alias ${clc.bold(aliasOpt)}, ${verifyMessage(projectOrAlias)}`);
|
|
@@ -12,6 +12,7 @@ async function ensureApis(projectId) {
|
|
|
12
12
|
exports.ensureApis = ensureApis;
|
|
13
13
|
async function ensureSparkApis(projectId) {
|
|
14
14
|
await (0, ensureApiEnabled_1.ensure)(projectId, api.cloudSQLAdminOrigin(), prefix);
|
|
15
|
+
await (0, ensureApiEnabled_1.ensure)(projectId, api.dataconnectOrigin(), prefix);
|
|
15
16
|
}
|
|
16
17
|
exports.ensureSparkApis = ensureSparkApis;
|
|
17
18
|
async function ensureGIFApis(projectId) {
|
|
@@ -108,6 +108,10 @@ class ParamValue {
|
|
|
108
108
|
return ["true", "y", "yes", "1"].includes(this.rawValue);
|
|
109
109
|
}
|
|
110
110
|
asList() {
|
|
111
|
+
if (this.rawValue.includes("[")) {
|
|
112
|
+
const unquoted = this.rawValue.replace(/'/g, '"');
|
|
113
|
+
return JSON.parse(unquoted);
|
|
114
|
+
}
|
|
111
115
|
return this.rawValue.split(this.delimiter);
|
|
112
116
|
}
|
|
113
117
|
asNumber() {
|
|
@@ -11,6 +11,7 @@ const runtimes = require("./runtimes");
|
|
|
11
11
|
const supported = require("./runtimes/supported");
|
|
12
12
|
const validate = require("./validate");
|
|
13
13
|
const ensure = require("./ensure");
|
|
14
|
+
const experiments = require("../../experiments");
|
|
14
15
|
const api_1 = require("../../api");
|
|
15
16
|
const functionsDeployHelper_1 = require("./functionsDeployHelper");
|
|
16
17
|
const utils_1 = require("../../utils");
|
|
@@ -51,13 +52,12 @@ async function prepare(context, options, payload) {
|
|
|
51
52
|
]);
|
|
52
53
|
const firebaseConfig = await functionsConfig.getFirebaseConfig(options);
|
|
53
54
|
context.firebaseConfig = firebaseConfig;
|
|
55
|
+
context.codebaseDeployEvents = {};
|
|
54
56
|
let runtimeConfig = { firebase: firebaseConfig };
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
runtimeConfig = Object.assign(Object.assign({}, runtimeConfig),
|
|
58
|
-
context.hasRuntimeConfig = Object.keys(config).length > 0;
|
|
57
|
+
const allowFunctionsConfig = experiments.isEnabled("dangerouslyAllowFunctionsConfig");
|
|
58
|
+
if (allowFunctionsConfig && checkAPIsEnabled[1]) {
|
|
59
|
+
runtimeConfig = Object.assign(Object.assign({}, runtimeConfig), (await (0, prepareFunctionsUpload_1.getFunctionsConfig)(projectId)));
|
|
59
60
|
}
|
|
60
|
-
context.codebaseDeployEvents = {};
|
|
61
61
|
const wantBuilds = await loadCodebases(context.config, options, firebaseConfig, runtimeConfig, context.filters);
|
|
62
62
|
if (Object.values(wantBuilds).some((b) => b.extensions)) {
|
|
63
63
|
const extContext = {};
|
|
@@ -54,28 +54,28 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dataconnect": {
|
|
56
56
|
"darwin": {
|
|
57
|
-
"version": "2.
|
|
58
|
-
"expectedSize":
|
|
59
|
-
"expectedChecksum": "
|
|
60
|
-
"expectedChecksumSHA256": "
|
|
61
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-v2.
|
|
62
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.
|
|
57
|
+
"version": "2.11.0",
|
|
58
|
+
"expectedSize": 29234016,
|
|
59
|
+
"expectedChecksum": "96da48708b8210f0d3d97099d777b322",
|
|
60
|
+
"expectedChecksumSHA256": "10fe334f2c4145e4c9d27bc442bdc92b1252164d3daac47bb7555da42b6d7050",
|
|
61
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-v2.11.0",
|
|
62
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.11.0"
|
|
63
63
|
},
|
|
64
64
|
"win32": {
|
|
65
|
-
"version": "2.
|
|
66
|
-
"expectedSize":
|
|
67
|
-
"expectedChecksum": "
|
|
68
|
-
"expectedChecksumSHA256": "
|
|
69
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-v2.
|
|
70
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.
|
|
65
|
+
"version": "2.11.0",
|
|
66
|
+
"expectedSize": 29719040,
|
|
67
|
+
"expectedChecksum": "df6b221af204a4a21163bcc73367f99e",
|
|
68
|
+
"expectedChecksumSHA256": "af17c0d873b2b8f1919652c1ad9fd4aed417cd82bc35bbc5cc4a302fc90f9a03",
|
|
69
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-v2.11.0",
|
|
70
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.11.0.exe"
|
|
71
71
|
},
|
|
72
72
|
"linux": {
|
|
73
|
-
"version": "2.
|
|
74
|
-
"expectedSize":
|
|
75
|
-
"expectedChecksum": "
|
|
76
|
-
"expectedChecksumSHA256": "
|
|
77
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-v2.
|
|
78
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.
|
|
73
|
+
"version": "2.11.0",
|
|
74
|
+
"expectedSize": 29159608,
|
|
75
|
+
"expectedChecksum": "38d6161f7e8f06ee89e5dc4094f1a9b6",
|
|
76
|
+
"expectedChecksumSHA256": "3391efac3570164141b5d7f3e3d48b6426ec9c8cf9eafeabee3fa31678120218",
|
|
77
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-v2.11.0",
|
|
78
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.11.0"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RecurrenceType = exports.PointInTimeRecoveryEnablement = exports.PointInTimeRecoveryEnablementOption = exports.DatabaseDeleteProtectionState = exports.DatabaseDeleteProtectionStateOption = exports.DatabaseType = exports.StateTtl = exports.State = exports.ArrayConfig = exports.Order = exports.QueryScope = exports.Mode = void 0;
|
|
3
|
+
exports.RecurrenceType = exports.DatabaseEdition = exports.PointInTimeRecoveryEnablement = exports.PointInTimeRecoveryEnablementOption = exports.DatabaseDeleteProtectionState = exports.DatabaseDeleteProtectionStateOption = exports.DatabaseType = exports.StateTtl = exports.State = exports.ArrayConfig = exports.Order = exports.QueryScope = exports.Mode = void 0;
|
|
4
4
|
var Mode;
|
|
5
5
|
(function (Mode) {
|
|
6
6
|
Mode["ASCENDING"] = "ASCENDING";
|
|
@@ -58,6 +58,12 @@ var PointInTimeRecoveryEnablement;
|
|
|
58
58
|
PointInTimeRecoveryEnablement["ENABLED"] = "POINT_IN_TIME_RECOVERY_ENABLED";
|
|
59
59
|
PointInTimeRecoveryEnablement["DISABLED"] = "POINT_IN_TIME_RECOVERY_DISABLED";
|
|
60
60
|
})(PointInTimeRecoveryEnablement = exports.PointInTimeRecoveryEnablement || (exports.PointInTimeRecoveryEnablement = {}));
|
|
61
|
+
var DatabaseEdition;
|
|
62
|
+
(function (DatabaseEdition) {
|
|
63
|
+
DatabaseEdition["DATABASE_EDITION_UNSPECIFIED"] = "DATABASE_EDITION_UNSPECIFIED";
|
|
64
|
+
DatabaseEdition["STANDARD"] = "STANDARD";
|
|
65
|
+
DatabaseEdition["ENTERPRISE"] = "ENTERPRISE";
|
|
66
|
+
})(DatabaseEdition = exports.DatabaseEdition || (exports.DatabaseEdition = {}));
|
|
61
67
|
var RecurrenceType;
|
|
62
68
|
(function (RecurrenceType) {
|
|
63
69
|
RecurrenceType["DAILY"] = "DAILY";
|
|
@@ -41,7 +41,11 @@ class PrettyPrint {
|
|
|
41
41
|
head: ["Field", "Value"],
|
|
42
42
|
colWidths: [30, colValueWidth],
|
|
43
43
|
});
|
|
44
|
-
|
|
44
|
+
const edition = !database.databaseEdition ||
|
|
45
|
+
database.databaseEdition === types.DatabaseEdition.DATABASE_EDITION_UNSPECIFIED
|
|
46
|
+
? types.DatabaseEdition.STANDARD
|
|
47
|
+
: database.databaseEdition;
|
|
48
|
+
table.push(["Name", clc.yellow(database.name)], ["Create Time", clc.yellow(database.createTime)], ["Last Update Time", clc.yellow(database.updateTime)], ["Type", clc.yellow(database.type)], ["Edition", clc.yellow(edition)], ["Location", clc.yellow(database.locationId)], ["Delete Protection State", clc.yellow(database.deleteProtectionState)], ["Point In Time Recovery", clc.yellow(database.pointInTimeRecoveryEnablement)], ["Earliest Version Time", clc.yellow(database.earliestVersionTime)], ["Version Retention Period", clc.yellow(database.versionRetentionPeriod)]);
|
|
45
49
|
if (database.cmekConfig) {
|
|
46
50
|
table.push(["KMS Key Name", clc.yellow(database.cmekConfig.kmsKeyName)]);
|
|
47
51
|
if (database.cmekConfig.activeKeyVersion) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.claude = void 0;
|
|
4
4
|
const promptUpdater_1 = require("./promptUpdater");
|
|
5
|
-
const
|
|
6
|
-
const CLAUDE_PROMPT_PATH = "CLAUDE.
|
|
5
|
+
const MCP_CONFIG_PATH = ".mcp.json";
|
|
6
|
+
const CLAUDE_PROMPT_PATH = "CLAUDE.md";
|
|
7
7
|
exports.claude = {
|
|
8
8
|
name: "claude",
|
|
9
9
|
displayName: "Claude Code",
|
|
@@ -11,9 +11,9 @@ exports.claude = {
|
|
|
11
11
|
var _a;
|
|
12
12
|
const files = [];
|
|
13
13
|
let existingConfig = {};
|
|
14
|
-
let
|
|
14
|
+
let mcpUpdated = false;
|
|
15
15
|
try {
|
|
16
|
-
const existingContent = config.readProjectFile(
|
|
16
|
+
const existingContent = config.readProjectFile(MCP_CONFIG_PATH);
|
|
17
17
|
if (existingContent) {
|
|
18
18
|
existingConfig = JSON.parse(existingContent);
|
|
19
19
|
}
|
|
@@ -28,10 +28,10 @@ exports.claude = {
|
|
|
28
28
|
command: "npx",
|
|
29
29
|
args: ["-y", "firebase-tools", "experimental:mcp", "--dir", projectPath],
|
|
30
30
|
};
|
|
31
|
-
config.writeProjectFile(
|
|
32
|
-
|
|
31
|
+
config.writeProjectFile(MCP_CONFIG_PATH, JSON.stringify(existingConfig, null, 2));
|
|
32
|
+
mcpUpdated = true;
|
|
33
33
|
}
|
|
34
|
-
files.push({ path:
|
|
34
|
+
files.push({ path: MCP_CONFIG_PATH, updated: mcpUpdated });
|
|
35
35
|
const { updated } = await (0, promptUpdater_1.updateFirebaseSection)(config, CLAUDE_PROMPT_PATH, enabledFeatures, {
|
|
36
36
|
interactive: true,
|
|
37
37
|
});
|
|
@@ -107,7 +107,7 @@ async function actuate(setup, config, options) {
|
|
|
107
107
|
info.connectors = [defaultConnector];
|
|
108
108
|
}
|
|
109
109
|
await writeFiles(config, info, options);
|
|
110
|
-
if (setup.projectId && info.shouldProvisionCSQL) {
|
|
110
|
+
if (setup.projectId && info.shouldProvisionCSQL && (await (0, cloudbilling_1.isBillingEnabled)(setup))) {
|
|
111
111
|
await (0, provisionCloudSql_1.provisionCloudSql)({
|
|
112
112
|
projectId: setup.projectId,
|
|
113
113
|
location: info.locationId,
|
|
@@ -170,7 +170,7 @@ async function actuate(sdkInfo, config) {
|
|
|
170
170
|
var _a, _b;
|
|
171
171
|
const connectorYamlPath = `${sdkInfo.connectorInfo.directory}/connector.yaml`;
|
|
172
172
|
(0, utils_1.logBullet)(`Writing your new SDK configuration to ${connectorYamlPath}`);
|
|
173
|
-
|
|
173
|
+
config.writeProjectFile(path.relative(config.projectDir, connectorYamlPath), sdkInfo.connectorYamlContents);
|
|
174
174
|
const account = (0, auth_1.getGlobalDefaultAccount)();
|
|
175
175
|
await dataconnectEmulator_1.DataConnectEmulator.generate({
|
|
176
176
|
configDir: sdkInfo.connectorInfo.directory,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apptestingAcutate = exports.apptestingAskQuestions = exports.genkit = exports.apphosting = exports.dataconnectSdk = exports.dataconnectPostSetup = exports.dataconnectActuate = exports.dataconnectAskQuestions = exports.hostingGithub = exports.remoteconfig = exports.project = exports.extensions = exports.emulators = exports.storageActuate = exports.storageAskQuestions = exports.hosting = exports.functions = exports.firestoreActuate = exports.firestoreAskQuestions = exports.databaseActuate = exports.databaseAskQuestions = exports.account = void 0;
|
|
3
|
+
exports.aitools = exports.apptestingAcutate = exports.apptestingAskQuestions = exports.genkit = exports.apphosting = exports.dataconnectSdk = exports.dataconnectPostSetup = exports.dataconnectActuate = exports.dataconnectAskQuestions = exports.hostingGithub = exports.remoteconfig = exports.project = exports.extensions = exports.emulators = exports.storageActuate = exports.storageAskQuestions = exports.hosting = exports.functions = exports.firestoreActuate = exports.firestoreAskQuestions = exports.databaseActuate = exports.databaseAskQuestions = exports.account = void 0;
|
|
4
4
|
var account_1 = require("./account");
|
|
5
5
|
Object.defineProperty(exports, "account", { enumerable: true, get: function () { return account_1.doSetup; } });
|
|
6
6
|
var database_1 = require("./database");
|
|
@@ -39,3 +39,5 @@ Object.defineProperty(exports, "genkit", { enumerable: true, get: function () {
|
|
|
39
39
|
var apptesting_1 = require("./apptesting");
|
|
40
40
|
Object.defineProperty(exports, "apptestingAskQuestions", { enumerable: true, get: function () { return apptesting_1.askQuestions; } });
|
|
41
41
|
Object.defineProperty(exports, "apptestingAcutate", { enumerable: true, get: function () { return apptesting_1.actuate; } });
|
|
42
|
+
var aitools_1 = require("./aitools");
|
|
43
|
+
Object.defineProperty(exports, "aitools", { enumerable: true, get: function () { return aitools_1.doSetup; } });
|
package/lib/init/index.js
CHANGED
|
@@ -6,6 +6,7 @@ const clc = require("colorette");
|
|
|
6
6
|
const error_1 = require("../error");
|
|
7
7
|
const logger_1 = require("../logger");
|
|
8
8
|
const features = require("./features");
|
|
9
|
+
const track_1 = require("../track");
|
|
9
10
|
const featuresList = [
|
|
10
11
|
{ name: "account", doSetup: features.account },
|
|
11
12
|
{
|
|
@@ -44,12 +45,14 @@ const featuresList = [
|
|
|
44
45
|
askQuestions: features.apptestingAskQuestions,
|
|
45
46
|
actuate: features.apptestingAcutate,
|
|
46
47
|
},
|
|
48
|
+
{ name: "aitools", displayName: "AI Tools", doSetup: features.aitools },
|
|
47
49
|
];
|
|
48
50
|
const featureMap = new Map(featuresList.map((feature) => [feature.name, feature]));
|
|
49
51
|
async function init(setup, config, options) {
|
|
50
52
|
var _a;
|
|
51
53
|
const nextFeature = (_a = setup.features) === null || _a === void 0 ? void 0 : _a.shift();
|
|
52
54
|
if (nextFeature) {
|
|
55
|
+
const start = process.uptime();
|
|
53
56
|
const f = featureMap.get(nextFeature);
|
|
54
57
|
if (!f) {
|
|
55
58
|
const availableFeatures = Object.keys(features)
|
|
@@ -72,6 +75,8 @@ async function init(setup, config, options) {
|
|
|
72
75
|
if (f.postSetup) {
|
|
73
76
|
await f.postSetup(setup, config, options);
|
|
74
77
|
}
|
|
78
|
+
const duration = Math.floor((process.uptime() - start) * 1000);
|
|
79
|
+
await (0, track_1.trackGA4)("product_init", { feature: nextFeature }, duration);
|
|
75
80
|
return init(setup, config, options);
|
|
76
81
|
}
|
|
77
82
|
}
|
|
@@ -80,6 +85,7 @@ async function actuate(setup, config, options) {
|
|
|
80
85
|
var _a;
|
|
81
86
|
const nextFeature = (_a = setup.features) === null || _a === void 0 ? void 0 : _a.shift();
|
|
82
87
|
if (nextFeature) {
|
|
88
|
+
const start = process.uptime();
|
|
83
89
|
const f = lookupFeature(nextFeature);
|
|
84
90
|
logger_1.logger.info(clc.bold(`\n${clc.white("===")} ${(0, lodash_1.capitalize)(nextFeature)} Setup Actuation`));
|
|
85
91
|
if (f.doSetup) {
|
|
@@ -90,6 +96,8 @@ async function actuate(setup, config, options) {
|
|
|
90
96
|
await f.actuate(setup, config, options);
|
|
91
97
|
}
|
|
92
98
|
}
|
|
99
|
+
const duration = Math.floor((process.uptime() - start) * 1000);
|
|
100
|
+
await (0, track_1.trackGA4)("product_init_mcp", { feature: nextFeature }, duration);
|
|
93
101
|
return actuate(setup, config, options);
|
|
94
102
|
}
|
|
95
103
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateStudioFirebaseProject = exports.reconcileStudioFirebaseProject = void 0;
|
|
4
|
+
const apiv2_1 = require("../apiv2");
|
|
5
|
+
const prompt = require("../prompt");
|
|
6
|
+
const api = require("../api");
|
|
7
|
+
const logger_1 = require("../logger");
|
|
8
|
+
const utils = require("../utils");
|
|
9
|
+
const configstore_1 = require("../configstore");
|
|
10
|
+
const TIMEOUT_MILLIS = 30000;
|
|
11
|
+
const studioClient = new apiv2_1.Client({
|
|
12
|
+
urlPrefix: api.studioApiOrigin(),
|
|
13
|
+
apiVersion: "v1",
|
|
14
|
+
});
|
|
15
|
+
async function reconcileStudioFirebaseProject(options, activeProjectFromConfig) {
|
|
16
|
+
const studioWorkspace = await getStudioWorkspace();
|
|
17
|
+
if (!studioWorkspace) {
|
|
18
|
+
return activeProjectFromConfig;
|
|
19
|
+
}
|
|
20
|
+
if (!studioWorkspace.firebaseProjectId) {
|
|
21
|
+
if (activeProjectFromConfig) {
|
|
22
|
+
await updateStudioFirebaseProject(activeProjectFromConfig);
|
|
23
|
+
}
|
|
24
|
+
return activeProjectFromConfig;
|
|
25
|
+
}
|
|
26
|
+
if (!activeProjectFromConfig) {
|
|
27
|
+
await writeStudioProjectToConfigStore(options, studioWorkspace.firebaseProjectId);
|
|
28
|
+
return studioWorkspace.firebaseProjectId;
|
|
29
|
+
}
|
|
30
|
+
if (studioWorkspace.firebaseProjectId !== activeProjectFromConfig && !options.nonInteractive) {
|
|
31
|
+
const choices = [
|
|
32
|
+
{
|
|
33
|
+
name: `Set ${studioWorkspace.firebaseProjectId} from Firebase Studio as my active project in both places`,
|
|
34
|
+
value: false,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: `Set ${activeProjectFromConfig} from Firebase CLI as my active project in both places`,
|
|
38
|
+
value: true,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
const useCliProject = await prompt.select({
|
|
42
|
+
message: "Found different active Firebase Projects in the Firebase CLI and your Firebase Studio Workspace. Which project would you like to set as your active project?",
|
|
43
|
+
choices,
|
|
44
|
+
});
|
|
45
|
+
if (useCliProject) {
|
|
46
|
+
await updateStudioFirebaseProject(activeProjectFromConfig);
|
|
47
|
+
return activeProjectFromConfig;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
await writeStudioProjectToConfigStore(options, studioWorkspace.firebaseProjectId);
|
|
51
|
+
return studioWorkspace.firebaseProjectId;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return studioWorkspace.firebaseProjectId;
|
|
55
|
+
}
|
|
56
|
+
exports.reconcileStudioFirebaseProject = reconcileStudioFirebaseProject;
|
|
57
|
+
async function getStudioWorkspace() {
|
|
58
|
+
const workspaceId = process.env.WORKSPACE_SLUG;
|
|
59
|
+
if (!workspaceId) {
|
|
60
|
+
logger_1.logger.error(`Failed to fetch Firebase Project from Studio Workspace because WORKSPACE_SLUG environment variable is empty`);
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const res = await studioClient.request({
|
|
65
|
+
method: "GET",
|
|
66
|
+
path: `/workspaces/${workspaceId}`,
|
|
67
|
+
timeout: TIMEOUT_MILLIS,
|
|
68
|
+
});
|
|
69
|
+
return res.body;
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
let message = err.message;
|
|
73
|
+
if (err.original) {
|
|
74
|
+
message += ` (original: ${err.original.message})`;
|
|
75
|
+
}
|
|
76
|
+
logger_1.logger.error(`Failed to fetch Firebase Project from current Studio Workspace: ${message}`);
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async function writeStudioProjectToConfigStore(options, studioProjectId) {
|
|
81
|
+
if (options.projectRoot) {
|
|
82
|
+
logger_1.logger.info(`Updating Firebase CLI active project to match Studio Workspace '${studioProjectId}'`);
|
|
83
|
+
utils.makeActiveProject(options.projectRoot, studioProjectId);
|
|
84
|
+
recordStudioProjectSyncTime();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async function updateStudioFirebaseProject(projectId) {
|
|
88
|
+
logger_1.logger.info(`Updating Studio Workspace active project to match Firebase CLI '${projectId}'`);
|
|
89
|
+
const workspaceId = process.env.WORKSPACE_SLUG;
|
|
90
|
+
if (!workspaceId) {
|
|
91
|
+
logger_1.logger.error(`Failed to update Firebase Project for Studio Workspace because WORKSPACE_SLUG environment variable is empty`);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
await studioClient.request({
|
|
96
|
+
method: "PATCH",
|
|
97
|
+
path: `/workspaces/${workspaceId}`,
|
|
98
|
+
responseType: "json",
|
|
99
|
+
body: {
|
|
100
|
+
firebaseProjectId: projectId,
|
|
101
|
+
},
|
|
102
|
+
queryParams: {
|
|
103
|
+
updateMask: "workspace.firebaseProjectId",
|
|
104
|
+
},
|
|
105
|
+
timeout: TIMEOUT_MILLIS,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
let message = err.message;
|
|
110
|
+
if (err.original) {
|
|
111
|
+
message += ` (original: ${err.original.message})`;
|
|
112
|
+
}
|
|
113
|
+
logger_1.logger.warn(`Failed to update active Firebase Project for current Studio Workspace: ${message}`);
|
|
114
|
+
}
|
|
115
|
+
recordStudioProjectSyncTime();
|
|
116
|
+
}
|
|
117
|
+
exports.updateStudioFirebaseProject = updateStudioFirebaseProject;
|
|
118
|
+
function recordStudioProjectSyncTime() {
|
|
119
|
+
configstore_1.configstore.set("firebaseStudioProjectLastSynced", Date.now());
|
|
120
|
+
}
|
package/lib/mcp/errors.js
CHANGED
|
@@ -3,8 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.mcpGeminiError = exports.mcpAuthError = exports.NO_PROJECT_ERROR = void 0;
|
|
4
4
|
const util_1 = require("./util");
|
|
5
5
|
exports.NO_PROJECT_ERROR = (0, util_1.mcpError)('No active project was found. Use the `firebase_update_environment` tool to set the project directory to an absolute folder location containing a firebase.json config file. Alternatively, change the MCP server config to add [...,"--dir","/absolute/path/to/project/directory"] in its command-line arguments.', "PRECONDITION_FAILED");
|
|
6
|
-
function mcpAuthError() {
|
|
6
|
+
function mcpAuthError(skipADC) {
|
|
7
7
|
const cmd = (0, util_1.commandExistsSync)("firebase") ? "firebase" : "npx -y firebase-tools";
|
|
8
|
+
if (skipADC) {
|
|
9
|
+
return (0, util_1.mcpError)(`The user is not currently logged into the Firebase CLI, which is required to use this tool. Please instruct the user to execute this shell command to sign in.
|
|
10
|
+
\`\`\`sh
|
|
11
|
+
${cmd} login
|
|
12
|
+
\`\`\``);
|
|
13
|
+
}
|
|
8
14
|
return (0, util_1.mcpError)(`The user is not currently logged into the Firebase CLI, which is required to use this tool. Please instruct the user to execute this shell command to sign in or to configure [Application Default Credentials][ADC] on their machine.
|
|
9
15
|
\`\`\`sh
|
|
10
16
|
${cmd} login
|