@mablhq/mabl-cli 2.72.5 → 2.72.12

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 (69) hide show
  1. package/browserEngines/chromiumBrowserEngine.js +17 -0
  2. package/browserLauncher/index.js +3 -3
  3. package/commands/mcp/mcp_cmds/tools/createTest.js +10 -0
  4. package/commands/mcp/mcp_cmds/tools/getApplications.js +69 -0
  5. package/commands/mcp/mcp_cmds/tools/{getPlanResults.js → getLatestPlanRuns.js} +6 -6
  6. package/commands/mcp/mcp_cmds/tools/{getPlanRun.js → getPlanRunResult.js} +5 -5
  7. package/commands/mcp/mcp_cmds/tools/index.js +6 -4
  8. package/execution/index.js +1 -1
  9. package/http/requestInterceptor.js +10 -5
  10. package/index.d.ts +2 -0
  11. package/mablscript/MablStepV2.js +40 -10
  12. package/mablscript/MablStepWithFindAction.js +126 -2
  13. package/mablscript/actions/AwaitDownloadAction.js +4 -3
  14. package/mablscript/actions/AwaitPDFDownloadAction.js +6 -5
  15. package/mablscript/actions/ConditionAction.js +2 -1
  16. package/mablscript/actions/ExtractAction.js +8 -13
  17. package/mablscript/actions/FindAction.js +20 -0
  18. package/mablscript/actions/GetVariableValue.js +15 -4
  19. package/mablscript/actions/JavaScriptAction.js +25 -39
  20. package/mablscript/diffing/diffingUtil.js +5 -5
  21. package/mablscript/importer.js +79 -59
  22. package/mablscript/mobile/steps/CreateVariableMobileStep.js +3 -1
  23. package/mablscript/steps/AbstractAssertionsAndVariablesStep.js +10 -8
  24. package/mablscript/steps/AccessibilityCheck.js +78 -36
  25. package/mablscript/steps/AssertStep.js +267 -86
  26. package/mablscript/steps/AssertStepOld.js +69 -139
  27. package/mablscript/steps/AwaitTabStep.js +32 -9
  28. package/mablscript/steps/AwaitUploadsStep.js +24 -8
  29. package/mablscript/steps/ClearCookiesStep.js +24 -8
  30. package/mablscript/steps/ClickAndHoldStep.js +47 -47
  31. package/mablscript/steps/ClickStep.js +38 -33
  32. package/mablscript/steps/CreateVariableStep.js +169 -137
  33. package/mablscript/steps/DatabaseQueryStep.js +16 -4
  34. package/mablscript/steps/DoubleClickStep.js +39 -40
  35. package/mablscript/steps/DownloadStep.js +81 -63
  36. package/mablscript/steps/EchoStep.js +28 -8
  37. package/mablscript/steps/ElseIfConditionStep.js +25 -12
  38. package/mablscript/steps/ElseStep.js +24 -9
  39. package/mablscript/steps/EndStep.js +24 -9
  40. package/mablscript/steps/EnterAuthCodeStep.js +38 -34
  41. package/mablscript/steps/EnterTextStep.js +53 -64
  42. package/mablscript/steps/EvaluateFlowStep.js +41 -18
  43. package/mablscript/steps/EvaluateJavaScriptStep.js +19 -19
  44. package/mablscript/steps/HoverStep.js +39 -39
  45. package/mablscript/steps/IfConditionStep.js +141 -99
  46. package/mablscript/steps/NavigateStep.js +31 -9
  47. package/mablscript/steps/OpenEmailStep.js +41 -21
  48. package/mablscript/steps/ReleaseStep.js +48 -38
  49. package/mablscript/steps/RemoveCookieStep.js +27 -9
  50. package/mablscript/steps/RightClickStep.js +38 -33
  51. package/mablscript/steps/SelectStep.js +71 -46
  52. package/mablscript/steps/SendHttpRequestStep.js +11 -4
  53. package/mablscript/steps/SendKeyStep.js +175 -49
  54. package/mablscript/steps/SetCookieStep.js +58 -23
  55. package/mablscript/steps/SetFilesStep.js +44 -43
  56. package/mablscript/steps/SetViewportStep.js +40 -12
  57. package/mablscript/steps/StepGroupStep.js +70 -0
  58. package/mablscript/steps/SwitchContextStep.js +93 -83
  59. package/mablscript/steps/SyntheticStep.js +1 -1
  60. package/mablscript/steps/VisitUrlStep.js +31 -21
  61. package/mablscript/steps/WaitStep.js +21 -8
  62. package/mablscript/steps/WaitUntilStep.js +32 -13
  63. package/mablscript/types/AssertStepDescriptor.js +2 -0
  64. package/mablscript/types/ConditionDescriptor.js +5 -5
  65. package/mablscript/types/GetVariableDescriptor.js +0 -8
  66. package/mablscript/types/StepGroupStepDescriptor.js +2 -0
  67. package/package.json +4 -4
  68. package/proxy/index.js +1 -1
  69. package/upload/index.js +1 -1
@@ -12,6 +12,9 @@ const runTest = (0, mcpMablTool_1.defineTool)({
12
12
  title: 'Create a mabl test',
13
13
  description: 'Create a mabl browser or API test',
14
14
  inputSchema: zod_1.z.object({
15
+ applicationId: zod_1.z
16
+ .string()
17
+ .describe('The id of the application to run the test in'),
15
18
  environmentId: zod_1.z
16
19
  .string()
17
20
  .describe('The id of the environment to run the test in'),
@@ -55,6 +58,12 @@ const runTest = (0, mcpMablTool_1.defineTool)({
55
58
  if (!params.url) {
56
59
  return (0, common_1.stringToToolResult)('url is required when creating a test. Try to infer the url from the user context or request the URL explicitly.', true);
57
60
  }
61
+ if (!params.applicationId) {
62
+ return (0, common_1.stringToToolResult)('applicationId is required when creating a test. Try to infer the application from the user context or request the application explicitly.', true);
63
+ }
64
+ if (!params.environmentId) {
65
+ return (0, common_1.stringToToolResult)('environmentId is required when creating a test. Request the environment explicitly.', true);
66
+ }
58
67
  messaging_1.mablEventEmitter.resetOutputEventChannel();
59
68
  let fullIntent = params.intent;
60
69
  if (params.steps) {
@@ -71,6 +80,7 @@ const runTest = (0, mcpMablTool_1.defineTool)({
71
80
  }
72
81
  await (0, trainingSessions_1.trainNewTest)({
73
82
  environmentId: params.environmentId,
83
+ applicationId: params.applicationId,
74
84
  url: params.url,
75
85
  testName: params.name ?? 'New Test',
76
86
  autoBranch: false,
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mcpMablTool_1 = require("./mcpMablTool");
4
+ const zod_1 = require("zod");
5
+ const getApplications = (0, mcpMablTool_1.defineTool)({
6
+ schema: {
7
+ name: 'get-applications',
8
+ title: 'Get all mabl applications with their environments',
9
+ description: 'Get all mabl applications with their associated environments',
10
+ inputSchema: zod_1.z.object({}),
11
+ outputSchema: zod_1.z.object({
12
+ applications: zod_1.z.array(zod_1.z.object({
13
+ applicationId: zod_1.z.string(),
14
+ applicationName: zod_1.z.string(),
15
+ environments: zod_1.z.array(zod_1.z.object({
16
+ environmentId: zod_1.z.string(),
17
+ name: zod_1.z.string(),
18
+ url: zod_1.z.string(),
19
+ })),
20
+ })),
21
+ }),
22
+ type: 'readOnly',
23
+ },
24
+ handle: async (_, mablApiClient, _server, workspaceId) => {
25
+ const limit = 500;
26
+ const [applications, deployments, environments] = await Promise.all([
27
+ mablApiClient.getApplications(workspaceId, limit),
28
+ mablApiClient.queryDeploymentEntities(workspaceId),
29
+ mablApiClient.getEnvironments(workspaceId, limit),
30
+ ]);
31
+ const environmentMap = new Map();
32
+ environments.forEach((env) => {
33
+ environmentMap.set(env.id, env);
34
+ });
35
+ const deploymentsByAppId = new Map();
36
+ if (deployments.deployments) {
37
+ deployments.deployments.forEach((deployment) => {
38
+ if (deployment.application_id) {
39
+ if (!deploymentsByAppId.has(deployment.application_id)) {
40
+ deploymentsByAppId.set(deployment.application_id, []);
41
+ }
42
+ deploymentsByAppId.get(deployment.application_id).push(deployment);
43
+ }
44
+ });
45
+ }
46
+ const applicationsWithEnvironments = applications.map((app) => ({
47
+ applicationId: app.id,
48
+ applicationName: app.name,
49
+ environments: (deploymentsByAppId.get(app.id) || []).map((deployment) => {
50
+ const environment = environmentMap.get(deployment.environment_id);
51
+ return {
52
+ environmentId: deployment.environment_id,
53
+ name: environment?.name || 'Unknown Environment',
54
+ url: deployment.uri || '',
55
+ };
56
+ }),
57
+ }));
58
+ return {
59
+ content: [
60
+ {
61
+ type: 'text',
62
+ text: JSON.stringify({ applications: applicationsWithEnvironments }, undefined, 2),
63
+ },
64
+ ],
65
+ structuredContent: { applications: applicationsWithEnvironments },
66
+ };
67
+ },
68
+ });
69
+ exports.default = [getApplications];
@@ -4,15 +4,15 @@ const mcpMablTool_1 = require("./mcpMablTool");
4
4
  const zod_1 = require("zod");
5
5
  const mablApi_1 = require("../../../../mablApi");
6
6
  const common_1 = require("./common");
7
- const getPlanResults = (0, mcpMablTool_1.defineTool)({
7
+ const getLatestPlanRuns = (0, mcpMablTool_1.defineTool)({
8
8
  schema: {
9
- name: 'get-plan-results',
10
- title: 'Get recent mabl plan run results',
11
- description: 'Get recent mabl plan run results',
9
+ name: 'get-latest-plan-runs',
10
+ title: 'Get latest mabl plan runs results',
11
+ description: 'Get latest mabl plan runs results',
12
12
  inputSchema: zod_1.z.object({
13
13
  planId: zod_1.z
14
14
  .string()
15
- .describe('The id of the mabl plan to get recent results of'),
15
+ .describe('The id of the mabl plan to get latest runs results of'),
16
16
  }),
17
17
  type: 'readOnly',
18
18
  outputSchema: zod_1.z.object({
@@ -78,4 +78,4 @@ const getPlanResults = (0, mcpMablTool_1.defineTool)({
78
78
  };
79
79
  },
80
80
  });
81
- exports.default = [getPlanResults];
81
+ exports.default = [getLatestPlanRuns];
@@ -33,11 +33,11 @@ async function processTestRun(testRun, planRun, mablApiClient, workspaceId, serv
33
33
  credentialsId: planRun.credentialsId,
34
34
  };
35
35
  }
36
- const getPlanRun = (0, mcpMablTool_1.defineTool)({
36
+ const getPlanRunResult = (0, mcpMablTool_1.defineTool)({
37
37
  schema: {
38
- name: 'get-plan-run',
39
- title: 'Get mabl plan run and its test results',
40
- description: 'Get a mabl plan run and all test results inside it. Useful for debugging a single plan run.',
38
+ name: 'get-plan-run-result',
39
+ title: 'Get mabl plan run result',
40
+ description: 'Get a mabl plan run result. Useful for debugging a single plan run.',
41
41
  inputSchema: zod_1.z.object({
42
42
  planRunId: zod_1.z
43
43
  .string()
@@ -71,4 +71,4 @@ const getPlanRun = (0, mcpMablTool_1.defineTool)({
71
71
  };
72
72
  },
73
73
  });
74
- exports.default = [getPlanRun];
74
+ exports.default = [getPlanRunResult];
@@ -7,14 +7,16 @@ const getEnvironments_1 = __importDefault(require("./getEnvironments"));
7
7
  const getTests_1 = __importDefault(require("./getTests"));
8
8
  const getMablDeployment_1 = __importDefault(require("./getMablDeployment"));
9
9
  const getTestResults_1 = __importDefault(require("./getTestResults"));
10
+ const getApplications_1 = __importDefault(require("./getApplications"));
10
11
  const analyzeFailure_1 = __importDefault(require("./analyzeFailure"));
11
12
  const runTest_1 = __importDefault(require("./runTest"));
12
13
  const exportToPlaywright_1 = __importDefault(require("./exportToPlaywright"));
13
14
  const createTest_1 = __importDefault(require("./createTest"));
14
15
  const getPlans_1 = __importDefault(require("./getPlans"));
15
- const getPlanResults_1 = __importDefault(require("./getPlanResults"));
16
- const getPlanRun_1 = __importDefault(require("./getPlanRun"));
16
+ const getPlanRunResult_1 = __importDefault(require("./getPlanRunResult"));
17
+ const getLatestPlanRuns_1 = __importDefault(require("./getLatestPlanRuns"));
17
18
  exports.default = [
19
+ ...getApplications_1.default,
18
20
  ...getEnvironments_1.default,
19
21
  ...getTests_1.default,
20
22
  ...getPlans_1.default,
@@ -24,6 +26,6 @@ exports.default = [
24
26
  ...runTest_1.default,
25
27
  ...exportToPlaywright_1.default,
26
28
  ...createTest_1.default,
27
- ...getPlanResults_1.default,
28
- ...getPlanRun_1.default,
29
+ ...getPlanRunResult_1.default,
30
+ ...getLatestPlanRuns_1.default,
29
31
  ];