@theia/ai-mcp-server 1.67.0-next.3 → 1.67.0-next.56

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 (62) hide show
  1. package/README.md +37 -9
  2. package/package.json +4 -4
  3. package/lib/browser/index.d.ts +0 -3
  4. package/lib/browser/index.d.ts.map +0 -1
  5. package/lib/browser/index.js +0 -21
  6. package/lib/browser/index.js.map +0 -1
  7. package/lib/browser/mcp-frontend-bootstrap.d.ts +0 -17
  8. package/lib/browser/mcp-frontend-bootstrap.d.ts.map +0 -1
  9. package/lib/browser/mcp-frontend-bootstrap.js +0 -47
  10. package/lib/browser/mcp-frontend-bootstrap.js.map +0 -1
  11. package/lib/browser/mcp-frontend-contribution.d.ts +0 -44
  12. package/lib/browser/mcp-frontend-contribution.d.ts.map +0 -1
  13. package/lib/browser/mcp-frontend-contribution.js +0 -21
  14. package/lib/browser/mcp-frontend-contribution.js.map +0 -1
  15. package/lib/browser/mcp-frontend-module.d.ts +0 -4
  16. package/lib/browser/mcp-frontend-module.d.ts.map +0 -1
  17. package/lib/browser/mcp-frontend-module.js +0 -37
  18. package/lib/browser/mcp-frontend-module.js.map +0 -1
  19. package/lib/browser/mcp-tool-delegate-client.d.ts +0 -27
  20. package/lib/browser/mcp-tool-delegate-client.d.ts.map +0 -1
  21. package/lib/browser/mcp-tool-delegate-client.js +0 -128
  22. package/lib/browser/mcp-tool-delegate-client.js.map +0 -1
  23. package/lib/common/index.d.ts +0 -2
  24. package/lib/common/index.d.ts.map +0 -1
  25. package/lib/common/index.js +0 -20
  26. package/lib/common/index.js.map +0 -1
  27. package/lib/common/mcp-tool-delegate.d.ts +0 -25
  28. package/lib/common/mcp-tool-delegate.d.ts.map +0 -1
  29. package/lib/common/mcp-tool-delegate.js +0 -22
  30. package/lib/common/mcp-tool-delegate.js.map +0 -1
  31. package/lib/node/index.d.ts +0 -5
  32. package/lib/node/index.d.ts.map +0 -1
  33. package/lib/node/index.js +0 -23
  34. package/lib/node/index.js.map +0 -1
  35. package/lib/node/mcp-backend-contribution-manager.d.ts +0 -16
  36. package/lib/node/mcp-backend-contribution-manager.d.ts.map +0 -1
  37. package/lib/node/mcp-backend-contribution-manager.js +0 -61
  38. package/lib/node/mcp-backend-contribution-manager.js.map +0 -1
  39. package/lib/node/mcp-backend-module.d.ts +0 -4
  40. package/lib/node/mcp-backend-module.d.ts.map +0 -1
  41. package/lib/node/mcp-backend-module.js +0 -56
  42. package/lib/node/mcp-backend-module.js.map +0 -1
  43. package/lib/node/mcp-frontend-contribution-manager.d.ts +0 -55
  44. package/lib/node/mcp-frontend-contribution-manager.d.ts.map +0 -1
  45. package/lib/node/mcp-frontend-contribution-manager.js +0 -242
  46. package/lib/node/mcp-frontend-contribution-manager.js.map +0 -1
  47. package/lib/node/mcp-theia-server-impl.d.ts +0 -32
  48. package/lib/node/mcp-theia-server-impl.d.ts.map +0 -1
  49. package/lib/node/mcp-theia-server-impl.js +0 -220
  50. package/lib/node/mcp-theia-server-impl.js.map +0 -1
  51. package/lib/node/mcp-theia-server.d.ts +0 -43
  52. package/lib/node/mcp-theia-server.d.ts.map +0 -1
  53. package/lib/node/mcp-theia-server.js +0 -22
  54. package/lib/node/mcp-theia-server.js.map +0 -1
  55. package/lib/node/mcp-tool-frontend-delegate.d.ts +0 -13
  56. package/lib/node/mcp-tool-frontend-delegate.d.ts.map +0 -1
  57. package/lib/node/mcp-tool-frontend-delegate.js +0 -66
  58. package/lib/node/mcp-tool-frontend-delegate.js.map +0 -1
  59. package/lib/package.spec.d.ts +0 -1
  60. package/lib/package.spec.d.ts.map +0 -1
  61. package/lib/package.spec.js +0 -26
  62. package/lib/package.spec.js.map +0 -1
@@ -1,220 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.MCPTheiaServerImpl = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const logger_1 = require("@theia/core/lib/common/logger");
22
- const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
23
- const core_1 = require("@theia/core");
24
- const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
25
- const crypto_1 = require("crypto");
26
- const mcp_backend_contribution_manager_1 = require("./mcp-backend-contribution-manager");
27
- const mcp_frontend_contribution_manager_1 = require("./mcp-frontend-contribution-manager");
28
- let MCPTheiaServerImpl = class MCPTheiaServerImpl {
29
- constructor() {
30
- this.httpTransports = new Map();
31
- this.running = false;
32
- this.serverId = (0, core_1.generateUuid)();
33
- }
34
- async configure(app) {
35
- this.httpApp = app;
36
- try {
37
- await this.start();
38
- }
39
- catch (error) {
40
- this.logger.error('Failed to start MCP server during initialization:', error);
41
- }
42
- }
43
- async start() {
44
- if (this.running) {
45
- throw new Error('MCP server is already running');
46
- }
47
- this.server = new mcp_js_1.McpServer({
48
- name: 'Theia MCP Server',
49
- version: '1.0.0'
50
- }, {
51
- capabilities: {
52
- tools: {
53
- listChanged: true
54
- },
55
- resources: {
56
- listChanged: true
57
- },
58
- prompts: {
59
- listChanged: true
60
- }
61
- }
62
- });
63
- await this.registerContributions();
64
- await this.setupHttpTransport();
65
- this.running = true;
66
- }
67
- async stop() {
68
- if (!this.running) {
69
- return;
70
- }
71
- try {
72
- if (this.serverId) {
73
- await this.frontendContributionManager.unregisterFrontendContributions(this.serverId);
74
- }
75
- for (const transport of this.httpTransports.values()) {
76
- transport.close();
77
- }
78
- this.httpTransports.clear();
79
- if (this.server) {
80
- this.server.close();
81
- this.server = undefined;
82
- }
83
- this.running = false;
84
- }
85
- catch (error) {
86
- this.logger.error('Error stopping MCP server:', error);
87
- throw error;
88
- }
89
- }
90
- getServer() {
91
- return this.server;
92
- }
93
- isRunning() {
94
- return this.running;
95
- }
96
- getServerId() {
97
- return this.serverId;
98
- }
99
- async setupHttpTransport() {
100
- if (!this.server) {
101
- throw new Error('Server not initialized');
102
- }
103
- if (!this.httpApp) {
104
- throw new Error('AppServer not initialized');
105
- }
106
- this.setupHttpEndpoints(this.httpApp);
107
- }
108
- setupHttpEndpoints(app) {
109
- app.all('/mcp', async (req, res) => {
110
- await this.handleStreamableHttpRequest(req, res);
111
- });
112
- }
113
- async handleStreamableHttpRequest(req, res) {
114
- var _a;
115
- if (!this.server) {
116
- res.status(503).json({
117
- jsonrpc: '2.0',
118
- error: {
119
- code: -32000,
120
- message: 'MCP Server not initialized',
121
- },
122
- id: undefined,
123
- });
124
- return;
125
- }
126
- const sessionId = req.headers['mcp-session-id'];
127
- let transport;
128
- try {
129
- if (sessionId && this.httpTransports.has(sessionId)) {
130
- transport = this.httpTransports.get(sessionId);
131
- }
132
- else {
133
- transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
134
- sessionIdGenerator: () => (0, crypto_1.randomUUID)(),
135
- onsessioninitialized: newSessionId => {
136
- this.httpTransports.set(newSessionId, transport);
137
- }
138
- });
139
- transport.onclose = () => {
140
- if (transport.sessionId) {
141
- this.httpTransports.delete(transport.sessionId);
142
- }
143
- };
144
- await this.server.connect(transport);
145
- }
146
- await transport.handleRequest(req, res, req.body);
147
- }
148
- catch (error) {
149
- this.logger.error('Error handling MCP Streamable HTTP request:', error);
150
- if (!res.headersSent) {
151
- res.status(500).json({
152
- jsonrpc: '2.0',
153
- error: {
154
- code: -32603,
155
- message: `Internal server error: ${error}`,
156
- },
157
- id: ((_a = req.body) === null || _a === void 0 ? void 0 : _a.id) || undefined,
158
- });
159
- }
160
- }
161
- }
162
- async registerContributions() {
163
- if (!this.server) {
164
- throw new Error('Server not initialized');
165
- }
166
- await this.backendContributionManager.registerBackendContributions(this.server);
167
- await this.registerFrontendContributions();
168
- }
169
- async registerFrontendContributions() {
170
- if (!this.server) {
171
- throw new Error('Server not initialized');
172
- }
173
- try {
174
- await this.frontendContributionManager.setMCPServer(this.server, this.serverId);
175
- }
176
- catch (error) {
177
- this.logger.debug('Frontend contributions registration failed (this is normal if no frontend is connected):', error);
178
- }
179
- }
180
- onStop() {
181
- this.logger.debug('MCP Server stopping...');
182
- if (this.running) {
183
- try {
184
- if (this.serverId) {
185
- this.frontendContributionManager.unregisterFrontendContributions(this.serverId)
186
- .catch(error => this.logger.warn('Failed to unregister frontend contributions during shutdown:', error));
187
- }
188
- for (const transport of this.httpTransports.values()) {
189
- transport.close();
190
- }
191
- this.httpTransports.clear();
192
- if (this.server) {
193
- this.server.close();
194
- this.server = undefined;
195
- }
196
- this.running = false;
197
- }
198
- catch (error) {
199
- this.logger.error('Error stopping MCP server:', error);
200
- }
201
- }
202
- }
203
- };
204
- exports.MCPTheiaServerImpl = MCPTheiaServerImpl;
205
- tslib_1.__decorate([
206
- (0, inversify_1.inject)(logger_1.ILogger),
207
- tslib_1.__metadata("design:type", Object)
208
- ], MCPTheiaServerImpl.prototype, "logger", void 0);
209
- tslib_1.__decorate([
210
- (0, inversify_1.inject)(mcp_backend_contribution_manager_1.MCPBackendContributionManager),
211
- tslib_1.__metadata("design:type", mcp_backend_contribution_manager_1.MCPBackendContributionManager)
212
- ], MCPTheiaServerImpl.prototype, "backendContributionManager", void 0);
213
- tslib_1.__decorate([
214
- (0, inversify_1.inject)(mcp_frontend_contribution_manager_1.MCPFrontendContributionManager),
215
- tslib_1.__metadata("design:type", mcp_frontend_contribution_manager_1.MCPFrontendContributionManager)
216
- ], MCPTheiaServerImpl.prototype, "frontendContributionManager", void 0);
217
- exports.MCPTheiaServerImpl = MCPTheiaServerImpl = tslib_1.__decorate([
218
- (0, inversify_1.injectable)()
219
- ], MCPTheiaServerImpl);
220
- //# sourceMappingURL=mcp-theia-server-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-theia-server-impl.js","sourceRoot":"","sources":["../../src/node/mcp-theia-server-impl.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oCAAoC;AACpC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,0DAAwD;AAExD,oEAAoE;AACpE,sCAA2C;AAE3C,0FAAmG;AAEnG,mCAAoC;AAEpC,yFAAmF;AACnF,2FAAqF;AAG9E,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QAYO,mBAAc,GAA+C,IAAI,GAAG,EAAE,CAAC;QAEvE,YAAO,GAAG,KAAK,CAAC;QAChB,aAAQ,GAAW,IAAA,mBAAY,GAAE,CAAC;IAmMhD,CAAC;IAjMG,KAAK,CAAC,SAAS,CAAE,GAAwB;QACrC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QAEnB,IAAI,CAAC;YACD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mDAAmD,EAAE,KAAK,CAAC,CAAC;QAClF,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAS,CAAC;YACxB,IAAI,EAAE,kBAAk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BAC5B,CAAC;gBAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACzB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;YAC3D,CAAC;QACL,CAAC;IACL,CAAC;CACJ,CAAA;AAlNY,gDAAkB;AAGR;IADlB,IAAA,kBAAM,EAAC,gBAAO,CAAC;;kDACmB;AAGhB;IADlB,IAAA,kBAAM,EAAC,gEAA6B,CAAC;sCACS,gEAA6B;sEAAC;AAG1D;IADlB,IAAA,kBAAM,EAAC,kEAA8B,CAAC;sCACS,kEAA8B;uEAAC;6BATtE,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CAkN9B"}
@@ -1,43 +0,0 @@
1
- import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
2
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
- export declare const MCPTheiaServer: unique symbol;
4
- /**
5
- * Main interface for the Theia MCP server (backend only)
6
- */
7
- export interface MCPTheiaServer {
8
- /**
9
- * Start the MCP server with the given configuration
10
- */
11
- start(): Promise<void>;
12
- /**
13
- * Stop the MCP server
14
- */
15
- stop(): Promise<void>;
16
- /**
17
- * Get the underlying MCP server instance
18
- */
19
- getServer(): McpServer | undefined;
20
- /**
21
- * Get the server ID
22
- */
23
- getServerId(): string | undefined;
24
- /**
25
- * Check if the server is running
26
- */
27
- isRunning(): boolean;
28
- }
29
- export declare const MCPBackendContribution: unique symbol;
30
- /**
31
- * Contribution interface for extending the MCP server with backend-only contributions
32
- */
33
- export interface MCPBackendContribution {
34
- /**
35
- * Configure MCP server (for backend contributions)
36
- * @param server The MCP server instance to configure
37
- */
38
- configure(server: McpServer): Promise<void> | void;
39
- }
40
- export declare const MCPBackendContributionProvider: unique symbol;
41
- export interface MCPBackendContributionProvider extends ContributionProvider<MCPBackendContribution> {
42
- }
43
- //# sourceMappingURL=mcp-theia-server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-theia-server.d.ts","sourceRoot":"","sources":["../../src/node/mcp-theia-server.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,eAAO,MAAM,cAAc,eAA2B,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB;;OAEG;IACH,SAAS,IAAI,SAAS,GAAG,SAAS,CAAC;IAEnC;;OAEG;IACH,WAAW,IAAI,MAAM,GAAG,SAAS,CAAC;IAElC;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AACvF,MAAM,WAAW,8BAA+B,SAAQ,oBAAoB,CAAC,sBAAsB,CAAC;CAAI"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.MCPBackendContributionProvider = exports.MCPBackendContribution = exports.MCPTheiaServer = void 0;
19
- exports.MCPTheiaServer = Symbol('MCPTheiaServer');
20
- exports.MCPBackendContribution = Symbol('MCPBackendContribution');
21
- exports.MCPBackendContributionProvider = Symbol('MCPBackendContributionProvider');
22
- //# sourceMappingURL=mcp-theia-server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-theia-server.js","sourceRoot":"","sources":["../../src/node/mcp-theia-server.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oCAAoC;AACpC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAKnE,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAgC1C,QAAA,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAa1D,QAAA,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Tool, Resource, ResourceContents, Prompt, PromptMessage } from '@modelcontextprotocol/sdk/types.js';
2
- import { MCPToolFrontendDelegate, MCPToolDelegateClient } from '../common/mcp-tool-delegate';
3
- export declare class MCPToolFrontendDelegateImpl implements MCPToolFrontendDelegate {
4
- private client?;
5
- setClient(client: MCPToolDelegateClient): void;
6
- callTool(serverId: string, toolName: string, args: unknown): Promise<unknown>;
7
- listTools(serverId: string): Promise<Tool[]>;
8
- listResources(serverId: string): Promise<Resource[]>;
9
- readResource(serverId: string, uri: string): Promise<ResourceContents>;
10
- listPrompts(serverId: string): Promise<Prompt[]>;
11
- getPrompt(serverId: string, name: string, args: unknown): Promise<PromptMessage[]>;
12
- }
13
- //# sourceMappingURL=mcp-tool-frontend-delegate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-tool-frontend-delegate.d.ts","sourceRoot":"","sources":["../../src/node/mcp-tool-frontend-delegate.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC7G,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAE7F,qBACa,2BAA4B,YAAW,uBAAuB;IAEvE,OAAO,CAAC,MAAM,CAAC,CAAwB;IAEvC,SAAS,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI;IAIxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAO7E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAO5C,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAOpD,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAOtE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOhD,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAM3F"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.MCPToolFrontendDelegateImpl = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- let MCPToolFrontendDelegateImpl = class MCPToolFrontendDelegateImpl {
22
- setClient(client) {
23
- this.client = client;
24
- }
25
- async callTool(serverId, toolName, args) {
26
- if (!this.client) {
27
- throw new Error('MCPToolDelegateClient not set');
28
- }
29
- return this.client.callTool(serverId, toolName, args);
30
- }
31
- async listTools(serverId) {
32
- if (!this.client) {
33
- throw new Error('MCPToolDelegateClient not set');
34
- }
35
- return this.client.listTools(serverId);
36
- }
37
- async listResources(serverId) {
38
- if (!this.client) {
39
- throw new Error('MCPToolDelegateClient not set');
40
- }
41
- return this.client.listResources(serverId);
42
- }
43
- async readResource(serverId, uri) {
44
- if (!this.client) {
45
- throw new Error('MCPToolDelegateClient not set');
46
- }
47
- return this.client.readResource(serverId, uri);
48
- }
49
- async listPrompts(serverId) {
50
- if (!this.client) {
51
- throw new Error('MCPToolDelegateClient not set');
52
- }
53
- return this.client.listPrompts(serverId);
54
- }
55
- async getPrompt(serverId, name, args) {
56
- if (!this.client) {
57
- throw new Error('MCPToolDelegateClient not set');
58
- }
59
- return this.client.getPrompt(serverId, name, args);
60
- }
61
- };
62
- exports.MCPToolFrontendDelegateImpl = MCPToolFrontendDelegateImpl;
63
- exports.MCPToolFrontendDelegateImpl = MCPToolFrontendDelegateImpl = tslib_1.__decorate([
64
- (0, inversify_1.injectable)()
65
- ], MCPToolFrontendDelegateImpl);
66
- //# sourceMappingURL=mcp-tool-frontend-delegate.js.map
@@ -1 +0,0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QAC5C,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAAgB;QAC9B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,QAAgB,EAAE,IAAY,EAAE,IAAa;QACzD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;CACJ,CAAA;AAjDY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CAiDvC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=package.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2025 EclipseSource GmbH and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
- /* note: this bogus test file is required so that
17
- we are able to run mocha unit tests on this
18
- package, without having any actual unit tests in it.
19
- This way a coverage report will be generated,
20
- showing 0% coverage, instead of no report.
21
- This file can be removed once we have real unit
22
- tests in place. */
23
- describe('ai-mcp-server package', () => {
24
- it('support code coverage statistics', () => true);
25
- });
26
- //# sourceMappingURL=package.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;;;qBAMqB;AAErB,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IAEnC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}