oh-my-claude-sisyphus 3.7.2 → 3.7.4
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.
- package/agents/build-fixer-low.md +2 -2
- package/agents/build-fixer.md +74 -19
- package/agents/code-reviewer.md +7 -7
- package/agents/designer-high.md +2 -2
- package/agents/designer-low.md +1 -1
- package/agents/designer.md +17 -2
- package/agents/security-reviewer.md +86 -17
- package/agents/tdd-guide.md +151 -12
- package/dist/__tests__/compatibility-security.test.d.ts +13 -0
- package/dist/__tests__/compatibility-security.test.d.ts.map +1 -0
- package/dist/__tests__/compatibility-security.test.js +403 -0
- package/dist/__tests__/compatibility-security.test.js.map +1 -0
- package/dist/__tests__/compatibility.test.d.ts +7 -0
- package/dist/__tests__/compatibility.test.d.ts.map +1 -0
- package/dist/__tests__/compatibility.test.js +484 -0
- package/dist/__tests__/compatibility.test.js.map +1 -0
- package/dist/__tests__/hud/analytics-display.test.js +4 -0
- package/dist/__tests__/hud/analytics-display.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +1 -1
- package/dist/__tests__/skills.test.js +6 -5
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/agents/definitions.js +1 -1
- package/dist/agents/definitions.js.map +1 -1
- package/dist/compatibility/discovery.d.ts +58 -0
- package/dist/compatibility/discovery.d.ts.map +1 -0
- package/dist/compatibility/discovery.js +621 -0
- package/dist/compatibility/discovery.js.map +1 -0
- package/dist/compatibility/index.d.ts +51 -0
- package/dist/compatibility/index.d.ts.map +1 -0
- package/dist/compatibility/index.js +72 -0
- package/dist/compatibility/index.js.map +1 -0
- package/dist/compatibility/mcp-bridge.d.ts +138 -0
- package/dist/compatibility/mcp-bridge.d.ts.map +1 -0
- package/dist/compatibility/mcp-bridge.js +524 -0
- package/dist/compatibility/mcp-bridge.js.map +1 -0
- package/dist/compatibility/permission-adapter.d.ts +79 -0
- package/dist/compatibility/permission-adapter.d.ts.map +1 -0
- package/dist/compatibility/permission-adapter.js +369 -0
- package/dist/compatibility/permission-adapter.js.map +1 -0
- package/dist/compatibility/registry.d.ts +161 -0
- package/dist/compatibility/registry.d.ts.map +1 -0
- package/dist/compatibility/registry.js +389 -0
- package/dist/compatibility/registry.js.map +1 -0
- package/dist/compatibility/types.d.ts +249 -0
- package/dist/compatibility/types.d.ts.map +1 -0
- package/dist/compatibility/types.js +8 -0
- package/dist/compatibility/types.js.map +1 -0
- package/dist/features/rate-limit-wait/daemon.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/daemon.js +3 -0
- package/dist/features/rate-limit-wait/daemon.js.map +1 -1
- package/dist/hooks/autopilot/prompts.d.ts.map +1 -1
- package/dist/hooks/autopilot/prompts.js +17 -3
- package/dist/hooks/autopilot/prompts.js.map +1 -1
- package/dist/hooks/github-auto-responder/classifier.d.ts +43 -0
- package/dist/hooks/github-auto-responder/classifier.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/classifier.js +150 -0
- package/dist/hooks/github-auto-responder/classifier.js.map +1 -0
- package/dist/hooks/github-auto-responder/config.d.ts +109 -0
- package/dist/hooks/github-auto-responder/config.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/config.js +69 -0
- package/dist/hooks/github-auto-responder/config.js.map +1 -0
- package/dist/hooks/github-auto-responder/constants.d.ts +45 -0
- package/dist/hooks/github-auto-responder/constants.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/constants.js +60 -0
- package/dist/hooks/github-auto-responder/constants.js.map +1 -0
- package/dist/hooks/github-auto-responder/filters.d.ts +95 -0
- package/dist/hooks/github-auto-responder/filters.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/filters.js +174 -0
- package/dist/hooks/github-auto-responder/filters.js.map +1 -0
- package/dist/hooks/github-auto-responder/github-client.d.ts +65 -0
- package/dist/hooks/github-auto-responder/github-client.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/github-client.js +128 -0
- package/dist/hooks/github-auto-responder/github-client.js.map +1 -0
- package/dist/hooks/github-auto-responder/idempotency.d.ts +68 -0
- package/dist/hooks/github-auto-responder/idempotency.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/idempotency.js +147 -0
- package/dist/hooks/github-auto-responder/idempotency.js.map +1 -0
- package/dist/hooks/github-auto-responder/index.d.ts +140 -0
- package/dist/hooks/github-auto-responder/index.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/index.js +145 -0
- package/dist/hooks/github-auto-responder/index.js.map +1 -0
- package/dist/hooks/github-auto-responder/persona.d.ts +40 -0
- package/dist/hooks/github-auto-responder/persona.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/persona.js +99 -0
- package/dist/hooks/github-auto-responder/persona.js.map +1 -0
- package/dist/hooks/github-auto-responder/responder.d.ts +122 -0
- package/dist/hooks/github-auto-responder/responder.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/responder.js +264 -0
- package/dist/hooks/github-auto-responder/responder.js.map +1 -0
- package/dist/hooks/github-auto-responder/server.d.ts +140 -0
- package/dist/hooks/github-auto-responder/server.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/server.js +301 -0
- package/dist/hooks/github-auto-responder/server.js.map +1 -0
- package/dist/hooks/github-auto-responder/signature.d.ts +34 -0
- package/dist/hooks/github-auto-responder/signature.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/signature.js +79 -0
- package/dist/hooks/github-auto-responder/signature.js.map +1 -0
- package/dist/hooks/github-auto-responder/templates.d.ts +16 -0
- package/dist/hooks/github-auto-responder/templates.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/templates.js +93 -0
- package/dist/hooks/github-auto-responder/templates.js.map +1 -0
- package/dist/hooks/github-auto-responder/types.d.ts +246 -0
- package/dist/hooks/github-auto-responder/types.d.ts.map +1 -0
- package/dist/hooks/github-auto-responder/types.js +7 -0
- package/dist/hooks/github-auto-responder/types.js.map +1 -0
- package/dist/hud/analytics-display.d.ts +1 -1
- package/dist/hud/analytics-display.d.ts.map +1 -1
- package/dist/hud/analytics-display.js +24 -7
- package/dist/hud/analytics-display.js.map +1 -1
- package/dist/installer/index.d.ts +1 -1
- package/dist/installer/index.js +1 -1
- package/docs/COMPATIBILITY.md +1051 -0
- package/package.json +3 -1
- package/scripts/github-webhook-server.ts +141 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Registry and Router
|
|
3
|
+
*
|
|
4
|
+
* Central registry for all external tools, plugins, and MCP servers.
|
|
5
|
+
* Handles tool registration, conflict resolution, and command routing.
|
|
6
|
+
*/
|
|
7
|
+
import { discoverAll } from './discovery.js';
|
|
8
|
+
/**
|
|
9
|
+
* Singleton registry instance
|
|
10
|
+
*/
|
|
11
|
+
let registryInstance = null;
|
|
12
|
+
/**
|
|
13
|
+
* Tool Registry - Central hub for all external tools
|
|
14
|
+
*/
|
|
15
|
+
export class ToolRegistry {
|
|
16
|
+
plugins = new Map();
|
|
17
|
+
mcpServers = new Map();
|
|
18
|
+
tools = new Map();
|
|
19
|
+
conflicts = new Map();
|
|
20
|
+
listeners = new Set();
|
|
21
|
+
lastDiscovery = 0;
|
|
22
|
+
discoveryCache = null;
|
|
23
|
+
/**
|
|
24
|
+
* Get the singleton registry instance
|
|
25
|
+
*/
|
|
26
|
+
static getInstance() {
|
|
27
|
+
if (!registryInstance) {
|
|
28
|
+
registryInstance = new ToolRegistry();
|
|
29
|
+
}
|
|
30
|
+
return registryInstance;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Reset the registry (for testing)
|
|
34
|
+
*/
|
|
35
|
+
static resetInstance() {
|
|
36
|
+
registryInstance = null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Initialize the registry by discovering all external resources
|
|
40
|
+
*/
|
|
41
|
+
async initialize(options) {
|
|
42
|
+
const result = discoverAll(options);
|
|
43
|
+
this.discoveryCache = result;
|
|
44
|
+
this.lastDiscovery = result.timestamp;
|
|
45
|
+
// Register discovered plugins
|
|
46
|
+
for (const plugin of result.plugins) {
|
|
47
|
+
this.registerPlugin(plugin);
|
|
48
|
+
}
|
|
49
|
+
// Register discovered MCP servers
|
|
50
|
+
for (const server of result.mcpServers) {
|
|
51
|
+
this.registerMcpServer(server);
|
|
52
|
+
}
|
|
53
|
+
this.emit({
|
|
54
|
+
type: 'plugin-discovered',
|
|
55
|
+
timestamp: Date.now(),
|
|
56
|
+
data: { pluginCount: result.plugins.length, mcpServerCount: result.mcpServers.length },
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Register a discovered plugin
|
|
61
|
+
*/
|
|
62
|
+
registerPlugin(plugin) {
|
|
63
|
+
this.plugins.set(plugin.name, plugin);
|
|
64
|
+
// Register all tools from this plugin
|
|
65
|
+
for (const tool of plugin.tools) {
|
|
66
|
+
this.registerTool(tool);
|
|
67
|
+
}
|
|
68
|
+
this.emit({
|
|
69
|
+
type: 'plugin-loaded',
|
|
70
|
+
timestamp: Date.now(),
|
|
71
|
+
data: { plugin: plugin.name, toolCount: plugin.tools.length },
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Register a discovered MCP server
|
|
76
|
+
*/
|
|
77
|
+
registerMcpServer(server) {
|
|
78
|
+
this.mcpServers.set(server.name, server);
|
|
79
|
+
// Register any pre-discovered tools
|
|
80
|
+
for (const tool of server.tools) {
|
|
81
|
+
this.registerTool(tool);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Register a single tool
|
|
86
|
+
*/
|
|
87
|
+
registerTool(tool) {
|
|
88
|
+
const existingTool = this.tools.get(tool.name);
|
|
89
|
+
if (existingTool) {
|
|
90
|
+
// Conflict detected - resolve by priority
|
|
91
|
+
this.handleConflict(existingTool, tool);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.tools.set(tool.name, tool);
|
|
95
|
+
this.emit({
|
|
96
|
+
type: 'tool-registered',
|
|
97
|
+
timestamp: Date.now(),
|
|
98
|
+
data: { tool: tool.name, source: tool.source },
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Handle tool name conflict
|
|
104
|
+
*/
|
|
105
|
+
handleConflict(existing, incoming) {
|
|
106
|
+
const conflictKey = existing.name;
|
|
107
|
+
// Get or create conflict record
|
|
108
|
+
let conflict = this.conflicts.get(conflictKey);
|
|
109
|
+
if (!conflict) {
|
|
110
|
+
conflict = {
|
|
111
|
+
name: conflictKey,
|
|
112
|
+
tools: [existing],
|
|
113
|
+
resolution: 'priority',
|
|
114
|
+
winner: existing,
|
|
115
|
+
};
|
|
116
|
+
this.conflicts.set(conflictKey, conflict);
|
|
117
|
+
}
|
|
118
|
+
// Add incoming tool to conflict list
|
|
119
|
+
conflict.tools.push(incoming);
|
|
120
|
+
// Resolve by priority (higher wins)
|
|
121
|
+
const existingPriority = existing.priority || 50;
|
|
122
|
+
const incomingPriority = incoming.priority || 50;
|
|
123
|
+
if (incomingPriority > existingPriority) {
|
|
124
|
+
conflict.winner = incoming;
|
|
125
|
+
this.tools.set(incoming.name, incoming);
|
|
126
|
+
}
|
|
127
|
+
this.emit({
|
|
128
|
+
type: 'tool-conflict',
|
|
129
|
+
timestamp: Date.now(),
|
|
130
|
+
data: { name: conflictKey, winner: conflict.winner.source },
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get a tool by name (supports both namespaced and short names)
|
|
135
|
+
*/
|
|
136
|
+
getTool(name) {
|
|
137
|
+
// Try exact match first
|
|
138
|
+
if (this.tools.has(name)) {
|
|
139
|
+
return this.tools.get(name);
|
|
140
|
+
}
|
|
141
|
+
// Try to find by short name (without namespace)
|
|
142
|
+
for (const [fullName, tool] of this.tools) {
|
|
143
|
+
const shortName = fullName.split(':').pop();
|
|
144
|
+
if (shortName === name) {
|
|
145
|
+
return tool;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get all tools from a specific source
|
|
152
|
+
*/
|
|
153
|
+
getToolsBySource(source) {
|
|
154
|
+
return Array.from(this.tools.values()).filter(t => t.source === source);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get all tools of a specific type
|
|
158
|
+
*/
|
|
159
|
+
getToolsByType(type) {
|
|
160
|
+
return Array.from(this.tools.values()).filter(t => t.type === type);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Get all registered tools
|
|
164
|
+
*/
|
|
165
|
+
getAllTools() {
|
|
166
|
+
return Array.from(this.tools.values());
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Get all registered plugins
|
|
170
|
+
*/
|
|
171
|
+
getAllPlugins() {
|
|
172
|
+
return Array.from(this.plugins.values());
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get all registered MCP servers
|
|
176
|
+
*/
|
|
177
|
+
getAllMcpServers() {
|
|
178
|
+
return Array.from(this.mcpServers.values());
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Get all conflicts
|
|
182
|
+
*/
|
|
183
|
+
getConflicts() {
|
|
184
|
+
return Array.from(this.conflicts.values());
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Route a command to the appropriate tool handler
|
|
188
|
+
*/
|
|
189
|
+
route(command) {
|
|
190
|
+
const tool = this.getTool(command);
|
|
191
|
+
if (!tool) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
// Determine if permission is required based on capabilities
|
|
195
|
+
const requiresPermission = tool.capabilities?.some(c => c === 'write' || c === 'execute') ?? false;
|
|
196
|
+
const route = {
|
|
197
|
+
tool,
|
|
198
|
+
requiresPermission,
|
|
199
|
+
};
|
|
200
|
+
// Add handler info for plugin tools
|
|
201
|
+
if (tool.type === 'plugin') {
|
|
202
|
+
const plugin = this.plugins.get(tool.source);
|
|
203
|
+
if (plugin?.manifest.tools) {
|
|
204
|
+
const toolDef = plugin.manifest.tools.find(t => `${plugin.name}:${t.name}` === tool.name);
|
|
205
|
+
if (toolDef) {
|
|
206
|
+
route.handler = toolDef.handler;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// Add MCP server info for MCP tools
|
|
211
|
+
if (tool.type === 'mcp') {
|
|
212
|
+
// Extract server name from tool source
|
|
213
|
+
route.mcpServer = tool.source;
|
|
214
|
+
}
|
|
215
|
+
return route;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Enable or disable a tool
|
|
219
|
+
*/
|
|
220
|
+
setToolEnabled(name, enabled) {
|
|
221
|
+
const tool = this.tools.get(name);
|
|
222
|
+
if (tool) {
|
|
223
|
+
tool.enabled = enabled;
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Check if a tool is enabled
|
|
230
|
+
*/
|
|
231
|
+
isToolEnabled(name) {
|
|
232
|
+
const tool = this.tools.get(name);
|
|
233
|
+
return tool?.enabled ?? false;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get plugin by name
|
|
237
|
+
*/
|
|
238
|
+
getPlugin(name) {
|
|
239
|
+
return this.plugins.get(name);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Get MCP server by name
|
|
243
|
+
*/
|
|
244
|
+
getMcpServer(name) {
|
|
245
|
+
return this.mcpServers.get(name);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Update MCP server connection status and tools
|
|
249
|
+
*/
|
|
250
|
+
updateMcpServer(name, updates) {
|
|
251
|
+
const server = this.mcpServers.get(name);
|
|
252
|
+
if (!server)
|
|
253
|
+
return;
|
|
254
|
+
if (updates.connected !== undefined) {
|
|
255
|
+
server.connected = updates.connected;
|
|
256
|
+
}
|
|
257
|
+
if (updates.error !== undefined) {
|
|
258
|
+
server.error = updates.error;
|
|
259
|
+
}
|
|
260
|
+
if (updates.tools) {
|
|
261
|
+
// Register new tools from MCP server
|
|
262
|
+
for (const tool of updates.tools) {
|
|
263
|
+
this.registerTool(tool);
|
|
264
|
+
}
|
|
265
|
+
server.tools = updates.tools;
|
|
266
|
+
}
|
|
267
|
+
this.emit({
|
|
268
|
+
type: updates.connected ? 'mcp-connected' : 'mcp-disconnected',
|
|
269
|
+
timestamp: Date.now(),
|
|
270
|
+
data: { server: name, toolCount: server.tools.length },
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get current registry state snapshot
|
|
275
|
+
*/
|
|
276
|
+
getState() {
|
|
277
|
+
return {
|
|
278
|
+
plugins: Array.from(this.plugins.values()),
|
|
279
|
+
mcpServers: Array.from(this.mcpServers.values()),
|
|
280
|
+
tools: new Map(this.tools),
|
|
281
|
+
conflicts: Array.from(this.conflicts.values()),
|
|
282
|
+
lastDiscovery: this.lastDiscovery,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Search tools by keyword
|
|
287
|
+
*/
|
|
288
|
+
searchTools(query) {
|
|
289
|
+
const lowerQuery = query.toLowerCase();
|
|
290
|
+
return Array.from(this.tools.values()).filter(tool => {
|
|
291
|
+
const searchText = `${tool.name} ${tool.description || ''} ${tool.source}`.toLowerCase();
|
|
292
|
+
return searchText.includes(lowerQuery);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Add event listener
|
|
297
|
+
*/
|
|
298
|
+
addEventListener(listener) {
|
|
299
|
+
this.listeners.add(listener);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Remove event listener
|
|
303
|
+
*/
|
|
304
|
+
removeEventListener(listener) {
|
|
305
|
+
this.listeners.delete(listener);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Emit event to all listeners
|
|
309
|
+
*/
|
|
310
|
+
emit(event) {
|
|
311
|
+
for (const listener of this.listeners) {
|
|
312
|
+
try {
|
|
313
|
+
listener(event);
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
// Ignore listener errors
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Clear all registered resources
|
|
322
|
+
*/
|
|
323
|
+
clear() {
|
|
324
|
+
this.plugins.clear();
|
|
325
|
+
this.mcpServers.clear();
|
|
326
|
+
this.tools.clear();
|
|
327
|
+
this.conflicts.clear();
|
|
328
|
+
this.discoveryCache = null;
|
|
329
|
+
this.lastDiscovery = 0;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Re-run discovery and update registry
|
|
333
|
+
*/
|
|
334
|
+
async refresh(options) {
|
|
335
|
+
this.clear();
|
|
336
|
+
await this.initialize({ ...options, force: true });
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Get discovery cache if available
|
|
340
|
+
*/
|
|
341
|
+
getDiscoveryCache() {
|
|
342
|
+
return this.discoveryCache;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Get the global registry instance
|
|
347
|
+
*/
|
|
348
|
+
export function getRegistry() {
|
|
349
|
+
return ToolRegistry.getInstance();
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Initialize the global registry
|
|
353
|
+
*/
|
|
354
|
+
export async function initializeRegistry(options) {
|
|
355
|
+
const registry = ToolRegistry.getInstance();
|
|
356
|
+
await registry.initialize(options);
|
|
357
|
+
return registry;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Quick access to route a command
|
|
361
|
+
*/
|
|
362
|
+
export function routeCommand(command) {
|
|
363
|
+
return ToolRegistry.getInstance().route(command);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Quick access to get a tool
|
|
367
|
+
*/
|
|
368
|
+
export function getExternalTool(name) {
|
|
369
|
+
return ToolRegistry.getInstance().getTool(name);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* List all available external tools
|
|
373
|
+
*/
|
|
374
|
+
export function listExternalTools() {
|
|
375
|
+
return ToolRegistry.getInstance().getAllTools();
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Check if any external plugins are installed
|
|
379
|
+
*/
|
|
380
|
+
export function hasExternalPlugins() {
|
|
381
|
+
return ToolRegistry.getInstance().getAllPlugins().length > 0;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Check if any MCP servers are configured
|
|
385
|
+
*/
|
|
386
|
+
export function hasMcpServers() {
|
|
387
|
+
return ToolRegistry.getInstance().getAllMcpServers().length > 0;
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/compatibility/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,OAAO,EAAE,WAAW,EAAwB,MAAM,gBAAgB,CAAC;AAEnE;;GAEG;AACH,IAAI,gBAAgB,GAAwB,IAAI,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,YAAY;IACf,OAAO,GAAkC,IAAI,GAAG,EAAE,CAAC;IACnD,UAAU,GAAqC,IAAI,GAAG,EAAE,CAAC;IACzD,KAAK,GAA8B,IAAI,GAAG,EAAE,CAAC;IAC7C,SAAS,GAA8B,IAAI,GAAG,EAAE,CAAC;IACjD,SAAS,GAA+B,IAAI,GAAG,EAAE,CAAC;IAClD,aAAa,GAAW,CAAC,CAAC;IAC1B,cAAc,GAA2B,IAAI,CAAC;IAEtD;;OAEG;IACH,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,gBAAgB,GAAG,IAAI,YAAY,EAAE,CAAC;QACxC,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa;QAClB,gBAAgB,GAAG,IAAI,CAAC;IAC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;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,YAAY,CAAC,WAAW,EAAE,CAAC,aAAa,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC/D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,YAAY,CAAC,WAAW,EAAE,CAAC,gBAAgB,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility Layer Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for MCP/Plugin compatibility layer.
|
|
5
|
+
* Enables OMC to discover, register, and use external plugins, tools, and MCP servers.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Type of external tool source
|
|
9
|
+
*/
|
|
10
|
+
export type ExternalToolType = 'plugin' | 'mcp' | 'skill' | 'agent';
|
|
11
|
+
/**
|
|
12
|
+
* Tool capability categories
|
|
13
|
+
*/
|
|
14
|
+
export type ToolCapability = 'read' | 'write' | 'execute' | 'network' | 'search' | 'analyze' | 'generate' | 'unknown';
|
|
15
|
+
/**
|
|
16
|
+
* External tool definition
|
|
17
|
+
*/
|
|
18
|
+
export interface ExternalTool {
|
|
19
|
+
/** Unique tool name (with namespace prefix) */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Tool type (plugin, mcp, skill, agent) */
|
|
22
|
+
type: ExternalToolType;
|
|
23
|
+
/** Source plugin/server name */
|
|
24
|
+
source: string;
|
|
25
|
+
/** Human-readable description */
|
|
26
|
+
description?: string;
|
|
27
|
+
/** Available commands/methods */
|
|
28
|
+
commands?: string[];
|
|
29
|
+
/** Tool capabilities */
|
|
30
|
+
capabilities?: ToolCapability[];
|
|
31
|
+
/** Whether this tool is enabled */
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
/** Original tool schema (for MCP tools) */
|
|
34
|
+
schema?: Record<string, unknown>;
|
|
35
|
+
/** Priority for conflict resolution (higher wins) */
|
|
36
|
+
priority?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Plugin manifest format (compatible with .claude-plugin/plugin.json)
|
|
40
|
+
*/
|
|
41
|
+
export interface PluginManifest {
|
|
42
|
+
/** Plugin name */
|
|
43
|
+
name: string;
|
|
44
|
+
/** Plugin version */
|
|
45
|
+
version: string;
|
|
46
|
+
/** Plugin description */
|
|
47
|
+
description?: string;
|
|
48
|
+
/** Skills directory or array of skill paths */
|
|
49
|
+
skills?: string | string[];
|
|
50
|
+
/** Agents directory or array of agent paths */
|
|
51
|
+
agents?: string | string[];
|
|
52
|
+
/** Commands directory or array of command paths */
|
|
53
|
+
commands?: string | string[];
|
|
54
|
+
/** Hook configurations */
|
|
55
|
+
hooks?: Record<string, string[]>;
|
|
56
|
+
/** MCP server configurations */
|
|
57
|
+
mcpServers?: Record<string, McpServerEntry>;
|
|
58
|
+
/** Required permissions */
|
|
59
|
+
permissions?: PluginPermission[];
|
|
60
|
+
/** Tool definitions */
|
|
61
|
+
tools?: PluginToolDefinition[];
|
|
62
|
+
/** Namespace prefix for this plugin */
|
|
63
|
+
namespace?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* MCP server entry in manifest
|
|
67
|
+
*/
|
|
68
|
+
export interface McpServerEntry {
|
|
69
|
+
/** Command to run the server */
|
|
70
|
+
command: string;
|
|
71
|
+
/** Arguments for the command */
|
|
72
|
+
args?: string[];
|
|
73
|
+
/** Environment variables */
|
|
74
|
+
env?: Record<string, string>;
|
|
75
|
+
/** Whether this server is enabled by default */
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
/** Description of the server */
|
|
78
|
+
description?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Permission required by a plugin
|
|
82
|
+
*/
|
|
83
|
+
export interface PluginPermission {
|
|
84
|
+
/** Tool name that requires permission */
|
|
85
|
+
tool: string;
|
|
86
|
+
/** Permission scope */
|
|
87
|
+
scope: 'read' | 'write' | 'execute' | 'all';
|
|
88
|
+
/** Patterns for allowed paths/commands */
|
|
89
|
+
patterns?: string[];
|
|
90
|
+
/** Reason for requiring this permission */
|
|
91
|
+
reason?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Tool definition within a plugin
|
|
95
|
+
*/
|
|
96
|
+
export interface PluginToolDefinition {
|
|
97
|
+
/** Tool name */
|
|
98
|
+
name: string;
|
|
99
|
+
/** Tool description */
|
|
100
|
+
description: string;
|
|
101
|
+
/** Input schema (JSON Schema) */
|
|
102
|
+
inputSchema?: Record<string, unknown>;
|
|
103
|
+
/** Handler function name or command */
|
|
104
|
+
handler: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Discovered plugin information
|
|
108
|
+
*/
|
|
109
|
+
export interface DiscoveredPlugin {
|
|
110
|
+
/** Plugin name */
|
|
111
|
+
name: string;
|
|
112
|
+
/** Plugin version */
|
|
113
|
+
version: string;
|
|
114
|
+
/** Path to plugin directory */
|
|
115
|
+
path: string;
|
|
116
|
+
/** Parsed manifest */
|
|
117
|
+
manifest: PluginManifest;
|
|
118
|
+
/** Whether the plugin is loaded */
|
|
119
|
+
loaded: boolean;
|
|
120
|
+
/** Error message if loading failed */
|
|
121
|
+
error?: string;
|
|
122
|
+
/** Discovered tools from this plugin */
|
|
123
|
+
tools: ExternalTool[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Discovered MCP server
|
|
127
|
+
*/
|
|
128
|
+
export interface DiscoveredMcpServer {
|
|
129
|
+
/** Server name */
|
|
130
|
+
name: string;
|
|
131
|
+
/** Server configuration */
|
|
132
|
+
config: McpServerEntry;
|
|
133
|
+
/** Source (e.g., "claude_desktop_config" or plugin name) */
|
|
134
|
+
source: string;
|
|
135
|
+
/** Whether the server is currently connected */
|
|
136
|
+
connected: boolean;
|
|
137
|
+
/** Available tools from this server */
|
|
138
|
+
tools: ExternalTool[];
|
|
139
|
+
/** Connection error if any */
|
|
140
|
+
error?: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Tool routing decision
|
|
144
|
+
*/
|
|
145
|
+
export interface ToolRoute {
|
|
146
|
+
/** The tool to invoke */
|
|
147
|
+
tool: ExternalTool;
|
|
148
|
+
/** Handler to execute (for plugins) */
|
|
149
|
+
handler?: string;
|
|
150
|
+
/** MCP server name (for MCP tools) */
|
|
151
|
+
mcpServer?: string;
|
|
152
|
+
/** Whether permission is required */
|
|
153
|
+
requiresPermission: boolean;
|
|
154
|
+
/** Cached permission decision */
|
|
155
|
+
permissionGranted?: boolean;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Conflict between tools with same name
|
|
159
|
+
*/
|
|
160
|
+
export interface ToolConflict {
|
|
161
|
+
/** Tool name that has conflict */
|
|
162
|
+
name: string;
|
|
163
|
+
/** All tools with this name */
|
|
164
|
+
tools: ExternalTool[];
|
|
165
|
+
/** Resolution method used */
|
|
166
|
+
resolution: 'priority' | 'namespace' | 'manual';
|
|
167
|
+
/** The winning tool */
|
|
168
|
+
winner: ExternalTool;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Registry state snapshot
|
|
172
|
+
*/
|
|
173
|
+
export interface RegistryState {
|
|
174
|
+
/** All discovered plugins */
|
|
175
|
+
plugins: DiscoveredPlugin[];
|
|
176
|
+
/** All discovered MCP servers */
|
|
177
|
+
mcpServers: DiscoveredMcpServer[];
|
|
178
|
+
/** All registered tools (by namespaced name) */
|
|
179
|
+
tools: Map<string, ExternalTool>;
|
|
180
|
+
/** Detected conflicts */
|
|
181
|
+
conflicts: ToolConflict[];
|
|
182
|
+
/** Last discovery timestamp */
|
|
183
|
+
lastDiscovery: number;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Discovery options
|
|
187
|
+
*/
|
|
188
|
+
export interface DiscoveryOptions {
|
|
189
|
+
/** Paths to scan for plugins */
|
|
190
|
+
pluginPaths?: string[];
|
|
191
|
+
/** Path to claude_desktop_config.json */
|
|
192
|
+
mcpConfigPath?: string;
|
|
193
|
+
/** Path to settings.json with mcpServers */
|
|
194
|
+
settingsPath?: string;
|
|
195
|
+
/** Whether to auto-connect MCP servers */
|
|
196
|
+
autoConnectMcp?: boolean;
|
|
197
|
+
/** Whether to force re-discovery */
|
|
198
|
+
force?: boolean;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Permission check result
|
|
202
|
+
*/
|
|
203
|
+
export interface PermissionCheckResult {
|
|
204
|
+
/** Whether the action is allowed */
|
|
205
|
+
allowed: boolean;
|
|
206
|
+
/** Reason for the decision */
|
|
207
|
+
reason: string;
|
|
208
|
+
/** Whether to ask user (if behavior is 'ask') */
|
|
209
|
+
askUser?: boolean;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* MCP tool invocation result
|
|
213
|
+
*/
|
|
214
|
+
export interface McpToolResult {
|
|
215
|
+
/** Whether the call succeeded */
|
|
216
|
+
success: boolean;
|
|
217
|
+
/** Result data */
|
|
218
|
+
data?: unknown;
|
|
219
|
+
/** Error message if failed */
|
|
220
|
+
error?: string;
|
|
221
|
+
/** Execution time in ms */
|
|
222
|
+
executionTime?: number;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Event emitted by the registry
|
|
226
|
+
*/
|
|
227
|
+
export interface RegistryEvent {
|
|
228
|
+
type: 'plugin-discovered' | 'plugin-loaded' | 'plugin-error' | 'mcp-connected' | 'mcp-disconnected' | 'mcp-error' | 'tool-registered' | 'tool-conflict' | 'tool-invoked';
|
|
229
|
+
timestamp: number;
|
|
230
|
+
data: unknown;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Registry event listener
|
|
234
|
+
*/
|
|
235
|
+
export type RegistryEventListener = (event: RegistryEvent) => void;
|
|
236
|
+
/**
|
|
237
|
+
* Safe command patterns for permission auto-approval
|
|
238
|
+
*/
|
|
239
|
+
export interface SafeCommandPattern {
|
|
240
|
+
/** Tool name */
|
|
241
|
+
tool: string;
|
|
242
|
+
/** Regex pattern for safe commands/paths */
|
|
243
|
+
pattern: RegExp;
|
|
244
|
+
/** Description of what this pattern allows */
|
|
245
|
+
description: string;
|
|
246
|
+
/** Source of this pattern (builtin, plugin name) */
|
|
247
|
+
source: string;
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/compatibility/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,IAAI,EAAE,gBAAgB,CAAC;IACvB,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,wBAAwB;IACxB,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;IAChC,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IAC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AC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,mBAAmB,GAAG,eAAe,GAAG,cAAc,GACtD,eAAe,GAAG,kBAAkB,GAAG,WAAW,GAClD,iBAAiB,GAAG,eAAe,GAAG,cAAc,CAAC;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/compatibility/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/features/rate-limit-wait/daemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/features/rate-limit-wait/daemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAcH,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAEZ,cAAc,EACf,MAAM,YAAY,CAAC;AAmHpB;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,IAAI,CAmCzE;AAwDD;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAe9D;AA8CD;;GAEG;AACH,iBAAe,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA4FrE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,cAAc,CAiEjE;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC9E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,cAAc,CA2ChE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,cAAc,CAyBrE;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CA6BvF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAgD5D;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|