cmp-standards 2.0.1 → 2.6.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 (167) hide show
  1. package/README.md +633 -541
  2. package/dist/cli/index.js +239 -7
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/dashboard/server.d.ts.map +1 -1
  5. package/dist/dashboard/server.js +203 -39
  6. package/dist/dashboard/server.js.map +1 -1
  7. package/dist/db/cloud.d.ts +174 -0
  8. package/dist/db/cloud.d.ts.map +1 -0
  9. package/dist/db/cloud.js +241 -0
  10. package/dist/db/cloud.js.map +1 -0
  11. package/dist/db/drizzle-client.d.ts +3 -3
  12. package/dist/db/drizzle-client.d.ts.map +1 -1
  13. package/dist/db/drizzle-client.js +57 -58
  14. package/dist/db/drizzle-client.js.map +1 -1
  15. package/dist/db/errors.d.ts +76 -0
  16. package/dist/db/errors.d.ts.map +1 -0
  17. package/dist/db/errors.js +135 -0
  18. package/dist/db/errors.js.map +1 -0
  19. package/dist/db/turso-client.d.ts +178 -0
  20. package/dist/db/turso-client.d.ts.map +1 -0
  21. package/dist/db/turso-client.js +455 -0
  22. package/dist/db/turso-client.js.map +1 -0
  23. package/dist/db/upstash-client.d.ts +161 -0
  24. package/dist/db/upstash-client.d.ts.map +1 -0
  25. package/dist/db/upstash-client.js +325 -0
  26. package/dist/db/upstash-client.js.map +1 -0
  27. package/dist/eslint/rules/no-async-useeffect.js +6 -6
  28. package/dist/hooks/cloud-post-tool-use.d.ts +30 -0
  29. package/dist/hooks/cloud-post-tool-use.d.ts.map +1 -0
  30. package/dist/hooks/cloud-post-tool-use.js +116 -0
  31. package/dist/hooks/cloud-post-tool-use.js.map +1 -0
  32. package/dist/hooks/cloud-pre-tool-use.d.ts +19 -0
  33. package/dist/hooks/cloud-pre-tool-use.d.ts.map +1 -0
  34. package/dist/hooks/cloud-pre-tool-use.js +149 -0
  35. package/dist/hooks/cloud-pre-tool-use.js.map +1 -0
  36. package/dist/hooks/cloud-session-start.d.ts +32 -0
  37. package/dist/hooks/cloud-session-start.d.ts.map +1 -0
  38. package/dist/hooks/cloud-session-start.js +257 -0
  39. package/dist/hooks/cloud-session-start.js.map +1 -0
  40. package/dist/hooks/index.d.ts +3 -0
  41. package/dist/hooks/index.d.ts.map +1 -1
  42. package/dist/hooks/index.js +5 -0
  43. package/dist/hooks/index.js.map +1 -1
  44. package/dist/hooks/memory-checkpoint.d.ts.map +1 -1
  45. package/dist/hooks/memory-checkpoint.js +12 -20
  46. package/dist/hooks/memory-checkpoint.js.map +1 -1
  47. package/dist/hooks/pre-tool-use.d.ts +2 -8
  48. package/dist/hooks/pre-tool-use.d.ts.map +1 -1
  49. package/dist/hooks/pre-tool-use.js +7 -106
  50. package/dist/hooks/pre-tool-use.js.map +1 -1
  51. package/dist/hooks/session-start.d.ts +2 -1
  52. package/dist/hooks/session-start.d.ts.map +1 -1
  53. package/dist/hooks/session-start.js +111 -77
  54. package/dist/hooks/session-start.js.map +1 -1
  55. package/dist/index.d.ts +14 -0
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +18 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/mcp/server.d.ts.map +1 -1
  60. package/dist/mcp/server.js +225 -2
  61. package/dist/mcp/server.js.map +1 -1
  62. package/dist/schema/plans.d.ts +194 -0
  63. package/dist/schema/plans.d.ts.map +1 -0
  64. package/dist/schema/plans.js +180 -0
  65. package/dist/schema/plans.js.map +1 -0
  66. package/dist/schema/tracking.d.ts +644 -0
  67. package/dist/schema/tracking.d.ts.map +1 -0
  68. package/dist/schema/tracking.js +204 -0
  69. package/dist/schema/tracking.js.map +1 -0
  70. package/dist/services/ContextGenerator.d.ts +16 -0
  71. package/dist/services/ContextGenerator.d.ts.map +1 -0
  72. package/dist/services/ContextGenerator.js +62 -0
  73. package/dist/services/ContextGenerator.js.map +1 -0
  74. package/dist/services/PlanManager.d.ts +99 -0
  75. package/dist/services/PlanManager.d.ts.map +1 -0
  76. package/dist/services/PlanManager.js +372 -0
  77. package/dist/services/PlanManager.js.map +1 -0
  78. package/dist/services/ProjectScaffold.d.ts.map +1 -1
  79. package/dist/services/ProjectScaffold.js +109 -81
  80. package/dist/services/ProjectScaffold.js.map +1 -1
  81. package/dist/services/TaskTracker.d.ts +1 -1
  82. package/dist/services/TaskTracker.d.ts.map +1 -1
  83. package/dist/services/TaskTracker.js +4 -8
  84. package/dist/services/TaskTracker.js.map +1 -1
  85. package/dist/services/WorkPlanManager.d.ts +1 -1
  86. package/dist/services/WorkPlanManager.d.ts.map +1 -1
  87. package/dist/services/WorkPlanManager.js +8 -14
  88. package/dist/services/WorkPlanManager.js.map +1 -1
  89. package/dist/services/auto-inject.d.ts +1 -0
  90. package/dist/services/auto-inject.d.ts.map +1 -1
  91. package/dist/services/auto-inject.js +12 -17
  92. package/dist/services/auto-inject.js.map +1 -1
  93. package/dist/services/context-injector.d.ts +105 -0
  94. package/dist/services/context-injector.d.ts.map +1 -0
  95. package/dist/services/context-injector.js +357 -0
  96. package/dist/services/context-injector.js.map +1 -0
  97. package/dist/services/cross-project-sync.d.ts +2 -0
  98. package/dist/services/cross-project-sync.d.ts.map +1 -1
  99. package/dist/services/cross-project-sync.js +26 -21
  100. package/dist/services/cross-project-sync.js.map +1 -1
  101. package/dist/services/index.d.ts +15 -15
  102. package/dist/services/index.d.ts.map +1 -1
  103. package/dist/services/index.js +18 -20
  104. package/dist/services/index.js.map +1 -1
  105. package/dist/services/memory-consolidation.d.ts.map +1 -1
  106. package/dist/services/memory-consolidation.js +30 -27
  107. package/dist/services/memory-consolidation.js.map +1 -1
  108. package/dist/services/memory-router.d.ts +98 -0
  109. package/dist/services/memory-router.d.ts.map +1 -0
  110. package/dist/services/memory-router.js +373 -0
  111. package/dist/services/memory-router.js.map +1 -0
  112. package/dist/services/pattern-tracker.d.ts +93 -0
  113. package/dist/services/pattern-tracker.d.ts.map +1 -0
  114. package/dist/services/pattern-tracker.js +347 -0
  115. package/dist/services/pattern-tracker.js.map +1 -0
  116. package/dist/services/semantic-search.d.ts +33 -35
  117. package/dist/services/semantic-search.d.ts.map +1 -1
  118. package/dist/services/semantic-search.js +207 -165
  119. package/dist/services/semantic-search.js.map +1 -1
  120. package/dist/utils/env-loader.d.ts +41 -0
  121. package/dist/utils/env-loader.d.ts.map +1 -0
  122. package/dist/utils/env-loader.js +78 -0
  123. package/dist/utils/env-loader.js.map +1 -0
  124. package/dist/utils/git.d.ts +52 -0
  125. package/dist/utils/git.d.ts.map +1 -0
  126. package/dist/utils/git.js +267 -0
  127. package/dist/utils/git.js.map +1 -0
  128. package/dist/utils/paths.d.ts +39 -5
  129. package/dist/utils/paths.d.ts.map +1 -1
  130. package/dist/utils/paths.js +88 -7
  131. package/dist/utils/paths.js.map +1 -1
  132. package/package.json +100 -94
  133. package/standards/README.md +50 -0
  134. package/standards/experts/expert-routing.md +215 -0
  135. package/standards/general/code-quality.md +86 -0
  136. package/standards/general/memory-usage.md +205 -0
  137. package/standards/general/sync-workflow.md +235 -0
  138. package/standards/general/workflow.md +82 -0
  139. package/standards/hooks/mandatory-tracking.md +446 -0
  140. package/standards/infrastructure/cloud-database.md +287 -0
  141. package/standards/mcp/server-design.md +243 -0
  142. package/standards/mcp/tool-patterns.md +354 -0
  143. package/standards/skills/skill-structure.md +286 -0
  144. package/standards/skills/workflow-design.md +323 -0
  145. package/standards/tools/tool-design.md +297 -0
  146. package/templates/agents/architecture-expert.md +61 -61
  147. package/templates/agents/database-expert.md +62 -62
  148. package/templates/agents/documentation-expert.md +57 -57
  149. package/templates/agents/memory-expert.md +88 -88
  150. package/templates/agents/performance-expert.md +61 -61
  151. package/templates/agents/security-expert.md +59 -59
  152. package/templates/agents/ux-expert.md +63 -63
  153. package/templates/agents/worker.md +75 -75
  154. package/templates/ai-skills/SKILL_TEMPLATE.md +55 -55
  155. package/templates/claude-settings.json +72 -0
  156. package/templates/commands/experts.md +138 -138
  157. package/templates/hooks/README.md +158 -158
  158. package/templates/hooks/project.config.json.template +77 -77
  159. package/templates/hooks/settings.local.json.template +57 -57
  160. package/templates/memory-config.json +56 -82
  161. package/templates/memory-config.schema.json +212 -212
  162. package/templates/settings.json +58 -58
  163. package/templates/skills/continue.md +205 -0
  164. package/templates/workflows/business-improvement.md +264 -264
  165. package/templates/workflows/expert-review.md +153 -153
  166. package/templates/workflows/internal-app.md +245 -245
  167. package/templates/workflows/sync-docs.md +187 -187
@@ -0,0 +1,644 @@
1
+ /**
2
+ * @file Schema de tracking para tareas, mejoras y sesiones
3
+ * @description Define los tipos y estructuras para el sistema de tracking obligatorio
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const TaskStatusSchema: z.ZodEnum<["pending", "in_progress", "completed", "blocked"]>;
7
+ export declare const TaskResultSchema: z.ZodEnum<["success", "partial", "blocked"]>;
8
+ export declare const ImprovementSchema: z.ZodObject<{
9
+ id: z.ZodString;
10
+ area: z.ZodString;
11
+ title: z.ZodString;
12
+ description: z.ZodString;
13
+ priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
14
+ effort: z.ZodOptional<z.ZodEnum<["trivial", "small", "medium", "large"]>>;
15
+ detectedAt: z.ZodString;
16
+ detectedBy: z.ZodOptional<z.ZodString>;
17
+ implementedAt: z.ZodOptional<z.ZodString>;
18
+ implementedInTask: z.ZodOptional<z.ZodString>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ id: string;
21
+ priority: "critical" | "high" | "medium" | "low";
22
+ description: string;
23
+ title: string;
24
+ area: string;
25
+ detectedAt: string;
26
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
27
+ detectedBy?: string | undefined;
28
+ implementedAt?: string | undefined;
29
+ implementedInTask?: string | undefined;
30
+ }, {
31
+ id: string;
32
+ priority: "critical" | "high" | "medium" | "low";
33
+ description: string;
34
+ title: string;
35
+ area: string;
36
+ detectedAt: string;
37
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
38
+ detectedBy?: string | undefined;
39
+ implementedAt?: string | undefined;
40
+ implementedInTask?: string | undefined;
41
+ }>;
42
+ export declare const TaskContentSchema: z.ZodObject<{
43
+ title: z.ZodString;
44
+ description: z.ZodOptional<z.ZodString>;
45
+ userRequest: z.ZodString;
46
+ plan: z.ZodArray<z.ZodString, "many">;
47
+ currentStep: z.ZodNumber;
48
+ domain: z.ZodString;
49
+ files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
50
+ sessionId: z.ZodString;
51
+ agentId: z.ZodOptional<z.ZodString>;
52
+ startedAt: z.ZodString;
53
+ lastActivityAt: z.ZodString;
54
+ completedAt: z.ZodOptional<z.ZodString>;
55
+ result: z.ZodOptional<z.ZodEnum<["success", "partial", "blocked"]>>;
56
+ resultNotes: z.ZodOptional<z.ZodString>;
57
+ improvements: z.ZodDefault<z.ZodArray<z.ZodObject<{
58
+ id: z.ZodString;
59
+ area: z.ZodString;
60
+ title: z.ZodString;
61
+ description: z.ZodString;
62
+ priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
63
+ effort: z.ZodOptional<z.ZodEnum<["trivial", "small", "medium", "large"]>>;
64
+ detectedAt: z.ZodString;
65
+ detectedBy: z.ZodOptional<z.ZodString>;
66
+ implementedAt: z.ZodOptional<z.ZodString>;
67
+ implementedInTask: z.ZodOptional<z.ZodString>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ id: string;
70
+ priority: "critical" | "high" | "medium" | "low";
71
+ description: string;
72
+ title: string;
73
+ area: string;
74
+ detectedAt: string;
75
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
76
+ detectedBy?: string | undefined;
77
+ implementedAt?: string | undefined;
78
+ implementedInTask?: string | undefined;
79
+ }, {
80
+ id: string;
81
+ priority: "critical" | "high" | "medium" | "low";
82
+ description: string;
83
+ title: string;
84
+ area: string;
85
+ detectedAt: string;
86
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
87
+ detectedBy?: string | undefined;
88
+ implementedAt?: string | undefined;
89
+ implementedInTask?: string | undefined;
90
+ }>, "many">>;
91
+ lessons: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
92
+ }, "strip", z.ZodTypeAny, {
93
+ title: string;
94
+ files: string[];
95
+ startedAt: string;
96
+ sessionId: string;
97
+ plan: string[];
98
+ improvements: {
99
+ id: string;
100
+ priority: "critical" | "high" | "medium" | "low";
101
+ description: string;
102
+ title: string;
103
+ area: string;
104
+ detectedAt: string;
105
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
106
+ detectedBy?: string | undefined;
107
+ implementedAt?: string | undefined;
108
+ implementedInTask?: string | undefined;
109
+ }[];
110
+ domain: string;
111
+ userRequest: string;
112
+ currentStep: number;
113
+ lastActivityAt: string;
114
+ lessons: string[];
115
+ description?: string | undefined;
116
+ result?: "blocked" | "success" | "partial" | undefined;
117
+ completedAt?: string | undefined;
118
+ agentId?: string | undefined;
119
+ resultNotes?: string | undefined;
120
+ }, {
121
+ title: string;
122
+ startedAt: string;
123
+ sessionId: string;
124
+ plan: string[];
125
+ domain: string;
126
+ userRequest: string;
127
+ currentStep: number;
128
+ lastActivityAt: string;
129
+ description?: string | undefined;
130
+ result?: "blocked" | "success" | "partial" | undefined;
131
+ files?: string[] | undefined;
132
+ completedAt?: string | undefined;
133
+ improvements?: {
134
+ id: string;
135
+ priority: "critical" | "high" | "medium" | "low";
136
+ description: string;
137
+ title: string;
138
+ area: string;
139
+ detectedAt: string;
140
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
141
+ detectedBy?: string | undefined;
142
+ implementedAt?: string | undefined;
143
+ implementedInTask?: string | undefined;
144
+ }[] | undefined;
145
+ agentId?: string | undefined;
146
+ resultNotes?: string | undefined;
147
+ lessons?: string[] | undefined;
148
+ }>;
149
+ export declare const TaskSchema: z.ZodObject<{
150
+ id: z.ZodString;
151
+ type: z.ZodLiteral<"task">;
152
+ status: z.ZodEnum<["pending", "in_progress", "completed", "blocked"]>;
153
+ system: z.ZodString;
154
+ content: z.ZodObject<{
155
+ title: z.ZodString;
156
+ description: z.ZodOptional<z.ZodString>;
157
+ userRequest: z.ZodString;
158
+ plan: z.ZodArray<z.ZodString, "many">;
159
+ currentStep: z.ZodNumber;
160
+ domain: z.ZodString;
161
+ files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
162
+ sessionId: z.ZodString;
163
+ agentId: z.ZodOptional<z.ZodString>;
164
+ startedAt: z.ZodString;
165
+ lastActivityAt: z.ZodString;
166
+ completedAt: z.ZodOptional<z.ZodString>;
167
+ result: z.ZodOptional<z.ZodEnum<["success", "partial", "blocked"]>>;
168
+ resultNotes: z.ZodOptional<z.ZodString>;
169
+ improvements: z.ZodDefault<z.ZodArray<z.ZodObject<{
170
+ id: z.ZodString;
171
+ area: z.ZodString;
172
+ title: z.ZodString;
173
+ description: z.ZodString;
174
+ priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
175
+ effort: z.ZodOptional<z.ZodEnum<["trivial", "small", "medium", "large"]>>;
176
+ detectedAt: z.ZodString;
177
+ detectedBy: z.ZodOptional<z.ZodString>;
178
+ implementedAt: z.ZodOptional<z.ZodString>;
179
+ implementedInTask: z.ZodOptional<z.ZodString>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ id: string;
182
+ priority: "critical" | "high" | "medium" | "low";
183
+ description: string;
184
+ title: string;
185
+ area: string;
186
+ detectedAt: string;
187
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
188
+ detectedBy?: string | undefined;
189
+ implementedAt?: string | undefined;
190
+ implementedInTask?: string | undefined;
191
+ }, {
192
+ id: string;
193
+ priority: "critical" | "high" | "medium" | "low";
194
+ description: string;
195
+ title: string;
196
+ area: string;
197
+ detectedAt: string;
198
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
199
+ detectedBy?: string | undefined;
200
+ implementedAt?: string | undefined;
201
+ implementedInTask?: string | undefined;
202
+ }>, "many">>;
203
+ lessons: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ title: string;
206
+ files: string[];
207
+ startedAt: string;
208
+ sessionId: string;
209
+ plan: string[];
210
+ improvements: {
211
+ id: string;
212
+ priority: "critical" | "high" | "medium" | "low";
213
+ description: string;
214
+ title: string;
215
+ area: string;
216
+ detectedAt: string;
217
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
218
+ detectedBy?: string | undefined;
219
+ implementedAt?: string | undefined;
220
+ implementedInTask?: string | undefined;
221
+ }[];
222
+ domain: string;
223
+ userRequest: string;
224
+ currentStep: number;
225
+ lastActivityAt: string;
226
+ lessons: string[];
227
+ description?: string | undefined;
228
+ result?: "blocked" | "success" | "partial" | undefined;
229
+ completedAt?: string | undefined;
230
+ agentId?: string | undefined;
231
+ resultNotes?: string | undefined;
232
+ }, {
233
+ title: string;
234
+ startedAt: string;
235
+ sessionId: string;
236
+ plan: string[];
237
+ domain: string;
238
+ userRequest: string;
239
+ currentStep: number;
240
+ lastActivityAt: string;
241
+ description?: string | undefined;
242
+ result?: "blocked" | "success" | "partial" | undefined;
243
+ files?: string[] | undefined;
244
+ completedAt?: string | undefined;
245
+ improvements?: {
246
+ id: string;
247
+ priority: "critical" | "high" | "medium" | "low";
248
+ description: string;
249
+ title: string;
250
+ area: string;
251
+ detectedAt: string;
252
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
253
+ detectedBy?: string | undefined;
254
+ implementedAt?: string | undefined;
255
+ implementedInTask?: string | undefined;
256
+ }[] | undefined;
257
+ agentId?: string | undefined;
258
+ resultNotes?: string | undefined;
259
+ lessons?: string[] | undefined;
260
+ }>;
261
+ createdAt: z.ZodString;
262
+ updatedAt: z.ZodString;
263
+ }, "strip", z.ZodTypeAny, {
264
+ system: string;
265
+ id: string;
266
+ type: "task";
267
+ status: "in_progress" | "blocked" | "pending" | "completed";
268
+ content: {
269
+ title: string;
270
+ files: string[];
271
+ startedAt: string;
272
+ sessionId: string;
273
+ plan: string[];
274
+ improvements: {
275
+ id: string;
276
+ priority: "critical" | "high" | "medium" | "low";
277
+ description: string;
278
+ title: string;
279
+ area: string;
280
+ detectedAt: string;
281
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
282
+ detectedBy?: string | undefined;
283
+ implementedAt?: string | undefined;
284
+ implementedInTask?: string | undefined;
285
+ }[];
286
+ domain: string;
287
+ userRequest: string;
288
+ currentStep: number;
289
+ lastActivityAt: string;
290
+ lessons: string[];
291
+ description?: string | undefined;
292
+ result?: "blocked" | "success" | "partial" | undefined;
293
+ completedAt?: string | undefined;
294
+ agentId?: string | undefined;
295
+ resultNotes?: string | undefined;
296
+ };
297
+ createdAt: string;
298
+ updatedAt: string;
299
+ }, {
300
+ system: string;
301
+ id: string;
302
+ type: "task";
303
+ status: "in_progress" | "blocked" | "pending" | "completed";
304
+ content: {
305
+ title: string;
306
+ startedAt: string;
307
+ sessionId: string;
308
+ plan: string[];
309
+ domain: string;
310
+ userRequest: string;
311
+ currentStep: number;
312
+ lastActivityAt: string;
313
+ description?: string | undefined;
314
+ result?: "blocked" | "success" | "partial" | undefined;
315
+ files?: string[] | undefined;
316
+ completedAt?: string | undefined;
317
+ improvements?: {
318
+ id: string;
319
+ priority: "critical" | "high" | "medium" | "low";
320
+ description: string;
321
+ title: string;
322
+ area: string;
323
+ detectedAt: string;
324
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
325
+ detectedBy?: string | undefined;
326
+ implementedAt?: string | undefined;
327
+ implementedInTask?: string | undefined;
328
+ }[] | undefined;
329
+ agentId?: string | undefined;
330
+ resultNotes?: string | undefined;
331
+ lessons?: string[] | undefined;
332
+ };
333
+ createdAt: string;
334
+ updatedAt: string;
335
+ }>;
336
+ export type Task = z.infer<typeof TaskSchema>;
337
+ export type TaskContent = z.infer<typeof TaskContentSchema>;
338
+ export type TaskStatus = z.infer<typeof TaskStatusSchema>;
339
+ export type TaskResult = z.infer<typeof TaskResultSchema>;
340
+ export declare const ImprovementStatusSchema: z.ZodEnum<["pending", "in_progress", "implemented", "rejected", "deferred"]>;
341
+ export declare const ImprovementContentSchema: z.ZodObject<{
342
+ area: z.ZodString;
343
+ title: z.ZodString;
344
+ description: z.ZodString;
345
+ detectedInTask: z.ZodString;
346
+ detectedBy: z.ZodString;
347
+ detectedAt: z.ZodString;
348
+ priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
349
+ effort: z.ZodOptional<z.ZodEnum<["trivial", "small", "medium", "large"]>>;
350
+ implementedAt: z.ZodOptional<z.ZodString>;
351
+ implementedInTask: z.ZodOptional<z.ZodString>;
352
+ implementedBy: z.ZodOptional<z.ZodString>;
353
+ rejectedAt: z.ZodOptional<z.ZodString>;
354
+ rejectedReason: z.ZodOptional<z.ZodString>;
355
+ }, "strip", z.ZodTypeAny, {
356
+ priority: "critical" | "high" | "medium" | "low";
357
+ description: string;
358
+ title: string;
359
+ area: string;
360
+ detectedAt: string;
361
+ detectedBy: string;
362
+ detectedInTask: string;
363
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
364
+ implementedAt?: string | undefined;
365
+ implementedInTask?: string | undefined;
366
+ implementedBy?: string | undefined;
367
+ rejectedAt?: string | undefined;
368
+ rejectedReason?: string | undefined;
369
+ }, {
370
+ priority: "critical" | "high" | "medium" | "low";
371
+ description: string;
372
+ title: string;
373
+ area: string;
374
+ detectedAt: string;
375
+ detectedBy: string;
376
+ detectedInTask: string;
377
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
378
+ implementedAt?: string | undefined;
379
+ implementedInTask?: string | undefined;
380
+ implementedBy?: string | undefined;
381
+ rejectedAt?: string | undefined;
382
+ rejectedReason?: string | undefined;
383
+ }>;
384
+ export declare const ImprovementRecordSchema: z.ZodObject<{
385
+ id: z.ZodString;
386
+ type: z.ZodLiteral<"improvement">;
387
+ status: z.ZodEnum<["pending", "in_progress", "implemented", "rejected", "deferred"]>;
388
+ system: z.ZodString;
389
+ content: z.ZodObject<{
390
+ area: z.ZodString;
391
+ title: z.ZodString;
392
+ description: z.ZodString;
393
+ detectedInTask: z.ZodString;
394
+ detectedBy: z.ZodString;
395
+ detectedAt: z.ZodString;
396
+ priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
397
+ effort: z.ZodOptional<z.ZodEnum<["trivial", "small", "medium", "large"]>>;
398
+ implementedAt: z.ZodOptional<z.ZodString>;
399
+ implementedInTask: z.ZodOptional<z.ZodString>;
400
+ implementedBy: z.ZodOptional<z.ZodString>;
401
+ rejectedAt: z.ZodOptional<z.ZodString>;
402
+ rejectedReason: z.ZodOptional<z.ZodString>;
403
+ }, "strip", z.ZodTypeAny, {
404
+ priority: "critical" | "high" | "medium" | "low";
405
+ description: string;
406
+ title: string;
407
+ area: string;
408
+ detectedAt: string;
409
+ detectedBy: string;
410
+ detectedInTask: string;
411
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
412
+ implementedAt?: string | undefined;
413
+ implementedInTask?: string | undefined;
414
+ implementedBy?: string | undefined;
415
+ rejectedAt?: string | undefined;
416
+ rejectedReason?: string | undefined;
417
+ }, {
418
+ priority: "critical" | "high" | "medium" | "low";
419
+ description: string;
420
+ title: string;
421
+ area: string;
422
+ detectedAt: string;
423
+ detectedBy: string;
424
+ detectedInTask: string;
425
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
426
+ implementedAt?: string | undefined;
427
+ implementedInTask?: string | undefined;
428
+ implementedBy?: string | undefined;
429
+ rejectedAt?: string | undefined;
430
+ rejectedReason?: string | undefined;
431
+ }>;
432
+ createdAt: z.ZodString;
433
+ updatedAt: z.ZodString;
434
+ }, "strip", z.ZodTypeAny, {
435
+ system: string;
436
+ id: string;
437
+ type: "improvement";
438
+ status: "in_progress" | "pending" | "implemented" | "rejected" | "deferred";
439
+ content: {
440
+ priority: "critical" | "high" | "medium" | "low";
441
+ description: string;
442
+ title: string;
443
+ area: string;
444
+ detectedAt: string;
445
+ detectedBy: string;
446
+ detectedInTask: string;
447
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
448
+ implementedAt?: string | undefined;
449
+ implementedInTask?: string | undefined;
450
+ implementedBy?: string | undefined;
451
+ rejectedAt?: string | undefined;
452
+ rejectedReason?: string | undefined;
453
+ };
454
+ createdAt: string;
455
+ updatedAt: string;
456
+ }, {
457
+ system: string;
458
+ id: string;
459
+ type: "improvement";
460
+ status: "in_progress" | "pending" | "implemented" | "rejected" | "deferred";
461
+ content: {
462
+ priority: "critical" | "high" | "medium" | "low";
463
+ description: string;
464
+ title: string;
465
+ area: string;
466
+ detectedAt: string;
467
+ detectedBy: string;
468
+ detectedInTask: string;
469
+ effort?: "medium" | "small" | "large" | "trivial" | undefined;
470
+ implementedAt?: string | undefined;
471
+ implementedInTask?: string | undefined;
472
+ implementedBy?: string | undefined;
473
+ rejectedAt?: string | undefined;
474
+ rejectedReason?: string | undefined;
475
+ };
476
+ createdAt: string;
477
+ updatedAt: string;
478
+ }>;
479
+ export type ImprovementRecord = z.infer<typeof ImprovementRecordSchema>;
480
+ export type ImprovementContent = z.infer<typeof ImprovementContentSchema>;
481
+ export type ImprovementStatus = z.infer<typeof ImprovementStatusSchema>;
482
+ export type Improvement = z.infer<typeof ImprovementSchema>;
483
+ export declare const SessionContentSchema: z.ZodObject<{
484
+ sessionId: z.ZodString;
485
+ userId: z.ZodOptional<z.ZodString>;
486
+ system: z.ZodString;
487
+ projectPath: z.ZodOptional<z.ZodString>;
488
+ ide: z.ZodOptional<z.ZodString>;
489
+ startedAt: z.ZodString;
490
+ lastActivityAt: z.ZodString;
491
+ endedAt: z.ZodOptional<z.ZodString>;
492
+ toolCalls: z.ZodDefault<z.ZodNumber>;
493
+ tasksStarted: z.ZodDefault<z.ZodNumber>;
494
+ tasksCompleted: z.ZodDefault<z.ZodNumber>;
495
+ improvementsDetected: z.ZodDefault<z.ZodNumber>;
496
+ }, "strip", z.ZodTypeAny, {
497
+ system: string;
498
+ startedAt: string;
499
+ sessionId: string;
500
+ toolCalls: number;
501
+ lastActivityAt: string;
502
+ tasksStarted: number;
503
+ tasksCompleted: number;
504
+ improvementsDetected: number;
505
+ endedAt?: string | undefined;
506
+ userId?: string | undefined;
507
+ projectPath?: string | undefined;
508
+ ide?: string | undefined;
509
+ }, {
510
+ system: string;
511
+ startedAt: string;
512
+ sessionId: string;
513
+ lastActivityAt: string;
514
+ endedAt?: string | undefined;
515
+ toolCalls?: number | undefined;
516
+ userId?: string | undefined;
517
+ projectPath?: string | undefined;
518
+ ide?: string | undefined;
519
+ tasksStarted?: number | undefined;
520
+ tasksCompleted?: number | undefined;
521
+ improvementsDetected?: number | undefined;
522
+ }>;
523
+ export declare const SessionSchema: z.ZodObject<{
524
+ id: z.ZodString;
525
+ type: z.ZodLiteral<"session">;
526
+ status: z.ZodEnum<["active", "ended"]>;
527
+ system: z.ZodString;
528
+ content: z.ZodObject<{
529
+ sessionId: z.ZodString;
530
+ userId: z.ZodOptional<z.ZodString>;
531
+ system: z.ZodString;
532
+ projectPath: z.ZodOptional<z.ZodString>;
533
+ ide: z.ZodOptional<z.ZodString>;
534
+ startedAt: z.ZodString;
535
+ lastActivityAt: z.ZodString;
536
+ endedAt: z.ZodOptional<z.ZodString>;
537
+ toolCalls: z.ZodDefault<z.ZodNumber>;
538
+ tasksStarted: z.ZodDefault<z.ZodNumber>;
539
+ tasksCompleted: z.ZodDefault<z.ZodNumber>;
540
+ improvementsDetected: z.ZodDefault<z.ZodNumber>;
541
+ }, "strip", z.ZodTypeAny, {
542
+ system: string;
543
+ startedAt: string;
544
+ sessionId: string;
545
+ toolCalls: number;
546
+ lastActivityAt: string;
547
+ tasksStarted: number;
548
+ tasksCompleted: number;
549
+ improvementsDetected: number;
550
+ endedAt?: string | undefined;
551
+ userId?: string | undefined;
552
+ projectPath?: string | undefined;
553
+ ide?: string | undefined;
554
+ }, {
555
+ system: string;
556
+ startedAt: string;
557
+ sessionId: string;
558
+ lastActivityAt: string;
559
+ endedAt?: string | undefined;
560
+ toolCalls?: number | undefined;
561
+ userId?: string | undefined;
562
+ projectPath?: string | undefined;
563
+ ide?: string | undefined;
564
+ tasksStarted?: number | undefined;
565
+ tasksCompleted?: number | undefined;
566
+ improvementsDetected?: number | undefined;
567
+ }>;
568
+ createdAt: z.ZodString;
569
+ updatedAt: z.ZodString;
570
+ }, "strip", z.ZodTypeAny, {
571
+ system: string;
572
+ id: string;
573
+ type: "session";
574
+ status: "active" | "ended";
575
+ content: {
576
+ system: string;
577
+ startedAt: string;
578
+ sessionId: string;
579
+ toolCalls: number;
580
+ lastActivityAt: string;
581
+ tasksStarted: number;
582
+ tasksCompleted: number;
583
+ improvementsDetected: number;
584
+ endedAt?: string | undefined;
585
+ userId?: string | undefined;
586
+ projectPath?: string | undefined;
587
+ ide?: string | undefined;
588
+ };
589
+ createdAt: string;
590
+ updatedAt: string;
591
+ }, {
592
+ system: string;
593
+ id: string;
594
+ type: "session";
595
+ status: "active" | "ended";
596
+ content: {
597
+ system: string;
598
+ startedAt: string;
599
+ sessionId: string;
600
+ lastActivityAt: string;
601
+ endedAt?: string | undefined;
602
+ toolCalls?: number | undefined;
603
+ userId?: string | undefined;
604
+ projectPath?: string | undefined;
605
+ ide?: string | undefined;
606
+ tasksStarted?: number | undefined;
607
+ tasksCompleted?: number | undefined;
608
+ improvementsDetected?: number | undefined;
609
+ };
610
+ createdAt: string;
611
+ updatedAt: string;
612
+ }>;
613
+ export type Session = z.infer<typeof SessionSchema>;
614
+ export type SessionContent = z.infer<typeof SessionContentSchema>;
615
+ /**
616
+ * Crear una nueva tarea con valores por defecto
617
+ */
618
+ export declare function createTask(system: string, sessionId: string, options: {
619
+ title: string;
620
+ userRequest: string;
621
+ plan: string[];
622
+ domain: string;
623
+ description?: string;
624
+ agentId?: string;
625
+ }): Omit<Task, 'createdAt' | 'updatedAt'>;
626
+ /**
627
+ * Crear una mejora detectada
628
+ */
629
+ export declare function createImprovement(system: string, taskId: string, options: {
630
+ area: string;
631
+ title: string;
632
+ description: string;
633
+ priority: Improvement['priority'];
634
+ effort?: Improvement['effort'];
635
+ detectedBy?: string;
636
+ }): Omit<ImprovementRecord, 'createdAt' | 'updatedAt'>;
637
+ /**
638
+ * Validar que una tarea tiene mejoras antes de completar
639
+ */
640
+ export declare function validateTaskCompletion(task: Task): {
641
+ valid: boolean;
642
+ errors: string[];
643
+ };
644
+ //# sourceMappingURL=tracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/schema/tracking.ts"],"names":[],"mappings":"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"}