@debugg-ai/debugg-ai-mcp 2.9.2 → 2.9.7
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/dist/services/workflows.js +23 -10
- package/dist/utils/axiosTransport.js +5 -1
- package/dist/utils/errors.js +12 -2
- package/package.json +5 -1
|
@@ -15,18 +15,31 @@ const EXECUTION_TIMEOUT_MS = 10 * 60 * 1000; // 10 min
|
|
|
15
15
|
export const createWorkflowsService = (tx) => {
|
|
16
16
|
const service = {
|
|
17
17
|
async findTemplateByName(keyword) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
// Narrow server-side with `search` AND walk every page. The backend caps
|
|
19
|
+
// the page size (it ignores page_size), so reading only page 1 silently
|
|
20
|
+
// hides templates that sort later — that bug made check_app_in_browser
|
|
21
|
+
// fail in prod because "App Evaluation Workflow Template" sat on page 2.
|
|
22
|
+
// `search` collapses the candidate set to one page on backends that
|
|
23
|
+
// support it; `page` paging is the fallback for those that ignore it.
|
|
22
24
|
const needle = keyword.toLowerCase();
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const seenNames = [];
|
|
26
|
+
const MAX_PAGES = 50; // safety valve against a backend that always returns `next`
|
|
27
|
+
for (let page = 1; page <= MAX_PAGES; page++) {
|
|
28
|
+
const response = await tx.get('api/v1/workflows/', { isTemplate: true, search: keyword, page });
|
|
29
|
+
const templates = response?.results ?? [];
|
|
30
|
+
for (const t of templates) {
|
|
31
|
+
seenNames.push(t.name);
|
|
32
|
+
if (t.name.toLowerCase().includes(needle))
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
if (!response?.next)
|
|
36
|
+
break;
|
|
28
37
|
}
|
|
29
|
-
|
|
38
|
+
if (seenNames.length === 0)
|
|
39
|
+
return null;
|
|
40
|
+
throw new Error(`No workflow template matching "${keyword}" found. ` +
|
|
41
|
+
`Available templates: ${seenNames.map(n => `"${n}"`).join(', ')}. ` +
|
|
42
|
+
`Ensure the backend has a template with "${keyword}" in its name.`);
|
|
30
43
|
},
|
|
31
44
|
async findEvaluationTemplate() {
|
|
32
45
|
// 'app evaluation workflow' is specific enough to skip 'App Evaluation Brain'
|
|
@@ -29,9 +29,13 @@ export class AxiosTransport {
|
|
|
29
29
|
}, (err) => {
|
|
30
30
|
const data = err.response?.data;
|
|
31
31
|
if (data) {
|
|
32
|
+
const strField = (v) => typeof v === 'string' && v ? v : null;
|
|
32
33
|
const msg = typeof data === 'string'
|
|
33
34
|
? data
|
|
34
|
-
: data.detail
|
|
35
|
+
: strField(data.detail) ??
|
|
36
|
+
strField(data.message) ??
|
|
37
|
+
strField(data.error) ??
|
|
38
|
+
JSON.stringify(data);
|
|
35
39
|
const newErr = new Error(String(msg));
|
|
36
40
|
newErr.statusCode = err.response?.status;
|
|
37
41
|
newErr.responseData = data;
|
package/dist/utils/errors.js
CHANGED
|
@@ -95,8 +95,18 @@ export function handleExternalServiceError(error, serviceName, operation) {
|
|
|
95
95
|
originalError: error.message
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
// Non-Error thrown value — serialize properly so the caller can diagnose.
|
|
99
|
+
// String(plainObj) → "[object Object]"; JSON.stringify exposes the fields.
|
|
100
|
+
const serialized = (() => {
|
|
101
|
+
try {
|
|
102
|
+
return JSON.stringify(error);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return String(error);
|
|
106
|
+
}
|
|
107
|
+
})();
|
|
108
|
+
logger.error('Unknown external service error', { serviceName, operation, error: serialized });
|
|
109
|
+
return new MCPError(MCPErrorCode.EXTERNAL_SERVICE_ERROR, `${serviceName} error: ${serialized}`, { serviceName, operation, originalError: serialized });
|
|
100
110
|
}
|
|
101
111
|
/**
|
|
102
112
|
* Check if error is retryable
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debugg-ai/debugg-ai-mcp",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.7",
|
|
4
4
|
"description": "Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
],
|
|
49
49
|
"author": "Quinn Osha",
|
|
50
50
|
"license": "Apache-2.0",
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/debugg-ai/debugg-ai-mcp.git"
|
|
54
|
+
},
|
|
51
55
|
"homepage": "https://debugg.ai",
|
|
52
56
|
"bugs": "https://github.com/debugg-ai/debugg-ai-mcp/issues",
|
|
53
57
|
"changelog": "https://github.com/debugg-ai/debugg-ai-mcp/CHANGELOG.md",
|