wyrm-mcp 7.2.0 → 7.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/LICENSE +26 -667
  2. package/NOTICE +14 -33
  3. package/dist/activation.d.ts.map +1 -1
  4. package/dist/activation.js +1 -44
  5. package/dist/activation.js.map +1 -1
  6. package/dist/agent-daemon.js +4 -281
  7. package/dist/agent-loop.js +7 -332
  8. package/dist/analytics.js +13 -236
  9. package/dist/attribution.js +1 -49
  10. package/dist/audit.js +2 -457
  11. package/dist/auto-capture.js +3 -138
  12. package/dist/auto-orchestrator.js +1 -325
  13. package/dist/autoconfig.js +39 -840
  14. package/dist/buddy-runner.js +1 -109
  15. package/dist/buddy.js +14 -564
  16. package/dist/build-flags.js +1 -17
  17. package/dist/capabilities.js +3 -183
  18. package/dist/capture.js +1 -56
  19. package/dist/causality.js +6 -107
  20. package/dist/cli.js +20 -281
  21. package/dist/cloud/cli.js +5 -541
  22. package/dist/cloud/client.js +1 -221
  23. package/dist/cloud/crypto.js +1 -85
  24. package/dist/cloud/machine-id.js +2 -113
  25. package/dist/cloud/recovery.js +1 -60
  26. package/dist/cloud/sync-engine.js +7 -543
  27. package/dist/cloud-backup.js +5 -579
  28. package/dist/cloud-profile.js +1 -138
  29. package/dist/cloud-sync-entrypoint.js +1 -47
  30. package/dist/cloud-sync.js +2 -309
  31. package/dist/constellation.js +12 -168
  32. package/dist/context-build-budgeted.js +4 -144
  33. package/dist/context-ranking.js +1 -69
  34. package/dist/crypto.js +1 -179
  35. package/dist/daemon-write-endpoint.js +1 -290
  36. package/dist/daemon-writer.js +2 -406
  37. package/dist/database.js +43 -1110
  38. package/dist/deprecations.js +2 -162
  39. package/dist/design.js +13 -141
  40. package/dist/event-replication.js +1 -112
  41. package/dist/events-sse.js +7 -43
  42. package/dist/events.js +6 -238
  43. package/dist/failure-patterns.js +42 -659
  44. package/dist/federation.js +12 -236
  45. package/dist/goals.js +13 -101
  46. package/dist/golden.js +3 -355
  47. package/dist/handlers/agent.js +4 -165
  48. package/dist/handlers/alias-adapters.js +1 -129
  49. package/dist/handlers/aliases.js +1 -171
  50. package/dist/handlers/audit.js +1 -87
  51. package/dist/handlers/boundary.js +1 -221
  52. package/dist/handlers/capture.js +73 -1109
  53. package/dist/handlers/causality.js +7 -114
  54. package/dist/handlers/cloud.js +85 -382
  55. package/dist/handlers/companion.js +28 -459
  56. package/dist/handlers/datalake.js +7 -187
  57. package/dist/handlers/dispatch-context.js +0 -22
  58. package/dist/handlers/entity.js +25 -256
  59. package/dist/handlers/events.js +16 -335
  60. package/dist/handlers/failure.js +13 -340
  61. package/dist/handlers/goals.js +4 -296
  62. package/dist/handlers/intelligence.js +126 -674
  63. package/dist/handlers/invoicing.js +1 -70
  64. package/dist/handlers/mcpclient.js +6 -137
  65. package/dist/handlers/orchestration.js +40 -125
  66. package/dist/handlers/output-schemas.js +1 -24
  67. package/dist/handlers/presence.js +3 -99
  68. package/dist/handlers/project.js +28 -182
  69. package/dist/handlers/prompts.js +6 -157
  70. package/dist/handlers/quest.js +4 -224
  71. package/dist/handlers/recall.js +11 -218
  72. package/dist/handlers/registry.js +1 -167
  73. package/dist/handlers/resources.js +1 -288
  74. package/dist/handlers/review.js +11 -74
  75. package/dist/handlers/run.js +17 -487
  76. package/dist/handlers/search.js +15 -326
  77. package/dist/handlers/session.js +28 -615
  78. package/dist/handlers/share.js +8 -184
  79. package/dist/handlers/shims.js +1 -464
  80. package/dist/handlers/skill.js +67 -449
  81. package/dist/handlers/survivors.js +1 -120
  82. package/dist/handlers/symbols.js +8 -109
  83. package/dist/handlers/syncops.js +4 -302
  84. package/dist/handlers/types.js +1 -27
  85. package/dist/harvest.js +5 -191
  86. package/dist/hours.js +7 -156
  87. package/dist/http-auth.js +3 -321
  88. package/dist/http-fast.js +21 -1137
  89. package/dist/icons.js +1 -47
  90. package/dist/index.js +2 -924
  91. package/dist/indexer.js +4 -145
  92. package/dist/intelligence.js +31 -261
  93. package/dist/internal-dispatch.js +3 -212
  94. package/dist/keyset.js +1 -110
  95. package/dist/knowledge-graph.js +12 -176
  96. package/dist/license.d.ts +11 -0
  97. package/dist/license.d.ts.map +1 -1
  98. package/dist/license.js +2 -414
  99. package/dist/license.js.map +1 -1
  100. package/dist/logger.js +2 -199
  101. package/dist/maintenance.js +2 -148
  102. package/dist/mcp-client.js +6 -262
  103. package/dist/memory-artifacts.js +30 -449
  104. package/dist/migrate-prompt.js +2 -124
  105. package/dist/migrations.js +40 -655
  106. package/dist/performance.js +1 -228
  107. package/dist/presence.js +11 -140
  108. package/dist/priority-embed.js +5 -164
  109. package/dist/providers/embedding-provider.js +1 -196
  110. package/dist/readonly-gate.js +1 -29
  111. package/dist/rehydration.js +9 -157
  112. package/dist/reindex.js +1 -88
  113. package/dist/render-target.js +21 -514
  114. package/dist/render.js +4 -280
  115. package/dist/repl-guard.js +1 -173
  116. package/dist/replication-daemon-entrypoint.js +1 -31
  117. package/dist/replication-daemon.js +2 -262
  118. package/dist/resilience.js +1 -591
  119. package/dist/reverse-bridge.js +5 -360
  120. package/dist/security.js +1 -244
  121. package/dist/session-seen.js +3 -51
  122. package/dist/setup.js +1 -260
  123. package/dist/skill-author.js +5 -168
  124. package/dist/spec-kit.js +1 -191
  125. package/dist/sqlite-busy.js +1 -154
  126. package/dist/statusline.js +11 -315
  127. package/dist/sub-agent.js +13 -262
  128. package/dist/summarizer.js +13 -139
  129. package/dist/symbols.js +7 -283
  130. package/dist/sync.js +5 -359
  131. package/dist/tasks-dispatch.js +1 -84
  132. package/dist/tasks.js +1 -282
  133. package/dist/token-budget.js +1 -143
  134. package/dist/tool-analytics.js +7 -129
  135. package/dist/tool-annotations.js +1 -365
  136. package/dist/tool-manifest-v2.json +1 -1
  137. package/dist/tool-manifest.json +1 -1
  138. package/dist/tool-profiles.js +1 -75
  139. package/dist/trace-harvest.js +6 -244
  140. package/dist/types.js +1 -30
  141. package/dist/ui-dashboard.js +41 -50
  142. package/dist/ulid.js +1 -81
  143. package/dist/validate.js +1 -129
  144. package/dist/vault.js +1 -534
  145. package/dist/vectors.js +3 -184
  146. package/dist/version-check.js +4 -136
  147. package/dist/visibility.js +19 -155
  148. package/dist/wyrm-cli.js +98 -2451
  149. package/dist/wyrm-cli.js.map +1 -1
  150. package/dist/wyrm-guard.js +14 -424
  151. package/dist/wyrm-loop.js +3 -150
  152. package/dist/wyrm-manifest.json +1 -1
  153. package/dist/wyrm-statusline-daemon.js +1 -11
  154. package/dist/wyrm-statusline.js +4 -56
  155. package/dist/wyrm-ui.js +9 -77
  156. package/package.json +4 -2
@@ -1,325 +1 @@
1
- /**
2
- * Wyrm Auto-Orchestrator - Automatically apply reasoning patterns
3
- *
4
- * This layer intercepts task requests and automatically applies
5
- * the best multi-agent reasoning pattern based on task classification.
6
- *
7
- * Patterns applied automatically:
8
- * - Haiku Boosting: All content generation via few-shot + self-critique
9
- * - Ensemble Voting: Decisions (architecture, design, strategy) via N approaches + vote
10
- * - Task Decomposition: Large features via subtasks + parallel execution
11
- * - Verification: High-risk code changes via multi-angle review
12
- *
13
- * @copyright 2026 Ghost Protocol (Pvt) Ltd.
14
- * @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
15
- */
16
- /**
17
- * Classify incoming task based on multiple signals
18
- */
19
- export function classifyTask(input, context) {
20
- const text = input.toLowerCase();
21
- let type = 'generation';
22
- let confidence = 50;
23
- let complexity = 'medium';
24
- // Decision detection
25
- const decisionKeywords = ['decide', 'choose', 'architecture', 'design pattern', 'approach', 'strategy', 'should we', 'which is better', 'trade-off', 'tradeoff'];
26
- if (decisionKeywords.some(kw => text.includes(kw))) {
27
- type = 'decision';
28
- confidence = 85;
29
- complexity = context?.complexity === 'high' ? 'high' : 'medium';
30
- }
31
- // Research detection
32
- const researchKeywords = ['investigate', 'analyze', 'explore', 'research', 'what are the', 'find all', 'compare', 'benchmark'];
33
- if (researchKeywords.some(kw => text.includes(kw))) {
34
- type = 'research';
35
- confidence = 80;
36
- complexity = 'high';
37
- }
38
- // Verification detection
39
- const verificationKeywords = ['review', 'check', 'validate', 'test', 'security', 'performance', 'audit', 'lint'];
40
- if (verificationKeywords.some(kw => text.includes(kw))) {
41
- type = 'verification';
42
- confidence = 75;
43
- complexity = 'medium';
44
- }
45
- // Decomposition detection (large feature builds)
46
- const decompositionKeywords = ['build', 'implement', 'feature', 'system', 'module', 'create', 'develop', 'setup'];
47
- const hasDetailedDescription = input.length > 500;
48
- if (decompositionKeywords.some(kw => text.includes(kw)) && hasDetailedDescription) {
49
- type = 'decomposition';
50
- confidence = 70;
51
- complexity = 'high';
52
- }
53
- // Generation (default, with boosting)
54
- if (type === 'generation') {
55
- confidence = 60; // Lower confidence for default catch-all
56
- complexity = 'low';
57
- }
58
- // Adjust complexity based on input length
59
- if (input.length > 1000)
60
- complexity = 'high';
61
- if (input.length < 200)
62
- complexity = 'low';
63
- const parallelBlocks = getParallelBlockCount(type, complexity);
64
- return {
65
- type,
66
- confidence,
67
- description: input.substring(0, 100) + (input.length > 100 ? '...' : ''),
68
- complexity,
69
- recommendedApproach: getRecommendedApproach(type),
70
- parallelBlocks,
71
- };
72
- }
73
- /**
74
- * Determine how many parallel agents to spawn
75
- */
76
- function getParallelBlockCount(type, complexity) {
77
- const config = {
78
- decision: { low: 2, medium: 3, high: 4 },
79
- generation: { low: 1, medium: 2, high: 3 },
80
- research: { low: 2, medium: 4, high: 6 },
81
- verification: { low: 2, medium: 3, high: 4 },
82
- decomposition: { low: 2, medium: 4, high: 6 },
83
- };
84
- return config[type][complexity] || 3;
85
- }
86
- /**
87
- * Get recommended orchestration approach
88
- */
89
- function getRecommendedApproach(type) {
90
- const approaches = {
91
- decision: 'ensemble-voting (4 approaches + vote)',
92
- generation: 'haiku-boosting (few-shot + self-critique)',
93
- research: 'parallel-research (N angles + synthesis)',
94
- verification: 'verification-pipeline (security + perf + style reviews)',
95
- decomposition: 'task-decomposition (subtasks + parallel + synthesis)',
96
- };
97
- return approaches[type];
98
- }
99
- /**
100
- * Default orchestration config
101
- */
102
- export function getDefaultConfig() {
103
- return {
104
- autoOrchestrateEnabled: true,
105
- minConfidenceThreshold: 65, // Only apply if 65%+ confident
106
- maxParallelAgents: 6,
107
- defaultHaikuBoosting: true, // Boost all Haiku content generation
108
- trackMetrics: true,
109
- thinkingBudget: 10000, // Max thinking tokens per orchestrated task
110
- };
111
- }
112
- /**
113
- * Apply appropriate orchestration pattern
114
- */
115
- export async function orchestrateTask(task, config = getDefaultConfig()) {
116
- const classified = classifyTask(task);
117
- // Check if confidence meets threshold
118
- if (classified.confidence < config.minConfidenceThreshold) {
119
- return {
120
- taskType: classified.type,
121
- approach: 'standard (below confidence threshold)',
122
- results: null,
123
- quality: 0,
124
- costSavings: 0,
125
- parallelExecutionTime: 0,
126
- confidence: classified.confidence,
127
- appliedPatterns: [],
128
- metrics: { tokensBoosting: 0, tokensEnsemble: 0, tokensVerification: 0, totalTokens: 0 },
129
- };
130
- }
131
- // Apply pattern based on task type
132
- let patterns = [];
133
- let startTime = Date.now();
134
- switch (classified.type) {
135
- case 'decision':
136
- patterns = ['ensemble-voting', 'haiku-boosting'];
137
- // Would spawn 4 approaches via parallel agents, vote, boost confidence
138
- break;
139
- case 'generation':
140
- patterns = ['haiku-boosting', 'self-critique'];
141
- // Add few-shot examples + self-critique loop
142
- break;
143
- case 'research':
144
- patterns = ['parallel-research', 'synthesis'];
145
- // Spawn parallel agents for different angles, synthesize findings
146
- break;
147
- case 'verification':
148
- patterns = ['parallel-review', 'multi-angle'];
149
- // Parallel: security review, performance check, style check → synthesize
150
- break;
151
- case 'decomposition':
152
- patterns = ['task-decomposition', 'parallel-synthesis'];
153
- // Break into subtasks, parallel execution, merge results
154
- break;
155
- }
156
- const executionTime = Date.now() - startTime;
157
- // Estimate quality and cost savings
158
- const qualityBoost = getQualityBoost(patterns);
159
- const costSavings = getCostSavings(patterns, classified.parallelBlocks);
160
- return {
161
- taskType: classified.type,
162
- approach: classified.recommendedApproach,
163
- results: null, // Would be filled by actual implementation
164
- quality: 60 + qualityBoost,
165
- costSavings,
166
- parallelExecutionTime: executionTime,
167
- confidence: classified.confidence,
168
- appliedPatterns: patterns,
169
- metrics: {
170
- tokensBoosting: patterns.includes('haiku-boosting') ? 800 : 0,
171
- tokensEnsemble: patterns.includes('ensemble-voting') ? 1200 : 0,
172
- tokensVerification: patterns.includes('multi-angle') ? 600 : 0,
173
- totalTokens: 0, // Would be calculated
174
- },
175
- };
176
- }
177
- /**
178
- * Quality boost from applied patterns (est. %)
179
- */
180
- function getQualityBoost(patterns) {
181
- let boost = 0;
182
- if (patterns.includes('haiku-boosting'))
183
- boost += 45;
184
- if (patterns.includes('ensemble-voting'))
185
- boost += 35;
186
- if (patterns.includes('self-critique'))
187
- boost += 25;
188
- if (patterns.includes('multi-angle'))
189
- boost += 20;
190
- return Math.min(boost, 80); // Cap at 80% boost
191
- }
192
- /**
193
- * Cost savings vs Opus (est. %)
194
- */
195
- function getCostSavings(patterns, parallelBlocks = 1) {
196
- // Base: Haiku is 10x cheaper than Opus
197
- // With patterns: Multiple Haiku calls (boosting + ensemble) still beat single Opus
198
- // Typical: 4 Haiku ($0.48) vs 1 Opus ($1.00) = 52% savings
199
- if (patterns.includes('ensemble-voting')) {
200
- return parallelBlocks > 1 ? 45 : 30; // Multiple approaches still cheaper
201
- }
202
- if (patterns.includes('haiku-boosting')) {
203
- return 35; // Boosting adds overhead but still cheaper than Opus
204
- }
205
- return 25; // Other patterns, general Haiku usage
206
- }
207
- /**
208
- * Orchestration middleware for agent context
209
- *
210
- * Usage in agent:
211
- * ```typescript
212
- * const config = getDefaultConfig();
213
- * const task = "Design a microservice architecture for a real-time collaboration tool";
214
- * const plan = await orchestrateTask(task, config);
215
- *
216
- * if (plan.appliedPatterns.length > 0) {
217
- * // Auto-orchestration active
218
- * // Implementation would:
219
- * // 1. Spawn parallel agents (if ensemble/decomposition)
220
- * // 2. Apply boosting (if generation)
221
- * // 3. Run reviews (if verification)
222
- * // 4. Synthesize results
223
- * // 5. Store metrics in Wyrm
224
- * }
225
- * ```
226
- */
227
- export class AutoOrchestrator {
228
- config;
229
- taskHistory = [];
230
- constructor(config) {
231
- this.config = {
232
- ...getDefaultConfig(),
233
- ...config,
234
- };
235
- }
236
- /**
237
- * Process incoming task with auto-orchestration
238
- */
239
- async processTask(task) {
240
- const classified = classifyTask(task);
241
- this.taskHistory.push(classified);
242
- // Trim history to last 100 tasks
243
- if (this.taskHistory.length > 100) {
244
- this.taskHistory = this.taskHistory.slice(-100);
245
- }
246
- return orchestrateTask(task, this.config);
247
- }
248
- /**
249
- * Get task classification insight
250
- */
251
- getTaskDistribution() {
252
- const dist = {
253
- decision: 0,
254
- generation: 0,
255
- research: 0,
256
- verification: 0,
257
- decomposition: 0,
258
- };
259
- for (const task of this.taskHistory) {
260
- dist[task.type]++;
261
- }
262
- return dist;
263
- }
264
- /**
265
- * Get orchestration effectiveness stats
266
- */
267
- getStats() {
268
- const distribution = this.getTaskDistribution();
269
- const total = this.taskHistory.length;
270
- const avgQuality = this.taskHistory.reduce((sum, t) => {
271
- const patterns = this.getPatternSetForType(t.type);
272
- return sum + getQualityBoost(patterns);
273
- }, 0) / (total || 1);
274
- const avgCost = this.taskHistory.reduce((sum, t) => {
275
- return sum + getCostSavings(this.getPatternSetForType(t.type), t.complexity === 'high' ? 4 : 2);
276
- }, 0) / (total || 1);
277
- const complexities = this.taskHistory.map(t => t.complexity);
278
- const avgComplexity = complexities.filter(c => c === 'high').length > total / 2
279
- ? 'high'
280
- : complexities.filter(c => c === 'low').length > total / 2
281
- ? 'low'
282
- : 'medium';
283
- return {
284
- tasksProcessed: total,
285
- distribution,
286
- estimatedQualityBoost: Math.round(avgQuality),
287
- estimatedCostSavings: Math.round(avgCost),
288
- averageComplexity: avgComplexity,
289
- };
290
- }
291
- /**
292
- * Get pattern set for task type
293
- */
294
- getPatternSetForType(type) {
295
- const patterns = {
296
- decision: ['ensemble-voting', 'haiku-boosting'],
297
- generation: ['haiku-boosting', 'self-critique'],
298
- research: ['parallel-research', 'synthesis'],
299
- verification: ['parallel-review', 'multi-angle'],
300
- decomposition: ['task-decomposition', 'parallel-synthesis'],
301
- };
302
- return patterns[type];
303
- }
304
- /**
305
- * Update config at runtime
306
- */
307
- updateConfig(updates) {
308
- this.config = { ...this.config, ...updates };
309
- }
310
- }
311
- /**
312
- * Singleton instance for global orchestration
313
- */
314
- let globalOrchestrator = null;
315
- export function getGlobalOrchestrator() {
316
- if (!globalOrchestrator) {
317
- globalOrchestrator = new AutoOrchestrator(getDefaultConfig());
318
- }
319
- return globalOrchestrator;
320
- }
321
- export function initializeOrchestrator(config) {
322
- globalOrchestrator = new AutoOrchestrator(config);
323
- return globalOrchestrator;
324
- }
325
- //# sourceMappingURL=auto-orchestrator.js.map
1
+ function g(i,e){const t=i.toLowerCase();let s="generation",r=50,o="medium";["decide","choose","architecture","design pattern","approach","strategy","should we","which is better","trade-off","tradeoff"].some(a=>t.includes(a))&&(s="decision",r=85,o=e?.complexity==="high"?"high":"medium"),["investigate","analyze","explore","research","what are the","find all","compare","benchmark"].some(a=>t.includes(a))&&(s="research",r=80,o="high"),["review","check","validate","test","security","performance","audit","lint"].some(a=>t.includes(a))&&(s="verification",r=75,o="medium");const u=["build","implement","feature","system","module","create","develop","setup"],y=i.length>500;u.some(a=>t.includes(a))&&y&&(s="decomposition",r=70,o="high"),s==="generation"&&(r=60,o="low"),i.length>1e3&&(o="high"),i.length<200&&(o="low");const k=b(s,o);return{type:s,confidence:r,description:i.substring(0,100)+(i.length>100?"...":""),complexity:o,recommendedApproach:v(s),parallelBlocks:k}}function b(i,e){return{decision:{low:2,medium:3,high:4},generation:{low:1,medium:2,high:3},research:{low:2,medium:4,high:6},verification:{low:2,medium:3,high:4},decomposition:{low:2,medium:4,high:6}}[i][e]||3}function v(i){return{decision:"ensemble-voting (4 approaches + vote)",generation:"haiku-boosting (few-shot + self-critique)",research:"parallel-research (N angles + synthesis)",verification:"verification-pipeline (security + perf + style reviews)",decomposition:"task-decomposition (subtasks + parallel + synthesis)"}[i]}function d(){return{autoOrchestrateEnabled:!0,minConfidenceThreshold:65,maxParallelAgents:6,defaultHaikuBoosting:!0,trackMetrics:!0,thinkingBudget:1e4}}async function w(i,e=d()){const t=g(i);if(t.confidence<e.minConfidenceThreshold)return{taskType:t.type,approach:"standard (below confidence threshold)",results:null,quality:0,costSavings:0,parallelExecutionTime:0,confidence:t.confidence,appliedPatterns:[],metrics:{tokensBoosting:0,tokensEnsemble:0,tokensVerification:0,totalTokens:0}};let s=[],r=Date.now();switch(t.type){case"decision":s=["ensemble-voting","haiku-boosting"];break;case"generation":s=["haiku-boosting","self-critique"];break;case"research":s=["parallel-research","synthesis"];break;case"verification":s=["parallel-review","multi-angle"];break;case"decomposition":s=["task-decomposition","parallel-synthesis"];break}const o=Date.now()-r,h=p(s),n=m(s,t.parallelBlocks);return{taskType:t.type,approach:t.recommendedApproach,results:null,quality:60+h,costSavings:n,parallelExecutionTime:o,confidence:t.confidence,appliedPatterns:s,metrics:{tokensBoosting:s.includes("haiku-boosting")?800:0,tokensEnsemble:s.includes("ensemble-voting")?1200:0,tokensVerification:s.includes("multi-angle")?600:0,totalTokens:0}}}function p(i){let e=0;return i.includes("haiku-boosting")&&(e+=45),i.includes("ensemble-voting")&&(e+=35),i.includes("self-critique")&&(e+=25),i.includes("multi-angle")&&(e+=20),Math.min(e,80)}function m(i,e=1){return i.includes("ensemble-voting")?e>1?45:30:i.includes("haiku-boosting")?35:25}class f{config;taskHistory=[];constructor(e){this.config={...d(),...e}}async processTask(e){const t=g(e);return this.taskHistory.push(t),this.taskHistory.length>100&&(this.taskHistory=this.taskHistory.slice(-100)),w(e,this.config)}getTaskDistribution(){const e={decision:0,generation:0,research:0,verification:0,decomposition:0};for(const t of this.taskHistory)e[t.type]++;return e}getStats(){const e=this.getTaskDistribution(),t=this.taskHistory.length,s=this.taskHistory.reduce((n,c)=>{const u=this.getPatternSetForType(c.type);return n+p(u)},0)/(t||1),r=this.taskHistory.reduce((n,c)=>n+m(this.getPatternSetForType(c.type),c.complexity==="high"?4:2),0)/(t||1),o=this.taskHistory.map(n=>n.complexity),h=o.filter(n=>n==="high").length>t/2?"high":o.filter(n=>n==="low").length>t/2?"low":"medium";return{tasksProcessed:t,distribution:e,estimatedQualityBoost:Math.round(s),estimatedCostSavings:Math.round(r),averageComplexity:h}}getPatternSetForType(e){return{decision:["ensemble-voting","haiku-boosting"],generation:["haiku-boosting","self-critique"],research:["parallel-research","synthesis"],verification:["parallel-review","multi-angle"],decomposition:["task-decomposition","parallel-synthesis"]}[e]}updateConfig(e){this.config={...this.config,...e}}}let l=null;function x(){return l||(l=new f(d())),l}function T(i){return l=new f(i),l}export{f as AutoOrchestrator,g as classifyTask,d as getDefaultConfig,x as getGlobalOrchestrator,T as initializeOrchestrator,w as orchestrateTask};