@debugg-ai/debugg-ai-mcp 1.0.62 → 1.0.64
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/config/index.js +4 -1
- package/dist/handlers/createEnvironmentHandler.js +33 -0
- package/dist/handlers/createProjectHandler.js +62 -10
- package/dist/handlers/index.js +5 -14
- package/dist/handlers/searchEnvironmentsHandler.js +122 -0
- package/dist/handlers/searchExecutionsHandler.js +71 -0
- package/dist/handlers/searchProjectsHandler.js +72 -0
- package/dist/handlers/testPageChangesHandler.js +46 -5
- package/dist/handlers/triggerCrawlHandler.js +208 -0
- package/dist/handlers/updateEnvironmentHandler.js +94 -15
- package/dist/index.js +15 -2
- package/dist/services/workflows.js +10 -6
- package/dist/tools/createEnvironment.js +5 -1
- package/dist/tools/index.js +12 -42
- package/dist/tools/searchEnvironments.js +35 -0
- package/dist/tools/searchExecutions.js +31 -0
- package/dist/tools/searchProjects.js +30 -0
- package/dist/tools/triggerCrawl.js +99 -0
- package/dist/types/index.js +64 -71
- package/package.json +4 -1
- package/dist/handlers/cancelExecutionHandler.js +0 -41
- package/dist/handlers/createCredentialHandler.js +0 -60
- package/dist/handlers/deleteCredentialHandler.js +0 -51
- package/dist/handlers/getCredentialHandler.js +0 -49
- package/dist/handlers/getEnvironmentHandler.js +0 -49
- package/dist/handlers/getExecutionHandler.js +0 -37
- package/dist/handlers/getProjectHandler.js +0 -37
- package/dist/handlers/listCredentialsHandler.js +0 -93
- package/dist/handlers/listEnvironmentsHandler.js +0 -63
- package/dist/handlers/listExecutionsHandler.js +0 -35
- package/dist/handlers/listProjectsHandler.js +0 -32
- package/dist/handlers/listReposHandler.js +0 -27
- package/dist/handlers/listTeamsHandler.js +0 -27
- package/dist/handlers/updateCredentialHandler.js +0 -70
- package/dist/tools/cancelExecution.js +0 -22
- package/dist/tools/createCredential.js +0 -52
- package/dist/tools/deleteCredential.js +0 -24
- package/dist/tools/getCredential.js +0 -24
- package/dist/tools/getEnvironment.js +0 -23
- package/dist/tools/getExecution.js +0 -22
- package/dist/tools/getProject.js +0 -22
- package/dist/tools/listCredentials.js +0 -30
- package/dist/tools/listEnvironments.js +0 -28
- package/dist/tools/listExecutions.js +0 -24
- package/dist/tools/listProjects.js +0 -27
- package/dist/tools/listRepos.js +0 -23
- package/dist/tools/listTeams.js +0 -23
- package/dist/tools/updateCredential.js +0 -28
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../utils/logger.js';
|
|
2
|
-
import { handleExternalServiceError } from '../utils/errors.js';
|
|
3
|
-
import { DebuggAIServerClient } from '../services/index.js';
|
|
4
|
-
import { config } from '../config/index.js';
|
|
5
|
-
import { detectRepoName } from '../utils/gitContext.js';
|
|
6
|
-
import { toPaginationParams, makePageInfo } from '../utils/pagination.js';
|
|
7
|
-
const logger = new Logger({ module: 'listCredentialsHandler' });
|
|
8
|
-
export async function listCredentialsHandler(input, _context) {
|
|
9
|
-
const start = Date.now();
|
|
10
|
-
const pagination = toPaginationParams({ page: input.page, pageSize: input.pageSize });
|
|
11
|
-
logger.toolStart('list_credentials', {
|
|
12
|
-
environmentId: input.environmentId,
|
|
13
|
-
projectUuid: input.projectUuid,
|
|
14
|
-
q: input.q,
|
|
15
|
-
role: input.role,
|
|
16
|
-
...pagination,
|
|
17
|
-
});
|
|
18
|
-
try {
|
|
19
|
-
const client = new DebuggAIServerClient(config.api.key);
|
|
20
|
-
await client.init();
|
|
21
|
-
let projectUuid = input.projectUuid;
|
|
22
|
-
if (!projectUuid) {
|
|
23
|
-
const repoName = detectRepoName();
|
|
24
|
-
if (!repoName) {
|
|
25
|
-
const payload = {
|
|
26
|
-
error: 'NoProjectResolved',
|
|
27
|
-
message: 'No git repo detected and no projectUuid provided. Pass projectUuid (get it from list_projects) or invoke from a directory with a git origin.',
|
|
28
|
-
pageInfo: makePageInfo(pagination.page, pagination.pageSize, 0, null),
|
|
29
|
-
credentials: [],
|
|
30
|
-
};
|
|
31
|
-
logger.toolComplete('list_credentials', Date.now() - start);
|
|
32
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
33
|
-
}
|
|
34
|
-
const project = await client.findProjectByRepoName(repoName);
|
|
35
|
-
if (!project) {
|
|
36
|
-
const payload = {
|
|
37
|
-
error: 'NoProjectResolved',
|
|
38
|
-
message: `No DebuggAI project found for repo "${repoName}". Pass projectUuid explicitly.`,
|
|
39
|
-
pageInfo: makePageInfo(pagination.page, pagination.pageSize, 0, null),
|
|
40
|
-
credentials: [],
|
|
41
|
-
};
|
|
42
|
-
logger.toolComplete('list_credentials', Date.now() - start);
|
|
43
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
44
|
-
}
|
|
45
|
-
projectUuid = project.uuid;
|
|
46
|
-
}
|
|
47
|
-
let pageInfo;
|
|
48
|
-
let credentials = [];
|
|
49
|
-
if (input.environmentId) {
|
|
50
|
-
// Paginated path — scoped to a single env.
|
|
51
|
-
const result = await client.listCredentialsPaginated(projectUuid, input.environmentId, pagination, input.q, input.role);
|
|
52
|
-
pageInfo = result.pageInfo;
|
|
53
|
-
credentials = result.credentials;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
// No env filter — iterate all envs and merge. Synthesize pageInfo from the full
|
|
57
|
-
// result (client-side paginate the merged list for consistent shape).
|
|
58
|
-
const envs = await client.listEnvironmentsForProject(projectUuid);
|
|
59
|
-
const all = [];
|
|
60
|
-
for (const env of envs) {
|
|
61
|
-
const credsForEnv = await client.listCredentialsForEnvironment(projectUuid, env.uuid, input.q, input.role);
|
|
62
|
-
all.push(...credsForEnv);
|
|
63
|
-
}
|
|
64
|
-
const offset = (pagination.page - 1) * pagination.pageSize;
|
|
65
|
-
credentials = all.slice(offset, offset + pagination.pageSize);
|
|
66
|
-
const totalCount = all.length;
|
|
67
|
-
const totalPages = totalCount === 0 ? 0 : Math.ceil(totalCount / pagination.pageSize);
|
|
68
|
-
pageInfo = {
|
|
69
|
-
page: pagination.page,
|
|
70
|
-
pageSize: pagination.pageSize,
|
|
71
|
-
totalCount,
|
|
72
|
-
totalPages,
|
|
73
|
-
hasMore: offset + credentials.length < totalCount,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
const payload = {
|
|
77
|
-
project: { uuid: projectUuid },
|
|
78
|
-
filter: {
|
|
79
|
-
environmentId: input.environmentId ?? null,
|
|
80
|
-
q: input.q ?? null,
|
|
81
|
-
role: input.role ?? null,
|
|
82
|
-
},
|
|
83
|
-
pageInfo,
|
|
84
|
-
credentials,
|
|
85
|
-
};
|
|
86
|
-
logger.toolComplete('list_credentials', Date.now() - start);
|
|
87
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
logger.toolError('list_credentials', error, Date.now() - start);
|
|
91
|
-
throw handleExternalServiceError(error, 'DebuggAI', 'list_credentials');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../utils/logger.js';
|
|
2
|
-
import { handleExternalServiceError } from '../utils/errors.js';
|
|
3
|
-
import { DebuggAIServerClient } from '../services/index.js';
|
|
4
|
-
import { config } from '../config/index.js';
|
|
5
|
-
import { detectRepoName } from '../utils/gitContext.js';
|
|
6
|
-
import { toPaginationParams, makePageInfo } from '../utils/pagination.js';
|
|
7
|
-
const logger = new Logger({ module: 'listEnvironmentsHandler' });
|
|
8
|
-
export async function listEnvironmentsHandler(input, _context) {
|
|
9
|
-
const start = Date.now();
|
|
10
|
-
const pagination = toPaginationParams({ page: input.page, pageSize: input.pageSize });
|
|
11
|
-
logger.toolStart('list_environments', { projectUuid: input.projectUuid, q: input.q, ...pagination });
|
|
12
|
-
try {
|
|
13
|
-
const client = new DebuggAIServerClient(config.api.key);
|
|
14
|
-
await client.init();
|
|
15
|
-
let projectUuid = input.projectUuid;
|
|
16
|
-
let projectName = null;
|
|
17
|
-
let projectRepoName = null;
|
|
18
|
-
if (!projectUuid) {
|
|
19
|
-
const repoName = detectRepoName();
|
|
20
|
-
if (!repoName) {
|
|
21
|
-
const payload = {
|
|
22
|
-
error: 'NoProjectResolved',
|
|
23
|
-
message: 'No git repo detected and no projectUuid provided. Pass projectUuid (get it from list_projects) or invoke from a directory with a git origin.',
|
|
24
|
-
pageInfo: makePageInfo(pagination.page, pagination.pageSize, 0, null),
|
|
25
|
-
environments: [],
|
|
26
|
-
};
|
|
27
|
-
logger.toolComplete('list_environments', Date.now() - start);
|
|
28
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
29
|
-
}
|
|
30
|
-
const project = await client.findProjectByRepoName(repoName);
|
|
31
|
-
if (!project) {
|
|
32
|
-
const payload = {
|
|
33
|
-
error: 'NoProjectResolved',
|
|
34
|
-
message: `No DebuggAI project found for repo "${repoName}". Pass projectUuid explicitly or call list_projects to discover.`,
|
|
35
|
-
pageInfo: makePageInfo(pagination.page, pagination.pageSize, 0, null),
|
|
36
|
-
environments: [],
|
|
37
|
-
};
|
|
38
|
-
logger.toolComplete('list_environments', Date.now() - start);
|
|
39
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
40
|
-
}
|
|
41
|
-
projectUuid = project.uuid;
|
|
42
|
-
projectName = project.name;
|
|
43
|
-
projectRepoName = project.repo?.name ?? repoName;
|
|
44
|
-
}
|
|
45
|
-
const { pageInfo, environments } = await client.listEnvironmentsPaginated(projectUuid, pagination, input.q);
|
|
46
|
-
const payload = {
|
|
47
|
-
project: {
|
|
48
|
-
uuid: projectUuid,
|
|
49
|
-
name: projectName,
|
|
50
|
-
repoName: projectRepoName,
|
|
51
|
-
},
|
|
52
|
-
filter: { q: input.q ?? null },
|
|
53
|
-
pageInfo,
|
|
54
|
-
environments,
|
|
55
|
-
};
|
|
56
|
-
logger.toolComplete('list_environments', Date.now() - start);
|
|
57
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
logger.toolError('list_environments', error, Date.now() - start);
|
|
61
|
-
throw handleExternalServiceError(error, 'DebuggAI', 'list_environments');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../utils/logger.js';
|
|
2
|
-
import { handleExternalServiceError } from '../utils/errors.js';
|
|
3
|
-
import { DebuggAIServerClient } from '../services/index.js';
|
|
4
|
-
import { config } from '../config/index.js';
|
|
5
|
-
import { toPaginationParams } from '../utils/pagination.js';
|
|
6
|
-
const logger = new Logger({ module: 'listExecutionsHandler' });
|
|
7
|
-
export async function listExecutionsHandler(input, _context) {
|
|
8
|
-
const start = Date.now();
|
|
9
|
-
const pagination = toPaginationParams({ page: input.page, pageSize: input.pageSize });
|
|
10
|
-
logger.toolStart('list_executions', { status: input.status, projectUuid: input.projectUuid, ...pagination });
|
|
11
|
-
try {
|
|
12
|
-
const client = new DebuggAIServerClient(config.api.key);
|
|
13
|
-
await client.init();
|
|
14
|
-
const { pageInfo, executions } = await client.workflows.listExecutions({
|
|
15
|
-
status: input.status,
|
|
16
|
-
projectId: input.projectUuid,
|
|
17
|
-
page: pagination.page,
|
|
18
|
-
pageSize: pagination.pageSize,
|
|
19
|
-
});
|
|
20
|
-
const payload = {
|
|
21
|
-
filter: {
|
|
22
|
-
status: input.status ?? null,
|
|
23
|
-
projectUuid: input.projectUuid ?? null,
|
|
24
|
-
},
|
|
25
|
-
pageInfo,
|
|
26
|
-
executions,
|
|
27
|
-
};
|
|
28
|
-
logger.toolComplete('list_executions', Date.now() - start);
|
|
29
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
logger.toolError('list_executions', error, Date.now() - start);
|
|
33
|
-
throw handleExternalServiceError(error, 'DebuggAI', 'list_executions');
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../utils/logger.js';
|
|
2
|
-
import { handleExternalServiceError } from '../utils/errors.js';
|
|
3
|
-
import { DebuggAIServerClient } from '../services/index.js';
|
|
4
|
-
import { config } from '../config/index.js';
|
|
5
|
-
import { toPaginationParams } from '../utils/pagination.js';
|
|
6
|
-
const logger = new Logger({ module: 'listProjectsHandler' });
|
|
7
|
-
export async function listProjectsHandler(input, _context) {
|
|
8
|
-
const start = Date.now();
|
|
9
|
-
const pagination = toPaginationParams({ page: input.page, pageSize: input.pageSize });
|
|
10
|
-
logger.toolStart('list_projects', { q: input.q, ...pagination });
|
|
11
|
-
try {
|
|
12
|
-
const client = new DebuggAIServerClient(config.api.key);
|
|
13
|
-
await client.init();
|
|
14
|
-
const { pageInfo, projects } = await client.listProjects(pagination, input.q);
|
|
15
|
-
const payload = {
|
|
16
|
-
filter: { q: input.q ?? null },
|
|
17
|
-
pageInfo,
|
|
18
|
-
projects: projects.map(p => ({
|
|
19
|
-
uuid: p.uuid,
|
|
20
|
-
name: p.name,
|
|
21
|
-
slug: p.slug,
|
|
22
|
-
repoName: p.repo?.name ?? null,
|
|
23
|
-
})),
|
|
24
|
-
};
|
|
25
|
-
logger.toolComplete('list_projects', Date.now() - start);
|
|
26
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
logger.toolError('list_projects', error, Date.now() - start);
|
|
30
|
-
throw handleExternalServiceError(error, 'DebuggAI', 'list_projects');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../utils/logger.js';
|
|
2
|
-
import { handleExternalServiceError } from '../utils/errors.js';
|
|
3
|
-
import { DebuggAIServerClient } from '../services/index.js';
|
|
4
|
-
import { config } from '../config/index.js';
|
|
5
|
-
import { toPaginationParams } from '../utils/pagination.js';
|
|
6
|
-
const logger = new Logger({ module: 'listReposHandler' });
|
|
7
|
-
export async function listReposHandler(input, _context) {
|
|
8
|
-
const start = Date.now();
|
|
9
|
-
const pagination = toPaginationParams({ page: input.page, pageSize: input.pageSize });
|
|
10
|
-
logger.toolStart('list_repos', { q: input.q, ...pagination });
|
|
11
|
-
try {
|
|
12
|
-
const client = new DebuggAIServerClient(config.api.key);
|
|
13
|
-
await client.init();
|
|
14
|
-
const { pageInfo, repos } = await client.listRepos(pagination, input.q);
|
|
15
|
-
const payload = {
|
|
16
|
-
filter: { q: input.q ?? null },
|
|
17
|
-
pageInfo,
|
|
18
|
-
repos,
|
|
19
|
-
};
|
|
20
|
-
logger.toolComplete('list_repos', Date.now() - start);
|
|
21
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
logger.toolError('list_repos', error, Date.now() - start);
|
|
25
|
-
throw handleExternalServiceError(error, 'DebuggAI', 'list_repos');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../utils/logger.js';
|
|
2
|
-
import { handleExternalServiceError } from '../utils/errors.js';
|
|
3
|
-
import { DebuggAIServerClient } from '../services/index.js';
|
|
4
|
-
import { config } from '../config/index.js';
|
|
5
|
-
import { toPaginationParams } from '../utils/pagination.js';
|
|
6
|
-
const logger = new Logger({ module: 'listTeamsHandler' });
|
|
7
|
-
export async function listTeamsHandler(input, _context) {
|
|
8
|
-
const start = Date.now();
|
|
9
|
-
const pagination = toPaginationParams({ page: input.page, pageSize: input.pageSize });
|
|
10
|
-
logger.toolStart('list_teams', { q: input.q, ...pagination });
|
|
11
|
-
try {
|
|
12
|
-
const client = new DebuggAIServerClient(config.api.key);
|
|
13
|
-
await client.init();
|
|
14
|
-
const { pageInfo, teams } = await client.listTeams(pagination, input.q);
|
|
15
|
-
const payload = {
|
|
16
|
-
filter: { q: input.q ?? null },
|
|
17
|
-
pageInfo,
|
|
18
|
-
teams,
|
|
19
|
-
};
|
|
20
|
-
logger.toolComplete('list_teams', Date.now() - start);
|
|
21
|
-
return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
logger.toolError('list_teams', error, Date.now() - start);
|
|
25
|
-
throw handleExternalServiceError(error, 'DebuggAI', 'list_teams');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../utils/logger.js';
|
|
2
|
-
import { handleExternalServiceError } from '../utils/errors.js';
|
|
3
|
-
import { DebuggAIServerClient } from '../services/index.js';
|
|
4
|
-
import { config } from '../config/index.js';
|
|
5
|
-
import { detectRepoName } from '../utils/gitContext.js';
|
|
6
|
-
const logger = new Logger({ module: 'updateCredentialHandler' });
|
|
7
|
-
function notFound(uuid, context) {
|
|
8
|
-
return {
|
|
9
|
-
content: [{ type: 'text', text: JSON.stringify({
|
|
10
|
-
error: 'NotFound',
|
|
11
|
-
message: `Credential ${uuid} not found (${context}).`,
|
|
12
|
-
uuid,
|
|
13
|
-
}, null, 2) }],
|
|
14
|
-
isError: true,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
// Defensive stripper: ensure no password/secret keys slip through into responses.
|
|
18
|
-
function stripSecrets(obj) {
|
|
19
|
-
const copy = { ...obj };
|
|
20
|
-
delete copy.password;
|
|
21
|
-
delete copy.secret;
|
|
22
|
-
return copy;
|
|
23
|
-
}
|
|
24
|
-
export async function updateCredentialHandler(input, _context) {
|
|
25
|
-
const start = Date.now();
|
|
26
|
-
logger.toolStart('update_credential', {
|
|
27
|
-
uuid: input.uuid,
|
|
28
|
-
environmentId: input.environmentId,
|
|
29
|
-
patchKeys: Object.keys(input).filter(k => !['uuid', 'environmentId', 'projectUuid', 'password'].includes(k)).concat(input.password !== undefined ? ['password'] : []),
|
|
30
|
-
});
|
|
31
|
-
try {
|
|
32
|
-
const client = new DebuggAIServerClient(config.api.key);
|
|
33
|
-
await client.init();
|
|
34
|
-
let projectUuid = input.projectUuid;
|
|
35
|
-
if (!projectUuid) {
|
|
36
|
-
const repoName = detectRepoName();
|
|
37
|
-
if (!repoName)
|
|
38
|
-
return notFound(input.uuid, 'no git repo and no projectUuid');
|
|
39
|
-
const project = await client.findProjectByRepoName(repoName);
|
|
40
|
-
if (!project)
|
|
41
|
-
return notFound(input.uuid, `no project for repo "${repoName}"`);
|
|
42
|
-
projectUuid = project.uuid;
|
|
43
|
-
}
|
|
44
|
-
try {
|
|
45
|
-
const credential = await client.updateCredential(projectUuid, input.environmentId, input.uuid, {
|
|
46
|
-
label: input.label,
|
|
47
|
-
username: input.username,
|
|
48
|
-
password: input.password,
|
|
49
|
-
role: input.role,
|
|
50
|
-
});
|
|
51
|
-
logger.toolComplete('update_credential', Date.now() - start);
|
|
52
|
-
return {
|
|
53
|
-
content: [{ type: 'text', text: JSON.stringify({
|
|
54
|
-
updated: true,
|
|
55
|
-
credential: stripSecrets(credential),
|
|
56
|
-
}, null, 2) }],
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
if (err?.statusCode === 404 || err?.response?.status === 404) {
|
|
61
|
-
return notFound(input.uuid, `backend 404 for env ${input.environmentId}`);
|
|
62
|
-
}
|
|
63
|
-
throw err;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
logger.toolError('update_credential', error, Date.now() - start);
|
|
68
|
-
throw handleExternalServiceError(error, 'DebuggAI', 'update_credential');
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CancelExecutionInputSchema } from '../types/index.js';
|
|
2
|
-
import { cancelExecutionHandler } from '../handlers/cancelExecutionHandler.js';
|
|
3
|
-
const DESCRIPTION = `Cancel an in-flight workflow execution by UUID. Returns {cancelled:true, uuid} on success. Returns isError:true + AlreadyCompleted when the execution is already done (backend 409). Returns isError:true + NotFound when uuid doesn't exist.`;
|
|
4
|
-
export function buildCancelExecutionTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'cancel_execution',
|
|
7
|
-
title: 'Cancel Workflow Execution',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
uuid: { type: 'string', description: 'Execution UUID. Required.' },
|
|
13
|
-
},
|
|
14
|
-
required: ['uuid'],
|
|
15
|
-
additionalProperties: false,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function buildValidatedCancelExecutionTool() {
|
|
20
|
-
const tool = buildCancelExecutionTool();
|
|
21
|
-
return { ...tool, inputSchema: CancelExecutionInputSchema, handler: cancelExecutionHandler };
|
|
22
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { CreateCredentialInputSchema } from '../types/index.js';
|
|
2
|
-
import { createCredentialHandler } from '../handlers/createCredentialHandler.js';
|
|
3
|
-
const DESCRIPTION = `Create a new credential under an environment. Required: environmentId, label, username, password. Optional role (e.g. "admin", "guest"). password is write-only — the response returns only uuid/label/username/role/environmentUuid, never the raw password. Defaults to the project resolved from the current git repo; pass projectUuid to target a different project (get UUIDs via list_projects). Returns the created credential's uuid for use with check_app_in_browser via credentialId.`;
|
|
4
|
-
export function buildCreateCredentialTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'create_credential',
|
|
7
|
-
title: 'Create Environment Credential',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
environmentId: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
description: 'UUID of the environment this credential belongs to. Required.',
|
|
15
|
-
},
|
|
16
|
-
label: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
description: 'Human-readable label for the credential (e.g. "Admin Account"). Required.',
|
|
19
|
-
minLength: 1,
|
|
20
|
-
},
|
|
21
|
-
username: {
|
|
22
|
-
type: 'string',
|
|
23
|
-
description: 'Username or email used to log in. Required.',
|
|
24
|
-
minLength: 1,
|
|
25
|
-
},
|
|
26
|
-
password: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
description: 'Password. Write-only — never echoed in any MCP tool response. Required.',
|
|
29
|
-
minLength: 1,
|
|
30
|
-
},
|
|
31
|
-
role: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'Optional: role string (e.g. "admin", "guest"). Persists on the credential and can be used with credentialRole resolution.',
|
|
34
|
-
},
|
|
35
|
-
projectUuid: {
|
|
36
|
-
type: 'string',
|
|
37
|
-
description: 'Optional: UUID of the target project. Defaults to the project resolved from the current git repo.',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
required: ['environmentId', 'label', 'username', 'password'],
|
|
41
|
-
additionalProperties: false,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export function buildValidatedCreateCredentialTool() {
|
|
46
|
-
const tool = buildCreateCredentialTool();
|
|
47
|
-
return {
|
|
48
|
-
...tool,
|
|
49
|
-
inputSchema: CreateCredentialInputSchema,
|
|
50
|
-
handler: createCredentialHandler,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { DeleteCredentialInputSchema } from '../types/index.js';
|
|
2
|
-
import { deleteCredentialHandler } from '../handlers/deleteCredentialHandler.js';
|
|
3
|
-
const DESCRIPTION = `Delete a credential by UUID. Returns {deleted:true, uuid}. Requires environmentId. Destructive — the credential is gone. Returns isError:true + NotFound when already deleted or uuid doesn't exist.`;
|
|
4
|
-
export function buildDeleteCredentialTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'delete_credential',
|
|
7
|
-
title: 'Delete Credential',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
uuid: { type: 'string', description: 'UUID of the credential. Required.' },
|
|
13
|
-
environmentId: { type: 'string', description: 'UUID of the environment the cred belongs to. Required.' },
|
|
14
|
-
projectUuid: { type: 'string', description: 'Optional: project UUID. Defaults to git-auto-detect.' },
|
|
15
|
-
},
|
|
16
|
-
required: ['uuid', 'environmentId'],
|
|
17
|
-
additionalProperties: false,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function buildValidatedDeleteCredentialTool() {
|
|
22
|
-
const tool = buildDeleteCredentialTool();
|
|
23
|
-
return { ...tool, inputSchema: DeleteCredentialInputSchema, handler: deleteCredentialHandler };
|
|
24
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { GetCredentialInputSchema } from '../types/index.js';
|
|
2
|
-
import { getCredentialHandler } from '../handlers/getCredentialHandler.js';
|
|
3
|
-
const DESCRIPTION = `Fetch a single credential by UUID. Returns {credential:{uuid,label,username,role,environmentUuid,environmentName,isActive,isDefault,description,timestamp,lastMod}}. Never returns the password. Requires environmentId. Returns isError:true + NotFound when the uuid doesn't exist.`;
|
|
4
|
-
export function buildGetCredentialTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'get_credential',
|
|
7
|
-
title: 'Get Credential by UUID',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
uuid: { type: 'string', description: 'UUID of the credential. Required.' },
|
|
13
|
-
environmentId: { type: 'string', description: 'UUID of the environment the cred belongs to. Required.' },
|
|
14
|
-
projectUuid: { type: 'string', description: 'Optional: project UUID. Defaults to git-auto-detect.' },
|
|
15
|
-
},
|
|
16
|
-
required: ['uuid', 'environmentId'],
|
|
17
|
-
additionalProperties: false,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function buildValidatedGetCredentialTool() {
|
|
22
|
-
const tool = buildGetCredentialTool();
|
|
23
|
-
return { ...tool, inputSchema: GetCredentialInputSchema, handler: getCredentialHandler };
|
|
24
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { GetEnvironmentInputSchema } from '../types/index.js';
|
|
2
|
-
import { getEnvironmentHandler } from '../handlers/getEnvironmentHandler.js';
|
|
3
|
-
const DESCRIPTION = `Fetch a single environment by UUID. Returns full detail (uuid, name, url, isActive, description, endpointType, activeUrl, timestamp, lastMod). Defaults to the project resolved from the current git repo; pass projectUuid to target a different project. Returns isError:true with NotFound when the uuid doesn't exist.`;
|
|
4
|
-
export function buildGetEnvironmentTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'get_environment',
|
|
7
|
-
title: 'Get Environment by UUID',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
uuid: { type: 'string', description: 'UUID of the environment to fetch. Required.' },
|
|
13
|
-
projectUuid: { type: 'string', description: 'Optional: UUID of the target project. Defaults to git-auto-detect.' },
|
|
14
|
-
},
|
|
15
|
-
required: ['uuid'],
|
|
16
|
-
additionalProperties: false,
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export function buildValidatedGetEnvironmentTool() {
|
|
21
|
-
const tool = buildGetEnvironmentTool();
|
|
22
|
-
return { ...tool, inputSchema: GetEnvironmentInputSchema, handler: getEnvironmentHandler };
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { GetExecutionInputSchema } from '../types/index.js';
|
|
2
|
-
import { getExecutionHandler } from '../handlers/getExecutionHandler.js';
|
|
3
|
-
const DESCRIPTION = `Fetch full detail for a single workflow execution. Returns {execution:{uuid,status,state,outcome,startedAt,completedAt,durationMs,nodeExecutions,executionSummary,errorInfo,contextData,...}}. Returns isError:true + NotFound when uuid doesn't exist.`;
|
|
4
|
-
export function buildGetExecutionTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'get_execution',
|
|
7
|
-
title: 'Get Execution Detail',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
uuid: { type: 'string', description: 'Execution UUID. Required.' },
|
|
13
|
-
},
|
|
14
|
-
required: ['uuid'],
|
|
15
|
-
additionalProperties: false,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function buildValidatedGetExecutionTool() {
|
|
20
|
-
const tool = buildGetExecutionTool();
|
|
21
|
-
return { ...tool, inputSchema: GetExecutionInputSchema, handler: getExecutionHandler };
|
|
22
|
-
}
|
package/dist/tools/getProject.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { GetProjectInputSchema } from '../types/index.js';
|
|
2
|
-
import { getProjectHandler } from '../handlers/getProjectHandler.js';
|
|
3
|
-
const DESCRIPTION = `Fetch a single project by UUID. Returns {project:{uuid,name,slug,platform,repoName,description,status,language,framework,timestamp,lastMod}}. Response is simplified — heavy internal fields (team, runner_configuration, github internals) are omitted. Returns isError:true + NotFound when uuid doesn't exist.`;
|
|
4
|
-
export function buildGetProjectTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'get_project',
|
|
7
|
-
title: 'Get Project by UUID',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
uuid: { type: 'string', description: 'UUID of the project. Required.' },
|
|
13
|
-
},
|
|
14
|
-
required: ['uuid'],
|
|
15
|
-
additionalProperties: false,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function buildValidatedGetProjectTool() {
|
|
20
|
-
const tool = buildGetProjectTool();
|
|
21
|
-
return { ...tool, inputSchema: GetProjectInputSchema, handler: getProjectHandler };
|
|
22
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ListCredentialsInputSchema } from '../types/index.js';
|
|
2
|
-
import { listCredentialsHandler } from '../handlers/listCredentialsHandler.js';
|
|
3
|
-
const DESCRIPTION = `List credentials for a DebuggAI project. Paginated when scoped to a single environment (pass environmentId); otherwise iterates all envs and returns everything with pageInfo reflecting the total. Default pageSize 20, max 200. Optional q filters label/username (client-side); role filters server-side. Never returns passwords.`;
|
|
4
|
-
export function buildListCredentialsTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'list_credentials',
|
|
7
|
-
title: 'List Project Credentials',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
environmentId: { type: 'string', description: 'Optional: filter to a single environment. Required for true pagination.' },
|
|
13
|
-
projectUuid: { type: 'string', description: 'Optional: UUID of the target project. Defaults to git-auto-detect.' },
|
|
14
|
-
q: { type: 'string', description: 'Optional: filter by label or username.' },
|
|
15
|
-
role: { type: 'string', description: 'Optional: filter by exact role match.' },
|
|
16
|
-
page: { type: 'number', description: 'Optional: 1-indexed page number. Default 1.', minimum: 1 },
|
|
17
|
-
pageSize: { type: 'number', description: 'Optional: items per page. Default 20, max 200.', minimum: 1, maximum: 200 },
|
|
18
|
-
},
|
|
19
|
-
additionalProperties: false,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export function buildValidatedListCredentialsTool() {
|
|
24
|
-
const tool = buildListCredentialsTool();
|
|
25
|
-
return {
|
|
26
|
-
...tool,
|
|
27
|
-
inputSchema: ListCredentialsInputSchema,
|
|
28
|
-
handler: listCredentialsHandler,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ListEnvironmentsInputSchema } from '../types/index.js';
|
|
2
|
-
import { listEnvironmentsHandler } from '../handlers/listEnvironmentsHandler.js';
|
|
3
|
-
const DESCRIPTION = `List environments for a DebuggAI project. Paginated — every response includes pageInfo {page, pageSize, totalCount, totalPages, hasMore}; default pageSize 20, max 200. By default targets the project resolved from the current git repo; pass projectUuid to target a different project. Optional q filters by environment name via backend search.`;
|
|
4
|
-
export function buildListEnvironmentsTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'list_environments',
|
|
7
|
-
title: 'List Project Environments',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
projectUuid: { type: 'string', description: 'Optional: UUID of the project to query. Defaults to git-auto-detect.' },
|
|
13
|
-
q: { type: 'string', description: 'Optional: filter by environment name.' },
|
|
14
|
-
page: { type: 'number', description: 'Optional: 1-indexed page number. Default 1.', minimum: 1 },
|
|
15
|
-
pageSize: { type: 'number', description: 'Optional: items per page. Default 20, max 200.', minimum: 1, maximum: 200 },
|
|
16
|
-
},
|
|
17
|
-
additionalProperties: false,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function buildValidatedListEnvironmentsTool() {
|
|
22
|
-
const tool = buildListEnvironmentsTool();
|
|
23
|
-
return {
|
|
24
|
-
...tool,
|
|
25
|
-
inputSchema: ListEnvironmentsInputSchema,
|
|
26
|
-
handler: listEnvironmentsHandler,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ListExecutionsInputSchema } from '../types/index.js';
|
|
2
|
-
import { listExecutionsHandler } from '../handlers/listExecutionsHandler.js';
|
|
3
|
-
const DESCRIPTION = `List workflow execution history. Paginated — every response includes pageInfo {page, pageSize, totalCount, totalPages, hasMore}; default pageSize 20, max 200. Optional status filter (e.g. "completed", "running", "failed", "cancelled"). Optional projectUuid scopes to a single project. Returns summary shape; use get_execution for full detail on a single uuid.`;
|
|
4
|
-
export function buildListExecutionsTool() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'list_executions',
|
|
7
|
-
title: 'List Workflow Executions',
|
|
8
|
-
description: DESCRIPTION,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
status: { type: 'string', description: 'Optional: filter by execution status.' },
|
|
13
|
-
projectUuid: { type: 'string', description: 'Optional: scope results to a specific project.' },
|
|
14
|
-
page: { type: 'number', description: 'Optional: 1-indexed page number. Default 1.', minimum: 1 },
|
|
15
|
-
pageSize: { type: 'number', description: 'Optional: items per page. Default 20, max 200.', minimum: 1, maximum: 200 },
|
|
16
|
-
},
|
|
17
|
-
additionalProperties: false,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function buildValidatedListExecutionsTool() {
|
|
22
|
-
const tool = buildListExecutionsTool();
|
|
23
|
-
return { ...tool, inputSchema: ListExecutionsInputSchema, handler: listExecutionsHandler };
|
|
24
|
-
}
|