@theia/ai-registry 1.73.0-next.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 (78) hide show
  1. package/README.md +40 -0
  2. package/lib/browser/ai-registry-frontend-module.d.ts +5 -0
  3. package/lib/browser/ai-registry-frontend-module.d.ts.map +1 -0
  4. package/lib/browser/ai-registry-frontend-module.js +45 -0
  5. package/lib/browser/ai-registry-frontend-module.js.map +1 -0
  6. package/lib/browser/ai-registry-toolbar-contribution.d.ts +9 -0
  7. package/lib/browser/ai-registry-toolbar-contribution.d.ts.map +1 -0
  8. package/lib/browser/ai-registry-toolbar-contribution.js +53 -0
  9. package/lib/browser/ai-registry-toolbar-contribution.js.map +1 -0
  10. package/lib/browser/mcp/mcp-entries.d.ts +40 -0
  11. package/lib/browser/mcp/mcp-entries.d.ts.map +1 -0
  12. package/lib/browser/mcp/mcp-entries.js +143 -0
  13. package/lib/browser/mcp/mcp-entries.js.map +1 -0
  14. package/lib/browser/mcp/mcp-extensions-contribution.d.ts +45 -0
  15. package/lib/browser/mcp/mcp-extensions-contribution.d.ts.map +1 -0
  16. package/lib/browser/mcp/mcp-extensions-contribution.js +198 -0
  17. package/lib/browser/mcp/mcp-extensions-contribution.js.map +1 -0
  18. package/lib/browser/mcp/mcp-extensions-contribution.spec.d.ts +2 -0
  19. package/lib/browser/mcp/mcp-extensions-contribution.spec.d.ts.map +1 -0
  20. package/lib/browser/mcp/mcp-extensions-contribution.spec.js +266 -0
  21. package/lib/browser/mcp/mcp-extensions-contribution.spec.js.map +1 -0
  22. package/lib/browser/mcp/mcp-install-service.d.ts +72 -0
  23. package/lib/browser/mcp/mcp-install-service.d.ts.map +1 -0
  24. package/lib/browser/mcp/mcp-install-service.js +255 -0
  25. package/lib/browser/mcp/mcp-install-service.js.map +1 -0
  26. package/lib/browser/mcp/mcp-install-service.spec.d.ts +2 -0
  27. package/lib/browser/mcp/mcp-install-service.spec.d.ts.map +1 -0
  28. package/lib/browser/mcp/mcp-install-service.spec.js +604 -0
  29. package/lib/browser/mcp/mcp-install-service.spec.js.map +1 -0
  30. package/lib/browser/mcp/mcp-registry-ui-bridge-impl.d.ts +27 -0
  31. package/lib/browser/mcp/mcp-registry-ui-bridge-impl.d.ts.map +1 -0
  32. package/lib/browser/mcp/mcp-registry-ui-bridge-impl.js +136 -0
  33. package/lib/browser/mcp/mcp-registry-ui-bridge-impl.js.map +1 -0
  34. package/lib/common/ai-registry-configuration.d.ts +28 -0
  35. package/lib/common/ai-registry-configuration.d.ts.map +1 -0
  36. package/lib/common/ai-registry-configuration.js +56 -0
  37. package/lib/common/ai-registry-configuration.js.map +1 -0
  38. package/lib/common/mcp/mcp-registry-entry-resolver.d.ts +12 -0
  39. package/lib/common/mcp/mcp-registry-entry-resolver.d.ts.map +1 -0
  40. package/lib/common/mcp/mcp-registry-entry-resolver.js +68 -0
  41. package/lib/common/mcp/mcp-registry-entry-resolver.js.map +1 -0
  42. package/lib/common/mcp/mcp-registry-entry-resolver.spec.d.ts +2 -0
  43. package/lib/common/mcp/mcp-registry-entry-resolver.spec.d.ts.map +1 -0
  44. package/lib/common/mcp/mcp-registry-entry-resolver.spec.js +230 -0
  45. package/lib/common/mcp/mcp-registry-entry-resolver.spec.js.map +1 -0
  46. package/lib/common/mcp/mcp-registry-types.d.ts +105 -0
  47. package/lib/common/mcp/mcp-registry-types.d.ts.map +1 -0
  48. package/lib/common/mcp/mcp-registry-types.js +18 -0
  49. package/lib/common/mcp/mcp-registry-types.js.map +1 -0
  50. package/lib/common/registry-fetch-service.d.ts +24 -0
  51. package/lib/common/registry-fetch-service.d.ts.map +1 -0
  52. package/lib/common/registry-fetch-service.js +72 -0
  53. package/lib/common/registry-fetch-service.js.map +1 -0
  54. package/lib/common/registry-fetch-service.spec.d.ts +2 -0
  55. package/lib/common/registry-fetch-service.spec.d.ts.map +1 -0
  56. package/lib/common/registry-fetch-service.spec.js +129 -0
  57. package/lib/common/registry-fetch-service.spec.js.map +1 -0
  58. package/lib/package.spec.d.ts +1 -0
  59. package/lib/package.spec.d.ts.map +1 -0
  60. package/lib/package.spec.js +26 -0
  61. package/lib/package.spec.js.map +1 -0
  62. package/package.json +50 -0
  63. package/src/browser/ai-registry-frontend-module.ts +48 -0
  64. package/src/browser/ai-registry-toolbar-contribution.ts +51 -0
  65. package/src/browser/mcp/mcp-entries.tsx +288 -0
  66. package/src/browser/mcp/mcp-extensions-contribution.spec.ts +294 -0
  67. package/src/browser/mcp/mcp-extensions-contribution.ts +199 -0
  68. package/src/browser/mcp/mcp-install-service.spec.ts +673 -0
  69. package/src/browser/mcp/mcp-install-service.ts +300 -0
  70. package/src/browser/mcp/mcp-registry-ui-bridge-impl.ts +130 -0
  71. package/src/browser/style/mcp-entries.css +56 -0
  72. package/src/common/ai-registry-configuration.ts +52 -0
  73. package/src/common/mcp/mcp-registry-entry-resolver.spec.ts +248 -0
  74. package/src/common/mcp/mcp-registry-entry-resolver.ts +68 -0
  75. package/src/common/mcp/mcp-registry-types.ts +119 -0
  76. package/src/common/registry-fetch-service.spec.ts +136 -0
  77. package/src/common/registry-fetch-service.ts +78 -0
  78. package/src/package.spec.ts +28 -0
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource GmbH.
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
+ const chai_1 = require("chai");
19
+ const ai_registry_configuration_1 = require("../ai-registry-configuration");
20
+ const mcp_registry_entry_resolver_1 = require("./mcp-registry-entry-resolver");
21
+ function createResolver(toolName = 'theia-ide') {
22
+ const resolver = new mcp_registry_entry_resolver_1.MCPRegistryEntryResolverImpl();
23
+ const configuration = Object.assign(new ai_registry_configuration_1.AIRegistryConfiguration(), {
24
+ getToolName() {
25
+ return toolName;
26
+ }
27
+ });
28
+ Object.assign(resolver, { configuration });
29
+ return resolver;
30
+ }
31
+ describe('MCPRegistryEntryResolver.resolve', () => {
32
+ let resolver;
33
+ beforeEach(() => {
34
+ resolver = createResolver();
35
+ });
36
+ it('normalises a server with a single approval, install config and inner server, propagating configHash', () => {
37
+ const raw = {
38
+ serverId: 'io.github.example/example-mcp',
39
+ name: 'Example',
40
+ description: 'Example MCP server',
41
+ mcpRegistryVerified: true,
42
+ approvals: [{
43
+ organizationId: 'theia',
44
+ date: '2026-04-01',
45
+ version: '^1.0.0',
46
+ configHash: 'hash-v1',
47
+ installConfigs: [{
48
+ tool: 'theia-ide',
49
+ config: { servers: { example: { command: 'npx', args: ['-y', 'example-mcp'] } } }
50
+ }]
51
+ }]
52
+ };
53
+ (0, chai_1.expect)(resolver.resolve(raw)).to.deep.equal({
54
+ serverId: 'io.github.example/example-mcp',
55
+ name: 'Example',
56
+ description: 'Example MCP server',
57
+ localName: 'example',
58
+ config: { command: 'npx', args: ['-y', 'example-mcp'] },
59
+ version: '^1.0.0',
60
+ configHash: 'hash-v1',
61
+ mcpRegistryVerified: true
62
+ });
63
+ });
64
+ it('omits configHash when the approval has none - supports payloads pre-dating the field', () => {
65
+ const raw = {
66
+ serverId: 'io.github.example/legacy-mcp',
67
+ name: 'Legacy',
68
+ description: 'Legacy MCP server with no configHash',
69
+ mcpRegistryVerified: true,
70
+ approvals: [{
71
+ organizationId: 'theia',
72
+ date: '2026-04-01',
73
+ version: '^1.0.0',
74
+ installConfigs: [{
75
+ tool: 'theia-ide',
76
+ config: { servers: { legacy: { command: 'npx', args: ['-y', 'legacy-mcp'] } } }
77
+ }]
78
+ }]
79
+ };
80
+ const resolved = resolver.resolve(raw);
81
+ (0, chai_1.expect)(resolved).to.not.have.property('configHash');
82
+ (0, chai_1.expect)(resolved?.version).to.equal('^1.0.0');
83
+ });
84
+ it('picks the most recent approval when multiple organisations approved the same server', () => {
85
+ const raw = {
86
+ serverId: 'io.github.example/example-mcp',
87
+ name: 'Example',
88
+ description: 'Example MCP server',
89
+ mcpRegistryVerified: true,
90
+ approvals: [
91
+ {
92
+ organizationId: 'older-org',
93
+ date: '2025-01-01',
94
+ version: '^0.5.0',
95
+ installConfigs: [{
96
+ tool: 'theia-ide',
97
+ config: { servers: { example: { command: 'old-cmd' } } }
98
+ }]
99
+ },
100
+ {
101
+ organizationId: 'newer-org',
102
+ date: '2026-04-01',
103
+ version: '^1.0.0',
104
+ installConfigs: [{
105
+ tool: 'theia-ide',
106
+ config: { servers: { example: { command: 'new-cmd' } } }
107
+ }]
108
+ }
109
+ ]
110
+ };
111
+ const resolved = resolver.resolve(raw);
112
+ (0, chai_1.expect)(resolved?.version).to.equal('^1.0.0');
113
+ (0, chai_1.expect)(resolved?.config).to.deep.equal({ command: 'new-cmd' });
114
+ });
115
+ it('returns undefined when the server has no approvals', () => {
116
+ const raw = {
117
+ serverId: 'io.github.example/orphan',
118
+ name: 'Orphan',
119
+ description: 'No approvals',
120
+ mcpRegistryVerified: false,
121
+ approvals: []
122
+ };
123
+ (0, chai_1.expect)(resolver.resolve(raw)).to.be.undefined;
124
+ });
125
+ it('returns undefined when the picked approval has no usable install config', () => {
126
+ const raw = {
127
+ serverId: 'io.github.example/empty',
128
+ name: 'Empty',
129
+ description: 'Approval with no usable config',
130
+ mcpRegistryVerified: false,
131
+ approvals: [{
132
+ organizationId: 'theia',
133
+ date: '2026-04-01',
134
+ version: '^1.0.0',
135
+ installConfigs: [{ tool: 'theia-ide' }]
136
+ }]
137
+ };
138
+ (0, chai_1.expect)(resolver.resolve(raw)).to.be.undefined;
139
+ });
140
+ it('picks the install config matching the configured tool name when multiple are present', () => {
141
+ const productResolver = createResolver('my-product');
142
+ const raw = {
143
+ serverId: 'io.github.example/multi-tool',
144
+ name: 'Multi Tool',
145
+ description: 'Approval carrying configs for several tools',
146
+ mcpRegistryVerified: true,
147
+ approvals: [{
148
+ organizationId: 'theia',
149
+ date: '2026-04-01',
150
+ version: '^1.0.0',
151
+ installConfigs: [
152
+ { tool: 'theia-ide', config: { servers: { example: { command: 'theia-cmd' } } } },
153
+ { tool: 'my-product', config: { servers: { example: { command: 'product-cmd' } } } }
154
+ ]
155
+ }]
156
+ };
157
+ (0, chai_1.expect)(productResolver.resolve(raw)?.config).to.deep.equal({ command: 'product-cmd' });
158
+ });
159
+ it('accepts an untagged install config as a fallback when no tool-specific config matches', () => {
160
+ const productResolver = createResolver('my-product');
161
+ const raw = {
162
+ serverId: 'io.github.example/untagged',
163
+ name: 'Untagged',
164
+ description: 'Approval whose install config has no tool tag',
165
+ mcpRegistryVerified: true,
166
+ approvals: [{
167
+ organizationId: 'theia',
168
+ date: '2026-04-01',
169
+ version: '^1.0.0',
170
+ installConfigs: [
171
+ { config: { servers: { example: { command: 'untagged-cmd' } } } }
172
+ ]
173
+ }]
174
+ };
175
+ (0, chai_1.expect)(productResolver.resolve(raw)?.config).to.deep.equal({ command: 'untagged-cmd' });
176
+ });
177
+ it("accepts every install config when the configured tool name is 'all'", () => {
178
+ const allResolver = createResolver('all');
179
+ const raw = {
180
+ serverId: 'io.github.example/all',
181
+ name: 'Any tool',
182
+ description: 'Approval whose install config is tagged for a different tool',
183
+ mcpRegistryVerified: true,
184
+ approvals: [{
185
+ organizationId: 'theia',
186
+ date: '2026-04-01',
187
+ version: '^1.0.0',
188
+ installConfigs: [
189
+ { tool: 'other-tool', config: { servers: { example: { command: 'other-cmd' } } } }
190
+ ]
191
+ }]
192
+ };
193
+ (0, chai_1.expect)(allResolver.resolve(raw)?.config).to.deep.equal({ command: 'other-cmd' });
194
+ });
195
+ it('warns and picks the first key deterministically when the install config exposes multiple servers', () => {
196
+ const raw = {
197
+ serverId: 'io.github.example/multi-server',
198
+ name: 'Multi Server',
199
+ description: 'Approval whose install config exposes multiple servers',
200
+ mcpRegistryVerified: true,
201
+ approvals: [{
202
+ organizationId: 'theia',
203
+ date: '2026-04-01',
204
+ version: '^1.0.0',
205
+ installConfigs: [{
206
+ tool: 'theia-ide',
207
+ config: {
208
+ servers: {
209
+ primary: { command: 'first-cmd' },
210
+ secondary: { command: 'second-cmd' }
211
+ }
212
+ }
213
+ }]
214
+ }]
215
+ };
216
+ const warnings = [];
217
+ const originalWarn = console.warn;
218
+ console.warn = (...args) => { warnings.push(args.map(String).join(' ')); };
219
+ try {
220
+ const resolved = resolver.resolve(raw);
221
+ (0, chai_1.expect)(resolved?.localName).to.equal('primary');
222
+ (0, chai_1.expect)(resolved?.config).to.deep.equal({ command: 'first-cmd' });
223
+ (0, chai_1.expect)(warnings.some(w => w.includes('multiple servers'))).to.equal(true);
224
+ }
225
+ finally {
226
+ console.warn = originalWarn;
227
+ }
228
+ });
229
+ });
230
+ //# sourceMappingURL=mcp-registry-entry-resolver.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-registry-entry-resolver.spec.js","sourceRoot":"","sources":["../../../src/common/mcp/mcp-registry-entry-resolver.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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,+BAA8B;AAC9B,4EAAuE;AACvE,+EAAuG;AAGvG,SAAS,cAAc,CAAC,WAAmB,WAAW;IAClD,MAAM,QAAQ,GAAG,IAAI,0DAA4B,EAAE,CAAC;IACpD,MAAM,aAAa,GAA4B,MAAM,CAAC,MAAM,CAAC,IAAI,mDAA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E,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9E,CAAC;gBAAS,CAAC;YACP,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC;QAChC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { MCPInstallEntryConfig } from '@theia/ai-mcp/lib/common/mcp-server-manager';
2
+ /**
3
+ * Shape of `installConfigs[].config` for Theia: a `servers` map keyed by the local
4
+ * MCP server key chosen by the registry maintainer. Server entries use the canonical
5
+ * {@link MCPInstallEntryConfig} type from `@theia/ai-mcp` so the registry and the
6
+ * install path can never drift in shape.
7
+ */
8
+ export interface RegistryMCPInstallConfigBlob {
9
+ servers: Record<string, MCPInstallEntryConfig>;
10
+ }
11
+ /**
12
+ * A single install config inside an approval. Already filtered per-tool by the registry
13
+ * for the per-tool view (`<baseUrl>/<toolName>.json`).
14
+ */
15
+ export interface RegistryInstallConfig {
16
+ tool?: string;
17
+ installUrl?: string;
18
+ openVsxUrl?: string;
19
+ config?: RegistryMCPInstallConfigBlob;
20
+ instructions?: string;
21
+ }
22
+ /**
23
+ * One organization's approval of an MCP server entry, with the install configs for the
24
+ * tools that organization approved.
25
+ */
26
+ export interface RegistryApproval {
27
+ organizationId: string;
28
+ date: string;
29
+ /** Pinned server version (per the AI-registry approval schema). Omitted means "use the latest from the Anthropic MCP registry". */
30
+ version?: string;
31
+ /**
32
+ * Content hash of the approval produced by the registry's consolidation pipeline.
33
+ * Drives update detection on the client - when the hash differs from the locally
34
+ * stored `registryMetadata.configHash`, the registry has published a new approval
35
+ * and Theia offers an Update action. Optional for backwards compatibility with
36
+ * older payloads that pre-date the field.
37
+ */
38
+ configHash?: string;
39
+ installConfigs: RegistryInstallConfig[];
40
+ }
41
+ /**
42
+ * Top-level MCP server entry as returned by the registry's per-tool JSON endpoint.
43
+ */
44
+ export interface RegistryMCPServer {
45
+ serverId: string;
46
+ name: string;
47
+ description: string;
48
+ mcpRegistryVerified: boolean;
49
+ approvals: RegistryApproval[];
50
+ }
51
+ /**
52
+ * A registry MCP entry after resolving the (potentially multiple) approvals and install configs
53
+ * down to the single (key, config, version) tuple the install service operates on.
54
+ *
55
+ * Resolution lives in the fetch layer; the install service expects this normalised shape.
56
+ */
57
+ export interface ResolvedRegistryEntry {
58
+ serverId: string;
59
+ name: string;
60
+ description: string;
61
+ /** The local preference key the registry maintainer chose (inner config.servers key). */
62
+ localName: string;
63
+ /** The config blob to write into `ai-features.mcp.mcpServers[localName]`. */
64
+ config: MCPInstallEntryConfig;
65
+ /** Registry-published version. Stored alongside installed entries for display only - update detection uses {@link configHash}. */
66
+ version?: string;
67
+ /**
68
+ * Content hash of the chosen approval - compared against the local
69
+ * `registryMetadata.configHash` to decide whether an Update is available. Optional
70
+ * for backwards compatibility with older registry payloads - when absent the client
71
+ * does not offer Update, since "no hash" is not evidence of a new version.
72
+ */
73
+ configHash?: string;
74
+ /** True if the entry is verified against the Anthropic MCP registry - drives the "verified only" search filter. */
75
+ mcpRegistryVerified: boolean;
76
+ }
77
+ /**
78
+ * Outcome of classifying an entry against the opposite side (registry -> local prefs
79
+ * for search/list views, or local prefs -> registry for the Installed view).
80
+ *
81
+ * Not every state is producible in both directions:
82
+ *
83
+ * - `not-installed` is only produced by `classifyRegistryEntry`.
84
+ * - `installed-user-added` is only produced by `classifyLocalServer`.
85
+ * - `installed-link-stale` is produced by both classifiers - `classifyLocalServer`
86
+ * when a linked local points to an unknown id, and `classifyRegistryEntry` when the
87
+ * key-matching local does so. The Installed and Search views show the same Unlink
88
+ * and Uninstall affordances in either case.
89
+ * - `installed-from-registry`, `installed-manually`, and `fix-config` are common.
90
+ */
91
+ export type ClassificationResult = {
92
+ kind: 'installed-from-registry';
93
+ updateAvailable: boolean;
94
+ } | {
95
+ kind: 'installed-manually';
96
+ } | {
97
+ kind: 'fix-config';
98
+ } | {
99
+ kind: 'not-installed';
100
+ } | {
101
+ kind: 'installed-link-stale';
102
+ } | {
103
+ kind: 'installed-user-added';
104
+ };
105
+ //# sourceMappingURL=mcp-registry-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-registry-types.d.ts","sourceRoot":"","sources":["../../../src/common/mcp/mcp-registry-types.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,4BAA4B,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mIAAmI;IACnI,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,qBAAqB,EAAE,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,gBAAgB,EAAE,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,MAAM,EAAE,qBAAqB,CAAC;IAC9B,kIAAkI;IAClI,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mHAAmH;IACnH,mBAAmB,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,oBAAoB,GAC1B;IAAE,IAAI,EAAE,yBAAyB,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource GmbH.
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
+ //# sourceMappingURL=mcp-registry-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-registry-types.js","sourceRoot":"","sources":["../../../src/common/mcp/mcp-registry-types.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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"}
@@ -0,0 +1,24 @@
1
+ import { Emitter, Event } from '@theia/core';
2
+ import { RequestService } from '@theia/core/shared/@theia/request';
3
+ import { AIRegistryConfiguration } from './ai-registry-configuration';
4
+ import { MCPRegistryEntryResolver } from './mcp/mcp-registry-entry-resolver';
5
+ import { ResolvedRegistryEntry } from './mcp/mcp-registry-types';
6
+ export declare const RegistryFetchService: unique symbol;
7
+ export interface RegistryFetchService {
8
+ /** Fires whenever the cached set of resolved entries changes (initial load, manual refresh). */
9
+ readonly onDidChange: Event<void>;
10
+ /** Returns the resolved registry entries, fetching (and caching) them on first use or when `forceRefresh` is set. */
11
+ getEntries(forceRefresh?: boolean): Promise<ResolvedRegistryEntry[]>;
12
+ }
13
+ export declare class RegistryFetchServiceImpl implements RegistryFetchService {
14
+ protected readonly requestService: RequestService;
15
+ protected readonly configuration: AIRegistryConfiguration;
16
+ protected readonly resolver: MCPRegistryEntryResolver;
17
+ protected cached: ResolvedRegistryEntry[] | undefined;
18
+ protected readonly onDidChangeEmitter: Emitter<void>;
19
+ /** Fires whenever the cached set of resolved entries changes (initial load, manual refresh). */
20
+ readonly onDidChange: Event<void>;
21
+ getEntries(forceRefresh?: boolean): Promise<ResolvedRegistryEntry[]>;
22
+ protected buildEndpointUrl(): string;
23
+ }
24
+ //# sourceMappingURL=registry-fetch-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-fetch-service.d.ts","sourceRoot":"","sources":["../../src/common/registry-fetch-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAkB,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAqB,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAMpF,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,MAAM,WAAW,oBAAoB;IACjC,gGAAgG;IAChG,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,qHAAqH;IACrH,UAAU,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;CACxE;AAED,qBACa,wBAAyB,YAAW,oBAAoB;IAGjE,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,uBAAuB,CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAEtD,SAAS,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IAEtD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,gBAAuB;IAC5D,gGAAgG;IAChG,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAiC;IAE5D,UAAU,CAAC,YAAY,GAAE,OAAe,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAkBjF,SAAS,CAAC,gBAAgB,IAAI,MAAM;CAMvC"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource GmbH.
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.RegistryFetchServiceImpl = exports.RegistryFetchService = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const core_1 = require("@theia/core");
21
+ const inversify_1 = require("@theia/core/shared/inversify");
22
+ const request_1 = require("@theia/core/shared/@theia/request");
23
+ const ai_registry_configuration_1 = require("./ai-registry-configuration");
24
+ const mcp_registry_entry_resolver_1 = require("./mcp/mcp-registry-entry-resolver");
25
+ exports.RegistryFetchService = Symbol('RegistryFetchService');
26
+ let RegistryFetchServiceImpl = class RegistryFetchServiceImpl {
27
+ constructor() {
28
+ this.onDidChangeEmitter = new core_1.Emitter();
29
+ /** Fires whenever the cached set of resolved entries changes (initial load, manual refresh). */
30
+ this.onDidChange = this.onDidChangeEmitter.event;
31
+ }
32
+ async getEntries(forceRefresh = false) {
33
+ if (this.cached && !forceRefresh) {
34
+ return this.cached;
35
+ }
36
+ const url = this.buildEndpointUrl();
37
+ const context = await this.requestService.request({ url });
38
+ if (!request_1.RequestContext.isSuccess(context)) {
39
+ throw new Error(`Failed to fetch AI registry from ${url}: HTTP ${context.res.statusCode ?? 'unknown'}`);
40
+ }
41
+ const data = request_1.RequestContext.asJson(context);
42
+ const entries = (data.mcp ?? [])
43
+ .map(server => this.resolver.resolve(server))
44
+ .filter((entry) => entry !== undefined);
45
+ this.cached = entries;
46
+ this.onDidChangeEmitter.fire();
47
+ return entries;
48
+ }
49
+ buildEndpointUrl() {
50
+ const base = this.configuration.getBaseUrl();
51
+ const tool = this.configuration.getToolName();
52
+ const separator = base.endsWith('/') ? '' : '/';
53
+ return `${base}${separator}${tool}.json`;
54
+ }
55
+ };
56
+ exports.RegistryFetchServiceImpl = RegistryFetchServiceImpl;
57
+ tslib_1.__decorate([
58
+ (0, inversify_1.inject)(request_1.RequestService),
59
+ tslib_1.__metadata("design:type", Object)
60
+ ], RegistryFetchServiceImpl.prototype, "requestService", void 0);
61
+ tslib_1.__decorate([
62
+ (0, inversify_1.inject)(ai_registry_configuration_1.AIRegistryConfiguration),
63
+ tslib_1.__metadata("design:type", ai_registry_configuration_1.AIRegistryConfiguration)
64
+ ], RegistryFetchServiceImpl.prototype, "configuration", void 0);
65
+ tslib_1.__decorate([
66
+ (0, inversify_1.inject)(mcp_registry_entry_resolver_1.MCPRegistryEntryResolver),
67
+ tslib_1.__metadata("design:type", Object)
68
+ ], RegistryFetchServiceImpl.prototype, "resolver", void 0);
69
+ exports.RegistryFetchServiceImpl = RegistryFetchServiceImpl = tslib_1.__decorate([
70
+ (0, inversify_1.injectable)()
71
+ ], RegistryFetchServiceImpl);
72
+ //# sourceMappingURL=registry-fetch-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-fetch-service.js","sourceRoot":"","sources":["../../src/common/registry-fetch-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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,sCAA6C;AAC7C,4DAAkE;AAClE,+DAAmF;AACnF,2EAAsE;AACtE,mFAA6E;AAOhE,QAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAS5D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QAagB,uBAAkB,GAAG,IAAI,cAAO,EAAQ,CAAC;QAC5D,gGAAgG;QACvF,gBAAW,GAAgB,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;IA0BtE,CAAC;IAxBG,KAAK,CAAC,UAAU,CAAC,eAAwB,KAAK;QAC1C,IAAI,IAAI,CAAC,MA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AwB;AAGd;IADlB,IAAA,kBAAM,EAAC,wBAAc,CAAC;;gEAC2B;AAG/B;IADlB,IAAA,kBAAM,EAAC,mDAAuB,CAAC;sCACE,mDAAuB;+DAAC;AAGvC;IADlB,IAAA,kBAAM,EAAC,sDAAwB,CAAC;;0DACqB;mCAT7C,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAyCpC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=registry-fetch-service.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-fetch-service.spec.d.ts","sourceRoot":"","sources":["../../src/common/registry-fetch-service.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource GmbH.
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
+ const chai_1 = require("chai");
19
+ const inversify_1 = require("@theia/core/shared/inversify");
20
+ const request_1 = require("@theia/core/shared/@theia/request");
21
+ const ai_registry_configuration_1 = require("./ai-registry-configuration");
22
+ const mcp_registry_entry_resolver_1 = require("./mcp/mcp-registry-entry-resolver");
23
+ const registry_fetch_service_1 = require("./registry-fetch-service");
24
+ class FakeRequestService {
25
+ constructor(responseBody, statusCode = 200) {
26
+ this.responseBody = responseBody;
27
+ this.statusCode = statusCode;
28
+ this.callCount = 0;
29
+ }
30
+ async configure() { }
31
+ async resolveProxy() { return undefined; }
32
+ async request(options) {
33
+ this.lastUrl = options.url;
34
+ this.callCount += 1;
35
+ return {
36
+ url: options.url,
37
+ res: { headers: {}, statusCode: this.statusCode },
38
+ buffer: new TextEncoder().encode(this.responseBody)
39
+ };
40
+ }
41
+ }
42
+ class FakeConfiguration extends ai_registry_configuration_1.AIRegistryConfiguration {
43
+ constructor(toolName, baseUrl) {
44
+ super();
45
+ this.toolName = toolName;
46
+ this.baseUrl = baseUrl;
47
+ }
48
+ getToolName() { return this.toolName; }
49
+ getBaseUrl() { return this.baseUrl; }
50
+ }
51
+ function payload() {
52
+ return JSON.stringify({
53
+ organizations: [],
54
+ tools: [],
55
+ mcp: [{
56
+ serverId: 'io.github.example/example-mcp',
57
+ name: 'Example',
58
+ description: 'Example MCP server',
59
+ mcpRegistryVerified: true,
60
+ approvals: [{
61
+ organizationId: 'theia',
62
+ date: '2026-04-01',
63
+ version: '^1.0.0',
64
+ configHash: 'hash-v1',
65
+ installConfigs: [{
66
+ tool: 'theia-ide',
67
+ config: { servers: { example: { command: 'npx', args: ['-y', 'example-mcp'] } } }
68
+ }]
69
+ }]
70
+ }]
71
+ });
72
+ }
73
+ describe('RegistryFetchService', () => {
74
+ function buildContainer(requestService, config) {
75
+ const container = new inversify_1.Container();
76
+ container.bind(request_1.RequestService).toConstantValue(requestService);
77
+ container.bind(ai_registry_configuration_1.AIRegistryConfiguration).toConstantValue(config);
78
+ container.bind(mcp_registry_entry_resolver_1.MCPRegistryEntryResolverImpl).toSelf().inSingletonScope();
79
+ container.bind(mcp_registry_entry_resolver_1.MCPRegistryEntryResolver).toService(mcp_registry_entry_resolver_1.MCPRegistryEntryResolverImpl);
80
+ container.bind(registry_fetch_service_1.RegistryFetchServiceImpl).toSelf().inSingletonScope();
81
+ container.bind(registry_fetch_service_1.RegistryFetchService).toService(registry_fetch_service_1.RegistryFetchServiceImpl);
82
+ return container;
83
+ }
84
+ it('fetches the per-tool JSON from <baseUrl>/<toolName>.json and returns resolved entries', async () => {
85
+ const request = new FakeRequestService(payload());
86
+ const config = new FakeConfiguration('theia-ide', 'https://example.test/api/v1/');
87
+ const service = buildContainer(request, config).get(registry_fetch_service_1.RegistryFetchService);
88
+ const entries = await service.getEntries();
89
+ (0, chai_1.expect)(request.lastUrl).to.equal('https://example.test/api/v1/theia-ide.json');
90
+ (0, chai_1.expect)(entries).to.have.length(1);
91
+ (0, chai_1.expect)(entries[0]).to.deep.equal({
92
+ serverId: 'io.github.example/example-mcp',
93
+ name: 'Example',
94
+ description: 'Example MCP server',
95
+ localName: 'example',
96
+ config: { command: 'npx', args: ['-y', 'example-mcp'] },
97
+ version: '^1.0.0',
98
+ configHash: 'hash-v1',
99
+ mcpRegistryVerified: true
100
+ });
101
+ });
102
+ it('serves cached entries on a second call without issuing a new request', async () => {
103
+ const request = new FakeRequestService(payload());
104
+ const service = buildContainer(request, new FakeConfiguration('theia-ide', 'https://example.test/api/v1/')).get(registry_fetch_service_1.RegistryFetchService);
105
+ await service.getEntries();
106
+ await service.getEntries();
107
+ (0, chai_1.expect)(request.callCount).to.equal(1);
108
+ });
109
+ it('refetches when forceRefresh is true', async () => {
110
+ const request = new FakeRequestService(payload());
111
+ const service = buildContainer(request, new FakeConfiguration('theia-ide', 'https://example.test/api/v1/')).get(registry_fetch_service_1.RegistryFetchService);
112
+ await service.getEntries();
113
+ await service.getEntries(true);
114
+ (0, chai_1.expect)(request.callCount).to.equal(2);
115
+ });
116
+ it('throws a descriptive error when the server returns a non-success status', async () => {
117
+ const request = new FakeRequestService('', 404);
118
+ const service = buildContainer(request, new FakeConfiguration('theia-ide', 'https://example.test/api/v1/')).get(registry_fetch_service_1.RegistryFetchService);
119
+ let caught;
120
+ try {
121
+ await service.getEntries();
122
+ }
123
+ catch (error) {
124
+ caught = error;
125
+ }
126
+ (0, chai_1.expect)(caught?.message).to.match(/HTTP 404/);
127
+ });
128
+ });
129
+ //# sourceMappingURL=registry-fetch-service.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-fetch-service.spec.js","sourceRoot":"","sources":["../../src/common/registry-fetch-service.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,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,+BAA8B;AAC9B,4DAAyD;AACzD,+DAAmG;AACnG,2EAAsE;AACtE,mFAA2G;AAC3G,qEAA0F;AAE1F,MAAM,kBAAkB;IAGpB,YAA6B,YAAoB,EAAmB,aAAa,GAAG;QAAvD,iBAAY,GAAZ,YAAY,CAAQ;QAAmB,eAAU,GAAV,UAAU,CAAM;QAD7E,cAAS,GAAG,CAAC,CAAC;IACmE,CAAC;IACzF,KAAK,CAAC,SAAS,KAAgC,CAAC;IAChD,KAAK,CAAC,YAAY,KAAkC,OAAO,SAAS,CAAC,CAAC,CAAC;IACvE,KAAK,CAAC,OAAO,CAAC,OAAuB;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;QAC3B,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC;QACpB,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;YACjD,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;SACtD,CAAC;IACN,CAAC;CACJ;AAED,MAAM,iBAAkB,SAAQ,mDAAuB;IACnD,YAA6B,QAAgB,EAAmB,OAAe;QAAI,KAAK,EAAE,CAAC;QAA9D,aAAQ,GAAR,QAAQ,CAAQ;QAAmB,YAAO,GAAP,OAAO,CAAQ;IAAa,CAAC;IACpF,WAAW,KAAa,OA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