@haneinfo/mcp-server 3.5.1 → 4.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 (84) hide show
  1. package/README.md +177 -12
  2. package/dist/admin-access.d.ts +24 -0
  3. package/dist/admin-access.d.ts.map +1 -0
  4. package/dist/admin-access.js +54 -0
  5. package/dist/admin-access.js.map +1 -0
  6. package/dist/authenticator.d.ts +31 -0
  7. package/dist/authenticator.d.ts.map +1 -0
  8. package/dist/authenticator.js +37 -0
  9. package/dist/authenticator.js.map +1 -0
  10. package/dist/deployment-config.d.ts +67 -0
  11. package/dist/deployment-config.d.ts.map +1 -0
  12. package/dist/deployment-config.js +157 -0
  13. package/dist/deployment-config.js.map +1 -0
  14. package/dist/discovery-push.service.d.ts +11 -9
  15. package/dist/discovery-push.service.d.ts.map +1 -1
  16. package/dist/discovery-push.service.js +27 -11
  17. package/dist/discovery-push.service.js.map +1 -1
  18. package/dist/enabled-resources.d.ts +53 -0
  19. package/dist/enabled-resources.d.ts.map +1 -0
  20. package/dist/enabled-resources.js +243 -0
  21. package/dist/enabled-resources.js.map +1 -0
  22. package/dist/iam-authenticator.d.ts +29 -0
  23. package/dist/iam-authenticator.d.ts.map +1 -0
  24. package/dist/iam-authenticator.js +269 -0
  25. package/dist/iam-authenticator.js.map +1 -0
  26. package/dist/index.d.ts +10 -3
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +10 -5
  29. package/dist/index.js.map +1 -1
  30. package/dist/mcp-tool.registry.d.ts +21 -76
  31. package/dist/mcp-tool.registry.d.ts.map +1 -1
  32. package/dist/mcp-tool.registry.js +66 -240
  33. package/dist/mcp-tool.registry.js.map +1 -1
  34. package/dist/mcp.controller.d.ts +21 -5
  35. package/dist/mcp.controller.d.ts.map +1 -1
  36. package/dist/mcp.controller.js +273 -48
  37. package/dist/mcp.controller.js.map +1 -1
  38. package/dist/mcp.module.d.ts +5 -0
  39. package/dist/mcp.module.d.ts.map +1 -1
  40. package/dist/mcp.module.js +71 -8
  41. package/dist/mcp.module.js.map +1 -1
  42. package/dist/mcp.service.d.ts +31 -18
  43. package/dist/mcp.service.d.ts.map +1 -1
  44. package/dist/mcp.service.js +784 -194
  45. package/dist/mcp.service.js.map +1 -1
  46. package/dist/pg-rate-limiter.d.ts +46 -0
  47. package/dist/pg-rate-limiter.d.ts.map +1 -0
  48. package/dist/pg-rate-limiter.js +161 -0
  49. package/dist/pg-rate-limiter.js.map +1 -0
  50. package/dist/plugin.d.ts +41 -4
  51. package/dist/plugin.d.ts.map +1 -1
  52. package/dist/plugin.js +23 -11
  53. package/dist/plugin.js.map +1 -1
  54. package/dist/prm.controller.d.ts +17 -0
  55. package/dist/prm.controller.d.ts.map +1 -0
  56. package/dist/prm.controller.js +77 -0
  57. package/dist/prm.controller.js.map +1 -0
  58. package/dist/protocol-config.d.ts +36 -0
  59. package/dist/protocol-config.d.ts.map +1 -0
  60. package/dist/protocol-config.js +142 -0
  61. package/dist/protocol-config.js.map +1 -0
  62. package/dist/rate-limit-config.d.ts +25 -0
  63. package/dist/rate-limit-config.d.ts.map +1 -0
  64. package/dist/rate-limit-config.js +85 -0
  65. package/dist/rate-limit-config.js.map +1 -0
  66. package/dist/rate-limit-http.d.ts +11 -0
  67. package/dist/rate-limit-http.d.ts.map +1 -0
  68. package/dist/rate-limit-http.js +68 -0
  69. package/dist/rate-limit-http.js.map +1 -0
  70. package/dist/request-state.d.ts +14 -9
  71. package/dist/request-state.d.ts.map +1 -1
  72. package/dist/request-state.js +37 -3
  73. package/dist/request-state.js.map +1 -1
  74. package/dist/types.d.ts +24 -7
  75. package/dist/types.d.ts.map +1 -1
  76. package/dist/types.js +3 -0
  77. package/dist/types.js.map +1 -1
  78. package/dist/write-confirmation.d.ts +82 -0
  79. package/dist/write-confirmation.d.ts.map +1 -0
  80. package/dist/write-confirmation.js +207 -0
  81. package/dist/write-confirmation.js.map +1 -0
  82. package/haneinfo.plugin.json +16 -8
  83. package/package.json +15 -3
  84. package/prisma/mcp-rate-limit.prisma +34 -0
@@ -1,65 +1,30 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
23
7
  };
24
- var __importStar = (this && this.__importStar) || (function () {
25
- var ownKeys = function(o) {
26
- ownKeys = Object.getOwnPropertyNames || function (o) {
27
- var ar = [];
28
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
- return ar;
30
- };
31
- return ownKeys(o);
32
- };
33
- return function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
- __setModuleDefault(result, mod);
38
- return result;
39
- };
40
- })();
41
8
  var __metadata = (this && this.__metadata) || function (k, v) {
42
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
43
10
  };
44
11
  var __param = (this && this.__param) || function (paramIndex, decorator) {
45
12
  return function (target, key) { decorator(target, key, paramIndex); }
46
13
  };
47
- var McpToolRegistry_1;
48
14
  Object.defineProperty(exports, "__esModule", { value: true });
49
- exports.McpToolRegistry = exports.MCP_TOOL_DISABLED = exports.MCP_DISABLED_TOOLS_SETTING = void 0;
15
+ exports.McpToolRegistry = exports.MCP_DISABLED_TOOLS_SETTING = void 0;
50
16
  exports.getConfiguredToolPrefix = getConfiguredToolPrefix;
51
17
  exports.getToolAliasPrefix = getToolAliasPrefix;
52
- exports.classifyToolAsReadOnly = classifyToolAsReadOnly;
53
- const pluginApiContract = __importStar(require("@haneinfo/plugin-api"));
18
+ const commands_1 = require("@haneinfo/commands");
54
19
  const plugin_api_1 = require("@haneinfo/plugin-api");
55
20
  const common_1 = require("@nestjs/common");
21
+ const enabled_resources_1 = require("./enabled-resources");
22
+ const types_1 = require("./types");
56
23
  /**
57
24
  * Built-in setting (decision 202610-e6c1, point 12), declared only when `@haneinfo/settings` is
58
- * installed: tool names listed here are hidden from tools/list and refused with TOOL_DISABLED.
25
+ * installed: command names listed here are hidden from `tools/list` and refused as `tool_unavailable`.
59
26
  */
60
27
  exports.MCP_DISABLED_TOOLS_SETTING = 'mcp-server.disabledTools';
61
- /** Error code returned (without running the handler) when a disabled tool is called by name. */
62
- exports.MCP_TOOL_DISABLED = 'TOOL_DISABLED';
63
28
  // Cross-app tool naming prefix (dev_docs 002 "consistent app prefixes across apps", dev_docs 023 §2.2) —
64
29
  // only `[a-zA-Z0-9_-]` is allowed because the prefixed name must also satisfy MCP tool-calling
65
30
  // name constraints (dev_docs 023 §3.1).
@@ -98,105 +63,46 @@ function getToolAliasPrefix() {
98
63
  }
99
64
  return prefix;
100
65
  }
101
- // Read/write action classification (dev_docs 002 "scope action read/write classification rules",
102
- // dev_docs 023 §2.3/§6.4) — this is the source `readOnlyHint` in mcp.service.ts is derived
103
- // from, and what the AI Agent Team app's single-write-per-invocation check (023 §3.5) relies
104
- // on. A tool with no declared scopes can't be classified, so it fails closed as a write tool
105
- // (same fail-closed posture as `actingUserId` in types.ts).
106
- const READ_ACTIONS = new Set(['read', 'list', 'get']);
107
- // Compatibility bridge for apps that consume this package from a local file before the
108
- // plugin-api release carrying the shared scope contract is published. Released installations use
109
- // plugin-api's implementation; the local fallback follows the same fail-closed grammar.
110
- function parseScopeContract(scope) {
111
- const shared = pluginApiContract.parseScope;
112
- if (shared)
113
- return shared(scope);
114
- const separator = scope.lastIndexOf(':');
115
- if (separator <= 0 || separator === scope.length - 1)
116
- return null;
117
- const resource = scope.slice(0, separator);
118
- const action = scope.slice(separator + 1);
119
- if (resource.split(':').some((segment) => segment.length === 0 || /[\s*]/.test(segment)) ||
120
- /\s/.test(action) ||
121
- action.includes(':')) {
122
- return null;
123
- }
124
- return { resource, action };
125
- }
126
- function matchScopeContract(grantedScopes, requiredScope) {
127
- const shared = pluginApiContract.matchScope;
128
- if (shared)
129
- return shared(grantedScopes, requiredScope);
130
- if (grantedScopes.includes('*'))
131
- return true;
132
- const required = parseScopeContract(requiredScope);
133
- if (!required || required.action === '*')
134
- return false;
135
- return grantedScopes.some((grantedScope) => {
136
- const granted = parseScopeContract(grantedScope);
137
- return (granted !== null &&
138
- granted.resource === required.resource &&
139
- (granted.action === '*' || granted.action === required.action));
140
- });
141
- }
142
- function classifyToolAsReadOnly(requiredScopes, mutates) {
143
- if (mutates)
144
- return false;
145
- if (requiredScopes.length === 0)
146
- return false;
147
- return requiredScopes.every((scope) => {
148
- const parsed = parseScopeContract(scope);
149
- return parsed !== null && READ_ACTIONS.has(parsed.action);
150
- });
151
- }
152
- let McpToolRegistry = McpToolRegistry_1 = class McpToolRegistry {
153
- constructor(scopeMatcher, settings, declarations) {
154
- this.scopeMatcher = scopeMatcher;
66
+ /**
67
+ * Manages `mcp-server.disabledTools` and generates discovery catalog snapshots from the sealed
68
+ * `@haneinfo/commands` registry (`mcp-connector-contract.md` §9.2; W5-04b).
69
+ */
70
+ let McpToolRegistry = class McpToolRegistry {
71
+ constructor(commandsOptions, settings, declarations, enabledResources) {
155
72
  this.settings = settings;
156
73
  this.declarations = declarations;
157
- this.logger = new common_1.Logger(McpToolRegistry_1.name);
158
- this.toolMap = new Map();
159
- // One entry per @McpTool(), pre-prefixing — the source list getCatalogSnapshot() derives
160
- // its external-facing names from, so a dual-registered tool isn't reported twice (023 §2.1
161
- // discovery push, T-9700).
162
- this.logicalTools = [];
163
- /** Registered name (bare or prefixed alias) -> logical name, for the disabled-tools setting. */
164
- this.logicalNames = new Map();
165
- /** Last value of mcp-server.disabledTools; always empty without @haneinfo/settings. */
74
+ this.enabledResources = enabledResources;
75
+ /** Last value of `mcp-server.disabledTools`; always empty without `@haneinfo/settings`. */
166
76
  this.disabled = new Set();
167
- /**
168
- * Runtime-changing tool sources (decision 202610-c5e8, e.g. @haneinfo/mcp-generated-tools).
169
- * Without a source every map below stays empty and the registry behaves exactly as before.
170
- */
171
- this.sources = [];
172
- /** Current source tools by registered name (bare or prefixed alias); rebuilt on refresh. */
173
- this.dynamicMap = new Map();
174
- /** Current source tools, pre-prefixing. */
175
- this.dynamicLogical = [];
176
- /** Registered source-tool name (bare or alias) -> logical name. */
177
- this.dynamicLogicalNames = new Map();
178
- this.skippedSourceNames = new Set();
77
+ if (commandsOptions?.commands) {
78
+ this.commands = commandsOptions.commands;
79
+ }
80
+ else {
81
+ const empty = (0, commands_1.createCommandRegistry)();
82
+ empty.seal();
83
+ this.commands = empty;
84
+ }
179
85
  }
180
- /** Declares mcp-server.disabledTools when the optional settings capability is installed. */
86
+ /** Declares `mcp-server.disabledTools` when the optional settings capability is installed. */
181
87
  onModuleInit() {
182
88
  this.declarations?.register({
183
89
  code: exports.MCP_DISABLED_TOOLS_SETTING,
184
90
  kind: 'setting',
185
91
  type: 'stringList',
186
- description: 'MCP tool names to switch off: they disappear from tools/list and a direct call is refused with TOOL_DISABLED. Names that do not exist are ignored.',
92
+ description: 'MCP tool names to switch off: they disappear from tools/list and a direct call is refused as unavailable. Names that do not exist are ignored.',
187
93
  default: [],
188
94
  maxItems: 200,
189
95
  maxLength: 128,
190
96
  pattern: '[A-Za-z0-9_.-]+',
191
- knownItems: () => [...this.logicalTools, ...this.dynamicLogical].map((tool) => tool.name),
97
+ knownItems: () => this.knownCommandNames(),
192
98
  });
193
99
  }
194
- /** True only when @haneinfo/settings is installed; otherwise no tool can ever be disabled. */
100
+ /** True only when `@haneinfo/settings` is installed; otherwise no tool can ever be disabled. */
195
101
  get disabledToolsSupported() {
196
102
  return this.settings !== undefined;
197
103
  }
198
104
  /**
199
- * Re-reads mcp-server.disabledTools (served from the settings cache) before a request. Without
105
+ * Re-reads `mcp-server.disabledTools` (served from the settings cache) before a request. Without
200
106
  * settings it does nothing. A failed read propagates, so a disabled tool never runs by accident.
201
107
  */
202
108
  async refreshDisabledTools() {
@@ -206,146 +112,66 @@ let McpToolRegistry = McpToolRegistry_1 = class McpToolRegistry {
206
112
  this.disabled = new Set(Array.isArray(names) ? names : []);
207
113
  return this.disabled;
208
114
  }
209
- /** Whether a registered (or aliased) tool name is currently switched off. */
115
+ /** Whether a command (by bare name or prefixed alias) is currently switched off. */
210
116
  isToolDisabled(name) {
211
117
  if (this.disabled.size === 0)
212
118
  return false;
213
- return this.disabled.has(this.logicalNames.get(name) ?? this.dynamicLogicalNames.get(name) ?? name);
214
- }
215
- /**
216
- * Adds a runtime-changing tool source (decision 202610-c5e8). Its tools never override a
217
- * registered tool, and MCP requests see them only after `refreshToolSources`.
218
- */
219
- registerToolSource(source) {
220
- this.sources.push(source);
221
- }
222
- /** True once a tool source is registered; false keeps every request path exactly as before. */
223
- get hasToolSources() {
224
- return this.sources.length > 0;
225
- }
226
- /**
227
- * Lets every source recompute (each one throttles itself), then rebuilds the source tools. A
228
- * name already registered, or taken by an earlier source tool, is skipped with one warning.
229
- */
230
- async refreshToolSources() {
231
- if (this.sources.length === 0)
232
- return;
233
- await Promise.all(this.sources.map((source) => source.refresh()));
234
- const aliasPrefix = getToolAliasPrefix();
235
- const map = new Map();
236
- const logical = [];
237
- const names = new Map();
238
- const take = (name, tool, logicalName) => {
239
- if (this.toolMap.has(name) || map.has(name)) {
240
- if (!this.skippedSourceNames.has(name))
241
- this.logger.warn(`Generated tool "${name}" skipped: the name is already registered`);
242
- this.skippedSourceNames.add(name);
243
- return false;
244
- }
245
- map.set(name, tool);
246
- names.set(name, logicalName);
119
+ if (this.disabled.has(name))
247
120
  return true;
248
- };
249
- for (const source of this.sources)
250
- for (const tool of source.tools()) {
251
- if (!take(tool.name, tool, tool.name))
252
- continue;
253
- logical.push(tool);
254
- if (aliasPrefix)
255
- take(`${aliasPrefix}_${tool.name}`, { ...tool, name: `${aliasPrefix}_${tool.name}` }, tool.name);
256
- }
257
- this.dynamicMap = map;
258
- this.dynamicLogical = logical;
259
- this.dynamicLogicalNames = names;
260
- }
261
- /** The current source tool registered under `name` (bare or alias), if any. */
262
- getSourceTool(name) {
263
- return this.dynamicMap.get(name);
264
- }
265
- /** Current source tools by registered name (aliases included), as of the last refresh. */
266
- getSourceTools() {
267
- return Array.from(this.dynamicMap.values());
268
- }
269
- hasScopesFor(ctx, tool) {
270
- return tool.requiredScopes.every((scope) => this.matchesScope(ctx.scopes, scope));
271
- }
272
- /**
273
- * Whether this exact registration is visible to the caller. `includeDisabled` lets a direct call
274
- * reach the handler wrapper, which then answers TOOL_DISABLED instead of running the tool.
275
- */
276
- isListed(ctx, tool, options = {}) {
277
- return ((this.toolMap.get(tool.name) === tool || this.dynamicMap.get(tool.name) === tool) &&
278
- this.hasScopesFor(ctx, tool) &&
279
- (options.includeDisabled === true || !this.isToolDisabled(tool.name)));
280
- }
281
- listTools(ctx) {
282
- return [...this.toolMap.values(), ...this.dynamicMap.values()].filter((tool) => this.hasScopesFor(ctx, tool) && !this.isToolDisabled(tool.name));
283
- }
284
- /** A registered tool, or else the current source tool of that name. */
285
- getTool(name) {
286
- return this.toolMap.get(name) ?? this.dynamicMap.get(name);
287
- }
288
- /**
289
- * Internal registration inventory of registered tools (source tools: getSourceTools); request
290
- * visibility must still go through listTools.
291
- */
292
- getAllTools() {
293
- return Array.from(this.toolMap.values());
294
- }
295
- getToolCount() {
296
- return this.toolMap.size;
297
- }
298
- /**
299
- * Registers `tool` under its bare name. When `MCP_TOOL_PREFIXED_ALIASES=true` is set, it is also
300
- * registered as `<MCP_TOOL_PREFIX>_<name>` pointing at the same handler/scopes. Aliases are off by
301
- * default; the bare name is the canonical one.
302
- */
303
- registerTool(tool) {
304
- this.registerSingle(tool);
305
- this.logicalTools.push(tool);
306
- this.logicalNames.set(tool.name, tool.name);
307
121
  const aliasPrefix = getToolAliasPrefix();
308
- if (aliasPrefix) {
309
- this.registerSingle({ ...tool, name: `${aliasPrefix}_${tool.name}` });
310
- this.logicalNames.set(`${aliasPrefix}_${tool.name}`, tool.name);
122
+ if (aliasPrefix && name.startsWith(`${aliasPrefix}_`)) {
123
+ return this.disabled.has(name.slice(aliasPrefix.length + 1));
311
124
  }
125
+ return false;
312
126
  }
313
127
  /**
314
- * External-facing catalog snapshot (023 §2.1 discovery push, T-9700) — one entry per
315
- * logical tool, named however an outside caller would actually have to call it: the bare name,
316
- * or the prefixed alias when aliases are enabled.
128
+ * External-facing catalog snapshot derived from enabled resource surfaces
129
+ * (023 §2.1 discovery push, T-9700; `mcp-connector-contract.md` §1, §7.3, §9.2).
317
130
  */
318
- getCatalogSnapshot() {
131
+ getCatalogSnapshot(kinds) {
132
+ const effectiveKinds = kinds ?? this.enabledResources?.getEnabledKinds() ?? ['employee'];
319
133
  const aliasPrefix = getToolAliasPrefix();
320
- return this.logicalTools.map((tool) => ({
321
- name: aliasPrefix ? `${aliasPrefix}_${tool.name}` : tool.name,
322
- description: tool.description,
323
- requiredScopes: tool.requiredScopes,
324
- readOnlyHint: classifyToolAsReadOnly(tool.requiredScopes, tool.mutates),
325
- }));
326
- }
327
- matchesScope(grantedScopes, requiredScope) {
328
- if (this.scopeMatcher) {
329
- return this.scopeMatcher.matches(grantedScopes, requiredScope);
134
+ const byName = new Map();
135
+ for (const kind of effectiveKinds) {
136
+ const surface = kind === 'admin' ? 'mcp-admin' : 'mcp';
137
+ for (const cmd of this.commands.list(surface)) {
138
+ if (this.enabledResources &&
139
+ !this.enabledResources.isCommandScopeAllowed(kind, cmd.scope)) {
140
+ continue;
141
+ }
142
+ const name = aliasPrefix ? `${aliasPrefix}_${cmd.name}` : cmd.name;
143
+ if (!byName.has(name)) {
144
+ byName.set(name, {
145
+ name,
146
+ description: cmd.description ?? '',
147
+ requiredScopes: [cmd.scope],
148
+ readOnlyHint: cmd.access === 'read',
149
+ });
150
+ }
151
+ }
330
152
  }
331
- return matchScopeContract(grantedScopes, requiredScope);
153
+ return [...byName.values()].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
332
154
  }
333
- registerSingle(tool) {
334
- if (this.toolMap.has(tool.name)) {
335
- this.logger.log(`Tool "${tool.name}" re-registered, overriding the previous definition`);
336
- }
337
- this.toolMap.set(tool.name, tool);
155
+ knownCommandNames() {
156
+ const names = new Set();
157
+ for (const cmd of this.commands.list('mcp'))
158
+ names.add(cmd.name);
159
+ for (const cmd of this.commands.list('mcp-admin'))
160
+ names.add(cmd.name);
161
+ return [...names].sort();
338
162
  }
339
163
  };
340
164
  exports.McpToolRegistry = McpToolRegistry;
341
- exports.McpToolRegistry = McpToolRegistry = McpToolRegistry_1 = __decorate([
165
+ exports.McpToolRegistry = McpToolRegistry = __decorate([
342
166
  (0, common_1.Injectable)(),
343
167
  __param(0, (0, common_1.Optional)()),
344
- __param(0, (0, common_1.Inject)(plugin_api_1.SCOPE_MATCHER)),
168
+ __param(0, (0, common_1.Inject)(types_1.MCP_COMMANDS_OPTIONS)),
345
169
  __param(1, (0, common_1.Optional)()),
346
170
  __param(1, (0, common_1.Inject)(plugin_api_1.SETTINGS)),
347
171
  __param(2, (0, common_1.Optional)()),
348
172
  __param(2, (0, common_1.Inject)(plugin_api_1.SETTING_DECLARATIONS)),
349
- __metadata("design:paramtypes", [Object, Object, Object])
173
+ __param(3, (0, common_1.Optional)()),
174
+ __param(3, (0, common_1.Inject)(enabled_resources_1.McpEnabledResources)),
175
+ __metadata("design:paramtypes", [Object, Object, Object, enabled_resources_1.McpEnabledResources])
350
176
  ], McpToolRegistry);
351
177
  //# sourceMappingURL=mcp-tool.registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-tool.registry.js","sourceRoot":"","sources":["../src/mcp-tool.registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,0DASC;AASD,gDAWC;AAyDD,wDAOC;AA9HD,wEAA0D;AAC1D,qDAU8B;AAC9B,2CAAyF;AAGzF;;;GAGG;AACU,QAAA,0BAA0B,GAAG,0BAA0B,CAAC;AACrE,gGAAgG;AACnF,QAAA,iBAAiB,GAAG,eAAe,CAAC;AAEjD,yGAAyG;AACzG,+FAA+F;AAC/F,wCAAwC;AACxC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C;;;;GAIG;AACH,SAAgB,uBAAuB;IACrC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IAC3C,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACb,oBAAoB,MAAM,6BAA6B,mBAAmB,uBAAuB,CAClG,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB;IAChC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;IACnD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,OAAO;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C,GAAG,CAAC,IAAI,CAAC,CAAC;QACvE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAA;AA7GY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAOR,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,4BAAoB,CAAC,CAAA;IAE5B,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,qBAAQ,CAAC,CAAA;IAEhB,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,iCAAoB,CAAC,CAAA;IAE5B,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,uCAAmB,CAAC,CAAA;6DACQ,uCAAmB;GAjB9C,eAAe,CA6G3B"}
@@ -1,16 +1,32 @@
1
+ import { type McpRateLimiterPort } from '@haneinfo/plugin-api';
1
2
  import type { Request, Response } from 'express';
3
+ import { type McpRequestAuthenticator } from './authenticator';
4
+ import { type McpIamDeploymentConfig } from './deployment-config';
5
+ import { McpEnabledResources } from './enabled-resources';
2
6
  import { McpService } from './mcp.service';
3
- import { McpToolRegistry } from './mcp-tool.registry';
7
+ import { type McpProtocolConfig } from './protocol-config';
8
+ import { type McpRateLimitConfig } from './rate-limit-config';
4
9
  /**
5
10
  * Extracts the correlation workflow id from request headers.
6
11
  */
7
12
  export declare function extractWorkflowId(headers: Record<string, unknown>): string | null;
8
13
  export declare class McpController {
9
14
  private readonly mcpService;
10
- private readonly registry;
15
+ private readonly rateLimiter?;
11
16
  private readonly nodeHandler;
12
- constructor(mcpService: McpService, registry: McpToolRegistry);
13
- handlePost(req: Request, res: Response): Promise<void>;
14
- getHealth(challenge?: string): object;
17
+ private readonly legacy2025NodeHandler;
18
+ private readonly authenticator;
19
+ private readonly rateLimitConfig;
20
+ private readonly protocolConfig;
21
+ private readonly enabledResources;
22
+ private readonly concurrencyLimiter;
23
+ constructor(mcpService: McpService, authenticator?: McpRequestAuthenticator, _deployment?: McpIamDeploymentConfig, rateLimiter?: McpRateLimiterPort | undefined, rateLimitConfig?: McpRateLimitConfig, protocolConfig?: McpProtocolConfig, enabledResources?: McpEnabledResources);
24
+ handleEmployee(req: Request, res: Response): Promise<void>;
25
+ handleAdmin(req: Request, res: Response): Promise<void>;
26
+ getHealth(challenge: string | undefined, res: Response, req?: Request): Promise<{
27
+ status: 'ok';
28
+ challenge?: string;
29
+ }>;
30
+ private handleMcpRequest;
15
31
  }
16
32
  //# sourceMappingURL=mcp.controller.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.controller.d.ts","sourceRoot":"","sources":["../src/mcp.controller.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKtD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAGjF;AAID,qBACa,aAAa;IAItB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAGV,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,eAAe;IAOtC,UAAU,CAAQ,GAAG,EAAE,OAAO,EAA+B,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAwDhG,SAAS,CAAqB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;CAW1D"}
1
+ {"version":3,"file":"mcp.controller.d.ts","sourceRoot":"","sources":["../src/mcp.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,K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