gthinking 1.3.0 → 2.1.1

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 (271) hide show
  1. package/.eslintrc.js +34 -0
  2. package/ANALYSIS_SUMMARY.md +363 -0
  3. package/README.md +230 -250
  4. package/dist/analysis/analysis-engine.d.ts +63 -0
  5. package/dist/analysis/analysis-engine.d.ts.map +1 -0
  6. package/dist/analysis/analysis-engine.js +322 -0
  7. package/dist/analysis/analysis-engine.js.map +1 -0
  8. package/dist/core/config.d.ts +1419 -0
  9. package/dist/core/config.d.ts.map +1 -0
  10. package/dist/core/config.js +361 -0
  11. package/dist/core/config.js.map +1 -0
  12. package/dist/core/engine.d.ts +176 -0
  13. package/dist/core/engine.d.ts.map +1 -0
  14. package/dist/core/engine.js +604 -0
  15. package/dist/core/engine.js.map +1 -0
  16. package/dist/core/errors.d.ts +153 -0
  17. package/dist/core/errors.d.ts.map +1 -0
  18. package/dist/core/errors.js +287 -0
  19. package/dist/core/errors.js.map +1 -0
  20. package/dist/core/index.d.ts +7 -0
  21. package/dist/core/index.d.ts.map +1 -0
  22. package/dist/{types.js → core/index.js} +8 -4
  23. package/dist/core/index.js.map +1 -0
  24. package/dist/core/pipeline.d.ts +121 -0
  25. package/dist/core/pipeline.d.ts.map +1 -0
  26. package/dist/core/pipeline.js +289 -0
  27. package/dist/core/pipeline.js.map +1 -0
  28. package/dist/core/rate-limiter.d.ts +58 -0
  29. package/dist/core/rate-limiter.d.ts.map +1 -0
  30. package/dist/core/rate-limiter.js +133 -0
  31. package/dist/core/rate-limiter.js.map +1 -0
  32. package/dist/core/session-manager.d.ts +96 -0
  33. package/dist/core/session-manager.d.ts.map +1 -0
  34. package/dist/core/session-manager.js +223 -0
  35. package/dist/core/session-manager.js.map +1 -0
  36. package/dist/creativity/creativity-engine.d.ts +6 -0
  37. package/dist/creativity/creativity-engine.d.ts.map +1 -0
  38. package/dist/creativity/creativity-engine.js +17 -0
  39. package/dist/creativity/creativity-engine.js.map +1 -0
  40. package/dist/index.d.ts +24 -32
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +130 -104
  43. package/dist/index.js.map +1 -1
  44. package/dist/learning/learning-engine.d.ts +6 -0
  45. package/dist/learning/learning-engine.d.ts.map +1 -0
  46. package/dist/learning/learning-engine.js +17 -0
  47. package/dist/learning/learning-engine.js.map +1 -0
  48. package/dist/llm/index.d.ts +10 -0
  49. package/dist/llm/index.d.ts.map +1 -0
  50. package/dist/llm/index.js +26 -0
  51. package/dist/llm/index.js.map +1 -0
  52. package/dist/llm/llm-service.d.ts +109 -0
  53. package/dist/llm/llm-service.d.ts.map +1 -0
  54. package/dist/llm/llm-service.js +224 -0
  55. package/dist/llm/llm-service.js.map +1 -0
  56. package/dist/llm/providers/base.d.ts +85 -0
  57. package/dist/llm/providers/base.d.ts.map +1 -0
  58. package/dist/llm/providers/base.js +57 -0
  59. package/dist/llm/providers/base.js.map +1 -0
  60. package/dist/llm/providers/cli.d.ts +23 -0
  61. package/dist/llm/providers/cli.d.ts.map +1 -0
  62. package/dist/llm/providers/cli.js +158 -0
  63. package/dist/llm/providers/cli.js.map +1 -0
  64. package/dist/llm/providers/gemini.d.ts +30 -0
  65. package/dist/llm/providers/gemini.d.ts.map +1 -0
  66. package/dist/llm/providers/gemini.js +168 -0
  67. package/dist/llm/providers/gemini.js.map +1 -0
  68. package/dist/llm/sanitization.d.ts +50 -0
  69. package/dist/llm/sanitization.d.ts.map +1 -0
  70. package/dist/llm/sanitization.js +149 -0
  71. package/dist/llm/sanitization.js.map +1 -0
  72. package/dist/{server.d.ts.map → mcp/server.d.ts.map} +1 -1
  73. package/dist/mcp/server.js +108 -0
  74. package/dist/mcp/server.js.map +1 -0
  75. package/dist/planning/planning-engine.d.ts +6 -0
  76. package/dist/planning/planning-engine.d.ts.map +1 -0
  77. package/dist/planning/planning-engine.js +17 -0
  78. package/dist/planning/planning-engine.js.map +1 -0
  79. package/dist/reasoning/reasoning-engine.d.ts +6 -0
  80. package/dist/reasoning/reasoning-engine.d.ts.map +1 -0
  81. package/dist/reasoning/reasoning-engine.js +17 -0
  82. package/dist/reasoning/reasoning-engine.js.map +1 -0
  83. package/dist/search/search-engine.d.ts +99 -0
  84. package/dist/search/search-engine.d.ts.map +1 -0
  85. package/dist/search/search-engine.js +271 -0
  86. package/dist/search/search-engine.js.map +1 -0
  87. package/dist/synthesis/synthesis-engine.d.ts +6 -0
  88. package/dist/synthesis/synthesis-engine.d.ts.map +1 -0
  89. package/dist/synthesis/synthesis-engine.js +17 -0
  90. package/dist/synthesis/synthesis-engine.js.map +1 -0
  91. package/dist/types/analysis.d.ts +1534 -49
  92. package/dist/types/analysis.d.ts.map +1 -1
  93. package/dist/types/analysis.js +250 -0
  94. package/dist/types/analysis.js.map +1 -1
  95. package/dist/types/core.d.ts +257 -30
  96. package/dist/types/core.d.ts.map +1 -1
  97. package/dist/types/core.js +148 -18
  98. package/dist/types/core.js.map +1 -1
  99. package/dist/types/creativity.d.ts +2871 -56
  100. package/dist/types/creativity.d.ts.map +1 -1
  101. package/dist/types/creativity.js +195 -0
  102. package/dist/types/creativity.js.map +1 -1
  103. package/dist/types/index.d.ts +6 -2
  104. package/dist/types/index.d.ts.map +1 -1
  105. package/dist/types/index.js +17 -2
  106. package/dist/types/index.js.map +1 -1
  107. package/dist/types/learning.d.ts +851 -61
  108. package/dist/types/learning.d.ts.map +1 -1
  109. package/dist/types/learning.js +155 -0
  110. package/dist/types/learning.js.map +1 -1
  111. package/dist/types/planning.d.ts +2223 -71
  112. package/dist/types/planning.d.ts.map +1 -1
  113. package/dist/types/planning.js +190 -0
  114. package/dist/types/planning.js.map +1 -1
  115. package/dist/types/reasoning.d.ts +2209 -72
  116. package/dist/types/reasoning.d.ts.map +1 -1
  117. package/dist/types/reasoning.js +200 -1
  118. package/dist/types/reasoning.js.map +1 -1
  119. package/dist/types/search.d.ts +981 -53
  120. package/dist/types/search.d.ts.map +1 -1
  121. package/dist/types/search.js +137 -0
  122. package/dist/types/search.js.map +1 -1
  123. package/dist/types/synthesis.d.ts +583 -38
  124. package/dist/types/synthesis.d.ts.map +1 -1
  125. package/dist/types/synthesis.js +138 -0
  126. package/dist/types/synthesis.js.map +1 -1
  127. package/dist/utils/cache.d.ts +144 -0
  128. package/dist/utils/cache.d.ts.map +1 -0
  129. package/dist/utils/cache.js +288 -0
  130. package/dist/utils/cache.js.map +1 -0
  131. package/dist/utils/id-generator.d.ts +89 -0
  132. package/dist/utils/id-generator.d.ts.map +1 -0
  133. package/dist/utils/id-generator.js +132 -0
  134. package/dist/utils/id-generator.js.map +1 -0
  135. package/dist/utils/index.d.ts +11 -0
  136. package/dist/utils/index.d.ts.map +1 -0
  137. package/dist/utils/index.js +33 -0
  138. package/dist/utils/index.js.map +1 -0
  139. package/dist/utils/logger.d.ts +142 -0
  140. package/dist/utils/logger.d.ts.map +1 -0
  141. package/dist/utils/logger.js +248 -0
  142. package/dist/utils/logger.js.map +1 -0
  143. package/dist/utils/metrics.d.ts +149 -0
  144. package/dist/utils/metrics.d.ts.map +1 -0
  145. package/dist/utils/metrics.js +296 -0
  146. package/dist/utils/metrics.js.map +1 -0
  147. package/dist/utils/timer.d.ts +7 -0
  148. package/dist/utils/timer.d.ts.map +1 -0
  149. package/dist/utils/timer.js +17 -0
  150. package/dist/utils/timer.js.map +1 -0
  151. package/dist/utils/validation.d.ts +147 -0
  152. package/dist/utils/validation.d.ts.map +1 -0
  153. package/dist/utils/validation.js +275 -0
  154. package/dist/utils/validation.js.map +1 -0
  155. package/docs/API.md +411 -0
  156. package/docs/ARCHITECTURE.md +271 -0
  157. package/docs/CHANGELOG.md +283 -0
  158. package/jest.config.js +28 -0
  159. package/package.json +43 -30
  160. package/src/analysis/analysis-engine.ts +383 -0
  161. package/src/core/config.ts +406 -0
  162. package/src/core/engine.ts +785 -0
  163. package/src/core/errors.ts +349 -0
  164. package/src/core/index.ts +12 -0
  165. package/src/core/pipeline.ts +424 -0
  166. package/src/core/rate-limiter.ts +155 -0
  167. package/src/core/session-manager.ts +269 -0
  168. package/src/creativity/creativity-engine.ts +14 -0
  169. package/src/index.ts +178 -0
  170. package/src/learning/learning-engine.ts +14 -0
  171. package/src/llm/index.ts +10 -0
  172. package/src/llm/llm-service.ts +285 -0
  173. package/src/llm/providers/base.ts +146 -0
  174. package/src/llm/providers/cli.ts +186 -0
  175. package/src/llm/providers/gemini.ts +201 -0
  176. package/src/llm/sanitization.ts +178 -0
  177. package/src/mcp/server.ts +117 -0
  178. package/src/planning/planning-engine.ts +14 -0
  179. package/src/reasoning/reasoning-engine.ts +14 -0
  180. package/src/search/search-engine.ts +333 -0
  181. package/src/synthesis/synthesis-engine.ts +14 -0
  182. package/src/types/analysis.ts +337 -0
  183. package/src/types/core.ts +342 -0
  184. package/src/types/creativity.ts +268 -0
  185. package/src/types/index.ts +31 -0
  186. package/src/types/learning.ts +215 -0
  187. package/src/types/planning.ts +251 -0
  188. package/src/types/reasoning.ts +288 -0
  189. package/src/types/search.ts +192 -0
  190. package/src/types/synthesis.ts +187 -0
  191. package/src/utils/cache.ts +363 -0
  192. package/src/utils/id-generator.ts +135 -0
  193. package/src/utils/index.ts +22 -0
  194. package/src/utils/logger.ts +290 -0
  195. package/src/utils/metrics.ts +380 -0
  196. package/src/utils/timer.ts +15 -0
  197. package/src/utils/validation.ts +297 -0
  198. package/tests/setup.ts +22 -0
  199. package/tests/unit/cache.test.ts +189 -0
  200. package/tests/unit/engine.test.ts +179 -0
  201. package/tests/unit/validation.test.ts +218 -0
  202. package/tsconfig.json +17 -12
  203. package/GEMINI.md +0 -68
  204. package/analysis.ts +0 -1063
  205. package/creativity.ts +0 -1055
  206. package/dist/analysis.d.ts +0 -54
  207. package/dist/analysis.d.ts.map +0 -1
  208. package/dist/analysis.js +0 -866
  209. package/dist/analysis.js.map +0 -1
  210. package/dist/creativity.d.ts +0 -81
  211. package/dist/creativity.d.ts.map +0 -1
  212. package/dist/creativity.js +0 -828
  213. package/dist/creativity.js.map +0 -1
  214. package/dist/engine.d.ts +0 -90
  215. package/dist/engine.d.ts.map +0 -1
  216. package/dist/engine.js +0 -720
  217. package/dist/engine.js.map +0 -1
  218. package/dist/examples.d.ts +0 -7
  219. package/dist/examples.d.ts.map +0 -1
  220. package/dist/examples.js +0 -506
  221. package/dist/examples.js.map +0 -1
  222. package/dist/learning.d.ts +0 -72
  223. package/dist/learning.d.ts.map +0 -1
  224. package/dist/learning.js +0 -615
  225. package/dist/learning.js.map +0 -1
  226. package/dist/llm-service.d.ts +0 -21
  227. package/dist/llm-service.d.ts.map +0 -1
  228. package/dist/llm-service.js +0 -100
  229. package/dist/llm-service.js.map +0 -1
  230. package/dist/planning.d.ts +0 -62
  231. package/dist/planning.d.ts.map +0 -1
  232. package/dist/planning.js +0 -886
  233. package/dist/planning.js.map +0 -1
  234. package/dist/reasoning.d.ts +0 -73
  235. package/dist/reasoning.d.ts.map +0 -1
  236. package/dist/reasoning.js +0 -845
  237. package/dist/reasoning.js.map +0 -1
  238. package/dist/search-discovery.d.ts +0 -73
  239. package/dist/search-discovery.d.ts.map +0 -1
  240. package/dist/search-discovery.js +0 -548
  241. package/dist/search-discovery.js.map +0 -1
  242. package/dist/server.js +0 -113
  243. package/dist/server.js.map +0 -1
  244. package/dist/types/engine.d.ts +0 -55
  245. package/dist/types/engine.d.ts.map +0 -1
  246. package/dist/types/engine.js +0 -3
  247. package/dist/types/engine.js.map +0 -1
  248. package/dist/types.d.ts +0 -6
  249. package/dist/types.d.ts.map +0 -1
  250. package/dist/types.js.map +0 -1
  251. package/engine.ts +0 -1009
  252. package/examples.ts +0 -717
  253. package/index.ts +0 -106
  254. package/learning.ts +0 -779
  255. package/llm-service.ts +0 -120
  256. package/planning.ts +0 -1101
  257. package/reasoning.ts +0 -1079
  258. package/search-discovery.ts +0 -700
  259. package/server.ts +0 -115
  260. package/types/analysis.ts +0 -69
  261. package/types/core.ts +0 -90
  262. package/types/creativity.ts +0 -72
  263. package/types/engine.ts +0 -60
  264. package/types/index.ts +0 -9
  265. package/types/learning.ts +0 -69
  266. package/types/planning.ts +0 -85
  267. package/types/reasoning.ts +0 -92
  268. package/types/search.ts +0 -58
  269. package/types/synthesis.ts +0 -43
  270. package/types.ts +0 -6
  271. /package/dist/{server.d.ts → mcp/server.d.ts} +0 -0
package/dist/planning.js DELETED
@@ -1,886 +0,0 @@
1
- "use strict";
2
- /**
3
- * Planning Module
4
- * Task decomposition, prioritization, resource allocation, and progress tracking
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.planningEngine = exports.PlanningEngine = void 0;
8
- const types_1 = require("./types");
9
- const events_1 = require("events");
10
- class TaskDecompositionEngine {
11
- constructor() {
12
- this.decompositionRules = [
13
- {
14
- pattern: /build|create|develop|implement/i,
15
- subtasks: [
16
- 'Research and requirements gathering',
17
- 'Design and architecture',
18
- 'Implementation',
19
- 'Testing and validation',
20
- 'Deployment'
21
- ],
22
- dependencies: [[], ['0'], ['1'], ['2'], ['3']]
23
- },
24
- {
25
- pattern: /analyze|research|investigate/i,
26
- subtasks: [
27
- 'Define scope and objectives',
28
- 'Gather existing data',
29
- 'Conduct analysis',
30
- 'Document findings',
31
- 'Present recommendations'
32
- ],
33
- dependencies: [[], ['0'], ['1'], ['2'], ['3']]
34
- },
35
- {
36
- pattern: /optimize|improve|enhance/i,
37
- subtasks: [
38
- 'Current state assessment',
39
- 'Identify improvement areas',
40
- 'Design improvements',
41
- 'Implement changes',
42
- 'Measure results'
43
- ],
44
- dependencies: [[], ['0'], ['1'], ['2'], ['3']]
45
- }
46
- ];
47
- }
48
- decompose(goal) {
49
- // Find matching decomposition rule
50
- for (const rule of this.decompositionRules) {
51
- if (rule.pattern.test(goal)) {
52
- return {
53
- subtasks: rule.subtasks,
54
- dependencies: rule.dependencies
55
- };
56
- }
57
- }
58
- // Default decomposition
59
- return {
60
- subtasks: [
61
- 'Understand requirements',
62
- 'Plan approach',
63
- 'Execute plan',
64
- 'Review and validate'
65
- ],
66
- dependencies: [[], ['0'], ['1'], ['2']]
67
- };
68
- }
69
- estimateComplexity(task) {
70
- // Estimate complexity based on keywords
71
- const complexityIndicators = [
72
- { keywords: ['complex', 'difficult', 'challenging', 'advanced'], weight: 0.9 },
73
- { keywords: ['simple', 'easy', 'basic', 'straightforward'], weight: 0.3 },
74
- { keywords: ['research', 'analysis', 'investigation'], weight: 0.7 },
75
- { keywords: ['implement', 'build', 'develop'], weight: 0.8 }
76
- ];
77
- const taskLower = task.toLowerCase();
78
- let complexity = 0.5; // Default
79
- complexityIndicators.forEach(indicator => {
80
- if (indicator.keywords.some(kw => taskLower.includes(kw))) {
81
- complexity = indicator.weight;
82
- }
83
- });
84
- // Adjust based on task length (longer tasks tend to be more complex)
85
- const wordCount = task.split(/\s+/).length;
86
- complexity += Math.min(0.2, wordCount * 0.01);
87
- return Math.min(1, complexity);
88
- }
89
- estimateDuration(task, complexity) {
90
- // Duration in minutes
91
- const baseDuration = 30;
92
- const complexityMultiplier = 1 + complexity * 4; // 1x to 5x
93
- return Math.round(baseDuration * complexityMultiplier);
94
- }
95
- }
96
- class PrioritizationEngine {
97
- constructor() {
98
- this.weights = {
99
- urgency: 0.25,
100
- importance: 0.3,
101
- effort: 0.2,
102
- risk: 0.15,
103
- dependencies: 0.1
104
- };
105
- }
106
- prioritize(tasks) {
107
- const scoredTasks = tasks.map(task => ({
108
- task,
109
- score: this.calculatePriorityScore(task)
110
- }));
111
- return scoredTasks
112
- .sort((a, b) => b.score - a.score)
113
- .map(({ task }) => task);
114
- }
115
- calculatePriorityScore(task) {
116
- const criteria = this.assessCriteria(task);
117
- // Calculate weighted score
118
- let score = 0;
119
- score += criteria.urgency * this.weights.urgency;
120
- score += criteria.importance * this.weights.importance;
121
- score += (1 - criteria.effort) * this.weights.effort; // Lower effort = higher priority
122
- score += (1 - criteria.risk) * this.weights.risk; // Lower risk = higher priority
123
- score += (1 - criteria.dependencies) * this.weights.dependencies; // Fewer deps = higher priority
124
- return score;
125
- }
126
- assessCriteria(task) {
127
- return {
128
- urgency: this.assessUrgency(task),
129
- importance: this.assessImportance(task),
130
- effort: this.assessEffort(task),
131
- risk: this.assessRisk(task),
132
- dependencies: this.assessDependencies(task)
133
- };
134
- }
135
- assessUrgency(task) {
136
- const urgencyKeywords = ['urgent', 'asap', 'immediate', 'critical', 'deadline'];
137
- const taskText = `${task.title} ${task.description}`.toLowerCase();
138
- if (task.priority === types_1.Priority.CRITICAL)
139
- return 1;
140
- if (task.priority === types_1.Priority.HIGH)
141
- return 0.8;
142
- const matches = urgencyKeywords.filter(kw => taskText.includes(kw)).length;
143
- return Math.min(1, matches * 0.3 + (task.priority === types_1.Priority.MEDIUM ? 0.3 : task.priority === types_1.Priority.LOW ? 0.2 : 0.1));
144
- }
145
- assessImportance(task) {
146
- const importanceKeywords = ['essential', 'crucial', 'key', 'important', 'core'];
147
- const taskText = `${task.title} ${task.description}`.toLowerCase();
148
- if (task.tags.includes('critical'))
149
- return 1;
150
- const matches = importanceKeywords.filter(kw => taskText.includes(kw)).length;
151
- return Math.min(1, matches * 0.25 + 0.3);
152
- }
153
- assessEffort(task) {
154
- // Normalize estimated duration (assuming max 8 hours)
155
- return Math.min(1, task.estimatedDuration / 480);
156
- }
157
- assessRisk(task) {
158
- const riskKeywords = ['risk', 'uncertain', 'unknown', 'complex', 'difficult'];
159
- const taskText = `${task.title} ${task.description}`.toLowerCase();
160
- const matches = riskKeywords.filter(kw => taskText.includes(kw)).length;
161
- return Math.min(1, matches * 0.3);
162
- }
163
- assessDependencies(task) {
164
- return Math.min(1, task.dependencies.length / 5);
165
- }
166
- /**
167
- * Calculate critical path
168
- */
169
- calculateCriticalPath(tasks) {
170
- const taskMap = new Map(tasks.map(t => [t.id, t]));
171
- const visited = new Set();
172
- const path = [];
173
- const visit = (taskId, currentPath = []) => {
174
- if (visited.has(taskId))
175
- return 0;
176
- if (currentPath.includes(taskId))
177
- return 0; // Cycle detected
178
- const task = taskMap.get(taskId);
179
- if (!task)
180
- return 0;
181
- let maxPathDuration = task.estimatedDuration;
182
- for (const depId of task.dependencies) {
183
- const depDuration = visit(depId, [...currentPath, taskId]);
184
- maxPathDuration = Math.max(maxPathDuration, task.estimatedDuration + depDuration);
185
- }
186
- visited.add(taskId);
187
- path.push(taskId);
188
- return maxPathDuration;
189
- };
190
- // Find the longest path
191
- let maxDuration = 0;
192
- let criticalPath = [];
193
- for (const task of tasks) {
194
- visited.clear();
195
- path.length = 0;
196
- const duration = visit(task.id);
197
- if (duration > maxDuration) {
198
- maxDuration = duration;
199
- criticalPath = [...path];
200
- }
201
- }
202
- return criticalPath;
203
- }
204
- }
205
- // ============================================================================
206
- // RESOURCE ALLOCATOR
207
- // ============================================================================
208
- class ResourceAllocator {
209
- constructor() {
210
- this.resources = new Map();
211
- }
212
- addResource(resource) {
213
- this.resources.set(resource.id, resource);
214
- }
215
- allocate(tasks) {
216
- const allocation = new Map();
217
- const resourceAvailability = new Map();
218
- // Initialize availability
219
- this.resources.forEach((resource, id) => {
220
- resourceAvailability.set(id, resource.availability);
221
- });
222
- // Allocate resources to tasks
223
- for (const task of tasks) {
224
- const suitableResources = this.findSuitableResources(task);
225
- const allocated = [];
226
- for (const resource of suitableResources) {
227
- const available = resourceAvailability.get(resource.id) || 0;
228
- if (available > 0) {
229
- allocated.push(resource.id);
230
- resourceAvailability.set(resource.id, available - 1);
231
- }
232
- }
233
- allocation.set(task.id, allocated);
234
- }
235
- return allocation;
236
- }
237
- findSuitableResources(task) {
238
- return Array.from(this.resources.values())
239
- .filter(resource => {
240
- // Check if resource skills match task requirements
241
- if (task.tags.length > 0 && resource.skills) {
242
- return task.tags.some(tag => resource.skills.some(skill => skill.toLowerCase().includes(tag.toLowerCase()) ||
243
- tag.toLowerCase().includes(skill.toLowerCase())));
244
- }
245
- return true;
246
- })
247
- .sort((a, b) => b.availability - a.availability);
248
- }
249
- checkOverallocation() {
250
- const overallocations = [];
251
- this.resources.forEach((resource, id) => {
252
- if (resource.availability < 0) {
253
- overallocations.push({
254
- resourceId: id,
255
- overallocation: Math.abs(resource.availability)
256
- });
257
- }
258
- });
259
- return overallocations;
260
- }
261
- getResourceUtilization() {
262
- const utilization = new Map();
263
- this.resources.forEach((resource, id) => {
264
- // Calculate utilization (simplified)
265
- utilization.set(id, 1 - resource.availability);
266
- });
267
- return utilization;
268
- }
269
- }
270
- // ============================================================================
271
- // PROGRESS TRACKER
272
- // ============================================================================
273
- class ProgressTracker {
274
- constructor() {
275
- this.taskHistory = new Map();
276
- }
277
- recordProgress(taskId, status, progress) {
278
- if (!this.taskHistory.has(taskId)) {
279
- this.taskHistory.set(taskId, []);
280
- }
281
- this.taskHistory.get(taskId).push({
282
- timestamp: new Date(),
283
- status,
284
- progress: Math.min(100, Math.max(0, progress))
285
- });
286
- }
287
- getProgress(taskId) {
288
- const history = this.taskHistory.get(taskId);
289
- if (!history || history.length === 0)
290
- return 0;
291
- return history[history.length - 1].progress;
292
- }
293
- calculateVelocity(taskId) {
294
- const history = this.taskHistory.get(taskId);
295
- if (!history || history.length < 2)
296
- return 0;
297
- const first = history[0];
298
- const last = history[history.length - 1];
299
- const timeDiff = last.timestamp.getTime() - first.timestamp.getTime();
300
- const progressDiff = last.progress - first.progress;
301
- return timeDiff > 0 ? (progressDiff / timeDiff) * 3600000 : 0; // Progress per hour
302
- }
303
- predictCompletion(taskId, totalWork) {
304
- const velocity = this.calculateVelocity(taskId);
305
- const currentProgress = this.getProgress(taskId);
306
- if (velocity <= 0 || currentProgress >= 100)
307
- return null;
308
- const remainingWork = totalWork * (1 - currentProgress / 100);
309
- const hoursRemaining = remainingWork / velocity;
310
- return new Date(Date.now() + hoursRemaining * 3600000);
311
- }
312
- getProgressTrend(taskId) {
313
- const history = this.taskHistory.get(taskId);
314
- if (!history || history.length < 3)
315
- return 'stable';
316
- const recent = history.slice(-3);
317
- const velocities = [];
318
- for (let i = 1; i < recent.length; i++) {
319
- const timeDiff = recent[i].timestamp.getTime() - recent[i - 1].timestamp.getTime();
320
- const progressDiff = recent[i].progress - recent[i - 1].progress;
321
- velocities.push(timeDiff > 0 ? progressDiff / timeDiff : 0);
322
- }
323
- const avgVelocity = velocities.reduce((a, b) => a + b, 0) / velocities.length;
324
- const firstVelocity = velocities[0];
325
- if (avgVelocity > firstVelocity * 1.2)
326
- return 'improving';
327
- if (avgVelocity < firstVelocity * 0.8)
328
- return 'declining';
329
- return 'stable';
330
- }
331
- }
332
- // ============================================================================
333
- // RISK ANALYZER
334
- // ============================================================================
335
- class RiskAnalyzer {
336
- constructor() {
337
- this.knownRisks = new Map();
338
- }
339
- analyzeRisks(tasks, resources) {
340
- const risks = [];
341
- // Analyze task-related risks
342
- tasks.forEach(task => {
343
- const taskRisks = this.identifyTaskRisks(task);
344
- risks.push(...taskRisks);
345
- });
346
- // Analyze resource-related risks
347
- const resourceRisks = this.identifyResourceRisks(tasks, resources);
348
- risks.push(...resourceRisks);
349
- // Analyze schedule-related risks
350
- const scheduleRisks = this.identifyScheduleRisks(tasks);
351
- risks.push(...scheduleRisks);
352
- // Sort by risk score (probability * impact)
353
- return risks
354
- .map(risk => ({ ...risk, riskScore: risk.probability * risk.impact }))
355
- .sort((a, b) => b.riskScore - a.riskScore);
356
- }
357
- identifyTaskRisks(task) {
358
- const risks = [];
359
- // Complexity risk
360
- if (task.estimatedDuration > 240) { // > 4 hours
361
- risks.push({
362
- id: `risk_complexity_${task.id}`,
363
- description: `Task "${task.title}" is complex and may take longer than estimated`,
364
- probability: 0.6,
365
- impact: 0.7,
366
- mitigation: 'Break down into smaller subtasks',
367
- status: 'identified'
368
- });
369
- }
370
- // Dependency risk
371
- if (task.dependencies.length > 3) {
372
- risks.push({
373
- id: `risk_deps_${task.id}`,
374
- description: `Task "${task.title}" has many dependencies`,
375
- probability: 0.5,
376
- impact: 0.6,
377
- mitigation: 'Monitor dependencies closely and have backup plans',
378
- status: 'identified'
379
- });
380
- }
381
- // Uncertainty risk
382
- const uncertaintyKeywords = ['unclear', 'unknown', 'uncertain', 'tbd', 'tba'];
383
- const taskText = `${task.title} ${task.description}`.toLowerCase();
384
- if (uncertaintyKeywords.some(kw => taskText.includes(kw))) {
385
- risks.push({
386
- id: `risk_uncertainty_${task.id}`,
387
- description: `Task "${task.title}" has unclear requirements`,
388
- probability: 0.7,
389
- impact: 0.5,
390
- mitigation: 'Clarify requirements before starting',
391
- status: 'identified'
392
- });
393
- }
394
- return risks;
395
- }
396
- identifyResourceRisks(tasks, resources) {
397
- const risks = [];
398
- // Resource availability risk
399
- const totalAvailability = resources.reduce((sum, r) => sum + r.availability, 0);
400
- const totalWork = tasks.reduce((sum, t) => sum + t.estimatedDuration, 0);
401
- if (totalWork > totalAvailability * 480) { // Assuming 8 hours per availability unit
402
- risks.push({
403
- id: 'risk_resource_availability',
404
- description: 'Insufficient resources for planned work',
405
- probability: 0.8,
406
- impact: 0.9,
407
- mitigation: 'Add more resources or extend timeline',
408
- status: 'identified'
409
- });
410
- }
411
- return risks;
412
- }
413
- identifyScheduleRisks(tasks) {
414
- const risks = [];
415
- // Check for tight schedules
416
- const criticalTasks = tasks.filter(t => t.priority === types_1.Priority.CRITICAL);
417
- if (criticalTasks.length > tasks.length * 0.3) {
418
- risks.push({
419
- id: 'risk_tight_schedule',
420
- description: 'Too many critical tasks may lead to schedule slip',
421
- probability: 0.6,
422
- impact: 0.7,
423
- mitigation: 'Re-prioritize and stagger critical tasks',
424
- status: 'identified'
425
- });
426
- }
427
- return risks;
428
- }
429
- updateRiskStatus(riskId, status) {
430
- const risk = this.knownRisks.get(riskId);
431
- if (risk) {
432
- risk.status = status;
433
- }
434
- }
435
- }
436
- // ============================================================================
437
- // MAIN PLANNING ENGINE
438
- // ============================================================================
439
- class PlanningEngine extends events_1.EventEmitter {
440
- constructor() {
441
- super();
442
- this.plans = new Map();
443
- this.decompositionEngine = new TaskDecompositionEngine();
444
- this.prioritizationEngine = new PrioritizationEngine();
445
- this.resourceAllocator = new ResourceAllocator();
446
- this.progressTracker = new ProgressTracker();
447
- this.riskAnalyzer = new RiskAnalyzer();
448
- }
449
- /**
450
- * Dynamically determine the required thinking stages based on the query
451
- */
452
- determineThinkingStages(query) {
453
- const stages = [];
454
- const lowerQuery = query.toLowerCase();
455
- // Always include Analysis and Synthesis
456
- stages.push(types_1.ThinkingStage.ANALYSIS);
457
- // Search needed?
458
- if (lowerQuery.includes('search') ||
459
- lowerQuery.includes('find') ||
460
- lowerQuery.includes('what is') ||
461
- lowerQuery.includes('latest') ||
462
- lowerQuery.includes('research')) {
463
- stages.push(types_1.ThinkingStage.SEARCH);
464
- }
465
- // Reasoning needed? (Default to yes for most queries unless very simple)
466
- if (lowerQuery.includes('why') ||
467
- lowerQuery.includes('how') ||
468
- lowerQuery.includes('compare') ||
469
- lowerQuery.includes('analyze') ||
470
- lowerQuery.includes('reason') ||
471
- stages.length === 1 // If only analysis so far, add reasoning
472
- ) {
473
- stages.push(types_1.ThinkingStage.REASONING);
474
- }
475
- // Creativity needed?
476
- if (lowerQuery.includes('create') ||
477
- lowerQuery.includes('idea') ||
478
- lowerQuery.includes('brainstorm') ||
479
- lowerQuery.includes('innovate') ||
480
- lowerQuery.includes('design') ||
481
- lowerQuery.includes('generate')) {
482
- stages.push(types_1.ThinkingStage.CREATIVITY);
483
- }
484
- // Planning needed?
485
- if (lowerQuery.includes('plan') ||
486
- lowerQuery.includes('roadmap') ||
487
- lowerQuery.includes('schedule') ||
488
- lowerQuery.includes('timeline') ||
489
- lowerQuery.includes('project') ||
490
- lowerQuery.includes('steps to')) {
491
- stages.push(types_1.ThinkingStage.PLANNING);
492
- }
493
- // Ensure logical order
494
- const orderedStages = [];
495
- if (stages.includes(types_1.ThinkingStage.SEARCH))
496
- orderedStages.push(types_1.ThinkingStage.SEARCH);
497
- if (stages.includes(types_1.ThinkingStage.ANALYSIS))
498
- orderedStages.push(types_1.ThinkingStage.ANALYSIS);
499
- if (stages.includes(types_1.ThinkingStage.REASONING))
500
- orderedStages.push(types_1.ThinkingStage.REASONING);
501
- // Learning is usually implicit/config-based, but we can add it if context is key
502
- // stages.push(ThinkingStage.LEARNING);
503
- if (stages.includes(types_1.ThinkingStage.PLANNING))
504
- orderedStages.push(types_1.ThinkingStage.PLANNING);
505
- if (stages.includes(types_1.ThinkingStage.CREATIVITY))
506
- orderedStages.push(types_1.ThinkingStage.CREATIVITY);
507
- // Always synthesis at the end
508
- orderedStages.push(types_1.ThinkingStage.SYNTHESIS);
509
- return orderedStages;
510
- }
511
- /**
512
- * Create a comprehensive plan
513
- */
514
- createPlan(goal, options = {}) {
515
- const planId = this.generateId();
516
- const createdAt = new Date();
517
- this.emit('planning_start', {
518
- id: planId,
519
- stage: types_1.ThinkingStage.PLANNING,
520
- timestamp: createdAt,
521
- data: { goal }
522
- });
523
- // Decompose goal into tasks
524
- const { subtasks, dependencies } = this.decompositionEngine.decompose(goal);
525
- // Create tasks
526
- const tasks = subtasks.map((description, index) => {
527
- const complexity = this.decompositionEngine.estimateComplexity(description);
528
- const duration = this.decompositionEngine.estimateDuration(description, complexity);
529
- return {
530
- id: `task_${planId}_${index}`,
531
- title: description,
532
- description,
533
- priority: this.inferPriority(description, index),
534
- status: types_1.TaskStatus.PENDING,
535
- estimatedDuration: duration,
536
- dependencies: dependencies[index].map(i => `task_${planId}_${i}`),
537
- subtasks: [],
538
- tags: []
539
- };
540
- });
541
- // Prioritize tasks
542
- const prioritizedTasks = this.prioritizationEngine.prioritize(tasks);
543
- // Add resources if provided
544
- if (options.resources) {
545
- options.resources.forEach(r => this.resourceAllocator.addResource(r));
546
- }
547
- // Allocate resources
548
- const resourceAllocation = this.resourceAllocator.allocate(prioritizedTasks);
549
- // Assign resources to tasks
550
- prioritizedTasks.forEach(task => {
551
- const allocated = resourceAllocation.get(task.id) || [];
552
- if (allocated.length > 0) {
553
- task.assignedTo = allocated[0];
554
- }
555
- });
556
- // Create milestones
557
- const milestones = this.createMilestones(prioritizedTasks, goal);
558
- // Create timeline
559
- const timeline = this.createTimeline(prioritizedTasks, milestones, options.deadline);
560
- // Analyze risks
561
- const risks = this.riskAnalyzer.analyzeRisks(prioritizedTasks, options.resources || []);
562
- const plan = {
563
- id: planId,
564
- goal,
565
- tasks: prioritizedTasks,
566
- milestones,
567
- resources: options.resources || [],
568
- timeline,
569
- status: types_1.TaskStatus.PENDING,
570
- createdAt,
571
- updatedAt: createdAt
572
- };
573
- this.plans.set(planId, plan);
574
- this.emit('planning_complete', {
575
- id: planId,
576
- stage: types_1.ThinkingStage.PLANNING,
577
- timestamp: new Date(),
578
- data: {
579
- plan,
580
- taskCount: tasks.length,
581
- riskCount: risks.length
582
- }
583
- });
584
- return plan;
585
- }
586
- /**
587
- * Update task progress
588
- */
589
- updateTaskProgress(planId, taskId, progress, status) {
590
- const plan = this.plans.get(planId);
591
- if (!plan)
592
- throw new Error(`Plan ${planId} not found`);
593
- const task = plan.tasks.find(t => t.id === taskId);
594
- if (!task)
595
- throw new Error(`Task ${taskId} not found`);
596
- const newStatus = status || (progress >= 100 ? types_1.TaskStatus.COMPLETED : progress > 0 ? types_1.TaskStatus.IN_PROGRESS : types_1.TaskStatus.PENDING);
597
- task.status = newStatus;
598
- if (newStatus === types_1.TaskStatus.COMPLETED) {
599
- task.endTime = new Date();
600
- }
601
- else if (newStatus === types_1.TaskStatus.IN_PROGRESS && !task.startTime) {
602
- task.startTime = new Date();
603
- }
604
- this.progressTracker.recordProgress(taskId, newStatus, progress);
605
- // Update plan status
606
- this.updatePlanStatus(plan);
607
- plan.updatedAt = new Date();
608
- this.emit('task_progress', {
609
- id: taskId,
610
- stage: types_1.ThinkingStage.PLANNING,
611
- timestamp: new Date(),
612
- data: { planId, taskId, progress, status: newStatus }
613
- });
614
- }
615
- /**
616
- * Generate progress report
617
- */
618
- generateProgressReport(planId) {
619
- const plan = this.plans.get(planId);
620
- if (!plan)
621
- throw new Error(`Plan ${planId} not found`);
622
- const completedTasks = plan.tasks.filter(t => t.status === types_1.TaskStatus.COMPLETED).length;
623
- const totalTasks = plan.tasks.length;
624
- const overallProgress = totalTasks > 0 ? (completedTasks / totalTasks) * 100 : 0;
625
- // Calculate if on track
626
- const onTrack = this.isOnTrack(plan);
627
- // Get risks
628
- const risks = this.riskAnalyzer.analyzeRisks(plan.tasks, plan.resources);
629
- // Determine next actions
630
- const nextActions = this.determineNextActions(plan);
631
- return {
632
- planId,
633
- timestamp: new Date(),
634
- overallProgress,
635
- completedTasks,
636
- totalTasks,
637
- onTrack,
638
- risks,
639
- nextActions
640
- };
641
- }
642
- /**
643
- * Adjust plan based on changes
644
- */
645
- adjustPlan(planId, changes) {
646
- const plan = this.plans.get(planId);
647
- if (!plan)
648
- throw new Error(`Plan ${planId} not found`);
649
- // Add new tasks
650
- if (changes.addTasks) {
651
- const newTasks = changes.addTasks.map((task, index) => ({
652
- ...task,
653
- id: `task_${planId}_new_${Date.now()}_${index}`
654
- }));
655
- plan.tasks.push(...newTasks);
656
- }
657
- // Remove tasks
658
- if (changes.removeTasks) {
659
- plan.tasks = plan.tasks.filter(t => !changes.removeTasks.includes(t.id));
660
- }
661
- // Update tasks
662
- if (changes.updateTasks) {
663
- changes.updateTasks.forEach(update => {
664
- const task = plan.tasks.find(t => t.id === update.id);
665
- if (task) {
666
- Object.assign(task, update);
667
- }
668
- });
669
- }
670
- // Re-prioritize
671
- plan.tasks = this.prioritizationEngine.prioritize(plan.tasks);
672
- // Update timeline if new deadline
673
- if (changes.newDeadline) {
674
- plan.timeline.endDate = changes.newDeadline;
675
- }
676
- plan.updatedAt = new Date();
677
- this.emit('plan_adjusted', {
678
- id: planId,
679
- stage: types_1.ThinkingStage.PLANNING,
680
- timestamp: new Date(),
681
- data: { changes }
682
- });
683
- return plan;
684
- }
685
- /**
686
- * Get plan by ID
687
- */
688
- getPlan(planId) {
689
- return this.plans.get(planId);
690
- }
691
- /**
692
- * Get all plans
693
- */
694
- getAllPlans() {
695
- return Array.from(this.plans.values());
696
- }
697
- // Private helper methods
698
- generateId() {
699
- return `plan_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
700
- }
701
- inferPriority(description, index) {
702
- const lower = description.toLowerCase();
703
- if (lower.includes('critical') || lower.includes('urgent'))
704
- return types_1.Priority.CRITICAL;
705
- if (lower.includes('important') || lower.includes('key'))
706
- return types_1.Priority.HIGH;
707
- if (index < 2)
708
- return types_1.Priority.HIGH; // First tasks are usually important
709
- if (lower.includes('optional') || lower.includes('nice to have'))
710
- return types_1.Priority.LOW;
711
- return types_1.Priority.MEDIUM;
712
- }
713
- createMilestones(tasks, goal) {
714
- const milestones = [];
715
- const totalTasks = tasks.length;
716
- if (totalTasks >= 3) {
717
- milestones.push({
718
- id: `milestone_${Date.now()}_1`,
719
- title: 'Phase 1 Complete',
720
- description: 'Initial phase completed',
721
- criteria: [`Complete ${Math.ceil(totalTasks * 0.25)} tasks`],
722
- status: types_1.TaskStatus.PENDING
723
- });
724
- }
725
- if (totalTasks >= 5) {
726
- milestones.push({
727
- id: `milestone_${Date.now()}_2`,
728
- title: 'Halfway Point',
729
- description: '50% of tasks completed',
730
- criteria: [`Complete ${Math.ceil(totalTasks * 0.5)} tasks`],
731
- status: types_1.TaskStatus.PENDING
732
- });
733
- }
734
- milestones.push({
735
- id: `milestone_${Date.now()}_final`,
736
- title: 'Goal Achieved',
737
- description: goal,
738
- criteria: ['All tasks completed'],
739
- status: types_1.TaskStatus.PENDING
740
- });
741
- return milestones;
742
- }
743
- createTimeline(tasks, milestones, deadline) {
744
- const startDate = new Date();
745
- const criticalPath = this.prioritizationEngine.calculateCriticalPath(tasks);
746
- // Calculate end date based on tasks
747
- const totalDuration = tasks.reduce((sum, t) => sum + t.estimatedDuration, 0);
748
- const calculatedEndDate = new Date(startDate.getTime() + totalDuration * 60000);
749
- const endDate = deadline || calculatedEndDate;
750
- // Create phases
751
- const phases = this.createPhases(tasks);
752
- return {
753
- startDate,
754
- endDate,
755
- phases,
756
- criticalPath,
757
- buffer: deadline ?
758
- (deadline.getTime() - calculatedEndDate.getTime()) / 60000 :
759
- totalDuration * 0.2 // 20% buffer
760
- };
761
- }
762
- createPhases(tasks) {
763
- const phases = [];
764
- const phaseNames = ['Planning', 'Execution', 'Review'];
765
- const tasksPerPhase = Math.ceil(tasks.length / phaseNames.length);
766
- let currentDate = new Date();
767
- phaseNames.forEach((name, index) => {
768
- const phaseTasks = tasks.slice(index * tasksPerPhase, (index + 1) * tasksPerPhase);
769
- const phaseDuration = phaseTasks.reduce((sum, t) => sum + t.estimatedDuration, 0);
770
- const phase = {
771
- id: `phase_${Date.now()}_${index}`,
772
- name,
773
- startDate: new Date(currentDate),
774
- endDate: new Date(currentDate.getTime() + phaseDuration * 60000),
775
- tasks: phaseTasks.map(t => t.id),
776
- dependencies: index > 0 ? [`phase_${Date.now()}_${index - 1}`] : []
777
- };
778
- phases.push(phase);
779
- currentDate = phase.endDate;
780
- });
781
- return phases;
782
- }
783
- updatePlanStatus(plan) {
784
- const completed = plan.tasks.filter(t => t.status === types_1.TaskStatus.COMPLETED).length;
785
- const inProgress = plan.tasks.filter(t => t.status === types_1.TaskStatus.IN_PROGRESS).length;
786
- const failed = plan.tasks.filter(t => t.status === types_1.TaskStatus.FAILED).length;
787
- if (failed > 0 && failed > plan.tasks.length * 0.3) {
788
- plan.status = types_1.TaskStatus.FAILED;
789
- }
790
- else if (completed === plan.tasks.length) {
791
- plan.status = types_1.TaskStatus.COMPLETED;
792
- }
793
- else if (inProgress > 0 || completed > 0) {
794
- plan.status = types_1.TaskStatus.IN_PROGRESS;
795
- }
796
- }
797
- isOnTrack(plan) {
798
- if (!plan.timeline.endDate)
799
- return true;
800
- const elapsed = Date.now() - plan.timeline.startDate.getTime();
801
- const total = plan.timeline.endDate.getTime() - plan.timeline.startDate.getTime();
802
- const expectedProgress = elapsed / total;
803
- const completedTasks = plan.tasks.filter(t => t.status === types_1.TaskStatus.COMPLETED).length;
804
- const actualProgress = completedTasks / plan.tasks.length;
805
- return actualProgress >= expectedProgress * 0.8; // Allow 20% slack
806
- }
807
- determineNextActions(plan) {
808
- const actions = [];
809
- // Find pending tasks with no incomplete dependencies
810
- const readyTasks = plan.tasks.filter(t => {
811
- if (t.status !== types_1.TaskStatus.PENDING)
812
- return false;
813
- return t.dependencies.every(depId => plan.tasks.find(t => t.id === depId)?.status === types_1.TaskStatus.COMPLETED);
814
- });
815
- if (readyTasks.length > 0) {
816
- actions.push(`Start task: ${readyTasks[0].title}`);
817
- }
818
- // Check for at-risk tasks
819
- const inProgressTasks = plan.tasks.filter(t => t.status === types_1.TaskStatus.IN_PROGRESS);
820
- inProgressTasks.forEach(task => {
821
- const trend = this.progressTracker.getProgressTrend(task.id);
822
- if (trend === 'declining') {
823
- actions.push(`Review task: ${task.title} (progress declining)`);
824
- }
825
- });
826
- return actions;
827
- }
828
- }
829
- exports.PlanningEngine = PlanningEngine;
830
- // ============================================================================
831
- // EXPORT SINGLETON INSTANCE
832
- // ============================================================================
833
- exports.planningEngine = new PlanningEngine();
834
- // ============================================================================
835
- // EXAMPLE USAGE
836
- // ============================================================================
837
- /*
838
- // Create a plan
839
- const plan = planningEngine.createPlan(
840
- 'Build a scalable microservices architecture with AI capabilities',
841
- {
842
- resources: [
843
- {
844
- id: 'dev1',
845
- type: 'human',
846
- name: 'Senior Developer',
847
- availability: 0.8,
848
- skills: ['backend', 'microservices', 'typescript']
849
- },
850
- {
851
- id: 'dev2',
852
- type: 'human',
853
- name: 'ML Engineer',
854
- availability: 0.6,
855
- skills: ['machine_learning', 'python', 'tensorflow']
856
- }
857
- ],
858
- deadline: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000) // 30 days
859
- }
860
- );
861
-
862
- // Update task progress
863
- planningEngine.updateTaskProgress(plan.id, plan.tasks[0].id, 50, TaskStatus.IN_PROGRESS);
864
- planningEngine.updateTaskProgress(plan.id, plan.tasks[0].id, 100, TaskStatus.COMPLETED);
865
-
866
- // Generate progress report
867
- const report = planningEngine.generateProgressReport(plan.id);
868
- console.log(`Progress: ${report.overallProgress}%`);
869
- console.log(`On track: ${report.onTrack}`);
870
- console.log(`Next actions: ${report.nextActions.join(', ')}`);
871
-
872
- // Adjust plan
873
- const adjustedPlan = planningEngine.adjustPlan(plan.id, {
874
- addTasks: [{
875
- title: 'Security audit',
876
- description: 'Perform security review',
877
- priority: Priority.HIGH,
878
- status: TaskStatus.PENDING,
879
- estimatedDuration: 120,
880
- dependencies: [],
881
- subtasks: [],
882
- tags: ['security']
883
- }]
884
- });
885
- */
886
- //# sourceMappingURL=planning.js.map