@mcp-consultant-tools/azure-devops 27.0.0 → 28.0.0-beta.10

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 (153) hide show
  1. package/build/azure-devops-client.d.ts +42 -0
  2. package/build/azure-devops-client.d.ts.map +1 -0
  3. package/build/azure-devops-client.js +144 -0
  4. package/build/azure-devops-client.js.map +1 -0
  5. package/build/cli/commands/build-commands.d.ts +7 -0
  6. package/build/cli/commands/build-commands.d.ts.map +1 -0
  7. package/build/cli/commands/build-commands.js +59 -0
  8. package/build/cli/commands/build-commands.js.map +1 -0
  9. package/build/cli/commands/configuration-commands.d.ts +7 -0
  10. package/build/cli/commands/configuration-commands.d.ts.map +1 -0
  11. package/build/cli/commands/configuration-commands.js +24 -0
  12. package/build/cli/commands/configuration-commands.js.map +1 -0
  13. package/build/cli/commands/index.d.ts +14 -0
  14. package/build/cli/commands/index.d.ts.map +1 -0
  15. package/build/cli/commands/index.js +27 -0
  16. package/build/cli/commands/index.js.map +1 -0
  17. package/build/cli/commands/pull-request-commands.d.ts +7 -0
  18. package/build/cli/commands/pull-request-commands.d.ts.map +1 -0
  19. package/build/cli/commands/pull-request-commands.js +234 -0
  20. package/build/cli/commands/pull-request-commands.js.map +1 -0
  21. package/build/cli/commands/sync-commands.d.ts +7 -0
  22. package/build/cli/commands/sync-commands.d.ts.map +1 -0
  23. package/build/cli/commands/sync-commands.js +148 -0
  24. package/build/cli/commands/sync-commands.js.map +1 -0
  25. package/build/cli/commands/variable-group-commands.d.ts +7 -0
  26. package/build/cli/commands/variable-group-commands.d.ts.map +1 -0
  27. package/build/cli/commands/variable-group-commands.js +36 -0
  28. package/build/cli/commands/variable-group-commands.js.map +1 -0
  29. package/build/cli/commands/wiki-commands.d.ts +7 -0
  30. package/build/cli/commands/wiki-commands.d.ts.map +1 -0
  31. package/build/cli/commands/wiki-commands.js +152 -0
  32. package/build/cli/commands/wiki-commands.js.map +1 -0
  33. package/build/cli/commands/work-item-commands.d.ts +7 -0
  34. package/build/cli/commands/work-item-commands.d.ts.map +1 -0
  35. package/build/cli/commands/work-item-commands.js +169 -0
  36. package/build/cli/commands/work-item-commands.js.map +1 -0
  37. package/build/cli/output.d.ts +11 -0
  38. package/build/cli/output.d.ts.map +1 -0
  39. package/build/cli/output.js +10 -0
  40. package/build/cli/output.js.map +1 -0
  41. package/build/cli.d.ts +9 -0
  42. package/build/cli.d.ts.map +1 -0
  43. package/build/cli.js +27 -0
  44. package/build/cli.js.map +1 -0
  45. package/build/context-factory.d.ts +10 -0
  46. package/build/context-factory.d.ts.map +1 -0
  47. package/build/context-factory.js +61 -0
  48. package/build/context-factory.js.map +1 -0
  49. package/build/index.d.ts +9 -11
  50. package/build/index.d.ts.map +1 -1
  51. package/build/index.js +14 -1906
  52. package/build/index.js.map +1 -1
  53. package/build/models/api-types.d.ts +159 -0
  54. package/build/models/api-types.d.ts.map +1 -0
  55. package/build/models/api-types.js +5 -0
  56. package/build/models/api-types.js.map +1 -0
  57. package/build/models/index.d.ts +5 -0
  58. package/build/models/index.d.ts.map +1 -0
  59. package/build/models/index.js +5 -0
  60. package/build/models/index.js.map +1 -0
  61. package/build/prompts/index.d.ts +3 -0
  62. package/build/prompts/index.d.ts.map +1 -0
  63. package/build/prompts/index.js +83 -0
  64. package/build/prompts/index.js.map +1 -0
  65. package/build/prompts/templates.d.ts +8 -0
  66. package/build/prompts/templates.d.ts.map +1 -0
  67. package/build/prompts/templates.js +126 -0
  68. package/build/prompts/templates.js.map +1 -0
  69. package/build/services/build-service.d.ts +16 -0
  70. package/build/services/build-service.d.ts.map +1 -0
  71. package/build/services/build-service.js +195 -0
  72. package/build/services/build-service.js.map +1 -0
  73. package/build/services/configuration-service.d.ts +7 -0
  74. package/build/services/configuration-service.d.ts.map +1 -0
  75. package/build/services/configuration-service.js +24 -0
  76. package/build/services/configuration-service.js.map +1 -0
  77. package/build/services/index.d.ts +11 -0
  78. package/build/services/index.d.ts.map +1 -0
  79. package/build/services/index.js +11 -0
  80. package/build/services/index.js.map +1 -0
  81. package/build/services/pull-request-service.d.ts +29 -0
  82. package/build/services/pull-request-service.d.ts.map +1 -0
  83. package/build/services/pull-request-service.js +390 -0
  84. package/build/services/pull-request-service.js.map +1 -0
  85. package/build/services/sync-service.d.ts +19 -0
  86. package/build/services/sync-service.d.ts.map +1 -0
  87. package/build/services/sync-service.js +463 -0
  88. package/build/services/sync-service.js.map +1 -0
  89. package/build/services/variable-group-service.d.ts +11 -0
  90. package/build/services/variable-group-service.d.ts.map +1 -0
  91. package/build/services/variable-group-service.js +62 -0
  92. package/build/services/variable-group-service.js.map +1 -0
  93. package/build/services/wiki-service.d.ts +41 -0
  94. package/build/services/wiki-service.d.ts.map +1 -0
  95. package/build/services/wiki-service.js +346 -0
  96. package/build/services/wiki-service.js.map +1 -0
  97. package/build/services/work-item-service.d.ts +22 -0
  98. package/build/services/work-item-service.d.ts.map +1 -0
  99. package/build/services/work-item-service.js +285 -0
  100. package/build/services/work-item-service.js.map +1 -0
  101. package/build/sync/file-utils.d.ts +7 -5
  102. package/build/sync/file-utils.d.ts.map +1 -1
  103. package/build/sync/file-utils.js +17 -8
  104. package/build/sync/file-utils.js.map +1 -1
  105. package/build/sync/markdown-serializer.d.ts +19 -4
  106. package/build/sync/markdown-serializer.d.ts.map +1 -1
  107. package/build/sync/markdown-serializer.js +48 -31
  108. package/build/sync/markdown-serializer.js.map +1 -1
  109. package/build/tool-examples.d.ts +9 -8
  110. package/build/tool-examples.d.ts.map +1 -1
  111. package/build/tool-examples.js +29 -12
  112. package/build/tool-examples.js.map +1 -1
  113. package/build/tools/build-tools.d.ts +3 -0
  114. package/build/tools/build-tools.d.ts.map +1 -0
  115. package/build/tools/build-tools.js +56 -0
  116. package/build/tools/build-tools.js.map +1 -0
  117. package/build/tools/configuration-tools.d.ts +6 -0
  118. package/build/tools/configuration-tools.d.ts.map +1 -0
  119. package/build/tools/configuration-tools.js +30 -0
  120. package/build/tools/configuration-tools.js.map +1 -0
  121. package/build/tools/index.d.ts +13 -0
  122. package/build/tools/index.d.ts.map +1 -0
  123. package/build/tools/index.js +30 -0
  124. package/build/tools/index.js.map +1 -0
  125. package/build/tools/pull-request-tools.d.ts +5 -0
  126. package/build/tools/pull-request-tools.d.ts.map +1 -0
  127. package/build/tools/pull-request-tools.js +227 -0
  128. package/build/tools/pull-request-tools.js.map +1 -0
  129. package/build/tools/sync-tools.d.ts +3 -0
  130. package/build/tools/sync-tools.d.ts.map +1 -0
  131. package/build/tools/sync-tools.js +146 -0
  132. package/build/tools/sync-tools.js.map +1 -0
  133. package/build/tools/variable-group-tools.d.ts +3 -0
  134. package/build/tools/variable-group-tools.d.ts.map +1 -0
  135. package/build/tools/variable-group-tools.js +32 -0
  136. package/build/tools/variable-group-tools.js.map +1 -0
  137. package/build/tools/wiki-tools.d.ts +3 -0
  138. package/build/tools/wiki-tools.d.ts.map +1 -0
  139. package/build/tools/wiki-tools.js +151 -0
  140. package/build/tools/wiki-tools.js.map +1 -0
  141. package/build/tools/work-item-tools.d.ts +3 -0
  142. package/build/tools/work-item-tools.d.ts.map +1 -0
  143. package/build/tools/work-item-tools.js +188 -0
  144. package/build/tools/work-item-tools.js.map +1 -0
  145. package/build/types.d.ts +23 -0
  146. package/build/types.d.ts.map +1 -0
  147. package/build/types.js +2 -0
  148. package/build/types.js.map +1 -0
  149. package/package.json +5 -3
  150. package/build/AzureDevOpsService.d.ts +0 -489
  151. package/build/AzureDevOpsService.d.ts.map +0 -1
  152. package/build/AzureDevOpsService.js +0 -1558
  153. package/build/AzureDevOpsService.js.map +0 -1
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Azure DevOps HTTP Client
3
+ *
4
+ * Handles authentication, base URL construction, and API requests.
5
+ * Extracted from AzureDevOpsService constructor + makeRequest().
6
+ */
7
+ import { type AxiosResponse } from 'axios';
8
+ import type { AzureDevOpsConfig } from './models/index.js';
9
+ export declare class AzureDevOpsClient {
10
+ private readonly _config;
11
+ private readonly _baseUrl;
12
+ private readonly _searchUrl;
13
+ private readonly _authHeader;
14
+ private readonly _apiVersion;
15
+ constructor(config: AzureDevOpsConfig);
16
+ /** Read-only access to config */
17
+ get config(): AzureDevOpsConfig;
18
+ /** Read-only access to organization name */
19
+ get organization(): string;
20
+ /** Read-only access to API version */
21
+ get apiVersion(): string;
22
+ /** Read-only access to base URL */
23
+ get baseUrl(): string;
24
+ /**
25
+ * Validate that a project is in the allowed list
26
+ */
27
+ validateProject(project: string): void;
28
+ /**
29
+ * Make an authenticated request to the Azure DevOps API
30
+ */
31
+ request<T>(endpoint: string, method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE', data?: any, useSearchUrl?: boolean, customHeaders?: Record<string, string>): Promise<T>;
32
+ /**
33
+ * Make a raw request returning the full AxiosResponse (for ETag/header access)
34
+ */
35
+ requestRaw(endpoint: string, method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE', data?: any, customHeaders?: Record<string, string>, responseType?: 'json' | 'arraybuffer'): Promise<AxiosResponse>;
36
+ get<T>(endpoint: string, customHeaders?: Record<string, string>): Promise<T>;
37
+ post<T>(endpoint: string, data?: any, useSearchUrl?: boolean, customHeaders?: Record<string, string>): Promise<T>;
38
+ patch<T>(endpoint: string, data?: any, customHeaders?: Record<string, string>): Promise<T>;
39
+ put<T>(endpoint: string, data?: any, customHeaders?: Record<string, string>): Promise<T>;
40
+ del<T>(endpoint: string, customHeaders?: Record<string, string>): Promise<T>;
41
+ }
42
+ //# sourceMappingURL=azure-devops-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azure-devops-client.d.ts","sourceRoot":"","sources":["../src/azure-devops-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAA4B,MAAM,mBAAmB,CAAC;AAErF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ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C,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,YAAY,GAAE,OAAe,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxH,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAI1F,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxF,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAGnF"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Azure DevOps HTTP Client
3
+ *
4
+ * Handles authentication, base URL construction, and API requests.
5
+ * Extracted from AzureDevOpsService constructor + makeRequest().
6
+ */
7
+ import axios from 'axios';
8
+ export class AzureDevOpsClient {
9
+ _config;
10
+ _baseUrl;
11
+ _searchUrl;
12
+ _authHeader;
13
+ _apiVersion;
14
+ constructor(config) {
15
+ this._config = {
16
+ ...config,
17
+ apiVersion: config.apiVersion || '7.1',
18
+ enableWorkItemWrite: config.enableWorkItemWrite ?? false,
19
+ enableWorkItemDelete: config.enableWorkItemDelete ?? false,
20
+ enableWikiWrite: config.enableWikiWrite ?? false,
21
+ enableWikiDelete: config.enableWikiDelete ?? false,
22
+ enablePullRequestWrite: config.enablePullRequestWrite ?? false,
23
+ };
24
+ this._baseUrl = `https://dev.azure.com/${this._config.organization}`;
25
+ this._searchUrl = `https://almsearch.dev.azure.com/${this._config.organization}`;
26
+ this._apiVersion = this._config.apiVersion;
27
+ // Encode PAT for Basic Auth (format is :PAT encoded in base64)
28
+ this._authHeader = `Basic ${Buffer.from(`:${this._config.pat}`).toString('base64')}`;
29
+ }
30
+ /** Read-only access to config */
31
+ get config() { return this._config; }
32
+ /** Read-only access to organization name */
33
+ get organization() { return this._config.organization; }
34
+ /** Read-only access to API version */
35
+ get apiVersion() { return this._apiVersion; }
36
+ /** Read-only access to base URL */
37
+ get baseUrl() { return this._baseUrl; }
38
+ /**
39
+ * Validate that a project is in the allowed list
40
+ */
41
+ validateProject(project) {
42
+ if (!this._config.projects.includes(project)) {
43
+ throw new Error(`Project '${project}' is not in the allowed projects list. Allowed projects: ${this._config.projects.join(', ')}`);
44
+ }
45
+ }
46
+ /**
47
+ * Make an authenticated request to the Azure DevOps API
48
+ */
49
+ async request(endpoint, method = 'GET', data, useSearchUrl = false, customHeaders) {
50
+ try {
51
+ const baseUrl = useSearchUrl ? this._searchUrl : this._baseUrl;
52
+ const url = `${baseUrl}/${endpoint}`;
53
+ const response = await axios({
54
+ method,
55
+ url,
56
+ headers: {
57
+ 'Authorization': this._authHeader,
58
+ 'Content-Type': method === 'PATCH' ? 'application/json-patch+json' : 'application/json',
59
+ 'Accept': 'application/json',
60
+ ...customHeaders // Merge custom headers (can override defaults)
61
+ },
62
+ data
63
+ });
64
+ return response.data;
65
+ }
66
+ catch (error) {
67
+ const errorDetails = error.response?.data?.message || error.response?.data || error.message;
68
+ console.error('Azure DevOps API request failed:', {
69
+ endpoint,
70
+ method,
71
+ status: error.response?.status,
72
+ statusText: error.response?.statusText,
73
+ error: errorDetails
74
+ });
75
+ // Provide user-friendly error messages
76
+ if (error.response?.status === 401) {
77
+ throw new Error('Azure DevOps authentication failed. Please check your PAT token and permissions.');
78
+ }
79
+ if (error.response?.status === 403) {
80
+ throw new Error('Azure DevOps access denied. Please check your PAT scopes and project permissions.');
81
+ }
82
+ if (error.response?.status === 404) {
83
+ throw new Error(`Azure DevOps resource not found: ${endpoint}`);
84
+ }
85
+ throw new Error(`Azure DevOps API request failed: ${error.message} - ${JSON.stringify(errorDetails)}`);
86
+ }
87
+ }
88
+ /**
89
+ * Make a raw request returning the full AxiosResponse (for ETag/header access)
90
+ */
91
+ async requestRaw(endpoint, method = 'GET', data, customHeaders, responseType) {
92
+ try {
93
+ const url = `${this._baseUrl}/${endpoint}`;
94
+ return await axios({
95
+ method,
96
+ url,
97
+ headers: {
98
+ 'Authorization': this._authHeader,
99
+ 'Content-Type': method === 'PATCH' ? 'application/json-patch+json' : 'application/json',
100
+ 'Accept': responseType === 'arraybuffer' ? 'application/octet-stream' : 'application/json',
101
+ ...customHeaders
102
+ },
103
+ data,
104
+ responseType: responseType || 'json'
105
+ });
106
+ }
107
+ catch (error) {
108
+ const errorDetails = error.response?.data?.message || error.response?.data || error.message;
109
+ console.error('Azure DevOps API request failed:', {
110
+ endpoint,
111
+ method,
112
+ status: error.response?.status,
113
+ error: errorDetails
114
+ });
115
+ if (error.response?.status === 401) {
116
+ throw new Error('Azure DevOps authentication failed. Please check your PAT token and permissions.');
117
+ }
118
+ if (error.response?.status === 403) {
119
+ throw new Error('Azure DevOps access denied. Please check your PAT scopes and project permissions.');
120
+ }
121
+ if (error.response?.status === 404) {
122
+ throw new Error(`Azure DevOps resource not found: ${endpoint}`);
123
+ }
124
+ throw new Error(`Azure DevOps API request failed: ${error.message} - ${JSON.stringify(errorDetails)}`);
125
+ }
126
+ }
127
+ // Convenience methods
128
+ async get(endpoint, customHeaders) {
129
+ return this.request(endpoint, 'GET', undefined, false, customHeaders);
130
+ }
131
+ async post(endpoint, data, useSearchUrl = false, customHeaders) {
132
+ return this.request(endpoint, 'POST', data, useSearchUrl, customHeaders);
133
+ }
134
+ async patch(endpoint, data, customHeaders) {
135
+ return this.request(endpoint, 'PATCH', data, false, customHeaders);
136
+ }
137
+ async put(endpoint, data, customHeaders) {
138
+ return this.request(endpoint, 'PUT', data, false, customHeaders);
139
+ }
140
+ async del(endpoint, customHeaders) {
141
+ return this.request(endpoint, 'DELETE', undefined, false, customHeaders);
142
+ }
143
+ }
144
+ //# sourceMappingURL=azure-devops-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azure-devops-client.js","sourceRoot":"","sources":["../src/azure-devops-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,MAAM,OAAO,iBAAiB;IACX,OAAO,CAAoB;IAC3B,QAAQ,CAAS;IACjB,UAAU,CAAS;IACnB,WAAW,CAAS;IACpB,WAAW,CAAS;IAErC,YAAY,MAAyB;QACnC,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,MAAM;YACT,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,KAAK;YACtC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,IAAI,KAAK;YACxD,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,IAAI,KAAK;YAC1D,eAAe,EAAE,MAAM,CAAC,eAAe,IAAI,KAAK;YAChD,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,IAAI,KAAK;YAClD,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,IAAI,KAAK;SAC/D,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,yBAAyB,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QACrE,IAAI,CAAC,UAAU,GAAG,mCAAmC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QACjF,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAW,CAAC;QAE5C,+DAA+D;QAC/D,IAAI,CAAC,WAAW,GAAG,SAAS,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvF,CAAC;IAED,iCAAiC;IACjC,IAAI,MAAM,KAAwB,OAAO,IAAI,CAAC,OAA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sC;QACnE,OAAO,IAAI,CAAC,OAAO,CAAI,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,IAAI,CAAI,QAAgB,EAAE,IAAU,EAAE,eAAwB,KAAK,EAAE,aAAsC;QAC/G,OAAO,IAAI,CAAC,OAAO,CAAI,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,KAAK,CAAI,QAAgB,EAAE,IAAU,EAAE,aAAsC;QACjF,OAAO,IAAI,CAAC,OAAO,CAAI,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,QAAgB,EAAE,IAAU,EAAE,aAAsC;QAC/E,OAAO,IAAI,CAAC,OAAO,CAAI,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,QAAgB,EAAE,aAAsC;QACnE,OAAO,IAAI,CAAC,OAAO,CAAI,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IAC9E,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Build CLI Commands - 3 commands for build troubleshooting
3
+ */
4
+ import type { Command } from 'commander';
5
+ import type { ServiceContext } from '../../types.js';
6
+ export declare function registerBuildCommands(program: Command, ctx: ServiceContext): void;
7
+ //# sourceMappingURL=build-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAuDjF"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Build CLI Commands - 3 commands for build troubleshooting
3
+ */
4
+ import { getGlobalFlags, handleCliError } from '@mcp-consultant-tools/core';
5
+ import { outputResult } from '../output.js';
6
+ export function registerBuildCommands(program, ctx) {
7
+ const build = program.command('build').description('Build troubleshooting operations');
8
+ build
9
+ .command('status')
10
+ .description('Get build status and details')
11
+ .argument('<project>', 'Project name')
12
+ .argument('<buildId>', 'Build ID')
13
+ .option('-d, --detail <level>', 'Detail level: summary, timeline, full', 'summary')
14
+ .option('-s, --scope <scope>', 'Timeline scope: problems, stages, jobs, all', 'problems')
15
+ .option('-m, --max-issues <n>', 'Max issues per record', '5')
16
+ .action(async (project, buildId, opts) => {
17
+ try {
18
+ const result = await ctx.build.getBuildStatus(project, parseInt(buildId), opts.detail, opts.scope, parseInt(opts.maxIssues));
19
+ outputResult({ fileName: `build-${buildId}-status`, data: result, summary: `Build #${buildId} status: ${result?.status || 'unknown'}` }, getGlobalFlags(program));
20
+ }
21
+ catch (error) {
22
+ handleCliError(error, 'get build status');
23
+ }
24
+ });
25
+ build
26
+ .command('timeline')
27
+ .description('Get step-by-step breakdown of a build')
28
+ .argument('<project>', 'Project name')
29
+ .argument('<buildId>', 'Build ID')
30
+ .option('-s, --scope <scope>', 'Filter scope: problems, stages, jobs, all', 'problems')
31
+ .option('-m, --max-issues <n>', 'Max issues per record', '5')
32
+ .action(async (project, buildId, opts) => {
33
+ try {
34
+ const result = await ctx.build.getBuildTimeline(project, parseInt(buildId), opts.scope, parseInt(opts.maxIssues));
35
+ outputResult({ fileName: `build-${buildId}-timeline`, data: result, summary: `Build #${buildId} timeline` }, getGlobalFlags(program));
36
+ }
37
+ catch (error) {
38
+ handleCliError(error, 'get build timeline');
39
+ }
40
+ });
41
+ build
42
+ .command('logs')
43
+ .description('Get build logs')
44
+ .argument('<project>', 'Project name')
45
+ .argument('<buildId>', 'Build ID')
46
+ .option('-l, --log-id <n>', 'Specific log ID to retrieve')
47
+ .option('-m, --mode <mode>', 'Filter mode: summary, full, errors', 'summary')
48
+ .action(async (project, buildId, opts) => {
49
+ try {
50
+ const logId = opts.logId ? parseInt(opts.logId) : undefined;
51
+ const result = await ctx.build.getBuildLogs(project, parseInt(buildId), logId, opts.mode);
52
+ outputResult({ fileName: `build-${buildId}-logs${logId ? `-${logId}` : ''}`, data: result, summary: `Build #${buildId} logs` }, getGlobalFlags(program));
53
+ }
54
+ catch (error) {
55
+ handleCliError(error, 'get build logs');
56
+ }
57
+ });
58
+ }
59
+ //# sourceMappingURL=build-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-commands.js","sourceRoot":"","sources":["../../../src/cli/commands/build-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,qBAAqB,CAAC,OAAgB,EAAE,GAAmB;IACzE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC;IAEvF,KAAK;SACF,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,8BAA8B,CAAC;SAC3C,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;SACrC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;SACjC,MAAM,CAAC,sBAAsB,EAAE,uCAAuC,EAAE,SAAS,CAAC;SAClF,MAAM,CAAC,qBAAqB,EAAE,6CAA6C,EAAE,UAAU,CAAC;SACxF,MAAM,CAAC,sBAAsB,EAAE,uBAAuB,EAAE,GAAG,CAAC;SAC5D,MAAM,CAAC,KAAK,EAAE,OAAe,E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1,7 @@
1
+ /**
2
+ * Configuration CLI Commands - 1 command
3
+ */
4
+ import type { Command } from 'commander';
5
+ import type { ServiceContext } from '../../types.js';
6
+ export declare function registerConfigurationCommands(program: Command, ctx: ServiceContext): void;
7
+ //# sourceMappingURL=configuration-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/configuration-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAiBzF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Configuration CLI Commands - 1 command
3
+ */
4
+ import { getGlobalFlags, handleCliError } from '@mcp-consultant-tools/core';
5
+ import { outputResult } from '../output.js';
6
+ export function registerConfigurationCommands(program, ctx) {
7
+ program
8
+ .command('config')
9
+ .description('Get configured organization and projects')
10
+ .action(async () => {
11
+ try {
12
+ const config = ctx.configuration.getConfiguration();
13
+ if (!config) {
14
+ process.stderr.write('Azure DevOps not configured. Set AZUREDEVOPS_ORGANIZATION and AZUREDEVOPS_PROJECTS.\n');
15
+ process.exit(1);
16
+ }
17
+ outputResult({ fileName: 'configuration', data: config, summary: `Organization: ${config?.organization || 'unknown'}\nProjects: ${config?.projects?.join(', ') || 'none'}` }, getGlobalFlags(program));
18
+ }
19
+ catch (error) {
20
+ handleCliError(error, 'get configuration');
21
+ }
22
+ });
23
+ }
24
+ //# sourceMappingURL=configuration-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration-commands.js","sourceRoot":"","sources":["../../../src/cli/commands/configuration-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,6BAA6B,CAAC,OAAgB,EAAE,GAAmB;IACjF,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC;YACpD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uFAAuF,CAAC,CAAC;gBAC9G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,YAAY,CACV,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAkB,MAAc,EAAE,YAAY,IAAI,SAAS,eAAgB,MAAc,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,EAAE,EACjL,cAAc,CAAC,OAAO,CAAC,CACxB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,cAAc,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;QAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * CLI Commands barrel export + combined registration
3
+ */
4
+ import type { Command } from 'commander';
5
+ import type { ServiceContext } from '../../types.js';
6
+ export declare function registerAllCommands(program: Command, ctx: ServiceContext): void;
7
+ export { registerWikiCommands } from './wiki-commands.js';
8
+ export { registerWorkItemCommands } from './work-item-commands.js';
9
+ export { registerPullRequestCommands } from './pull-request-commands.js';
10
+ export { registerBuildCommands } from './build-commands.js';
11
+ export { registerVariableGroupCommands } from './variable-group-commands.js';
12
+ export { registerSyncCommands } from './sync-commands.js';
13
+ export { registerConfigurationCommands } from './configuration-commands.js';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AASrD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAQ/E;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * CLI Commands barrel export + combined registration
3
+ */
4
+ import { registerWikiCommands } from './wiki-commands.js';
5
+ import { registerWorkItemCommands } from './work-item-commands.js';
6
+ import { registerPullRequestCommands } from './pull-request-commands.js';
7
+ import { registerBuildCommands } from './build-commands.js';
8
+ import { registerVariableGroupCommands } from './variable-group-commands.js';
9
+ import { registerSyncCommands } from './sync-commands.js';
10
+ import { registerConfigurationCommands } from './configuration-commands.js';
11
+ export function registerAllCommands(program, ctx) {
12
+ registerConfigurationCommands(program, ctx);
13
+ registerWikiCommands(program, ctx);
14
+ registerWorkItemCommands(program, ctx);
15
+ registerPullRequestCommands(program, ctx);
16
+ registerBuildCommands(program, ctx);
17
+ registerVariableGroupCommands(program, ctx);
18
+ registerSyncCommands(program, ctx);
19
+ }
20
+ export { registerWikiCommands } from './wiki-commands.js';
21
+ export { registerWorkItemCommands } from './work-item-commands.js';
22
+ export { registerPullRequestCommands } from './pull-request-commands.js';
23
+ export { registerBuildCommands } from './build-commands.js';
24
+ export { registerVariableGroupCommands } from './variable-group-commands.js';
25
+ export { registerSyncCommands } from './sync-commands.js';
26
+ export { registerConfigurationCommands } from './configuration-commands.js';
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAE5E,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,GAAmB;IACvE,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC5C,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnC,wBAAwB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACvC,2BAA2B,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC1C,qBAAqB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACpC,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC5C,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Pull Request CLI Commands - 6 read-only + 7 write commands
3
+ */
4
+ import type { Command } from 'commander';
5
+ import type { ServiceContext } from '../../types.js';
6
+ export declare function registerPullRequestCommands(program: Command, ctx: ServiceContext): void;
7
+ //# sourceMappingURL=pull-request-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pull-request-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/pull-request-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAiQvF"}
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Pull Request CLI Commands - 6 read-only + 7 write commands
3
+ */
4
+ import { getGlobalFlags, handleCliError } from '@mcp-consultant-tools/core';
5
+ import { outputResult } from '../output.js';
6
+ export function registerPullRequestCommands(program, ctx) {
7
+ const pr = program.command('pr').description('Pull request operations');
8
+ // --- Read-only commands ---
9
+ pr
10
+ .command('list-repos')
11
+ .description('List all Git repositories in a project')
12
+ .argument('<project>', 'Project name')
13
+ .action(async (project) => {
14
+ try {
15
+ const result = await ctx.pullRequest.listRepositories(project);
16
+ outputResult({ fileName: `repos-${project}`, data: result, summary: `Found ${Array.isArray(result) ? result.length : 0} repositories in '${project}'` }, getGlobalFlags(program));
17
+ }
18
+ catch (error) {
19
+ handleCliError(error, 'list repositories');
20
+ }
21
+ });
22
+ pr
23
+ .command('list')
24
+ .description('List pull requests in a repository')
25
+ .argument('<project>', 'Project name')
26
+ .argument('<repositoryId>', 'Repository ID or name')
27
+ .option('-s, --status <status>', 'Filter by status: active, completed, abandoned, all', 'active')
28
+ .option('-t, --top <n>', 'Maximum results', '25')
29
+ .action(async (project, repositoryId, opts) => {
30
+ try {
31
+ const result = await ctx.pullRequest.listPullRequests(project, repositoryId, opts.status, parseInt(opts.top));
32
+ outputResult({ fileName: `prs-${repositoryId}`, data: result, summary: `Pull requests in '${repositoryId}' (${opts.status})` }, getGlobalFlags(program));
33
+ }
34
+ catch (error) {
35
+ handleCliError(error, 'list pull requests');
36
+ }
37
+ });
38
+ pr
39
+ .command('get')
40
+ .description('Get pull request details')
41
+ .argument('<project>', 'Project name')
42
+ .argument('<repositoryId>', 'Repository ID or name')
43
+ .argument('<pullRequestId>', 'Pull request ID')
44
+ .action(async (project, repositoryId, pullRequestId) => {
45
+ try {
46
+ const result = await ctx.pullRequest.getPullRequest(project, repositoryId, parseInt(pullRequestId));
47
+ outputResult({ fileName: `pr-${pullRequestId}`, data: result, summary: `Pull request #${pullRequestId}` }, getGlobalFlags(program));
48
+ }
49
+ catch (error) {
50
+ handleCliError(error, 'get pull request');
51
+ }
52
+ });
53
+ pr
54
+ .command('threads')
55
+ .description('Get comment threads on a pull request')
56
+ .argument('<project>', 'Project name')
57
+ .argument('<repositoryId>', 'Repository ID or name')
58
+ .argument('<pullRequestId>', 'Pull request ID')
59
+ .action(async (project, repositoryId, pullRequestId) => {
60
+ try {
61
+ const result = await ctx.pullRequest.getPullRequestThreads(project, repositoryId, parseInt(pullRequestId));
62
+ outputResult({ fileName: `pr-${pullRequestId}-threads`, data: result, summary: `Threads for PR #${pullRequestId}` }, getGlobalFlags(program));
63
+ }
64
+ catch (error) {
65
+ handleCliError(error, 'get PR threads');
66
+ }
67
+ });
68
+ pr
69
+ .command('commits')
70
+ .description('Get commits in a pull request')
71
+ .argument('<project>', 'Project name')
72
+ .argument('<repositoryId>', 'Repository ID or name')
73
+ .argument('<pullRequestId>', 'Pull request ID')
74
+ .action(async (project, repositoryId, pullRequestId) => {
75
+ try {
76
+ const result = await ctx.pullRequest.getPullRequestCommits(project, repositoryId, parseInt(pullRequestId));
77
+ outputResult({ fileName: `pr-${pullRequestId}-commits`, data: result, summary: `Commits for PR #${pullRequestId}` }, getGlobalFlags(program));
78
+ }
79
+ catch (error) {
80
+ handleCliError(error, 'get PR commits');
81
+ }
82
+ });
83
+ pr
84
+ .command('changes')
85
+ .description('Get file changes in a pull request')
86
+ .argument('<project>', 'Project name')
87
+ .argument('<repositoryId>', 'Repository ID or name')
88
+ .argument('<pullRequestId>', 'Pull request ID')
89
+ .option('-i, --iteration-id <n>', 'Iteration ID (default: latest)')
90
+ .action(async (project, repositoryId, pullRequestId, opts) => {
91
+ try {
92
+ const iterationId = opts.iterationId ? parseInt(opts.iterationId) : undefined;
93
+ const result = await ctx.pullRequest.getPullRequestChanges(project, repositoryId, parseInt(pullRequestId), iterationId);
94
+ outputResult({ fileName: `pr-${pullRequestId}-changes`, data: result, summary: `Changes for PR #${pullRequestId}` }, getGlobalFlags(program));
95
+ }
96
+ catch (error) {
97
+ handleCliError(error, 'get PR changes');
98
+ }
99
+ });
100
+ // --- Write commands (require AZUREDEVOPS_ENABLE_PR_WRITE=true) ---
101
+ pr
102
+ .command('add-thread')
103
+ .description('Add a comment thread to a PR (requires AZUREDEVOPS_ENABLE_PR_WRITE=true)')
104
+ .argument('<project>', 'Project name')
105
+ .argument('<repositoryId>', 'Repository ID or name')
106
+ .argument('<pullRequestId>', 'Pull request ID')
107
+ .argument('<content>', 'Comment content (markdown)')
108
+ .option('-f, --file-path <path>', 'File path for inline comment')
109
+ .option('-l, --line-number <n>', 'Line number for inline comment')
110
+ .option('-s, --status <status>', 'Thread status', 'active')
111
+ .action(async (project, repositoryId, pullRequestId, content, opts) => {
112
+ try {
113
+ const lineNumber = opts.lineNumber ? parseInt(opts.lineNumber) : undefined;
114
+ const result = await ctx.pullRequest.addPullRequestThread(project, repositoryId, parseInt(pullRequestId), content, opts.filePath, lineNumber, opts.status);
115
+ outputResult({ fileName: `pr-${pullRequestId}-thread-added`, data: result, summary: `Added comment to PR #${pullRequestId}` }, getGlobalFlags(program));
116
+ }
117
+ catch (error) {
118
+ handleCliError(error, 'add PR thread');
119
+ }
120
+ });
121
+ pr
122
+ .command('create')
123
+ .description('Create a new pull request (requires AZUREDEVOPS_ENABLE_PR_WRITE=true)')
124
+ .argument('<project>', 'Project name')
125
+ .argument('<repositoryId>', 'Repository ID or name')
126
+ .requiredOption('--source <ref>', 'Source branch ref (e.g., refs/heads/feature)')
127
+ .requiredOption('--target <ref>', 'Target branch ref (e.g., refs/heads/main)')
128
+ .requiredOption('--title <title>', 'PR title')
129
+ .option('-d, --description <text>', 'PR description')
130
+ .option('--reviewers <ids...>', 'Reviewer GUIDs')
131
+ .option('--draft', 'Create as draft PR', false)
132
+ .action(async (project, repositoryId, opts) => {
133
+ try {
134
+ const result = await ctx.pullRequest.createPullRequest(project, repositoryId, opts.source, opts.target, opts.title, opts.description, opts.reviewers, opts.draft);
135
+ outputResult({ fileName: `pr-created`, data: result, summary: `Created PR #${result?.pullRequestId}` }, getGlobalFlags(program));
136
+ }
137
+ catch (error) {
138
+ handleCliError(error, 'create pull request');
139
+ }
140
+ });
141
+ pr
142
+ .command('update')
143
+ .description('Update a pull request (requires AZUREDEVOPS_ENABLE_PR_WRITE=true)')
144
+ .argument('<project>', 'Project name')
145
+ .argument('<repositoryId>', 'Repository ID or name')
146
+ .argument('<pullRequestId>', 'Pull request ID')
147
+ .option('--title <title>', 'New title')
148
+ .option('-d, --description <text>', 'New description')
149
+ .option('-s, --status <status>', 'Set status: abandoned or active')
150
+ .option('--draft <bool>', 'Set draft state')
151
+ .action(async (project, repositoryId, pullRequestId, opts) => {
152
+ try {
153
+ const isDraft = opts.draft !== undefined ? opts.draft === 'true' : undefined;
154
+ const result = await ctx.pullRequest.updatePullRequest(project, repositoryId, parseInt(pullRequestId), { title: opts.title, description: opts.description, status: opts.status, isDraft });
155
+ outputResult({ fileName: `pr-${pullRequestId}-updated`, data: result, summary: `Updated PR #${pullRequestId}` }, getGlobalFlags(program));
156
+ }
157
+ catch (error) {
158
+ handleCliError(error, 'update pull request');
159
+ }
160
+ });
161
+ pr
162
+ .command('complete')
163
+ .description('Complete (merge) a pull request (requires AZUREDEVOPS_ENABLE_PR_WRITE=true)')
164
+ .argument('<project>', 'Project name')
165
+ .argument('<repositoryId>', 'Repository ID or name')
166
+ .argument('<pullRequestId>', 'Pull request ID')
167
+ .option('--strategy <strategy>', 'Merge strategy: squash, noFastForward, rebase, rebaseMerge', 'squash')
168
+ .option('--no-delete-branch', 'Keep source branch after merge')
169
+ .option('--no-transition-work-items', 'Do not transition linked work items')
170
+ .option('--commit-message <msg>', 'Custom merge commit message')
171
+ .action(async (project, repositoryId, pullRequestId, opts) => {
172
+ try {
173
+ const result = await ctx.pullRequest.completePullRequest(project, repositoryId, parseInt(pullRequestId), opts.strategy, opts.deleteBranch ?? true, opts.transitionWorkItems ?? true, opts.commitMessage);
174
+ outputResult({ fileName: `pr-${pullRequestId}-completed`, data: result, summary: `Completed PR #${pullRequestId}` }, getGlobalFlags(program));
175
+ }
176
+ catch (error) {
177
+ handleCliError(error, 'complete pull request');
178
+ }
179
+ });
180
+ pr
181
+ .command('add-reviewer')
182
+ .description('Add or remove a reviewer (requires AZUREDEVOPS_ENABLE_PR_WRITE=true)')
183
+ .argument('<project>', 'Project name')
184
+ .argument('<repositoryId>', 'Repository ID or name')
185
+ .argument('<pullRequestId>', 'Pull request ID')
186
+ .argument('<reviewerId>', 'Reviewer GUID or unique name')
187
+ .option('--required', 'Mark as required reviewer', false)
188
+ .option('--remove', 'Remove reviewer instead of adding', false)
189
+ .action(async (project, repositoryId, pullRequestId, reviewerId, opts) => {
190
+ try {
191
+ const result = await ctx.pullRequest.addOrRemovePrReviewer(project, repositoryId, parseInt(pullRequestId), reviewerId, opts.required, opts.remove);
192
+ outputResult({ fileName: `pr-${pullRequestId}-reviewer`, data: result, summary: `${opts.remove ? 'Removed' : 'Added'} reviewer on PR #${pullRequestId}` }, getGlobalFlags(program));
193
+ }
194
+ catch (error) {
195
+ handleCliError(error, 'manage PR reviewer');
196
+ }
197
+ });
198
+ pr
199
+ .command('vote')
200
+ .description('Submit a vote on a pull request (requires AZUREDEVOPS_ENABLE_PR_WRITE=true)')
201
+ .argument('<project>', 'Project name')
202
+ .argument('<repositoryId>', 'Repository ID or name')
203
+ .argument('<pullRequestId>', 'Pull request ID')
204
+ .argument('<vote>', 'Vote: approve, approveWithSuggestions, noResponse, waitForAuthor, reject')
205
+ .option('-r, --reviewer-id <id>', 'Reviewer GUID (defaults to authenticated user)')
206
+ .action(async (project, repositoryId, pullRequestId, vote, opts) => {
207
+ try {
208
+ const result = await ctx.pullRequest.votePullRequest(project, repositoryId, parseInt(pullRequestId), vote, opts.reviewerId);
209
+ outputResult({ fileName: `pr-${pullRequestId}-vote`, data: result, summary: `Voted '${vote}' on PR #${pullRequestId}` }, getGlobalFlags(program));
210
+ }
211
+ catch (error) {
212
+ handleCliError(error, 'vote on PR');
213
+ }
214
+ });
215
+ pr
216
+ .command('reply')
217
+ .description('Reply to a PR thread (requires AZUREDEVOPS_ENABLE_PR_WRITE=true)')
218
+ .argument('<project>', 'Project name')
219
+ .argument('<repositoryId>', 'Repository ID or name')
220
+ .argument('<pullRequestId>', 'Pull request ID')
221
+ .argument('<threadId>', 'Thread ID')
222
+ .option('-c, --content <text>', 'Reply text (markdown)')
223
+ .option('-s, --status <status>', 'Update thread status: active, fixed, wontFix, closed, byDesign, pending')
224
+ .action(async (project, repositoryId, pullRequestId, threadId, opts) => {
225
+ try {
226
+ const result = await ctx.pullRequest.replyToPrThread(project, repositoryId, parseInt(pullRequestId), parseInt(threadId), opts.content, opts.status);
227
+ outputResult({ fileName: `pr-${pullRequestId}-reply-${threadId}`, data: result, summary: `Replied to thread #${threadId} on PR #${pullRequestId}` }, getGlobalFlags(program));
228
+ }
229
+ catch (error) {
230
+ handleCliError(error, 'reply to PR thread');
231
+ }
232
+ });
233
+ }
234
+ //# sourceMappingURL=pull-request-commands.js.map