@venthezone/everything-opencode-plugin 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2476 @@
1
+ // ../essential-opencode/src/types/index.ts
2
+ var DEFAULT_CONFIG = {
3
+ components: {
4
+ agents: true,
5
+ commands: true,
6
+ skills: true,
7
+ workflows: true,
8
+ hooks: true
9
+ },
10
+ performance: {
11
+ lazyLoad: true,
12
+ cacheResults: true,
13
+ maxConcurrency: 5
14
+ },
15
+ development: {
16
+ enableDebug: false,
17
+ verboseLogging: false,
18
+ enableTelemetry: false
19
+ },
20
+ defaults: {
21
+ temperature: 0.7,
22
+ maxTokens: 4000
23
+ }
24
+ };
25
+ // ../essential-opencode/src/utils/logger.ts
26
+ class Logger {
27
+ context;
28
+ logLevel = 2 /* INFO */;
29
+ logHistory = [];
30
+ maxHistorySize = 1000;
31
+ constructor(context, logLevel) {
32
+ this.context = context;
33
+ if (logLevel) {
34
+ this.logLevel = logLevel;
35
+ } else if (this.context.config.development?.enableDebug) {
36
+ this.logLevel = 3 /* DEBUG */;
37
+ }
38
+ }
39
+ debug(message, data) {
40
+ this.log(3 /* DEBUG */, message, data);
41
+ }
42
+ info(message, data) {
43
+ this.log(2 /* INFO */, message, data);
44
+ }
45
+ warn(message, data) {
46
+ this.log(1 /* WARN */, message, data);
47
+ }
48
+ error(message, error) {
49
+ this.log(0 /* ERROR */, message, error);
50
+ }
51
+ log(level, message, data) {
52
+ if (!this.shouldLog(level))
53
+ return;
54
+ const entry = {
55
+ timestamp: new Date,
56
+ level,
57
+ message,
58
+ data: this.sanitizeData(data),
59
+ sessionId: this.context.session.id
60
+ };
61
+ this.logHistory.push(entry);
62
+ if (this.logHistory.length > this.maxHistorySize) {
63
+ this.logHistory = this.logHistory.slice(-this.maxHistorySize / 2);
64
+ }
65
+ this.outputLog(entry);
66
+ }
67
+ shouldLog(level) {
68
+ return level >= this.logLevel;
69
+ }
70
+ outputLog(entry) {
71
+ const timestamp = entry.timestamp.toISOString();
72
+ const levelStr = LogLevel[entry.level].padEnd(5);
73
+ const sessionId = entry.sessionId.substring(0, 8);
74
+ let output = `[${timestamp}] [${levelStr}] [${sessionId}] ${entry.message}`;
75
+ if (entry.data) {
76
+ output += `
77
+ ` + this.formatData(entry.data);
78
+ }
79
+ switch (entry.level) {
80
+ case 0 /* ERROR */:
81
+ console.error(output);
82
+ break;
83
+ case 1 /* WARN */:
84
+ console.warn(output);
85
+ break;
86
+ case 3 /* DEBUG */:
87
+ if (this.context.config.development?.verboseLogging) {
88
+ console.log(output);
89
+ }
90
+ break;
91
+ default:
92
+ console.log(output);
93
+ }
94
+ }
95
+ formatData(data) {
96
+ try {
97
+ return JSON.stringify(data, null, 2);
98
+ } catch (error) {
99
+ return `[Unserializable data: ${typeof data}]`;
100
+ }
101
+ }
102
+ sanitizeData(data) {
103
+ if (!data)
104
+ return data;
105
+ if (typeof data === "string") {
106
+ return this.maskSensitiveStrings(data);
107
+ }
108
+ if (Array.isArray(data)) {
109
+ return data.map((item) => this.sanitizeData(item));
110
+ }
111
+ if (typeof data === "object") {
112
+ const sanitized = {};
113
+ for (const [key, value] of Object.entries(data)) {
114
+ if (this.isSensitiveKey(key)) {
115
+ sanitized[key] = "[REDACTED]";
116
+ } else {
117
+ sanitized[key] = this.sanitizeData(value);
118
+ }
119
+ }
120
+ return sanitized;
121
+ }
122
+ return data;
123
+ }
124
+ maskSensitiveStrings(str) {
125
+ const sensitivePatterns = [
126
+ /password["\s:]+["\s]*[\w\-]+/gi,
127
+ /token["\s:]+["\s]*[\w\-\.]+/gi,
128
+ /secret["\s:]+["\s]*[\w\-]+/gi,
129
+ /key["\s:]+["\s]*[\w\-]+/gi,
130
+ /auth["\s:]+["\s]*[\w\-]+/gi
131
+ ];
132
+ let result = str;
133
+ for (const pattern of sensitivePatterns) {
134
+ result = result.replace(pattern, (match) => {
135
+ return match.replace(/[\w\-\.]+$/, "***");
136
+ });
137
+ }
138
+ return result;
139
+ }
140
+ isSensitiveKey(key) {
141
+ const sensitiveKeys = [
142
+ "password",
143
+ "passwd",
144
+ "pwd",
145
+ "token",
146
+ "secret",
147
+ "key",
148
+ "auth",
149
+ "authorization",
150
+ "credential",
151
+ "credentials",
152
+ "private",
153
+ "confidential"
154
+ ];
155
+ return sensitiveKeys.some((sensitive) => key.toLowerCase().includes(sensitive));
156
+ }
157
+ getHistory(level, limit) {
158
+ let filtered = this.logHistory;
159
+ if (level !== undefined) {
160
+ filtered = filtered.filter((entry) => entry.level === level);
161
+ }
162
+ if (limit) {
163
+ filtered = filtered.slice(-limit);
164
+ }
165
+ return filtered.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
166
+ }
167
+ getStats() {
168
+ const levelCounts = new Map;
169
+ for (const entry of this.logHistory) {
170
+ levelCounts.set(entry.level, (levelCounts.get(entry.level) || 0) + 1);
171
+ }
172
+ const now = new Date;
173
+ const recentEntries = this.logHistory.filter((entry) => now.getTime() - entry.timestamp.getTime() < 60 * 60 * 1000);
174
+ return {
175
+ totalEntries: this.logHistory.length,
176
+ entriesByLevel: Object.fromEntries(levelCounts),
177
+ recentEntries: recentEntries.length,
178
+ currentLevel: LogLevel[this.logLevel],
179
+ oldestEntry: this.logHistory.length > 0 ? this.logHistory[0].timestamp : null,
180
+ newestEntry: this.logHistory.length > 0 ? this.logHistory[this.logHistory.length - 1].timestamp : null
181
+ };
182
+ }
183
+ clearHistory() {
184
+ this.logHistory = [];
185
+ this.info("Log history cleared");
186
+ }
187
+ exportLogs() {
188
+ return {
189
+ logs: this.logHistory,
190
+ exportTime: new Date,
191
+ sessionId: this.context.session.id,
192
+ stats: this.getStats()
193
+ };
194
+ }
195
+ child(additionalContext) {
196
+ return new Logger({
197
+ ...this.context,
198
+ session: {
199
+ ...this.context.session,
200
+ context: {
201
+ ...this.context.session.context,
202
+ ...additionalContext
203
+ }
204
+ }
205
+ }, this.logLevel);
206
+ }
207
+ setLogLevel(level) {
208
+ this.logLevel = level;
209
+ this.info(`Log level changed to: ${LogLevel[level]}`);
210
+ }
211
+ setDebugMode(enabled) {
212
+ if (enabled) {
213
+ this.setLogLevel(3 /* DEBUG */);
214
+ } else {
215
+ this.setLogLevel(2 /* INFO */);
216
+ }
217
+ }
218
+ time(label) {
219
+ const startTime = Date.now();
220
+ this.debug(`Timer started: ${label}`);
221
+ return () => {
222
+ const duration = Date.now() - startTime;
223
+ this.debug(`Timer finished: ${label} (${duration}ms)`);
224
+ };
225
+ }
226
+ logMemoryUsage(label) {
227
+ try {
228
+ const usage = process.memoryUsage();
229
+ const message = label ? `Memory usage (${label})` : "Memory usage";
230
+ this.debug(message, {
231
+ rss: this.formatBytes(usage.rss),
232
+ heapTotal: this.formatBytes(usage.heapTotal),
233
+ heapUsed: this.formatBytes(usage.heapUsed),
234
+ external: this.formatBytes(usage.external)
235
+ });
236
+ } catch (error) {
237
+ this.debug("Could not get memory usage", error);
238
+ }
239
+ }
240
+ formatBytes(bytes) {
241
+ const units = ["B", "KB", "MB", "GB"];
242
+ let size = bytes;
243
+ let unitIndex = 0;
244
+ while (size >= 1024 && unitIndex < units.length - 1) {
245
+ size /= 1024;
246
+ unitIndex++;
247
+ }
248
+ return `${size.toFixed(2)} ${units[unitIndex]}`;
249
+ }
250
+ async writeToFile(filePath) {
251
+ try {
252
+ const logData = this.exportLogs();
253
+ await this.context.$`mkdir -p ${this.context.workspace.root}/.opencode/logs`;
254
+ await this.context.$`echo ${JSON.stringify(logData, null, 2)} > ${filePath}`;
255
+ this.info(`Logs written to: ${filePath}`);
256
+ } catch (error) {
257
+ this.error(`Failed to write logs to file: ${filePath}`, error);
258
+ }
259
+ }
260
+ }
261
+ var LogLevel;
262
+ ((LogLevel2) => {
263
+ LogLevel2[LogLevel2["ERROR"] = 0] = "ERROR";
264
+ LogLevel2[LogLevel2["WARN"] = 1] = "WARN";
265
+ LogLevel2[LogLevel2["INFO"] = 2] = "INFO";
266
+ LogLevel2[LogLevel2["DEBUG"] = 3] = "DEBUG";
267
+ })(LogLevel ||= {});
268
+ // ../essential-opencode/src/utils/tool-registry.ts
269
+ class ToolRegistry {
270
+ context;
271
+ logger;
272
+ tools = new Map;
273
+ categories = new Map;
274
+ metadata = new Map;
275
+ constructor(context, logger) {
276
+ this.context = context;
277
+ this.logger = logger;
278
+ }
279
+ register(tool) {
280
+ if (this.tools.has(tool.name)) {
281
+ this.logger.warn(`Tool ${tool.name} is already registered, overwriting...`);
282
+ }
283
+ this.tools.set(tool.name, tool);
284
+ const category = this.extractCategory(tool);
285
+ if (!this.categories.has(category)) {
286
+ this.categories.set(category, new Set);
287
+ }
288
+ this.categories.get(category).add(tool.name);
289
+ this.logger.debug(`Registered tool: ${tool.name} (${category})`);
290
+ }
291
+ unregister(id) {
292
+ const tool = this.tools.get(id);
293
+ if (tool) {
294
+ const category = this.extractCategory(tool);
295
+ this.categories.get(category)?.delete(id);
296
+ this.tools.delete(id);
297
+ this.logger.debug(`Unregistered tool: ${id}`);
298
+ }
299
+ }
300
+ get(id) {
301
+ return this.tools.get(id);
302
+ }
303
+ list() {
304
+ return Array.from(this.tools.values());
305
+ }
306
+ filter(category) {
307
+ const toolNames = this.categories.get(category);
308
+ if (!toolNames)
309
+ return [];
310
+ return Array.from(toolNames).map((name) => this.tools.get(name)).filter(Boolean);
311
+ }
312
+ search(query) {
313
+ const lowerQuery = query.toLowerCase();
314
+ return this.list().filter((tool) => tool.name.toLowerCase().includes(lowerQuery) || tool.description.toLowerCase().includes(lowerQuery));
315
+ }
316
+ getByCapability(capability) {
317
+ return this.list().filter((tool) => tool.parameters && Object.values(tool.parameters).some((param) => typeof param === "object" && param && ("description" in param) && param.description?.toLowerCase().includes(capability.toLowerCase())));
318
+ }
319
+ extractCategory(tool) {
320
+ if (tool.parameters && "category" in tool.parameters) {
321
+ return tool.parameters.category || "general";
322
+ }
323
+ if (tool.name.includes("-")) {
324
+ const parts = tool.name.split("-");
325
+ if (parts.length > 1) {
326
+ return parts[0];
327
+ }
328
+ }
329
+ if (tool.name.startsWith("code-"))
330
+ return "code";
331
+ if (tool.name.startsWith("test-"))
332
+ return "testing";
333
+ if (tool.name.startsWith("security-"))
334
+ return "security";
335
+ if (tool.name.startsWith("build-"))
336
+ return "build";
337
+ if (tool.name.startsWith("refactor-"))
338
+ return "refactoring";
339
+ if (tool.name.startsWith("update-"))
340
+ return "maintenance";
341
+ return "general";
342
+ }
343
+ getStats() {
344
+ const categoryStats = Array.from(this.categories.entries()).map(([category, tools]) => ({
345
+ category,
346
+ count: tools.size
347
+ }));
348
+ return {
349
+ totalTools: this.tools.size,
350
+ categories: categoryStats,
351
+ tools: this.list().map((tool) => ({
352
+ name: tool.name,
353
+ description: tool.description,
354
+ category: this.extractCategory(tool)
355
+ }))
356
+ };
357
+ }
358
+ }
359
+ // ../essential-opencode/src/utils/agent-registry.ts
360
+ class AgentRegistry {
361
+ context;
362
+ logger;
363
+ agents = new Map;
364
+ capabilities = new Map;
365
+ constructor(context, logger) {
366
+ this.context = context;
367
+ this.logger = logger;
368
+ }
369
+ register(agent) {
370
+ if (this.agents.has(agent.id)) {
371
+ this.logger.warn(`Agent ${agent.id} is already registered, overwriting...`);
372
+ }
373
+ this.agents.set(agent.id, agent);
374
+ for (const capability of agent.capabilities) {
375
+ if (!this.capabilities.has(capability)) {
376
+ this.capabilities.set(capability, new Set);
377
+ }
378
+ this.capabilities.get(capability).add(agent.id);
379
+ }
380
+ this.logger.debug(`Registered agent: ${agent.name} (${agent.capabilities.join(", ")})`);
381
+ }
382
+ unregister(id) {
383
+ const agent = this.agents.get(id);
384
+ if (agent) {
385
+ for (const capability of agent.capabilities) {
386
+ this.capabilities.get(capability)?.delete(id);
387
+ }
388
+ this.agents.delete(id);
389
+ this.logger.debug(`Unregistered agent: ${id}`);
390
+ }
391
+ }
392
+ get(id) {
393
+ return this.agents.get(id);
394
+ }
395
+ list() {
396
+ return Array.from(this.agents.values());
397
+ }
398
+ filter(capability) {
399
+ const agentIds = this.capabilities.get(capability);
400
+ if (!agentIds)
401
+ return [];
402
+ return Array.from(agentIds).map((id) => this.agents.get(id)).filter(Boolean);
403
+ }
404
+ findByCapabilities(capabilities) {
405
+ if (capabilities.length === 0)
406
+ return this.list();
407
+ return this.list().filter((agent) => capabilities.every((cap) => agent.capabilities.includes(cap)));
408
+ }
409
+ findByAnyCapability(capabilities) {
410
+ if (capabilities.length === 0)
411
+ return [];
412
+ const agentIds = new Set;
413
+ for (const capability of capabilities) {
414
+ const ids = this.capabilities.get(capability);
415
+ if (ids) {
416
+ for (const id of ids) {
417
+ agentIds.add(id);
418
+ }
419
+ }
420
+ }
421
+ return Array.from(agentIds).map((id) => this.agents.get(id)).filter(Boolean);
422
+ }
423
+ search(query) {
424
+ const lowerQuery = query.toLowerCase();
425
+ return this.list().filter((agent) => agent.name.toLowerCase().includes(lowerQuery) || agent.description.toLowerCase().includes(lowerQuery) || agent.capabilities.some((cap) => cap.toLowerCase().includes(lowerQuery)));
426
+ }
427
+ getBestAgent(task, requiredCapabilities) {
428
+ let candidates = this.list();
429
+ if (requiredCapabilities && requiredCapabilities.length > 0) {
430
+ candidates = this.findByCapabilities(requiredCapabilities);
431
+ }
432
+ if (candidates.length === 0)
433
+ return;
434
+ if (candidates.length === 1)
435
+ return candidates[0];
436
+ const taskLower = task.toLowerCase();
437
+ const scored = candidates.map((agent) => {
438
+ let score = 0;
439
+ if (agent.name.toLowerCase().includes(taskLower))
440
+ score += 10;
441
+ if (taskLower.includes(agent.name.toLowerCase()))
442
+ score += 5;
443
+ if (agent.description.toLowerCase().includes(taskLower))
444
+ score += 3;
445
+ const matchingCapabilities = agent.capabilities.filter((cap) => cap.toLowerCase().includes(taskLower) || taskLower.includes(cap.toLowerCase()));
446
+ score += matchingCapabilities.length * 2;
447
+ score += (10 - agent.capabilities.length) * 0.5;
448
+ return { agent, score };
449
+ });
450
+ scored.sort((a, b) => b.score - a.score);
451
+ return scored[0].agent;
452
+ }
453
+ getAllCapabilities() {
454
+ return Array.from(this.capabilities.keys()).sort();
455
+ }
456
+ getByCategory(category) {
457
+ const categoryKeywords = {
458
+ development: ["code", "development", "programming"],
459
+ testing: ["test", "testing", "qa"],
460
+ security: ["security", "audit", "vulnerability"],
461
+ documentation: ["doc", "documentation", "readme"],
462
+ architecture: ["architect", "design", "structure"],
463
+ automation: ["automation", "script", "workflow"]
464
+ };
465
+ const keywords = categoryKeywords[category] || [category];
466
+ const lowerKeywords = keywords.map((k) => k.toLowerCase());
467
+ return this.list().filter((agent) => lowerKeywords.some((keyword) => agent.name.toLowerCase().includes(keyword) || agent.description.toLowerCase().includes(keyword) || agent.capabilities.some((cap) => cap.toLowerCase().includes(keyword))));
468
+ }
469
+ getStats() {
470
+ const capabilityStats = Array.from(this.capabilities.entries()).map(([capability, agents]) => ({
471
+ capability,
472
+ count: agents.size
473
+ })).sort((a, b) => b.count - a.count);
474
+ return {
475
+ totalAgents: this.agents.size,
476
+ totalCapabilities: this.capabilities.size,
477
+ topCapabilities: capabilityStats.slice(0, 10),
478
+ agents: this.list().map((agent) => ({
479
+ id: agent.id,
480
+ name: agent.name,
481
+ description: agent.description,
482
+ capabilities: agent.capabilities,
483
+ tools: agent.tools || []
484
+ }))
485
+ };
486
+ }
487
+ }
488
+ // ../essential-opencode/src/utils/skill-registry.ts
489
+ class SkillRegistry {
490
+ context;
491
+ logger;
492
+ skills = new Map;
493
+ categories = new Map;
494
+ expertise = new Map;
495
+ constructor(context, logger) {
496
+ this.context = context;
497
+ this.logger = logger;
498
+ }
499
+ register(skill) {
500
+ if (this.skills.has(skill.id)) {
501
+ this.logger.warn(`Skill ${skill.id} is already registered, overwriting...`);
502
+ }
503
+ this.skills.set(skill.id, skill);
504
+ if (!this.categories.has(skill.category)) {
505
+ this.categories.set(skill.category, new Set);
506
+ }
507
+ this.categories.get(skill.category).add(skill.id);
508
+ for (const exp of skill.expertise) {
509
+ if (!this.expertise.has(exp)) {
510
+ this.expertise.set(exp, new Set);
511
+ }
512
+ this.expertise.get(exp).add(skill.id);
513
+ }
514
+ this.logger.debug(`Registered skill: ${skill.name} (${skill.category}: ${skill.expertise.join(", ")})`);
515
+ }
516
+ unregister(id) {
517
+ const skill = this.skills.get(id);
518
+ if (skill) {
519
+ this.categories.get(skill.category)?.delete(id);
520
+ for (const exp of skill.expertise) {
521
+ this.expertise.get(exp)?.delete(id);
522
+ }
523
+ this.skills.delete(id);
524
+ this.logger.debug(`Unregistered skill: ${id}`);
525
+ }
526
+ }
527
+ get(id) {
528
+ return this.skills.get(id);
529
+ }
530
+ list() {
531
+ return Array.from(this.skills.values());
532
+ }
533
+ filter(category) {
534
+ const skillIds = this.categories.get(category);
535
+ if (!skillIds)
536
+ return [];
537
+ return Array.from(skillIds).map((id) => this.skills.get(id)).filter(Boolean);
538
+ }
539
+ findByExpertise(expertise) {
540
+ const skillIds = this.expertise.get(expertise);
541
+ if (!skillIds)
542
+ return [];
543
+ return Array.from(skillIds).map((id) => this.skills.get(id)).filter(Boolean);
544
+ }
545
+ findByMultipleExpertise(expertiseAreas) {
546
+ if (expertiseAreas.length === 0)
547
+ return this.list();
548
+ return this.list().filter((skill) => expertiseAreas.every((exp) => skill.expertise.includes(exp)));
549
+ }
550
+ findByAnyExpertise(expertiseAreas) {
551
+ if (expertiseAreas.length === 0)
552
+ return [];
553
+ const skillIds = new Set;
554
+ for (const exp of expertiseAreas) {
555
+ const ids = this.expertise.get(exp);
556
+ if (ids) {
557
+ for (const id of ids) {
558
+ skillIds.add(id);
559
+ }
560
+ }
561
+ }
562
+ return Array.from(skillIds).map((id) => this.skills.get(id)).filter(Boolean);
563
+ }
564
+ search(query) {
565
+ const lowerQuery = query.toLowerCase();
566
+ return this.list().filter((skill) => skill.name.toLowerCase().includes(lowerQuery) || skill.description.toLowerCase().includes(lowerQuery) || skill.category.toLowerCase().includes(lowerQuery) || skill.expertise.some((exp) => exp.toLowerCase().includes(lowerQuery)) || skill.patterns?.some((pattern) => pattern.toLowerCase().includes(lowerQuery)));
567
+ }
568
+ getBestSkill(task, requiredExpertise) {
569
+ let candidates = this.list();
570
+ if (requiredExpertise && requiredExpertise.length > 0) {
571
+ candidates = this.findByMultipleExpertise(requiredExpertise);
572
+ }
573
+ if (candidates.length === 0)
574
+ return;
575
+ if (candidates.length === 1)
576
+ return candidates[0];
577
+ const taskLower = task.toLowerCase();
578
+ const scored = candidates.map((skill) => {
579
+ let score = 0;
580
+ if (skill.name.toLowerCase().includes(taskLower))
581
+ score += 10;
582
+ if (taskLower.includes(skill.name.toLowerCase()))
583
+ score += 5;
584
+ if (skill.description.toLowerCase().includes(taskLower))
585
+ score += 3;
586
+ const matchingExpertise = skill.expertise.filter((exp) => exp.toLowerCase().includes(taskLower) || taskLower.includes(exp.toLowerCase()));
587
+ score += matchingExpertise.length * 4;
588
+ if (skill.patterns) {
589
+ const matchingPatterns = skill.patterns.filter((pattern) => pattern.toLowerCase().includes(taskLower));
590
+ score += matchingPatterns.length * 2;
591
+ }
592
+ if (skill.category.toLowerCase().includes(taskLower))
593
+ score += 2;
594
+ return { skill, score };
595
+ });
596
+ scored.sort((a, b) => b.score - a.score);
597
+ return scored[0].skill;
598
+ }
599
+ getAllCategories() {
600
+ return Array.from(this.categories.keys()).sort();
601
+ }
602
+ getAllExpertise() {
603
+ return Array.from(this.expertise.keys()).sort();
604
+ }
605
+ getRelatedSkills(skillId) {
606
+ const skill = this.get(skillId);
607
+ if (!skill)
608
+ return [];
609
+ return this.list().filter((s) => s.id !== skillId && (s.category === skill.category || s.expertise.some((exp) => skill.expertise.includes(exp))));
610
+ }
611
+ getByTechnology(technology) {
612
+ const techLower = technology.toLowerCase();
613
+ return this.list().filter((skill) => skill.name.toLowerCase().includes(techLower) || skill.description.toLowerCase().includes(techLower) || skill.expertise.some((exp) => exp.toLowerCase().includes(techLower)) || skill.patterns?.some((pattern) => pattern.toLowerCase().includes(techLower)));
614
+ }
615
+ getSkillsForAgent(agentId, agent) {
616
+ const allowedSkills = agent?.allowedSkills;
617
+ if (!allowedSkills || allowedSkills.length === 0) {
618
+ this.logger.debug(`Agent ${agentId} has access to all ${this.skills.size} skills`);
619
+ return this.list();
620
+ }
621
+ const filtered = this.list().filter((skill) => allowedSkills.includes(skill.id));
622
+ this.logger.debug(`Agent ${agentId} has scoped access to ${filtered.length}/${this.skills.size} skills: [${allowedSkills.join(", ")}]`);
623
+ const existingSkillIds = new Set(this.list().map((s) => s.id));
624
+ const missingSkills = allowedSkills.filter((id) => !existingSkillIds.has(id));
625
+ if (missingSkills.length > 0) {
626
+ this.logger.warn(`Agent ${agentId} references non-existent skills: [${missingSkills.join(", ")}]`);
627
+ }
628
+ return filtered;
629
+ }
630
+ getStats() {
631
+ const categoryStats = Array.from(this.categories.entries()).map(([category, skills]) => ({
632
+ category,
633
+ count: skills.size
634
+ })).sort((a, b) => b.count - a.count);
635
+ const expertiseStats = Array.from(this.expertise.entries()).map(([expertise, skills]) => ({
636
+ expertise,
637
+ count: skills.size
638
+ })).sort((a, b) => b.count - a.count);
639
+ return {
640
+ totalSkills: this.skills.size,
641
+ totalCategories: this.categories.size,
642
+ totalExpertiseAreas: this.expertise.size,
643
+ topCategories: categoryStats.slice(0, 10),
644
+ topExpertiseAreas: expertiseStats.slice(0, 10),
645
+ skills: this.list().map((skill) => ({
646
+ id: skill.id,
647
+ name: skill.name,
648
+ description: skill.description,
649
+ category: skill.category,
650
+ expertise: skill.expertise,
651
+ patternCount: skill.patterns?.length || 0,
652
+ exampleCount: skill.examples?.length || 0
653
+ }))
654
+ };
655
+ }
656
+ }
657
+ // ../essential-opencode/src/utils/workflow-engine.ts
658
+ class WorkflowEngine {
659
+ context;
660
+ toolRegistry;
661
+ logger;
662
+ workflows = new Map;
663
+ runningWorkflows = new Map;
664
+ constructor(context, toolRegistry, logger) {
665
+ this.context = context;
666
+ this.toolRegistry = toolRegistry;
667
+ this.logger = logger;
668
+ }
669
+ register(workflow) {
670
+ if (this.workflows.has(workflow.id)) {
671
+ this.logger.warn(`Workflow ${workflow.id} is already registered, overwriting...`);
672
+ }
673
+ this.workflows.set(workflow.id, workflow);
674
+ this.logger.debug(`Registered workflow: ${workflow.name} (${workflow.steps.length} steps)`);
675
+ }
676
+ unregister(id) {
677
+ this.workflows.delete(id);
678
+ this.logger.debug(`Unregistered workflow: ${id}`);
679
+ }
680
+ get(id) {
681
+ return this.workflows.get(id);
682
+ }
683
+ list() {
684
+ return Array.from(this.workflows.values());
685
+ }
686
+ async execute(workflowId, inputContext) {
687
+ const workflow = this.get(workflowId);
688
+ if (!workflow) {
689
+ return {
690
+ success: false,
691
+ error: `Workflow ${workflowId} not found`,
692
+ executionId: crypto.randomUUID()
693
+ };
694
+ }
695
+ const executionId = crypto.randomUUID();
696
+ this.logger.info(`Starting workflow execution: ${workflow.name} (${executionId})`);
697
+ const executionContext = {
698
+ workflow,
699
+ startTime: new Date,
700
+ currentStep: 0,
701
+ context: { ...inputContext, workflowId, executionId }
702
+ };
703
+ this.runningWorkflows.set(executionId, executionContext);
704
+ try {
705
+ await this.context.sessionManager?.createCheckpoint("workflow-start", `Started workflow: ${workflow.name}`, "automatic", { workflowId, executionId, inputContext });
706
+ const result = await this.executeSteps(workflow, executionContext);
707
+ await this.context.sessionManager?.createCheckpoint("workflow-complete", `Completed workflow: ${workflow.name}`, "automatic", {
708
+ workflowId,
709
+ executionId,
710
+ success: result.success,
711
+ duration: Date.now() - executionContext.startTime.getTime()
712
+ });
713
+ this.logger.info(`Workflow execution completed: ${workflow.name} (${executionId})`);
714
+ return {
715
+ ...result,
716
+ executionId
717
+ };
718
+ } catch (error) {
719
+ this.logger.error(`Workflow execution failed: ${workflow.name} (${executionId})`, error);
720
+ await this.context.sessionManager?.createCheckpoint("workflow-error", `Failed workflow: ${workflow.name}`, "error", {
721
+ workflowId,
722
+ executionId,
723
+ error: error instanceof Error ? error.message : String(error)
724
+ });
725
+ return {
726
+ success: false,
727
+ error: error instanceof Error ? error.message : String(error),
728
+ executionId
729
+ };
730
+ } finally {
731
+ this.runningWorkflows.delete(executionId);
732
+ }
733
+ }
734
+ async executeSteps(workflow, executionContext) {
735
+ let stepResult = {};
736
+ let stepContext = { ...executionContext.context };
737
+ for (let i = 0;i < workflow.steps.length; i++) {
738
+ const step = workflow.steps[i];
739
+ executionContext.currentStep = i;
740
+ this.logger.debug(`Executing step ${i + 1}/${workflow.steps.length}: ${step.name}`);
741
+ try {
742
+ if (step.condition && !this.evaluateCondition(step.condition, stepContext)) {
743
+ this.logger.debug(`Skipping step ${step.name} - condition not met`);
744
+ continue;
745
+ }
746
+ const result = await this.executeStep(step, stepContext, workflow);
747
+ if (!result.success) {
748
+ if (step.onError === "continue") {
749
+ this.logger.warn(`Step ${step.name} failed, continuing workflow`);
750
+ continue;
751
+ } else if (step.onError === "retry") {
752
+ this.logger.info(`Retrying step ${step.name}`);
753
+ i--;
754
+ continue;
755
+ } else {
756
+ return {
757
+ success: false,
758
+ error: `Step ${step.name} failed: ${result.error}`,
759
+ completedSteps: i,
760
+ stepResult
761
+ };
762
+ }
763
+ }
764
+ stepResult = { ...stepResult, [step.id]: result.result };
765
+ stepContext = { ...stepContext, ...result.result, stepResult };
766
+ } catch (error) {
767
+ this.logger.error(`Step execution error: ${step.name}`, error);
768
+ if (step.onError === "continue") {
769
+ continue;
770
+ } else {
771
+ return {
772
+ success: false,
773
+ error: error instanceof Error ? error.message : String(error),
774
+ completedSteps: i,
775
+ stepResult
776
+ };
777
+ }
778
+ }
779
+ }
780
+ return {
781
+ success: true,
782
+ result: stepResult
783
+ };
784
+ }
785
+ async executeStep(step, context, workflow) {
786
+ try {
787
+ switch (step.type) {
788
+ case "tool":
789
+ return await this.executeToolStep(step, context);
790
+ case "agent":
791
+ return await this.executeAgentStep(step, context);
792
+ case "condition":
793
+ return await this.executeConditionStep(step, context);
794
+ case "loop":
795
+ return await this.executeLoopStep(step, context, workflow);
796
+ default:
797
+ return {
798
+ success: false,
799
+ error: `Unknown step type: ${step.type}`
800
+ };
801
+ }
802
+ } catch (error) {
803
+ return {
804
+ success: false,
805
+ error: error instanceof Error ? error.message : String(error)
806
+ };
807
+ }
808
+ }
809
+ async executeToolStep(step, context) {
810
+ const toolName = step.config.tool;
811
+ const tool = this.toolRegistry.get(toolName);
812
+ if (!tool) {
813
+ return {
814
+ success: false,
815
+ error: `Tool ${toolName} not found`
816
+ };
817
+ }
818
+ this.logger.debug(`Executing tool: ${toolName}`);
819
+ try {
820
+ const args = this.substituteVariables(step.config.args || {}, context);
821
+ const result = await tool.execute(args, {
822
+ ...this.context,
823
+ signal: new AbortController().signal
824
+ });
825
+ return {
826
+ success: true,
827
+ result
828
+ };
829
+ } catch (error) {
830
+ return {
831
+ success: false,
832
+ error: error instanceof Error ? error.message : String(error)
833
+ };
834
+ }
835
+ }
836
+ async executeAgentStep(step, context) {
837
+ const agentName = step.config.agent;
838
+ const prompt = this.substituteVariables(step.config.prompt || "", context);
839
+ this.logger.debug(`Executing agent: ${agentName}`);
840
+ try {
841
+ const result = await this.context.task({
842
+ description: step.config.description || `Execute ${agentName} agent`,
843
+ prompt: this.createAgentPrompt(agentName, prompt, step.config, context),
844
+ subagent_type: "general"
845
+ });
846
+ return {
847
+ success: true,
848
+ result
849
+ };
850
+ } catch (error) {
851
+ return {
852
+ success: false,
853
+ error: error instanceof Error ? error.message : String(error)
854
+ };
855
+ }
856
+ }
857
+ async executeConditionStep(step, context) {
858
+ const condition = this.substituteVariables(step.config.condition, context);
859
+ const result = this.evaluateCondition(condition, context);
860
+ return {
861
+ success: true,
862
+ result: { condition, result }
863
+ };
864
+ }
865
+ async executeLoopStep(step, context, workflow) {
866
+ const iterations = step.config.iterations || 1;
867
+ const loopSteps = step.config.steps || [];
868
+ const loopResults = [];
869
+ this.logger.debug(`Executing loop: ${iterations} iterations`);
870
+ for (let i = 0;i < iterations; i++) {
871
+ const loopContext = { ...context, loopIndex: i };
872
+ const loopResult = {};
873
+ for (const loopStep of loopSteps) {
874
+ const result = await this.executeStep(loopStep, loopContext, workflow);
875
+ if (!result.success) {
876
+ return {
877
+ success: false,
878
+ error: `Loop step ${loopStep.name} failed on iteration ${i}: ${result.error}`
879
+ };
880
+ }
881
+ loopResult[loopStep.id] = result.result;
882
+ }
883
+ loopResults.push(loopResult);
884
+ }
885
+ return {
886
+ success: true,
887
+ result: { loopResults, iterations }
888
+ };
889
+ }
890
+ evaluateCondition(condition, context) {
891
+ try {
892
+ const evaluated = condition.replace(/\{(\w+)\}/g, (match, key) => {
893
+ return JSON.stringify(context[key] || "");
894
+ });
895
+ const fn = new Function("return " + evaluated);
896
+ return Boolean(fn());
897
+ } catch (error) {
898
+ this.logger.error(`Condition evaluation failed: ${condition}`, error);
899
+ return false;
900
+ }
901
+ }
902
+ substituteVariables(input, context) {
903
+ if (typeof input === "string") {
904
+ return input.replace(/\{(\w+)\}/g, (match, key) => {
905
+ return context[key] !== undefined ? String(context[key]) : match;
906
+ });
907
+ }
908
+ if (Array.isArray(input)) {
909
+ return input.map((item) => this.substituteVariables(item, context));
910
+ }
911
+ if (typeof input === "object" && input !== null) {
912
+ const result = {};
913
+ for (const [key, value] of Object.entries(input)) {
914
+ result[key] = this.substituteVariables(value, context);
915
+ }
916
+ return result;
917
+ }
918
+ return input;
919
+ }
920
+ createAgentPrompt(agentName, prompt, config, context) {
921
+ return `
922
+ You are acting as the ${agentName} agent within a workflow execution context.
923
+
924
+ ${prompt}
925
+
926
+ Context:
927
+ ${JSON.stringify(context, null, 2)}
928
+
929
+ Configuration:
930
+ ${JSON.stringify(config, null, 2)}
931
+
932
+ Please execute this task according to the agent's specialized capabilities and return the results in a structured format.
933
+ `.trim();
934
+ }
935
+ getRunningWorkflows() {
936
+ return Array.from(this.runningWorkflows.entries()).map(([executionId, running]) => ({
937
+ executionId,
938
+ workflow: running.workflow,
939
+ startTime: running.startTime,
940
+ currentStep: running.currentStep,
941
+ totalSteps: running.workflow.steps.length
942
+ }));
943
+ }
944
+ async stopWorkflow(executionId) {
945
+ const running = this.runningWorkflows.get(executionId);
946
+ if (!running)
947
+ return false;
948
+ this.logger.info(`Stopping workflow execution: ${executionId}`);
949
+ this.runningWorkflows.delete(executionId);
950
+ await this.context.sessionManager?.createCheckpoint("workflow-stop", `Stopped workflow: ${running.workflow.name}`, "automatic", {
951
+ workflowId: running.workflow.id,
952
+ executionId,
953
+ stoppedAt: new Date,
954
+ currentStep: running.currentStep
955
+ });
956
+ return true;
957
+ }
958
+ getStats() {
959
+ return {
960
+ totalWorkflows: this.workflows.size,
961
+ runningWorkflows: this.runningWorkflows.size,
962
+ workflows: this.list().map((workflow) => ({
963
+ id: workflow.id,
964
+ name: workflow.name,
965
+ description: workflow.description,
966
+ steps: workflow.steps.length,
967
+ triggers: workflow.triggers || [],
968
+ dependencies: workflow.dependencies || []
969
+ })),
970
+ runningDetails: this.getRunningWorkflows()
971
+ };
972
+ }
973
+ findByTrigger(trigger) {
974
+ return this.list().filter((workflow) => workflow.triggers?.includes(trigger));
975
+ }
976
+ async executeByTrigger(trigger, context) {
977
+ const workflows = this.findByTrigger(trigger);
978
+ const results = [];
979
+ for (const workflow of workflows) {
980
+ const result = await this.execute(workflow.id, context);
981
+ results.push({
982
+ workflowId: workflow.id,
983
+ executionId: result.executionId,
984
+ success: result.success,
985
+ error: result.error
986
+ });
987
+ }
988
+ return results;
989
+ }
990
+ }
991
+ // ../essential-opencode/src/utils/session-manager.ts
992
+ class SessionManager {
993
+ context;
994
+ logger;
995
+ checkpoints = [];
996
+ lastCheckpointTime = 0;
997
+ constructor(context, logger) {
998
+ this.context = context;
999
+ this.logger = logger;
1000
+ }
1001
+ async initialize() {
1002
+ this.logger.info("Initializing session manager...");
1003
+ await this.loadSessionData();
1004
+ await this.createCheckpoint("initial", "Session started", "automatic");
1005
+ this.logger.info("Session manager initialized");
1006
+ }
1007
+ async onSessionStart(input, output) {
1008
+ this.logger.info(`Session ${this.context.session.id} started`);
1009
+ this.context.session.startTime = new Date;
1010
+ await this.createCheckpoint("session-start", "OpenCode session initialized", "automatic", {
1011
+ input,
1012
+ output,
1013
+ workspace: this.context.workspace
1014
+ });
1015
+ }
1016
+ async onSessionEnd(input, output) {
1017
+ this.logger.info(`Session ${this.context.session.id} ending`);
1018
+ await this.createCheckpoint("session-end", "OpenCode session ended", "automatic", {
1019
+ input,
1020
+ output,
1021
+ duration: Date.now() - this.context.session.startTime.getTime(),
1022
+ checkpointCount: this.checkpoints.length
1023
+ });
1024
+ await this.saveSessionData();
1025
+ this.logger.info("Session manager cleaned up");
1026
+ }
1027
+ async createCheckpoint(type, description, checkpointType = "manual", additionalContext) {
1028
+ const checkpoint = {
1029
+ id: crypto.randomUUID(),
1030
+ timestamp: new Date,
1031
+ type: checkpointType,
1032
+ description,
1033
+ context: {
1034
+ ...this.context.session.context,
1035
+ type,
1036
+ ...additionalContext
1037
+ },
1038
+ state: this.captureState()
1039
+ };
1040
+ this.checkpoints.push(checkpoint);
1041
+ this.lastCheckpointTime = Date.now();
1042
+ this.logger.debug(`Created checkpoint: ${checkpoint.type} - ${checkpoint.description}`);
1043
+ if (this.checkpoints.length > 100) {
1044
+ this.checkpoints = this.checkpoints.slice(-50);
1045
+ }
1046
+ return checkpoint;
1047
+ }
1048
+ getRecentCheckpoints(count = 10) {
1049
+ return this.checkpoints.slice(-count).sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
1050
+ }
1051
+ getCheckpoint(id) {
1052
+ return this.checkpoints.find((cp) => cp.id === id);
1053
+ }
1054
+ async restoreFromCheckpoint(checkpointId) {
1055
+ const checkpoint = this.getCheckpoint(checkpointId);
1056
+ if (!checkpoint) {
1057
+ this.logger.error(`Checkpoint ${checkpointId} not found`);
1058
+ return false;
1059
+ }
1060
+ this.logger.info(`Restoring session from checkpoint: ${checkpoint.description}`);
1061
+ this.context.session.context = { ...checkpoint.context };
1062
+ await this.createCheckpoint("restore", `Restored from ${checkpointId}`, "automatic", {
1063
+ restoredFrom: checkpointId,
1064
+ restoredAt: new Date
1065
+ });
1066
+ return true;
1067
+ }
1068
+ async autoCheckpoint(description) {
1069
+ const now = Date.now();
1070
+ const timeSinceLastCheckpoint = now - this.lastCheckpointTime;
1071
+ if (timeSinceLastCheckpoint < 5 * 60 * 1000) {
1072
+ return;
1073
+ }
1074
+ await this.createCheckpoint("auto", description || "Automatic checkpoint", "automatic", {
1075
+ timeSinceLastCheckpoint,
1076
+ lastCheckpoint: this.checkpoints[this.checkpoints.length - 1]?.id
1077
+ });
1078
+ }
1079
+ getSessionSummary() {
1080
+ const now = new Date;
1081
+ return {
1082
+ id: this.context.session.id,
1083
+ startTime: this.context.session.startTime,
1084
+ duration: now.getTime() - this.context.session.startTime.getTime(),
1085
+ checkpointCount: this.checkpoints.length,
1086
+ lastActivity: new Date(this.lastCheckpointTime)
1087
+ };
1088
+ }
1089
+ exportSessionData() {
1090
+ return {
1091
+ session: {
1092
+ id: this.context.session.id,
1093
+ startTime: this.context.session.startTime,
1094
+ checkpoints: this.checkpoints,
1095
+ context: this.context.session.context
1096
+ },
1097
+ workspace: this.context.workspace,
1098
+ exportTime: new Date
1099
+ };
1100
+ }
1101
+ async importSessionData(data) {
1102
+ try {
1103
+ this.context.session.id = data.session.id || crypto.randomUUID();
1104
+ this.context.session.startTime = new Date(data.session.startTime || Date.now());
1105
+ this.checkpoints = data.session.checkpoints || [];
1106
+ this.context.session.context = data.session.context || {};
1107
+ this.logger.info(`Imported session data: ${this.checkpoints.length} checkpoints`);
1108
+ await this.createCheckpoint("import", "Session data imported", "automatic", {
1109
+ importedAt: new Date,
1110
+ originalSessionId: data.session.id
1111
+ });
1112
+ } catch (error) {
1113
+ this.logger.error("Failed to import session data", error);
1114
+ }
1115
+ }
1116
+ captureState() {
1117
+ return {
1118
+ timestamp: Date.now(),
1119
+ workspace: this.context.workspace,
1120
+ sessionContext: { ...this.context.session.context }
1121
+ };
1122
+ }
1123
+ async saveSessionData() {
1124
+ try {
1125
+ const sessionFile = `${this.context.workspace.root}/.opencode/session-${this.context.session.id}.json`;
1126
+ const sessionData = this.exportSessionData();
1127
+ await this.context.$`mkdir -p ${this.context.workspace.root}/.opencode`;
1128
+ await this.context.$`echo ${JSON.stringify(sessionData, null, 2)} > ${sessionFile}`;
1129
+ this.logger.debug(`Session data saved to ${sessionFile}`);
1130
+ } catch (error) {
1131
+ this.logger.error("Failed to save session data", error);
1132
+ }
1133
+ }
1134
+ async loadSessionData() {
1135
+ try {
1136
+ const sessionFile = `${this.context.workspace.root}/.opencode/session-${this.context.session.id}.json`;
1137
+ const result = await this.context.$`test -f ${sessionFile}`.quiet().nothrow();
1138
+ const fileExists = result.exitCode === 0;
1139
+ if (!fileExists)
1140
+ return;
1141
+ const sessionData = await this.context.$`cat ${sessionFile}`.text();
1142
+ const parsed = JSON.parse(sessionData);
1143
+ await this.importSessionData(parsed);
1144
+ this.logger.info(`Loaded session data from ${sessionFile}`);
1145
+ } catch (error) {
1146
+ this.logger.error("Failed to load session data", error);
1147
+ }
1148
+ }
1149
+ async cleanupOldSessions(maxAge = 7 * 24 * 60 * 60 * 1000) {
1150
+ try {
1151
+ const sessionDir = `${this.context.workspace.root}/.opencode`;
1152
+ const now = Date.now();
1153
+ const sessionFiles = await this.context.$`ls ${sessionDir}/session-*.json 2>/dev/null || true`.text().trim().split(`
1154
+ `).filter(Boolean);
1155
+ for (const file of sessionFiles) {
1156
+ const fileStats = await this.context.$`stat -c %Y ${file}`.text().trim();
1157
+ const fileTime = parseInt(fileStats) * 1000;
1158
+ if (now - fileTime > maxAge) {
1159
+ await this.context.$`rm ${file}`;
1160
+ this.logger.debug(`Removed old session file: ${file}`);
1161
+ }
1162
+ }
1163
+ } catch (error) {
1164
+ this.logger.error("Failed to cleanup old sessions", error);
1165
+ }
1166
+ }
1167
+ }
1168
+ // ../essential-opencode/src/utils/hook-manager.ts
1169
+ class HookManager {
1170
+ context;
1171
+ logger;
1172
+ hooks = new Map;
1173
+ eventHistory = [];
1174
+ constructor(context, logger) {
1175
+ this.context = context;
1176
+ this.logger = logger;
1177
+ }
1178
+ async beforeToolExecute(input, output) {
1179
+ const startTime = Date.now();
1180
+ try {
1181
+ this.logger.debug(`Before tool execute: ${input.tool}`);
1182
+ if (this.shouldCreateCheckpoint(input.tool)) {
1183
+ await this.context.sessionManager?.createCheckpoint("tool-before", `Before ${input.tool}`, "automatic", { tool: input.tool, args: input.args });
1184
+ }
1185
+ this.logToolUsage(input, "before");
1186
+ await this.validateToolExecution(input);
1187
+ } catch (error) {
1188
+ this.logger.error("Error in beforeToolExecute hook", error);
1189
+ throw error;
1190
+ } finally {
1191
+ this.recordEvent("tool.execute.before", input, output, Date.now() - startTime);
1192
+ }
1193
+ }
1194
+ async afterToolExecute(input, output) {
1195
+ const startTime = Date.now();
1196
+ try {
1197
+ this.logger.debug(`After tool execute: ${input.tool}`);
1198
+ if (this.shouldCreateCheckpoint(input.tool, output)) {
1199
+ await this.context.sessionManager?.createCheckpoint("tool-after", `After ${input.tool}`, "automatic", {
1200
+ tool: input.tool,
1201
+ success: !output.error,
1202
+ resultSize: this.getResultSize(output)
1203
+ });
1204
+ }
1205
+ await this.analyzeToolResults(input, output);
1206
+ this.updateSessionContext(input, output);
1207
+ } catch (error) {
1208
+ this.logger.error("Error in afterToolExecute hook", error);
1209
+ throw error;
1210
+ } finally {
1211
+ this.recordEvent("tool.execute.after", input, output, Date.now() - startTime);
1212
+ }
1213
+ }
1214
+ async onAgentRequest(input, output) {
1215
+ const startTime = Date.now();
1216
+ try {
1217
+ this.logger.debug(`Agent request: ${input.agent || "unknown"}`);
1218
+ await this.context.sessionManager?.createCheckpoint("agent-request", `Agent request: ${input.agent}`, "automatic", { agent: input.agent, request: input.request });
1219
+ this.monitorAgentUsage(input);
1220
+ } catch (error) {
1221
+ this.logger.error("Error in onAgentRequest hook", error);
1222
+ throw error;
1223
+ } finally {
1224
+ this.recordEvent("agent.request", input, output, Date.now() - startTime);
1225
+ }
1226
+ }
1227
+ registerHook(event, handler) {
1228
+ if (!this.hooks.has(event)) {
1229
+ this.hooks.set(event, []);
1230
+ }
1231
+ this.hooks.get(event).push(handler);
1232
+ this.logger.debug(`Registered hook for event: ${event}`);
1233
+ }
1234
+ unregisterHook(event, handler) {
1235
+ const handlers = this.hooks.get(event);
1236
+ if (handlers) {
1237
+ const index = handlers.indexOf(handler);
1238
+ if (index > -1) {
1239
+ handlers.splice(index, 1);
1240
+ this.logger.debug(`Unregistered hook for event: ${event}`);
1241
+ }
1242
+ }
1243
+ }
1244
+ async executeHooks(event, input, output) {
1245
+ const handlers = this.hooks.get(event);
1246
+ if (!handlers || handlers.length === 0)
1247
+ return;
1248
+ this.logger.debug(`Executing ${handlers.length} hooks for event: ${event}`);
1249
+ for (const handler of handlers) {
1250
+ try {
1251
+ await handler(input, output, this.context);
1252
+ } catch (error) {
1253
+ this.logger.error(`Hook execution failed for event: ${event}`, error);
1254
+ }
1255
+ }
1256
+ }
1257
+ getHookStats() {
1258
+ const eventCounts = new Map;
1259
+ const totalDuration = new Map;
1260
+ for (const event of this.eventHistory) {
1261
+ eventCounts.set(event.event, (eventCounts.get(event.event) || 0) + 1);
1262
+ totalDuration.set(event.event, (totalDuration.get(event.event) || 0) + event.duration);
1263
+ }
1264
+ return {
1265
+ totalEvents: this.eventHistory.length,
1266
+ registeredHooks: Array.from(this.hooks.entries()).map(([event, handlers]) => ({
1267
+ event,
1268
+ count: handlers.length
1269
+ })),
1270
+ eventStats: Array.from(eventCounts.entries()).map(([event, count]) => ({
1271
+ event,
1272
+ count,
1273
+ averageDuration: totalDuration.get(event) / count,
1274
+ totalDuration: totalDuration.get(event)
1275
+ })),
1276
+ recentEvents: this.eventHistory.slice(-10).map((e) => ({
1277
+ event: e.event,
1278
+ timestamp: e.timestamp,
1279
+ duration: e.duration
1280
+ }))
1281
+ };
1282
+ }
1283
+ shouldCreateCheckpoint(tool, output) {
1284
+ const significantTools = ["write", "edit", "bash", "glob", "task"];
1285
+ if (significantTools.includes(tool))
1286
+ return true;
1287
+ if (output?.error)
1288
+ return true;
1289
+ if (output && this.getResultSize(output) > 1e4)
1290
+ return true;
1291
+ return false;
1292
+ }
1293
+ getResultSize(output) {
1294
+ if (typeof output === "string")
1295
+ return output.length;
1296
+ if (typeof output === "object") {
1297
+ try {
1298
+ return JSON.stringify(output).length;
1299
+ } catch {
1300
+ return 0;
1301
+ }
1302
+ }
1303
+ return 0;
1304
+ }
1305
+ logToolUsage(input, phase) {
1306
+ const usage = {
1307
+ tool: input.tool,
1308
+ phase,
1309
+ timestamp: new Date,
1310
+ args: input.args ? Object.keys(input.args) : [],
1311
+ sessionId: this.context.session.id
1312
+ };
1313
+ this.logger.debug(`Tool usage: ${usage.tool} (${usage.phase})`);
1314
+ }
1315
+ async validateToolExecution(input) {
1316
+ switch (input.tool) {
1317
+ case "bash":
1318
+ await this.validateBashCommand(input.args?.command || "");
1319
+ break;
1320
+ case "write":
1321
+ case "edit":
1322
+ await this.validateFileOperation(input.args?.filePath || "");
1323
+ break;
1324
+ case "read":
1325
+ await this.validateFileRead(input.args?.filePath || "");
1326
+ break;
1327
+ }
1328
+ }
1329
+ async validateBashCommand(command) {
1330
+ const dangerousPatterns = [
1331
+ /rm\s+-rf/,
1332
+ /sudo/,
1333
+ /passwd/,
1334
+ /curl.*\|.*sh/,
1335
+ /wget.*\|.*sh/,
1336
+ /eval/,
1337
+ /exec/
1338
+ ];
1339
+ for (const pattern of dangerousPatterns) {
1340
+ if (pattern.test(command)) {
1341
+ this.logger.warn(`Potentially dangerous command detected: ${command}`);
1342
+ }
1343
+ }
1344
+ }
1345
+ async validateFileOperation(filePath) {
1346
+ const sensitivePatterns = [
1347
+ /\.env$/,
1348
+ /\/etc\//,
1349
+ /\.ssh\//,
1350
+ /\.gnupg\//
1351
+ ];
1352
+ for (const pattern of sensitivePatterns) {
1353
+ if (pattern.test(filePath)) {
1354
+ this.logger.warn(`Attempted write to sensitive file: ${filePath}`);
1355
+ }
1356
+ }
1357
+ }
1358
+ async validateFileRead(filePath) {
1359
+ const sensitivePatterns = [
1360
+ /\.env$/,
1361
+ /\.pem$/,
1362
+ /\.key$/,
1363
+ /\/etc\/shadow/
1364
+ ];
1365
+ for (const pattern of sensitivePatterns) {
1366
+ if (pattern.test(filePath)) {
1367
+ this.logger.warn(`Attempted read from sensitive file: ${filePath}`);
1368
+ }
1369
+ }
1370
+ }
1371
+ async analyzeToolResults(input, output) {
1372
+ if (input.tool === "read" && output?.content) {
1373
+ const insights = this.analyzeFileContent(output.content, input.args?.filePath || "");
1374
+ if (insights.length > 0) {
1375
+ this.context.session.context.fileInsights = {
1376
+ ...this.context.session.context.fileInsights || {},
1377
+ [input.args?.filePath || ""]: insights
1378
+ };
1379
+ }
1380
+ }
1381
+ if (input.tool === "bash" && output?.stdout) {
1382
+ const insights = this.analyzeBashOutput(output.stdout, input.args?.command || "");
1383
+ if (insights.length > 0) {
1384
+ this.context.session.context.commandInsights = {
1385
+ ...this.context.session.context.commandInsights || {},
1386
+ [input.args?.command || ""]: insights
1387
+ };
1388
+ }
1389
+ }
1390
+ }
1391
+ analyzeFileContent(content, filePath) {
1392
+ const insights = [];
1393
+ if (content.includes("TODO") || content.includes("FIXME")) {
1394
+ insights.push("Contains TODO/FIXME comments");
1395
+ }
1396
+ if (content.includes("console.log") && filePath.endsWith(".js")) {
1397
+ insights.push("Contains console.log statements");
1398
+ }
1399
+ if (content.includes("import") && content.includes("from")) {
1400
+ insights.push("Uses ES6 imports");
1401
+ }
1402
+ return insights;
1403
+ }
1404
+ analyzeBashOutput(output, command) {
1405
+ const insights = [];
1406
+ if (command.includes("test") && output.includes("failed")) {
1407
+ insights.push("Test failures detected");
1408
+ }
1409
+ if (command.includes("git") && output.includes("conflict")) {
1410
+ insights.push("Git conflicts detected");
1411
+ }
1412
+ if (command.includes("npm") && output.includes("error")) {
1413
+ insights.push("NPM errors detected");
1414
+ }
1415
+ return insights;
1416
+ }
1417
+ updateSessionContext(input, output) {
1418
+ if (["write", "edit"].includes(input.tool)) {
1419
+ const filePath = input.args?.filePath;
1420
+ if (filePath) {
1421
+ this.context.session.context.modifiedFiles = [
1422
+ ...this.context.session.context.modifiedFiles || [],
1423
+ filePath
1424
+ ].filter((file, index, arr) => arr.indexOf(file) === index);
1425
+ }
1426
+ }
1427
+ if (input.tool === "bash") {
1428
+ this.context.session.context.executedCommands = [
1429
+ ...this.context.session.context.executedCommands || [],
1430
+ {
1431
+ command: input.args?.command,
1432
+ timestamp: new Date,
1433
+ success: !output?.error
1434
+ }
1435
+ ];
1436
+ }
1437
+ }
1438
+ monitorAgentUsage(input) {
1439
+ const agentName = input.agent || "unknown";
1440
+ this.context.session.context.agentUsage = {
1441
+ ...this.context.session.context.agentUsage || {},
1442
+ [agentName]: {
1443
+ ...this.context.session.context.agentUsage?.[agentName] || {},
1444
+ count: (this.context.session.context.agentUsage?.[agentName]?.count || 0) + 1,
1445
+ lastUsed: new Date
1446
+ }
1447
+ };
1448
+ }
1449
+ recordEvent(event, input, output, duration) {
1450
+ this.eventHistory.push({
1451
+ event,
1452
+ timestamp: new Date,
1453
+ input: this.sanitizeInput(input),
1454
+ output: this.sanitizeOutput(output),
1455
+ duration
1456
+ });
1457
+ if (this.eventHistory.length > 1000) {
1458
+ this.eventHistory = this.eventHistory.slice(-500);
1459
+ }
1460
+ }
1461
+ sanitizeInput(input) {
1462
+ if (!input)
1463
+ return input;
1464
+ const sanitized = { ...input };
1465
+ delete sanitized.password;
1466
+ delete sanitized.token;
1467
+ delete sanitized.secret;
1468
+ return sanitized;
1469
+ }
1470
+ sanitizeOutput(output) {
1471
+ if (!output)
1472
+ return output;
1473
+ const sanitized = { ...output };
1474
+ if (sanitized.content && sanitized.content.length > 1000) {
1475
+ sanitized.content = sanitized.content.substring(0, 1000) + "...[truncated]";
1476
+ }
1477
+ return sanitized;
1478
+ }
1479
+ }
1480
+ // ../essential-opencode/src/utils/agent-utils.ts
1481
+ function withDefaults(agent, config) {
1482
+ const defaults = config?.defaults || DEFAULT_CONFIG.defaults;
1483
+ return {
1484
+ ...agent,
1485
+ temperature: agent.temperature ?? defaults.temperature,
1486
+ maxTokens: agent.maxTokens ?? defaults.maxTokens
1487
+ };
1488
+ }
1489
+ function validateAgent(agent) {
1490
+ if (!agent.id || !agent.name || !agent.description) {
1491
+ return false;
1492
+ }
1493
+ if (agent.temperature !== undefined && (agent.temperature < 0 || agent.temperature > 2)) {
1494
+ console.warn(`[agent-utils] Invalid temperature for ${agent.id}: ${agent.temperature}. Should be between 0 and 2.`);
1495
+ return false;
1496
+ }
1497
+ if (agent.maxTokens !== undefined && agent.maxTokens < 1) {
1498
+ console.warn(`[agent-utils] Invalid maxTokens for ${agent.id}: ${agent.maxTokens}. Should be >= 1.`);
1499
+ return false;
1500
+ }
1501
+ return true;
1502
+ }
1503
+ function getAvailableSkills(agent, allSkills) {
1504
+ if (!agent.allowedSkills || agent.allowedSkills.length === 0) {
1505
+ return allSkills;
1506
+ }
1507
+ return allSkills.filter((skill) => agent.allowedSkills.includes(skill));
1508
+ }
1509
+ // ../essential-opencode/src/utils/agent-skill-validator.ts
1510
+ function validateAgentSkillCompatibility(agent, availableSkills) {
1511
+ const result = {
1512
+ valid: true,
1513
+ errors: [],
1514
+ warnings: [],
1515
+ suggestions: []
1516
+ };
1517
+ const skillMap = new Map(availableSkills.map((s) => [s.id, s]));
1518
+ const allowedSkills = agent.allowedSkills || [];
1519
+ if (allowedSkills.length === 0) {
1520
+ result.suggestions.push(`Agent '${agent.id}' has access to all ${availableSkills.length} skills. Consider scoping skills to prevent ultracontext rot.`);
1521
+ return result;
1522
+ }
1523
+ const nonExistent = allowedSkills.filter((skillId) => !skillMap.has(skillId));
1524
+ if (nonExistent.length > 0) {
1525
+ result.valid = false;
1526
+ result.errors.push(`Agent '${agent.id}' references non-existent skills: [${nonExistent.join(", ")}]`);
1527
+ }
1528
+ const existingSkills = allowedSkills.filter((skillId) => skillMap.has(skillId));
1529
+ if (existingSkills.length === 0 && allowedSkills.length > 0) {
1530
+ result.valid = false;
1531
+ result.errors.push(`Agent '${agent.id}' has no valid skills available`);
1532
+ }
1533
+ if (agent.capabilities && agent.capabilities.length > 0) {
1534
+ const suggestedSkills = availableSkills.filter((skill) => {
1535
+ return agent.capabilities.some((cap) => skill.expertise.some((exp) => exp.toLowerCase().includes(cap.toLowerCase()) || cap.toLowerCase().includes(exp.toLowerCase())));
1536
+ });
1537
+ const missingSuggestions = suggestedSkills.filter((skill) => !allowedSkills.includes(skill.id)).map((skill) => skill.id);
1538
+ if (missingSuggestions.length > 0) {
1539
+ result.suggestions.push(`Agent '${agent.id}' might benefit from these skills based on capabilities: [${missingSuggestions.join(", ")}]`);
1540
+ }
1541
+ }
1542
+ if (existingSkills.length > 0 && existingSkills.length < 3 && availableSkills.length > 5) {
1543
+ result.warnings.push(`Agent '${agent.id}' has access to only ${existingSkills.length} skill(s), which may limit functionality`);
1544
+ }
1545
+ return result;
1546
+ }
1547
+ function validateAllAgents(agents, availableSkills) {
1548
+ const results = new Map;
1549
+ for (const agent of agents) {
1550
+ const result = validateAgentSkillCompatibility(agent, availableSkills);
1551
+ results.set(agent.id, result);
1552
+ }
1553
+ return results;
1554
+ }
1555
+ function getValidationSummary(results) {
1556
+ let totalAgents = 0;
1557
+ let validAgents = 0;
1558
+ let totalErrors = 0;
1559
+ let totalWarnings = 0;
1560
+ let totalSuggestions = 0;
1561
+ for (const [agentId, result] of results) {
1562
+ totalAgents++;
1563
+ if (result.valid)
1564
+ validAgents++;
1565
+ totalErrors += result.errors.length;
1566
+ totalWarnings += result.warnings.length;
1567
+ totalSuggestions += result.suggestions.length;
1568
+ }
1569
+ return {
1570
+ totalAgents,
1571
+ validAgents,
1572
+ invalidAgents: totalAgents - validAgents,
1573
+ totalErrors,
1574
+ totalWarnings,
1575
+ totalSuggestions,
1576
+ allValid: validAgents === totalAgents
1577
+ };
1578
+ }
1579
+ // ../essential-opencode/src/hooks/index.ts
1580
+ async function onSessionStart(context) {
1581
+ console.log("[everything-opencode] Session started");
1582
+ return {
1583
+ success: true,
1584
+ data: {
1585
+ timestamp: new Date().toISOString(),
1586
+ sessionId: context.sessionId
1587
+ }
1588
+ };
1589
+ }
1590
+ async function onSessionEnd(context) {
1591
+ console.log("[everything-opencode] Session ended");
1592
+ return {
1593
+ success: true,
1594
+ data: {
1595
+ timestamp: new Date().toISOString(),
1596
+ sessionId: context.sessionId
1597
+ }
1598
+ };
1599
+ }
1600
+ async function onToolExecuteBefore(context) {
1601
+ const toolName = context.data?.toolName;
1602
+ console.log(`[everything-opencode] Executing tool: ${toolName}`);
1603
+ return {
1604
+ success: true,
1605
+ data: {
1606
+ timestamp: new Date().toISOString(),
1607
+ toolName
1608
+ }
1609
+ };
1610
+ }
1611
+ async function onToolExecuteAfter(context) {
1612
+ const toolName = context.data?.toolName;
1613
+ const success = context.data?.success;
1614
+ console.log(`[everything-opencode] Tool ${toolName} ${success ? "succeeded" : "failed"}`);
1615
+ return {
1616
+ success: true,
1617
+ data: {
1618
+ timestamp: new Date().toISOString(),
1619
+ toolName,
1620
+ success
1621
+ }
1622
+ };
1623
+ }
1624
+ async function onAgentRequest(context) {
1625
+ const agentId = context.data?.agentId;
1626
+ console.log(`[everything-opencode] Agent request: ${agentId}`);
1627
+ return {
1628
+ success: true,
1629
+ data: {
1630
+ timestamp: new Date().toISOString(),
1631
+ agentId
1632
+ }
1633
+ };
1634
+ }
1635
+ // ../essential-opencode/src/contexts/index.ts
1636
+ import { readFileSync, existsSync } from "fs";
1637
+ import { join } from "path";
1638
+ function detectTypeScript(workingDir) {
1639
+ const tsconfigPath = join(workingDir, "tsconfig.json");
1640
+ return existsSync(tsconfigPath);
1641
+ }
1642
+ function detectPackageManager(workingDir) {
1643
+ if (existsSync(join(workingDir, "bun.lockb")))
1644
+ return "bun";
1645
+ if (existsSync(join(workingDir, "pnpm-lock.yaml")))
1646
+ return "pnpm";
1647
+ if (existsSync(join(workingDir, "yarn.lock")))
1648
+ return "yarn";
1649
+ if (existsSync(join(workingDir, "package-lock.json")))
1650
+ return "npm";
1651
+ return "unknown";
1652
+ }
1653
+ function detectTestingFramework(workingDir) {
1654
+ const packageJsonPath = join(workingDir, "package.json");
1655
+ if (!existsSync(packageJsonPath))
1656
+ return "unknown";
1657
+ try {
1658
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
1659
+ const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
1660
+ if (deps.vitest)
1661
+ return "vitest";
1662
+ if (deps.jest)
1663
+ return "jest";
1664
+ if (deps.mocha)
1665
+ return "mocha";
1666
+ } catch (error) {
1667
+ console.error("[contexts] Failed to parse package.json:", error);
1668
+ }
1669
+ return "unknown";
1670
+ }
1671
+ function enrichContext(context) {
1672
+ const workingDir = context.workingDirectory || process.cwd();
1673
+ return {
1674
+ ...context,
1675
+ projectContext: {
1676
+ isTypeScript: detectTypeScript(workingDir),
1677
+ packageManager: detectPackageManager(workingDir),
1678
+ testingFramework: detectTestingFramework(workingDir),
1679
+ workingDir
1680
+ }
1681
+ };
1682
+ }
1683
+ // ../essential-opencode/src/agents/planner.ts
1684
+ var plannerAgent = {
1685
+ id: "planner",
1686
+ name: "Planner",
1687
+ description: "Expert planning specialist for complex features and refactoring. Use PROACTIVELY when users request feature implementation, architectural changes, or complex refactoring. Automatically activated for planning tasks.",
1688
+ capabilities: [
1689
+ "requirements-analysis",
1690
+ "architecture-review",
1691
+ "step-breakdown",
1692
+ "implementation-planning",
1693
+ "risk-assessment",
1694
+ "dependency-mapping"
1695
+ ],
1696
+ tools: [
1697
+ "read",
1698
+ "grep",
1699
+ "glob"
1700
+ ],
1701
+ context: [
1702
+ "project-architecture",
1703
+ "implementation-strategies",
1704
+ "best-practices",
1705
+ "risk-mitigation"
1706
+ ],
1707
+ temperature: 0.3,
1708
+ allowedSkills: [
1709
+ "coding-standards",
1710
+ "testing",
1711
+ "documentation",
1712
+ "planning-with-files"
1713
+ ]
1714
+ };
1715
+ var planner_default = plannerAgent;
1716
+ // ../essential-opencode/src/agents/code-reviewer.ts
1717
+ var codeReviewerAgent = {
1718
+ id: "code-reviewer",
1719
+ name: "Code Reviewer",
1720
+ description: "Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code. MUST BE USED for all code changes.",
1721
+ capabilities: [
1722
+ "code-quality-review",
1723
+ "security-checks",
1724
+ "performance-analysis",
1725
+ "best-practices",
1726
+ "error-handling",
1727
+ "test-coverage-review"
1728
+ ],
1729
+ tools: [
1730
+ "read",
1731
+ "grep",
1732
+ "glob",
1733
+ "bash"
1734
+ ],
1735
+ context: [
1736
+ "coding-standards",
1737
+ "security-vulnerabilities",
1738
+ "performance-optimization",
1739
+ "code-maintainability"
1740
+ ],
1741
+ allowedSkills: ["coding-standards", "security-check", "performance-optimization"]
1742
+ };
1743
+ var code_reviewer_default = codeReviewerAgent;
1744
+ // ../essential-opencode/src/agents/doc-updater.ts
1745
+ var docUpdaterAgent = {
1746
+ id: "doc-updater",
1747
+ name: "Documentation Updater",
1748
+ description: "Documentation and codemap specialist. Use PROACTIVELY for updating codemaps and documentation. Runs /update-codemaps and /update-docs, generates docs/CODEMAPS/*, updates READMEs and guides.",
1749
+ capabilities: [
1750
+ "codemap-generation",
1751
+ "documentation-updates",
1752
+ "ast-analysis",
1753
+ "dependency-mapping",
1754
+ "api-documentation"
1755
+ ],
1756
+ tools: [
1757
+ "read",
1758
+ "write",
1759
+ "edit",
1760
+ "bash",
1761
+ "grep",
1762
+ "glob"
1763
+ ],
1764
+ context: [
1765
+ "typescript-ast",
1766
+ "documentation-generation",
1767
+ "code-structure-analysis",
1768
+ "dependency-graphs"
1769
+ ]
1770
+ };
1771
+ var doc_updater_default = docUpdaterAgent;
1772
+ // ../essential-opencode/src/agents/build-error-resolver.ts
1773
+ var buildErrorResolverAgent = {
1774
+ id: "build-error-resolver",
1775
+ name: "Build Error Resolver",
1776
+ description: "Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur. Fixes build/type errors only with minimal diffs, no architectural edits. Focuses on getting the build green quickly.",
1777
+ capabilities: [
1778
+ "typescript-error-resolution",
1779
+ "build-error-fixing",
1780
+ "dependency-issues",
1781
+ "configuration-errors",
1782
+ "minimal-diffs",
1783
+ "compilation-failures"
1784
+ ],
1785
+ tools: [
1786
+ "read",
1787
+ "write",
1788
+ "edit",
1789
+ "bash",
1790
+ "grep",
1791
+ "glob"
1792
+ ],
1793
+ context: [
1794
+ "build-configuration",
1795
+ "typescript-compiler",
1796
+ "dependency-management",
1797
+ "error-resolution"
1798
+ ]
1799
+ };
1800
+ var build_error_resolver_default = buildErrorResolverAgent;
1801
+ // ../essential-opencode/src/agents/security-reviewer.ts
1802
+ var securityReviewerAgent = {
1803
+ id: "security-reviewer",
1804
+ name: "Security Reviewer",
1805
+ description: "Security vulnerability detection and remediation specialist. Use PROACTIVELY after writing code that handles user input, authentication, API endpoints, or sensitive data. Flags secrets, SSRF, injection, unsafe crypto, and OWASP Top 10 vulnerabilities.",
1806
+ capabilities: [
1807
+ "vulnerability-detection",
1808
+ "secrets-detection",
1809
+ "input-validation",
1810
+ "authentication-security",
1811
+ "dependency-security",
1812
+ "owasp-top-10"
1813
+ ],
1814
+ tools: [
1815
+ "read",
1816
+ "write",
1817
+ "edit",
1818
+ "bash",
1819
+ "grep",
1820
+ "glob"
1821
+ ],
1822
+ context: [
1823
+ "owasp-top-10",
1824
+ "security-best-practices",
1825
+ "cryptographic-security",
1826
+ "authentication-authorization",
1827
+ "financial-security"
1828
+ ]
1829
+ };
1830
+ var security_reviewer_default = securityReviewerAgent;
1831
+ // ../essential-opencode/src/agents/refactor-cleaner.ts
1832
+ var refactorCleanerAgent = {
1833
+ id: "refactor-cleaner",
1834
+ name: "Refactor Cleaner",
1835
+ description: "Dead code cleanup and consolidation specialist. Use PROACTIVELY for removing unused code, duplicates, and refactoring. Runs analysis tools (knip, depcheck, ts-prune) to identify dead code and safely removes it.",
1836
+ capabilities: [
1837
+ "dead-code-detection",
1838
+ "duplicate-elimination",
1839
+ "dependency-cleanup",
1840
+ "safe-refactoring",
1841
+ "code-consolidation"
1842
+ ],
1843
+ tools: [
1844
+ "read",
1845
+ "write",
1846
+ "edit",
1847
+ "bash",
1848
+ "grep",
1849
+ "glob"
1850
+ ],
1851
+ context: [
1852
+ "code-analysis",
1853
+ "dependency-management",
1854
+ "refactoring-best-practices",
1855
+ "deletion-logging"
1856
+ ]
1857
+ };
1858
+ var refactor_cleaner_default = refactorCleanerAgent;
1859
+ // ../essential-opencode/src/skills/coding-standards.ts
1860
+ var codingStandardsSkill = {
1861
+ id: "coding-standards",
1862
+ name: "Coding Standards & Best Practices",
1863
+ description: "Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development",
1864
+ category: "development",
1865
+ expertise: [
1866
+ "typescript-standards",
1867
+ "javascript-best-practices",
1868
+ "react-patterns",
1869
+ "nodejs-patterns",
1870
+ "code-quality",
1871
+ "performance-optimization",
1872
+ "error-handling",
1873
+ "api-design"
1874
+ ],
1875
+ patterns: [
1876
+ "Use descriptive variable and function names",
1877
+ "Follow KISS (Keep It Simple, Stupid) principle",
1878
+ "Apply DRY (Don't Repeat Yourself) pattern",
1879
+ "Follow YAGNI (You Aren't Gonna Need It) principle",
1880
+ "Use immutable patterns with spread operator",
1881
+ "Implement comprehensive error handling",
1882
+ "Follow async/await best practices",
1883
+ "Use proper TypeScript typing"
1884
+ ],
1885
+ examples: [
1886
+ "Refactor complex functions into smaller, focused functions",
1887
+ "Implement proper error boundaries in React applications",
1888
+ "Create reusable custom hooks for common logic",
1889
+ "Set up consistent API response formats",
1890
+ "Apply performance optimization with memoization and lazy loading"
1891
+ ]
1892
+ };
1893
+ var coding_standards_default = codingStandardsSkill;
1894
+ // ../essential-opencode/src/skills/tdd-workflow.ts
1895
+ var tddWorkflowSkill = {
1896
+ id: "tdd-workflow",
1897
+ name: "Test-Driven Development Workflow",
1898
+ description: "TDD methodology with comprehensive testing including unit, integration, and E2E tests for minimum 80% coverage",
1899
+ category: "development",
1900
+ expertise: [
1901
+ "test-driven-development",
1902
+ "unit-testing",
1903
+ "integration-testing",
1904
+ "e2e-testing",
1905
+ "test-coverage",
1906
+ "testing-patterns",
1907
+ "mock-testing",
1908
+ "continuous-testing"
1909
+ ],
1910
+ patterns: [
1911
+ "Write tests BEFORE code implementation",
1912
+ "Arrange-Act-Assert test structure",
1913
+ "Test edge cases and error scenarios",
1914
+ "Mock external dependencies",
1915
+ "Verify 80%+ code coverage",
1916
+ "Use semantic selectors in tests",
1917
+ "Independent test isolation",
1918
+ "Descriptive test naming"
1919
+ ],
1920
+ examples: [
1921
+ "Write failing tests for new functionality, then implement code to make tests pass",
1922
+ "Create comprehensive test suite for API endpoints with Jest/Supertest",
1923
+ "Implement E2E tests with Playwright for critical user workflows",
1924
+ "Set up test coverage reporting and enforce minimum thresholds",
1925
+ "Mock external services like databases and APIs for isolated unit testing"
1926
+ ]
1927
+ };
1928
+ var tdd_workflow_default = tddWorkflowSkill;
1929
+ // ../essential-opencode/src/skills/security-review.ts
1930
+ var securityReviewSkill = {
1931
+ id: "security-review",
1932
+ name: "Security Review",
1933
+ description: "Comprehensive security analysis including vulnerability assessment, secure coding practices, and security best practices",
1934
+ category: "security",
1935
+ expertise: [
1936
+ "vulnerability-assessment",
1937
+ "secure-coding",
1938
+ "authentication-authorization",
1939
+ "data-protection",
1940
+ "security-audit",
1941
+ "penetration-testing"
1942
+ ],
1943
+ patterns: [
1944
+ "Check for SQL injection vulnerabilities",
1945
+ "Validate input sanitization and output encoding",
1946
+ "Review authentication and authorization mechanisms",
1947
+ "Assess data protection and encryption usage",
1948
+ "Identify potential security misconfigurations",
1949
+ "Review dependency security",
1950
+ "Check for XSS and CSRF vulnerabilities",
1951
+ "Validate session management"
1952
+ ],
1953
+ examples: [
1954
+ "Review user authentication implementation for security weaknesses",
1955
+ "Assess API endpoint security including input validation and rate limiting",
1956
+ "Analyze database queries for SQL injection vulnerabilities",
1957
+ "Review file upload functionality for security risks",
1958
+ "Check for proper error handling that doesn't leak sensitive information"
1959
+ ]
1960
+ };
1961
+ var security_review_default = securityReviewSkill;
1962
+ // ../essential-opencode/src/skills/verification-loop.ts
1963
+ var verificationLoopSkill = {
1964
+ id: "verification-loop",
1965
+ name: "Verification Loop",
1966
+ description: "Comprehensive verification system for development sessions with build, type checking, linting, testing, security scanning, and diff review",
1967
+ category: "quality-assurance",
1968
+ expertise: [
1969
+ "build-verification",
1970
+ "type-checking",
1971
+ "linting-checks",
1972
+ "test-verification",
1973
+ "security-scanning",
1974
+ "diff-review",
1975
+ "quality-gates",
1976
+ "continuous-verification"
1977
+ ],
1978
+ patterns: [
1979
+ "Run build verification before any other checks",
1980
+ "Execute type checking to catch type errors early",
1981
+ "Run linting to enforce code standards",
1982
+ "Execute test suite with coverage reporting",
1983
+ "Perform security scans for secrets and vulnerabilities",
1984
+ "Review diff for unintended changes and edge cases",
1985
+ "Generate comprehensive verification reports",
1986
+ "Run verification at logical intervals during development"
1987
+ ],
1988
+ examples: [
1989
+ "Run full verification pipeline before creating pull requests",
1990
+ "Execute verification after completing significant features",
1991
+ "Set up continuous verification during long development sessions",
1992
+ "Review security scans for exposed API keys or console.log statements",
1993
+ "Check test coverage meets minimum 80% threshold"
1994
+ ]
1995
+ };
1996
+ var verification_loop_default = verificationLoopSkill;
1997
+ // ../essential-opencode/src/skills/planning-with-files.ts
1998
+ var planningWithFilesSkill = {
1999
+ id: "planning-with-files",
2000
+ name: "Planning with Files",
2001
+ description: "Structured planning using persistent markdown files (task_plan.md, findings.md, progress.md) for complex multi-step tasks and research projects",
2002
+ category: "project-management",
2003
+ expertise: [
2004
+ "Task planning and breakdown",
2005
+ "Research organization",
2006
+ "Progress tracking",
2007
+ "Session recovery",
2008
+ "Multi-phase projects"
2009
+ ],
2010
+ patterns: [
2011
+ "Complex tasks requiring >5 tool calls",
2012
+ "Research projects with findings",
2013
+ "Multi-session work continuation",
2014
+ "Tasks needing structured planning"
2015
+ ],
2016
+ examples: [
2017
+ {
2018
+ trigger: "Complex refactoring project",
2019
+ action: "Create task_plan.md with phases, findings.md for analysis, progress.md for tracking"
2020
+ },
2021
+ {
2022
+ trigger: "Codebase investigation",
2023
+ action: "Document findings in findings.md, track progress in progress.md"
2024
+ },
2025
+ {
2026
+ trigger: "Session recovery after /clear",
2027
+ action: "Read task_plan.md and progress.md to resume work"
2028
+ }
2029
+ ]
2030
+ };
2031
+ var planning_with_files_default = planningWithFilesSkill;
2032
+ // ../essential-opencode/src/skills/continuous-learning.ts
2033
+ var continuousLearningSkill = {
2034
+ id: "continuous-learning",
2035
+ name: "Continuous Learning",
2036
+ description: "Automatically extract reusable patterns from development sessions and save them as learned skills for future use",
2037
+ category: "automation",
2038
+ expertise: [
2039
+ "pattern-extraction",
2040
+ "session-evaluation",
2041
+ "skill-learning",
2042
+ "hook-automation",
2043
+ "context-analysis",
2044
+ "pattern-detection",
2045
+ "session-management",
2046
+ "automated-learning"
2047
+ ],
2048
+ patterns: [
2049
+ "Extract error resolution patterns from sessions",
2050
+ "Identify user corrections and improvements",
2051
+ "Detect workarounds for framework quirks",
2052
+ "Capture debugging techniques that work",
2053
+ "Learn project-specific conventions",
2054
+ "Run session evaluation at logical boundaries",
2055
+ "Save useful patterns to learned skills directory",
2056
+ "Configure minimum session length for extraction"
2057
+ ],
2058
+ examples: [
2059
+ "Set up stop hooks to automatically evaluate sessions at completion",
2060
+ "Extract reusable error resolution patterns from debugging sessions",
2061
+ "Learn project-specific coding patterns and conventions",
2062
+ "Configure pattern extraction thresholds and ignore patterns",
2063
+ "Save learned debugging techniques for future reference"
2064
+ ]
2065
+ };
2066
+ var continuous_learning_default = continuousLearningSkill;
2067
+ // ../essential-opencode/src/skills/strategic-compact.ts
2068
+ var strategicCompactSkill = {
2069
+ id: "strategic-compact",
2070
+ name: "Strategic Compact",
2071
+ description: "Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction",
2072
+ category: "context-management",
2073
+ expertise: [
2074
+ "context-compaction",
2075
+ "memory-management",
2076
+ "session-optimization",
2077
+ "hook-automation",
2078
+ "threshold-detection",
2079
+ "strategic-planning",
2080
+ "context-preservation",
2081
+ "tool-call-tracking"
2082
+ ],
2083
+ patterns: [
2084
+ "Compact after exploration before execution",
2085
+ "Compact at logical task boundaries",
2086
+ "Use PreToolUse hooks for threshold detection",
2087
+ "Track tool calls to determine optimal compaction points",
2088
+ "Preserve important context while removing noise",
2089
+ "Suggest manual compaction at strategic intervals",
2090
+ "Configure thresholds based on session complexity",
2091
+ "Avoid mid-task context interruption"
2092
+ ],
2093
+ examples: [
2094
+ "Set up PreToolUse hooks to suggest compaction at 50 tool calls",
2095
+ "Compact after research phase before implementation",
2096
+ "Use strategic compaction before major task shifts",
2097
+ "Configure compaction thresholds based on project complexity",
2098
+ "Preserve critical context while clearing noise"
2099
+ ]
2100
+ };
2101
+ var strategic_compact_default = strategicCompactSkill;
2102
+ // ../essential-opencode/src/skills/eval-harness.ts
2103
+ var evalHarnessSkill = {
2104
+ id: "eval-harness",
2105
+ name: "Eval Harness",
2106
+ description: "Formal evaluation framework for development sessions, implementing eval-driven development (EDD) principles with capability and regression testing",
2107
+ category: "evaluation",
2108
+ expertise: [
2109
+ "eval-driven-development",
2110
+ "capability-evals",
2111
+ "regression-evals",
2112
+ "code-grading",
2113
+ "model-grading",
2114
+ "pass-k-metrics",
2115
+ "test-metrics",
2116
+ "eval-automation"
2117
+ ],
2118
+ patterns: [
2119
+ "Define evals BEFORE implementation",
2120
+ "Use capability evals to test new functionality",
2121
+ "Implement regression evals to prevent breakage",
2122
+ "Apply code-based graders for deterministic checks",
2123
+ "Use model-based graders for open-ended evaluation",
2124
+ "Track pass@k metrics for reliability measurement",
2125
+ "Run evals frequently during development",
2126
+ "Maintain eval baselines for regression detection"
2127
+ ],
2128
+ examples: [
2129
+ "Define capability evals for new authentication features",
2130
+ "Create regression evals to ensure existing functionality works",
2131
+ "Set up code-based graders for deterministic test results",
2132
+ "Implement pass@3 metrics to measure reliability targets",
2133
+ "Run continuous evals during feature development",
2134
+ "Generate comprehensive eval reports before deployment"
2135
+ ]
2136
+ };
2137
+ var eval_harness_default = evalHarnessSkill;
2138
+ // ../essential-opencode/src/skills/project-guidelines-example.ts
2139
+ var projectGuidelinesExampleSkill = {
2140
+ id: "project-guidelines-example",
2141
+ name: "Project Guidelines Example",
2142
+ description: "Example of project-specific skill containing architecture overview, file structure, code patterns, testing requirements, and deployment workflow",
2143
+ category: "project-management",
2144
+ expertise: [
2145
+ "architecture-design",
2146
+ "project-structure",
2147
+ "code-patterns",
2148
+ "testing-strategies",
2149
+ "deployment-workflows",
2150
+ "technology-stack",
2151
+ "development-guidelines",
2152
+ "team-collaboration"
2153
+ ],
2154
+ patterns: [
2155
+ "Define clear architecture and technology stack",
2156
+ "Establish consistent file structure conventions",
2157
+ "Create reusable code patterns and utilities",
2158
+ "Implement comprehensive testing strategies",
2159
+ "Set up deployment workflows and checklists",
2160
+ "Define critical coding rules and standards",
2161
+ "Document API response formats",
2162
+ "Create development environment guidelines"
2163
+ ],
2164
+ examples: [
2165
+ "Set up Next.js + FastAPI architecture with proper separation",
2166
+ "Create consistent API response patterns across frontend and backend",
2167
+ "Implement comprehensive testing with Jest, pytest, and Playwright",
2168
+ "Define deployment checklist for Google Cloud Run",
2169
+ "Establish project-specific coding rules and conventions",
2170
+ "Create integration patterns for Claude AI with structured output"
2171
+ ]
2172
+ };
2173
+ var project_guidelines_example_default = projectGuidelinesExampleSkill;
2174
+ // ../essential-opencode/src/skills/clickhouse-io.ts
2175
+ var clickhouseIoSkill = {
2176
+ id: "clickhouse-io",
2177
+ name: "ClickHouse Analytics Patterns",
2178
+ description: "ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads",
2179
+ category: "database",
2180
+ expertise: [
2181
+ "clickhouse-optimization",
2182
+ "analytical-queries",
2183
+ "data-engineering",
2184
+ "merge-trees",
2185
+ "materialized-views",
2186
+ "bulk-inserts",
2187
+ "performance-tuning",
2188
+ "real-time-analytics"
2189
+ ],
2190
+ patterns: [
2191
+ "Use MergeTree engines for time-series data",
2192
+ "Implement efficient partitioning strategies",
2193
+ "Optimize query performance with proper filtering",
2194
+ "Use materialized views for real-time aggregations",
2195
+ "Batch insert operations for performance",
2196
+ "Leverage ClickHouse-specific aggregation functions",
2197
+ "Implement ETL patterns for data pipelines",
2198
+ "Monitor query performance and system metrics"
2199
+ ],
2200
+ examples: [
2201
+ "Design optimal table schemas with MergeTree engines",
2202
+ "Create materialized views for real-time analytics",
2203
+ "Implement efficient bulk insert patterns",
2204
+ "Optimize analytical queries with proper indexing",
2205
+ "Set up ETL pipelines for continuous data ingestion",
2206
+ "Monitor ClickHouse performance and query efficiency"
2207
+ ]
2208
+ };
2209
+ var clickhouse_io_default = clickhouseIoSkill;
2210
+
2211
+ // ../essential-opencode/src/index.ts
2212
+ var ESSENTIAL_VERSION = "1.0.0";
2213
+ var ESSENTIAL_NAME = "@venthezone/essential-opencode";
2214
+ // ../typescript-opencode/src/agents/tdd-guide.ts
2215
+ var tddGuideAgent = {
2216
+ id: "tdd-guide",
2217
+ name: "TDD Guide",
2218
+ description: "Test-Driven Development specialist enforcing write-tests-first methodology. Use PROACTIVELY when writing new features, fixing bugs, or refactoring code. Ensures 80%+ test coverage.",
2219
+ capabilities: [
2220
+ "test-driven-development",
2221
+ "unit-testing",
2222
+ "integration-testing",
2223
+ "e2e-testing",
2224
+ "test-coverage",
2225
+ "red-green-refactor"
2226
+ ],
2227
+ tools: [
2228
+ "read",
2229
+ "write",
2230
+ "edit",
2231
+ "bash",
2232
+ "grep"
2233
+ ],
2234
+ context: [
2235
+ "testing-methodologies",
2236
+ "test-frameworks",
2237
+ "mocking-strategies",
2238
+ "coverage-reports"
2239
+ ],
2240
+ allowedSkills: ["testing", "tdd-methodology"]
2241
+ };
2242
+ var tdd_guide_default = tddGuideAgent;
2243
+ // ../typescript-opencode/src/agents/architect.ts
2244
+ var architectAgent = {
2245
+ id: "architect",
2246
+ name: "Software Architect",
2247
+ description: "Expert in software architecture, design patterns, system design, and technical decision making",
2248
+ capabilities: [
2249
+ "system-design",
2250
+ "architecture-planning",
2251
+ "design-patterns",
2252
+ "technical-decisions",
2253
+ "scalability-planning",
2254
+ "performance-optimization"
2255
+ ],
2256
+ tools: [
2257
+ "read",
2258
+ "glob",
2259
+ "grep",
2260
+ "write",
2261
+ "edit"
2262
+ ],
2263
+ context: [
2264
+ "architectural-principles",
2265
+ "design-patterns",
2266
+ "best-practices",
2267
+ "technology-stack"
2268
+ ],
2269
+ allowedSkills: ["architecture-patterns", "design-patterns", "system-design"]
2270
+ };
2271
+ var architect_default = architectAgent;
2272
+ // ../typescript-opencode/src/agents/e2e-runner.ts
2273
+ var e2eRunnerAgent = {
2274
+ id: "e2e-runner",
2275
+ name: "E2E Test Runner",
2276
+ description: "End-to-end testing specialist using Playwright. Use PROACTIVELY for generating, maintaining, and running E2E tests. Manages test journeys, quarantines flaky tests, uploads artifacts (screenshots, videos, traces), and ensures critical user flows work.",
2277
+ capabilities: [
2278
+ "test-journey-creation",
2279
+ "test-maintenance",
2280
+ "flaky-test-management",
2281
+ "artifact-management",
2282
+ "ci-cd-integration",
2283
+ "test-reporting"
2284
+ ],
2285
+ tools: [
2286
+ "read",
2287
+ "write",
2288
+ "edit",
2289
+ "bash",
2290
+ "grep",
2291
+ "glob"
2292
+ ],
2293
+ context: [
2294
+ "playwright-testing",
2295
+ "page-object-model",
2296
+ "test-automation",
2297
+ "flaky-test-quarantine"
2298
+ ]
2299
+ };
2300
+ var e2e_runner_default = e2eRunnerAgent;
2301
+ // ../typescript-opencode/src/skills/backend-patterns.ts
2302
+ var backendPatternsSkill = {
2303
+ id: "backend-patterns",
2304
+ name: "Backend Development Patterns",
2305
+ description: "Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes",
2306
+ category: "backend",
2307
+ expertise: [
2308
+ "api-design",
2309
+ "repository-pattern",
2310
+ "service-layer",
2311
+ "middleware-patterns",
2312
+ "database-optimization",
2313
+ "caching-strategies",
2314
+ "error-handling",
2315
+ "authentication-authorization"
2316
+ ],
2317
+ patterns: [
2318
+ "RESTful API design with proper HTTP methods",
2319
+ "Repository pattern for data access abstraction",
2320
+ "Service layer for business logic separation",
2321
+ "Middleware for request/response processing",
2322
+ "Query optimization and N+1 prevention",
2323
+ "Cache-aside pattern for performance",
2324
+ "Centralized error handling",
2325
+ "JWT-based authentication and RBAC"
2326
+ ],
2327
+ examples: [
2328
+ "Design RESTful APIs with proper resource endpoints",
2329
+ "Implement repository pattern for database operations",
2330
+ "Set up Redis caching layer for frequently accessed data",
2331
+ "Create middleware for authentication and authorization",
2332
+ "Implement rate limiting for API protection",
2333
+ "Use transactions for data consistency"
2334
+ ]
2335
+ };
2336
+ var backend_patterns_default = backendPatternsSkill;
2337
+ // ../typescript-opencode/src/skills/frontend-patterns.ts
2338
+ var frontendPatternsSkill = {
2339
+ id: "frontend-patterns",
2340
+ name: "Frontend Development Patterns",
2341
+ description: "Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices",
2342
+ category: "frontend",
2343
+ expertise: [
2344
+ "react-patterns",
2345
+ "nextjs-development",
2346
+ "state-management",
2347
+ "performance-optimization",
2348
+ "component-design",
2349
+ "custom-hooks",
2350
+ "accessibility",
2351
+ "animation-patterns"
2352
+ ],
2353
+ patterns: [
2354
+ "Component composition over inheritance",
2355
+ "Compound components for complex UI",
2356
+ "Render props pattern for flexible components",
2357
+ "Custom hooks for reusable logic",
2358
+ "Context + reducer pattern for state",
2359
+ "Memoization with useMemo and useCallback",
2360
+ "Code splitting and lazy loading",
2361
+ "Error boundaries for graceful failures"
2362
+ ],
2363
+ examples: [
2364
+ "Create compound components like Tabs with TabList and Tab",
2365
+ "Implement custom data fetching hook with loading states",
2366
+ "Set up virtualization for long lists performance",
2367
+ "Create accessible form components with proper keyboard navigation",
2368
+ "Implement animations with Framer Motion",
2369
+ "Use error boundaries to catch and handle component errors"
2370
+ ]
2371
+ };
2372
+ var frontend_patterns_default = frontendPatternsSkill;
2373
+
2374
+ // ../typescript-opencode/src/index.ts
2375
+ var typescriptAgents = [
2376
+ "tdd-guide",
2377
+ "architect",
2378
+ "e2e-runner"
2379
+ ];
2380
+ var typescriptSkills = [
2381
+ "backend-patterns",
2382
+ "frontend-patterns"
2383
+ ];
2384
+ var TYPESCRIPT_VERSION = "1.0.0";
2385
+ var TYPESCRIPT_NAME = "@venthezone/typescript-opencode";
2386
+
2387
+ // src/index.ts
2388
+ var allAgents = [
2389
+ "planner",
2390
+ "code-reviewer",
2391
+ "doc-updater",
2392
+ "build-error-resolver",
2393
+ "security-reviewer",
2394
+ "refactor-cleaner",
2395
+ "tdd-guide",
2396
+ "architect",
2397
+ "e2e-runner"
2398
+ ];
2399
+ var allSkills = [
2400
+ "coding-standards",
2401
+ "tdd-workflow",
2402
+ "security-review",
2403
+ "verification-loop",
2404
+ "planning-with-files",
2405
+ "continuous-learning",
2406
+ "strategic-compact",
2407
+ "eval-harness",
2408
+ "project-guidelines-example",
2409
+ "clickhouse-io",
2410
+ "backend-patterns",
2411
+ "frontend-patterns"
2412
+ ];
2413
+ var EVERYTHING_VERSION = "1.0.0";
2414
+ var EVERYTHING_NAME = "@venthezone/everything-opencode-plugin";
2415
+ var PACKAGES = {
2416
+ essential: "@venthezone/essential-opencode",
2417
+ typescript: "@venthezone/typescript-opencode",
2418
+ complete: "@venthezone/everything-opencode-plugin"
2419
+ };
2420
+ export {
2421
+ withDefaults,
2422
+ verification_loop_default as verificationLoopSkill,
2423
+ validateAllAgents,
2424
+ validateAgentSkillCompatibility,
2425
+ validateAgent,
2426
+ typescriptSkills,
2427
+ typescriptAgents,
2428
+ tdd_workflow_default as tddWorkflowSkill,
2429
+ tdd_guide_default as tddGuideAgent,
2430
+ strategic_compact_default as strategicCompactSkill,
2431
+ security_reviewer_default as securityReviewerAgent,
2432
+ security_review_default as securityReviewSkill,
2433
+ refactor_cleaner_default as refactorCleanerAgent,
2434
+ project_guidelines_example_default as projectGuidelinesSkill,
2435
+ planning_with_files_default as planningWithFilesSkill,
2436
+ planner_default as plannerAgent,
2437
+ onToolExecuteBefore,
2438
+ onToolExecuteAfter,
2439
+ onSessionStart,
2440
+ onSessionEnd,
2441
+ onAgentRequest,
2442
+ getValidationSummary,
2443
+ getAvailableSkills,
2444
+ frontend_patterns_default as frontendPatternsSkill,
2445
+ eval_harness_default as evalHarnessSkill,
2446
+ enrichContext,
2447
+ e2e_runner_default as e2eRunnerAgent,
2448
+ doc_updater_default as docUpdaterAgent,
2449
+ detectTypeScript,
2450
+ detectTestingFramework,
2451
+ detectPackageManager,
2452
+ continuous_learning_default as continuousLearningSkill,
2453
+ coding_standards_default as codingStandardsSkill,
2454
+ code_reviewer_default as codeReviewerAgent,
2455
+ clickhouse_io_default as clickhouseIOSkill,
2456
+ build_error_resolver_default as buildErrorResolverAgent,
2457
+ backend_patterns_default as backendPatternsSkill,
2458
+ architect_default as architectAgent,
2459
+ allSkills,
2460
+ allAgents,
2461
+ WorkflowEngine,
2462
+ ToolRegistry,
2463
+ TYPESCRIPT_VERSION,
2464
+ TYPESCRIPT_NAME,
2465
+ SkillRegistry,
2466
+ SessionManager,
2467
+ PACKAGES,
2468
+ Logger,
2469
+ HookManager,
2470
+ EVERYTHING_VERSION,
2471
+ EVERYTHING_NAME,
2472
+ ESSENTIAL_VERSION,
2473
+ ESSENTIAL_NAME,
2474
+ DEFAULT_CONFIG,
2475
+ AgentRegistry
2476
+ };