@mablhq/mabl-cli 2.70.18 → 2.70.20
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/api/mablApiClient.js
CHANGED
|
@@ -12,12 +12,22 @@ const cliConfigProvider_1 = require("../providers/cliConfigProvider");
|
|
|
12
12
|
const basicApiClient_1 = require("./basicApiClient");
|
|
13
13
|
const query_string_1 = __importDefault(require("query-string"));
|
|
14
14
|
const featureSet_1 = require("./featureSet");
|
|
15
|
+
const AGENT_API_URL_DEV = 'https://agent-api-172599862372.us-central1.run.app';
|
|
16
|
+
const AGENT_API_URL_PROD = 'https://agent-api-259397947092.us-central1.run.app';
|
|
15
17
|
class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
16
18
|
constructor(options) {
|
|
17
19
|
super(options);
|
|
18
20
|
this.baseApiUrl =
|
|
19
21
|
options.apiUrl ?? process.env.MABL_API_URL ?? env_1.BASE_API_URL;
|
|
20
|
-
this.
|
|
22
|
+
if (this.baseApiUrl.includes('api-dev.internal')) {
|
|
23
|
+
this.baseApiAgentUrl = AGENT_API_URL_DEV;
|
|
24
|
+
}
|
|
25
|
+
else if (this.baseApiUrl.includes('api.internal')) {
|
|
26
|
+
this.baseApiAgentUrl = AGENT_API_URL_PROD;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.baseApiAgentUrl = this.baseApiUrl;
|
|
30
|
+
}
|
|
21
31
|
}
|
|
22
32
|
async getPlan(planId) {
|
|
23
33
|
try {
|
|
@@ -14,12 +14,14 @@ const getPlanResults = (0, mcpMablTool_1.defineTool)({
|
|
|
14
14
|
.describe('The id of the mabl plan to get recent results of'),
|
|
15
15
|
}),
|
|
16
16
|
type: 'readOnly',
|
|
17
|
-
outputSchema: zod_1.z.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
outputSchema: zod_1.z.object({
|
|
18
|
+
planResults: zod_1.z.array(zod_1.z.object({
|
|
19
|
+
planRunId: zod_1.z.string().nullable(),
|
|
20
|
+
status: zod_1.z.string().nullable(),
|
|
21
|
+
completedTimeMs: zod_1.z.number().nullable(),
|
|
22
|
+
errorMessage: zod_1.z.string(),
|
|
23
|
+
})),
|
|
24
|
+
}),
|
|
23
25
|
},
|
|
24
26
|
handle: async (params, mablApiClient, _, workspaceId) => {
|
|
25
27
|
const planId = params.planId;
|
|
@@ -62,10 +64,10 @@ const getPlanResults = (0, mcpMablTool_1.defineTool)({
|
|
|
62
64
|
content: [
|
|
63
65
|
{
|
|
64
66
|
type: 'text',
|
|
65
|
-
text: JSON.stringify(processedResults),
|
|
67
|
+
text: JSON.stringify({ planResults: processedResults }),
|
|
66
68
|
},
|
|
67
69
|
],
|
|
68
|
-
structuredContent: processedResults,
|
|
70
|
+
structuredContent: { planResults: processedResults },
|
|
69
71
|
};
|
|
70
72
|
},
|
|
71
73
|
});
|
|
@@ -14,13 +14,15 @@ const getTestResults = (0, mcpMablTool_1.defineTool)({
|
|
|
14
14
|
.describe('The id of the mabl test to get recent results of'),
|
|
15
15
|
}),
|
|
16
16
|
type: 'readOnly',
|
|
17
|
-
outputSchema: zod_1.z.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
outputSchema: zod_1.z.object({
|
|
18
|
+
testResults: zod_1.z.array(zod_1.z.object({
|
|
19
|
+
testRunId: zod_1.z.string().nullable(),
|
|
20
|
+
environmentId: zod_1.z.string().nullable(),
|
|
21
|
+
status: zod_1.z.string().nullable(),
|
|
22
|
+
completedTimeMs: zod_1.z.number().nullable(),
|
|
23
|
+
errorMessage: zod_1.z.string(),
|
|
24
|
+
})),
|
|
25
|
+
}),
|
|
24
26
|
},
|
|
25
27
|
handle: async (params, mablApiClient, _, workspaceId) => {
|
|
26
28
|
const testId = params.testId;
|
|
@@ -64,10 +66,10 @@ const getTestResults = (0, mcpMablTool_1.defineTool)({
|
|
|
64
66
|
content: [
|
|
65
67
|
{
|
|
66
68
|
type: 'text',
|
|
67
|
-
text: JSON.stringify(processedResults),
|
|
69
|
+
text: JSON.stringify({ testResults: processedResults }),
|
|
68
70
|
},
|
|
69
71
|
],
|
|
70
|
-
structuredContent: processedResults,
|
|
72
|
+
structuredContent: { testResults: processedResults },
|
|
71
73
|
};
|
|
72
74
|
},
|
|
73
75
|
});
|