cmp-standards 2.7.0 → 2.8.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.
Files changed (162) hide show
  1. package/README.md +633 -633
  2. package/dist/cache/EmbeddingCache.d.ts +110 -0
  3. package/dist/cache/EmbeddingCache.d.ts.map +1 -0
  4. package/dist/cache/EmbeddingCache.js +239 -0
  5. package/dist/cache/EmbeddingCache.js.map +1 -0
  6. package/dist/cache/index.d.ts +6 -0
  7. package/dist/cache/index.d.ts.map +1 -0
  8. package/dist/cache/index.js +6 -0
  9. package/dist/cache/index.js.map +1 -0
  10. package/dist/cli/index.js +0 -0
  11. package/dist/db/cloud.d.ts +1 -0
  12. package/dist/db/cloud.d.ts.map +1 -1
  13. package/dist/db/drizzle-client.d.ts +10 -1
  14. package/dist/db/drizzle-client.d.ts.map +1 -1
  15. package/dist/db/drizzle-client.js +57 -3
  16. package/dist/db/drizzle-client.js.map +1 -1
  17. package/dist/db/errors.d.ts +13 -1
  18. package/dist/db/errors.d.ts.map +1 -1
  19. package/dist/db/errors.js +49 -5
  20. package/dist/db/errors.js.map +1 -1
  21. package/dist/db/migrations.d.ts +42 -0
  22. package/dist/db/migrations.d.ts.map +1 -0
  23. package/dist/db/migrations.js +173 -0
  24. package/dist/db/migrations.js.map +1 -0
  25. package/dist/db/turso-client.d.ts +15 -3
  26. package/dist/db/turso-client.d.ts.map +1 -1
  27. package/dist/db/turso-client.js +50 -39
  28. package/dist/db/turso-client.js.map +1 -1
  29. package/dist/eslint/rules/no-async-useeffect.js +6 -6
  30. package/dist/events/EventBus.d.ts +97 -0
  31. package/dist/events/EventBus.d.ts.map +1 -0
  32. package/dist/events/EventBus.js +256 -0
  33. package/dist/events/EventBus.js.map +1 -0
  34. package/dist/events/index.d.ts +7 -0
  35. package/dist/events/index.d.ts.map +1 -0
  36. package/dist/events/index.js +9 -0
  37. package/dist/events/index.js.map +1 -0
  38. package/dist/events/types.d.ts +989 -0
  39. package/dist/events/types.d.ts.map +1 -0
  40. package/dist/events/types.js +136 -0
  41. package/dist/events/types.js.map +1 -0
  42. package/dist/experts/ConsensusEngine.d.ts +57 -0
  43. package/dist/experts/ConsensusEngine.d.ts.map +1 -0
  44. package/dist/experts/ConsensusEngine.js +146 -0
  45. package/dist/experts/ConsensusEngine.js.map +1 -0
  46. package/dist/experts/ExpertPanelService.d.ts +84 -0
  47. package/dist/experts/ExpertPanelService.d.ts.map +1 -0
  48. package/dist/experts/ExpertPanelService.js +204 -0
  49. package/dist/experts/ExpertPanelService.js.map +1 -0
  50. package/dist/experts/ExpertRouter.d.ts +68 -0
  51. package/dist/experts/ExpertRouter.d.ts.map +1 -0
  52. package/dist/experts/ExpertRouter.js +374 -0
  53. package/dist/experts/ExpertRouter.js.map +1 -0
  54. package/dist/experts/VoteCollector.d.ts +58 -0
  55. package/dist/experts/VoteCollector.d.ts.map +1 -0
  56. package/dist/experts/VoteCollector.js +146 -0
  57. package/dist/experts/VoteCollector.js.map +1 -0
  58. package/dist/experts/index.d.ts +9 -0
  59. package/dist/experts/index.d.ts.map +1 -0
  60. package/dist/experts/index.js +13 -0
  61. package/dist/experts/index.js.map +1 -0
  62. package/dist/hooks/cloud-pre-tool-use.js +20 -20
  63. package/dist/hooks/expert-review.d.ts +74 -0
  64. package/dist/hooks/expert-review.d.ts.map +1 -0
  65. package/dist/hooks/expert-review.js +220 -0
  66. package/dist/hooks/expert-review.js.map +1 -0
  67. package/dist/hooks/index.d.ts +1 -0
  68. package/dist/hooks/index.d.ts.map +1 -1
  69. package/dist/hooks/index.js +2 -0
  70. package/dist/hooks/index.js.map +1 -1
  71. package/dist/index.d.ts +13 -0
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +22 -0
  74. package/dist/index.js.map +1 -1
  75. package/dist/interfaces/index.d.ts +450 -0
  76. package/dist/interfaces/index.d.ts.map +1 -0
  77. package/dist/interfaces/index.js +50 -0
  78. package/dist/interfaces/index.js.map +1 -0
  79. package/dist/mcp/schemas.d.ts +278 -0
  80. package/dist/mcp/schemas.d.ts.map +1 -0
  81. package/dist/mcp/schemas.js +166 -0
  82. package/dist/mcp/schemas.js.map +1 -0
  83. package/dist/mcp/server.d.ts.map +1 -1
  84. package/dist/mcp/server.js +14 -3
  85. package/dist/mcp/server.js.map +1 -1
  86. package/dist/patterns/feedback-loop.d.ts +264 -0
  87. package/dist/patterns/feedback-loop.d.ts.map +1 -0
  88. package/dist/patterns/feedback-loop.js +329 -0
  89. package/dist/patterns/feedback-loop.js.map +1 -0
  90. package/dist/patterns/index.d.ts +9 -0
  91. package/dist/patterns/index.d.ts.map +1 -0
  92. package/dist/patterns/index.js +9 -0
  93. package/dist/patterns/index.js.map +1 -0
  94. package/dist/patterns/lifecycle.d.ts +88 -0
  95. package/dist/patterns/lifecycle.d.ts.map +1 -0
  96. package/dist/patterns/lifecycle.js +284 -0
  97. package/dist/patterns/lifecycle.js.map +1 -0
  98. package/dist/patterns/registry.d.ts +142 -0
  99. package/dist/patterns/registry.d.ts.map +1 -0
  100. package/dist/patterns/registry.js +442 -0
  101. package/dist/patterns/registry.js.map +1 -0
  102. package/dist/performance/Debouncer.d.ts +91 -0
  103. package/dist/performance/Debouncer.d.ts.map +1 -0
  104. package/dist/performance/Debouncer.js +198 -0
  105. package/dist/performance/Debouncer.js.map +1 -0
  106. package/dist/performance/MemoryDecay.d.ts +82 -0
  107. package/dist/performance/MemoryDecay.d.ts.map +1 -0
  108. package/dist/performance/MemoryDecay.js +153 -0
  109. package/dist/performance/MemoryDecay.js.map +1 -0
  110. package/dist/performance/index.d.ts +7 -0
  111. package/dist/performance/index.d.ts.map +1 -0
  112. package/dist/performance/index.js +9 -0
  113. package/dist/performance/index.js.map +1 -0
  114. package/dist/schema/expert-types.d.ts +395 -0
  115. package/dist/schema/expert-types.d.ts.map +1 -0
  116. package/dist/schema/expert-types.js +250 -0
  117. package/dist/schema/expert-types.js.map +1 -0
  118. package/dist/services/ContextGenerator.js +7 -7
  119. package/dist/services/PlanManager.d.ts +1 -1
  120. package/dist/services/PlanManager.d.ts.map +1 -1
  121. package/dist/services/PlanManager.js +26 -6
  122. package/dist/services/PlanManager.js.map +1 -1
  123. package/dist/services/ProjectScaffold.js +76 -76
  124. package/dist/services/memory-router.js +35 -35
  125. package/dist/services/pattern-tracker.js +90 -90
  126. package/dist/services/semantic-search.js +2 -2
  127. package/package.json +105 -104
  128. package/standards/README.md +50 -50
  129. package/standards/experts/expert-routing.md +215 -215
  130. package/standards/general/code-quality.md +86 -86
  131. package/standards/general/memory-usage.md +205 -205
  132. package/standards/general/sync-workflow.md +235 -235
  133. package/standards/general/workflow.md +82 -82
  134. package/standards/hooks/mandatory-tracking.md +446 -446
  135. package/standards/infrastructure/cloud-database.md +287 -287
  136. package/standards/mcp/server-design.md +243 -243
  137. package/standards/mcp/tool-patterns.md +354 -354
  138. package/standards/skills/skill-structure.md +286 -286
  139. package/standards/skills/workflow-design.md +323 -323
  140. package/standards/tools/tool-design.md +297 -297
  141. package/templates/agents/architecture-expert.md +61 -61
  142. package/templates/agents/database-expert.md +62 -62
  143. package/templates/agents/documentation-expert.md +57 -57
  144. package/templates/agents/memory-expert.md +88 -88
  145. package/templates/agents/performance-expert.md +61 -61
  146. package/templates/agents/security-expert.md +59 -59
  147. package/templates/agents/ux-expert.md +63 -63
  148. package/templates/agents/worker.md +75 -75
  149. package/templates/ai-skills/SKILL_TEMPLATE.md +55 -55
  150. package/templates/claude-settings.json +72 -72
  151. package/templates/commands/experts.md +138 -138
  152. package/templates/hooks/README.md +158 -158
  153. package/templates/hooks/project.config.json.template +77 -77
  154. package/templates/hooks/settings.local.json.template +57 -57
  155. package/templates/memory-config.json +56 -56
  156. package/templates/memory-config.schema.json +212 -212
  157. package/templates/settings.json +58 -58
  158. package/templates/skills/continue.md +205 -205
  159. package/templates/workflows/business-improvement.md +264 -264
  160. package/templates/workflows/expert-review.md +153 -153
  161. package/templates/workflows/internal-app.md +245 -245
  162. package/templates/workflows/sync-docs.md +187 -187
@@ -0,0 +1,989 @@
1
+ /**
2
+ * @file Event Type Definitions for cmp-standards v2.8
3
+ * @description Type-safe event system for expert panel orchestration
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const EventMetadataSchema: z.ZodObject<{
7
+ eventId: z.ZodString;
8
+ timestamp: z.ZodString;
9
+ source: z.ZodString;
10
+ correlationId: z.ZodOptional<z.ZodString>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ source: string;
13
+ timestamp: string;
14
+ eventId: string;
15
+ correlationId?: string | undefined;
16
+ }, {
17
+ source: string;
18
+ timestamp: string;
19
+ eventId: string;
20
+ correlationId?: string | undefined;
21
+ }>;
22
+ export type EventMetadata = z.infer<typeof EventMetadataSchema>;
23
+ export declare const TaskNeedsReviewEventSchema: z.ZodObject<{
24
+ type: z.ZodLiteral<"task.needs_review">;
25
+ taskId: z.ZodString;
26
+ files: z.ZodArray<z.ZodString, "many">;
27
+ criticality: z.ZodEnum<["critical", "normal"]>;
28
+ domain: z.ZodOptional<z.ZodString>;
29
+ metadata: z.ZodObject<{
30
+ eventId: z.ZodString;
31
+ timestamp: z.ZodString;
32
+ source: z.ZodString;
33
+ correlationId: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ source: string;
36
+ timestamp: string;
37
+ eventId: string;
38
+ correlationId?: string | undefined;
39
+ }, {
40
+ source: string;
41
+ timestamp: string;
42
+ eventId: string;
43
+ correlationId?: string | undefined;
44
+ }>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ type: "task.needs_review";
47
+ files: string[];
48
+ taskId: string;
49
+ criticality: "critical" | "normal";
50
+ metadata: {
51
+ source: string;
52
+ timestamp: string;
53
+ eventId: string;
54
+ correlationId?: string | undefined;
55
+ };
56
+ domain?: string | undefined;
57
+ }, {
58
+ type: "task.needs_review";
59
+ files: string[];
60
+ taskId: string;
61
+ criticality: "critical" | "normal";
62
+ metadata: {
63
+ source: string;
64
+ timestamp: string;
65
+ eventId: string;
66
+ correlationId?: string | undefined;
67
+ };
68
+ domain?: string | undefined;
69
+ }>;
70
+ export declare const TaskReviewedEventSchema: z.ZodObject<{
71
+ type: z.ZodLiteral<"task.reviewed">;
72
+ taskId: z.ZodString;
73
+ decision: z.ZodEnum<["APPROVED", "REJECTED", "NEEDS_REVIEW"]>;
74
+ metadata: z.ZodObject<{
75
+ eventId: z.ZodString;
76
+ timestamp: z.ZodString;
77
+ source: z.ZodString;
78
+ correlationId: z.ZodOptional<z.ZodString>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ source: string;
81
+ timestamp: string;
82
+ eventId: string;
83
+ correlationId?: string | undefined;
84
+ }, {
85
+ source: string;
86
+ timestamp: string;
87
+ eventId: string;
88
+ correlationId?: string | undefined;
89
+ }>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ type: "task.reviewed";
92
+ taskId: string;
93
+ metadata: {
94
+ source: string;
95
+ timestamp: string;
96
+ eventId: string;
97
+ correlationId?: string | undefined;
98
+ };
99
+ decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
100
+ }, {
101
+ type: "task.reviewed";
102
+ taskId: string;
103
+ metadata: {
104
+ source: string;
105
+ timestamp: string;
106
+ eventId: string;
107
+ correlationId?: string | undefined;
108
+ };
109
+ decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
110
+ }>;
111
+ export declare const TaskCompletedEventSchema: z.ZodObject<{
112
+ type: z.ZodLiteral<"task.completed">;
113
+ taskId: z.ZodString;
114
+ result: z.ZodEnum<["success", "partial", "failed"]>;
115
+ metadata: z.ZodObject<{
116
+ eventId: z.ZodString;
117
+ timestamp: z.ZodString;
118
+ source: z.ZodString;
119
+ correlationId: z.ZodOptional<z.ZodString>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ source: string;
122
+ timestamp: string;
123
+ eventId: string;
124
+ correlationId?: string | undefined;
125
+ }, {
126
+ source: string;
127
+ timestamp: string;
128
+ eventId: string;
129
+ correlationId?: string | undefined;
130
+ }>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ type: "task.completed";
133
+ result: "failed" | "success" | "partial";
134
+ taskId: string;
135
+ metadata: {
136
+ source: string;
137
+ timestamp: string;
138
+ eventId: string;
139
+ correlationId?: string | undefined;
140
+ };
141
+ }, {
142
+ type: "task.completed";
143
+ result: "failed" | "success" | "partial";
144
+ taskId: string;
145
+ metadata: {
146
+ source: string;
147
+ timestamp: string;
148
+ eventId: string;
149
+ correlationId?: string | undefined;
150
+ };
151
+ }>;
152
+ export declare const ExpertVoteSubmittedEventSchema: z.ZodObject<{
153
+ type: z.ZodLiteral<"expert.vote_submitted">;
154
+ expertId: z.ZodString;
155
+ taskId: z.ZodString;
156
+ vote: z.ZodEnum<["APPROVE", "REJECT", "WARN", "ABSTAIN"]>;
157
+ confidence: z.ZodNumber;
158
+ issues: z.ZodArray<z.ZodObject<{
159
+ severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
160
+ message: z.ZodString;
161
+ file: z.ZodOptional<z.ZodString>;
162
+ line: z.ZodOptional<z.ZodNumber>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ message: string;
165
+ severity: "critical" | "high" | "medium" | "low";
166
+ line?: number | undefined;
167
+ file?: string | undefined;
168
+ }, {
169
+ message: string;
170
+ severity: "critical" | "high" | "medium" | "low";
171
+ line?: number | undefined;
172
+ file?: string | undefined;
173
+ }>, "many">;
174
+ reasoning: z.ZodOptional<z.ZodString>;
175
+ metadata: z.ZodObject<{
176
+ eventId: z.ZodString;
177
+ timestamp: z.ZodString;
178
+ source: z.ZodString;
179
+ correlationId: z.ZodOptional<z.ZodString>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ source: string;
182
+ timestamp: string;
183
+ eventId: string;
184
+ correlationId?: string | undefined;
185
+ }, {
186
+ source: string;
187
+ timestamp: string;
188
+ eventId: string;
189
+ correlationId?: string | undefined;
190
+ }>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ issues: {
193
+ message: string;
194
+ severity: "critical" | "high" | "medium" | "low";
195
+ line?: number | undefined;
196
+ file?: string | undefined;
197
+ }[];
198
+ type: "expert.vote_submitted";
199
+ taskId: string;
200
+ metadata: {
201
+ source: string;
202
+ timestamp: string;
203
+ eventId: string;
204
+ correlationId?: string | undefined;
205
+ };
206
+ expertId: string;
207
+ vote: "APPROVE" | "REJECT" | "WARN" | "ABSTAIN";
208
+ confidence: number;
209
+ reasoning?: string | undefined;
210
+ }, {
211
+ issues: {
212
+ message: string;
213
+ severity: "critical" | "high" | "medium" | "low";
214
+ line?: number | undefined;
215
+ file?: string | undefined;
216
+ }[];
217
+ type: "expert.vote_submitted";
218
+ taskId: string;
219
+ metadata: {
220
+ source: string;
221
+ timestamp: string;
222
+ eventId: string;
223
+ correlationId?: string | undefined;
224
+ };
225
+ expertId: string;
226
+ vote: "APPROVE" | "REJECT" | "WARN" | "ABSTAIN";
227
+ confidence: number;
228
+ reasoning?: string | undefined;
229
+ }>;
230
+ export declare const ExpertRecommendationEventSchema: z.ZodObject<{
231
+ type: z.ZodLiteral<"expert.recommendation">;
232
+ expertId: z.ZodString;
233
+ taskId: z.ZodString;
234
+ recommendation: z.ZodObject<{
235
+ title: z.ZodString;
236
+ description: z.ZodString;
237
+ priority: z.ZodEnum<["critical", "high", "medium", "low"]>;
238
+ effort: z.ZodEnum<["trivial", "small", "medium", "large"]>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ title: string;
241
+ description: string;
242
+ priority: "critical" | "high" | "medium" | "low";
243
+ effort: "medium" | "small" | "large" | "trivial";
244
+ }, {
245
+ title: string;
246
+ description: string;
247
+ priority: "critical" | "high" | "medium" | "low";
248
+ effort: "medium" | "small" | "large" | "trivial";
249
+ }>;
250
+ metadata: z.ZodObject<{
251
+ eventId: z.ZodString;
252
+ timestamp: z.ZodString;
253
+ source: z.ZodString;
254
+ correlationId: z.ZodOptional<z.ZodString>;
255
+ }, "strip", z.ZodTypeAny, {
256
+ source: string;
257
+ timestamp: string;
258
+ eventId: string;
259
+ correlationId?: string | undefined;
260
+ }, {
261
+ source: string;
262
+ timestamp: string;
263
+ eventId: string;
264
+ correlationId?: string | undefined;
265
+ }>;
266
+ }, "strip", z.ZodTypeAny, {
267
+ type: "expert.recommendation";
268
+ taskId: string;
269
+ metadata: {
270
+ source: string;
271
+ timestamp: string;
272
+ eventId: string;
273
+ correlationId?: string | undefined;
274
+ };
275
+ expertId: string;
276
+ recommendation: {
277
+ title: string;
278
+ description: string;
279
+ priority: "critical" | "high" | "medium" | "low";
280
+ effort: "medium" | "small" | "large" | "trivial";
281
+ };
282
+ }, {
283
+ type: "expert.recommendation";
284
+ taskId: string;
285
+ metadata: {
286
+ source: string;
287
+ timestamp: string;
288
+ eventId: string;
289
+ correlationId?: string | undefined;
290
+ };
291
+ expertId: string;
292
+ recommendation: {
293
+ title: string;
294
+ description: string;
295
+ priority: "critical" | "high" | "medium" | "low";
296
+ effort: "medium" | "small" | "large" | "trivial";
297
+ };
298
+ }>;
299
+ export declare const ConsensusReachedEventSchema: z.ZodObject<{
300
+ type: z.ZodLiteral<"consensus.reached">;
301
+ taskId: z.ZodString;
302
+ decision: z.ZodEnum<["APPROVED", "REJECTED", "NEEDS_REVIEW"]>;
303
+ threshold: z.ZodEnum<["UNANIMITY", "MAJORITY"]>;
304
+ votes: z.ZodObject<{
305
+ approve: z.ZodNumber;
306
+ reject: z.ZodNumber;
307
+ abstain: z.ZodNumber;
308
+ }, "strip", z.ZodTypeAny, {
309
+ approve: number;
310
+ reject: number;
311
+ abstain: number;
312
+ }, {
313
+ approve: number;
314
+ reject: number;
315
+ abstain: number;
316
+ }>;
317
+ metadata: z.ZodObject<{
318
+ eventId: z.ZodString;
319
+ timestamp: z.ZodString;
320
+ source: z.ZodString;
321
+ correlationId: z.ZodOptional<z.ZodString>;
322
+ }, "strip", z.ZodTypeAny, {
323
+ source: string;
324
+ timestamp: string;
325
+ eventId: string;
326
+ correlationId?: string | undefined;
327
+ }, {
328
+ source: string;
329
+ timestamp: string;
330
+ eventId: string;
331
+ correlationId?: string | undefined;
332
+ }>;
333
+ }, "strip", z.ZodTypeAny, {
334
+ type: "consensus.reached";
335
+ taskId: string;
336
+ metadata: {
337
+ source: string;
338
+ timestamp: string;
339
+ eventId: string;
340
+ correlationId?: string | undefined;
341
+ };
342
+ decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
343
+ threshold: "UNANIMITY" | "MAJORITY";
344
+ votes: {
345
+ approve: number;
346
+ reject: number;
347
+ abstain: number;
348
+ };
349
+ }, {
350
+ type: "consensus.reached";
351
+ taskId: string;
352
+ metadata: {
353
+ source: string;
354
+ timestamp: string;
355
+ eventId: string;
356
+ correlationId?: string | undefined;
357
+ };
358
+ decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
359
+ threshold: "UNANIMITY" | "MAJORITY";
360
+ votes: {
361
+ approve: number;
362
+ reject: number;
363
+ abstain: number;
364
+ };
365
+ }>;
366
+ export declare const PatternDetectedEventSchema: z.ZodObject<{
367
+ type: z.ZodLiteral<"pattern.detected">;
368
+ patternId: z.ZodString;
369
+ occurrences: z.ZodNumber;
370
+ files: z.ZodArray<z.ZodString, "many">;
371
+ severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
372
+ autoImprove: z.ZodBoolean;
373
+ metadata: z.ZodObject<{
374
+ eventId: z.ZodString;
375
+ timestamp: z.ZodString;
376
+ source: z.ZodString;
377
+ correlationId: z.ZodOptional<z.ZodString>;
378
+ }, "strip", z.ZodTypeAny, {
379
+ source: string;
380
+ timestamp: string;
381
+ eventId: string;
382
+ correlationId?: string | undefined;
383
+ }, {
384
+ source: string;
385
+ timestamp: string;
386
+ eventId: string;
387
+ correlationId?: string | undefined;
388
+ }>;
389
+ }, "strip", z.ZodTypeAny, {
390
+ type: "pattern.detected";
391
+ patternId: string;
392
+ occurrences: number;
393
+ files: string[];
394
+ severity: "critical" | "high" | "medium" | "low";
395
+ metadata: {
396
+ source: string;
397
+ timestamp: string;
398
+ eventId: string;
399
+ correlationId?: string | undefined;
400
+ };
401
+ autoImprove: boolean;
402
+ }, {
403
+ type: "pattern.detected";
404
+ patternId: string;
405
+ occurrences: number;
406
+ files: string[];
407
+ severity: "critical" | "high" | "medium" | "low";
408
+ metadata: {
409
+ source: string;
410
+ timestamp: string;
411
+ eventId: string;
412
+ correlationId?: string | undefined;
413
+ };
414
+ autoImprove: boolean;
415
+ }>;
416
+ export declare const MemoryCreatedEventSchema: z.ZodObject<{
417
+ type: z.ZodLiteral<"memory.created">;
418
+ memoryId: z.ZodString;
419
+ domain: z.ZodString;
420
+ title: z.ZodString;
421
+ metadata: z.ZodObject<{
422
+ eventId: z.ZodString;
423
+ timestamp: z.ZodString;
424
+ source: z.ZodString;
425
+ correlationId: z.ZodOptional<z.ZodString>;
426
+ }, "strip", z.ZodTypeAny, {
427
+ source: string;
428
+ timestamp: string;
429
+ eventId: string;
430
+ correlationId?: string | undefined;
431
+ }, {
432
+ source: string;
433
+ timestamp: string;
434
+ eventId: string;
435
+ correlationId?: string | undefined;
436
+ }>;
437
+ }, "strip", z.ZodTypeAny, {
438
+ title: string;
439
+ domain: string;
440
+ type: "memory.created";
441
+ metadata: {
442
+ source: string;
443
+ timestamp: string;
444
+ eventId: string;
445
+ correlationId?: string | undefined;
446
+ };
447
+ memoryId: string;
448
+ }, {
449
+ title: string;
450
+ domain: string;
451
+ type: "memory.created";
452
+ metadata: {
453
+ source: string;
454
+ timestamp: string;
455
+ eventId: string;
456
+ correlationId?: string | undefined;
457
+ };
458
+ memoryId: string;
459
+ }>;
460
+ export declare const MemoryAccessedEventSchema: z.ZodObject<{
461
+ type: z.ZodLiteral<"memory.accessed">;
462
+ memoryId: z.ZodString;
463
+ context: z.ZodOptional<z.ZodString>;
464
+ metadata: z.ZodObject<{
465
+ eventId: z.ZodString;
466
+ timestamp: z.ZodString;
467
+ source: z.ZodString;
468
+ correlationId: z.ZodOptional<z.ZodString>;
469
+ }, "strip", z.ZodTypeAny, {
470
+ source: string;
471
+ timestamp: string;
472
+ eventId: string;
473
+ correlationId?: string | undefined;
474
+ }, {
475
+ source: string;
476
+ timestamp: string;
477
+ eventId: string;
478
+ correlationId?: string | undefined;
479
+ }>;
480
+ }, "strip", z.ZodTypeAny, {
481
+ type: "memory.accessed";
482
+ metadata: {
483
+ source: string;
484
+ timestamp: string;
485
+ eventId: string;
486
+ correlationId?: string | undefined;
487
+ };
488
+ memoryId: string;
489
+ context?: string | undefined;
490
+ }, {
491
+ type: "memory.accessed";
492
+ metadata: {
493
+ source: string;
494
+ timestamp: string;
495
+ eventId: string;
496
+ correlationId?: string | undefined;
497
+ };
498
+ memoryId: string;
499
+ context?: string | undefined;
500
+ }>;
501
+ export declare const EventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
502
+ type: z.ZodLiteral<"task.needs_review">;
503
+ taskId: z.ZodString;
504
+ files: z.ZodArray<z.ZodString, "many">;
505
+ criticality: z.ZodEnum<["critical", "normal"]>;
506
+ domain: z.ZodOptional<z.ZodString>;
507
+ metadata: z.ZodObject<{
508
+ eventId: z.ZodString;
509
+ timestamp: z.ZodString;
510
+ source: z.ZodString;
511
+ correlationId: z.ZodOptional<z.ZodString>;
512
+ }, "strip", z.ZodTypeAny, {
513
+ source: string;
514
+ timestamp: string;
515
+ eventId: string;
516
+ correlationId?: string | undefined;
517
+ }, {
518
+ source: string;
519
+ timestamp: string;
520
+ eventId: string;
521
+ correlationId?: string | undefined;
522
+ }>;
523
+ }, "strip", z.ZodTypeAny, {
524
+ type: "task.needs_review";
525
+ files: string[];
526
+ taskId: string;
527
+ criticality: "critical" | "normal";
528
+ metadata: {
529
+ source: string;
530
+ timestamp: string;
531
+ eventId: string;
532
+ correlationId?: string | undefined;
533
+ };
534
+ domain?: string | undefined;
535
+ }, {
536
+ type: "task.needs_review";
537
+ files: string[];
538
+ taskId: string;
539
+ criticality: "critical" | "normal";
540
+ metadata: {
541
+ source: string;
542
+ timestamp: string;
543
+ eventId: string;
544
+ correlationId?: string | undefined;
545
+ };
546
+ domain?: string | undefined;
547
+ }>, z.ZodObject<{
548
+ type: z.ZodLiteral<"task.reviewed">;
549
+ taskId: z.ZodString;
550
+ decision: z.ZodEnum<["APPROVED", "REJECTED", "NEEDS_REVIEW"]>;
551
+ metadata: z.ZodObject<{
552
+ eventId: z.ZodString;
553
+ timestamp: z.ZodString;
554
+ source: z.ZodString;
555
+ correlationId: z.ZodOptional<z.ZodString>;
556
+ }, "strip", z.ZodTypeAny, {
557
+ source: string;
558
+ timestamp: string;
559
+ eventId: string;
560
+ correlationId?: string | undefined;
561
+ }, {
562
+ source: string;
563
+ timestamp: string;
564
+ eventId: string;
565
+ correlationId?: string | undefined;
566
+ }>;
567
+ }, "strip", z.ZodTypeAny, {
568
+ type: "task.reviewed";
569
+ taskId: string;
570
+ metadata: {
571
+ source: string;
572
+ timestamp: string;
573
+ eventId: string;
574
+ correlationId?: string | undefined;
575
+ };
576
+ decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
577
+ }, {
578
+ type: "task.reviewed";
579
+ taskId: string;
580
+ metadata: {
581
+ source: string;
582
+ timestamp: string;
583
+ eventId: string;
584
+ correlationId?: string | undefined;
585
+ };
586
+ decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
587
+ }>, z.ZodObject<{
588
+ type: z.ZodLiteral<"task.completed">;
589
+ taskId: z.ZodString;
590
+ result: z.ZodEnum<["success", "partial", "failed"]>;
591
+ metadata: z.ZodObject<{
592
+ eventId: z.ZodString;
593
+ timestamp: z.ZodString;
594
+ source: z.ZodString;
595
+ correlationId: z.ZodOptional<z.ZodString>;
596
+ }, "strip", z.ZodTypeAny, {
597
+ source: string;
598
+ timestamp: string;
599
+ eventId: string;
600
+ correlationId?: string | undefined;
601
+ }, {
602
+ source: string;
603
+ timestamp: string;
604
+ eventId: string;
605
+ correlationId?: string | undefined;
606
+ }>;
607
+ }, "strip", z.ZodTypeAny, {
608
+ type: "task.completed";
609
+ result: "failed" | "success" | "partial";
610
+ taskId: string;
611
+ metadata: {
612
+ source: string;
613
+ timestamp: string;
614
+ eventId: string;
615
+ correlationId?: string | undefined;
616
+ };
617
+ }, {
618
+ type: "task.completed";
619
+ result: "failed" | "success" | "partial";
620
+ taskId: string;
621
+ metadata: {
622
+ source: string;
623
+ timestamp: string;
624
+ eventId: string;
625
+ correlationId?: string | undefined;
626
+ };
627
+ }>, z.ZodObject<{
628
+ type: z.ZodLiteral<"expert.vote_submitted">;
629
+ expertId: z.ZodString;
630
+ taskId: z.ZodString;
631
+ vote: z.ZodEnum<["APPROVE", "REJECT", "WARN", "ABSTAIN"]>;
632
+ confidence: z.ZodNumber;
633
+ issues: z.ZodArray<z.ZodObject<{
634
+ severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
635
+ message: z.ZodString;
636
+ file: z.ZodOptional<z.ZodString>;
637
+ line: z.ZodOptional<z.ZodNumber>;
638
+ }, "strip", z.ZodTypeAny, {
639
+ message: string;
640
+ severity: "critical" | "high" | "medium" | "low";
641
+ line?: number | undefined;
642
+ file?: string | undefined;
643
+ }, {
644
+ message: string;
645
+ severity: "critical" | "high" | "medium" | "low";
646
+ line?: number | undefined;
647
+ file?: string | undefined;
648
+ }>, "many">;
649
+ reasoning: z.ZodOptional<z.ZodString>;
650
+ metadata: z.ZodObject<{
651
+ eventId: z.ZodString;
652
+ timestamp: z.ZodString;
653
+ source: z.ZodString;
654
+ correlationId: z.ZodOptional<z.ZodString>;
655
+ }, "strip", z.ZodTypeAny, {
656
+ source: string;
657
+ timestamp: string;
658
+ eventId: string;
659
+ correlationId?: string | undefined;
660
+ }, {
661
+ source: string;
662
+ timestamp: string;
663
+ eventId: string;
664
+ correlationId?: string | undefined;
665
+ }>;
666
+ }, "strip", z.ZodTypeAny, {
667
+ issues: {
668
+ message: string;
669
+ severity: "critical" | "high" | "medium" | "low";
670
+ line?: number | undefined;
671
+ file?: string | undefined;
672
+ }[];
673
+ type: "expert.vote_submitted";
674
+ taskId: string;
675
+ metadata: {
676
+ source: string;
677
+ timestamp: string;
678
+ eventId: string;
679
+ correlationId?: string | undefined;
680
+ };
681
+ expertId: string;
682
+ vote: "APPROVE" | "REJECT" | "WARN" | "ABSTAIN";
683
+ confidence: number;
684
+ reasoning?: string | undefined;
685
+ }, {
686
+ issues: {
687
+ message: string;
688
+ severity: "critical" | "high" | "medium" | "low";
689
+ line?: number | undefined;
690
+ file?: string | undefined;
691
+ }[];
692
+ type: "expert.vote_submitted";
693
+ taskId: string;
694
+ metadata: {
695
+ source: string;
696
+ timestamp: string;
697
+ eventId: string;
698
+ correlationId?: string | undefined;
699
+ };
700
+ expertId: string;
701
+ vote: "APPROVE" | "REJECT" | "WARN" | "ABSTAIN";
702
+ confidence: number;
703
+ reasoning?: string | undefined;
704
+ }>, z.ZodObject<{
705
+ type: z.ZodLiteral<"expert.recommendation">;
706
+ expertId: z.ZodString;
707
+ taskId: z.ZodString;
708
+ recommendation: z.ZodObject<{
709
+ title: z.ZodString;
710
+ description: z.ZodString;
711
+ priority: z.ZodEnum<["critical", "high", "medium", "low"]>;
712
+ effort: z.ZodEnum<["trivial", "small", "medium", "large"]>;
713
+ }, "strip", z.ZodTypeAny, {
714
+ title: string;
715
+ description: string;
716
+ priority: "critical" | "high" | "medium" | "low";
717
+ effort: "medium" | "small" | "large" | "trivial";
718
+ }, {
719
+ title: string;
720
+ description: string;
721
+ priority: "critical" | "high" | "medium" | "low";
722
+ effort: "medium" | "small" | "large" | "trivial";
723
+ }>;
724
+ metadata: z.ZodObject<{
725
+ eventId: z.ZodString;
726
+ timestamp: z.ZodString;
727
+ source: z.ZodString;
728
+ correlationId: z.ZodOptional<z.ZodString>;
729
+ }, "strip", z.ZodTypeAny, {
730
+ source: string;
731
+ timestamp: string;
732
+ eventId: string;
733
+ correlationId?: string | undefined;
734
+ }, {
735
+ source: string;
736
+ timestamp: string;
737
+ eventId: string;
738
+ correlationId?: string | undefined;
739
+ }>;
740
+ }, "strip", z.ZodTypeAny, {
741
+ type: "expert.recommendation";
742
+ taskId: string;
743
+ metadata: {
744
+ source: string;
745
+ timestamp: string;
746
+ eventId: string;
747
+ correlationId?: string | undefined;
748
+ };
749
+ expertId: string;
750
+ recommendation: {
751
+ title: string;
752
+ description: string;
753
+ priority: "critical" | "high" | "medium" | "low";
754
+ effort: "medium" | "small" | "large" | "trivial";
755
+ };
756
+ }, {
757
+ type: "expert.recommendation";
758
+ taskId: string;
759
+ metadata: {
760
+ source: string;
761
+ timestamp: string;
762
+ eventId: string;
763
+ correlationId?: string | undefined;
764
+ };
765
+ expertId: string;
766
+ recommendation: {
767
+ title: string;
768
+ description: string;
769
+ priority: "critical" | "high" | "medium" | "low";
770
+ effort: "medium" | "small" | "large" | "trivial";
771
+ };
772
+ }>, z.ZodObject<{
773
+ type: z.ZodLiteral<"consensus.reached">;
774
+ taskId: z.ZodString;
775
+ decision: z.ZodEnum<["APPROVED", "REJECTED", "NEEDS_REVIEW"]>;
776
+ threshold: z.ZodEnum<["UNANIMITY", "MAJORITY"]>;
777
+ votes: z.ZodObject<{
778
+ approve: z.ZodNumber;
779
+ reject: z.ZodNumber;
780
+ abstain: z.ZodNumber;
781
+ }, "strip", z.ZodTypeAny, {
782
+ approve: number;
783
+ reject: number;
784
+ abstain: number;
785
+ }, {
786
+ approve: number;
787
+ reject: number;
788
+ abstain: number;
789
+ }>;
790
+ metadata: z.ZodObject<{
791
+ eventId: z.ZodString;
792
+ timestamp: z.ZodString;
793
+ source: z.ZodString;
794
+ correlationId: z.ZodOptional<z.ZodString>;
795
+ }, "strip", z.ZodTypeAny, {
796
+ source: string;
797
+ timestamp: string;
798
+ eventId: string;
799
+ correlationId?: string | undefined;
800
+ }, {
801
+ source: string;
802
+ timestamp: string;
803
+ eventId: string;
804
+ correlationId?: string | undefined;
805
+ }>;
806
+ }, "strip", z.ZodTypeAny, {
807
+ type: "consensus.reached";
808
+ taskId: string;
809
+ metadata: {
810
+ source: string;
811
+ timestamp: string;
812
+ eventId: string;
813
+ correlationId?: string | undefined;
814
+ };
815
+ decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
816
+ threshold: "UNANIMITY" | "MAJORITY";
817
+ votes: {
818
+ approve: number;
819
+ reject: number;
820
+ abstain: number;
821
+ };
822
+ }, {
823
+ type: "consensus.reached";
824
+ taskId: string;
825
+ metadata: {
826
+ source: string;
827
+ timestamp: string;
828
+ eventId: string;
829
+ correlationId?: string | undefined;
830
+ };
831
+ decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
832
+ threshold: "UNANIMITY" | "MAJORITY";
833
+ votes: {
834
+ approve: number;
835
+ reject: number;
836
+ abstain: number;
837
+ };
838
+ }>, z.ZodObject<{
839
+ type: z.ZodLiteral<"pattern.detected">;
840
+ patternId: z.ZodString;
841
+ occurrences: z.ZodNumber;
842
+ files: z.ZodArray<z.ZodString, "many">;
843
+ severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
844
+ autoImprove: z.ZodBoolean;
845
+ metadata: z.ZodObject<{
846
+ eventId: z.ZodString;
847
+ timestamp: z.ZodString;
848
+ source: z.ZodString;
849
+ correlationId: z.ZodOptional<z.ZodString>;
850
+ }, "strip", z.ZodTypeAny, {
851
+ source: string;
852
+ timestamp: string;
853
+ eventId: string;
854
+ correlationId?: string | undefined;
855
+ }, {
856
+ source: string;
857
+ timestamp: string;
858
+ eventId: string;
859
+ correlationId?: string | undefined;
860
+ }>;
861
+ }, "strip", z.ZodTypeAny, {
862
+ type: "pattern.detected";
863
+ patternId: string;
864
+ occurrences: number;
865
+ files: string[];
866
+ severity: "critical" | "high" | "medium" | "low";
867
+ metadata: {
868
+ source: string;
869
+ timestamp: string;
870
+ eventId: string;
871
+ correlationId?: string | undefined;
872
+ };
873
+ autoImprove: boolean;
874
+ }, {
875
+ type: "pattern.detected";
876
+ patternId: string;
877
+ occurrences: number;
878
+ files: string[];
879
+ severity: "critical" | "high" | "medium" | "low";
880
+ metadata: {
881
+ source: string;
882
+ timestamp: string;
883
+ eventId: string;
884
+ correlationId?: string | undefined;
885
+ };
886
+ autoImprove: boolean;
887
+ }>, z.ZodObject<{
888
+ type: z.ZodLiteral<"memory.created">;
889
+ memoryId: z.ZodString;
890
+ domain: z.ZodString;
891
+ title: z.ZodString;
892
+ metadata: z.ZodObject<{
893
+ eventId: z.ZodString;
894
+ timestamp: z.ZodString;
895
+ source: z.ZodString;
896
+ correlationId: z.ZodOptional<z.ZodString>;
897
+ }, "strip", z.ZodTypeAny, {
898
+ source: string;
899
+ timestamp: string;
900
+ eventId: string;
901
+ correlationId?: string | undefined;
902
+ }, {
903
+ source: string;
904
+ timestamp: string;
905
+ eventId: string;
906
+ correlationId?: string | undefined;
907
+ }>;
908
+ }, "strip", z.ZodTypeAny, {
909
+ title: string;
910
+ domain: string;
911
+ type: "memory.created";
912
+ metadata: {
913
+ source: string;
914
+ timestamp: string;
915
+ eventId: string;
916
+ correlationId?: string | undefined;
917
+ };
918
+ memoryId: string;
919
+ }, {
920
+ title: string;
921
+ domain: string;
922
+ type: "memory.created";
923
+ metadata: {
924
+ source: string;
925
+ timestamp: string;
926
+ eventId: string;
927
+ correlationId?: string | undefined;
928
+ };
929
+ memoryId: string;
930
+ }>, z.ZodObject<{
931
+ type: z.ZodLiteral<"memory.accessed">;
932
+ memoryId: z.ZodString;
933
+ context: z.ZodOptional<z.ZodString>;
934
+ metadata: z.ZodObject<{
935
+ eventId: z.ZodString;
936
+ timestamp: z.ZodString;
937
+ source: z.ZodString;
938
+ correlationId: z.ZodOptional<z.ZodString>;
939
+ }, "strip", z.ZodTypeAny, {
940
+ source: string;
941
+ timestamp: string;
942
+ eventId: string;
943
+ correlationId?: string | undefined;
944
+ }, {
945
+ source: string;
946
+ timestamp: string;
947
+ eventId: string;
948
+ correlationId?: string | undefined;
949
+ }>;
950
+ }, "strip", z.ZodTypeAny, {
951
+ type: "memory.accessed";
952
+ metadata: {
953
+ source: string;
954
+ timestamp: string;
955
+ eventId: string;
956
+ correlationId?: string | undefined;
957
+ };
958
+ memoryId: string;
959
+ context?: string | undefined;
960
+ }, {
961
+ type: "memory.accessed";
962
+ metadata: {
963
+ source: string;
964
+ timestamp: string;
965
+ eventId: string;
966
+ correlationId?: string | undefined;
967
+ };
968
+ memoryId: string;
969
+ context?: string | undefined;
970
+ }>]>;
971
+ export type Event = z.infer<typeof EventSchema>;
972
+ export type TaskNeedsReviewEvent = z.infer<typeof TaskNeedsReviewEventSchema>;
973
+ export type TaskReviewedEvent = z.infer<typeof TaskReviewedEventSchema>;
974
+ export type TaskCompletedEvent = z.infer<typeof TaskCompletedEventSchema>;
975
+ export type ExpertVoteSubmittedEvent = z.infer<typeof ExpertVoteSubmittedEventSchema>;
976
+ export type ExpertRecommendationEvent = z.infer<typeof ExpertRecommendationEventSchema>;
977
+ export type ConsensusReachedEvent = z.infer<typeof ConsensusReachedEventSchema>;
978
+ export type PatternDetectedEvent = z.infer<typeof PatternDetectedEventSchema>;
979
+ export type MemoryCreatedEvent = z.infer<typeof MemoryCreatedEventSchema>;
980
+ export type MemoryAccessedEvent = z.infer<typeof MemoryAccessedEventSchema>;
981
+ export type EventType = Event['type'];
982
+ export type EventHandler<T extends Event = Event> = (event: T) => Promise<void> | void;
983
+ export type EventHandlerMap = {
984
+ [K in EventType]?: EventHandler<Extract<Event, {
985
+ type: K;
986
+ }>>[];
987
+ };
988
+ export declare function createEventMetadata(source: string, correlationId?: string): EventMetadata;
989
+ //# sourceMappingURL=types.d.ts.map