mcp4openapi 0.3.1 → 0.3.3

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 (152) hide show
  1. package/README.md +7 -0
  2. package/dist/src/core/cli-config.d.ts.map +1 -1
  3. package/dist/src/core/cli-config.js +2 -0
  4. package/dist/src/core/cli-config.js.map +1 -1
  5. package/dist/src/core/index.d.ts.map +1 -1
  6. package/dist/src/core/index.js +18 -3
  7. package/dist/src/core/index.js.map +1 -1
  8. package/dist/src/index.js +0 -0
  9. package/dist/src/profile/profile-allowlist.d.ts +18 -0
  10. package/dist/src/profile/profile-allowlist.d.ts.map +1 -0
  11. package/dist/src/profile/profile-allowlist.js +68 -0
  12. package/dist/src/profile/profile-allowlist.js.map +1 -0
  13. package/dist/src/profile/profile-registry.d.ts +5 -0
  14. package/dist/src/profile/profile-registry.d.ts.map +1 -1
  15. package/dist/src/profile/profile-registry.js +38 -14
  16. package/dist/src/profile/profile-registry.js.map +1 -1
  17. package/package.json +2 -2
  18. package/profiles/gitlab/developer-profile-oauth.json +243 -41
  19. package/profiles/gitlab/developer-profile-oauth.test.json +1009 -5
  20. package/profiles/gitlab/openapi.yaml +1419 -164
  21. package/profiles/gitlab/profile-optimized-oauth.json +785 -0
  22. package/profiles/gitlab/profile-optimized-oauth.test.json +1566 -0
  23. package/profiles/grafana/openapi.json +28078 -0
  24. package/profiles/grafana/profile.json +1083 -0
  25. package/profiles/grafana/profile.test.json +235 -0
  26. package/profiles/mattermost/openapi.yaml +27434 -0
  27. package/profiles/mattermost/profile.json +463 -0
  28. package/profiles/mattermost/profile.test.json +607 -0
  29. package/profiles/n8n/profile-optimized.json +1002 -364
  30. package/profiles/n8n/profile-optimized.test.json +43 -43
  31. package/dist/src/argument-normalizer.d.ts +0 -5
  32. package/dist/src/argument-normalizer.d.ts.map +0 -1
  33. package/dist/src/argument-normalizer.js +0 -61
  34. package/dist/src/argument-normalizer.js.map +0 -1
  35. package/dist/src/cli-config.d.ts +0 -9
  36. package/dist/src/cli-config.d.ts.map +0 -1
  37. package/dist/src/cli-config.js +0 -111
  38. package/dist/src/cli-config.js.map +0 -1
  39. package/dist/src/composite-executor.d.ts +0 -77
  40. package/dist/src/composite-executor.d.ts.map +0 -1
  41. package/dist/src/composite-executor.js +0 -193
  42. package/dist/src/composite-executor.js.map +0 -1
  43. package/dist/src/constants.d.ts +0 -85
  44. package/dist/src/constants.d.ts.map +0 -1
  45. package/dist/src/constants.js +0 -85
  46. package/dist/src/constants.js.map +0 -1
  47. package/dist/src/dag-executor.d.ts +0 -49
  48. package/dist/src/dag-executor.d.ts.map +0 -1
  49. package/dist/src/dag-executor.js +0 -138
  50. package/dist/src/dag-executor.js.map +0 -1
  51. package/dist/src/errors.d.ts +0 -59
  52. package/dist/src/errors.d.ts.map +0 -1
  53. package/dist/src/errors.js +0 -119
  54. package/dist/src/errors.js.map +0 -1
  55. package/dist/src/filtering.d.ts +0 -19
  56. package/dist/src/filtering.d.ts.map +0 -1
  57. package/dist/src/filtering.js +0 -292
  58. package/dist/src/filtering.js.map +0 -1
  59. package/dist/src/http-client-factory.d.ts +0 -62
  60. package/dist/src/http-client-factory.d.ts.map +0 -1
  61. package/dist/src/http-client-factory.js +0 -133
  62. package/dist/src/http-client-factory.js.map +0 -1
  63. package/dist/src/http-transport-config.d.ts +0 -6
  64. package/dist/src/http-transport-config.d.ts.map +0 -1
  65. package/dist/src/http-transport-config.js +0 -47
  66. package/dist/src/http-transport-config.js.map +0 -1
  67. package/dist/src/http-transport.d.ts +0 -316
  68. package/dist/src/http-transport.d.ts.map +0 -1
  69. package/dist/src/http-transport.js +0 -2412
  70. package/dist/src/http-transport.js.map +0 -1
  71. package/dist/src/interceptors.d.ts +0 -116
  72. package/dist/src/interceptors.d.ts.map +0 -1
  73. package/dist/src/interceptors.js +0 -392
  74. package/dist/src/interceptors.js.map +0 -1
  75. package/dist/src/jsonrpc-validator.d.ts +0 -27
  76. package/dist/src/jsonrpc-validator.d.ts.map +0 -1
  77. package/dist/src/jsonrpc-validator.js +0 -58
  78. package/dist/src/jsonrpc-validator.js.map +0 -1
  79. package/dist/src/logger.d.ts +0 -59
  80. package/dist/src/logger.d.ts.map +0 -1
  81. package/dist/src/logger.js +0 -177
  82. package/dist/src/logger.js.map +0 -1
  83. package/dist/src/mcp-server-manager.d.ts +0 -20
  84. package/dist/src/mcp-server-manager.d.ts.map +0 -1
  85. package/dist/src/mcp-server-manager.js +0 -38
  86. package/dist/src/mcp-server-manager.js.map +0 -1
  87. package/dist/src/mcp-server.d.ts +0 -203
  88. package/dist/src/mcp-server.d.ts.map +0 -1
  89. package/dist/src/mcp-server.js +0 -1369
  90. package/dist/src/mcp-server.js.map +0 -1
  91. package/dist/src/metrics.d.ts +0 -97
  92. package/dist/src/metrics.d.ts.map +0 -1
  93. package/dist/src/metrics.js +0 -273
  94. package/dist/src/metrics.js.map +0 -1
  95. package/dist/src/naming-warnings.d.ts +0 -23
  96. package/dist/src/naming-warnings.d.ts.map +0 -1
  97. package/dist/src/naming-warnings.js +0 -83
  98. package/dist/src/naming-warnings.js.map +0 -1
  99. package/dist/src/naming.d.ts +0 -58
  100. package/dist/src/naming.d.ts.map +0 -1
  101. package/dist/src/naming.js +0 -510
  102. package/dist/src/naming.js.map +0 -1
  103. package/dist/src/oauth-provider.d.ts +0 -131
  104. package/dist/src/oauth-provider.d.ts.map +0 -1
  105. package/dist/src/oauth-provider.js +0 -836
  106. package/dist/src/oauth-provider.js.map +0 -1
  107. package/dist/src/openapi-parser.d.ts +0 -70
  108. package/dist/src/openapi-parser.d.ts.map +0 -1
  109. package/dist/src/openapi-parser.js +0 -436
  110. package/dist/src/openapi-parser.js.map +0 -1
  111. package/dist/src/profile-loader.d.ts +0 -78
  112. package/dist/src/profile-loader.d.ts.map +0 -1
  113. package/dist/src/profile-loader.js +0 -483
  114. package/dist/src/profile-loader.js.map +0 -1
  115. package/dist/src/profile-registry.d.ts +0 -18
  116. package/dist/src/profile-registry.d.ts.map +0 -1
  117. package/dist/src/profile-registry.js +0 -26
  118. package/dist/src/profile-registry.js.map +0 -1
  119. package/dist/src/profile-resolver.d.ts +0 -19
  120. package/dist/src/profile-resolver.d.ts.map +0 -1
  121. package/dist/src/profile-resolver.js +0 -167
  122. package/dist/src/profile-resolver.js.map +0 -1
  123. package/dist/src/proxy-executor.d.ts +0 -86
  124. package/dist/src/proxy-executor.d.ts.map +0 -1
  125. package/dist/src/proxy-executor.js +0 -497
  126. package/dist/src/proxy-executor.js.map +0 -1
  127. package/dist/src/schema-validator.d.ts +0 -30
  128. package/dist/src/schema-validator.d.ts.map +0 -1
  129. package/dist/src/schema-validator.js +0 -128
  130. package/dist/src/schema-validator.js.map +0 -1
  131. package/dist/src/startup-profile.d.ts +0 -17
  132. package/dist/src/startup-profile.d.ts.map +0 -1
  133. package/dist/src/startup-profile.js +0 -30
  134. package/dist/src/startup-profile.js.map +0 -1
  135. package/dist/src/startup-validation.d.ts +0 -11
  136. package/dist/src/startup-validation.d.ts.map +0 -1
  137. package/dist/src/startup-validation.js +0 -21
  138. package/dist/src/startup-validation.js.map +0 -1
  139. package/dist/src/tool-filter.d.ts +0 -65
  140. package/dist/src/tool-filter.d.ts.map +0 -1
  141. package/dist/src/tool-filter.js +0 -471
  142. package/dist/src/tool-filter.js.map +0 -1
  143. package/dist/src/tool-generator.d.ts +0 -67
  144. package/dist/src/tool-generator.d.ts.map +0 -1
  145. package/dist/src/tool-generator.js +0 -182
  146. package/dist/src/tool-generator.js.map +0 -1
  147. package/dist/src/validation-utils.d.ts +0 -49
  148. package/dist/src/validation-utils.d.ts.map +0 -1
  149. package/dist/src/validation-utils.js +0 -138
  150. package/dist/src/validation-utils.js.map +0 -1
  151. package/profiles/gitlab/developer-profile.json +0 -1508
  152. package/profiles/gitlab/developer-profile.test.json +0 -3432
@@ -1,193 +0,0 @@
1
- /**
2
- * Composite action executor for chaining API calls
3
- *
4
- * Why: Reduces roundtrips by fetching related data in sequence (e.g., MR + comments).
5
- * Aggregates results into single JSON structure as defined by store_as paths.
6
- */
7
- import { DAGExecutor } from './dag-executor.js';
8
- import { isSafePropertyName } from './validation-utils.js';
9
- export class CompositeExecutor {
10
- constructor(parser, httpClient, parameterAliases = {}) {
11
- this.parser = parser;
12
- this.httpClient = httpClient;
13
- this.parameterAliases = parameterAliases;
14
- }
15
- /**
16
- * Execute a series of API calls and merge results
17
- *
18
- * Why parallel: Steps may have dependencies, but independent steps can run concurrently.
19
- * Uses DAG analysis to determine safe parallelization while maintaining correctness.
20
- *
21
- * Supports partial results: If allowPartial=true, continues after errors and returns
22
- * what was completed. Useful for composite actions where some data is better than none.
23
- */
24
- async execute(steps, args, allowPartial = false, httpClient) {
25
- // Analyze DAG and get execution levels
26
- const executionLevels = DAGExecutor.topologicalSort(steps);
27
- const result = {};
28
- const errors = [];
29
- let completedSteps = 0;
30
- // Execute level by level (each level can run in parallel)
31
- for (const level of executionLevels) {
32
- // Execute all steps in current level concurrently
33
- const levelPromises = level.steps.map((step, levelIndex) => this.executeStep(step, level.stepIndices[levelIndex], args, httpClient));
34
- // Wait for all steps in this level to complete
35
- const levelResults = await Promise.allSettled(levelPromises);
36
- // Process results
37
- for (let i = 0; i < levelResults.length; i++) {
38
- const promiseResult = levelResults[i];
39
- const step = level.steps[i];
40
- const originalStepIndex = level.stepIndices[i];
41
- if (promiseResult.status === 'fulfilled') {
42
- // Step completed successfully
43
- const response = promiseResult.value;
44
- this.storeResult(result, step.store_as, response.body);
45
- completedSteps++;
46
- }
47
- else {
48
- // Step failed
49
- const error = promiseResult.reason;
50
- const stepError = {
51
- step_index: originalStepIndex,
52
- step_call: step.call,
53
- error: error instanceof Error ? error.message : String(error),
54
- timestamp: new Date().toISOString(),
55
- };
56
- errors.push(stepError);
57
- // Store error in result for debugging
58
- this.storeResult(result, `${step.store_as}_error`, stepError);
59
- if (!allowPartial) {
60
- throw new Error(`Composite step ${originalStepIndex + 1}/${steps.length} failed: ${stepError.error}\n` +
61
- `Completed steps: ${completedSteps}\n` +
62
- `Failed step: ${step.call}`);
63
- }
64
- }
65
- }
66
- }
67
- return {
68
- data: result,
69
- completed_steps: completedSteps,
70
- total_steps: steps.length,
71
- errors: errors.length > 0 ? errors : undefined,
72
- };
73
- }
74
- /**
75
- * Execute single composite step (extracted for parallel execution)
76
- *
77
- * @param step The composite step to execute
78
- * @param stepIndex Original index for error reporting
79
- * @param args Arguments for parameter substitution
80
- * @param httpClient Optional HTTP client override
81
- * @returns Promise resolving to HTTP response
82
- */
83
- async executeStep(step, stepIndex, args, httpClient) {
84
- const { method, path, operation } = this.parseCall(step.call);
85
- if (!operation) {
86
- throw new Error(`Operation not found for call: ${step.call}`);
87
- }
88
- // Substitute path parameters from args
89
- const resolvedPath = this.resolvePath(path, args);
90
- // Execute request
91
- const client = httpClient || this.httpClient;
92
- if (!client) {
93
- throw new Error('HTTP client not provided');
94
- }
95
- const response = await client.request(method, resolvedPath, {
96
- params: this.extractQueryParams(operation, args),
97
- operationId: operation.operationId,
98
- });
99
- return response;
100
- }
101
- /**
102
- * Parse composite step call syntax
103
- *
104
- * Format: "GET /projects/{id}/merge_requests/{iid}"
105
- */
106
- parseCall(call) {
107
- const [method, path] = call.split(' ');
108
- const pathInfo = this.parser.getPath(path);
109
- const operation = pathInfo?.operations[method.toLowerCase()];
110
- return { method, path, operation };
111
- }
112
- /**
113
- * Resolve path template with actual values
114
- *
115
- * Example: "/projects/{id}" + {id: "123"} => "/projects/123"
116
- * Supports parameter_aliases: {project_id: "123"} can map to {id} if configured
117
- */
118
- resolvePath(template, args) {
119
- return template.replace(/\{(\w+)\}/g, (_, key) => {
120
- // Try direct match first
121
- if (args[key] !== undefined) {
122
- return String(args[key]);
123
- }
124
- // Try aliases from profile
125
- const possibleAliases = this.parameterAliases[key] || [];
126
- for (const alias of possibleAliases) {
127
- if (args[alias] !== undefined) {
128
- return String(args[alias]);
129
- }
130
- }
131
- throw new Error(`Missing path parameter: ${key}` +
132
- (possibleAliases.length > 0 ? `. Tried aliases: ${possibleAliases.join(', ')}` : ''));
133
- });
134
- }
135
- /**
136
- * Extract query parameters from args based on operation definition
137
- */
138
- extractQueryParams(operation, args) {
139
- const params = {};
140
- for (const param of operation.parameters) {
141
- if (param.in === 'query' && args[param.name] !== undefined) {
142
- const value = args[param.name];
143
- // Pass arrays as-is for HttpClient serialization
144
- if (Array.isArray(value)) {
145
- params[param.name] = value.map(String);
146
- }
147
- else {
148
- params[param.name] = String(value);
149
- }
150
- }
151
- }
152
- return params;
153
- }
154
- /**
155
- * Store value at JSONPath-like location
156
- *
157
- * Why nested: Allows semantic structure (comments belong under merge_request object).
158
- *
159
- * Examples:
160
- * - "merge_request" => { merge_request: value }
161
- * - "merge_request.comments" => { merge_request: { comments: value } }
162
- *
163
- * Validates path navigation to prevent overwriting non-object values.
164
- */
165
- storeResult(target, path, value) {
166
- const parts = path.split('.');
167
- let current = target;
168
- for (let i = 0; i < parts.length - 1; i++) {
169
- const part = parts[i];
170
- // Prevent prototype pollution
171
- if (!isSafePropertyName(part)) {
172
- throw new Error(`Invalid property name in path: ${part}`);
173
- }
174
- const existing = current[part];
175
- // Validate we can navigate through this path
176
- if (existing !== undefined && (typeof existing !== 'object' || existing === null)) {
177
- throw new Error(`Cannot store at path '${path}': ` +
178
- `'${parts.slice(0, i + 1).join('.')}' is ${typeof existing}, not an object`);
179
- }
180
- if (!current[part]) {
181
- // nosemgrep: javascript.lang.security.audit.prototype-pollution.prototype-pollution-loop.prototype-pollution-loop
182
- current[part] = {};
183
- }
184
- current = current[part];
185
- }
186
- const finalKey = parts[parts.length - 1];
187
- if (!isSafePropertyName(finalKey)) {
188
- throw new Error(`Invalid property name in path: ${finalKey}`);
189
- }
190
- current[finalKey] = value;
191
- }
192
- }
193
- //# sourceMappingURL=composite-executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composite-executor.js","sourceRoot":"","sources":["../../src/composite-executor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,WAAW,EA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,IAAI,CAAC,EAAE,CAAC;gBACnB,kHAAkH;gBAClH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACrB,CAAC;YACD,OAAO,GAAG,OAAO,CAAC,IAAI,CAA4B,CAAC;QACrD,CAAC;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,EAAE,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;IAC5B,CAAC;CACF"}
@@ -1,85 +0,0 @@
1
- /**
2
- * Application constants
3
- *
4
- * Why: Centralized constants improve readability and maintainability.
5
- * Magic numbers scattered through code are harder to understand and change.
6
- */
7
- /**
8
- * Time conversion constants
9
- */
10
- export declare const TIME: {
11
- readonly MS_PER_SECOND: 1000;
12
- readonly MS_PER_MINUTE: 60000;
13
- readonly MS_PER_HOUR: 3600000;
14
- readonly SECONDS_PER_MINUTE: 60;
15
- readonly MINUTES_PER_HOUR: 60;
16
- };
17
- /**
18
- * HTTP status codes
19
- *
20
- * Why: Named constants more readable than numeric literals.
21
- * Makes intent clear (STATUS_TOO_MANY_REQUESTS vs 429).
22
- */
23
- export declare const HTTP_STATUS: {
24
- readonly OK: 200;
25
- readonly CREATED: 201;
26
- readonly ACCEPTED: 202;
27
- readonly FOUND: 302;
28
- readonly MULTIPLE_CHOICES: 300;
29
- readonly BAD_REQUEST: 400;
30
- readonly UNAUTHORIZED: 401;
31
- readonly FORBIDDEN: 403;
32
- readonly NOT_FOUND: 404;
33
- readonly METHOD_NOT_ALLOWED: 405;
34
- readonly NOT_ACCEPTABLE: 406;
35
- readonly TOO_MANY_REQUESTS: 429;
36
- readonly INTERNAL_SERVER_ERROR: 500;
37
- readonly BAD_GATEWAY: 502;
38
- readonly SERVICE_UNAVAILABLE: 503;
39
- readonly GATEWAY_TIMEOUT: 504;
40
- };
41
- /**
42
- * MIME type constants
43
- *
44
- * Why: Prevents typos in content-type headers and ensures consistency.
45
- */
46
- export declare const MIME_TYPES: {
47
- readonly JSON: "application/json";
48
- readonly EVENT_STREAM: "text/event-stream";
49
- readonly FORM_URLENCODED: "application/x-www-form-urlencoded";
50
- };
51
- /**
52
- * OAuth and Well-Known URL paths
53
- *
54
- * Why: Centralized OAuth-related paths for consistency and easy updates.
55
- */
56
- export declare const OAUTH_PATHS: {
57
- readonly AUTHORIZE: "/oauth/authorize";
58
- readonly TOKEN: "/oauth/token";
59
- readonly CALLBACK: "/oauth/callback";
60
- readonly REGISTER: "/oauth/register";
61
- readonly WELL_KNOWN_AUTHORIZATION_SERVER: "/.well-known/oauth-authorization-server";
62
- readonly WELL_KNOWN_PROTECTED_RESOURCE: "/.well-known/oauth-protected-resource/mcp";
63
- };
64
- /**
65
- * Default timeout and interval values (in milliseconds)
66
- *
67
- * Why: Centralized timing configuration for sessions, heartbeats, and cleanup.
68
- */
69
- export declare const TIMEOUTS: {
70
- readonly SESSION_TIMEOUT_MS: number;
71
- readonly HEARTBEAT_INTERVAL_MS: number;
72
- readonly RATE_LIMIT_WINDOW_MS: 60000;
73
- readonly CLEANUP_INTERVAL_MS: 60000;
74
- };
75
- /**
76
- * OAuth rate limiting defaults
77
- *
78
- * Why: Centralized OAuth rate limiting configuration to prevent duplication
79
- * and ensure consistency across mcp-server.ts and http-transport.ts
80
- */
81
- export declare const OAUTH_RATE_LIMIT: {
82
- readonly MAX_REQUESTS: 10;
83
- readonly WINDOW_MS: number;
84
- };
85
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;;CAMP,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAiBd,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;CAOd,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;;CAKX,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC"}
@@ -1,85 +0,0 @@
1
- /**
2
- * Application constants
3
- *
4
- * Why: Centralized constants improve readability and maintainability.
5
- * Magic numbers scattered through code are harder to understand and change.
6
- */
7
- /**
8
- * Time conversion constants
9
- */
10
- export const TIME = {
11
- MS_PER_SECOND: 1000,
12
- MS_PER_MINUTE: 60000,
13
- MS_PER_HOUR: 3600000,
14
- SECONDS_PER_MINUTE: 60,
15
- MINUTES_PER_HOUR: 60,
16
- };
17
- /**
18
- * HTTP status codes
19
- *
20
- * Why: Named constants more readable than numeric literals.
21
- * Makes intent clear (STATUS_TOO_MANY_REQUESTS vs 429).
22
- */
23
- export const HTTP_STATUS = {
24
- OK: 200,
25
- CREATED: 201,
26
- ACCEPTED: 202,
27
- FOUND: 302,
28
- MULTIPLE_CHOICES: 300,
29
- BAD_REQUEST: 400,
30
- UNAUTHORIZED: 401,
31
- FORBIDDEN: 403,
32
- NOT_FOUND: 404,
33
- METHOD_NOT_ALLOWED: 405,
34
- NOT_ACCEPTABLE: 406,
35
- TOO_MANY_REQUESTS: 429,
36
- INTERNAL_SERVER_ERROR: 500,
37
- BAD_GATEWAY: 502,
38
- SERVICE_UNAVAILABLE: 503,
39
- GATEWAY_TIMEOUT: 504,
40
- };
41
- /**
42
- * MIME type constants
43
- *
44
- * Why: Prevents typos in content-type headers and ensures consistency.
45
- */
46
- export const MIME_TYPES = {
47
- JSON: 'application/json',
48
- EVENT_STREAM: 'text/event-stream',
49
- FORM_URLENCODED: 'application/x-www-form-urlencoded',
50
- };
51
- /**
52
- * OAuth and Well-Known URL paths
53
- *
54
- * Why: Centralized OAuth-related paths for consistency and easy updates.
55
- */
56
- export const OAUTH_PATHS = {
57
- AUTHORIZE: '/oauth/authorize',
58
- TOKEN: '/oauth/token',
59
- CALLBACK: '/oauth/callback',
60
- REGISTER: '/oauth/register',
61
- WELL_KNOWN_AUTHORIZATION_SERVER: '/.well-known/oauth-authorization-server',
62
- WELL_KNOWN_PROTECTED_RESOURCE: '/.well-known/oauth-protected-resource/mcp',
63
- };
64
- /**
65
- * Default timeout and interval values (in milliseconds)
66
- *
67
- * Why: Centralized timing configuration for sessions, heartbeats, and cleanup.
68
- */
69
- export const TIMEOUTS = {
70
- SESSION_TIMEOUT_MS: 30 * TIME.MS_PER_MINUTE, // 30 minutes
71
- HEARTBEAT_INTERVAL_MS: 30 * TIME.MS_PER_SECOND, // 30 seconds
72
- RATE_LIMIT_WINDOW_MS: TIME.MS_PER_MINUTE, // 1 minute
73
- CLEANUP_INTERVAL_MS: TIME.MS_PER_MINUTE, // 1 minute
74
- };
75
- /**
76
- * OAuth rate limiting defaults
77
- *
78
- * Why: Centralized OAuth rate limiting configuration to prevent duplication
79
- * and ensure consistency across mcp-server.ts and http-transport.ts
80
- */
81
- export const OAUTH_RATE_LIMIT = {
82
- MAX_REQUESTS: 10, // Max OAuth requests per window
83
- WINDOW_MS: 10 * TIME.MS_PER_MINUTE, // 10 minutes window
84
- };
85
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,OAAO;IACpB,kBAAkB,EAAE,EAAE;IACtB,gBAAgB,EAAE,EAAE;CACZ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,EAAE,EAAE,GAAG;IACP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0 @@
1
- /**
2
- * DAG Execution Engine for Composite Steps
3
- *
4
- * Why: Enables parallel execution of independent composite steps
5
- * while maintaining correct dependency order.
6
- *
7
- * Uses Kahn's algorithm for topological sorting - BFS-based approach
8
- * that detects cycles and determines execution levels.
9
- */
10
- import type { CompositeStep } from './types/profile.js';
11
- /**
12
- * Execution level containing steps that can run in parallel
13
- */
14
- export interface ExecutionLevel {
15
- steps: CompositeStep[];
16
- stepIndices: number[];
17
- }
18
- /**
19
- * Topological sort result for DAG execution
20
- */
21
- export interface TopologicalSortResult {
22
- levels: ExecutionLevel[];
23
- hasCycles: boolean;
24
- errorMessage?: string;
25
- }
26
- /**
27
- * Execute composite steps with DAG-based parallelization
28
- *
29
- * Why: Some steps may depend on others (e.g., get MR ID, then fetch comments).
30
- * Independent steps can run in parallel for better performance.
31
- */
32
- export declare class DAGExecutor {
33
- /**
34
- * Sort composite steps into execution levels using Kahn's algorithm
35
- *
36
- * @param steps Composite steps with optional depends_on
37
- * @returns Execution levels where each level can run in parallel
38
- * @throws Error if cycles detected or invalid dependencies
39
- */
40
- static topologicalSort(steps: CompositeStep[]): ExecutionLevel[];
41
- /**
42
- * Analyze DAG structure without throwing
43
- *
44
- * @param steps Composite steps to analyze
45
- * @returns Analysis result with levels or error info
46
- */
47
- static analyzeDAG(steps: CompositeStep[]): TopologicalSortResult;
48
- }
49
- //# sourceMappingURL=dag-executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dag-executor.d.ts","sourceRoot":"","sources":["../../src/dag-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,cAAc,EAAE;IAQhE;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,qBAAqB;CAoHjE"}
@@ -1,138 +0,0 @@
1
- /**
2
- * DAG Execution Engine for Composite Steps
3
- *
4
- * Why: Enables parallel execution of independent composite steps
5
- * while maintaining correct dependency order.
6
- *
7
- * Uses Kahn's algorithm for topological sorting - BFS-based approach
8
- * that detects cycles and determines execution levels.
9
- */
10
- /**
11
- * Execute composite steps with DAG-based parallelization
12
- *
13
- * Why: Some steps may depend on others (e.g., get MR ID, then fetch comments).
14
- * Independent steps can run in parallel for better performance.
15
- */
16
- export class DAGExecutor {
17
- /**
18
- * Sort composite steps into execution levels using Kahn's algorithm
19
- *
20
- * @param steps Composite steps with optional depends_on
21
- * @returns Execution levels where each level can run in parallel
22
- * @throws Error if cycles detected or invalid dependencies
23
- */
24
- static topologicalSort(steps) {
25
- const result = this.analyzeDAG(steps);
26
- if (result.hasCycles) {
27
- throw new Error(`DAG analysis failed: ${result.errorMessage}`);
28
- }
29
- return result.levels;
30
- }
31
- /**
32
- * Analyze DAG structure without throwing
33
- *
34
- * @param steps Composite steps to analyze
35
- * @returns Analysis result with levels or error info
36
- */
37
- static analyzeDAG(steps) {
38
- // Build dependency graph and in-degree map
39
- const graph = new Map(); // node -> list of dependent nodes
40
- const inDegree = new Map();
41
- // Initialize all nodes
42
- for (const step of steps) {
43
- const node = step.store_as;
44
- inDegree.set(node, 0);
45
- if (!graph.has(node)) {
46
- graph.set(node, []);
47
- }
48
- }
49
- // Build edges and calculate in-degrees
50
- for (const step of steps) {
51
- if (step.depends_on) {
52
- for (const dep of step.depends_on) {
53
- // Validate dependency exists
54
- if (!inDegree.has(dep)) {
55
- return {
56
- levels: [],
57
- hasCycles: true,
58
- errorMessage: `Step '${step.store_as}' depends on '${dep}' but no step produces '${dep}'`
59
- };
60
- }
61
- // Add edge: dep -> step.store_as
62
- if (!graph.has(dep)) {
63
- graph.set(dep, []);
64
- }
65
- graph.get(dep).push(step.store_as);
66
- // Increase in-degree of dependent step
67
- inDegree.set(step.store_as, inDegree.get(step.store_as) + 1);
68
- }
69
- }
70
- }
71
- // Kahn's algorithm: BFS with in-degree
72
- const levels = [];
73
- const queue = [];
74
- // Start with nodes having in-degree 0 (no dependencies)
75
- for (const [node, degree] of inDegree) {
76
- if (degree === 0) {
77
- queue.push(node);
78
- }
79
- }
80
- // Process queue level by level
81
- while (queue.length > 0) {
82
- const currentLevel = [];
83
- const currentIndices = [];
84
- const levelSize = queue.length;
85
- // Process all nodes at current level (can run in parallel)
86
- for (let i = 0; i < levelSize; i++) {
87
- const node = queue.shift();
88
- // Find corresponding step and add to level
89
- const stepIndex = steps.findIndex(s => s.store_as === node);
90
- if (stepIndex >= 0) {
91
- currentLevel.push(steps[stepIndex]);
92
- currentIndices.push(stepIndex);
93
- }
94
- // Decrease in-degree of all dependent nodes
95
- const neighbors = graph.get(node) || [];
96
- for (const neighbor of neighbors) {
97
- const newDegree = inDegree.get(neighbor) - 1;
98
- inDegree.set(neighbor, newDegree);
99
- // If in-degree becomes 0, add to next level
100
- if (newDegree === 0) {
101
- queue.push(neighbor);
102
- }
103
- }
104
- }
105
- // Add level if it contains steps
106
- if (currentLevel.length > 0) {
107
- levels.push({ steps: currentLevel, stepIndices: currentIndices });
108
- }
109
- }
110
- // Check for cycles: if not all nodes were processed
111
- const processedCount = levels.reduce((sum, level) => sum + level.steps.length, 0);
112
- if (processedCount !== steps.length) {
113
- // Find unprocessed nodes (part of cycle)
114
- const processedNodes = new Set();
115
- for (const level of levels) {
116
- for (const step of level.steps) {
117
- processedNodes.add(step.store_as);
118
- }
119
- }
120
- const cycleNodes = [];
121
- for (const step of steps) {
122
- if (!processedNodes.has(step.store_as)) {
123
- cycleNodes.push(step.store_as);
124
- }
125
- }
126
- return {
127
- levels: [],
128
- hasCycles: true,
129
- errorMessage: `Circular dependency detected involving: ${cycleNodes.join(', ')}`
130
- };
131
- }
132
- return {
133
- levels,
134
- hasCycles: false
135
- };
136
- }
137
- }
138
- //# sourceMappingURL=dag-executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dag-executor.js","sourceRoot":"","sources":["../../src/dag-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAqBH;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,KAAsB;QAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,KAAsB;QACtC,2CAA2C;QAC3C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC,CAAC,kCAAkC;QAC7E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;QAE3C,uBAAuB;QACvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC3B,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrB,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QAED,uCAAuC;QACvC,KAAK,MAAM,IAA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AG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,cAAc,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;YACpC,yCAAyC;YACzC,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;YACzC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;oBAC/B,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC;YAED,MAAM,UAAU,GAAa,EAAE,CAAC;YAChC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACvC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC;YAED,OAAO;gBACL,MAAM,EAAE,EAAE;gBACV,SAAS,EAAE,IAAI;gBACf,YAAY,EAAE,2CAA2C,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aACjF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,MAAM;YACN,SAAS,EAAE,KAAK;SACjB,CAAC;IACJ,CAAC;CACF"}
@@ -1,59 +0,0 @@
1
- /**
2
- * Structured error types for MCP server
3
- *
4
- * Provides type-safe error handling with machine-readable error codes
5
- * and structured error details for better debugging and client handling.
6
- */
7
- export declare class MCPError extends Error {
8
- code: string;
9
- details?: Record<string, unknown> | undefined;
10
- constructor(message: string, code: string, details?: Record<string, unknown> | undefined);
11
- }
12
- export declare class ValidationError extends MCPError {
13
- constructor(message: string, details?: Record<string, unknown>);
14
- }
15
- export declare class OperationNotFoundError extends MCPError {
16
- constructor(operationId: string);
17
- }
18
- export declare class ResourceNotFoundError extends MCPError {
19
- constructor(resource: string, resourceType?: string);
20
- }
21
- export declare class ParameterError extends MCPError {
22
- constructor(paramName: string, reason: string);
23
- }
24
- export declare class AuthenticationError extends MCPError {
25
- constructor(message?: string, details?: Record<string, unknown>);
26
- }
27
- export declare class AuthorizationError extends MCPError {
28
- constructor(message?: string);
29
- }
30
- export declare class RateLimitError extends MCPError {
31
- constructor(message: string, retryAfter?: number);
32
- }
33
- export declare class NetworkError extends MCPError {
34
- constructor(message: string, statusCode?: number, details?: Record<string, unknown>);
35
- }
36
- export declare class ConfigurationError extends MCPError {
37
- constructor(message: string, details?: Record<string, unknown>);
38
- }
39
- export declare class SessionError extends MCPError {
40
- constructor(message: string, sessionId?: string);
41
- }
42
- export declare class UnknownCliFlagError extends MCPError {
43
- constructor(flags: string[]);
44
- }
45
- /**
46
- * Helper function to check if an error is an MCPError
47
- */
48
- export declare function isMCPError(error: unknown): error is MCPError;
49
- /**
50
- * Generate a unique correlation ID for error tracking
51
- *
52
- * Why: Allows matching client-reported errors with server logs
53
- */
54
- export declare function generateCorrelationId(): string;
55
- /**
56
- * Helper function to get error details for logging
57
- */
58
- export declare function getErrorDetails(error: unknown): Record<string, unknown>;
59
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,qBAAa,QAAS,SAAQ,KAAK;IAGxB,IAAI,EAAE,MAAM;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAFxC,OAAO,EAAE,MAAM,EACR,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;CAK3C;AAED,qBAAa,eAAgB,SAAQ,QAAQ;gBAC/B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC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