firebase-tools 14.15.2 → 14.17.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.
Files changed (83) hide show
  1. package/lib/commands/firestore-bulkdelete.js +73 -0
  2. package/lib/commands/firestore-operations-cancel.js +44 -0
  3. package/lib/commands/firestore-operations-describe.js +29 -0
  4. package/lib/commands/firestore-operations-list.js +29 -0
  5. package/lib/commands/firestore-utils.js +15 -0
  6. package/lib/commands/functions-config-export.js +5 -2
  7. package/lib/commands/index.js +5 -0
  8. package/lib/config.js +16 -4
  9. package/lib/crashlytics/{listNotes.js → events.js} +11 -9
  10. package/lib/crashlytics/filters.js +77 -0
  11. package/lib/crashlytics/issues.js +50 -0
  12. package/lib/crashlytics/notes.js +67 -0
  13. package/lib/crashlytics/reports.js +47 -0
  14. package/lib/crashlytics/types.js +60 -0
  15. package/lib/dataconnect/ensureApis.js +3 -3
  16. package/lib/deploy/apphosting/deploy.js +2 -1
  17. package/lib/deploy/apphosting/util.js +5 -8
  18. package/lib/deploy/functions/deploy.js +4 -3
  19. package/lib/deploy/functions/prepare.js +8 -6
  20. package/lib/emulator/apphosting/developmentServer.js +3 -3
  21. package/lib/emulator/apphosting/serve.js +29 -29
  22. package/lib/emulator/commandUtils.js +7 -1
  23. package/lib/emulator/controller.js +15 -31
  24. package/lib/emulator/downloadableEmulatorInfo.json +18 -18
  25. package/lib/emulator/hub.js +7 -1
  26. package/lib/emulator/initEmulators.js +1 -1
  27. package/lib/extensions/runtimes/common.js +3 -2
  28. package/lib/firestore/api.js +45 -0
  29. package/lib/firestore/pretty-print.js +23 -0
  30. package/lib/functions/projectConfig.js +69 -9
  31. package/lib/gcp/cloudfunctions.js +1 -6
  32. package/lib/gcp/cloudfunctionsv2.js +1 -9
  33. package/lib/gcp/cloudsql/cloudsqladmin.js +2 -2
  34. package/lib/init/features/dataconnect/create_app.js +7 -2
  35. package/lib/init/features/dataconnect/index.js +101 -60
  36. package/lib/init/features/dataconnect/sdk.js +35 -17
  37. package/lib/mcp/errors.js +2 -10
  38. package/lib/mcp/index.js +0 -3
  39. package/lib/mcp/prompts/crashlytics/connect.js +114 -0
  40. package/lib/mcp/prompts/crashlytics/index.js +2 -3
  41. package/lib/mcp/tools/auth/disable_user.js +1 -1
  42. package/lib/mcp/tools/auth/get_user.js +9 -2
  43. package/lib/mcp/tools/core/index.js +4 -0
  44. package/lib/mcp/tools/core/init.js +11 -2
  45. package/lib/mcp/tools/core/login.js +46 -0
  46. package/lib/mcp/tools/core/logout.js +62 -0
  47. package/lib/mcp/tools/crashlytics/events.js +42 -0
  48. package/lib/mcp/tools/crashlytics/index.js +16 -20
  49. package/lib/mcp/tools/crashlytics/issues.js +56 -0
  50. package/lib/mcp/tools/crashlytics/notes.js +78 -0
  51. package/lib/mcp/tools/crashlytics/reports.js +100 -0
  52. package/lib/mcp/tools/dataconnect/index.js +2 -2
  53. package/lib/mcp/tools/dataconnect/{info.js → list_services.js} +5 -5
  54. package/lib/mcp/util.js +1 -17
  55. package/lib/serve/functions.js +4 -3
  56. package/lib/unzip.js +13 -0
  57. package/lib/utils.js +17 -1
  58. package/package.json +1 -1
  59. package/schema/firebase-config.json +160 -59
  60. package/lib/crashlytics/addNote.js +0 -27
  61. package/lib/crashlytics/deleteNote.js +0 -23
  62. package/lib/crashlytics/getIssueDetails.js +0 -26
  63. package/lib/crashlytics/getSampleCrash.js +0 -34
  64. package/lib/crashlytics/listTopDevices.js +0 -33
  65. package/lib/crashlytics/listTopIssues.js +0 -30
  66. package/lib/crashlytics/listTopOperatingSystems.js +0 -32
  67. package/lib/crashlytics/listTopVersions.js +0 -32
  68. package/lib/crashlytics/updateIssue.js +0 -35
  69. package/lib/mcp/prompts/crashlytics/common.js +0 -10
  70. package/lib/mcp/prompts/crashlytics/fix_issue.js +0 -89
  71. package/lib/mcp/prompts/crashlytics/prioritize_issues.js +0 -79
  72. package/lib/mcp/tools/crashlytics/add_note.js +0 -32
  73. package/lib/mcp/tools/crashlytics/constants.js +0 -11
  74. package/lib/mcp/tools/crashlytics/delete_note.js +0 -35
  75. package/lib/mcp/tools/crashlytics/get_issue_details.js +0 -31
  76. package/lib/mcp/tools/crashlytics/get_sample_crash.js +0 -43
  77. package/lib/mcp/tools/crashlytics/list_notes.js +0 -37
  78. package/lib/mcp/tools/crashlytics/list_top_devices.js +0 -33
  79. package/lib/mcp/tools/crashlytics/list_top_issues.js +0 -38
  80. package/lib/mcp/tools/crashlytics/list_top_operating_systems.js +0 -33
  81. package/lib/mcp/tools/crashlytics/list_top_versions.js +0 -33
  82. package/lib/mcp/tools/crashlytics/update_issue.js +0 -37
  83. package/lib/mcp/tools/database/set_rules.js +0 -41
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateIssue = exports.IssueState = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- var IssueState;
8
- (function (IssueState) {
9
- IssueState["OPEN"] = "OPEN";
10
- IssueState["CLOSED"] = "CLOSED";
11
- })(IssueState = exports.IssueState || (exports.IssueState = {}));
12
- async function updateIssue(appId, issueId, state) {
13
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
14
- try {
15
- logger_1.logger.debug(`[mcp][crashlytics] updateIssue called with appId: ${appId}, issueId: ${issueId}, state: ${state}`);
16
- const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
17
- method: "PATCH",
18
- headers: {
19
- "Content-Type": "application/json",
20
- },
21
- path: `/projects/${requestProjectNumber}/apps/${appId}/issues/${issueId}`,
22
- queryParams: { updateMask: "state" },
23
- body: { state },
24
- timeout: utils_1.TIMEOUT,
25
- });
26
- return response.body;
27
- }
28
- catch (err) {
29
- logger_1.logger.debug(err.message);
30
- throw new error_1.FirebaseError(`Failed to update issue ${issueId} for app ${appId}. Error: ${err}.`, {
31
- original: err,
32
- });
33
- }
34
- }
35
- exports.updateIssue = updateIssue;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAppIdInstruction = exports.ACTIVE_USER_INSTRUCTION = void 0;
4
- exports.ACTIVE_USER_INSTRUCTION = "If the Firbase 'Active user' is set to <NONE>, instruct the user to run `firebase login` before continuing. You will know that the user is not logged in if we have nothing in the 'Active user' field.";
5
- const getAppIdInstruction = (index) => `If there is no active app id, then do the following:
6
- ${index}a. If this is an Android app, read the mobilesdk_app_id value specified in the google-services.json file. If there are multiple files or multiple app ids in single file. Ask the user to disambiguate.
7
- ${index}b. If this is an iOS app, read the GOOGLE_APP_ID from GoogleService-Info.plist file. If there are multiple files or multiple app ids in single file. Ask the user to disambiguate.
8
- ${index}c. If you can't find either of the above, ask the user for the app id.
9
- `;
10
- exports.getAppIdInstruction = getAppIdInstruction;
@@ -1,89 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fix_issue = void 0;
4
- const prompt_1 = require("../../prompt");
5
- const common_1 = require("./common");
6
- const APP_ID_INSTRUCTION = (0, common_1.getAppIdInstruction)(2);
7
- exports.fix_issue = (0, prompt_1.prompt)({
8
- name: "fix_issue",
9
- omitPrefix: false,
10
- description: "Fix a Crashlytics issue",
11
- arguments: [
12
- {
13
- name: "app_id",
14
- description: "A Firebase app id.",
15
- required: false,
16
- },
17
- {
18
- name: "issue_id",
19
- description: "A Crashlytics issue id.",
20
- required: true,
21
- },
22
- ],
23
- annotations: {
24
- title: "Prioritize Crashlytics Issues",
25
- },
26
- }, async ({ app_id, issue_id }, { accountEmail }) => {
27
- return [
28
- {
29
- role: "user",
30
- content: {
31
- type: "text",
32
- text: `
33
- Your goal is to fix a specific issue from Crashlytics.
34
-
35
- Active user: ${accountEmail || "<NONE>"}
36
- Active app: ${app_id || "<NONE>"}
37
- Issue id: ${issue_id}
38
-
39
- ## Required information
40
-
41
- ## Required information
42
-
43
- Before fetching and prioritizing issues, secure the following information:
44
-
45
- First, and this is INCREDIBLY IMPORTANT, verify the active user. IT IS SO IMPORTANT THAT YOU DO THIS FIRST. NO TOOL CALL WILL WORK WITHOUT IT. ${common_1.ACTIVE_USER_INSTRUCTION}
46
- Then, verify the app id. ${APP_ID_INSTRUCTION}
47
- Finally, verify the issue id is not null or empty.
48
-
49
- All are required to successfully investigate and fix an issue.
50
-
51
- ## Steps
52
-
53
- 1. Make sure you have a good understanding of the code structure and where different functionality exists
54
- 2. Use the 'crashlytics_get_issue_details' tool to get more context on the issue.
55
- 3. Use the 'crashlytics_get_sample_crash_for_issue' tool to get 3 example crashes for this issue.
56
- 4. Read the files that exist in the stack trace of the issue to understand the crash deeply.
57
- 5. Determine the root cause of the crash.
58
- 6. Write out a plan using the following criteria:
59
- 6a. Write out a description of the issue and including
60
- * A brief description of the cause of the issue
61
- * A determination of your level of confidence in the cause of the issue
62
- * A determination of which library is at fault, this codebase or a dependent library
63
- * A determination for how complex the fix will be
64
- 6b. The plan should include relevant files to change
65
- 6c. The plan should include a test plan to verify the fix
66
- 6d. Use the following format for the plan:
67
-
68
- **Cause**
69
- <A description of the cause of the issue>
70
-
71
- **Confidence**: <one of "not at all confident", "somewhat confident", "confident", "very confident">
72
- **Fault**: <a determination of whether this code base is at fault or a dependent library is at fault>
73
- **Complexity**: <one of "simple", "moderately simple", "moderately hard", "hard", "oof, I don't know where to start">
74
-
75
- **Fix**
76
- <A plan for how to fix the issue>
77
-
78
- **Test**
79
- <a plan for how to test that the issue has been fixed an protect against regressions>
80
- 7. Present the plan to the user and get approval before making the change.
81
- 8. Fix the issue.
82
- 8a. Be mindful of API contracts and do not add fields to resources without a clear way to populate those fields
83
- 8b. If there is not enough information in the crash report to find a root cause, describe why you cannot fix the issue instead of making a guess.
84
- 9. Ask the developer if they would like you to test the fix for them.
85
- `.trim(),
86
- },
87
- },
88
- ];
89
- });
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prioritize_issues = void 0;
4
- const prompt_1 = require("../../prompt");
5
- const common_1 = require("./common");
6
- const APP_ID_INSTRUCTION = (0, common_1.getAppIdInstruction)(2);
7
- exports.prioritize_issues = (0, prompt_1.prompt)({
8
- name: "prioritize_issues",
9
- omitPrefix: false,
10
- description: "Fetch and prioritize issues from Crashlytics.",
11
- arguments: [
12
- {
13
- name: "app_id",
14
- description: "AppId for which the issues list should be fetched.",
15
- required: false,
16
- },
17
- {
18
- name: "issue_count",
19
- description: "The number of issues that should be returned in the final list. Defaults to 5.",
20
- required: false,
21
- },
22
- {
23
- name: "prompt",
24
- description: "Any additional instructions you wish to provide about issue prioritization.",
25
- required: false,
26
- },
27
- ],
28
- annotations: {
29
- title: "Prioritize Crashlytics Issues",
30
- },
31
- }, async ({ app_id, prompt, issue_count }, { accountEmail }) => {
32
- return [
33
- {
34
- role: "user",
35
- content: {
36
- type: "text",
37
- text: `
38
- Your goal is to prioritize issues from Crashlytics and return the top ${issue_count || 5} issues based on the criteria below.
39
-
40
- Active user: ${accountEmail || "<NONE>"}
41
- Active app: ${app_id || "<NONE>"}
42
-
43
- ## User Instructions
44
-
45
- ${prompt || "<the user didn't supply specific instructions>"}
46
-
47
- ## Required information
48
-
49
- Before fetching and prioritizing issues, secure the following information:
50
-
51
- First, and this is INCREDIBLY IMPORTANT, verify the active user. IT IS SO IMPORTANT THAT YOU DO THIS FIRST. NO TOOL CALL WILL WORK WITHOUT IT. ${common_1.ACTIVE_USER_INSTRUCTION}
52
- Then, verify the app id. ${APP_ID_INSTRUCTION}
53
-
54
- Both pieces of information are required to successfully prioritize issues.
55
-
56
- ## Steps
57
-
58
- Follow the steps below taking note of any user instructions provided above.
59
-
60
- 1. Use the 'crashlytics_list_top_issues' tool to fetch up to 20 issues.
61
- 2. Use the 'crashlytics_list_top_versions' tool to fetch the top versions for this app.
62
- 3. If the user instructions include statements about prioritization, use those instructions.
63
- 4. If the user instructions do not include statements about prioritization, then prioritize the returned issues using the following criteria:
64
- 4a. The app versions for the issue include the most recent version of the app.
65
- 4b. The number of users experiencing the issue across variants
66
- 4c. The volume of crashes
67
- 5. Return the top ${issue_count || 5} issue ids, with a brief description of the issue in the following format:
68
- * Issue <issue id>
69
- * <the issue title>
70
- * <the issue subtitle>
71
- * Description: <a discription of the issue based on information from the tool response>
72
- * Rationale: <the reason this issue was prioritized in the way it was>
73
-
74
- The point of this command is to surface information only.
75
- `.trim(),
76
- },
77
- },
78
- ];
79
- });
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.add_note = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const addNote_1 = require("../../../crashlytics/addNote");
8
- const constants_1 = require("./constants");
9
- exports.add_note = (0, tool_1.tool)({
10
- name: "add_note",
11
- description: "Add a note to an issue from crashlytics.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z.string().describe("The issue id to add the note to."),
15
- note: zod_1.z.string().describe("The note to add to the issue."),
16
- }),
17
- annotations: {
18
- title: "Add note to Crashlytics issue.",
19
- readOnlyHint: true,
20
- },
21
- _meta: {
22
- requiresAuth: true,
23
- },
24
- }, async ({ app_id, issue_id, note }) => {
25
- if (!app_id)
26
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
27
- if (!issue_id)
28
- return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
29
- if (!note)
30
- return (0, util_1.mcpError)(`Must specify 'note' parameter.`);
31
- return (0, util_1.toContent)(await (0, addNote_1.addNote)(app_id, issue_id, note));
32
- });
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APP_ID_FIELD = void 0;
4
- const zod_1 = require("zod");
5
- exports.APP_ID_FIELD = zod_1.z
6
- .string()
7
- .describe("AppId for the application. For an Android application, read the " +
8
- "mobilesdk_app_id value specified in the google-services.json file for " +
9
- "the current package name. For an iOS Application, read the GOOGLE_APP_ID " +
10
- "from GoogleService-Info.plist. If neither is available, ask the user to " +
11
- "provide the app id.");
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.delete_note = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const deleteNote_1 = require("../../../crashlytics/deleteNote");
8
- const constants_1 = require("./constants");
9
- exports.delete_note = (0, tool_1.tool)({
10
- name: "delete_note",
11
- description: "Delete a note from an issue in Crashlytics.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z.string().describe("The issue id to delete the note from."),
15
- note_id: zod_1.z.string().describe("The note id to delete."),
16
- }),
17
- annotations: {
18
- title: "Delete Note from Crashlytics Issue.",
19
- readOnlyHint: true,
20
- },
21
- _meta: {
22
- requiresAuth: true,
23
- },
24
- }, async ({ app_id, issue_id, note_id }) => {
25
- if (!app_id) {
26
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
27
- }
28
- if (!issue_id) {
29
- return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
30
- }
31
- if (!note_id) {
32
- return (0, util_1.mcpError)(`Must specify 'note_id' parameter.`);
33
- }
34
- return (0, util_1.toContent)(await (0, deleteNote_1.deleteNote)(app_id, issue_id, note_id));
35
- });
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get_issue_details = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const getIssueDetails_1 = require("../../../crashlytics/getIssueDetails");
8
- const constants_1 = require("./constants");
9
- exports.get_issue_details = (0, tool_1.tool)({
10
- name: "get_issue_details",
11
- description: "Gets the details about a specific crashlytics issue.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z
15
- .string()
16
- .describe("The issue ID for which the details needs to be fetched. This is the value of the field `id` in the list of issues. Defaults to the first id in the list of issues."),
17
- }),
18
- annotations: {
19
- title: "Gets the details of a specific issue.",
20
- readOnlyHint: true,
21
- },
22
- _meta: {
23
- requiresAuth: true,
24
- },
25
- }, async ({ app_id, issue_id }) => {
26
- if (!app_id)
27
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
28
- if (!issue_id)
29
- return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
30
- return (0, util_1.toContent)(await (0, getIssueDetails_1.getIssueDetails)(app_id, issue_id));
31
- });
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get_sample_crash = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const getSampleCrash_1 = require("../../../crashlytics/getSampleCrash");
8
- const constants_1 = require("./constants");
9
- exports.get_sample_crash = (0, tool_1.tool)({
10
- name: "get_sample_crash_for_issue",
11
- description: "Gets the sample crash for an issue.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z
15
- .string()
16
- .describe("The issue Id for which the sample crash needs to be fetched. This is the value of the field `id` in the list of issues. Defaults to the first id in the list of issues."),
17
- variant_id: zod_1.z
18
- .string()
19
- .optional()
20
- .describe("The issue variant Id used as a filter to get sample issues."),
21
- sample_count: zod_1.z
22
- .number()
23
- .describe("Number of samples that needs to be fetched. Maximum value is 3. Defaults to 1.")
24
- .default(1),
25
- }),
26
- annotations: {
27
- title: "Gets a sample of a crash for a specific issue.",
28
- readOnlyHint: true,
29
- },
30
- _meta: {
31
- requiresAuth: true,
32
- },
33
- }, async ({ app_id, issue_id, variant_id, sample_count }) => {
34
- if (!app_id)
35
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
36
- if (!issue_id)
37
- return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
38
- if (!sample_count)
39
- sample_count = 1;
40
- if (sample_count > 3)
41
- sample_count = 3;
42
- return (0, util_1.toContent)(await (0, getSampleCrash_1.getSampleCrash)(app_id, issue_id, sample_count, variant_id));
43
- });
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.list_notes = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const listNotes_1 = require("../../../crashlytics/listNotes");
8
- const constants_1 = require("./constants");
9
- exports.list_notes = (0, tool_1.tool)({
10
- name: "list_notes",
11
- description: "List all notes for an issue in Crashlytics.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z.string().describe("The issue id to list notes for."),
15
- note_count: zod_1.z
16
- .number()
17
- .optional()
18
- .default(10)
19
- .describe("Number of notes that needs to be fetched. Defaults to 10 if unspecified."),
20
- }),
21
- annotations: {
22
- title: "List notes for a Crashlytics issue.",
23
- readOnlyHint: true,
24
- },
25
- _meta: {
26
- requiresAuth: true,
27
- },
28
- }, async ({ app_id, issue_id, note_count }) => {
29
- if (!app_id) {
30
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
31
- }
32
- if (!issue_id) {
33
- return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
34
- }
35
- note_count !== null && note_count !== void 0 ? note_count : (note_count = 10);
36
- return (0, util_1.toContent)(await (0, listNotes_1.listNotes)(app_id, issue_id, note_count));
37
- });
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.list_top_devices = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const listTopDevices_1 = require("../../../crashlytics/listTopDevices");
8
- const constants_1 = require("./constants");
9
- exports.list_top_devices = (0, tool_1.tool)({
10
- name: "list_top_devices",
11
- description: "List the top devices from Crashlytics for an application.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z.string().optional().describe("The issue id to filter on"),
15
- device_count: zod_1.z
16
- .number()
17
- .optional()
18
- .default(10)
19
- .describe("Number of devices that needs to be fetched. Defaults to 10 if unspecified."),
20
- }),
21
- annotations: {
22
- title: "List Top Crashlytics Devices.",
23
- readOnlyHint: true,
24
- },
25
- _meta: {
26
- requiresAuth: true,
27
- },
28
- }, async ({ app_id, issue_id, device_count }) => {
29
- if (!app_id)
30
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
31
- device_count !== null && device_count !== void 0 ? device_count : (device_count = 10);
32
- return (0, util_1.toContent)(await (0, listTopDevices_1.listTopDevices)(app_id, device_count, issue_id));
33
- });
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.list_top_issues = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const listTopIssues_1 = require("../../../crashlytics/listTopIssues");
8
- const constants_1 = require("./constants");
9
- exports.list_top_issues = (0, tool_1.tool)({
10
- name: "list_top_issues",
11
- description: "List the top crashes from crashlytics happening in the application.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_count: zod_1.z
15
- .number()
16
- .optional()
17
- .describe("Number of issues that needs to be fetched. Defaults to 10 if unspecified.")
18
- .default(10),
19
- issue_type: zod_1.z
20
- .enum(["FATAL", "NON-FATAL", "ANR"])
21
- .optional()
22
- .default("FATAL")
23
- .describe("Types of issues that can be fetched comma-separated. Defaults to `FATAL` (Crashes). Other values include NON-FATAL (Non-fatal issues), ANR (Application not responding)."),
24
- }),
25
- annotations: {
26
- title: "List Top Crashlytics Issues.",
27
- readOnlyHint: true,
28
- },
29
- _meta: {
30
- requiresAuth: true,
31
- },
32
- }, async ({ app_id, issue_type, issue_count }) => {
33
- if (!app_id)
34
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
35
- issue_type !== null && issue_type !== void 0 ? issue_type : (issue_type = "FATAL");
36
- issue_count !== null && issue_count !== void 0 ? issue_count : (issue_count = 10);
37
- return (0, util_1.toContent)(await (0, listTopIssues_1.listTopIssues)(app_id, issue_type, issue_count));
38
- });
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.list_top_operating_systems = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const listTopOperatingSystems_1 = require("../../../crashlytics/listTopOperatingSystems");
8
- const constants_1 = require("./constants");
9
- exports.list_top_operating_systems = (0, tool_1.tool)({
10
- name: "list_top_operating_systems",
11
- description: "List the top operating systems from Crashlytics for an application.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z.string().optional().describe("The issue id to filter on"),
15
- os_count: zod_1.z
16
- .number()
17
- .optional()
18
- .default(10)
19
- .describe("Number of operating systems that needs to be fetched. Defaults to 10 if unspecified."),
20
- }),
21
- annotations: {
22
- title: "List Top Crashlytics Operating Systems.",
23
- readOnlyHint: true,
24
- },
25
- _meta: {
26
- requiresAuth: true,
27
- },
28
- }, async ({ app_id, issue_id, os_count }) => {
29
- if (!app_id)
30
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
31
- os_count !== null && os_count !== void 0 ? os_count : (os_count = 10);
32
- return (0, util_1.toContent)(await (0, listTopOperatingSystems_1.listTopOperatingSystems)(app_id, os_count, issue_id));
33
- });
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.list_top_versions = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const listTopVersions_1 = require("../../../crashlytics/listTopVersions");
8
- const constants_1 = require("./constants");
9
- exports.list_top_versions = (0, tool_1.tool)({
10
- name: "list_top_versions",
11
- description: "List the top versions from Crashlytics for an application.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z.string().optional().describe("The issue id to filter on"),
15
- version_count: zod_1.z
16
- .number()
17
- .optional()
18
- .default(10)
19
- .describe("Number of versions that needs to be fetched. Defaults to 10 if unspecified."),
20
- }),
21
- annotations: {
22
- title: "List Top Crashlytics Versions.",
23
- readOnlyHint: true,
24
- },
25
- _meta: {
26
- requiresAuth: true,
27
- },
28
- }, async ({ app_id, issue_id, version_count }) => {
29
- if (!app_id)
30
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
31
- version_count !== null && version_count !== void 0 ? version_count : (version_count = 10);
32
- return (0, util_1.toContent)(await (0, listTopVersions_1.listTopVersions)(app_id, version_count, issue_id));
33
- });
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.update_issue = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const updateIssue_1 = require("../../../crashlytics/updateIssue");
8
- const constants_1 = require("./constants");
9
- exports.update_issue = (0, tool_1.tool)({
10
- name: "update_issue",
11
- description: "Update the state of an issue in Crashlytics.",
12
- inputSchema: zod_1.z.object({
13
- app_id: constants_1.APP_ID_FIELD,
14
- issue_id: zod_1.z.string().describe("The issue id to update."),
15
- state: zod_1.z
16
- .nativeEnum(updateIssue_1.IssueState)
17
- .describe("The new state for the issue. Can be 'OPEN' or 'CLOSED'."),
18
- }),
19
- annotations: {
20
- title: "Update Crashlytics issue state.",
21
- readOnlyHint: true,
22
- },
23
- _meta: {
24
- requiresAuth: true,
25
- },
26
- }, async ({ app_id, issue_id, state }) => {
27
- if (!app_id) {
28
- return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
29
- }
30
- if (!issue_id) {
31
- return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
32
- }
33
- if (!state) {
34
- return (0, util_1.mcpError)(`Must specify 'state' parameter.`);
35
- }
36
- return (0, util_1.toContent)(await (0, updateIssue_1.updateIssue)(app_id, issue_id, state));
37
- });
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validate_rules = void 0;
4
- const zod_1 = require("zod");
5
- const apiv2_1 = require("../../../apiv2");
6
- const tool_1 = require("../../tool");
7
- const util_1 = require("../../util");
8
- const rtdb_1 = require("../../../rtdb");
9
- const error_1 = require("../../../error");
10
- exports.validate_rules = (0, tool_1.tool)({
11
- name: "validate_rules",
12
- description: "Validates an RTDB database's rules",
13
- inputSchema: zod_1.z.object({
14
- databaseUrl: zod_1.z
15
- .string()
16
- .optional()
17
- .describe("connect to the database at url. If omitted, use default database instance <project>-default-rtdb.firebaseio.com. Can point to emulator URL (e.g. localhost:6000/<instance>)"),
18
- rules: zod_1.z
19
- .string()
20
- .describe('The rules object, as a string (ex: {".read": false, ".write": false})'),
21
- }),
22
- annotations: {
23
- title: "Validate Realtime Database rules",
24
- idempotentHint: true,
25
- },
26
- _meta: {
27
- requiresAuth: true,
28
- requiresProject: false,
29
- },
30
- }, async ({ databaseUrl, rules }, { projectId, host }) => {
31
- const dbUrl = databaseUrl !== null && databaseUrl !== void 0 ? databaseUrl : `https://${projectId}-default-rtdb.us-central1.firebasedatabase.app`;
32
- const client = new apiv2_1.Client({ urlPrefix: dbUrl });
33
- try {
34
- await (0, rtdb_1.updateRulesWithClient)(client, rules, { dryRun: true });
35
- }
36
- catch (e) {
37
- host.logger.debug(`failed to update rules at url ${dbUrl}`);
38
- return (0, util_1.mcpError)((0, error_1.getErrMsg)(e));
39
- }
40
- return (0, util_1.toContent)("the inputted rules are valid!");
41
- });