@gotza02/seq-thinking 1.1.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/README.md +149 -0
- package/SYSTEM_INSTRUCTIONS.md +50 -0
- package/agents_test.log +15 -0
- package/dist/__tests__/agents.test.d.ts +2 -0
- package/dist/__tests__/agents.test.d.ts.map +1 -0
- package/dist/__tests__/agents.test.js +673 -0
- package/dist/__tests__/agents.test.js.map +1 -0
- package/dist/__tests__/mcp-server.test.d.ts +2 -0
- package/dist/__tests__/mcp-server.test.d.ts.map +1 -0
- package/dist/__tests__/mcp-server.test.js +315 -0
- package/dist/__tests__/mcp-server.test.js.map +1 -0
- package/dist/__tests__/sequential-thinking.test.d.ts +2 -0
- package/dist/__tests__/sequential-thinking.test.d.ts.map +1 -0
- package/dist/__tests__/sequential-thinking.test.js +545 -0
- package/dist/__tests__/sequential-thinking.test.js.map +1 -0
- package/dist/__tests__/swarm-coordinator.test.d.ts +2 -0
- package/dist/__tests__/swarm-coordinator.test.d.ts.map +1 -0
- package/dist/__tests__/swarm-coordinator.test.js +606 -0
- package/dist/__tests__/swarm-coordinator.test.js.map +1 -0
- package/dist/__tests__/types.test.d.ts +2 -0
- package/dist/__tests__/types.test.d.ts.map +1 -0
- package/dist/__tests__/types.test.js +741 -0
- package/dist/__tests__/types.test.js.map +1 -0
- package/dist/__tests__/utils.test.d.ts +2 -0
- package/dist/__tests__/utils.test.d.ts.map +1 -0
- package/dist/__tests__/utils.test.js +264 -0
- package/dist/__tests__/utils.test.js.map +1 -0
- package/dist/agents/base-agent.d.ts +126 -0
- package/dist/agents/base-agent.d.ts.map +1 -0
- package/dist/agents/base-agent.js +214 -0
- package/dist/agents/base-agent.js.map +1 -0
- package/dist/agents/critic-agent.d.ts +134 -0
- package/dist/agents/critic-agent.d.ts.map +1 -0
- package/dist/agents/critic-agent.js +484 -0
- package/dist/agents/critic-agent.js.map +1 -0
- package/dist/agents/index.d.ts +11 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +11 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/meta-reasoning-agent.d.ts +143 -0
- package/dist/agents/meta-reasoning-agent.d.ts.map +1 -0
- package/dist/agents/meta-reasoning-agent.js +532 -0
- package/dist/agents/meta-reasoning-agent.js.map +1 -0
- package/dist/agents/reasoner-agent.d.ts +75 -0
- package/dist/agents/reasoner-agent.d.ts.map +1 -0
- package/dist/agents/reasoner-agent.js +226 -0
- package/dist/agents/reasoner-agent.js.map +1 -0
- package/dist/agents/synthesizer-agent.d.ts +174 -0
- package/dist/agents/synthesizer-agent.d.ts.map +1 -0
- package/dist/agents/synthesizer-agent.js +583 -0
- package/dist/agents/synthesizer-agent.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server.d.ts +823 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +377 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/sequential-thinking.d.ts +91 -0
- package/dist/sequential-thinking.d.ts.map +1 -0
- package/dist/sequential-thinking.js +540 -0
- package/dist/sequential-thinking.js.map +1 -0
- package/dist/swarm-coordinator.d.ts +188 -0
- package/dist/swarm-coordinator.d.ts.map +1 -0
- package/dist/swarm-coordinator.js +627 -0
- package/dist/swarm-coordinator.js.map +1 -0
- package/dist/types/index.d.ts +806 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +279 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +421 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +864 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/llm-adapter.d.ts +23 -0
- package/dist/utils/llm-adapter.d.ts.map +1 -0
- package/dist/utils/llm-adapter.js +68 -0
- package/dist/utils/llm-adapter.js.map +1 -0
- package/dist/utils/persistence.d.ts +33 -0
- package/dist/utils/persistence.d.ts.map +1 -0
- package/dist/utils/persistence.js +108 -0
- package/dist/utils/persistence.js.map +1 -0
- package/package.json +41 -0
- package/src/__tests__/agents.test.ts +858 -0
- package/src/__tests__/mcp-server.test.ts +380 -0
- package/src/__tests__/sequential-thinking.test.ts +687 -0
- package/src/__tests__/swarm-coordinator.test.ts +903 -0
- package/src/__tests__/types.test.ts +839 -0
- package/src/__tests__/utils.test.ts +322 -0
- package/src/agents/base-agent.ts +285 -0
- package/src/agents/critic-agent.ts +582 -0
- package/src/agents/index.ts +11 -0
- package/src/agents/meta-reasoning-agent.ts +672 -0
- package/src/agents/reasoner-agent.ts +312 -0
- package/src/agents/synthesizer-agent.ts +758 -0
- package/src/index.ts +118 -0
- package/src/mcp-server.ts +387 -0
- package/src/sequential-thinking.ts +560 -0
- package/src/swarm-coordinator.ts +744 -0
- package/src/types/index.ts +915 -0
- package/src/utils/index.ts +1004 -0
- package/src/utils/llm-adapter.ts +76 -0
- package/src/utils/persistence.ts +108 -0
- package/test_output.log +0 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synthesizer Agent Implementation
|
|
3
|
+
* @module agents/synthesizer-agent
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
import { BaseAgent } from './base-agent.js';
|
|
7
|
+
import { AgentType, SynthesizerType } from '../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Synthesizer agent that combines multiple agent outputs
|
|
10
|
+
*/
|
|
11
|
+
export class SynthesizerAgent extends BaseAgent {
|
|
12
|
+
/** Synthesizer type */
|
|
13
|
+
synthesizerType;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new synthesizer agent
|
|
16
|
+
* @param config - Agent configuration
|
|
17
|
+
*/
|
|
18
|
+
constructor(config) {
|
|
19
|
+
const defaultCapabilities = [
|
|
20
|
+
{
|
|
21
|
+
name: 'consensus_building',
|
|
22
|
+
description: 'Build consensus from multiple outputs',
|
|
23
|
+
confidence: 0.85,
|
|
24
|
+
performanceMetrics: { tasksCompleted: 0, averageQuality: 0, averageTimeMs: 0 }
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'conflict_resolution',
|
|
28
|
+
description: 'Resolve conflicts between outputs',
|
|
29
|
+
confidence: 0.8,
|
|
30
|
+
performanceMetrics: { tasksCompleted: 0, averageQuality: 0, averageTimeMs: 0 }
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'creative_synthesis',
|
|
34
|
+
description: 'Create creative combinations',
|
|
35
|
+
confidence: 0.75,
|
|
36
|
+
performanceMetrics: { tasksCompleted: 0, averageQuality: 0, averageTimeMs: 0 }
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'integration',
|
|
40
|
+
description: 'Integrate multiple perspectives',
|
|
41
|
+
confidence: 0.85,
|
|
42
|
+
performanceMetrics: { tasksCompleted: 0, averageQuality: 0, averageTimeMs: 0 }
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
super({
|
|
46
|
+
name: config.name,
|
|
47
|
+
type: AgentType.SYNTHESIZER,
|
|
48
|
+
subtype: config.synthesizerType || SynthesizerType.CONSENSUS,
|
|
49
|
+
capabilities: config.capabilities || defaultCapabilities,
|
|
50
|
+
maxConcurrentTasks: 3,
|
|
51
|
+
confidenceThreshold: 0.7
|
|
52
|
+
});
|
|
53
|
+
this.synthesizerType = config.synthesizerType || SynthesizerType.CONSENSUS;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get agent type
|
|
57
|
+
* @returns Agent type
|
|
58
|
+
*/
|
|
59
|
+
getType() {
|
|
60
|
+
return AgentType.SYNTHESIZER;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get agent capabilities
|
|
64
|
+
* @returns Array of capabilities
|
|
65
|
+
*/
|
|
66
|
+
getCapabilities() {
|
|
67
|
+
return this.config.capabilities;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Process a task - synthesize inputs
|
|
71
|
+
* @param task - Task to process
|
|
72
|
+
* @returns Task result
|
|
73
|
+
*/
|
|
74
|
+
async process(task) {
|
|
75
|
+
const startTime = Date.now();
|
|
76
|
+
const input = task.input;
|
|
77
|
+
let result;
|
|
78
|
+
switch (this.synthesizerType) {
|
|
79
|
+
case SynthesizerType.CONSENSUS:
|
|
80
|
+
result = await this.buildConsensus(input);
|
|
81
|
+
break;
|
|
82
|
+
case SynthesizerType.CREATIVE:
|
|
83
|
+
result = await this.creativeSynthesis(input);
|
|
84
|
+
break;
|
|
85
|
+
case SynthesizerType.CONFLICT_RESOLUTION:
|
|
86
|
+
result = await this.resolveConflicts(input);
|
|
87
|
+
break;
|
|
88
|
+
default:
|
|
89
|
+
result = await this.buildConsensus(input);
|
|
90
|
+
}
|
|
91
|
+
return this.createTaskResult(task.id, result, result.confidence, Date.now() - startTime, {
|
|
92
|
+
reasoningSteps: input.outputs.length,
|
|
93
|
+
intermediateResults: input.outputs.map(o => o.output)
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Build consensus from multiple outputs
|
|
98
|
+
* @param input - Synthesis input
|
|
99
|
+
* @returns Synthesis result
|
|
100
|
+
*/
|
|
101
|
+
async buildConsensus(input) {
|
|
102
|
+
const { outputs } = input;
|
|
103
|
+
if (outputs.length === 0) {
|
|
104
|
+
return {
|
|
105
|
+
synthesizedOutput: null,
|
|
106
|
+
confidence: 0,
|
|
107
|
+
contributingAgents: [],
|
|
108
|
+
synthesisMethod: 'consensus'
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (outputs.length === 1) {
|
|
112
|
+
return {
|
|
113
|
+
synthesizedOutput: outputs[0].output,
|
|
114
|
+
confidence: outputs[0].confidence,
|
|
115
|
+
contributingAgents: [outputs[0].agentId],
|
|
116
|
+
synthesisMethod: 'consensus'
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// Extract key points from each output
|
|
120
|
+
const keyPoints = outputs.map(o => this.extractKeyPoints(o.output));
|
|
121
|
+
// Find consensus points (common across multiple outputs)
|
|
122
|
+
const consensusPoints = this.findConsensusPoints(keyPoints);
|
|
123
|
+
// Find points of divergence
|
|
124
|
+
const divergencePoints = this.findDivergencePoints(keyPoints);
|
|
125
|
+
// Weight by confidence
|
|
126
|
+
const weightedConsensus = this.applyConfidenceWeights(consensusPoints, outputs);
|
|
127
|
+
// Calculate consensus level
|
|
128
|
+
const consensusLevel = consensusPoints.length / Math.max(...keyPoints.map(kp => kp.length));
|
|
129
|
+
// Generate unified output
|
|
130
|
+
const unified = this.generateUnifiedOutput(weightedConsensus, divergencePoints);
|
|
131
|
+
// Calculate overall confidence
|
|
132
|
+
const avgConfidence = outputs.reduce((sum, o) => sum + o.confidence, 0) / outputs.length;
|
|
133
|
+
const consensusBoost = consensusLevel * 0.1;
|
|
134
|
+
return {
|
|
135
|
+
synthesizedOutput: unified,
|
|
136
|
+
confidence: Math.min(1, avgConfidence + consensusBoost),
|
|
137
|
+
contributingAgents: outputs.map(o => o.agentId),
|
|
138
|
+
synthesisMethod: 'consensus',
|
|
139
|
+
consensusLevel,
|
|
140
|
+
dissentPoints: divergencePoints
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Creative synthesis
|
|
145
|
+
* @param input - Synthesis input
|
|
146
|
+
* @returns Synthesis result
|
|
147
|
+
*/
|
|
148
|
+
async creativeSynthesis(input) {
|
|
149
|
+
const { outputs } = input;
|
|
150
|
+
if (outputs.length === 0) {
|
|
151
|
+
return {
|
|
152
|
+
synthesizedOutput: null,
|
|
153
|
+
confidence: 0,
|
|
154
|
+
contributingAgents: [],
|
|
155
|
+
synthesisMethod: 'creative_combination'
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
// Extract creative elements
|
|
159
|
+
const creativeElements = outputs.map(o => this.extractCreativeElements(o.output));
|
|
160
|
+
// Find unexpected connections
|
|
161
|
+
const connections = this.findUnexpectedConnections(creativeElements);
|
|
162
|
+
// Generate novel combinations
|
|
163
|
+
const combinations = this.generateNovelCombinations(creativeElements, connections);
|
|
164
|
+
// Create creative output
|
|
165
|
+
const creativeOutput = {
|
|
166
|
+
combinations,
|
|
167
|
+
connections,
|
|
168
|
+
originalElements: creativeElements,
|
|
169
|
+
novelInsights: this.generateNovelInsights(combinations)
|
|
170
|
+
};
|
|
171
|
+
// Calculate confidence based on diversity and novelty
|
|
172
|
+
const diversityScore = this.calculateDiversity(creativeElements);
|
|
173
|
+
const noveltyScore = connections.length > 0 ? 0.8 : 0.5;
|
|
174
|
+
const confidence = (diversityScore + noveltyScore) / 2;
|
|
175
|
+
return {
|
|
176
|
+
synthesizedOutput: creativeOutput,
|
|
177
|
+
confidence,
|
|
178
|
+
contributingAgents: outputs.map(o => o.agentId),
|
|
179
|
+
synthesisMethod: 'creative_combination'
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Resolve conflicts between outputs
|
|
184
|
+
* @param input - Synthesis input
|
|
185
|
+
* @returns Synthesis result
|
|
186
|
+
*/
|
|
187
|
+
async resolveConflicts(input) {
|
|
188
|
+
const { outputs } = input;
|
|
189
|
+
if (outputs.length === 0) {
|
|
190
|
+
return {
|
|
191
|
+
synthesizedOutput: null,
|
|
192
|
+
confidence: 0,
|
|
193
|
+
contributingAgents: [],
|
|
194
|
+
synthesisMethod: 'conflict_resolution'
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
if (outputs.length === 1) {
|
|
198
|
+
return {
|
|
199
|
+
synthesizedOutput: outputs[0].output,
|
|
200
|
+
confidence: outputs[0].confidence,
|
|
201
|
+
contributingAgents: [outputs[0].agentId],
|
|
202
|
+
synthesisMethod: 'conflict_resolution'
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
// Identify conflicts
|
|
206
|
+
const conflicts = this.identifyConflicts(outputs);
|
|
207
|
+
if (conflicts.length === 0) {
|
|
208
|
+
// No conflicts, use consensus
|
|
209
|
+
return this.buildConsensus(input);
|
|
210
|
+
}
|
|
211
|
+
// Resolve each conflict
|
|
212
|
+
const resolutions = conflicts.map(conflict => ({
|
|
213
|
+
conflict,
|
|
214
|
+
resolution: this.resolveConflict(conflict, outputs)
|
|
215
|
+
}));
|
|
216
|
+
// Merge resolved conflicts with non-conflicting content
|
|
217
|
+
const finalOutput = this.mergeResolutions(outputs, resolutions);
|
|
218
|
+
// Calculate confidence
|
|
219
|
+
const avgConfidence = outputs.reduce((sum, o) => sum + o.confidence, 0) / outputs.length;
|
|
220
|
+
const resolutionQuality = resolutions.length > 0
|
|
221
|
+
? resolutions.reduce((sum, r) => sum + r.resolution.confidence, 0) / resolutions.length
|
|
222
|
+
: 1;
|
|
223
|
+
return {
|
|
224
|
+
synthesizedOutput: finalOutput,
|
|
225
|
+
confidence: (avgConfidence + resolutionQuality) / 2,
|
|
226
|
+
contributingAgents: outputs.map(o => o.agentId),
|
|
227
|
+
synthesisMethod: 'conflict_resolution',
|
|
228
|
+
dissentPoints: conflicts.map(c => c.description)
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
// ============================================================================
|
|
232
|
+
// Helper Methods
|
|
233
|
+
// ============================================================================
|
|
234
|
+
/**
|
|
235
|
+
* Extract key points from output
|
|
236
|
+
* @param output - Output to extract from
|
|
237
|
+
* @returns Array of key points
|
|
238
|
+
*/
|
|
239
|
+
extractKeyPoints(output) {
|
|
240
|
+
if (typeof output === 'string') {
|
|
241
|
+
return output.split(/[.!?]+/).filter(s => s.trim().length > 10);
|
|
242
|
+
}
|
|
243
|
+
if (output && typeof output === 'object') {
|
|
244
|
+
const obj = output;
|
|
245
|
+
if ('conclusion' in obj && typeof obj.conclusion === 'string') {
|
|
246
|
+
return [obj.conclusion];
|
|
247
|
+
}
|
|
248
|
+
if ('keyPoints' in obj && Array.isArray(obj.keyPoints)) {
|
|
249
|
+
return obj.keyPoints;
|
|
250
|
+
}
|
|
251
|
+
return [JSON.stringify(output)];
|
|
252
|
+
}
|
|
253
|
+
return [String(output)];
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Find consensus points
|
|
257
|
+
* @param keyPointsArray - Array of key points arrays
|
|
258
|
+
* @returns Consensus points
|
|
259
|
+
*/
|
|
260
|
+
findConsensusPoints(keyPointsArray) {
|
|
261
|
+
if (keyPointsArray.length === 0)
|
|
262
|
+
return [];
|
|
263
|
+
if (keyPointsArray.length === 1)
|
|
264
|
+
return keyPointsArray[0];
|
|
265
|
+
const consensus = [];
|
|
266
|
+
const firstSet = keyPointsArray[0];
|
|
267
|
+
for (const point of firstSet) {
|
|
268
|
+
const normalizedPoint = this.normalizePoint(point);
|
|
269
|
+
let matchCount = 1;
|
|
270
|
+
for (let i = 1; i < keyPointsArray.length; i++) {
|
|
271
|
+
const otherSet = keyPointsArray[i];
|
|
272
|
+
const hasMatch = otherSet.some(otherPoint => this.pointsAreSimilar(normalizedPoint, this.normalizePoint(otherPoint)));
|
|
273
|
+
if (hasMatch)
|
|
274
|
+
matchCount++;
|
|
275
|
+
}
|
|
276
|
+
// Point is in consensus if it appears in majority
|
|
277
|
+
if (matchCount > keyPointsArray.length / 2) {
|
|
278
|
+
consensus.push(point);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return consensus;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Find divergence points
|
|
285
|
+
* @param keyPointsArray - Array of key points arrays
|
|
286
|
+
* @returns Divergence points
|
|
287
|
+
*/
|
|
288
|
+
findDivergencePoints(keyPointsArray) {
|
|
289
|
+
if (keyPointsArray.length <= 1)
|
|
290
|
+
return [];
|
|
291
|
+
const allPoints = keyPointsArray.flat();
|
|
292
|
+
const uniquePoints = [...new Set(allPoints.map(p => this.normalizePoint(p)))];
|
|
293
|
+
const divergence = [];
|
|
294
|
+
for (const point of uniquePoints) {
|
|
295
|
+
let matchCount = 0;
|
|
296
|
+
for (const pointSet of keyPointsArray) {
|
|
297
|
+
const hasMatch = pointSet.some(p => this.pointsAreSimilar(point, this.normalizePoint(p)));
|
|
298
|
+
if (hasMatch)
|
|
299
|
+
matchCount++;
|
|
300
|
+
}
|
|
301
|
+
// Point diverges if not in majority
|
|
302
|
+
if (matchCount <= keyPointsArray.length / 2) {
|
|
303
|
+
const original = allPoints.find(p => this.normalizePoint(p) === point);
|
|
304
|
+
if (original)
|
|
305
|
+
divergence.push(original);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return divergence;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Normalize a point for comparison
|
|
312
|
+
* @param point - Point to normalize
|
|
313
|
+
* @returns Normalized point
|
|
314
|
+
*/
|
|
315
|
+
normalizePoint(point) {
|
|
316
|
+
return point.toLowerCase().trim().replace(/\s+/g, ' ');
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Check if two points are similar
|
|
320
|
+
* @param a - First point
|
|
321
|
+
* @param b - Second point
|
|
322
|
+
* @returns True if similar
|
|
323
|
+
*/
|
|
324
|
+
pointsAreSimilar(a, b) {
|
|
325
|
+
// Simple similarity check
|
|
326
|
+
if (a === b)
|
|
327
|
+
return true;
|
|
328
|
+
const wordsA = new Set(a.split(' '));
|
|
329
|
+
const wordsB = new Set(b.split(' '));
|
|
330
|
+
const intersection = [...wordsA].filter(w => wordsB.has(w));
|
|
331
|
+
const union = new Set([...wordsA, ...wordsB]);
|
|
332
|
+
return union.size > 0 && intersection.length / union.size > 0.6;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Apply confidence weights to points
|
|
336
|
+
* @param points - Points to weight
|
|
337
|
+
* @param outputs - Outputs with confidence
|
|
338
|
+
* @returns Weighted points
|
|
339
|
+
*/
|
|
340
|
+
applyConfidenceWeights(points, outputs) {
|
|
341
|
+
const avgConfidence = outputs.reduce((sum, o) => sum + o.confidence, 0) / outputs.length;
|
|
342
|
+
return points.map(point => ({
|
|
343
|
+
point,
|
|
344
|
+
weight: avgConfidence
|
|
345
|
+
}));
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Generate unified output
|
|
349
|
+
* @param weightedPoints - Weighted points
|
|
350
|
+
* @param divergencePoints - Divergence points
|
|
351
|
+
* @returns Unified output
|
|
352
|
+
*/
|
|
353
|
+
generateUnifiedOutput(weightedPoints, divergencePoints) {
|
|
354
|
+
return {
|
|
355
|
+
consensus: weightedPoints.map(wp => wp.point),
|
|
356
|
+
consensusWeights: weightedPoints.map(wp => wp.weight),
|
|
357
|
+
pointsOfDivergence: divergencePoints,
|
|
358
|
+
summary: `Consensus reached on ${weightedPoints.length} points with ${divergencePoints.length} points of divergence`
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Extract creative elements
|
|
363
|
+
* @param output - Output to extract from
|
|
364
|
+
* @returns Creative elements
|
|
365
|
+
*/
|
|
366
|
+
extractCreativeElements(output) {
|
|
367
|
+
if (typeof output === 'string') {
|
|
368
|
+
// Extract novel phrases, metaphors, etc.
|
|
369
|
+
return output.split(/[.!?]+/).filter(s => s.trim().length > 5);
|
|
370
|
+
}
|
|
371
|
+
if (output && typeof output === 'object') {
|
|
372
|
+
const obj = output;
|
|
373
|
+
if ('creativeElements' in obj && Array.isArray(obj.creativeElements)) {
|
|
374
|
+
return obj.creativeElements;
|
|
375
|
+
}
|
|
376
|
+
if ('ideas' in obj && Array.isArray(obj.ideas)) {
|
|
377
|
+
return obj.ideas;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return [String(output)];
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Find unexpected connections
|
|
384
|
+
* @param elementsArray - Array of element arrays
|
|
385
|
+
* @returns Connections
|
|
386
|
+
*/
|
|
387
|
+
findUnexpectedConnections(elementsArray) {
|
|
388
|
+
const connections = [];
|
|
389
|
+
// Compare elements from different sources
|
|
390
|
+
for (let i = 0; i < elementsArray.length; i++) {
|
|
391
|
+
for (let j = i + 1; j < elementsArray.length; j++) {
|
|
392
|
+
const setA = elementsArray[i];
|
|
393
|
+
const setB = elementsArray[j];
|
|
394
|
+
for (const elemA of setA) {
|
|
395
|
+
for (const elemB of setB) {
|
|
396
|
+
const connection = this.findConnection(elemA, elemB);
|
|
397
|
+
if (connection) {
|
|
398
|
+
connections.push({
|
|
399
|
+
elements: [elemA, elemB],
|
|
400
|
+
connection
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return connections;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Find connection between two elements
|
|
411
|
+
* @param a - First element
|
|
412
|
+
* @param b - Second element
|
|
413
|
+
* @returns Connection description or null
|
|
414
|
+
*/
|
|
415
|
+
findConnection(a, b) {
|
|
416
|
+
const wordsA = new Set(a.toLowerCase().split(/\s+/));
|
|
417
|
+
const wordsB = new Set(b.toLowerCase().split(/\s+/));
|
|
418
|
+
const common = [...wordsA].filter(w => wordsB.has(w) && w.length > 3);
|
|
419
|
+
if (common.length > 0) {
|
|
420
|
+
return `Connected through: ${common.join(', ')}`;
|
|
421
|
+
}
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Generate novel combinations
|
|
426
|
+
* @param elementsArray - Array of element arrays
|
|
427
|
+
* @param connections - Connections
|
|
428
|
+
* @returns Combinations
|
|
429
|
+
*/
|
|
430
|
+
generateNovelCombinations(elementsArray, connections) {
|
|
431
|
+
const combinations = [];
|
|
432
|
+
for (const connection of connections) {
|
|
433
|
+
const [elemA, elemB] = connection.elements;
|
|
434
|
+
combinations.push(`Combining "${elemA.substring(0, 30)}..." with "${elemB.substring(0, 30)}..."`);
|
|
435
|
+
}
|
|
436
|
+
// Cross-pollinate ideas
|
|
437
|
+
for (let i = 0; i < elementsArray.length && i < 3; i++) {
|
|
438
|
+
for (let j = i + 1; j < elementsArray.length && j < 3; j++) {
|
|
439
|
+
const elemA = elementsArray[i][0];
|
|
440
|
+
const elemB = elementsArray[j][0];
|
|
441
|
+
if (elemA && elemB) {
|
|
442
|
+
combinations.push(`Cross: ${elemA.substring(0, 20)}... + ${elemB.substring(0, 20)}...`);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return combinations;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Generate novel insights
|
|
450
|
+
* @param combinations - Combinations
|
|
451
|
+
* @returns Insights
|
|
452
|
+
*/
|
|
453
|
+
generateNovelInsights(combinations) {
|
|
454
|
+
return combinations.map((combo, i) => `Insight ${i + 1}: ${combo} suggests a new approach`);
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Calculate diversity score
|
|
458
|
+
* @param elementsArray - Array of element arrays
|
|
459
|
+
* @returns Diversity score (0-1)
|
|
460
|
+
*/
|
|
461
|
+
calculateDiversity(elementsArray) {
|
|
462
|
+
const allElements = elementsArray.flat();
|
|
463
|
+
const uniqueElements = new Set(allElements);
|
|
464
|
+
if (allElements.length === 0)
|
|
465
|
+
return 0;
|
|
466
|
+
return uniqueElements.size / allElements.length;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Identify conflicts
|
|
470
|
+
* @param outputs - Outputs to analyze
|
|
471
|
+
* @returns Conflicts
|
|
472
|
+
*/
|
|
473
|
+
identifyConflicts(outputs) {
|
|
474
|
+
const conflicts = [];
|
|
475
|
+
// Check for contradictory conclusions
|
|
476
|
+
const conclusions = [];
|
|
477
|
+
for (const output of outputs) {
|
|
478
|
+
const conclusion = this.extractConclusion(output.output);
|
|
479
|
+
if (conclusion) {
|
|
480
|
+
conclusions.push({ agentId: output.agentId, conclusion });
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
// Find contradictions
|
|
484
|
+
for (let i = 0; i < conclusions.length; i++) {
|
|
485
|
+
for (let j = i + 1; j < conclusions.length; j++) {
|
|
486
|
+
const a = conclusions[i];
|
|
487
|
+
const b = conclusions[j];
|
|
488
|
+
if (this.areContradictory(a.conclusion, b.conclusion)) {
|
|
489
|
+
conflicts.push({
|
|
490
|
+
type: 'contradiction',
|
|
491
|
+
description: `Contradictory conclusions: "${a.conclusion.substring(0, 30)}..." vs "${b.conclusion.substring(0, 30)}..."`,
|
|
492
|
+
involvedAgents: [a.agentId, b.agentId]
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return conflicts;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Extract conclusion from output
|
|
501
|
+
* @param output - Output to extract from
|
|
502
|
+
* @returns Conclusion string or null
|
|
503
|
+
*/
|
|
504
|
+
extractConclusion(output) {
|
|
505
|
+
if (typeof output === 'string')
|
|
506
|
+
return output;
|
|
507
|
+
if (output && typeof output === 'object') {
|
|
508
|
+
const obj = output;
|
|
509
|
+
if ('conclusion' in obj && typeof obj.conclusion === 'string') {
|
|
510
|
+
return obj.conclusion;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Check if two conclusions are contradictory
|
|
517
|
+
* @param a - First conclusion
|
|
518
|
+
* @param b - Second conclusion
|
|
519
|
+
* @returns True if contradictory
|
|
520
|
+
*/
|
|
521
|
+
areContradictory(a, b) {
|
|
522
|
+
const lowerA = a.toLowerCase();
|
|
523
|
+
const lowerB = b.toLowerCase();
|
|
524
|
+
// Check for direct opposites
|
|
525
|
+
const oppositePatterns = [
|
|
526
|
+
{ pos: /\b(is|are|was|were)\b/gi, neg: /\b(is not|are not|was not|were not)\b/gi },
|
|
527
|
+
{ pos: /\bshould\b/gi, neg: /\bshould not\b/gi },
|
|
528
|
+
{ pos: /\bcan\b/gi, neg: /\bcannot\b/gi }
|
|
529
|
+
];
|
|
530
|
+
for (const { pos, neg } of oppositePatterns) {
|
|
531
|
+
const aHasPos = pos.test(lowerA);
|
|
532
|
+
const aHasNeg = neg.test(lowerA);
|
|
533
|
+
const bHasPos = pos.test(lowerB);
|
|
534
|
+
const bHasNeg = neg.test(lowerB);
|
|
535
|
+
if ((aHasPos && bHasNeg) || (aHasNeg && bHasPos)) {
|
|
536
|
+
return true;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return false;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Resolve a conflict
|
|
543
|
+
* @param conflict - Conflict to resolve
|
|
544
|
+
* @param outputs - All outputs
|
|
545
|
+
* @returns Resolution
|
|
546
|
+
*/
|
|
547
|
+
resolveConflict(conflict, outputs) {
|
|
548
|
+
// Get conflicting outputs
|
|
549
|
+
const conflictingOutputs = outputs.filter(o => conflict.involvedAgents.includes(o.agentId));
|
|
550
|
+
// Select based on confidence
|
|
551
|
+
const best = conflictingOutputs.reduce((max, o) => o.confidence > max.confidence ? o : max, conflictingOutputs[0]);
|
|
552
|
+
if (!best) {
|
|
553
|
+
return { resolution: null, confidence: 0 };
|
|
554
|
+
}
|
|
555
|
+
return {
|
|
556
|
+
resolution: best.output,
|
|
557
|
+
confidence: best.confidence
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Merge resolutions with non-conflicting content
|
|
562
|
+
* @param outputs - All outputs
|
|
563
|
+
* @param resolutions - Resolutions
|
|
564
|
+
* @returns Merged output
|
|
565
|
+
*/
|
|
566
|
+
mergeResolutions(outputs, resolutions) {
|
|
567
|
+
const merged = {
|
|
568
|
+
resolvedConflicts: resolutions.length,
|
|
569
|
+
agentOutputs: {}
|
|
570
|
+
};
|
|
571
|
+
// Add all outputs
|
|
572
|
+
for (const output of outputs) {
|
|
573
|
+
merged.agentOutputs[output.agentId] = output.output;
|
|
574
|
+
}
|
|
575
|
+
// Add resolutions
|
|
576
|
+
merged.resolutions = resolutions.map(r => ({
|
|
577
|
+
conflict: r.conflict,
|
|
578
|
+
selectedResolution: r.resolution.resolution
|
|
579
|
+
}));
|
|
580
|
+
return merged;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
//# sourceMappingURL=synthesizer-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthesizer-agent.js","sourceRoot":"","sources":["../../src/agents/synthesizer-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,eAAe,EAIhB,MAAM,mBAAmB,CAAC;AA0B3B;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAC7C,uBAAuB;IACf,eAAe,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAIX;QACC,MAAM,mBAAmB,GAAsB;YAC7C;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,uCAAuC;gBACpD,UAAU,EAAE,IAAI;gBAChB,kBAAkB,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE;aAC/E;YACD;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,mCAAmC;gBAChD,UAAU,EAAE,GAAG;gBACf,kBAAkB,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE;aAC/E;YACD;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,8BAA8B;gBAC3C,UAAU,EAAE,IAAI;gBAChB,kBAAkB,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE;aAC/E;YACD;gBACE,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,iCAAiC;gBAC9C,UAAU,EAAE,IAAI;gBAChB,kBAAkB,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAA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AAC;QAEJ,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Sequential Thinking with Swarm Agents
|
|
3
|
+
* Main entry point for the library
|
|
4
|
+
* @module mcp-sequential-thinking
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
export { MCPServer } from './mcp-server.js';
|
|
8
|
+
export { SessionManager, ThoughtGraph, MetaReasoningEngine, SelfCorrectionEngine, AdaptiveGranularityEngine, ConfidenceCalibrator } from './sequential-thinking.js';
|
|
9
|
+
export { SwarmCoordinator, AgentRegistry, MessageBroker, TaskQueueManager, TaskAssigner, ConsensusEngine, ConflictResolver } from './swarm-coordinator.js';
|
|
10
|
+
export { BaseAgent, ReasonerAgent, CriticAgent, SynthesizerAgent, MetaReasoningAgent } from './agents/index.js';
|
|
11
|
+
export * from './types/index.js';
|
|
12
|
+
export { generateId, generateUUID, generateShortId, clamp, clampConfidence, lerp, roundTo, extractWords, calculateJaccardSimilarity, calculateSimilarity, calculateCosineSimilarity, extractNGrams, calculateNGramSimilarity, calculateMean, calculateWeightedAverage, calculateMedian, calculateStandardDeviation, calculateVariance, findMin, findMax, normalizeValues, calculatePercentile, formatDuration, formatTimestamp, formatRelativeTime, deepClone, deepCloneWithDates, deepMerge, deepEqual, pick, omit, validateUUID, isNonEmptyString, isPositiveNumber, isInRange, isNonEmptyArray, isPlainObject, sanitizeString, truncateString, toCamelCase, toPascalCase, toSnakeCase, toKebabCase, escapeRegExp, unique, uniqueBy, groupBy, partition, shuffle, sample, chunk, flatten, deepFlatten, sleep, createTimeoutPromise, withTimeout, retry, debounce, throttle, tryCatch, tryCatchAsync, createError } from './utils/index.js';
|
|
13
|
+
/**
|
|
14
|
+
* Library version
|
|
15
|
+
*/
|
|
16
|
+
export declare const VERSION = "1.0.0";
|
|
17
|
+
/**
|
|
18
|
+
* Default export - MCPServer
|
|
19
|
+
*/
|
|
20
|
+
export { MCPServer as default } from './mcp-server.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EACf,KAAK,EACL,eAAe,EACf,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,0BAA0B,EAC1B,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,KAAK,EACL,oBAAoB,EACpB,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B;;GAEG;AACH,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Sequential Thinking with Swarm Agents
|
|
3
|
+
* Main entry point for the library
|
|
4
|
+
* @module mcp-sequential-thinking
|
|
5
|
+
* @version 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
// Export MCP Server
|
|
8
|
+
export { MCPServer } from './mcp-server.js';
|
|
9
|
+
// Export Sequential Thinking components
|
|
10
|
+
export { SessionManager, ThoughtGraph, MetaReasoningEngine, SelfCorrectionEngine, AdaptiveGranularityEngine, ConfidenceCalibrator } from './sequential-thinking.js';
|
|
11
|
+
// Export Swarm Coordinator components
|
|
12
|
+
export { SwarmCoordinator, AgentRegistry, MessageBroker, TaskQueueManager, TaskAssigner, ConsensusEngine, ConflictResolver } from './swarm-coordinator.js';
|
|
13
|
+
// Export Agents
|
|
14
|
+
export { BaseAgent, ReasonerAgent, CriticAgent, SynthesizerAgent, MetaReasoningAgent } from './agents/index.js';
|
|
15
|
+
// Export all types
|
|
16
|
+
export * from './types/index.js';
|
|
17
|
+
// Export utilities (avoiding Result conflict)
|
|
18
|
+
export { generateId, generateUUID, generateShortId, clamp, clampConfidence, lerp, roundTo, extractWords, calculateJaccardSimilarity, calculateSimilarity, calculateCosineSimilarity, extractNGrams, calculateNGramSimilarity, calculateMean, calculateWeightedAverage, calculateMedian, calculateStandardDeviation, calculateVariance, findMin, findMax, normalizeValues, calculatePercentile, formatDuration, formatTimestamp, formatRelativeTime, deepClone, deepCloneWithDates, deepMerge, deepEqual, pick, omit, validateUUID, isNonEmptyString, isPositiveNumber, isInRange, isNonEmptyArray, isPlainObject, sanitizeString, truncateString, toCamelCase, toPascalCase, toSnakeCase, toKebabCase, escapeRegExp, unique, uniqueBy, groupBy, partition, shuffle, sample, chunk, flatten, deepFlatten, sleep, createTimeoutPromise, withTimeout, retry, debounce, throttle, tryCatch, tryCatchAsync, createError } from './utils/index.js';
|
|
19
|
+
/**
|
|
20
|
+
* Library version
|
|
21
|
+
*/
|
|
22
|
+
export const VERSION = '1.0.0';
|
|
23
|
+
/**
|
|
24
|
+
* Default export - MCPServer
|
|
25
|
+
*/
|
|
26
|
+
export { MCPServer as default } from './mcp-server.js';
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,oBAAoB;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wCAAwC;AACxC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAElC,sCAAsC;AACtC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,gBAAgB;AAChB,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B,mBAAmB;AACnB,cAAc,kBAAkB,CAAC;AAEjC,8CAA8C;AAC9C,OAAO,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EACf,KAAK,EACL,eAAe,EACf,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,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