@sparkleideas/shared 3.0.0-alpha.7
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 +323 -0
- package/__tests__/hooks/bash-safety.test.ts +289 -0
- package/__tests__/hooks/file-organization.test.ts +335 -0
- package/__tests__/hooks/git-commit.test.ts +336 -0
- package/__tests__/hooks/index.ts +23 -0
- package/__tests__/hooks/session-hooks.test.ts +357 -0
- package/__tests__/hooks/task-hooks.test.ts +193 -0
- package/docs/EVENTS_IMPLEMENTATION_SUMMARY.md +388 -0
- package/docs/EVENTS_QUICK_REFERENCE.md +470 -0
- package/docs/EVENTS_README.md +352 -0
- package/package.json +39 -0
- package/src/core/config/defaults.ts +207 -0
- package/src/core/config/index.ts +15 -0
- package/src/core/config/loader.ts +271 -0
- package/src/core/config/schema.ts +188 -0
- package/src/core/config/validator.ts +209 -0
- package/src/core/event-bus.ts +236 -0
- package/src/core/index.ts +22 -0
- package/src/core/interfaces/agent.interface.ts +251 -0
- package/src/core/interfaces/coordinator.interface.ts +363 -0
- package/src/core/interfaces/event.interface.ts +267 -0
- package/src/core/interfaces/index.ts +19 -0
- package/src/core/interfaces/memory.interface.ts +332 -0
- package/src/core/interfaces/task.interface.ts +223 -0
- package/src/core/orchestrator/event-coordinator.ts +122 -0
- package/src/core/orchestrator/health-monitor.ts +214 -0
- package/src/core/orchestrator/index.ts +89 -0
- package/src/core/orchestrator/lifecycle-manager.ts +263 -0
- package/src/core/orchestrator/session-manager.ts +279 -0
- package/src/core/orchestrator/task-manager.ts +317 -0
- package/src/events/domain-events.ts +584 -0
- package/src/events/event-store.test.ts +387 -0
- package/src/events/event-store.ts +588 -0
- package/src/events/example-usage.ts +293 -0
- package/src/events/index.ts +90 -0
- package/src/events/projections.ts +561 -0
- package/src/events/state-reconstructor.ts +349 -0
- package/src/events.ts +367 -0
- package/src/hooks/INTEGRATION.md +658 -0
- package/src/hooks/README.md +532 -0
- package/src/hooks/example-usage.ts +499 -0
- package/src/hooks/executor.ts +379 -0
- package/src/hooks/hooks.test.ts +421 -0
- package/src/hooks/index.ts +131 -0
- package/src/hooks/registry.ts +333 -0
- package/src/hooks/safety/bash-safety.ts +604 -0
- package/src/hooks/safety/file-organization.ts +473 -0
- package/src/hooks/safety/git-commit.ts +623 -0
- package/src/hooks/safety/index.ts +46 -0
- package/src/hooks/session-hooks.ts +559 -0
- package/src/hooks/task-hooks.ts +513 -0
- package/src/hooks/types.ts +357 -0
- package/src/hooks/verify-exports.test.ts +125 -0
- package/src/index.ts +195 -0
- package/src/mcp/connection-pool.ts +438 -0
- package/src/mcp/index.ts +183 -0
- package/src/mcp/server.ts +774 -0
- package/src/mcp/session-manager.ts +428 -0
- package/src/mcp/tool-registry.ts +566 -0
- package/src/mcp/transport/http.ts +557 -0
- package/src/mcp/transport/index.ts +294 -0
- package/src/mcp/transport/stdio.ts +324 -0
- package/src/mcp/transport/websocket.ts +484 -0
- package/src/mcp/types.ts +565 -0
- package/src/plugin-interface.ts +663 -0
- package/src/plugin-loader.ts +638 -0
- package/src/plugin-registry.ts +604 -0
- package/src/plugins/index.ts +34 -0
- package/src/plugins/official/hive-mind-plugin.ts +330 -0
- package/src/plugins/official/index.ts +24 -0
- package/src/plugins/official/maestro-plugin.ts +508 -0
- package/src/plugins/types.ts +108 -0
- package/src/resilience/bulkhead.ts +277 -0
- package/src/resilience/circuit-breaker.ts +326 -0
- package/src/resilience/index.ts +26 -0
- package/src/resilience/rate-limiter.ts +420 -0
- package/src/resilience/retry.ts +224 -0
- package/src/security/index.ts +39 -0
- package/src/security/input-validation.ts +265 -0
- package/src/security/secure-random.ts +159 -0
- package/src/services/index.ts +16 -0
- package/src/services/v3-progress.service.ts +505 -0
- package/src/types/agent.types.ts +144 -0
- package/src/types/index.ts +22 -0
- package/src/types/mcp.types.ts +300 -0
- package/src/types/memory.types.ts +263 -0
- package/src/types/swarm.types.ts +255 -0
- package/src/types/task.types.ts +205 -0
- package/src/types.ts +367 -0
- package/src/utils/secure-logger.d.ts +69 -0
- package/src/utils/secure-logger.d.ts.map +1 -0
- package/src/utils/secure-logger.js +208 -0
- package/src/utils/secure-logger.js.map +1 -0
- package/src/utils/secure-logger.ts +257 -0
- package/tmp.json +0 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Store Usage Example
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates how to use the Event Sourcing system in V3 Claude Flow.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx tsx v3/@sparkleideas/shared/src/events/example-usage.ts
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { EventStore } from './event-store.js';
|
|
11
|
+
import { AgentStateProjection, TaskHistoryProjection, MemoryIndexProjection } from './projections.js';
|
|
12
|
+
import {
|
|
13
|
+
createAgentSpawnedEvent,
|
|
14
|
+
createAgentStartedEvent,
|
|
15
|
+
createAgentStoppedEvent,
|
|
16
|
+
createAgentTaskAssignedEvent,
|
|
17
|
+
createAgentTaskCompletedEvent,
|
|
18
|
+
createTaskCreatedEvent,
|
|
19
|
+
createTaskStartedEvent,
|
|
20
|
+
createTaskCompletedEvent,
|
|
21
|
+
createTaskFailedEvent,
|
|
22
|
+
createMemoryStoredEvent,
|
|
23
|
+
createMemoryRetrievedEvent,
|
|
24
|
+
createSwarmInitializedEvent,
|
|
25
|
+
createSwarmScaledEvent,
|
|
26
|
+
} from './domain-events.js';
|
|
27
|
+
|
|
28
|
+
async function main() {
|
|
29
|
+
console.log('Event Sourcing Example - V3 Claude Flow\n');
|
|
30
|
+
|
|
31
|
+
// =========================================================================
|
|
32
|
+
// 1. Initialize Event Store
|
|
33
|
+
// =========================================================================
|
|
34
|
+
console.log('1. Initializing Event Store...');
|
|
35
|
+
|
|
36
|
+
const eventStore = new EventStore({
|
|
37
|
+
databasePath: './event-store-example.db',
|
|
38
|
+
verbose: true,
|
|
39
|
+
autoPersistInterval: 0, // Manual persist for demo
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
await eventStore.initialize();
|
|
43
|
+
console.log(' Event Store initialized\n');
|
|
44
|
+
|
|
45
|
+
// =========================================================================
|
|
46
|
+
// 2. Record Swarm Initialization Events
|
|
47
|
+
// =========================================================================
|
|
48
|
+
console.log('2. Recording Swarm Events...');
|
|
49
|
+
|
|
50
|
+
await eventStore.append(
|
|
51
|
+
createSwarmInitializedEvent('hierarchical-mesh', 15, {
|
|
52
|
+
security: { strict: true },
|
|
53
|
+
memory: { backend: '@sparkleideas/agentdb' },
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
await eventStore.append(createSwarmScaledEvent(0, 5, 'Initial agent spawn'));
|
|
58
|
+
|
|
59
|
+
console.log(' Swarm events recorded\n');
|
|
60
|
+
|
|
61
|
+
// =========================================================================
|
|
62
|
+
// 3. Record Agent Lifecycle Events
|
|
63
|
+
// =========================================================================
|
|
64
|
+
console.log('3. Recording Agent Lifecycle Events...');
|
|
65
|
+
|
|
66
|
+
// Agent 1: Queen Coordinator
|
|
67
|
+
await eventStore.append(
|
|
68
|
+
createAgentSpawnedEvent('agent-1', 'queen-coordinator', 'coordination', [
|
|
69
|
+
'orchestration',
|
|
70
|
+
'task-assignment',
|
|
71
|
+
])
|
|
72
|
+
);
|
|
73
|
+
await eventStore.append(createAgentStartedEvent('agent-1'));
|
|
74
|
+
|
|
75
|
+
// Agent 2: Security Architect
|
|
76
|
+
await eventStore.append(
|
|
77
|
+
createAgentSpawnedEvent('agent-2', 'security-architect', 'security', [
|
|
78
|
+
'threat-modeling',
|
|
79
|
+
'security-design',
|
|
80
|
+
])
|
|
81
|
+
);
|
|
82
|
+
await eventStore.append(createAgentStartedEvent('agent-2'));
|
|
83
|
+
|
|
84
|
+
// Agent 3: Core Architect
|
|
85
|
+
await eventStore.append(
|
|
86
|
+
createAgentSpawnedEvent('agent-3', 'core-architect', 'core', ['ddd-design', 'architecture'])
|
|
87
|
+
);
|
|
88
|
+
await eventStore.append(createAgentStartedEvent('agent-3'));
|
|
89
|
+
|
|
90
|
+
console.log(' Agent events recorded\n');
|
|
91
|
+
|
|
92
|
+
// =========================================================================
|
|
93
|
+
// 4. Record Task Execution Events
|
|
94
|
+
// =========================================================================
|
|
95
|
+
console.log('4. Recording Task Execution Events...');
|
|
96
|
+
|
|
97
|
+
// Task 1: Security Audit
|
|
98
|
+
await eventStore.append(
|
|
99
|
+
createTaskCreatedEvent(
|
|
100
|
+
'task-1',
|
|
101
|
+
'security-audit',
|
|
102
|
+
'Audit CVE-1 (Command Injection)',
|
|
103
|
+
'Review and fix command injection vulnerability',
|
|
104
|
+
'critical',
|
|
105
|
+
[]
|
|
106
|
+
)
|
|
107
|
+
);
|
|
108
|
+
await eventStore.append(createTaskStartedEvent('task-1', 'agent-2'));
|
|
109
|
+
await eventStore.append(
|
|
110
|
+
createAgentTaskAssignedEvent('agent-2', 'task-1', Date.now())
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// Example: Async work gap between task start and completion
|
|
114
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
115
|
+
|
|
116
|
+
await eventStore.append(
|
|
117
|
+
createTaskCompletedEvent('task-1', { vulnerabilitiesFixed: 3, severity: 'high' }, 5234)
|
|
118
|
+
);
|
|
119
|
+
await eventStore.append(
|
|
120
|
+
createAgentTaskCompletedEvent('agent-2', 'task-1', { success: true }, Date.now(), 5234)
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
// Task 2: DDD Architecture Design
|
|
124
|
+
await eventStore.append(
|
|
125
|
+
createTaskCreatedEvent(
|
|
126
|
+
'task-2',
|
|
127
|
+
'architecture-design',
|
|
128
|
+
'Design V3 Domain Structure',
|
|
129
|
+
'Implement bounded contexts for V3',
|
|
130
|
+
'high',
|
|
131
|
+
[]
|
|
132
|
+
)
|
|
133
|
+
);
|
|
134
|
+
await eventStore.append(createTaskStartedEvent('task-2', 'agent-3'));
|
|
135
|
+
await eventStore.append(
|
|
136
|
+
createAgentTaskAssignedEvent('agent-3', 'task-2', Date.now())
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
console.log(' Task events recorded\n');
|
|
140
|
+
|
|
141
|
+
// =========================================================================
|
|
142
|
+
// 5. Record Memory Operations Events
|
|
143
|
+
// =========================================================================
|
|
144
|
+
console.log('5. Recording Memory Operations Events...');
|
|
145
|
+
|
|
146
|
+
await eventStore.append(
|
|
147
|
+
createMemoryStoredEvent('mem-1', 'agent-context', 'agent-2-state', 'episodic', 2048)
|
|
148
|
+
);
|
|
149
|
+
await eventStore.append(
|
|
150
|
+
createMemoryStoredEvent('mem-2', 'task-results', 'task-1-result', 'semantic', 1024)
|
|
151
|
+
);
|
|
152
|
+
await eventStore.append(createMemoryRetrievedEvent('mem-1', 'agent-context', 'agent-2-state', 1));
|
|
153
|
+
await eventStore.append(createMemoryRetrievedEvent('mem-1', 'agent-context', 'agent-2-state', 2));
|
|
154
|
+
|
|
155
|
+
console.log(' Memory events recorded\n');
|
|
156
|
+
|
|
157
|
+
// =========================================================================
|
|
158
|
+
// 6. Query Events
|
|
159
|
+
// =========================================================================
|
|
160
|
+
console.log('6. Querying Events...\n');
|
|
161
|
+
|
|
162
|
+
const allAgentEvents = await eventStore.query({ aggregateTypes: ['agent'] });
|
|
163
|
+
console.log(` Total agent events: ${allAgentEvents.length}`);
|
|
164
|
+
|
|
165
|
+
const allTaskEvents = await eventStore.query({ aggregateTypes: ['task'] });
|
|
166
|
+
console.log(` Total task events: ${allTaskEvents.length}`);
|
|
167
|
+
|
|
168
|
+
const completedTaskEvents = await eventStore.getEventsByType('task:completed');
|
|
169
|
+
console.log(` Completed task events: ${completedTaskEvents.length}`);
|
|
170
|
+
|
|
171
|
+
console.log();
|
|
172
|
+
|
|
173
|
+
// =========================================================================
|
|
174
|
+
// 7. Build Projections
|
|
175
|
+
// =========================================================================
|
|
176
|
+
console.log('7. Building Projections...\n');
|
|
177
|
+
|
|
178
|
+
// Agent State Projection
|
|
179
|
+
const agentProjection = new AgentStateProjection(eventStore);
|
|
180
|
+
await agentProjection.initialize();
|
|
181
|
+
|
|
182
|
+
console.log(' Agent State Projection:');
|
|
183
|
+
const allAgents = agentProjection.getAllAgents();
|
|
184
|
+
for (const agent of allAgents) {
|
|
185
|
+
console.log(` - ${agent.id}: ${agent.role} (${agent.status})`);
|
|
186
|
+
console.log(` Tasks completed: ${agent.completedTasks.length}`);
|
|
187
|
+
console.log(` Avg duration: ${agent.taskCount > 0 ? agent.totalTaskDuration / agent.taskCount : 0}ms`);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const activeAgents = agentProjection.getActiveAgentCount();
|
|
191
|
+
console.log(`\n Active agents: ${activeAgents}`);
|
|
192
|
+
|
|
193
|
+
// Task History Projection
|
|
194
|
+
const taskProjection = new TaskHistoryProjection(eventStore);
|
|
195
|
+
await taskProjection.initialize();
|
|
196
|
+
|
|
197
|
+
console.log('\n Task History Projection:');
|
|
198
|
+
const allTasks = taskProjection.getAllTasks();
|
|
199
|
+
for (const task of allTasks) {
|
|
200
|
+
console.log(` - ${task.id}: ${task.title} (${task.status})`);
|
|
201
|
+
console.log(` Assigned to: ${task.assignedAgent || 'unassigned'}`);
|
|
202
|
+
console.log(` Duration: ${task.duration || 'N/A'}ms`);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const avgTaskDuration = taskProjection.getAverageTaskDuration();
|
|
206
|
+
console.log(`\n Average task duration: ${avgTaskDuration.toFixed(2)}ms`);
|
|
207
|
+
|
|
208
|
+
// Memory Index Projection
|
|
209
|
+
const memoryProjection = new MemoryIndexProjection(eventStore);
|
|
210
|
+
await memoryProjection.initialize();
|
|
211
|
+
|
|
212
|
+
console.log('\n Memory Index Projection:');
|
|
213
|
+
const activeMemories = memoryProjection.getActiveMemories();
|
|
214
|
+
for (const memory of activeMemories) {
|
|
215
|
+
console.log(` - ${memory.id}: ${memory.namespace}/${memory.key}`);
|
|
216
|
+
console.log(` Size: ${memory.size} bytes, Accessed: ${memory.accessCount} times`);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const totalSize = activeMemories.reduce((sum, m) => sum + m.size, 0);
|
|
220
|
+
console.log(`\n Total memory used: ${totalSize} bytes`);
|
|
221
|
+
|
|
222
|
+
// =========================================================================
|
|
223
|
+
// 8. Event Replay
|
|
224
|
+
// =========================================================================
|
|
225
|
+
console.log('\n8. Event Replay Example...\n');
|
|
226
|
+
|
|
227
|
+
let replayCount = 0;
|
|
228
|
+
for await (const event of eventStore.replay(0)) {
|
|
229
|
+
replayCount++;
|
|
230
|
+
if (replayCount <= 3) {
|
|
231
|
+
console.log(` Replaying: ${event.type} (v${event.version})`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
console.log(` Total events replayed: ${replayCount}`);
|
|
235
|
+
|
|
236
|
+
// =========================================================================
|
|
237
|
+
// 9. Snapshots
|
|
238
|
+
// =========================================================================
|
|
239
|
+
console.log('\n9. Snapshot Example...\n');
|
|
240
|
+
|
|
241
|
+
const agent2State = agentProjection.getAgent('agent-2');
|
|
242
|
+
if (agent2State) {
|
|
243
|
+
await eventStore.saveSnapshot({
|
|
244
|
+
aggregateId: 'agent-2',
|
|
245
|
+
aggregateType: 'agent',
|
|
246
|
+
version: 5,
|
|
247
|
+
state: agent2State as unknown as Record<string, unknown>,
|
|
248
|
+
timestamp: Date.now(),
|
|
249
|
+
});
|
|
250
|
+
console.log(' Snapshot saved for agent-2');
|
|
251
|
+
|
|
252
|
+
const snapshot = await eventStore.getSnapshot('agent-2');
|
|
253
|
+
console.log(` Snapshot retrieved: version ${snapshot?.version}`);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// =========================================================================
|
|
257
|
+
// 10. Statistics
|
|
258
|
+
// =========================================================================
|
|
259
|
+
console.log('\n10. Event Store Statistics...\n');
|
|
260
|
+
|
|
261
|
+
const stats = await eventStore.getStats();
|
|
262
|
+
console.log(` Total events: ${stats.totalEvents}`);
|
|
263
|
+
console.log(` Events by type:`);
|
|
264
|
+
for (const [type, count] of Object.entries(stats.eventsByType)) {
|
|
265
|
+
console.log(` - ${type}: ${count}`);
|
|
266
|
+
}
|
|
267
|
+
console.log(`\n Events by aggregate:`);
|
|
268
|
+
const topAggregates = Object.entries(stats.eventsByAggregate)
|
|
269
|
+
.sort(([, a], [, b]) => b - a)
|
|
270
|
+
.slice(0, 5);
|
|
271
|
+
for (const [aggregate, count] of topAggregates) {
|
|
272
|
+
console.log(` - ${aggregate}: ${count}`);
|
|
273
|
+
}
|
|
274
|
+
console.log(`\n Snapshots: ${stats.snapshotCount}`);
|
|
275
|
+
|
|
276
|
+
// =========================================================================
|
|
277
|
+
// Cleanup
|
|
278
|
+
// =========================================================================
|
|
279
|
+
console.log('\n11. Persisting and Shutting Down...\n');
|
|
280
|
+
|
|
281
|
+
await eventStore.persist();
|
|
282
|
+
await eventStore.shutdown();
|
|
283
|
+
|
|
284
|
+
console.log(' Event Store shutdown complete');
|
|
285
|
+
console.log('\nExample completed successfully!');
|
|
286
|
+
console.log('Database saved to: ./event-store-example.db');
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Run the example
|
|
290
|
+
main().catch((error) => {
|
|
291
|
+
console.error('Error running example:', error);
|
|
292
|
+
process.exit(1);
|
|
293
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Sourcing System (ADR-007)
|
|
3
|
+
*
|
|
4
|
+
* Complete event sourcing implementation for V3 Claude Flow:
|
|
5
|
+
* - Domain events for all aggregates (agent, task, memory, swarm)
|
|
6
|
+
* - Persistent event store with SQLite backend
|
|
7
|
+
* - Projections for building read models
|
|
8
|
+
* - Event replay and snapshots
|
|
9
|
+
*
|
|
10
|
+
* @module v3/shared/events
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Domain Event Types
|
|
14
|
+
export type {
|
|
15
|
+
DomainEvent,
|
|
16
|
+
AllDomainEvents,
|
|
17
|
+
AgentSpawnedEvent,
|
|
18
|
+
AgentStartedEvent,
|
|
19
|
+
AgentStoppedEvent,
|
|
20
|
+
AgentFailedEvent,
|
|
21
|
+
AgentStatusChangedEvent,
|
|
22
|
+
AgentTaskAssignedEvent,
|
|
23
|
+
AgentTaskCompletedEvent,
|
|
24
|
+
TaskCreatedEvent,
|
|
25
|
+
TaskStartedEvent,
|
|
26
|
+
TaskCompletedEvent,
|
|
27
|
+
TaskFailedEvent,
|
|
28
|
+
TaskBlockedEvent,
|
|
29
|
+
TaskQueuedEvent,
|
|
30
|
+
MemoryStoredEvent,
|
|
31
|
+
MemoryRetrievedEvent,
|
|
32
|
+
MemoryDeletedEvent,
|
|
33
|
+
MemoryExpiredEvent,
|
|
34
|
+
SwarmInitializedEvent,
|
|
35
|
+
SwarmScaledEvent,
|
|
36
|
+
SwarmTerminatedEvent,
|
|
37
|
+
SwarmPhaseChangedEvent,
|
|
38
|
+
SwarmMilestoneReachedEvent,
|
|
39
|
+
SwarmErrorEvent,
|
|
40
|
+
} from './domain-events.js';
|
|
41
|
+
|
|
42
|
+
// Domain Event Factory Functions
|
|
43
|
+
export {
|
|
44
|
+
createAgentSpawnedEvent,
|
|
45
|
+
createAgentStartedEvent,
|
|
46
|
+
createAgentStoppedEvent,
|
|
47
|
+
createAgentFailedEvent,
|
|
48
|
+
createTaskCreatedEvent,
|
|
49
|
+
createTaskStartedEvent,
|
|
50
|
+
createTaskCompletedEvent,
|
|
51
|
+
createTaskFailedEvent,
|
|
52
|
+
createMemoryStoredEvent,
|
|
53
|
+
createMemoryRetrievedEvent,
|
|
54
|
+
createMemoryDeletedEvent,
|
|
55
|
+
createSwarmInitializedEvent,
|
|
56
|
+
createSwarmScaledEvent,
|
|
57
|
+
createSwarmTerminatedEvent,
|
|
58
|
+
} from './domain-events.js';
|
|
59
|
+
|
|
60
|
+
// Event Store
|
|
61
|
+
export { EventStore } from './event-store.js';
|
|
62
|
+
export type {
|
|
63
|
+
EventStoreConfig,
|
|
64
|
+
EventFilter,
|
|
65
|
+
EventSnapshot,
|
|
66
|
+
EventStoreStats,
|
|
67
|
+
} from './event-store.js';
|
|
68
|
+
|
|
69
|
+
// Projections
|
|
70
|
+
export {
|
|
71
|
+
Projection,
|
|
72
|
+
AgentStateProjection,
|
|
73
|
+
TaskHistoryProjection,
|
|
74
|
+
MemoryIndexProjection,
|
|
75
|
+
} from './projections.js';
|
|
76
|
+
export type {
|
|
77
|
+
AgentProjectionState,
|
|
78
|
+
TaskProjectionState,
|
|
79
|
+
MemoryProjectionState,
|
|
80
|
+
} from './projections.js';
|
|
81
|
+
|
|
82
|
+
// State Reconstruction (ADR-007)
|
|
83
|
+
export {
|
|
84
|
+
StateReconstructor,
|
|
85
|
+
createStateReconstructor,
|
|
86
|
+
AgentAggregate,
|
|
87
|
+
TaskAggregate,
|
|
88
|
+
type AggregateRoot,
|
|
89
|
+
type ReconstructorOptions,
|
|
90
|
+
} from './state-reconstructor.js';
|