@litmers/cursorflow-orchestrator 0.1.20 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/commands/cursorflow-clean.md +19 -0
- package/commands/cursorflow-runs.md +59 -0
- package/commands/cursorflow-stop.md +55 -0
- package/dist/cli/clean.js +171 -0
- package/dist/cli/clean.js.map +1 -1
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.js +1 -1
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/logs.js +83 -42
- package/dist/cli/logs.js.map +1 -1
- package/dist/cli/monitor.d.ts +7 -0
- package/dist/cli/monitor.js +1007 -189
- package/dist/cli/monitor.js.map +1 -1
- package/dist/cli/prepare.js +87 -3
- package/dist/cli/prepare.js.map +1 -1
- package/dist/cli/resume.js +188 -236
- package/dist/cli/resume.js.map +1 -1
- package/dist/cli/run.js +125 -3
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/runs.d.ts +5 -0
- package/dist/cli/runs.js +214 -0
- package/dist/cli/runs.js.map +1 -0
- package/dist/cli/setup-commands.js +0 -0
- package/dist/cli/signal.js +1 -1
- package/dist/cli/signal.js.map +1 -1
- package/dist/cli/stop.d.ts +5 -0
- package/dist/cli/stop.js +215 -0
- package/dist/cli/stop.js.map +1 -0
- package/dist/cli/tasks.d.ts +10 -0
- package/dist/cli/tasks.js +165 -0
- package/dist/cli/tasks.js.map +1 -0
- package/dist/core/auto-recovery.d.ts +212 -0
- package/dist/core/auto-recovery.js +737 -0
- package/dist/core/auto-recovery.js.map +1 -0
- package/dist/core/failure-policy.d.ts +156 -0
- package/dist/core/failure-policy.js +488 -0
- package/dist/core/failure-policy.js.map +1 -0
- package/dist/core/orchestrator.d.ts +15 -2
- package/dist/core/orchestrator.js +397 -15
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/reviewer.d.ts +2 -0
- package/dist/core/reviewer.js +2 -0
- package/dist/core/reviewer.js.map +1 -1
- package/dist/core/runner.d.ts +33 -10
- package/dist/core/runner.js +321 -146
- package/dist/core/runner.js.map +1 -1
- package/dist/services/logging/buffer.d.ts +67 -0
- package/dist/services/logging/buffer.js +309 -0
- package/dist/services/logging/buffer.js.map +1 -0
- package/dist/services/logging/console.d.ts +89 -0
- package/dist/services/logging/console.js +169 -0
- package/dist/services/logging/console.js.map +1 -0
- package/dist/services/logging/file-writer.d.ts +71 -0
- package/dist/services/logging/file-writer.js +516 -0
- package/dist/services/logging/file-writer.js.map +1 -0
- package/dist/services/logging/formatter.d.ts +39 -0
- package/dist/services/logging/formatter.js +227 -0
- package/dist/services/logging/formatter.js.map +1 -0
- package/dist/services/logging/index.d.ts +11 -0
- package/dist/services/logging/index.js +30 -0
- package/dist/services/logging/index.js.map +1 -0
- package/dist/services/logging/parser.d.ts +31 -0
- package/dist/services/logging/parser.js +222 -0
- package/dist/services/logging/parser.js.map +1 -0
- package/dist/services/process/index.d.ts +59 -0
- package/dist/services/process/index.js +257 -0
- package/dist/services/process/index.js.map +1 -0
- package/dist/types/agent.d.ts +20 -0
- package/dist/types/agent.js +6 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/config.d.ts +65 -0
- package/dist/types/config.js +6 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/events.d.ts +125 -0
- package/dist/types/events.js +6 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +37 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/lane.d.ts +43 -0
- package/dist/types/lane.js +6 -0
- package/dist/types/lane.js.map +1 -0
- package/dist/types/logging.d.ts +71 -0
- package/dist/types/logging.js +16 -0
- package/dist/types/logging.js.map +1 -0
- package/dist/types/review.d.ts +17 -0
- package/dist/types/review.js +6 -0
- package/dist/types/review.js.map +1 -0
- package/dist/types/run.d.ts +32 -0
- package/dist/types/run.js +6 -0
- package/dist/types/run.js.map +1 -0
- package/dist/types/task.d.ts +71 -0
- package/dist/types/task.js +6 -0
- package/dist/types/task.js.map +1 -0
- package/dist/ui/components.d.ts +134 -0
- package/dist/ui/components.js +389 -0
- package/dist/ui/components.js.map +1 -0
- package/dist/ui/log-viewer.d.ts +49 -0
- package/dist/ui/log-viewer.js +449 -0
- package/dist/ui/log-viewer.js.map +1 -0
- package/dist/utils/checkpoint.d.ts +87 -0
- package/dist/utils/checkpoint.js +317 -0
- package/dist/utils/checkpoint.js.map +1 -0
- package/dist/utils/config.d.ts +4 -0
- package/dist/utils/config.js +11 -2
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/cursor-agent.js.map +1 -1
- package/dist/utils/dependency.d.ts +74 -0
- package/dist/utils/dependency.js +420 -0
- package/dist/utils/dependency.js.map +1 -0
- package/dist/utils/doctor.js +10 -5
- package/dist/utils/doctor.js.map +1 -1
- package/dist/utils/enhanced-logger.d.ts +10 -33
- package/dist/utils/enhanced-logger.js +94 -9
- package/dist/utils/enhanced-logger.js.map +1 -1
- package/dist/utils/git.d.ts +121 -0
- package/dist/utils/git.js +322 -2
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/health.d.ts +91 -0
- package/dist/utils/health.js +556 -0
- package/dist/utils/health.js.map +1 -0
- package/dist/utils/lock.d.ts +95 -0
- package/dist/utils/lock.js +332 -0
- package/dist/utils/lock.js.map +1 -0
- package/dist/utils/log-buffer.d.ts +17 -0
- package/dist/utils/log-buffer.js +14 -0
- package/dist/utils/log-buffer.js.map +1 -0
- package/dist/utils/log-constants.d.ts +23 -0
- package/dist/utils/log-constants.js +28 -0
- package/dist/utils/log-constants.js.map +1 -0
- package/dist/utils/log-formatter.d.ts +9 -0
- package/dist/utils/log-formatter.js +113 -70
- package/dist/utils/log-formatter.js.map +1 -1
- package/dist/utils/log-service.d.ts +19 -0
- package/dist/utils/log-service.js +47 -0
- package/dist/utils/log-service.js.map +1 -0
- package/dist/utils/logger.d.ts +46 -27
- package/dist/utils/logger.js +82 -60
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/process-manager.d.ts +21 -0
- package/dist/utils/process-manager.js +138 -0
- package/dist/utils/process-manager.js.map +1 -0
- package/dist/utils/retry.d.ts +121 -0
- package/dist/utils/retry.js +374 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/run-service.d.ts +88 -0
- package/dist/utils/run-service.js +412 -0
- package/dist/utils/run-service.js.map +1 -0
- package/dist/utils/state.d.ts +58 -2
- package/dist/utils/state.js +306 -3
- package/dist/utils/state.js.map +1 -1
- package/dist/utils/task-service.d.ts +82 -0
- package/dist/utils/task-service.js +348 -0
- package/dist/utils/task-service.js.map +1 -0
- package/dist/utils/types.d.ts +2 -272
- package/dist/utils/types.js +16 -0
- package/dist/utils/types.js.map +1 -1
- package/package.json +38 -23
- package/scripts/ai-security-check.js +0 -1
- package/scripts/local-security-gate.sh +0 -0
- package/scripts/monitor-lanes.sh +94 -0
- package/scripts/patches/test-cursor-agent.js +0 -1
- package/scripts/release.sh +0 -0
- package/scripts/setup-security.sh +0 -0
- package/scripts/stream-logs.sh +72 -0
- package/scripts/verify-and-fix.sh +0 -0
- package/src/cli/clean.ts +180 -0
- package/src/cli/index.ts +7 -0
- package/src/cli/init.ts +1 -1
- package/src/cli/logs.ts +79 -42
- package/src/cli/monitor.ts +1815 -899
- package/src/cli/prepare.ts +97 -3
- package/src/cli/resume.ts +220 -277
- package/src/cli/run.ts +154 -3
- package/src/cli/runs.ts +212 -0
- package/src/cli/setup-commands.ts +0 -0
- package/src/cli/signal.ts +1 -1
- package/src/cli/stop.ts +209 -0
- package/src/cli/tasks.ts +154 -0
- package/src/core/auto-recovery.ts +909 -0
- package/src/core/failure-policy.ts +592 -0
- package/src/core/orchestrator.ts +1136 -675
- package/src/core/reviewer.ts +4 -0
- package/src/core/runner.ts +1443 -1217
- package/src/services/logging/buffer.ts +326 -0
- package/src/services/logging/console.ts +193 -0
- package/src/services/logging/file-writer.ts +526 -0
- package/src/services/logging/formatter.ts +268 -0
- package/src/services/logging/index.ts +16 -0
- package/src/services/logging/parser.ts +232 -0
- package/src/services/process/index.ts +261 -0
- package/src/types/agent.ts +24 -0
- package/src/types/config.ts +79 -0
- package/src/types/events.ts +156 -0
- package/src/types/index.ts +29 -0
- package/src/types/lane.ts +56 -0
- package/src/types/logging.ts +96 -0
- package/src/types/review.ts +20 -0
- package/src/types/run.ts +37 -0
- package/src/types/task.ts +79 -0
- package/src/ui/components.ts +430 -0
- package/src/ui/log-viewer.ts +485 -0
- package/src/utils/checkpoint.ts +374 -0
- package/src/utils/config.ts +11 -2
- package/src/utils/cursor-agent.ts +1 -1
- package/src/utils/dependency.ts +482 -0
- package/src/utils/doctor.ts +11 -5
- package/src/utils/enhanced-logger.ts +108 -49
- package/src/utils/git.ts +871 -499
- package/src/utils/health.ts +596 -0
- package/src/utils/lock.ts +346 -0
- package/src/utils/log-buffer.ts +28 -0
- package/src/utils/log-constants.ts +26 -0
- package/src/utils/log-formatter.ts +120 -37
- package/src/utils/log-service.ts +49 -0
- package/src/utils/logger.ts +100 -51
- package/src/utils/process-manager.ts +100 -0
- package/src/utils/retry.ts +413 -0
- package/src/utils/run-service.ts +433 -0
- package/src/utils/state.ts +369 -3
- package/src/utils/task-service.ts +370 -0
- package/src/utils/types.ts +2 -315
|
@@ -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,4BAEC;AAKD,kCAeC;AAKD,gCAUC;AAKD,0BAMC;AAKD,kBAEC;AAKD,kBAEC;AA5KD,IAAY,QAKX;AALD,WAAY,QAAQ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+
* 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;
|