firebase-tools 14.14.0 → 14.15.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 (67) hide show
  1. package/lib/apphosting/backend.js +40 -15
  2. package/lib/auth.js +37 -2
  3. package/lib/commands/apphosting-backends-create.js +8 -5
  4. package/lib/commands/dataconnect-sdk-generate.js +3 -5
  5. package/lib/commands/dataconnect-sql-diff.js +2 -2
  6. package/lib/commands/dataconnect-sql-grant.js +2 -2
  7. package/lib/commands/dataconnect-sql-migrate.js +2 -2
  8. package/lib/commands/dataconnect-sql-setup.js +2 -2
  9. package/lib/commands/dataconnect-sql-shell.js +2 -2
  10. package/lib/commands/init.js +3 -0
  11. package/lib/commands/login.js +12 -7
  12. package/lib/crashlytics/addNote.js +27 -0
  13. package/lib/crashlytics/deleteNote.js +23 -0
  14. package/lib/crashlytics/getIssueDetails.js +5 -20
  15. package/lib/crashlytics/getSampleCrash.js +6 -20
  16. package/lib/crashlytics/listNotes.js +29 -0
  17. package/lib/crashlytics/listTopDevices.js +33 -0
  18. package/lib/crashlytics/listTopIssues.js +8 -23
  19. package/lib/crashlytics/listTopOperatingSystems.js +32 -0
  20. package/lib/crashlytics/listTopVersions.js +32 -0
  21. package/lib/crashlytics/updateIssue.js +35 -0
  22. package/lib/crashlytics/utils.js +38 -0
  23. package/lib/dataconnect/appFinder.js +103 -0
  24. package/lib/dataconnect/load.js +105 -6
  25. package/lib/deploy/dataconnect/prepare.js +1 -3
  26. package/lib/emulator/controller.js +2 -2
  27. package/lib/emulator/downloadableEmulatorInfo.json +17 -17
  28. package/lib/init/features/dataconnect/create_app.js +48 -0
  29. package/lib/init/features/dataconnect/index.js +19 -30
  30. package/lib/init/features/dataconnect/sdk.js +218 -161
  31. package/lib/init/features/index.js +3 -2
  32. package/lib/init/index.js +5 -1
  33. package/lib/management/apps.js +3 -3
  34. package/lib/mcp/prompts/core/deploy.js +51 -8
  35. package/lib/mcp/prompts/crashlytics/common.js +10 -0
  36. package/lib/mcp/prompts/crashlytics/fix_issue.js +89 -0
  37. package/lib/mcp/prompts/crashlytics/index.js +6 -0
  38. package/lib/mcp/prompts/crashlytics/prioritize_issues.js +79 -0
  39. package/lib/mcp/prompts/index.js +3 -2
  40. package/lib/mcp/tools/core/init.js +5 -1
  41. package/lib/mcp/tools/crashlytics/add_note.js +32 -0
  42. package/lib/mcp/tools/crashlytics/constants.js +11 -0
  43. package/lib/mcp/tools/crashlytics/delete_note.js +35 -0
  44. package/lib/mcp/tools/crashlytics/get_issue_details.js +2 -4
  45. package/lib/mcp/tools/crashlytics/get_sample_crash.js +4 -4
  46. package/lib/mcp/tools/crashlytics/index.js +16 -2
  47. package/lib/mcp/tools/crashlytics/list_notes.js +37 -0
  48. package/lib/mcp/tools/crashlytics/list_top_devices.js +33 -0
  49. package/lib/mcp/tools/crashlytics/list_top_issues.js +5 -7
  50. package/lib/mcp/tools/crashlytics/list_top_operating_systems.js +33 -0
  51. package/lib/mcp/tools/crashlytics/list_top_versions.js +33 -0
  52. package/lib/mcp/tools/crashlytics/update_issue.js +37 -0
  53. package/lib/mcp/tools/dataconnect/execute_graphql.js +2 -2
  54. package/lib/mcp/tools/dataconnect/execute_graphql_read.js +2 -2
  55. package/lib/mcp/tools/dataconnect/execute_mutation.js +2 -2
  56. package/lib/mcp/tools/dataconnect/execute_query.js +2 -2
  57. package/lib/mcp/tools/dataconnect/generate_operation.js +2 -2
  58. package/lib/mcp/tools/dataconnect/get_connector.js +2 -2
  59. package/lib/mcp/tools/dataconnect/get_schema.js +2 -2
  60. package/lib/utils.js +11 -1
  61. package/package.json +1 -1
  62. package/templates/init/dataconnect/connector.yaml +0 -16
  63. package/templates/init/dataconnect/dataconnect.yaml +2 -1
  64. package/templates/init/dataconnect/mutations.gql +29 -29
  65. package/templates/init/dataconnect/queries.gql +73 -73
  66. package/templates/init/dataconnect/schema.gql +48 -48
  67. package/lib/dataconnect/fileUtils.js +0 -168
@@ -0,0 +1,89 @@
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
+ });
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.crashlyticsPrompts = void 0;
4
+ const fix_issue_1 = require("./fix_issue");
5
+ const prioritize_issues_1 = require("./prioritize_issues");
6
+ exports.crashlyticsPrompts = [fix_issue_1.fix_issue, prioritize_issues_1.prioritize_issues];
@@ -0,0 +1,79 @@
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
+ });
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.availablePrompts = void 0;
4
4
  const core_1 = require("./core");
5
+ const crashlytics_1 = require("./crashlytics");
5
6
  const prompts = {
6
7
  core: core_1.corePrompts,
7
8
  firestore: [],
@@ -10,7 +11,7 @@ const prompts = {
10
11
  auth: [],
11
12
  messaging: [],
12
13
  remoteconfig: [],
13
- crashlytics: [],
14
+ crashlytics: crashlytics_1.crashlyticsPrompts,
14
15
  apphosting: [],
15
16
  database: [],
16
17
  };
@@ -24,7 +25,7 @@ function namespacePrompts(promptsToNamespace, feature) {
24
25
  newPrompt.mcp.name = `firebase:${p.mcp.name}`;
25
26
  }
26
27
  else {
27
- newPrompt.mcp.name = `firebase:${feature}:${p.mcp.name}`;
28
+ newPrompt.mcp.name = `${feature}:${p.mcp.name}`;
28
29
  }
29
30
  newPrompt.mcp._meta = Object.assign(Object.assign({}, p.mcp._meta), { feature });
30
31
  return newPrompt;
@@ -78,7 +78,8 @@ exports.init = (0, tool_1.tool)({
78
78
  .describe("The Postgres database ID to use in the Firebase Data Connect service."),
79
79
  })
80
80
  .optional()
81
- .describe("Provide this object to initialize Firebase Data Connect with Cloud SQL Postgres in this project directory."),
81
+ .describe("Provide this object to initialize Firebase Data Connect with Cloud SQL Postgres in this project directory.\n" +
82
+ "It installs Data Connect Generated SDKs in all detected apps in the folder."),
82
83
  storage: zod_1.z
83
84
  .object({
84
85
  rules_filename: zod_1.z
@@ -138,6 +139,9 @@ exports.init = (0, tool_1.tool)({
138
139
  cloudSqlInstanceId: features.dataconnect.cloudsql_instance_id || "",
139
140
  cloudSqlDatabase: features.dataconnect.cloudsql_database || "",
140
141
  };
142
+ featureInfo.dataconnectSdk = {
143
+ apps: [],
144
+ };
141
145
  }
142
146
  const setup = {
143
147
  config: config === null || config === void 0 ? void 0 : config.src,
@@ -0,0 +1,32 @@
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
+ });
@@ -0,0 +1,11 @@
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.");
@@ -0,0 +1,35 @@
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
+ });
@@ -5,13 +5,12 @@ const zod_1 = require("zod");
5
5
  const tool_1 = require("../../tool");
6
6
  const util_1 = require("../../util");
7
7
  const getIssueDetails_1 = require("../../../crashlytics/getIssueDetails");
8
+ const constants_1 = require("./constants");
8
9
  exports.get_issue_details = (0, tool_1.tool)({
9
10
  name: "get_issue_details",
10
11
  description: "Gets the details about a specific crashlytics issue.",
11
12
  inputSchema: zod_1.z.object({
12
- app_id: zod_1.z
13
- .string()
14
- .describe("The AppID for which the issues list should be fetched. For an Android application, read the mobilesdk_app_id value specified in the google-services.json file for the current package name. For an iOS Application, read the GOOGLE_APP_ID from GoogleService-Info.plist. If neither is available, use the `firebase_list_apps` tool to find an app_id to pass to this tool."),
13
+ app_id: constants_1.APP_ID_FIELD,
15
14
  issue_id: zod_1.z
16
15
  .string()
17
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."),
@@ -22,7 +21,6 @@ exports.get_issue_details = (0, tool_1.tool)({
22
21
  },
23
22
  _meta: {
24
23
  requiresAuth: true,
25
- requiresProject: false,
26
24
  },
27
25
  }, async ({ app_id, issue_id }) => {
28
26
  if (!app_id)
@@ -5,13 +5,12 @@ const zod_1 = require("zod");
5
5
  const tool_1 = require("../../tool");
6
6
  const util_1 = require("../../util");
7
7
  const getSampleCrash_1 = require("../../../crashlytics/getSampleCrash");
8
+ const constants_1 = require("./constants");
8
9
  exports.get_sample_crash = (0, tool_1.tool)({
9
10
  name: "get_sample_crash_for_issue",
10
11
  description: "Gets the sample crash for an issue.",
11
12
  inputSchema: zod_1.z.object({
12
- app_id: zod_1.z
13
- .string()
14
- .describe("AppId for which the issues list should be fetched. For an Android application, read the mobilesdk_app_id value specified in the google-services.json file for the current package name. For an iOS Application, read the GOOGLE_APP_ID from GoogleService-Info.plist. If neither is available, use the `firebase_list_apps` tool to find an app_id to pass to this tool."),
13
+ app_id: constants_1.APP_ID_FIELD,
15
14
  issue_id: zod_1.z
16
15
  .string()
17
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."),
@@ -30,13 +29,14 @@ exports.get_sample_crash = (0, tool_1.tool)({
30
29
  },
31
30
  _meta: {
32
31
  requiresAuth: true,
33
- requiresProject: false,
34
32
  },
35
33
  }, async ({ app_id, issue_id, variant_id, sample_count }) => {
36
34
  if (!app_id)
37
35
  return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
38
36
  if (!issue_id)
39
37
  return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
38
+ if (!sample_count)
39
+ sample_count = 1;
40
40
  if (sample_count > 3)
41
41
  sample_count = 3;
42
42
  return (0, util_1.toContent)(await (0, getSampleCrash_1.getSampleCrash)(app_id, issue_id, sample_count, variant_id));
@@ -1,11 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.crashlyticsTools = void 0;
4
+ const add_note_1 = require("./add_note");
5
+ const delete_note_1 = require("./delete_note");
4
6
  const get_issue_details_1 = require("./get_issue_details");
5
- const list_top_issues_1 = require("./list_top_issues");
6
7
  const get_sample_crash_1 = require("./get_sample_crash");
8
+ const list_notes_1 = require("./list_notes");
9
+ const list_top_devices_1 = require("./list_top_devices");
10
+ const list_top_issues_1 = require("./list_top_issues");
11
+ const list_top_operating_systems_1 = require("./list_top_operating_systems");
12
+ const list_top_versions_1 = require("./list_top_versions");
13
+ const update_issue_1 = require("./update_issue");
7
14
  exports.crashlyticsTools = [
8
- list_top_issues_1.list_top_issues,
15
+ add_note_1.add_note,
16
+ delete_note_1.delete_note,
9
17
  get_issue_details_1.get_issue_details,
10
18
  get_sample_crash_1.get_sample_crash,
19
+ list_notes_1.list_notes,
20
+ list_top_devices_1.list_top_devices,
21
+ list_top_issues_1.list_top_issues,
22
+ list_top_operating_systems_1.list_top_operating_systems,
23
+ list_top_versions_1.list_top_versions,
24
+ update_issue_1.update_issue,
11
25
  ];
@@ -0,0 +1,37 @@
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
+ });
@@ -0,0 +1,33 @@
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
+ });
@@ -5,14 +5,12 @@ const zod_1 = require("zod");
5
5
  const tool_1 = require("../../tool");
6
6
  const util_1 = require("../../util");
7
7
  const listTopIssues_1 = require("../../../crashlytics/listTopIssues");
8
+ const constants_1 = require("./constants");
8
9
  exports.list_top_issues = (0, tool_1.tool)({
9
10
  name: "list_top_issues",
10
11
  description: "List the top crashes from crashlytics happening in the application.",
11
12
  inputSchema: zod_1.z.object({
12
- app_id: zod_1.z
13
- .string()
14
- .optional()
15
- .describe("AppId for which the issues list should be fetched. For an Android application, read the mobilesdk_app_id value specified in the google-services.json file for the current package name. For an iOS Application, read the GOOGLE_APP_ID from GoogleService-Info.plist. If neither is available, use the `firebase_list_apps` tool to find an app_id to pass to this tool."),
13
+ app_id: constants_1.APP_ID_FIELD,
16
14
  issue_count: zod_1.z
17
15
  .number()
18
16
  .optional()
@@ -21,6 +19,7 @@ exports.list_top_issues = (0, tool_1.tool)({
21
19
  issue_type: zod_1.z
22
20
  .enum(["FATAL", "NON-FATAL", "ANR"])
23
21
  .optional()
22
+ .default("FATAL")
24
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)."),
25
24
  }),
26
25
  annotations: {
@@ -29,12 +28,11 @@ exports.list_top_issues = (0, tool_1.tool)({
29
28
  },
30
29
  _meta: {
31
30
  requiresAuth: true,
32
- requiresProject: true,
33
31
  },
34
- }, async ({ app_id, issue_type, issue_count }, { projectId }) => {
32
+ }, async ({ app_id, issue_type, issue_count }) => {
35
33
  if (!app_id)
36
34
  return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
37
35
  issue_type !== null && issue_type !== void 0 ? issue_type : (issue_type = "FATAL");
38
36
  issue_count !== null && issue_count !== void 0 ? issue_count : (issue_count = 10);
39
- return (0, util_1.toContent)(await (0, listTopIssues_1.listTopIssues)(projectId, app_id, issue_type, issue_count));
37
+ return (0, util_1.toContent)(await (0, listTopIssues_1.listTopIssues)(app_id, issue_type, issue_count));
40
38
  });
@@ -0,0 +1,33 @@
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
+ });
@@ -0,0 +1,33 @@
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
+ });
@@ -0,0 +1,37 @@
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
+ });
@@ -4,7 +4,7 @@ exports.execute_graphql = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const tool_1 = require("../../tool");
6
6
  const dataplane = require("../../../dataconnect/dataplaneClient");
7
- const fileUtils_1 = require("../../../dataconnect/fileUtils");
7
+ const load_1 = require("../../../dataconnect/load");
8
8
  const converter_1 = require("./converter");
9
9
  const emulator_1 = require("./emulator");
10
10
  exports.execute_graphql = (0, tool_1.tool)({
@@ -31,7 +31,7 @@ exports.execute_graphql = (0, tool_1.tool)({
31
31
  requiresAuth: true,
32
32
  },
33
33
  }, async ({ query, service_id, variables: unparsedVariables, use_emulator }, { projectId, config, host }) => {
34
- const serviceInfo = await (0, fileUtils_1.pickService)(projectId, config, service_id || undefined);
34
+ const serviceInfo = await (0, load_1.pickService)(projectId, config, service_id || undefined);
35
35
  let apiClient;
36
36
  if (use_emulator) {
37
37
  apiClient = await (0, emulator_1.getDataConnectEmulatorClient)(host);
@@ -4,7 +4,7 @@ exports.execute_graphql_read = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const tool_1 = require("../../tool");
6
6
  const dataplane = require("../../../dataconnect/dataplaneClient");
7
- const fileUtils_1 = require("../../../dataconnect/fileUtils");
7
+ const load_1 = require("../../../dataconnect/load");
8
8
  const converter_1 = require("./converter");
9
9
  const emulator_1 = require("./emulator");
10
10
  exports.execute_graphql_read = (0, tool_1.tool)({
@@ -31,7 +31,7 @@ exports.execute_graphql_read = (0, tool_1.tool)({
31
31
  requiresAuth: true,
32
32
  },
33
33
  }, async ({ query, service_id, variables: unparsedVariables, use_emulator }, { projectId, config, host }) => {
34
- const serviceInfo = await (0, fileUtils_1.pickService)(projectId, config, service_id || undefined);
34
+ const serviceInfo = await (0, load_1.pickService)(projectId, config, service_id || undefined);
35
35
  let apiClient;
36
36
  if (use_emulator) {
37
37
  apiClient = await (0, emulator_1.getDataConnectEmulatorClient)(host);