@mablhq/mabl-cli 2.72.41 → 2.72.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/mcp/mcp_cmds/tools/getApplications.js +13 -11
- package/commands/mcp/mcp_cmds/tools/getCredentials.js +10 -8
- package/commands/mcp/mcp_cmds/tools/getLatestAuthoredTests.js +3 -2
- package/commands/mcp/mcp_cmds/tools/getTestResults.js +11 -9
- package/commands/mcp/mcp_cmds/tools/getTests.js +4 -3
- package/commands/mcp/mcp_cmds/tools/getWorkspaces.js +9 -9
- package/commands/mcp/mcp_cmds/tools/interceptor.js +7 -0
- package/commands/mcp/mcp_cmds/tools/mcpMablTool.js +9 -1
- package/execution/index.js +1 -1
- package/package.json +1 -1
- package/util/analytics.js +21 -0
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getApplicationsOutputSchema = void 0;
|
|
3
4
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
4
5
|
const zod_1 = require("zod");
|
|
6
|
+
exports.getApplicationsOutputSchema = zod_1.z.object({
|
|
7
|
+
applications: zod_1.z.array(zod_1.z.object({
|
|
8
|
+
applicationId: zod_1.z.string(),
|
|
9
|
+
applicationName: zod_1.z.string(),
|
|
10
|
+
environments: zod_1.z.array(zod_1.z.object({
|
|
11
|
+
environmentId: zod_1.z.string(),
|
|
12
|
+
name: zod_1.z.string(),
|
|
13
|
+
url: zod_1.z.string(),
|
|
14
|
+
})),
|
|
15
|
+
})),
|
|
16
|
+
});
|
|
5
17
|
const getApplications = (0, mcpMablTool_1.defineTool)({
|
|
6
18
|
schema: {
|
|
7
19
|
name: 'get-applications',
|
|
8
20
|
title: 'Get all mabl applications with their environments',
|
|
9
21
|
description: 'Get all mabl applications with their associated environments',
|
|
10
22
|
inputSchema: zod_1.z.object({}),
|
|
11
|
-
outputSchema:
|
|
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
|
-
}),
|
|
23
|
+
outputSchema: exports.getApplicationsOutputSchema,
|
|
22
24
|
type: 'readOnly',
|
|
23
25
|
},
|
|
24
26
|
handle: async (_, mablApiClient, _server, workspaceId) => {
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCredentialsOutputSchema = void 0;
|
|
3
4
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
4
5
|
const zod_1 = require("zod");
|
|
6
|
+
exports.getCredentialsOutputSchema = zod_1.z.object({
|
|
7
|
+
credentials: zod_1.z.array(zod_1.z.object({
|
|
8
|
+
id: zod_1.z.string(),
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
type: zod_1.z.string(),
|
|
11
|
+
cloud_only: zod_1.z.boolean().optional(),
|
|
12
|
+
})),
|
|
13
|
+
});
|
|
5
14
|
const getCredentials = (0, mcpMablTool_1.defineTool)({
|
|
6
15
|
schema: {
|
|
7
16
|
name: 'get-credentials',
|
|
8
17
|
title: 'Get all mabl credentials',
|
|
9
18
|
description: 'Get all mabl credentials',
|
|
10
19
|
inputSchema: zod_1.z.object({}),
|
|
11
|
-
outputSchema:
|
|
12
|
-
credentials: zod_1.z.array(zod_1.z.object({
|
|
13
|
-
id: zod_1.z.string(),
|
|
14
|
-
name: zod_1.z.string(),
|
|
15
|
-
type: zod_1.z.string(),
|
|
16
|
-
cloud_only: zod_1.z.boolean().optional(),
|
|
17
|
-
})),
|
|
18
|
-
}),
|
|
20
|
+
outputSchema: exports.getCredentialsOutputSchema,
|
|
19
21
|
type: 'readOnly',
|
|
20
22
|
},
|
|
21
23
|
handle: async (_, mablApiClient, _server, workspaceId) => {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLatestAuthoredTestsOutputSchema = void 0;
|
|
3
4
|
const zod_1 = require("zod");
|
|
4
5
|
const testUtils_1 = require("../utils/testUtils");
|
|
5
6
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
6
7
|
const cliConfigProvider_1 = require("../../../../providers/cliConfigProvider");
|
|
7
8
|
const common_1 = require("./common");
|
|
8
|
-
|
|
9
|
+
exports.getLatestAuthoredTestsOutputSchema = zod_1.z.object({
|
|
9
10
|
latestAuthoredTests: zod_1.z
|
|
10
11
|
.array(testUtils_1.testOutputSchema)
|
|
11
12
|
.describe('Array of latest tests authored by the current user'),
|
|
@@ -22,7 +23,7 @@ const getLatestAuthoredTests = (0, mcpMablTool_1.defineTool)({
|
|
|
22
23
|
.describe('Maximum number of tests to return (default: 10)'),
|
|
23
24
|
}),
|
|
24
25
|
type: 'readOnly',
|
|
25
|
-
outputSchema: getLatestAuthoredTestsOutputSchema,
|
|
26
|
+
outputSchema: exports.getLatestAuthoredTestsOutputSchema,
|
|
26
27
|
},
|
|
27
28
|
handle: async (args, mablApiClient, _server, workspaceId) => {
|
|
28
29
|
const limit = args.limit || 10;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTestResultsOutputSchema = void 0;
|
|
3
4
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
const mablApi_1 = require("../../../../mablApi");
|
|
6
7
|
const common_1 = require("./common");
|
|
8
|
+
exports.getTestResultsOutputSchema = zod_1.z.object({
|
|
9
|
+
testResults: zod_1.z.array(zod_1.z.object({
|
|
10
|
+
testRunId: zod_1.z.string().nullable(),
|
|
11
|
+
environmentId: zod_1.z.string().nullable(),
|
|
12
|
+
status: zod_1.z.string().nullable(),
|
|
13
|
+
completedTimeMs: zod_1.z.number().nullable(),
|
|
14
|
+
errorMessage: zod_1.z.string(),
|
|
15
|
+
})),
|
|
16
|
+
});
|
|
7
17
|
const getTestResults = (0, mcpMablTool_1.defineTool)({
|
|
8
18
|
schema: {
|
|
9
19
|
name: 'get-test-results',
|
|
@@ -15,15 +25,7 @@ const getTestResults = (0, mcpMablTool_1.defineTool)({
|
|
|
15
25
|
.describe('The id of the mabl test to get recent results of'),
|
|
16
26
|
}),
|
|
17
27
|
type: 'readOnly',
|
|
18
|
-
outputSchema:
|
|
19
|
-
testResults: zod_1.z.array(zod_1.z.object({
|
|
20
|
-
testRunId: zod_1.z.string().nullable(),
|
|
21
|
-
environmentId: zod_1.z.string().nullable(),
|
|
22
|
-
status: zod_1.z.string().nullable(),
|
|
23
|
-
completedTimeMs: zod_1.z.number().nullable(),
|
|
24
|
-
errorMessage: zod_1.z.string(),
|
|
25
|
-
})),
|
|
26
|
-
}),
|
|
28
|
+
outputSchema: exports.getTestResultsOutputSchema,
|
|
27
29
|
},
|
|
28
30
|
handle: async (params, mablApiClient, _, workspaceId) => {
|
|
29
31
|
const testId = params.testId;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTestsOutputSchema = void 0;
|
|
3
4
|
const common_1 = require("./common");
|
|
4
5
|
const testUtils_1 = require("../utils/testUtils");
|
|
5
6
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
6
7
|
const zod_1 = require("zod");
|
|
7
|
-
|
|
8
|
+
exports.getTestsOutputSchema = zod_1.z.object({
|
|
8
9
|
tests: zod_1.z.array(zod_1.z.object({
|
|
9
10
|
id: zod_1.z.string().optional(),
|
|
10
11
|
name: zod_1.z.string().optional(),
|
|
@@ -32,7 +33,7 @@ const getTests = (0, mcpMablTool_1.defineTool)({
|
|
|
32
33
|
.optional(),
|
|
33
34
|
}),
|
|
34
35
|
type: 'readOnly',
|
|
35
|
-
outputSchema: getTestsOutputSchema,
|
|
36
|
+
outputSchema: exports.getTestsOutputSchema,
|
|
36
37
|
},
|
|
37
38
|
handle: async (params, mablApiClient, _server, workspaceId) => {
|
|
38
39
|
const limit = 1_000;
|
|
@@ -45,7 +46,7 @@ const getTests = (0, mcpMablTool_1.defineTool)({
|
|
|
45
46
|
name: test.test_name ?? '',
|
|
46
47
|
description: test.test_description ?? '',
|
|
47
48
|
type: test.test_type ?? '',
|
|
48
|
-
|
|
49
|
+
stepsChunks: test.test_step_chunks.map((stepChunk) => ({
|
|
49
50
|
annotatedStepDescriptions: stepChunk.annotated_step_descriptions ?? '',
|
|
50
51
|
context: stepChunk.context ?? '',
|
|
51
52
|
})),
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWorkspacesOutputSchema = void 0;
|
|
3
4
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
4
5
|
const zod_1 = require("zod");
|
|
6
|
+
exports.getWorkspacesOutputSchema = zod_1.z.object({
|
|
7
|
+
workspaces: zod_1.z.array(zod_1.z.object({
|
|
8
|
+
id: zod_1.z.string().describe('The workspace ID'),
|
|
9
|
+
name: zod_1.z.string().describe('The workspace name'),
|
|
10
|
+
})),
|
|
11
|
+
currentWorkspaceId: zod_1.z.string().describe('The currently active workspace ID'),
|
|
12
|
+
});
|
|
5
13
|
const getWorkspaces = (0, mcpMablTool_1.defineTool)({
|
|
6
14
|
schema: {
|
|
7
15
|
name: 'get-workspaces',
|
|
@@ -13,15 +21,7 @@ const getWorkspaces = (0, mcpMablTool_1.defineTool)({
|
|
|
13
21
|
.optional()
|
|
14
22
|
.describe('The maximum number of workspaces to return (default: 50)'),
|
|
15
23
|
}),
|
|
16
|
-
outputSchema:
|
|
17
|
-
workspaces: zod_1.z.array(zod_1.z.object({
|
|
18
|
-
id: zod_1.z.string().describe('The workspace ID'),
|
|
19
|
-
name: zod_1.z.string().describe('The workspace name'),
|
|
20
|
-
})),
|
|
21
|
-
currentWorkspaceId: zod_1.z
|
|
22
|
-
.string()
|
|
23
|
-
.describe('The currently active workspace ID'),
|
|
24
|
-
}),
|
|
24
|
+
outputSchema: exports.getWorkspacesOutputSchema,
|
|
25
25
|
type: 'readOnly',
|
|
26
26
|
},
|
|
27
27
|
handle: async (args, mablApiClient, _server, workspaceId) => {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mcpToolInterceptor = mcpToolInterceptor;
|
|
4
|
+
const analytics_1 = require("../../../../util/analytics");
|
|
5
|
+
function mcpToolInterceptor(toolName) {
|
|
6
|
+
(0, analytics_1.trackMcpEvent)(toolName).catch((error) => console.error('Error with analytics event', error));
|
|
7
|
+
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineTool = defineTool;
|
|
4
|
+
const interceptor_1 = require("./interceptor");
|
|
4
5
|
function defineTool(tool) {
|
|
5
|
-
|
|
6
|
+
const originalHandle = tool.handle;
|
|
7
|
+
return {
|
|
8
|
+
...tool,
|
|
9
|
+
handle: (params, apiClient, server, workspaceId) => {
|
|
10
|
+
(0, interceptor_1.mcpToolInterceptor)(tool.schema.name);
|
|
11
|
+
return originalHandle(params, apiClient, server, workspaceId);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
6
14
|
}
|