@litmers/cursorflow-orchestrator 0.1.18 → 0.1.26

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 (234) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +25 -7
  3. package/commands/cursorflow-clean.md +19 -0
  4. package/commands/cursorflow-runs.md +59 -0
  5. package/commands/cursorflow-stop.md +55 -0
  6. package/dist/cli/clean.js +178 -6
  7. package/dist/cli/clean.js.map +1 -1
  8. package/dist/cli/index.js +12 -1
  9. package/dist/cli/index.js.map +1 -1
  10. package/dist/cli/init.js +8 -7
  11. package/dist/cli/init.js.map +1 -1
  12. package/dist/cli/logs.js +126 -77
  13. package/dist/cli/logs.js.map +1 -1
  14. package/dist/cli/monitor.d.ts +7 -0
  15. package/dist/cli/monitor.js +1021 -202
  16. package/dist/cli/monitor.js.map +1 -1
  17. package/dist/cli/prepare.js +39 -21
  18. package/dist/cli/prepare.js.map +1 -1
  19. package/dist/cli/resume.js +268 -163
  20. package/dist/cli/resume.js.map +1 -1
  21. package/dist/cli/run.js +11 -5
  22. package/dist/cli/run.js.map +1 -1
  23. package/dist/cli/runs.d.ts +5 -0
  24. package/dist/cli/runs.js +214 -0
  25. package/dist/cli/runs.js.map +1 -0
  26. package/dist/cli/setup-commands.js +0 -0
  27. package/dist/cli/signal.js +8 -8
  28. package/dist/cli/signal.js.map +1 -1
  29. package/dist/cli/stop.d.ts +5 -0
  30. package/dist/cli/stop.js +215 -0
  31. package/dist/cli/stop.js.map +1 -0
  32. package/dist/cli/tasks.d.ts +10 -0
  33. package/dist/cli/tasks.js +165 -0
  34. package/dist/cli/tasks.js.map +1 -0
  35. package/dist/core/auto-recovery.d.ts +212 -0
  36. package/dist/core/auto-recovery.js +737 -0
  37. package/dist/core/auto-recovery.js.map +1 -0
  38. package/dist/core/failure-policy.d.ts +156 -0
  39. package/dist/core/failure-policy.js +488 -0
  40. package/dist/core/failure-policy.js.map +1 -0
  41. package/dist/core/orchestrator.d.ts +16 -2
  42. package/dist/core/orchestrator.js +439 -105
  43. package/dist/core/orchestrator.js.map +1 -1
  44. package/dist/core/reviewer.d.ts +2 -0
  45. package/dist/core/reviewer.js +2 -0
  46. package/dist/core/reviewer.js.map +1 -1
  47. package/dist/core/runner.d.ts +33 -10
  48. package/dist/core/runner.js +374 -164
  49. package/dist/core/runner.js.map +1 -1
  50. package/dist/services/logging/buffer.d.ts +67 -0
  51. package/dist/services/logging/buffer.js +309 -0
  52. package/dist/services/logging/buffer.js.map +1 -0
  53. package/dist/services/logging/console.d.ts +89 -0
  54. package/dist/services/logging/console.js +169 -0
  55. package/dist/services/logging/console.js.map +1 -0
  56. package/dist/services/logging/file-writer.d.ts +71 -0
  57. package/dist/services/logging/file-writer.js +516 -0
  58. package/dist/services/logging/file-writer.js.map +1 -0
  59. package/dist/services/logging/formatter.d.ts +39 -0
  60. package/dist/services/logging/formatter.js +227 -0
  61. package/dist/services/logging/formatter.js.map +1 -0
  62. package/dist/services/logging/index.d.ts +11 -0
  63. package/dist/services/logging/index.js +30 -0
  64. package/dist/services/logging/index.js.map +1 -0
  65. package/dist/services/logging/parser.d.ts +31 -0
  66. package/dist/services/logging/parser.js +222 -0
  67. package/dist/services/logging/parser.js.map +1 -0
  68. package/dist/services/process/index.d.ts +59 -0
  69. package/dist/services/process/index.js +257 -0
  70. package/dist/services/process/index.js.map +1 -0
  71. package/dist/types/agent.d.ts +20 -0
  72. package/dist/types/agent.js +6 -0
  73. package/dist/types/agent.js.map +1 -0
  74. package/dist/types/config.d.ts +65 -0
  75. package/dist/types/config.js +6 -0
  76. package/dist/types/config.js.map +1 -0
  77. package/dist/types/events.d.ts +125 -0
  78. package/dist/types/events.js +6 -0
  79. package/dist/types/events.js.map +1 -0
  80. package/dist/types/index.d.ts +12 -0
  81. package/dist/types/index.js +37 -0
  82. package/dist/types/index.js.map +1 -0
  83. package/dist/types/lane.d.ts +43 -0
  84. package/dist/types/lane.js +6 -0
  85. package/dist/types/lane.js.map +1 -0
  86. package/dist/types/logging.d.ts +71 -0
  87. package/dist/types/logging.js +16 -0
  88. package/dist/types/logging.js.map +1 -0
  89. package/dist/types/review.d.ts +17 -0
  90. package/dist/types/review.js +6 -0
  91. package/dist/types/review.js.map +1 -0
  92. package/dist/types/run.d.ts +32 -0
  93. package/dist/types/run.js +6 -0
  94. package/dist/types/run.js.map +1 -0
  95. package/dist/types/task.d.ts +71 -0
  96. package/dist/types/task.js +6 -0
  97. package/dist/types/task.js.map +1 -0
  98. package/dist/ui/components.d.ts +134 -0
  99. package/dist/ui/components.js +389 -0
  100. package/dist/ui/components.js.map +1 -0
  101. package/dist/ui/log-viewer.d.ts +49 -0
  102. package/dist/ui/log-viewer.js +449 -0
  103. package/dist/ui/log-viewer.js.map +1 -0
  104. package/dist/utils/checkpoint.d.ts +87 -0
  105. package/dist/utils/checkpoint.js +317 -0
  106. package/dist/utils/checkpoint.js.map +1 -0
  107. package/dist/utils/config.d.ts +4 -0
  108. package/dist/utils/config.js +18 -8
  109. package/dist/utils/config.js.map +1 -1
  110. package/dist/utils/cursor-agent.js.map +1 -1
  111. package/dist/utils/dependency.d.ts +74 -0
  112. package/dist/utils/dependency.js +420 -0
  113. package/dist/utils/dependency.js.map +1 -0
  114. package/dist/utils/doctor.js +17 -11
  115. package/dist/utils/doctor.js.map +1 -1
  116. package/dist/utils/enhanced-logger.d.ts +10 -33
  117. package/dist/utils/enhanced-logger.js +108 -20
  118. package/dist/utils/enhanced-logger.js.map +1 -1
  119. package/dist/utils/git.d.ts +121 -0
  120. package/dist/utils/git.js +484 -11
  121. package/dist/utils/git.js.map +1 -1
  122. package/dist/utils/health.d.ts +91 -0
  123. package/dist/utils/health.js +556 -0
  124. package/dist/utils/health.js.map +1 -0
  125. package/dist/utils/lock.d.ts +95 -0
  126. package/dist/utils/lock.js +332 -0
  127. package/dist/utils/lock.js.map +1 -0
  128. package/dist/utils/log-buffer.d.ts +17 -0
  129. package/dist/utils/log-buffer.js +14 -0
  130. package/dist/utils/log-buffer.js.map +1 -0
  131. package/dist/utils/log-constants.d.ts +23 -0
  132. package/dist/utils/log-constants.js +28 -0
  133. package/dist/utils/log-constants.js.map +1 -0
  134. package/dist/utils/log-formatter.d.ts +25 -0
  135. package/dist/utils/log-formatter.js +237 -0
  136. package/dist/utils/log-formatter.js.map +1 -0
  137. package/dist/utils/log-service.d.ts +19 -0
  138. package/dist/utils/log-service.js +47 -0
  139. package/dist/utils/log-service.js.map +1 -0
  140. package/dist/utils/logger.d.ts +46 -27
  141. package/dist/utils/logger.js +82 -60
  142. package/dist/utils/logger.js.map +1 -1
  143. package/dist/utils/path.d.ts +19 -0
  144. package/dist/utils/path.js +77 -0
  145. package/dist/utils/path.js.map +1 -0
  146. package/dist/utils/process-manager.d.ts +21 -0
  147. package/dist/utils/process-manager.js +138 -0
  148. package/dist/utils/process-manager.js.map +1 -0
  149. package/dist/utils/retry.d.ts +121 -0
  150. package/dist/utils/retry.js +374 -0
  151. package/dist/utils/retry.js.map +1 -0
  152. package/dist/utils/run-service.d.ts +88 -0
  153. package/dist/utils/run-service.js +412 -0
  154. package/dist/utils/run-service.js.map +1 -0
  155. package/dist/utils/state.d.ts +62 -3
  156. package/dist/utils/state.js +317 -11
  157. package/dist/utils/state.js.map +1 -1
  158. package/dist/utils/task-service.d.ts +82 -0
  159. package/dist/utils/task-service.js +348 -0
  160. package/dist/utils/task-service.js.map +1 -0
  161. package/dist/utils/template.d.ts +14 -0
  162. package/dist/utils/template.js +122 -0
  163. package/dist/utils/template.js.map +1 -0
  164. package/dist/utils/types.d.ts +2 -271
  165. package/dist/utils/types.js +16 -0
  166. package/dist/utils/types.js.map +1 -1
  167. package/package.json +38 -23
  168. package/scripts/ai-security-check.js +0 -1
  169. package/scripts/local-security-gate.sh +0 -0
  170. package/scripts/monitor-lanes.sh +94 -0
  171. package/scripts/patches/test-cursor-agent.js +0 -1
  172. package/scripts/release.sh +0 -0
  173. package/scripts/setup-security.sh +0 -0
  174. package/scripts/stream-logs.sh +72 -0
  175. package/scripts/verify-and-fix.sh +0 -0
  176. package/src/cli/clean.ts +187 -6
  177. package/src/cli/index.ts +12 -1
  178. package/src/cli/init.ts +8 -7
  179. package/src/cli/logs.ts +124 -77
  180. package/src/cli/monitor.ts +1815 -898
  181. package/src/cli/prepare.ts +41 -21
  182. package/src/cli/resume.ts +753 -626
  183. package/src/cli/run.ts +12 -5
  184. package/src/cli/runs.ts +212 -0
  185. package/src/cli/setup-commands.ts +0 -0
  186. package/src/cli/signal.ts +8 -7
  187. package/src/cli/stop.ts +209 -0
  188. package/src/cli/tasks.ts +154 -0
  189. package/src/core/auto-recovery.ts +909 -0
  190. package/src/core/failure-policy.ts +592 -0
  191. package/src/core/orchestrator.ts +1131 -704
  192. package/src/core/reviewer.ts +4 -0
  193. package/src/core/runner.ts +444 -180
  194. package/src/services/logging/buffer.ts +326 -0
  195. package/src/services/logging/console.ts +193 -0
  196. package/src/services/logging/file-writer.ts +526 -0
  197. package/src/services/logging/formatter.ts +268 -0
  198. package/src/services/logging/index.ts +16 -0
  199. package/src/services/logging/parser.ts +232 -0
  200. package/src/services/process/index.ts +261 -0
  201. package/src/types/agent.ts +24 -0
  202. package/src/types/config.ts +79 -0
  203. package/src/types/events.ts +156 -0
  204. package/src/types/index.ts +29 -0
  205. package/src/types/lane.ts +56 -0
  206. package/src/types/logging.ts +96 -0
  207. package/src/types/review.ts +20 -0
  208. package/src/types/run.ts +37 -0
  209. package/src/types/task.ts +79 -0
  210. package/src/ui/components.ts +430 -0
  211. package/src/ui/log-viewer.ts +485 -0
  212. package/src/utils/checkpoint.ts +374 -0
  213. package/src/utils/config.ts +18 -8
  214. package/src/utils/cursor-agent.ts +1 -1
  215. package/src/utils/dependency.ts +482 -0
  216. package/src/utils/doctor.ts +18 -11
  217. package/src/utils/enhanced-logger.ts +122 -60
  218. package/src/utils/git.ts +517 -11
  219. package/src/utils/health.ts +596 -0
  220. package/src/utils/lock.ts +346 -0
  221. package/src/utils/log-buffer.ts +28 -0
  222. package/src/utils/log-constants.ts +26 -0
  223. package/src/utils/log-formatter.ts +245 -0
  224. package/src/utils/log-service.ts +49 -0
  225. package/src/utils/logger.ts +100 -51
  226. package/src/utils/path.ts +45 -0
  227. package/src/utils/process-manager.ts +100 -0
  228. package/src/utils/retry.ts +413 -0
  229. package/src/utils/run-service.ts +433 -0
  230. package/src/utils/state.ts +385 -11
  231. package/src/utils/task-service.ts +370 -0
  232. package/src/utils/template.ts +92 -0
  233. package/src/utils/types.ts +2 -314
  234. package/templates/basic.json +21 -0
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Console Logging Utilities
3
+ *
4
+ * Provides formatted console output with colors, timestamps, and context support.
5
+ */
6
+ export declare enum LogLevel {
7
+ error = 0,
8
+ warn = 1,
9
+ info = 2,
10
+ debug = 3
11
+ }
12
+ export declare const COLORS: {
13
+ readonly reset: "\u001B[0m";
14
+ readonly red: "\u001B[31m";
15
+ readonly yellow: "\u001B[33m";
16
+ readonly green: "\u001B[32m";
17
+ readonly blue: "\u001B[34m";
18
+ readonly cyan: "\u001B[36m";
19
+ readonly magenta: "\u001B[35m";
20
+ readonly gray: "\u001B[90m";
21
+ readonly bold: "\u001B[1m";
22
+ readonly white: "\u001B[37m";
23
+ };
24
+ /**
25
+ * Set log level
26
+ */
27
+ export declare function setLogLevel(level: string | number): void;
28
+ /**
29
+ * Get current log level
30
+ */
31
+ export declare function getLogLevel(): number;
32
+ /**
33
+ * Format timestamp as [HH:MM:SS] in local time
34
+ */
35
+ export declare function formatTimestamp(date?: Date): string;
36
+ /**
37
+ * Log options interface for contextual logging
38
+ */
39
+ export interface LogOptions {
40
+ context?: string;
41
+ emoji?: string;
42
+ noTimestamp?: boolean;
43
+ color?: string;
44
+ }
45
+ export declare function error(message: string, options?: LogOptions | string): void;
46
+ export declare function warn(message: string, options?: LogOptions | string): void;
47
+ export declare function info(message: string, options?: LogOptions | string): void;
48
+ export declare function success(message: string, options?: LogOptions | string): void;
49
+ export declare function debug(message: string, options?: LogOptions | string): void;
50
+ export declare function progress(message: string, options?: LogOptions | string): void;
51
+ /**
52
+ * Create a context-bound logger
53
+ */
54
+ export declare function withContext(context: string): {
55
+ error: (message: string, options?: Omit<LogOptions, "context">) => void;
56
+ warn: (message: string, options?: Omit<LogOptions, "context">) => void;
57
+ info: (message: string, options?: Omit<LogOptions, "context">) => void;
58
+ success: (message: string, options?: Omit<LogOptions, "context">) => void;
59
+ debug: (message: string, options?: Omit<LogOptions, "context">) => void;
60
+ progress: (message: string, options?: Omit<LogOptions, "context">) => void;
61
+ };
62
+ /**
63
+ * Lane-specific output
64
+ */
65
+ export declare function laneOutput(laneName: string, message: string, isError?: boolean): void;
66
+ /**
67
+ * Section header
68
+ */
69
+ export declare function section(message: string): void;
70
+ /**
71
+ * Simple log without formatting
72
+ */
73
+ export declare function log(message: string | any): void;
74
+ /**
75
+ * Raw output (no formatting)
76
+ */
77
+ export declare function raw(message: string): void;
78
+ /**
79
+ * Status indicators
80
+ */
81
+ export declare const STATUS: {
82
+ readonly running: "\u001B[34m🔄\u001B[0m";
83
+ readonly done: "\u001B[32m✅\u001B[0m";
84
+ readonly failed: "\u001B[31m❌\u001B[0m";
85
+ readonly warning: "\u001B[33m⚠️\u001B[0m";
86
+ readonly pending: "\u001B[90m⏳\u001B[0m";
87
+ readonly paused: "\u001B[33m⏸️\u001B[0m";
88
+ readonly waiting: "\u001B[90m⏳\u001B[0m";
89
+ };
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ /**
3
+ * Console Logging Utilities
4
+ *
5
+ * Provides formatted console output with colors, timestamps, and context support.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.STATUS = exports.COLORS = exports.LogLevel = void 0;
9
+ exports.setLogLevel = setLogLevel;
10
+ exports.getLogLevel = getLogLevel;
11
+ exports.formatTimestamp = formatTimestamp;
12
+ exports.error = error;
13
+ exports.warn = warn;
14
+ exports.info = info;
15
+ exports.success = success;
16
+ exports.debug = debug;
17
+ exports.progress = progress;
18
+ exports.withContext = withContext;
19
+ exports.laneOutput = laneOutput;
20
+ exports.section = section;
21
+ exports.log = log;
22
+ exports.raw = raw;
23
+ var LogLevel;
24
+ (function (LogLevel) {
25
+ LogLevel[LogLevel["error"] = 0] = "error";
26
+ LogLevel[LogLevel["warn"] = 1] = "warn";
27
+ LogLevel[LogLevel["info"] = 2] = "info";
28
+ LogLevel[LogLevel["debug"] = 3] = "debug";
29
+ })(LogLevel || (exports.LogLevel = LogLevel = {}));
30
+ exports.COLORS = {
31
+ reset: '\x1b[0m',
32
+ red: '\x1b[31m',
33
+ yellow: '\x1b[33m',
34
+ green: '\x1b[32m',
35
+ blue: '\x1b[34m',
36
+ cyan: '\x1b[36m',
37
+ magenta: '\x1b[35m',
38
+ gray: '\x1b[90m',
39
+ bold: '\x1b[1m',
40
+ white: '\x1b[37m',
41
+ };
42
+ let currentLogLevel = LogLevel.info;
43
+ /**
44
+ * Set log level
45
+ */
46
+ function setLogLevel(level) {
47
+ if (typeof level === 'string') {
48
+ currentLogLevel = LogLevel[level] ?? LogLevel.info;
49
+ }
50
+ else {
51
+ currentLogLevel = level;
52
+ }
53
+ }
54
+ /**
55
+ * Get current log level
56
+ */
57
+ function getLogLevel() {
58
+ return currentLogLevel;
59
+ }
60
+ /**
61
+ * Format timestamp as [HH:MM:SS] in local time
62
+ */
63
+ function formatTimestamp(date = new Date()) {
64
+ return date.toLocaleTimeString('en-US', { hour12: false });
65
+ }
66
+ /**
67
+ * Internal log function with color support
68
+ */
69
+ function logWithColor(color, level, message, options = {}) {
70
+ if (LogLevel[level] > currentLogLevel)
71
+ return;
72
+ const { context, emoji = '', noTimestamp = false } = options;
73
+ const timestamp = noTimestamp ? '' : `${exports.COLORS.gray}[${formatTimestamp()}]${exports.COLORS.reset}`;
74
+ const contextPart = context ? ` ${exports.COLORS.magenta}[${context}]${exports.COLORS.reset}` : '';
75
+ const emojiPart = emoji ? `${emoji} ` : '';
76
+ const levelPart = `${color}${level.toUpperCase().padEnd(5)}${exports.COLORS.reset}`;
77
+ const lines = String(message).split('\n');
78
+ const prefix = `${timestamp}${contextPart} ${emojiPart}${levelPart}`;
79
+ for (const line of lines) {
80
+ console.log(`${prefix} ${line}`);
81
+ }
82
+ }
83
+ function normalizeOptions(options, defaultEmoji) {
84
+ if (typeof options === 'string') {
85
+ return { emoji: options };
86
+ }
87
+ return { emoji: defaultEmoji, ...options };
88
+ }
89
+ // Primary logging functions
90
+ function error(message, options) {
91
+ logWithColor(exports.COLORS.red, 'error', message, normalizeOptions(options, '❌'));
92
+ }
93
+ function warn(message, options) {
94
+ logWithColor(exports.COLORS.yellow, 'warn', message, normalizeOptions(options, '⚠️'));
95
+ }
96
+ function info(message, options) {
97
+ logWithColor(exports.COLORS.cyan, 'info', message, normalizeOptions(options, 'ℹ️'));
98
+ }
99
+ function success(message, options) {
100
+ logWithColor(exports.COLORS.green, 'info', message, normalizeOptions(options, '✅'));
101
+ }
102
+ function debug(message, options) {
103
+ logWithColor(exports.COLORS.gray, 'debug', message, normalizeOptions(options, '🔍'));
104
+ }
105
+ function progress(message, options) {
106
+ logWithColor(exports.COLORS.blue, 'info', message, normalizeOptions(options, '🔄'));
107
+ }
108
+ /**
109
+ * Create a context-bound logger
110
+ */
111
+ function withContext(context) {
112
+ return {
113
+ error: (message, options) => error(message, { ...options, context }),
114
+ warn: (message, options) => warn(message, { ...options, context }),
115
+ info: (message, options) => info(message, { ...options, context }),
116
+ success: (message, options) => success(message, { ...options, context }),
117
+ debug: (message, options) => debug(message, { ...options, context }),
118
+ progress: (message, options) => progress(message, { ...options, context }),
119
+ };
120
+ }
121
+ /**
122
+ * Lane-specific output
123
+ */
124
+ function laneOutput(laneName, message, isError = false) {
125
+ const timestamp = `${exports.COLORS.gray}[${formatTimestamp()}]${exports.COLORS.reset}`;
126
+ const laneLabel = `${exports.COLORS.magenta}${laneName.padEnd(10)}${exports.COLORS.reset}`;
127
+ const output = isError ? `${exports.COLORS.red}${message}${exports.COLORS.reset}` : message;
128
+ if (isError) {
129
+ process.stderr.write(`${timestamp} ${laneLabel} ${output}\n`);
130
+ }
131
+ else {
132
+ process.stdout.write(`${timestamp} ${laneLabel} ${output}\n`);
133
+ }
134
+ }
135
+ /**
136
+ * Section header
137
+ */
138
+ function section(message) {
139
+ console.log('');
140
+ console.log(`${exports.COLORS.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${exports.COLORS.reset}`);
141
+ console.log(`${exports.COLORS.cyan} ${message}${exports.COLORS.reset}`);
142
+ console.log(`${exports.COLORS.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${exports.COLORS.reset}`);
143
+ console.log('');
144
+ }
145
+ /**
146
+ * Simple log without formatting
147
+ */
148
+ function log(message) {
149
+ console.log(message);
150
+ }
151
+ /**
152
+ * Raw output (no formatting)
153
+ */
154
+ function raw(message) {
155
+ process.stdout.write(message);
156
+ }
157
+ /**
158
+ * Status indicators
159
+ */
160
+ exports.STATUS = {
161
+ running: `${exports.COLORS.blue}🔄${exports.COLORS.reset}`,
162
+ done: `${exports.COLORS.green}✅${exports.COLORS.reset}`,
163
+ failed: `${exports.COLORS.red}❌${exports.COLORS.reset}`,
164
+ warning: `${exports.COLORS.yellow}⚠️${exports.COLORS.reset}`,
165
+ pending: `${exports.COLORS.gray}⏳${exports.COLORS.reset}`,
166
+ paused: `${exports.COLORS.yellow}⏸️${exports.COLORS.reset}`,
167
+ waiting: `${exports.COLORS.gray}⏳${exports.COLORS.reset}`,
168
+ };
169
+ //# sourceMappingURL=console.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.js","sourceRoot":"","sources":["../../../src/services/logging/console.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA2BH,kCAMC;AAKD,kCAEC;AAKD,0CAEC;AA6CD,sBAEC;AAED,oBAEC;AAED,oBAEC;AAED,0BAEC;AAED,sBAEC;AAED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,CAAC,IAAI,IAAI,cAAM,CAAC,KAAK,EAAE;CACjC,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Log File Writer - Write logs to files with rotation
3
+ *
4
+ * Manages log file writing with support for multiple formats.
5
+ */
6
+ import { Transform, TransformCallback } from 'stream';
7
+ import { LogSession, ParsedMessage } from '../../types/logging';
8
+ import { EnhancedLogConfig } from '../../types/config';
9
+ export declare const DEFAULT_LOG_CONFIG: EnhancedLogConfig;
10
+ /**
11
+ * Transform stream for clean log output
12
+ */
13
+ export declare class CleanLogTransform extends Transform {
14
+ private config;
15
+ private session;
16
+ private buffer;
17
+ constructor(config: EnhancedLogConfig, session: LogSession);
18
+ _transform(chunk: Buffer, _encoding: BufferEncoding, callback: TransformCallback): void;
19
+ _flush(callback: TransformCallback): void;
20
+ private hasTimestamp;
21
+ }
22
+ /**
23
+ * Enhanced Log Manager - Handles all log file operations
24
+ */
25
+ export declare class EnhancedLogManager {
26
+ private config;
27
+ private session;
28
+ private logDir;
29
+ private cleanLogPath;
30
+ private rawLogPath;
31
+ private jsonLogPath;
32
+ private readableLogPath;
33
+ private cleanLogFd;
34
+ private rawLogFd;
35
+ private jsonLogFd;
36
+ private readableLogFd;
37
+ private cleanLogSize;
38
+ private rawLogSize;
39
+ private cleanTransform;
40
+ private streamingParser;
41
+ private lineBuffer;
42
+ private onParsedMessage?;
43
+ constructor(logDir: string, session: LogSession, config?: Partial<EnhancedLogConfig>, onParsedMessage?: (msg: ParsedMessage) => void);
44
+ private initLogFiles;
45
+ private writeSessionHeader;
46
+ private writeReadableMessage;
47
+ private rotateIfNeeded;
48
+ private rotateLog;
49
+ private writeToCleanLog;
50
+ private writeToRawLog;
51
+ private writeJsonEntry;
52
+ writeStdout(data: Buffer | string): void;
53
+ writeStderr(data: Buffer | string): void;
54
+ log(level: 'info' | 'error' | 'debug', message: string, metadata?: Record<string, any>): void;
55
+ section(title: string): void;
56
+ setTask(taskName: string, model?: string): void;
57
+ private isNoise;
58
+ getLogPaths(): {
59
+ clean: string;
60
+ raw?: string;
61
+ json?: string;
62
+ readable: string;
63
+ };
64
+ getFileDescriptors(): {
65
+ stdout: number;
66
+ stderr: number;
67
+ };
68
+ close(): void;
69
+ private formatDuration;
70
+ }
71
+ export declare function createLogManager(laneRunDir: string, laneName: string, config?: Partial<EnhancedLogConfig>, onParsedMessage?: (msg: ParsedMessage) => void): EnhancedLogManager;