@muggleai/works 5.12.0-staging.81 → 5.12.0-staging.82

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.
@@ -4930,14 +4930,14 @@ var projectTools = [
4930
4930
  description: "Create an E2E acceptance testing project to organize browser tests for a web app. A project groups test scenarios (use cases), specific test steps (test cases), and replayable browser scripts (test scripts) for one application. Create a project first before generating or running any E2E tests.",
4931
4931
  inputSchema: ProjectCreateInputSchema,
4932
4932
  mapToUpstream: (input) => {
4933
- const data = input;
4933
+ const toolInput = input;
4934
4934
  return {
4935
4935
  method: "POST",
4936
4936
  path: `${MUGGLE_TEST_PREFIX}/projects`,
4937
4937
  body: {
4938
- name: data.projectName,
4939
- description: data.description,
4940
- url: data.url
4938
+ name: toolInput.projectName,
4939
+ description: toolInput.description,
4940
+ url: toolInput.url
4941
4941
  }
4942
4942
  };
4943
4943
  }
@@ -4947,10 +4947,10 @@ var projectTools = [
4947
4947
  description: "Get details of a specific project by ID.",
4948
4948
  inputSchema: ProjectGetInputSchema,
4949
4949
  mapToUpstream: (input) => {
4950
- const data = input;
4950
+ const toolInput = input;
4951
4951
  return {
4952
4952
  method: "GET",
4953
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}`
4953
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}`
4954
4954
  };
4955
4955
  }
4956
4956
  },
@@ -4959,14 +4959,14 @@ var projectTools = [
4959
4959
  description: "Update an existing project's details.",
4960
4960
  inputSchema: ProjectUpdateInputSchema,
4961
4961
  mapToUpstream: (input) => {
4962
- const data = input;
4963
- const body = { id: data.projectId };
4964
- if (data.projectName !== void 0) body.name = data.projectName;
4965
- if (data.description !== void 0) body.description = data.description;
4966
- if (data.url !== void 0) body.url = data.url;
4962
+ const toolInput = input;
4963
+ const body = { id: toolInput.projectId };
4964
+ if (toolInput.projectName !== void 0) body.name = toolInput.projectName;
4965
+ if (toolInput.description !== void 0) body.description = toolInput.description;
4966
+ if (toolInput.url !== void 0) body.url = toolInput.url;
4967
4967
  return {
4968
4968
  method: "PUT",
4969
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}`,
4969
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}`,
4970
4970
  body
4971
4971
  };
4972
4972
  }
@@ -4976,15 +4976,15 @@ var projectTools = [
4976
4976
  description: "List projects accessible to the authenticated user. Returns up to 10 items per page by default (max 100). Response includes pagination metadata (totalCount, totalPages, hasMore) \u2014 check `hasMore` to decide whether to fetch additional pages.",
4977
4977
  inputSchema: ProjectListInputSchema,
4978
4978
  mapToUpstream: (input) => {
4979
- const data = input;
4979
+ const toolInput = input;
4980
4980
  return {
4981
4981
  method: "GET",
4982
4982
  path: `${MUGGLE_TEST_PREFIX}/projects`,
4983
4983
  queryParams: {
4984
- page: data.page,
4985
- pageSize: data.pageSize,
4986
- sortBy: data.sortBy,
4987
- sortOrder: data.sortOrder
4984
+ page: toolInput.page,
4985
+ pageSize: toolInput.pageSize,
4986
+ sortBy: toolInput.sortBy,
4987
+ sortOrder: toolInput.sortOrder
4988
4988
  }
4989
4989
  };
4990
4990
  }
@@ -4994,10 +4994,10 @@ var projectTools = [
4994
4994
  description: "Delete a project and all associated entities. This is a soft delete.",
4995
4995
  inputSchema: ProjectDeleteInputSchema,
4996
4996
  mapToUpstream: (input) => {
4997
- const data = input;
4997
+ const toolInput = input;
4998
4998
  return {
4999
4999
  method: "DELETE",
5000
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}`
5000
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}`
5001
5001
  };
5002
5002
  }
5003
5003
  }
@@ -5008,10 +5008,10 @@ var useCaseTools = [
5008
5008
  description: "Get the use case discovery memory for a project, including all discovered use case candidates.",
5009
5009
  inputSchema: UseCaseDiscoveryMemoryGetInputSchema,
5010
5010
  mapToUpstream: (input) => {
5011
- const data = input;
5011
+ const toolInput = input;
5012
5012
  return {
5013
5013
  method: "GET",
5014
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/use-case-discovery-memory`
5014
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/use-case-discovery-memory`
5015
5015
  };
5016
5016
  }
5017
5017
  },
@@ -5020,11 +5020,11 @@ var useCaseTools = [
5020
5020
  description: "Approve (graduate) selected use case candidates into actual use cases.",
5021
5021
  inputSchema: UseCaseCandidatesApproveInputSchema,
5022
5022
  mapToUpstream: (input) => {
5023
- const data = input;
5023
+ const toolInput = input;
5024
5024
  return {
5025
5025
  method: "POST",
5026
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/use-case-discovery-memory/graduate`,
5027
- body: { approveIds: data.approvedCandidateIds }
5026
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/use-case-discovery-memory/graduate`,
5027
+ body: { approveIds: toolInput.approvedCandidateIds }
5028
5028
  };
5029
5029
  }
5030
5030
  },
@@ -5033,16 +5033,16 @@ var useCaseTools = [
5033
5033
  description: "List use cases for a project. Returns up to 10 items per page by default (max 100). Response includes pagination metadata (totalCount, totalPages, hasMore) \u2014 check `hasMore` to decide whether to fetch additional pages.",
5034
5034
  inputSchema: UseCaseListInputSchema,
5035
5035
  mapToUpstream: (input) => {
5036
- const data = input;
5036
+ const toolInput = input;
5037
5037
  return {
5038
5038
  method: "GET",
5039
5039
  path: `${MUGGLE_TEST_PREFIX}/use-cases`,
5040
5040
  queryParams: {
5041
- projectId: data.projectId,
5042
- page: data.page,
5043
- pageSize: data.pageSize,
5044
- sortBy: data.sortBy,
5045
- sortOrder: data.sortOrder
5041
+ projectId: toolInput.projectId,
5042
+ page: toolInput.page,
5043
+ pageSize: toolInput.pageSize,
5044
+ sortBy: toolInput.sortBy,
5045
+ sortOrder: toolInput.sortOrder
5046
5046
  }
5047
5047
  };
5048
5048
  }
@@ -5052,10 +5052,10 @@ var useCaseTools = [
5052
5052
  description: "Get details of a specific use case by ID.",
5053
5053
  inputSchema: UseCaseGetInputSchema,
5054
5054
  mapToUpstream: (input) => {
5055
- const data = input;
5055
+ const toolInput = input;
5056
5056
  return {
5057
5057
  method: "GET",
5058
- path: `${MUGGLE_TEST_PREFIX}/use-cases/${data.useCaseId}`
5058
+ path: `${MUGGLE_TEST_PREFIX}/use-cases/${toolInput.useCaseId}`
5059
5059
  };
5060
5060
  }
5061
5061
  },
@@ -5064,11 +5064,11 @@ var useCaseTools = [
5064
5064
  description: "Preview a use case generated from a natural language instruction without saving.",
5065
5065
  inputSchema: UseCasePromptPreviewInputSchema,
5066
5066
  mapToUpstream: (input) => {
5067
- const data = input;
5067
+ const toolInput = input;
5068
5068
  return {
5069
5069
  method: "POST",
5070
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/use-cases/prompt/preview`,
5071
- body: { instruction: data.instruction }
5070
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/use-cases/prompt/preview`,
5071
+ body: { instruction: toolInput.instruction }
5072
5072
  };
5073
5073
  }
5074
5074
  },
@@ -5077,13 +5077,13 @@ var useCaseTools = [
5077
5077
  description: "Create one or more use cases from natural language instructions.",
5078
5078
  inputSchema: UseCaseCreateFromPromptsInputSchema,
5079
5079
  mapToUpstream: (input) => {
5080
- const data = input;
5080
+ const toolInput = input;
5081
5081
  return {
5082
5082
  method: "POST",
5083
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/use-cases/prompts/bulk`,
5083
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/use-cases/prompts/bulk`,
5084
5084
  body: {
5085
- projectId: data.projectId,
5086
- prompts: data.instructions.map((instruction) => ({ instruction }))
5085
+ projectId: toolInput.projectId,
5086
+ prompts: toolInput.instructions.map((instruction) => ({ instruction }))
5087
5087
  }
5088
5088
  };
5089
5089
  }
@@ -5093,11 +5093,11 @@ var useCaseTools = [
5093
5093
  description: "Update an existing use case by regenerating its fields from a new instruction.",
5094
5094
  inputSchema: UseCaseUpdateFromPromptInputSchema,
5095
5095
  mapToUpstream: (input) => {
5096
- const data = input;
5096
+ const toolInput = input;
5097
5097
  return {
5098
5098
  method: "POST",
5099
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/use-cases/${data.useCaseId}/prompt`,
5100
- body: { instruction: data.instruction }
5099
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/use-cases/${toolInput.useCaseId}/prompt`,
5100
+ body: { instruction: toolInput.instruction }
5101
5101
  };
5102
5102
  }
5103
5103
  },
@@ -5106,20 +5106,20 @@ var useCaseTools = [
5106
5106
  description: "Directly update an existing use case's fields without invoking the LLM. Pass only the fields you want to change \u2014 others are left untouched. Use this for cheap, deterministic edits (rename, flip status DRAFT\u2192APPROVED, change priority, edit acceptance criteria). For LLM regeneration from a new instruction, use muggle-remote-use-case-update-from-prompt instead. Note: changing title, description, or url triggers background regeneration of dependent test cases on the server.",
5107
5107
  inputSchema: UseCaseUpdateInputSchema,
5108
5108
  mapToUpstream: (input) => {
5109
- const data = input;
5110
- const body = { id: data.useCaseId };
5111
- if (data.title !== void 0) body.title = data.title;
5112
- if (data.description !== void 0) body.description = data.description;
5113
- if (data.userStory !== void 0) body.userStory = data.userStory;
5114
- if (data.url !== void 0) body.url = data.url;
5115
- if (data.useCaseBreakdown !== void 0) body.useCaseBreakdown = data.useCaseBreakdown;
5116
- if (data.status !== void 0) body.status = data.status;
5117
- if (data.priority !== void 0) body.priority = data.priority;
5118
- if (data.source !== void 0) body.source = data.source;
5119
- if (data.category !== void 0) body.category = data.category;
5109
+ const toolInput = input;
5110
+ const body = { id: toolInput.useCaseId };
5111
+ if (toolInput.title !== void 0) body.title = toolInput.title;
5112
+ if (toolInput.description !== void 0) body.description = toolInput.description;
5113
+ if (toolInput.userStory !== void 0) body.userStory = toolInput.userStory;
5114
+ if (toolInput.url !== void 0) body.url = toolInput.url;
5115
+ if (toolInput.useCaseBreakdown !== void 0) body.useCaseBreakdown = toolInput.useCaseBreakdown;
5116
+ if (toolInput.status !== void 0) body.status = toolInput.status;
5117
+ if (toolInput.priority !== void 0) body.priority = toolInput.priority;
5118
+ if (toolInput.source !== void 0) body.source = toolInput.source;
5119
+ if (toolInput.category !== void 0) body.category = toolInput.category;
5120
5120
  return {
5121
5121
  method: "PUT",
5122
- path: `${MUGGLE_TEST_PREFIX}/use-cases/${data.useCaseId}`,
5122
+ path: `${MUGGLE_TEST_PREFIX}/use-cases/${toolInput.useCaseId}`,
5123
5123
  body
5124
5124
  };
5125
5125
  }
@@ -5129,21 +5129,21 @@ var useCaseTools = [
5129
5129
  description: "Create a single use case from a fully-specified payload. Use this to persist use cases returned by muggle-remote-use-case-bulk-preview-submit \u2014 no LLM is invoked.",
5130
5130
  inputSchema: UseCaseCreateInputSchema,
5131
5131
  mapToUpstream: (input) => {
5132
- const data = input;
5132
+ const toolInput = input;
5133
5133
  return {
5134
5134
  method: "POST",
5135
5135
  path: `${MUGGLE_TEST_PREFIX}/use-cases`,
5136
5136
  body: {
5137
- projectId: data.projectId,
5138
- title: data.title,
5139
- description: data.description,
5140
- userStory: data.userStory,
5141
- url: data.url,
5142
- useCaseBreakdown: data.useCaseBreakdown,
5143
- status: data.status,
5144
- priority: data.priority,
5145
- source: data.source,
5146
- category: data.category
5137
+ projectId: toolInput.projectId,
5138
+ title: toolInput.title,
5139
+ description: toolInput.description,
5140
+ userStory: toolInput.userStory,
5141
+ url: toolInput.url,
5142
+ useCaseBreakdown: toolInput.useCaseBreakdown,
5143
+ status: toolInput.status,
5144
+ priority: toolInput.priority,
5145
+ source: toolInput.source,
5146
+ category: toolInput.category
5147
5147
  }
5148
5148
  };
5149
5149
  }
@@ -5153,11 +5153,11 @@ var useCaseTools = [
5153
5153
  description: "Submit an async bulk-preview job that uses the OpenAI Batch API to generate use cases from many prompts at ~50% of normal LLM cost. Returns a job ID immediately; poll with muggle-remote-bulk-preview-job-get until the job reaches a terminal status, then persist each successful result via muggle-remote-use-case-create.",
5154
5154
  inputSchema: BulkPreviewSubmitUseCaseInputSchema,
5155
5155
  mapToUpstream: (input) => {
5156
- const data = input;
5156
+ const toolInput = input;
5157
5157
  return {
5158
5158
  method: "POST",
5159
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/use-cases/prompts/bulk-preview`,
5160
- body: { prompts: data.prompts }
5159
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/use-cases/prompts/bulk-preview`,
5160
+ body: { prompts: toolInput.prompts }
5161
5161
  };
5162
5162
  }
5163
5163
  },
@@ -5180,16 +5180,16 @@ var testCaseTools = [
5180
5180
  description: "List test cases for a project. Returns up to 10 items per page by default (max 100). Response includes pagination metadata (totalCount, totalPages, hasMore) \u2014 check `hasMore` to decide whether to fetch additional pages.",
5181
5181
  inputSchema: TestCaseListInputSchema,
5182
5182
  mapToUpstream: (input) => {
5183
- const data = input;
5183
+ const toolInput = input;
5184
5184
  return {
5185
5185
  method: "GET",
5186
5186
  path: `${MUGGLE_TEST_PREFIX}/test-cases`,
5187
5187
  queryParams: {
5188
- projectId: data.projectId,
5189
- page: data.page,
5190
- pageSize: data.pageSize,
5191
- sortBy: data.sortBy,
5192
- sortOrder: data.sortOrder
5188
+ projectId: toolInput.projectId,
5189
+ page: toolInput.page,
5190
+ pageSize: toolInput.pageSize,
5191
+ sortBy: toolInput.sortBy,
5192
+ sortOrder: toolInput.sortOrder
5193
5193
  }
5194
5194
  };
5195
5195
  }
@@ -5199,10 +5199,10 @@ var testCaseTools = [
5199
5199
  description: "Get details of a specific test case.",
5200
5200
  inputSchema: TestCaseGetInputSchema,
5201
5201
  mapToUpstream: (input) => {
5202
- const data = input;
5202
+ const toolInput = input;
5203
5203
  return {
5204
5204
  method: "GET",
5205
- path: `${MUGGLE_TEST_PREFIX}/test-cases/${data.testCaseId}`
5205
+ path: `${MUGGLE_TEST_PREFIX}/test-cases/${toolInput.testCaseId}`
5206
5206
  };
5207
5207
  }
5208
5208
  },
@@ -5211,10 +5211,10 @@ var testCaseTools = [
5211
5211
  description: "Resolve a test case's prerequisite chain from the project's test-plan graph. Returns { testCaseId, ancestors, orphan } where `ancestors` is an array of test case IDs ordered immediate-parent \u2192 root (empty when the case is a graph root). `orphan: true` means the case has no graph node, so it has no prerequisites. Call this before generating or replaying a script to ensure every prerequisite test case already has a ready script.",
5212
5212
  inputSchema: TestCaseAncestorsGetInputSchema,
5213
5213
  mapToUpstream: (input) => {
5214
- const data = input;
5214
+ const toolInput = input;
5215
5215
  return {
5216
5216
  method: "GET",
5217
- path: `${MUGGLE_TEST_PREFIX}/test-plan-graph/test-cases/${data.testCaseId}/ancestors`
5217
+ path: `${MUGGLE_TEST_PREFIX}/test-plan-graph/test-cases/${toolInput.testCaseId}/ancestors`
5218
5218
  };
5219
5219
  }
5220
5220
  },
@@ -5223,10 +5223,10 @@ var testCaseTools = [
5223
5223
  description: "List test cases for a specific use case.",
5224
5224
  inputSchema: TestCaseListByUseCaseInputSchema,
5225
5225
  mapToUpstream: (input) => {
5226
- const data = input;
5226
+ const toolInput = input;
5227
5227
  return {
5228
5228
  method: "GET",
5229
- path: `${MUGGLE_TEST_PREFIX}/use-cases/${data.useCaseId}/test-cases`
5229
+ path: `${MUGGLE_TEST_PREFIX}/use-cases/${toolInput.useCaseId}/test-cases`
5230
5230
  };
5231
5231
  }
5232
5232
  },
@@ -5235,11 +5235,11 @@ var testCaseTools = [
5235
5235
  description: "Generate E2E acceptance test cases from a plain-English description of what to test \u2014 e.g., 'test the signup flow with invalid email' or 'verify the checkout handles empty cart'. Returns preview test cases that can be used to generate executable browser test scripts.",
5236
5236
  inputSchema: TestCaseGenerateFromPromptInputSchema,
5237
5237
  mapToUpstream: (input) => {
5238
- const data = input;
5238
+ const toolInput = input;
5239
5239
  return {
5240
5240
  method: "POST",
5241
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/use-cases/${data.useCaseId}/test-cases/prompt/preview`,
5242
- body: { instruction: data.instruction }
5241
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/use-cases/${toolInput.useCaseId}/test-cases/prompt/preview`,
5242
+ body: { instruction: toolInput.instruction }
5243
5243
  };
5244
5244
  }
5245
5245
  },
@@ -5248,24 +5248,24 @@ var testCaseTools = [
5248
5248
  description: "Create a new test case for a use case.",
5249
5249
  inputSchema: TestCaseCreateInputSchema,
5250
5250
  mapToUpstream: (input) => {
5251
- const data = input;
5251
+ const toolInput = input;
5252
5252
  return {
5253
5253
  method: "POST",
5254
5254
  path: `${MUGGLE_TEST_PREFIX}/test-cases`,
5255
5255
  body: {
5256
- projectId: data.projectId,
5257
- useCaseId: data.useCaseId,
5258
- title: data.title,
5259
- description: data.description,
5260
- goal: data.goal,
5261
- precondition: data.precondition,
5262
- expectedResult: data.expectedResult,
5263
- url: data.url,
5264
- status: data.status || "DRAFT",
5265
- priority: data.priority || "MEDIUM",
5266
- tags: data.tags || [],
5267
- category: data.category || "Functional",
5268
- automated: data.automated ?? true
5256
+ projectId: toolInput.projectId,
5257
+ useCaseId: toolInput.useCaseId,
5258
+ title: toolInput.title,
5259
+ description: toolInput.description,
5260
+ goal: toolInput.goal,
5261
+ precondition: toolInput.precondition,
5262
+ expectedResult: toolInput.expectedResult,
5263
+ url: toolInput.url,
5264
+ status: toolInput.status || "DRAFT",
5265
+ priority: toolInput.priority || "MEDIUM",
5266
+ tags: toolInput.tags || [],
5267
+ category: toolInput.category || "Functional",
5268
+ automated: toolInput.automated ?? true
5269
5269
  }
5270
5270
  };
5271
5271
  }
@@ -5275,22 +5275,22 @@ var testCaseTools = [
5275
5275
  description: "Directly update an existing test case's fields. Pass only the fields you want to change \u2014 others are left untouched. Use this for cheap, deterministic edits (rename, change status/priority, fix expected result, add tags). Does not touch the associated test script \u2014 script regeneration is a separate workflow (muggle-remote-workflow-start-test-script-generation).",
5276
5276
  inputSchema: TestCaseUpdateInputSchema,
5277
5277
  mapToUpstream: (input) => {
5278
- const data = input;
5279
- const body = { id: data.testCaseId };
5280
- if (data.title !== void 0) body.title = data.title;
5281
- if (data.description !== void 0) body.description = data.description;
5282
- if (data.goal !== void 0) body.goal = data.goal;
5283
- if (data.precondition !== void 0) body.precondition = data.precondition;
5284
- if (data.expectedResult !== void 0) body.expectedResult = data.expectedResult;
5285
- if (data.url !== void 0) body.url = data.url;
5286
- if (data.status !== void 0) body.status = data.status;
5287
- if (data.priority !== void 0) body.priority = data.priority;
5288
- if (data.tags !== void 0) body.tags = data.tags;
5289
- if (data.category !== void 0) body.category = data.category;
5290
- if (data.automated !== void 0) body.automated = data.automated;
5278
+ const toolInput = input;
5279
+ const body = { id: toolInput.testCaseId };
5280
+ if (toolInput.title !== void 0) body.title = toolInput.title;
5281
+ if (toolInput.description !== void 0) body.description = toolInput.description;
5282
+ if (toolInput.goal !== void 0) body.goal = toolInput.goal;
5283
+ if (toolInput.precondition !== void 0) body.precondition = toolInput.precondition;
5284
+ if (toolInput.expectedResult !== void 0) body.expectedResult = toolInput.expectedResult;
5285
+ if (toolInput.url !== void 0) body.url = toolInput.url;
5286
+ if (toolInput.status !== void 0) body.status = toolInput.status;
5287
+ if (toolInput.priority !== void 0) body.priority = toolInput.priority;
5288
+ if (toolInput.tags !== void 0) body.tags = toolInput.tags;
5289
+ if (toolInput.category !== void 0) body.category = toolInput.category;
5290
+ if (toolInput.automated !== void 0) body.automated = toolInput.automated;
5291
5291
  return {
5292
5292
  method: "PUT",
5293
- path: `${MUGGLE_TEST_PREFIX}/test-cases/${data.testCaseId}`,
5293
+ path: `${MUGGLE_TEST_PREFIX}/test-cases/${toolInput.testCaseId}`,
5294
5294
  body
5295
5295
  };
5296
5296
  }
@@ -5300,11 +5300,11 @@ var testCaseTools = [
5300
5300
  description: "Submit an async bulk-preview job that uses the OpenAI Batch API to generate test cases for a single use case from many prompts at ~50% of normal LLM cost. Returns a job ID immediately; poll with muggle-remote-bulk-preview-job-get until the job reaches a terminal status, then persist each successful result via muggle-remote-test-case-create. Note: one input prompt may fan out to 1\u20135 test cases.",
5301
5301
  inputSchema: BulkPreviewSubmitTestCaseInputSchema,
5302
5302
  mapToUpstream: (input) => {
5303
- const data = input;
5303
+ const toolInput = input;
5304
5304
  return {
5305
5305
  method: "POST",
5306
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/use-cases/${data.useCaseId}/test-cases/prompts/bulk-preview`,
5307
- body: { prompts: data.prompts }
5306
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/use-cases/${toolInput.useCaseId}/test-cases/prompts/bulk-preview`,
5307
+ body: { prompts: toolInput.prompts }
5308
5308
  };
5309
5309
  }
5310
5310
  },
@@ -5327,10 +5327,10 @@ var bulkPreviewTools = [
5327
5327
  description: "Get the current status and (when terminal) results of a bulk-preview job. Poll this after submitting a bulk-preview job \u2014 every 10\u201315 seconds is fine. Terminal statuses: succeeded, partial, failed, cancelled, expired.",
5328
5328
  inputSchema: BulkPreviewJobGetInputSchema,
5329
5329
  mapToUpstream: (input) => {
5330
- const data = input;
5330
+ const toolInput = input;
5331
5331
  return {
5332
5332
  method: "GET",
5333
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/bulk-preview-jobs/${data.jobId}`
5333
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/bulk-preview-jobs/${toolInput.jobId}`
5334
5334
  };
5335
5335
  }
5336
5336
  },
@@ -5339,15 +5339,15 @@ var bulkPreviewTools = [
5339
5339
  description: "List bulk-preview jobs for a project, optionally filtered by status or kind.",
5340
5340
  inputSchema: BulkPreviewJobListInputSchema,
5341
5341
  mapToUpstream: (input) => {
5342
- const data = input;
5342
+ const toolInput = input;
5343
5343
  return {
5344
5344
  method: "GET",
5345
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/bulk-preview-jobs`,
5345
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/bulk-preview-jobs`,
5346
5346
  queryParams: {
5347
- status: data.status?.join(","),
5348
- kind: data.kind,
5349
- limit: data.limit,
5350
- cursor: data.cursor
5347
+ status: toolInput.status?.join(","),
5348
+ kind: toolInput.kind,
5349
+ limit: toolInput.limit,
5350
+ cursor: toolInput.cursor
5351
5351
  }
5352
5352
  };
5353
5353
  }
@@ -5357,10 +5357,10 @@ var bulkPreviewTools = [
5357
5357
  description: "Request cancellation of a bulk-preview job. Cancellation is cooperative \u2014 the harvester picks it up on its next tick and moves the job to status=cancelled.",
5358
5358
  inputSchema: BulkPreviewJobCancelInputSchema,
5359
5359
  mapToUpstream: (input) => {
5360
- const data = input;
5360
+ const toolInput = input;
5361
5361
  return {
5362
5362
  method: "DELETE",
5363
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/bulk-preview-jobs/${data.jobId}`
5363
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/bulk-preview-jobs/${toolInput.jobId}`
5364
5364
  };
5365
5365
  }
5366
5366
  }
@@ -5371,18 +5371,18 @@ var testScriptTools = [
5371
5371
  description: "List test scripts for a project, optionally filtered by test case and by environment lane. Returns up to 10 items per page by default (max 100). Response includes pagination metadata (totalCount, totalPages, hasMore) \u2014 check `hasMore` to decide whether to fetch additional pages.",
5372
5372
  inputSchema: TestScriptListInputSchema,
5373
5373
  mapToUpstream: (input) => {
5374
- const data = input;
5374
+ const toolInput = input;
5375
5375
  return {
5376
5376
  method: "GET",
5377
5377
  path: `${MUGGLE_TEST_PREFIX}/test-scripts`,
5378
5378
  queryParams: {
5379
- projectId: data.projectId,
5380
- testCaseId: data.testCaseId,
5381
- runEnvironmentType: data.runEnvironmentType,
5382
- page: data.page,
5383
- pageSize: data.pageSize,
5384
- sortBy: data.sortBy,
5385
- sortOrder: data.sortOrder
5379
+ projectId: toolInput.projectId,
5380
+ testCaseId: toolInput.testCaseId,
5381
+ runEnvironmentType: toolInput.runEnvironmentType,
5382
+ page: toolInput.page,
5383
+ pageSize: toolInput.pageSize,
5384
+ sortBy: toolInput.sortBy,
5385
+ sortOrder: toolInput.sortOrder
5386
5386
  }
5387
5387
  };
5388
5388
  }
@@ -5392,10 +5392,10 @@ var testScriptTools = [
5392
5392
  description: "Get details of a specific test script.",
5393
5393
  inputSchema: TestScriptGetInputSchema,
5394
5394
  mapToUpstream: (input) => {
5395
- const data = input;
5395
+ const toolInput = input;
5396
5396
  return {
5397
5397
  method: "GET",
5398
- path: `${MUGGLE_TEST_PREFIX}/test-scripts/${data.testScriptId}`
5398
+ path: `${MUGGLE_TEST_PREFIX}/test-scripts/${toolInput.testScriptId}`
5399
5399
  };
5400
5400
  }
5401
5401
  },
@@ -5418,10 +5418,10 @@ var actionScriptTools = [
5418
5418
  description: "Get the full action script content by ID. Use actionScriptId from a test script to fetch the complete script with all steps and element labels needed for replay.",
5419
5419
  inputSchema: ActionScriptGetInputSchema,
5420
5420
  mapToUpstream: (input) => {
5421
- const data = input;
5421
+ const toolInput = input;
5422
5422
  return {
5423
5423
  method: "GET",
5424
- path: `/v1/protected/actionScript/${data.actionScriptId}`
5424
+ path: `/v1/protected/actionScript/${toolInput.actionScriptId}`
5425
5425
  };
5426
5426
  }
5427
5427
  },
@@ -5444,16 +5444,16 @@ var workflowTools = [
5444
5444
  description: "Scan a website to automatically discover testable user flows and UI interactions. Crawls the site and identifies use cases like signup, login, search, checkout, form submissions, and navigation patterns. Use this when setting up E2E acceptance testing for a site without predefined test cases.",
5445
5445
  inputSchema: WorkflowStartWebsiteScanInputSchema,
5446
5446
  mapToUpstream: (input) => {
5447
- const data = input;
5447
+ const toolInput = input;
5448
5448
  return {
5449
5449
  method: "POST",
5450
5450
  path: `${MUGGLE_TEST_PREFIX}/workflow/use-case/website-scan`,
5451
5451
  body: {
5452
- projectId: data.projectId,
5453
- url: data.url,
5454
- description: data.description,
5455
- archiveUnapproved: data.archiveUnapproved,
5456
- ...data.workflowParams && { workflowParams: data.workflowParams }
5452
+ projectId: toolInput.projectId,
5453
+ url: toolInput.url,
5454
+ description: toolInput.description,
5455
+ archiveUnapproved: toolInput.archiveUnapproved,
5456
+ ...toolInput.workflowParams && { workflowParams: toolInput.workflowParams }
5457
5457
  },
5458
5458
  timeoutMs: getWorkflowTimeoutMs()
5459
5459
  };
@@ -5464,11 +5464,11 @@ var workflowTools = [
5464
5464
  description: "List website scan workflow runtimes.",
5465
5465
  inputSchema: WorkflowListRuntimesInputSchema,
5466
5466
  mapToUpstream: (input) => {
5467
- const data = input;
5467
+ const toolInput = input;
5468
5468
  return {
5469
5469
  method: "GET",
5470
5470
  path: `${MUGGLE_TEST_PREFIX}/workflow/use-case/website-scan/workflowRuntimes`,
5471
- queryParams: { projectId: data.projectId }
5471
+ queryParams: { projectId: toolInput.projectId }
5472
5472
  };
5473
5473
  }
5474
5474
  },
@@ -5477,10 +5477,10 @@ var workflowTools = [
5477
5477
  description: "Get the latest run status for a website scan workflow runtime.",
5478
5478
  inputSchema: WorkflowGetLatestRunInputSchema,
5479
5479
  mapToUpstream: (input) => {
5480
- const data = input;
5480
+ const toolInput = input;
5481
5481
  return {
5482
5482
  method: "GET",
5483
- path: `${MUGGLE_TEST_PREFIX}/workflow/use-case/website-scan/${data.workflowRuntimeId}/run/latest`
5483
+ path: `${MUGGLE_TEST_PREFIX}/workflow/use-case/website-scan/${toolInput.workflowRuntimeId}/run/latest`
5484
5484
  };
5485
5485
  }
5486
5486
  },
@@ -5489,17 +5489,17 @@ var workflowTools = [
5489
5489
  description: "Start a test case detection workflow to generate test cases from use cases.",
5490
5490
  inputSchema: WorkflowStartTestCaseDetectionInputSchema,
5491
5491
  mapToUpstream: (input) => {
5492
- const data = input;
5492
+ const toolInput = input;
5493
5493
  return {
5494
5494
  method: "POST",
5495
5495
  path: `${MUGGLE_TEST_PREFIX}/workflow/test-case/test-case-detection`,
5496
5496
  body: {
5497
- projectId: data.projectId,
5498
- useCaseId: data.useCaseId,
5499
- name: data.name,
5500
- description: data.description,
5501
- url: data.url,
5502
- ...data.workflowParams && { workflowParams: data.workflowParams }
5497
+ projectId: toolInput.projectId,
5498
+ useCaseId: toolInput.useCaseId,
5499
+ name: toolInput.name,
5500
+ description: toolInput.description,
5501
+ url: toolInput.url,
5502
+ ...toolInput.workflowParams && { workflowParams: toolInput.workflowParams }
5503
5503
  },
5504
5504
  timeoutMs: getWorkflowTimeoutMs()
5505
5505
  };
@@ -5510,11 +5510,11 @@ var workflowTools = [
5510
5510
  description: "List test case detection workflow runtimes.",
5511
5511
  inputSchema: WorkflowListRuntimesInputSchema,
5512
5512
  mapToUpstream: (input) => {
5513
- const data = input;
5513
+ const toolInput = input;
5514
5514
  return {
5515
5515
  method: "GET",
5516
5516
  path: `${MUGGLE_TEST_PREFIX}/workflow/test-case/test-case-detection/workflowRuntimes`,
5517
- queryParams: { projectId: data.projectId }
5517
+ queryParams: { projectId: toolInput.projectId }
5518
5518
  };
5519
5519
  }
5520
5520
  },
@@ -5523,10 +5523,10 @@ var workflowTools = [
5523
5523
  description: "Get the latest run status for a test case detection workflow runtime.",
5524
5524
  inputSchema: WorkflowGetLatestRunInputSchema,
5525
5525
  mapToUpstream: (input) => {
5526
- const data = input;
5526
+ const toolInput = input;
5527
5527
  return {
5528
5528
  method: "GET",
5529
- path: `${MUGGLE_TEST_PREFIX}/workflow/test-case/test-case-detection/${data.workflowRuntimeId}/run/latest`
5529
+ path: `${MUGGLE_TEST_PREFIX}/workflow/test-case/test-case-detection/${toolInput.workflowRuntimeId}/run/latest`
5530
5530
  };
5531
5531
  }
5532
5532
  },
@@ -5535,22 +5535,22 @@ var workflowTools = [
5535
5535
  description: "Start a test script generation workflow.",
5536
5536
  inputSchema: WorkflowStartTestScriptGenerationInputSchema,
5537
5537
  mapToUpstream: (input) => {
5538
- const data = input;
5538
+ const toolInput = input;
5539
5539
  return {
5540
5540
  method: "POST",
5541
5541
  path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-generation`,
5542
5542
  body: {
5543
- projectId: data.projectId,
5544
- testCaseId: data.testCaseId,
5545
- useCaseId: data.useCaseId,
5546
- name: data.name,
5547
- url: data.url,
5548
- goal: data.goal,
5549
- precondition: data.precondition,
5550
- instructions: data.instructions,
5551
- expectedResult: data.expectedResult,
5552
- ...data.runEnvironmentType && { runEnvironmentType: data.runEnvironmentType },
5553
- ...data.workflowParams && { workflowParams: data.workflowParams }
5543
+ projectId: toolInput.projectId,
5544
+ testCaseId: toolInput.testCaseId,
5545
+ useCaseId: toolInput.useCaseId,
5546
+ name: toolInput.name,
5547
+ url: toolInput.url,
5548
+ goal: toolInput.goal,
5549
+ precondition: toolInput.precondition,
5550
+ instructions: toolInput.instructions,
5551
+ expectedResult: toolInput.expectedResult,
5552
+ ...toolInput.runEnvironmentType && { runEnvironmentType: toolInput.runEnvironmentType },
5553
+ ...toolInput.workflowParams && { workflowParams: toolInput.workflowParams }
5554
5554
  },
5555
5555
  timeoutMs: getWorkflowTimeoutMs()
5556
5556
  };
@@ -5561,15 +5561,15 @@ var workflowTools = [
5561
5561
  description: "Start a bulk test script generation workflow to generate scripts for multiple test cases in a single request.",
5562
5562
  inputSchema: WorkflowStartTestScriptGenerationBulkInputSchema,
5563
5563
  mapToUpstream: (input) => {
5564
- const data = input;
5564
+ const toolInput = input;
5565
5565
  return {
5566
5566
  method: "POST",
5567
5567
  path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-generation/bulk`,
5568
5568
  body: {
5569
- projectId: data.projectId,
5570
- name: data.name,
5571
- ...data.testCaseIds && { testCaseIds: data.testCaseIds },
5572
- ...data.workflowParams && { workflowParams: data.workflowParams }
5569
+ projectId: toolInput.projectId,
5570
+ name: toolInput.name,
5571
+ ...toolInput.testCaseIds && { testCaseIds: toolInput.testCaseIds },
5572
+ ...toolInput.workflowParams && { workflowParams: toolInput.workflowParams }
5573
5573
  },
5574
5574
  timeoutMs: getWorkflowTimeoutMs()
5575
5575
  };
@@ -5580,10 +5580,10 @@ var workflowTools = [
5580
5580
  description: "Get the latest run status for a test script generation workflow runtime.",
5581
5581
  inputSchema: WorkflowGetLatestRunInputSchema,
5582
5582
  mapToUpstream: (input) => {
5583
- const data = input;
5583
+ const toolInput = input;
5584
5584
  return {
5585
5585
  method: "GET",
5586
- path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-generation/${data.workflowRuntimeId}/run/latest`
5586
+ path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-generation/${toolInput.workflowRuntimeId}/run/latest`
5587
5587
  };
5588
5588
  }
5589
5589
  },
@@ -5592,10 +5592,10 @@ var workflowTools = [
5592
5592
  description: "Get the latest test script generation runtime for a specific test case.",
5593
5593
  inputSchema: WorkflowGetLatestScriptGenByTestCaseInputSchema,
5594
5594
  mapToUpstream: (input) => {
5595
- const data = input;
5595
+ const toolInput = input;
5596
5596
  return {
5597
5597
  method: "GET",
5598
- path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-generation/testcases/${data.testCaseId}/runtime/latest`
5598
+ path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-generation/testcases/${toolInput.testCaseId}/runtime/latest`
5599
5599
  };
5600
5600
  }
5601
5601
  },
@@ -5604,17 +5604,17 @@ var workflowTools = [
5604
5604
  description: "Start a test script replay workflow to execute a single test script.",
5605
5605
  inputSchema: WorkflowStartTestScriptReplayInputSchema,
5606
5606
  mapToUpstream: (input) => {
5607
- const data = input;
5607
+ const toolInput = input;
5608
5608
  return {
5609
5609
  method: "POST",
5610
5610
  path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay`,
5611
5611
  body: {
5612
- projectId: data.projectId,
5613
- useCaseId: data.useCaseId,
5614
- testCaseId: data.testCaseId,
5615
- testScriptId: data.testScriptId,
5616
- name: data.name,
5617
- ...data.workflowParams && { workflowParams: data.workflowParams }
5612
+ projectId: toolInput.projectId,
5613
+ useCaseId: toolInput.useCaseId,
5614
+ testCaseId: toolInput.testCaseId,
5615
+ testScriptId: toolInput.testScriptId,
5616
+ name: toolInput.name,
5617
+ ...toolInput.workflowParams && { workflowParams: toolInput.workflowParams }
5618
5618
  },
5619
5619
  timeoutMs: getWorkflowTimeoutMs()
5620
5620
  };
@@ -5625,10 +5625,10 @@ var workflowTools = [
5625
5625
  description: "Get the latest run status for a test script replay workflow runtime.",
5626
5626
  inputSchema: WorkflowGetLatestRunInputSchema,
5627
5627
  mapToUpstream: (input) => {
5628
- const data = input;
5628
+ const toolInput = input;
5629
5629
  return {
5630
5630
  method: "GET",
5631
- path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay/${data.workflowRuntimeId}/run/latest`
5631
+ path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay/${toolInput.workflowRuntimeId}/run/latest`
5632
5632
  };
5633
5633
  }
5634
5634
  },
@@ -5637,20 +5637,20 @@ var workflowTools = [
5637
5637
  description: "Start a bulk test script replay workflow to execute multiple test scripts.",
5638
5638
  inputSchema: WorkflowStartTestScriptReplayBulkInputSchema,
5639
5639
  mapToUpstream: (input) => {
5640
- const data = input;
5640
+ const toolInput = input;
5641
5641
  return {
5642
5642
  method: "POST",
5643
5643
  path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay/bulk/workflowRuntimes`,
5644
5644
  body: {
5645
- projectId: data.projectId,
5646
- name: data.name,
5647
- intervalSec: data.intervalSec,
5648
- useCaseId: data.useCaseId,
5649
- namePrefix: data.namePrefix,
5650
- limit: data.limit,
5651
- testCaseIds: data.testCaseIds,
5652
- repeatPerTestCase: data.repeatPerTestCase,
5653
- ...data.workflowParams && { workflowParams: data.workflowParams }
5645
+ projectId: toolInput.projectId,
5646
+ name: toolInput.name,
5647
+ intervalSec: toolInput.intervalSec,
5648
+ useCaseId: toolInput.useCaseId,
5649
+ namePrefix: toolInput.namePrefix,
5650
+ limit: toolInput.limit,
5651
+ testCaseIds: toolInput.testCaseIds,
5652
+ repeatPerTestCase: toolInput.repeatPerTestCase,
5653
+ ...toolInput.workflowParams && { workflowParams: toolInput.workflowParams }
5654
5654
  },
5655
5655
  timeoutMs: getWorkflowTimeoutMs()
5656
5656
  };
@@ -5661,11 +5661,11 @@ var workflowTools = [
5661
5661
  description: "List bulk test script replay workflow runtimes.",
5662
5662
  inputSchema: WorkflowListRuntimesInputSchema,
5663
5663
  mapToUpstream: (input) => {
5664
- const data = input;
5664
+ const toolInput = input;
5665
5665
  return {
5666
5666
  method: "GET",
5667
5667
  path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay/bulk/workflowRuntimes`,
5668
- queryParams: { projectId: data.projectId }
5668
+ queryParams: { projectId: toolInput.projectId }
5669
5669
  };
5670
5670
  }
5671
5671
  },
@@ -5674,10 +5674,10 @@ var workflowTools = [
5674
5674
  description: "Get the latest run status for a bulk test script replay workflow runtime.",
5675
5675
  inputSchema: WorkflowGetLatestRunInputSchema,
5676
5676
  mapToUpstream: (input) => {
5677
- const data = input;
5677
+ const toolInput = input;
5678
5678
  return {
5679
5679
  method: "GET",
5680
- path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay/bulk/${data.workflowRuntimeId}/run/latest`
5680
+ path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay/bulk/${toolInput.workflowRuntimeId}/run/latest`
5681
5681
  };
5682
5682
  }
5683
5683
  },
@@ -5686,10 +5686,10 @@ var workflowTools = [
5686
5686
  description: "Get the summary of a bulk replay run batch.",
5687
5687
  inputSchema: WorkflowGetReplayBulkBatchSummaryInputSchema,
5688
5688
  mapToUpstream: (input) => {
5689
- const data = input;
5689
+ const toolInput = input;
5690
5690
  return {
5691
5691
  method: "GET",
5692
- path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay/bulk/run-batch/${data.runBatchId}/summary`
5692
+ path: `${MUGGLE_TEST_PREFIX}/workflow/test-script/test-script-replay/bulk/run-batch/${toolInput.runBatchId}/summary`
5693
5693
  };
5694
5694
  }
5695
5695
  },
@@ -5698,10 +5698,10 @@ var workflowTools = [
5698
5698
  description: "Cancel a running workflow run.",
5699
5699
  inputSchema: WorkflowCancelRunInputSchema,
5700
5700
  mapToUpstream: (input) => {
5701
- const data = input;
5701
+ const toolInput = input;
5702
5702
  return {
5703
5703
  method: "POST",
5704
- path: `${MUGGLE_TEST_PREFIX}/workflow/runs/${data.workflowRunId}/cancel`
5704
+ path: `${MUGGLE_TEST_PREFIX}/workflow/runs/${toolInput.workflowRunId}/cancel`
5705
5705
  };
5706
5706
  }
5707
5707
  },
@@ -5710,10 +5710,10 @@ var workflowTools = [
5710
5710
  description: "Cancel a workflow runtime and all its runs.",
5711
5711
  inputSchema: WorkflowCancelRuntimeInputSchema,
5712
5712
  mapToUpstream: (input) => {
5713
- const data = input;
5713
+ const toolInput = input;
5714
5714
  return {
5715
5715
  method: "POST",
5716
- path: `${MUGGLE_TEST_PREFIX}/workflow/runtimes/${data.workflowRuntimeId}/cancel`
5716
+ path: `${MUGGLE_TEST_PREFIX}/workflow/runtimes/${toolInput.workflowRuntimeId}/cancel`
5717
5717
  };
5718
5718
  }
5719
5719
  },
@@ -5722,32 +5722,32 @@ var workflowTools = [
5722
5722
  description: "Upload a locally executed run (generation/replay) to cloud workflow records.",
5723
5723
  inputSchema: LocalRunUploadInputSchema,
5724
5724
  mapToUpstream: (input) => {
5725
- const data = input;
5725
+ const toolInput = input;
5726
5726
  return {
5727
5727
  method: "POST",
5728
5728
  path: `${MUGGLE_TEST_PREFIX}/local-run/upload`,
5729
5729
  body: {
5730
- projectId: data.projectId,
5731
- useCaseId: data.useCaseId,
5732
- testCaseId: data.testCaseId,
5733
- runType: data.runType,
5734
- ...data.runEnvironmentType && { runEnvironmentType: data.runEnvironmentType },
5735
- productionUrl: data.productionUrl,
5730
+ projectId: toolInput.projectId,
5731
+ useCaseId: toolInput.useCaseId,
5732
+ testCaseId: toolInput.testCaseId,
5733
+ runType: toolInput.runType,
5734
+ ...toolInput.runEnvironmentType && { runEnvironmentType: toolInput.runEnvironmentType },
5735
+ productionUrl: toolInput.productionUrl,
5736
5736
  localExecutionContext: {
5737
- originalUrl: data.localExecutionContext.originalUrl,
5738
- productionUrl: data.localExecutionContext.productionUrl,
5739
- runByUserId: data.localExecutionContext.runByUserId,
5740
- machineHostname: data.localExecutionContext.machineHostname,
5741
- osInfo: data.localExecutionContext.osInfo,
5742
- electronAppVersion: data.localExecutionContext.electronAppVersion,
5743
- mcpServerVersion: data.localExecutionContext.mcpServerVersion,
5744
- localExecutionCompletedAt: data.localExecutionContext.localExecutionCompletedAt,
5745
- uploadedAt: data.localExecutionContext.uploadedAt
5737
+ originalUrl: toolInput.localExecutionContext.originalUrl,
5738
+ productionUrl: toolInput.localExecutionContext.productionUrl,
5739
+ runByUserId: toolInput.localExecutionContext.runByUserId,
5740
+ machineHostname: toolInput.localExecutionContext.machineHostname,
5741
+ osInfo: toolInput.localExecutionContext.osInfo,
5742
+ electronAppVersion: toolInput.localExecutionContext.electronAppVersion,
5743
+ mcpServerVersion: toolInput.localExecutionContext.mcpServerVersion,
5744
+ localExecutionCompletedAt: toolInput.localExecutionContext.localExecutionCompletedAt,
5745
+ uploadedAt: toolInput.localExecutionContext.uploadedAt
5746
5746
  },
5747
- actionScript: data.actionScript,
5748
- status: data.status,
5749
- executionTimeMs: data.executionTimeMs,
5750
- errorMessage: data.errorMessage
5747
+ actionScript: toolInput.actionScript,
5748
+ status: toolInput.status,
5749
+ executionTimeMs: toolInput.executionTimeMs,
5750
+ errorMessage: toolInput.errorMessage
5751
5751
  }
5752
5752
  };
5753
5753
  }
@@ -5759,10 +5759,10 @@ var reportTools = [
5759
5759
  description: "Get a summary of test results for a project.",
5760
5760
  inputSchema: ProjectTestResultsSummaryInputSchema,
5761
5761
  mapToUpstream: (input) => {
5762
- const data = input;
5762
+ const toolInput = input;
5763
5763
  return {
5764
5764
  method: "GET",
5765
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/testResults`
5765
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/testResults`
5766
5766
  };
5767
5767
  }
5768
5768
  },
@@ -5771,10 +5771,10 @@ var reportTools = [
5771
5771
  description: "Get a summary of test scripts for a project.",
5772
5772
  inputSchema: ProjectTestScriptsSummaryInputSchema,
5773
5773
  mapToUpstream: (input) => {
5774
- const data = input;
5774
+ const toolInput = input;
5775
5775
  return {
5776
5776
  method: "GET",
5777
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/test-scripts/summary`
5777
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/test-scripts/summary`
5778
5778
  };
5779
5779
  }
5780
5780
  },
@@ -5783,15 +5783,15 @@ var reportTools = [
5783
5783
  description: "Get a paginated, slimmed summary of latest test runs for a project. Response shape: { page, pageSize, totalCount, totalPages, hasMore, runs: [{ status, testCaseId, testCaseTitle, useCaseId, useCaseTitle, lastRunAt, error, latestWorkflowRunId }] }. Returns 20 runs per page by default (max 100). `totalCount` is the project-wide total after the replay-status filter; `runs` is the page slice. Check `hasMore` to decide whether to fetch additional pages. Use muggle-remote-test-case-get / muggle-remote-wf-get-ts-replay-latest-run for full per-run detail.",
5784
5784
  inputSchema: ProjectTestRunsSummaryInputSchema,
5785
5785
  mapToUpstream: (input) => {
5786
- const data = input;
5786
+ const toolInput = input;
5787
5787
  return {
5788
5788
  method: "GET",
5789
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/test-runs/summary/paginated`,
5789
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/test-runs/summary/paginated`,
5790
5790
  queryParams: {
5791
- page: data.page,
5792
- pageSize: data.pageSize,
5793
- sortBy: data.sortBy,
5794
- sortOrder: data.sortOrder
5791
+ page: toolInput.page,
5792
+ pageSize: toolInput.pageSize,
5793
+ sortBy: toolInput.sortBy,
5794
+ sortOrder: toolInput.sortOrder
5795
5795
  }
5796
5796
  };
5797
5797
  },
@@ -5802,11 +5802,11 @@ var reportTools = [
5802
5802
  description: "Get report statistics summary for a project.",
5803
5803
  inputSchema: ReportStatsSummaryInputSchema,
5804
5804
  mapToUpstream: (input) => {
5805
- const data = input;
5805
+ const toolInput = input;
5806
5806
  return {
5807
5807
  method: "GET",
5808
5808
  path: `${MUGGLE_TEST_PREFIX}/report/stats-summary`,
5809
- queryParams: { projectId: data.projectId }
5809
+ queryParams: { projectId: toolInput.projectId }
5810
5810
  };
5811
5811
  }
5812
5812
  },
@@ -5815,16 +5815,16 @@ var reportTools = [
5815
5815
  description: "Query cost/usage data for a project over a date range.",
5816
5816
  inputSchema: ReportCostQueryInputSchema,
5817
5817
  mapToUpstream: (input) => {
5818
- const data = input;
5818
+ const toolInput = input;
5819
5819
  return {
5820
5820
  method: "POST",
5821
5821
  path: `${MUGGLE_TEST_PREFIX}/report/cost/query`,
5822
5822
  body: {
5823
- projectId: data.projectId,
5824
- startDateKey: data.startDateKey,
5825
- endDateKey: data.endDateKey,
5826
- filterType: data.filterType,
5827
- filterIds: data.filterIds
5823
+ projectId: toolInput.projectId,
5824
+ startDateKey: toolInput.startDateKey,
5825
+ endDateKey: toolInput.endDateKey,
5826
+ filterType: toolInput.filterType,
5827
+ filterIds: toolInput.filterIds
5828
5828
  }
5829
5829
  };
5830
5830
  }
@@ -5834,17 +5834,17 @@ var reportTools = [
5834
5834
  description: "Update report delivery preferences for a project.",
5835
5835
  inputSchema: ReportPreferencesUpsertInputSchema,
5836
5836
  mapToUpstream: (input) => {
5837
- const data = input;
5837
+ const toolInput = input;
5838
5838
  return {
5839
5839
  method: "PUT",
5840
5840
  path: `${MUGGLE_TEST_PREFIX}/report/preferences`,
5841
5841
  body: {
5842
- projectId: data.projectId,
5843
- channels: data.channels,
5844
- emails: data.emails,
5845
- phones: data.phones,
5846
- webhookUrl: data.webhookUrl,
5847
- defaultExportFormat: data.defaultExportFormat
5842
+ projectId: toolInput.projectId,
5843
+ channels: toolInput.channels,
5844
+ emails: toolInput.emails,
5845
+ phones: toolInput.phones,
5846
+ webhookUrl: toolInput.webhookUrl,
5847
+ defaultExportFormat: toolInput.defaultExportFormat
5848
5848
  }
5849
5849
  };
5850
5850
  }
@@ -5854,13 +5854,13 @@ var reportTools = [
5854
5854
  description: "Generate a final test report for a project.",
5855
5855
  inputSchema: ReportFinalGenerateInputSchema,
5856
5856
  mapToUpstream: (input) => {
5857
- const data = input;
5857
+ const toolInput = input;
5858
5858
  return {
5859
5859
  method: "POST",
5860
5860
  path: `${MUGGLE_TEST_PREFIX}/report/final/generate`,
5861
5861
  body: {
5862
- projectId: data.projectId,
5863
- exportFormat: data.exportFormat
5862
+ projectId: toolInput.projectId,
5863
+ exportFormat: toolInput.exportFormat
5864
5864
  },
5865
5865
  timeoutMs: getWorkflowTimeoutMs()
5866
5866
  };
@@ -5873,11 +5873,11 @@ var secretTools = [
5873
5873
  description: "List all secrets for a project. Secret values are not returned for security.",
5874
5874
  inputSchema: SecretListInputSchema,
5875
5875
  mapToUpstream: (input) => {
5876
- const data = input;
5876
+ const toolInput = input;
5877
5877
  return {
5878
5878
  method: "GET",
5879
5879
  path: `${MUGGLE_TEST_PREFIX}/secrets`,
5880
- queryParams: { projectId: data.projectId }
5880
+ queryParams: { projectId: toolInput.projectId }
5881
5881
  };
5882
5882
  }
5883
5883
  },
@@ -5886,16 +5886,16 @@ var secretTools = [
5886
5886
  description: "Create a new secret (credential) for a project.",
5887
5887
  inputSchema: SecretCreateInputSchema,
5888
5888
  mapToUpstream: (input) => {
5889
- const data = input;
5889
+ const toolInput = input;
5890
5890
  return {
5891
5891
  method: "POST",
5892
5892
  path: `${MUGGLE_TEST_PREFIX}/secrets`,
5893
5893
  body: {
5894
- projectId: data.projectId,
5895
- secretName: data.name,
5896
- value: data.value,
5897
- description: data.description,
5898
- source: data.source
5894
+ projectId: toolInput.projectId,
5895
+ secretName: toolInput.name,
5896
+ value: toolInput.value,
5897
+ description: toolInput.description,
5898
+ source: toolInput.source
5899
5899
  }
5900
5900
  };
5901
5901
  }
@@ -5905,10 +5905,10 @@ var secretTools = [
5905
5905
  description: "Get details of a specific secret. The secret value is not returned for security.",
5906
5906
  inputSchema: SecretGetInputSchema,
5907
5907
  mapToUpstream: (input) => {
5908
- const data = input;
5908
+ const toolInput = input;
5909
5909
  return {
5910
5910
  method: "GET",
5911
- path: `${MUGGLE_TEST_PREFIX}/secrets/${data.secretId}`
5911
+ path: `${MUGGLE_TEST_PREFIX}/secrets/${toolInput.secretId}`
5912
5912
  };
5913
5913
  }
5914
5914
  },
@@ -5917,14 +5917,14 @@ var secretTools = [
5917
5917
  description: "Update an existing secret.",
5918
5918
  inputSchema: SecretUpdateInputSchema,
5919
5919
  mapToUpstream: (input) => {
5920
- const data = input;
5920
+ const toolInput = input;
5921
5921
  const body = {};
5922
- if (data.name !== void 0) body.name = data.name;
5923
- if (data.value !== void 0) body.value = data.value;
5924
- if (data.description !== void 0) body.description = data.description;
5922
+ if (toolInput.name !== void 0) body.name = toolInput.name;
5923
+ if (toolInput.value !== void 0) body.value = toolInput.value;
5924
+ if (toolInput.description !== void 0) body.description = toolInput.description;
5925
5925
  return {
5926
5926
  method: "PUT",
5927
- path: `${MUGGLE_TEST_PREFIX}/secrets/${data.secretId}`,
5927
+ path: `${MUGGLE_TEST_PREFIX}/secrets/${toolInput.secretId}`,
5928
5928
  body
5929
5929
  };
5930
5930
  }
@@ -5934,10 +5934,10 @@ var secretTools = [
5934
5934
  description: "Delete a secret from a project.",
5935
5935
  inputSchema: SecretDeleteInputSchema,
5936
5936
  mapToUpstream: (input) => {
5937
- const data = input;
5937
+ const toolInput = input;
5938
5938
  return {
5939
5939
  method: "DELETE",
5940
- path: `${MUGGLE_TEST_PREFIX}/secrets/${data.secretId}`
5940
+ path: `${MUGGLE_TEST_PREFIX}/secrets/${toolInput.secretId}`
5941
5941
  };
5942
5942
  }
5943
5943
  }
@@ -5948,15 +5948,15 @@ var prdFileTools = [
5948
5948
  description: "Upload a PRD file to a project. File content should be base64-encoded.",
5949
5949
  inputSchema: PrdFileUploadInputSchema,
5950
5950
  mapToUpstream: (input) => {
5951
- const data = input;
5951
+ const toolInput = input;
5952
5952
  return {
5953
5953
  method: "POST",
5954
5954
  path: `${MUGGLE_TEST_PREFIX}/workflow/use-case/prd-file-upload`,
5955
5955
  multipartFormData: {
5956
5956
  fileFieldName: "file",
5957
- fileName: data.fileName,
5958
- contentType: data.contentType || "application/octet-stream",
5959
- fileBase64: data.contentBase64
5957
+ fileName: toolInput.fileName,
5958
+ contentType: toolInput.contentType || "application/octet-stream",
5959
+ fileBase64: toolInput.contentBase64
5960
5960
  }
5961
5961
  };
5962
5962
  }
@@ -5966,10 +5966,10 @@ var prdFileTools = [
5966
5966
  description: "List all PRD files associated with a project.",
5967
5967
  inputSchema: PrdFileListInputSchema,
5968
5968
  mapToUpstream: (input) => {
5969
- const data = input;
5969
+ const toolInput = input;
5970
5970
  return {
5971
5971
  method: "GET",
5972
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/prd-files`
5972
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/prd-files`
5973
5973
  };
5974
5974
  }
5975
5975
  },
@@ -5978,10 +5978,10 @@ var prdFileTools = [
5978
5978
  description: "Delete a PRD file from a project.",
5979
5979
  inputSchema: PrdFileDeleteInputSchema,
5980
5980
  mapToUpstream: (input) => {
5981
- const data = input;
5981
+ const toolInput = input;
5982
5982
  return {
5983
5983
  method: "DELETE",
5984
- path: `${MUGGLE_TEST_PREFIX}/projects/${data.projectId}/prd-files/${data.prdFileId}`
5984
+ path: `${MUGGLE_TEST_PREFIX}/projects/${toolInput.projectId}/prd-files/${toolInput.prdFileId}`
5985
5985
  };
5986
5986
  }
5987
5987
  },
@@ -5990,19 +5990,19 @@ var prdFileTools = [
5990
5990
  description: "Start a PRD file processing workflow to extract use cases.",
5991
5991
  inputSchema: PrdFileProcessStartInputSchema,
5992
5992
  mapToUpstream: (input) => {
5993
- const data = input;
5993
+ const toolInput = input;
5994
5994
  return {
5995
5995
  method: "POST",
5996
5996
  path: `${MUGGLE_TEST_PREFIX}/workflow/use-case/prd-file-process`,
5997
5997
  body: {
5998
- projectId: data.projectId,
5999
- name: data.name,
6000
- description: data.description,
6001
- prdFilePath: data.prdFilePath,
6002
- originalFileName: data.originalFileName,
6003
- url: data.url,
6004
- contentChecksum: data.contentChecksum,
6005
- fileSize: data.fileSize
5998
+ projectId: toolInput.projectId,
5999
+ name: toolInput.name,
6000
+ description: toolInput.description,
6001
+ prdFilePath: toolInput.prdFilePath,
6002
+ originalFileName: toolInput.originalFileName,
6003
+ url: toolInput.url,
6004
+ contentChecksum: toolInput.contentChecksum,
6005
+ fileSize: toolInput.fileSize
6006
6006
  }
6007
6007
  };
6008
6008
  }
@@ -6012,10 +6012,10 @@ var prdFileTools = [
6012
6012
  description: "Get the latest run status of a PRD file processing workflow.",
6013
6013
  inputSchema: PrdFileProcessLatestRunInputSchema,
6014
6014
  mapToUpstream: (input) => {
6015
- const data = input;
6015
+ const toolInput = input;
6016
6016
  return {
6017
6017
  method: "GET",
6018
- path: `${MUGGLE_TEST_PREFIX}/workflow/use-case/prd-file-process/${data.workflowRuntimeId}/run/latest`
6018
+ path: `${MUGGLE_TEST_PREFIX}/workflow/use-case/prd-file-process/${toolInput.workflowRuntimeId}/run/latest`
6019
6019
  };
6020
6020
  }
6021
6021
  }
@@ -6026,14 +6026,14 @@ var walletTools = [
6026
6026
  description: "Create a Stripe checkout session to purchase a token package.",
6027
6027
  inputSchema: WalletTopUpInputSchema,
6028
6028
  mapToUpstream: (input) => {
6029
- const data = input;
6029
+ const toolInput = input;
6030
6030
  return {
6031
6031
  method: "POST",
6032
6032
  path: "/v1/protected/wallet/topup",
6033
6033
  body: {
6034
- packageId: data.packageId,
6035
- checkoutSuccessCallback: data.checkoutSuccessCallback,
6036
- checkoutCancelCallback: data.checkoutCancelCallback
6034
+ packageId: toolInput.packageId,
6035
+ checkoutSuccessCallback: toolInput.checkoutSuccessCallback,
6036
+ checkoutCancelCallback: toolInput.checkoutCancelCallback
6037
6037
  }
6038
6038
  };
6039
6039
  }
@@ -6043,13 +6043,13 @@ var walletTools = [
6043
6043
  description: "Create a Stripe setup session to add a payment method.",
6044
6044
  inputSchema: WalletPaymentMethodCreateSetupSessionInputSchema,
6045
6045
  mapToUpstream: (input) => {
6046
- const data = input;
6046
+ const toolInput = input;
6047
6047
  return {
6048
6048
  method: "POST",
6049
6049
  path: "/v1/protected/wallet/payment-methods/setup",
6050
6050
  body: {
6051
- checkoutSuccessCallback: data.checkoutSuccessCallback,
6052
- checkoutCancelCallback: data.checkoutCancelCallback
6051
+ checkoutSuccessCallback: toolInput.checkoutSuccessCallback,
6052
+ checkoutCancelCallback: toolInput.checkoutCancelCallback
6053
6053
  }
6054
6054
  };
6055
6055
  }
@@ -6059,11 +6059,11 @@ var walletTools = [
6059
6059
  description: "Set the saved payment method used by wallet auto top-up.",
6060
6060
  inputSchema: WalletAutoTopUpSetPaymentMethodInputSchema,
6061
6061
  mapToUpstream: (input) => {
6062
- const data = input;
6062
+ const toolInput = input;
6063
6063
  return {
6064
6064
  method: "PUT",
6065
6065
  path: "/v1/protected/wallet/auto-topup/payment-method",
6066
- body: { paymentMethodId: data.paymentMethodId }
6066
+ body: { paymentMethodId: toolInput.paymentMethodId }
6067
6067
  };
6068
6068
  }
6069
6069
  },
@@ -6083,14 +6083,14 @@ var walletTools = [
6083
6083
  description: "Update wallet auto-topup settings.",
6084
6084
  inputSchema: WalletAutoTopUpUpdateInputSchema,
6085
6085
  mapToUpstream: (input) => {
6086
- const data = input;
6086
+ const toolInput = input;
6087
6087
  return {
6088
6088
  method: "PUT",
6089
6089
  path: "/v1/protected/wallet/auto-topup",
6090
6090
  body: {
6091
- enabled: data.enabled,
6092
- topUpTriggerTokenThreshold: data.topUpTriggerTokenThreshold,
6093
- packageId: data.packageId
6091
+ enabled: toolInput.enabled,
6092
+ topUpTriggerTokenThreshold: toolInput.topUpTriggerTokenThreshold,
6093
+ packageId: toolInput.packageId
6094
6094
  }
6095
6095
  };
6096
6096
  }
@@ -6159,8 +6159,8 @@ var recommendationTools = [
6159
6159
  throw new Error("RECOMMENDATION_ONLY");
6160
6160
  },
6161
6161
  localHandler: async (input) => {
6162
- const data = input;
6163
- const provider = data?.repositoryProvider || "github";
6162
+ const toolInput = input;
6163
+ const provider = toolInput?.repositoryProvider || "github";
6164
6164
  const recommendations = [];
6165
6165
  if (provider === "github" || provider === "other") {
6166
6166
  recommendations.push({
@@ -6206,30 +6206,30 @@ var apiKeyTools = [
6206
6206
  description: "Create a new API key for the authenticated user. Requires existing authentication.",
6207
6207
  inputSchema: ApiKeyCreateInputSchema,
6208
6208
  mapToUpstream: (input) => {
6209
- const data = input;
6209
+ const toolInput = input;
6210
6210
  return {
6211
6211
  method: "POST",
6212
6212
  path: API_KEY_PREFIX,
6213
6213
  body: {
6214
- name: data.name || "MCP Gateway Key",
6215
- expiry: data.expiry || "90d"
6214
+ name: toolInput.name || "MCP Gateway Key",
6215
+ expiry: toolInput.expiry || "90d"
6216
6216
  }
6217
6217
  };
6218
6218
  },
6219
6219
  mapFromUpstream: (response) => {
6220
- const data = response.data;
6221
- const maskedKey = `${data.prefix}...${data.lastFour}`;
6222
- const expiresAt = data.expiresAt ? new Date(data.expiresAt).toISOString() : "never";
6220
+ const toolInput = response.data;
6221
+ const maskedKey = `${toolInput.prefix}...${toolInput.lastFour}`;
6222
+ const expiresAt = toolInput.expiresAt ? new Date(toolInput.expiresAt).toISOString() : "never";
6223
6223
  return {
6224
6224
  success: true,
6225
6225
  message: "API key created.",
6226
6226
  apiKey: {
6227
- id: data.id,
6228
- key: data.key,
6227
+ id: toolInput.id,
6228
+ key: toolInput.key,
6229
6229
  hint: maskedKey,
6230
- name: data.name,
6231
- status: data.status,
6232
- createdAt: new Date(data.createdAt).toISOString(),
6230
+ name: toolInput.name,
6231
+ status: toolInput.status,
6232
+ createdAt: new Date(toolInput.createdAt).toISOString(),
6233
6233
  expiresAt
6234
6234
  },
6235
6235
  note: "The full API key is returned only once. Store it securely."
@@ -6268,10 +6268,10 @@ var apiKeyTools = [
6268
6268
  description: "Get details of a specific API key by ID.",
6269
6269
  inputSchema: ApiKeyGetInputSchema,
6270
6270
  mapToUpstream: (input) => {
6271
- const data = input;
6271
+ const toolInput = input;
6272
6272
  return {
6273
6273
  method: "GET",
6274
- path: `${API_KEY_PREFIX}/${data.apiKeyId}`
6274
+ path: `${API_KEY_PREFIX}/${toolInput.apiKeyId}`
6275
6275
  };
6276
6276
  },
6277
6277
  mapFromUpstream: (response) => {
@@ -6295,10 +6295,10 @@ var apiKeyTools = [
6295
6295
  description: "Revoke an API key. The key will immediately stop working. Use muggle-remote-auth-api-key-list to find the key ID first.",
6296
6296
  inputSchema: ApiKeyRevokeInputSchema,
6297
6297
  mapToUpstream: (input) => {
6298
- const data = input;
6298
+ const toolInput = input;
6299
6299
  return {
6300
6300
  method: "DELETE",
6301
- path: `${API_KEY_PREFIX}/${data.apiKeyId}`
6301
+ path: `${API_KEY_PREFIX}/${toolInput.apiKeyId}`
6302
6302
  };
6303
6303
  },
6304
6304
  mapFromUpstream: () => {
@@ -6315,14 +6315,14 @@ var userFeedbackTools = [
6315
6315
  description: "Submit user feedback on a generated action script \u2014 either the whole script (targetType='actionScript', targetId=actionScriptId) or a specific step (targetType='step', targetId=`${actionScriptId}:${stepIndex}` with 0-based stepIndex). Persists the feedback and triggers an async feedback-analysis workflow that may regenerate the script. The response includes the saved feedback and, when the analysis workflow was started, a feedbackAnalysisWorkflowRuntimeId for polling.",
6316
6316
  inputSchema: UserFeedbackCreateInputSchema,
6317
6317
  mapToUpstream: (input) => {
6318
- const data = input;
6318
+ const toolInput = input;
6319
6319
  return {
6320
6320
  method: "POST",
6321
6321
  path: `${MUGGLE_TEST_PREFIX}/user-feedback`,
6322
6322
  body: {
6323
- projectId: data.projectId,
6324
- target: data.target,
6325
- feedbackText: data.feedbackText
6323
+ projectId: toolInput.projectId,
6324
+ target: toolInput.target,
6325
+ feedbackText: toolInput.feedbackText
6326
6326
  }
6327
6327
  };
6328
6328
  }
@@ -6332,18 +6332,18 @@ var userFeedbackTools = [
6332
6332
  description: "List active user feedback entries for a project. Optionally narrow by exactly one of actionScriptId / testScriptId / testCaseId / useCaseId \u2014 the typical query is 'show me feedback on this test case (or test script, or use case).' Supports limit/offset pagination. Response: { feedback: IUserFeedback[], total: number, hasMore: boolean }.",
6333
6333
  inputSchema: UserFeedbackListInputSchema,
6334
6334
  mapToUpstream: (input) => {
6335
- const data = input;
6335
+ const toolInput = input;
6336
6336
  return {
6337
6337
  method: "GET",
6338
6338
  path: `${MUGGLE_TEST_PREFIX}/user-feedback`,
6339
6339
  queryParams: {
6340
- projectId: data.projectId,
6341
- actionScriptId: data.actionScriptId,
6342
- testScriptId: data.testScriptId,
6343
- testCaseId: data.testCaseId,
6344
- useCaseId: data.useCaseId,
6345
- limit: data.limit,
6346
- offset: data.offset
6340
+ projectId: toolInput.projectId,
6341
+ actionScriptId: toolInput.actionScriptId,
6342
+ testScriptId: toolInput.testScriptId,
6343
+ testCaseId: toolInput.testCaseId,
6344
+ useCaseId: toolInput.useCaseId,
6345
+ limit: toolInput.limit,
6346
+ offset: toolInput.offset
6347
6347
  }
6348
6348
  };
6349
6349
  }
@@ -6353,10 +6353,10 @@ var userFeedbackTools = [
6353
6353
  description: "Soft-delete a user feedback entry by ID. Returns 204 on success.",
6354
6354
  inputSchema: UserFeedbackDeleteInputSchema,
6355
6355
  mapToUpstream: (input) => {
6356
- const data = input;
6356
+ const toolInput = input;
6357
6357
  return {
6358
6358
  method: "DELETE",
6359
- path: `${MUGGLE_TEST_PREFIX}/user-feedback/${data.feedbackId}`
6359
+ path: `${MUGGLE_TEST_PREFIX}/user-feedback/${toolInput.feedbackId}`
6360
6360
  };
6361
6361
  }
6362
6362
  }
@@ -6397,12 +6397,12 @@ var authTools = [
6397
6397
  throw new Error("LOCAL_HANDLER_ONLY");
6398
6398
  },
6399
6399
  localHandler: async (input) => {
6400
- const data = input;
6400
+ const toolInput = input;
6401
6401
  const authService = getAuthService();
6402
6402
  const deviceCodeResponse = await authService.startDeviceCodeFlow({
6403
- forceNewSession: data.forceNewSession
6403
+ forceNewSession: toolInput.forceNewSession
6404
6404
  });
6405
- const waitForCompletion = data.waitForCompletion ?? true;
6405
+ const waitForCompletion = toolInput.waitForCompletion ?? true;
6406
6406
  if (!waitForCompletion) {
6407
6407
  return {
6408
6408
  status: "pending",
@@ -6416,7 +6416,7 @@ var authTools = [
6416
6416
  const pollResult = await authService.waitForDeviceCodeAuthorization({
6417
6417
  deviceCode: deviceCodeResponse.deviceCode,
6418
6418
  intervalSeconds: deviceCodeResponse.interval,
6419
- timeoutMs: data.timeoutMs
6419
+ timeoutMs: toolInput.timeoutMs
6420
6420
  });
6421
6421
  if (pollResult.status === "complete" /* Complete */) {
6422
6422
  return {
@@ -6441,27 +6441,27 @@ var authTools = [
6441
6441
  throw new Error("LOCAL_HANDLER_ONLY");
6442
6442
  },
6443
6443
  localHandler: async (input) => {
6444
- const data = input;
6444
+ const toolInput = input;
6445
6445
  const authService = getAuthService();
6446
- const deviceCode = data.deviceCode ?? authService.getPendingDeviceCode();
6446
+ const deviceCode = toolInput.deviceCode ?? authService.getPendingDeviceCode();
6447
6447
  if (!deviceCode) {
6448
6448
  return {
6449
6449
  error: "NO_PENDING_LOGIN",
6450
6450
  message: "No pending login found. Please start a new login with muggle-remote-auth-login."
6451
6451
  };
6452
6452
  }
6453
- const result = await authService.pollDeviceCode(deviceCode);
6454
- if (result.status === "complete" /* Complete */) {
6453
+ const devicePollOutcome = await authService.pollDeviceCode(deviceCode);
6454
+ if (devicePollOutcome.status === "complete" /* Complete */) {
6455
6455
  return {
6456
6456
  status: "complete",
6457
6457
  success: true,
6458
- email: result.email,
6458
+ email: devicePollOutcome.email,
6459
6459
  message: "Login complete. You are now authenticated."
6460
6460
  };
6461
6461
  }
6462
6462
  return {
6463
- status: result.status,
6464
- message: result.message
6463
+ status: devicePollOutcome.status,
6464
+ message: devicePollOutcome.message
6465
6465
  };
6466
6466
  }
6467
6467
  },
@@ -6475,8 +6475,8 @@ var authTools = [
6475
6475
  },
6476
6476
  localHandler: async () => {
6477
6477
  const authService = getAuthService();
6478
- const result = authService.logout();
6479
- if (result) {
6478
+ const didLogout = authService.logout();
6479
+ if (didLogout) {
6480
6480
  return { success: true, message: "Successfully logged out." };
6481
6481
  }
6482
6482
  return { success: false, message: "No active session to log out from." };
@@ -6525,9 +6525,9 @@ async function executeQaTool(toolName, input, correlationId) {
6525
6525
  try {
6526
6526
  const validatedInput = tool.inputSchema.parse(input);
6527
6527
  if (tool.localHandler) {
6528
- const result = await tool.localHandler(validatedInput);
6528
+ const localHandlerOutput = await tool.localHandler(validatedInput);
6529
6529
  return {
6530
- content: JSON.stringify(result, null, 2),
6530
+ content: JSON.stringify(localHandlerOutput, null, 2),
6531
6531
  isError: false
6532
6532
  };
6533
6533
  }
@@ -6537,17 +6537,17 @@ async function executeQaTool(toolName, input, correlationId) {
6537
6537
  const client = getPromptServiceClient();
6538
6538
  const response = await client.execute(upstreamCall, credentials, correlationId);
6539
6539
  const mapper = tool.mapFromUpstream || defaultResponseMapper;
6540
- const result = mapper(response, validatedInput);
6540
+ const mappedResponse = mapper(response, validatedInput);
6541
6541
  return {
6542
- content: JSON.stringify(result, null, 2),
6542
+ content: JSON.stringify(mappedResponse, null, 2),
6543
6543
  isError: false
6544
6544
  };
6545
6545
  } catch (error) {
6546
6546
  if (error instanceof Error && error.message === "RECOMMENDATION_ONLY") {
6547
6547
  const mapper = tool.mapFromUpstream || defaultResponseMapper;
6548
- const result = mapper({ statusCode: 200, data: {}, headers: {} }, validatedInput);
6548
+ const mappedResponse = mapper({ statusCode: 200, data: {}, headers: {} }, validatedInput);
6549
6549
  return {
6550
- content: JSON.stringify(result, null, 2),
6550
+ content: JSON.stringify(mappedResponse, null, 2),
6551
6551
  isError: false
6552
6552
  };
6553
6553
  }