devops-mcp-server-extension 1.0.0

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 (102) hide show
  1. package/LICENSE +218 -0
  2. package/README.md +527 -0
  3. package/README.zh-cn.md +503 -0
  4. package/dist/common/errors.js +77 -0
  5. package/dist/common/modularTemplates.js +483 -0
  6. package/dist/common/pipelineTemplates.js +19 -0
  7. package/dist/common/toolsetManager.js +123 -0
  8. package/dist/common/toolsets.js +23 -0
  9. package/dist/common/types.js +60 -0
  10. package/dist/common/utils.js +381 -0
  11. package/dist/common/version.js +1 -0
  12. package/dist/index.js +225 -0
  13. package/dist/operations/appstack/appOrchestrations.js +260 -0
  14. package/dist/operations/appstack/appTags.js +168 -0
  15. package/dist/operations/appstack/appTemplates.js +72 -0
  16. package/dist/operations/appstack/applications.js +171 -0
  17. package/dist/operations/appstack/changeOrders.js +320 -0
  18. package/dist/operations/appstack/changeRequests.js +288 -0
  19. package/dist/operations/appstack/deploymentResources.js +286 -0
  20. package/dist/operations/appstack/globalVars.js +221 -0
  21. package/dist/operations/appstack/releaseWorkflows.js +695 -0
  22. package/dist/operations/appstack/variableGroups.js +245 -0
  23. package/dist/operations/codeup/branches.js +157 -0
  24. package/dist/operations/codeup/changeRequestComments.js +140 -0
  25. package/dist/operations/codeup/changeRequests.js +230 -0
  26. package/dist/operations/codeup/commits.js +121 -0
  27. package/dist/operations/codeup/compare.js +30 -0
  28. package/dist/operations/codeup/files.js +249 -0
  29. package/dist/operations/codeup/repositories.js +71 -0
  30. package/dist/operations/codeup/types.js +414 -0
  31. package/dist/operations/flow/hostGroup.js +52 -0
  32. package/dist/operations/flow/pipeline.js +609 -0
  33. package/dist/operations/flow/pipelineJob.js +126 -0
  34. package/dist/operations/flow/resourceMember.js +137 -0
  35. package/dist/operations/flow/serviceConnection.js +27 -0
  36. package/dist/operations/flow/tag.js +191 -0
  37. package/dist/operations/flow/types.js +523 -0
  38. package/dist/operations/flow/vmDeployOrder.js +171 -0
  39. package/dist/operations/organization/members.js +106 -0
  40. package/dist/operations/organization/organization.js +110 -0
  41. package/dist/operations/organization/types.js +111 -0
  42. package/dist/operations/packages/artifacts.js +71 -0
  43. package/dist/operations/packages/repositories.js +39 -0
  44. package/dist/operations/packages/types.js +56 -0
  45. package/dist/operations/projex/effort.js +122 -0
  46. package/dist/operations/projex/project.js +243 -0
  47. package/dist/operations/projex/sprint.js +103 -0
  48. package/dist/operations/projex/types.js +618 -0
  49. package/dist/operations/projex/workitem.js +826 -0
  50. package/dist/operations/testhub/testcases.js +240 -0
  51. package/dist/operations/testhub/testplans.js +128 -0
  52. package/dist/tool-handlers/appstack-app-release-workflows.js +103 -0
  53. package/dist/tool-handlers/appstack-change-orders.js +55 -0
  54. package/dist/tool-handlers/appstack-change-requests.js +49 -0
  55. package/dist/tool-handlers/appstack-deployment-resources.js +31 -0
  56. package/dist/tool-handlers/appstack-global-vars.js +37 -0
  57. package/dist/tool-handlers/appstack-orchestrations.js +49 -0
  58. package/dist/tool-handlers/appstack-release-workflows.js +37 -0
  59. package/dist/tool-handlers/appstack-tags.js +37 -0
  60. package/dist/tool-handlers/appstack-templates.js +19 -0
  61. package/dist/tool-handlers/appstack-variable-groups.js +55 -0
  62. package/dist/tool-handlers/appstack.js +37 -0
  63. package/dist/tool-handlers/base.js +25 -0
  64. package/dist/tool-handlers/code-management.js +150 -0
  65. package/dist/tool-handlers/commit.js +31 -0
  66. package/dist/tool-handlers/effort.js +103 -0
  67. package/dist/tool-handlers/index.js +119 -0
  68. package/dist/tool-handlers/organization.js +72 -0
  69. package/dist/tool-handlers/packages.js +32 -0
  70. package/dist/tool-handlers/pipeline.js +289 -0
  71. package/dist/tool-handlers/project-management.js +201 -0
  72. package/dist/tool-handlers/resourceMember.js +43 -0
  73. package/dist/tool-handlers/service-connections.js +16 -0
  74. package/dist/tool-handlers/tag.js +64 -0
  75. package/dist/tool-handlers/test-management.js +74 -0
  76. package/dist/tool-handlers/vmDeployOrder.js +50 -0
  77. package/dist/tool-registry/appstack-app-release-workflows.js +80 -0
  78. package/dist/tool-registry/appstack-change-orders.js +40 -0
  79. package/dist/tool-registry/appstack-change-requests.js +35 -0
  80. package/dist/tool-registry/appstack-deployment-resources.js +20 -0
  81. package/dist/tool-registry/appstack-global-vars.js +25 -0
  82. package/dist/tool-registry/appstack-orchestrations.js +35 -0
  83. package/dist/tool-registry/appstack-release-workflows.js +25 -0
  84. package/dist/tool-registry/appstack-tags.js +25 -0
  85. package/dist/tool-registry/appstack-templates.js +10 -0
  86. package/dist/tool-registry/appstack-variable-groups.js +40 -0
  87. package/dist/tool-registry/appstack.js +25 -0
  88. package/dist/tool-registry/base.js +19 -0
  89. package/dist/tool-registry/code-management.js +109 -0
  90. package/dist/tool-registry/commit.js +20 -0
  91. package/dist/tool-registry/effort.js +39 -0
  92. package/dist/tool-registry/index.js +7 -0
  93. package/dist/tool-registry/organization.js +65 -0
  94. package/dist/tool-registry/packages.js +21 -0
  95. package/dist/tool-registry/pipeline.js +190 -0
  96. package/dist/tool-registry/project-management.js +143 -0
  97. package/dist/tool-registry/resourceMember.js +29 -0
  98. package/dist/tool-registry/service-connections.js +10 -0
  99. package/dist/tool-registry/tag.js +44 -0
  100. package/dist/tool-registry/test-management.js +59 -0
  101. package/dist/tool-registry/vmDeployOrder.js +34 -0
  102. package/package.json +52 -0
@@ -0,0 +1,49 @@
1
+ import { getLatestOrchestration, listAppOrchestration, createAppOrchestration, deleteAppOrchestration, getAppOrchestration, updateAppOrchestration, GetLatestOrchestrationRequestSchema, ListAppOrchestrationRequestSchema, CreateAppOrchestrationRequestSchema, DeleteAppOrchestrationRequestSchema, GetAppOrchestrationRequestSchema, UpdateAppOrchestrationRequestSchema } from '../operations/appstack/appOrchestrations.js';
2
+ /**
3
+ * Handle the appstack application orchestrations tool requests
4
+ *
5
+ * @param request - The tool request
6
+ * @returns The tool response or null if not handled
7
+ */
8
+ export async function handleAppStackOrchestrationTools(request) {
9
+ switch (request.params.name) {
10
+ case 'get_latest_orchestration':
11
+ const getLatestParams = GetLatestOrchestrationRequestSchema.parse(request.params.arguments);
12
+ const getLatestResult = await getLatestOrchestration(getLatestParams);
13
+ return {
14
+ content: [{ type: "text", text: JSON.stringify(getLatestResult, null, 2) }],
15
+ };
16
+ case 'list_app_orchestration':
17
+ const listParams = ListAppOrchestrationRequestSchema.parse(request.params.arguments);
18
+ const listResult = await listAppOrchestration(listParams);
19
+ return {
20
+ content: [{ type: "text", text: JSON.stringify(listResult, null, 2) }],
21
+ };
22
+ case 'create_app_orchestration':
23
+ const createParams = CreateAppOrchestrationRequestSchema.parse(request.params.arguments);
24
+ const createResult = await createAppOrchestration(createParams);
25
+ return {
26
+ content: [{ type: "text", text: JSON.stringify(createResult, null, 2) }],
27
+ };
28
+ case 'delete_app_orchestration':
29
+ const deleteParams = DeleteAppOrchestrationRequestSchema.parse(request.params.arguments);
30
+ const deleteResult = await deleteAppOrchestration(deleteParams);
31
+ return {
32
+ content: [{ type: "text", text: JSON.stringify(deleteResult, null, 2) }],
33
+ };
34
+ case 'get_app_orchestration':
35
+ const getAppParams = GetAppOrchestrationRequestSchema.parse(request.params.arguments);
36
+ const getAppResult = await getAppOrchestration(getAppParams);
37
+ return {
38
+ content: [{ type: "text", text: JSON.stringify(getAppResult, null, 2) }],
39
+ };
40
+ case 'update_app_orchestration':
41
+ const updateParams = UpdateAppOrchestrationRequestSchema.parse(request.params.arguments);
42
+ const updateResult = await updateAppOrchestration(updateParams);
43
+ return {
44
+ content: [{ type: "text", text: JSON.stringify(updateResult, null, 2) }],
45
+ };
46
+ default:
47
+ return null;
48
+ }
49
+ }
@@ -0,0 +1,37 @@
1
+ import { listSystemAllReleaseWorkflows, createSystemReleaseWorkflows, updateSystemReleaseStage, executeReleaseStage, ListSystemAllReleaseWorkflowsRequestSchema, CreateSystemReleaseWorkflowsRequestSchema, UpdateSystemReleaseStageRequestSchema, ExecuteReleaseStageRequestSchema } from '../operations/appstack/releaseWorkflows.js';
2
+ /**
3
+ * Handle the appstack release workflow tool requests (system level)
4
+ *
5
+ * @param request - The tool request
6
+ * @returns The tool response or null if not handled
7
+ */
8
+ export async function handleAppStackReleaseWorkflowTools(request) {
9
+ switch (request.params.name) {
10
+ case 'list_system_release_workflows':
11
+ const listParams = ListSystemAllReleaseWorkflowsRequestSchema.parse(request.params.arguments);
12
+ const listResult = await listSystemAllReleaseWorkflows(listParams);
13
+ return {
14
+ content: [{ type: "text", text: JSON.stringify(listResult, null, 2) }],
15
+ };
16
+ case 'create_system_release_workflow':
17
+ const createParams = CreateSystemReleaseWorkflowsRequestSchema.parse(request.params.arguments);
18
+ const createResult = await createSystemReleaseWorkflows(createParams);
19
+ return {
20
+ content: [{ type: "text", text: JSON.stringify(createResult, null, 2) }],
21
+ };
22
+ case 'update_system_release_stage':
23
+ const updateParams = UpdateSystemReleaseStageRequestSchema.parse(request.params.arguments);
24
+ const updateResult = await updateSystemReleaseStage(updateParams);
25
+ return {
26
+ content: [{ type: "text", text: JSON.stringify(updateResult, null, 2) }],
27
+ };
28
+ case 'execute_system_release_stage':
29
+ const executeParams = ExecuteReleaseStageRequestSchema.parse(request.params.arguments);
30
+ const executeResult = await executeReleaseStage(executeParams);
31
+ return {
32
+ content: [{ type: "text", text: JSON.stringify(executeResult, null, 2) }],
33
+ };
34
+ default:
35
+ return null;
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ import { createAppTag, updateAppTag, searchAppTag, updateAppTagBind, CreateAppTagRequestSchema, UpdateAppTagRequestSchema, SearchAppTagRequestSchema, UpdateAppTagBindRequestSchema } from '../operations/appstack/appTags.js';
2
+ /**
3
+ * Handle the appstack tag tool requests
4
+ *
5
+ * @param request - The tool request
6
+ * @returns The tool response or null if not handled
7
+ */
8
+ export async function handleAppStackTagTools(request) {
9
+ switch (request.params.name) {
10
+ case 'create_app_tag':
11
+ const createParams = CreateAppTagRequestSchema.parse(request.params.arguments);
12
+ const createResult = await createAppTag(createParams);
13
+ return {
14
+ content: [{ type: "text", text: JSON.stringify(createResult, null, 2) }],
15
+ };
16
+ case 'update_app_tag':
17
+ const updateParams = UpdateAppTagRequestSchema.parse(request.params.arguments);
18
+ const updateResult = await updateAppTag(updateParams);
19
+ return {
20
+ content: [{ type: "text", text: JSON.stringify(updateResult, null, 2) }],
21
+ };
22
+ case 'search_app_tags':
23
+ const searchParams = SearchAppTagRequestSchema.parse(request.params.arguments);
24
+ const searchResult = await searchAppTag(searchParams);
25
+ return {
26
+ content: [{ type: "text", text: JSON.stringify(searchResult, null, 2) }],
27
+ };
28
+ case 'update_app_tag_bind':
29
+ const bindParams = UpdateAppTagBindRequestSchema.parse(request.params.arguments);
30
+ await updateAppTagBind(bindParams);
31
+ return {
32
+ content: [{ type: "text", text: "Application tag bindings updated successfully" }],
33
+ };
34
+ default:
35
+ return null;
36
+ }
37
+ }
@@ -0,0 +1,19 @@
1
+ import { searchAppTemplates, SearchAppTemplatesRequestSchema } from '../operations/appstack/appTemplates.js';
2
+ /**
3
+ * Handle the appstack template tool requests
4
+ *
5
+ * @param request - The tool request
6
+ * @returns The tool response or null if not handled
7
+ */
8
+ export async function handleAppStackTemplateTools(request) {
9
+ switch (request.params.name) {
10
+ case 'search_app_templates':
11
+ const searchParams = SearchAppTemplatesRequestSchema.parse(request.params.arguments);
12
+ const searchResult = await searchAppTemplates(searchParams);
13
+ return {
14
+ content: [{ type: "text", text: JSON.stringify(searchResult, null, 2) }],
15
+ };
16
+ default:
17
+ return null;
18
+ }
19
+ }
@@ -0,0 +1,55 @@
1
+ import { getEnvVariableGroups, createVariableGroup, deleteVariableGroup, getVariableGroup, updateVariableGroup, getAppVariableGroups, getAppVariableGroupsRevision, GetEnvVariableGroupsRequestSchema, CreateVariableGroupRequestSchema, DeleteVariableGroupRequestSchema, GetVariableGroupRequestSchema, UpdateVariableGroupRequestSchema, GetAppVariableGroupsRequestSchema, GetAppVariableGroupsRevisionRequestSchema } from '../operations/appstack/variableGroups.js';
2
+ /**
3
+ * Handle the appstack variable groups tool requests
4
+ *
5
+ * @param request - The tool request
6
+ * @returns The tool response or null if not handled
7
+ */
8
+ export async function handleAppStackVariableGroupTools(request) {
9
+ switch (request.params.name) {
10
+ case 'get_env_variable_groups':
11
+ const getEnvParams = GetEnvVariableGroupsRequestSchema.parse(request.params.arguments);
12
+ const getEnvResult = await getEnvVariableGroups(getEnvParams);
13
+ return {
14
+ content: [{ type: "text", text: JSON.stringify(getEnvResult, null, 2) }],
15
+ };
16
+ case 'create_variable_group':
17
+ const createParams = CreateVariableGroupRequestSchema.parse(request.params.arguments);
18
+ const createResult = await createVariableGroup(createParams);
19
+ return {
20
+ content: [{ type: "text", text: JSON.stringify(createResult, null, 2) }],
21
+ };
22
+ case 'delete_variable_group':
23
+ const deleteParams = DeleteVariableGroupRequestSchema.parse(request.params.arguments);
24
+ const deleteResult = await deleteVariableGroup(deleteParams);
25
+ return {
26
+ content: [{ type: "text", text: JSON.stringify(deleteResult, null, 2) }],
27
+ };
28
+ case 'get_variable_group':
29
+ const getParams = GetVariableGroupRequestSchema.parse(request.params.arguments);
30
+ const getResult = await getVariableGroup(getParams);
31
+ return {
32
+ content: [{ type: "text", text: JSON.stringify(getResult, null, 2) }],
33
+ };
34
+ case 'update_variable_group':
35
+ const updateParams = UpdateVariableGroupRequestSchema.parse(request.params.arguments);
36
+ const updateResult = await updateVariableGroup(updateParams);
37
+ return {
38
+ content: [{ type: "text", text: JSON.stringify(updateResult, null, 2) }],
39
+ };
40
+ case 'get_app_variable_groups':
41
+ const getAppParams = GetAppVariableGroupsRequestSchema.parse(request.params.arguments);
42
+ const getAppResult = await getAppVariableGroups(getAppParams);
43
+ return {
44
+ content: [{ type: "text", text: JSON.stringify(getAppResult, null, 2) }],
45
+ };
46
+ case 'get_app_variable_groups_revision':
47
+ const getAppRevParams = GetAppVariableGroupsRevisionRequestSchema.parse(request.params.arguments);
48
+ const getAppRevResult = await getAppVariableGroupsRevision(getAppRevParams);
49
+ return {
50
+ content: [{ type: "text", text: JSON.stringify(getAppRevResult, null, 2) }],
51
+ };
52
+ default:
53
+ return null;
54
+ }
55
+ }
@@ -0,0 +1,37 @@
1
+ import { listApplications, getApplication, createApplication, updateApplication, ListApplicationsRequestSchema, GetApplicationRequestSchema, CreateApplicationRequestSchema, UpdateApplicationRequestSchema } from '../operations/appstack/applications.js';
2
+ /**
3
+ * Handle the appstack tool requests
4
+ *
5
+ * @param request - The tool request
6
+ * @returns The tool response or null if not handled
7
+ */
8
+ export async function handleAppStackTools(request) {
9
+ switch (request.params.name) {
10
+ case 'list_applications':
11
+ const listParams = ListApplicationsRequestSchema.parse(request.params.arguments);
12
+ const listResult = await listApplications(listParams);
13
+ return {
14
+ content: [{ type: "text", text: JSON.stringify(listResult, null, 2) }],
15
+ };
16
+ case 'get_application':
17
+ const getParams = GetApplicationRequestSchema.parse(request.params.arguments);
18
+ const getResult = await getApplication(getParams);
19
+ return {
20
+ content: [{ type: "text", text: JSON.stringify(getResult, null, 2) }],
21
+ };
22
+ case 'create_application':
23
+ const createParams = CreateApplicationRequestSchema.parse(request.params.arguments);
24
+ const createResult = await createApplication(createParams);
25
+ return {
26
+ content: [{ type: "text", text: JSON.stringify(createResult, null, 2) }],
27
+ };
28
+ case 'update_application':
29
+ const updateParams = UpdateApplicationRequestSchema.parse(request.params.arguments);
30
+ const updateResult = await updateApplication(updateParams);
31
+ return {
32
+ content: [{ type: "text", text: JSON.stringify(updateResult, null, 2) }],
33
+ };
34
+ default:
35
+ return null;
36
+ }
37
+ }
@@ -0,0 +1,25 @@
1
+ import * as organization from '../operations/organization/organization.js';
2
+ export const handleBaseTools = async (request) => {
3
+ switch (request.params.name) {
4
+ case "get_current_organization_info": {
5
+ const currentOrgInfo = await organization.getCurrentOrganizationInfoFunc();
6
+ return {
7
+ content: [{ type: "text", text: JSON.stringify(currentOrgInfo, null, 2) }],
8
+ };
9
+ }
10
+ case "get_user_organizations": {
11
+ const userOrgs = await organization.getUserOrganizationsFunc();
12
+ return {
13
+ content: [{ type: "text", text: JSON.stringify(userOrgs, null, 2) }],
14
+ };
15
+ }
16
+ case "get_current_user": {
17
+ const currentUserInfo = await organization.getCurrentUserFunc();
18
+ return {
19
+ content: [{ type: "text", text: JSON.stringify(currentUserInfo, null, 2) }],
20
+ };
21
+ }
22
+ default:
23
+ return null;
24
+ }
25
+ };
@@ -0,0 +1,150 @@
1
+ import * as branches from '../operations/codeup/branches.js';
2
+ import * as files from '../operations/codeup/files.js';
3
+ import * as repositories from '../operations/codeup/repositories.js';
4
+ import * as changeRequests from '../operations/codeup/changeRequests.js';
5
+ import * as changeRequestComments from '../operations/codeup/changeRequestComments.js';
6
+ import * as compare from '../operations/codeup/compare.js';
7
+ import * as types from '../common/types.js';
8
+ export const handleCodeManagementTools = async (request) => {
9
+ switch (request.params.name) {
10
+ // Branch Operations
11
+ case "create_branch": {
12
+ const args = types.CreateBranchSchema.parse(request.params.arguments);
13
+ const branch = await branches.createBranchFunc(args.organizationId, args.repositoryId, args.branch, args.ref);
14
+ return {
15
+ content: [{ type: "text", text: JSON.stringify(branch, null, 2) }],
16
+ };
17
+ }
18
+ case "get_branch": {
19
+ const args = types.GetBranchSchema.parse(request.params.arguments);
20
+ const branch = await branches.getBranchFunc(args.organizationId, args.repositoryId, args.branchName);
21
+ return {
22
+ content: [{ type: "text", text: JSON.stringify(branch, null, 2) }],
23
+ };
24
+ }
25
+ case "delete_branch": {
26
+ const args = types.DeleteBranchSchema.parse(request.params.arguments);
27
+ const result = await branches.deleteBranchFunc(args.organizationId, args.repositoryId, args.branchName);
28
+ return {
29
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
30
+ };
31
+ }
32
+ case "list_branches": {
33
+ const args = types.ListBranchesSchema.parse(request.params.arguments);
34
+ const branchList = await branches.listBranchesFunc(args.organizationId, args.repositoryId, args.page, args.perPage, args.sort, args.search ?? undefined);
35
+ return {
36
+ content: [{ type: "text", text: JSON.stringify(branchList, null, 2) }],
37
+ };
38
+ }
39
+ // File Operations
40
+ case "get_file_blobs": {
41
+ const args = types.GetFileBlobsSchema.parse(request.params.arguments);
42
+ const fileContent = await files.getFileBlobsFunc(args.organizationId, args.repositoryId, args.filePath, args.ref);
43
+ return {
44
+ content: [{ type: "text", text: JSON.stringify(fileContent, null, 2) }],
45
+ };
46
+ }
47
+ case "create_file": {
48
+ const args = types.CreateFileSchema.parse(request.params.arguments);
49
+ const result = await files.createFileFunc(args.organizationId, args.repositoryId, args.filePath, args.content, args.commitMessage, args.branch, args.encoding);
50
+ return {
51
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
52
+ };
53
+ }
54
+ case "update_file": {
55
+ const args = types.UpdateFileSchema.parse(request.params.arguments);
56
+ const result = await files.updateFileFunc(args.organizationId, args.repositoryId, args.filePath, args.content, args.commitMessage, args.branch, args.encoding);
57
+ return {
58
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
59
+ };
60
+ }
61
+ case "delete_file": {
62
+ const args = types.DeleteFileSchema.parse(request.params.arguments);
63
+ const result = await files.deleteFileFunc(args.organizationId, args.repositoryId, args.filePath, args.commitMessage, args.branch);
64
+ return {
65
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
66
+ };
67
+ }
68
+ case "list_files": {
69
+ const args = types.ListFilesSchema.parse(request.params.arguments);
70
+ const fileList = await files.listFilesFunc(args.organizationId, args.repositoryId, args.path, args.ref, args.type);
71
+ return {
72
+ content: [{ type: "text", text: JSON.stringify(fileList, null, 2) }],
73
+ };
74
+ }
75
+ case "compare": {
76
+ const args = types.GetCompareSchema.parse(request.params.arguments);
77
+ const compareResult = await compare.getCompareFunc(args.organizationId, args.repositoryId, args.from, args.to, args.sourceType ?? undefined, args.targetType ?? undefined, args.straight ?? undefined);
78
+ return {
79
+ content: [{ type: "text", text: JSON.stringify(compareResult, null, 2) }],
80
+ };
81
+ }
82
+ // Repository Operations
83
+ case "get_repository": {
84
+ const args = types.GetRepositorySchema.parse(request.params.arguments);
85
+ const repository = await repositories.getRepositoryFunc(args.organizationId, args.repositoryId);
86
+ return {
87
+ content: [{ type: "text", text: JSON.stringify(repository, null, 2) }],
88
+ };
89
+ }
90
+ case "list_repositories": {
91
+ const args = types.ListRepositoriesSchema.parse(request.params.arguments);
92
+ const repositoryList = await repositories.listRepositoriesFunc(args.organizationId, args.page, args.perPage, args.orderBy, args.sort, args.search ?? undefined, args.archived);
93
+ return {
94
+ content: [{ type: "text", text: JSON.stringify(repositoryList, null, 2) }],
95
+ };
96
+ }
97
+ // Change Request Operations
98
+ case "get_change_request": {
99
+ const args = types.GetChangeRequestSchema.parse(request.params.arguments);
100
+ const changeRequest = await changeRequests.getChangeRequestFunc(args.organizationId, args.repositoryId, args.localId);
101
+ return {
102
+ content: [{ type: "text", text: JSON.stringify(changeRequest, null, 2) }],
103
+ };
104
+ }
105
+ case "list_change_requests": {
106
+ const args = types.ListChangeRequestsSchema.parse(request.params.arguments);
107
+ const changeRequestList = await changeRequests.listChangeRequestsFunc(args.organizationId, args.page, args.perPage, args.projectIds ?? undefined, args.authorIds ?? undefined, args.reviewerIds ?? undefined, args.state ?? undefined, args.search ?? undefined, args.orderBy, args.sort, args.createdBefore ?? undefined, args.createdAfter ?? undefined);
108
+ return {
109
+ content: [{ type: "text", text: JSON.stringify(changeRequestList, null, 2) }],
110
+ };
111
+ }
112
+ case "create_change_request": {
113
+ const args = types.CreateChangeRequestSchema.parse(request.params.arguments);
114
+ const changeRequest = await changeRequests.createChangeRequestFunc(args.organizationId, args.repositoryId, args.title, args.sourceBranch, args.targetBranch, args.description ?? undefined, args.sourceProjectId, args.targetProjectId, args.reviewerUserIds ?? undefined, args.workItemIds ?? undefined, args.createFrom, args.triggerAIReviewRun ?? false);
115
+ return {
116
+ content: [{ type: "text", text: JSON.stringify(changeRequest, null, 2) }],
117
+ };
118
+ }
119
+ case "create_change_request_comment": {
120
+ const args = types.CreateChangeRequestCommentSchema.parse(request.params.arguments);
121
+ const comment = await changeRequestComments.createChangeRequestCommentFunc(args.organizationId, args.repositoryId, args.localId, args.comment_type, args.content, args.draft, args.resolved, args.patchset_biz_id, args.file_path ?? undefined, args.line_number ?? undefined, args.from_patchset_biz_id ?? undefined, args.to_patchset_biz_id ?? undefined, args.parent_comment_biz_id ?? undefined);
122
+ return {
123
+ content: [{ type: "text", text: JSON.stringify(comment, null, 2) }],
124
+ };
125
+ }
126
+ case "list_change_request_comments": {
127
+ const args = types.ListChangeRequestCommentsSchema.parse(request.params.arguments);
128
+ const comments = await changeRequestComments.listChangeRequestCommentsFunc(args.organizationId, args.repositoryId, args.localId, args.patchSetBizIds ?? undefined, args.commentType, args.state, args.resolved, args.filePath ?? undefined);
129
+ return {
130
+ content: [{ type: "text", text: JSON.stringify(comments, null, 2) }],
131
+ };
132
+ }
133
+ case "update_change_request_comment": {
134
+ const args = types.UpdateChangeRequestCommentSchema.parse(request.params.arguments);
135
+ const result = await changeRequestComments.updateChangeRequestCommentFunc(args.organizationId, args.repositoryId, args.localId, args.commentBizId, args.content ?? undefined, args.resolved ?? undefined);
136
+ return {
137
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
138
+ };
139
+ }
140
+ case "list_change_request_patch_sets": {
141
+ const args = types.ListChangeRequestPatchSetsSchema.parse(request.params.arguments);
142
+ const patchSets = await changeRequests.listChangeRequestPatchSetsFunc(args.organizationId, args.repositoryId, args.localId);
143
+ return {
144
+ content: [{ type: "text", text: JSON.stringify(patchSets, null, 2) }],
145
+ };
146
+ }
147
+ default:
148
+ return null;
149
+ }
150
+ };
@@ -0,0 +1,31 @@
1
+ import { listCommits, getCommit, createCommitComment, ListCommitsRequestSchema, GetCommitRequestSchema, CreateCommitCommentRequestSchema } from '../operations/codeup/commits.js';
2
+ /**
3
+ * Handle the commit tool requests
4
+ *
5
+ * @param request - The tool request
6
+ * @returns The tool response or null if not handled
7
+ */
8
+ export async function handleCommitTools(request) {
9
+ switch (request.params.name) {
10
+ case 'list_commits':
11
+ const listCommitsParams = ListCommitsRequestSchema.parse(request.params.arguments);
12
+ const listCommitsResult = await listCommits(listCommitsParams);
13
+ return {
14
+ content: [{ type: "text", text: JSON.stringify(listCommitsResult, null, 2) }],
15
+ };
16
+ case 'get_commit':
17
+ const getCommitParams = GetCommitRequestSchema.parse(request.params.arguments);
18
+ const getCommitResult = await getCommit(getCommitParams);
19
+ return {
20
+ content: [{ type: "text", text: JSON.stringify(getCommitResult, null, 2) }],
21
+ };
22
+ case 'create_commit_comment':
23
+ const createCommitCommentParams = CreateCommitCommentRequestSchema.parse(request.params.arguments);
24
+ const createCommitCommentResult = await createCommitComment(createCommitCommentParams);
25
+ return {
26
+ content: [{ type: "text", text: JSON.stringify(createCommitCommentResult, null, 2) }],
27
+ };
28
+ default:
29
+ return null;
30
+ }
31
+ }
@@ -0,0 +1,103 @@
1
+ import * as effort from '../operations/projex/effort.js';
2
+ import * as types from '../common/types.js';
3
+ export const handleEffortTools = async (request) => {
4
+ switch (request.params.name) {
5
+ case "list_current_user_effort_records": {
6
+ const args = types.ListCurrentUserEffortRecordsSchema.parse(request.params.arguments);
7
+ const effortRecords = await effort.listCurrentUserEffortRecords({
8
+ organizationId: args.organizationId,
9
+ startDate: args.startDate,
10
+ endDate: args.endDate
11
+ });
12
+ return {
13
+ content: [{ type: "text", text: JSON.stringify(effortRecords, null, 2) }],
14
+ };
15
+ }
16
+ case "list_effort_records": {
17
+ const args = types.ListEffortRecordsSchema.parse(request.params.arguments);
18
+ const effortRecords = await effort.listEffortRecords({
19
+ id: args.id,
20
+ organizationId: args.organizationId
21
+ });
22
+ return {
23
+ content: [{ type: "text", text: JSON.stringify(effortRecords, null, 2) }],
24
+ };
25
+ }
26
+ case "create_effort_record": {
27
+ const args = types.CreateEffortRecordSchema.parse(request.params.arguments);
28
+ const result = await effort.createEffortRecord({
29
+ id: args.id,
30
+ organizationId: args.organizationId,
31
+ actualTime: args.actualTime,
32
+ description: args.description,
33
+ gmtEnd: args.gmtEnd,
34
+ gmtStart: args.gmtStart,
35
+ operatorId: args.operatorId,
36
+ workType: args.workType
37
+ });
38
+ return {
39
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
40
+ };
41
+ }
42
+ case "list_estimated_efforts": {
43
+ const args = types.ListEstimatedEffortsSchema.parse(request.params.arguments);
44
+ const estimatedEfforts = await effort.listEstimatedEfforts({
45
+ id: args.id,
46
+ organizationId: args.organizationId
47
+ });
48
+ return {
49
+ content: [{ type: "text", text: JSON.stringify(estimatedEfforts, null, 2) }],
50
+ };
51
+ }
52
+ case "create_estimated_effort": {
53
+ const args = types.CreateEstimatedEffortSchema.parse(request.params.arguments);
54
+ const result = await effort.createEstimatedEffort({
55
+ id: args.id,
56
+ organizationId: args.organizationId,
57
+ description: args.description,
58
+ operatorId: args.operatorId,
59
+ owner: args.owner,
60
+ spentTime: args.spentTime,
61
+ workType: args.workType
62
+ });
63
+ return {
64
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
65
+ };
66
+ }
67
+ case "update_effort_record": {
68
+ const args = types.UpdateEffortRecordSchema.parse(request.params.arguments);
69
+ await effort.updateEffortRecord({
70
+ organizationId: args.organizationId,
71
+ workitemId: args.workitemId,
72
+ id: args.id,
73
+ actualTime: args.actualTime,
74
+ description: args.description,
75
+ gmtEnd: args.gmtEnd,
76
+ gmtStart: args.gmtStart,
77
+ operatorId: args.operatorId,
78
+ workType: args.workType
79
+ });
80
+ return {
81
+ content: [{ type: "text", text: "Effort record updated successfully" }],
82
+ };
83
+ }
84
+ case "update_estimated_effort": {
85
+ const args = types.UpdateEstimatedEffortSchema.parse(request.params.arguments);
86
+ await effort.updateEstimatedEffort({
87
+ organizationId: args.organizationId,
88
+ workitemId: args.workitemId,
89
+ id: args.id,
90
+ description: args.description,
91
+ operatorId: args.operatorId,
92
+ owner: args.owner,
93
+ spentTime: args.spentTime,
94
+ workType: args.workType
95
+ });
96
+ return {
97
+ content: [{ type: "text", text: "Estimated effort updated successfully" }],
98
+ };
99
+ }
100
+ default:
101
+ return null;
102
+ }
103
+ };