@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,237 @@
1
+ "use strict";
2
+ /**
3
+ * Utility for formatting log messages for console display
4
+ *
5
+ * Format: [HH:MM:SS] [lane-task] ICON TYPE content
6
+ *
7
+ * Rules:
8
+ * - Box format only for: user, assistant, system, result
9
+ * - Compact format for: tool, tool_result, thinking (gray/dim)
10
+ * - Tool names simplified: ShellToolCall → Shell
11
+ * - Lane labels max 16 chars: [01-types-tests]
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.formatMessageForConsole = formatMessageForConsole;
15
+ exports.formatPotentialJsonMessage = formatPotentialJsonMessage;
16
+ const log_constants_1 = require("./log-constants");
17
+ const enhanced_logger_1 = require("./enhanced-logger");
18
+ // Types that should use box format
19
+ const BOX_TYPES = new Set(['user', 'assistant', 'system', 'result']);
20
+ /**
21
+ * Simplify tool names (ShellToolCall → Shell, etc.)
22
+ */
23
+ function simplifyToolName(name) {
24
+ // Remove common suffixes
25
+ return name
26
+ .replace(/ToolCall$/i, '')
27
+ .replace(/Tool$/i, '')
28
+ .replace(/^run_terminal_cmd$/i, 'shell')
29
+ .replace(/^search_replace$/i, 'edit');
30
+ }
31
+ /**
32
+ * Format a single parsed message into a human-readable string (compact or multi-line)
33
+ */
34
+ function formatMessageForConsole(msg, options = {}) {
35
+ const { includeTimestamp = true, laneLabel = '', compact = false, context = '' } = options;
36
+ const ts = includeTimestamp ? new Date(msg.timestamp).toLocaleTimeString('en-US', { hour12: false }) : '';
37
+ const tsPrefix = ts ? `${log_constants_1.COLORS.gray}[${ts}]${log_constants_1.COLORS.reset} ` : '';
38
+ // Handle context (e.g. from logger.info) - max 16 chars
39
+ const effectiveLaneLabel = laneLabel || (context ? `[${context}]` : '');
40
+ const truncatedLabel = effectiveLaneLabel.length > 16
41
+ ? effectiveLaneLabel.substring(0, 16)
42
+ : effectiveLaneLabel;
43
+ const labelPrefix = truncatedLabel ? `${log_constants_1.COLORS.magenta}${truncatedLabel.padEnd(16)}${log_constants_1.COLORS.reset} ` : '';
44
+ let typePrefix = '';
45
+ let content = msg.content;
46
+ // Determine if we should use box format
47
+ // Box format only for: user, assistant, system, result (and only when not compact)
48
+ const useBox = !compact && BOX_TYPES.has(msg.type);
49
+ // Clean up wrapped prompts for user messages to hide internal instructions
50
+ if (msg.type === 'user') {
51
+ const contextMarker = '### 🛠 Environment & Context';
52
+ const instructionsMarker = '### 📝 Final Instructions';
53
+ if (content.includes(contextMarker)) {
54
+ const parts = content.split('---\n');
55
+ if (parts.length >= 3) {
56
+ content = parts[1].trim();
57
+ }
58
+ else {
59
+ content = content.split(contextMarker).pop() || content;
60
+ content = content.split(instructionsMarker)[0] || content;
61
+ content = content.replace(/^.*---\n/s, '').trim();
62
+ }
63
+ }
64
+ }
65
+ // For thinking: collapse multiple newlines into single space
66
+ if (msg.type === 'thinking') {
67
+ content = content.replace(/\n\s*\n/g, ' ').replace(/\n/g, ' ').trim();
68
+ }
69
+ switch (msg.type) {
70
+ case 'user':
71
+ typePrefix = `${log_constants_1.COLORS.cyan}🧑 USER${log_constants_1.COLORS.reset}`;
72
+ if (!useBox)
73
+ content = content.replace(/\n/g, ' ').substring(0, 100) + (content.length > 100 ? '...' : '');
74
+ break;
75
+ case 'assistant':
76
+ typePrefix = `${log_constants_1.COLORS.green}🤖 ASST${log_constants_1.COLORS.reset}`;
77
+ if (!useBox)
78
+ content = content.replace(/\n/g, ' ').substring(0, 100) + (content.length > 100 ? '...' : '');
79
+ break;
80
+ case 'tool':
81
+ // Tool calls are always compact and gray
82
+ typePrefix = `${log_constants_1.COLORS.gray}🔧 TOOL${log_constants_1.COLORS.reset}`;
83
+ const toolMatch = content.match(/\[Tool: ([^\]]+)\] (.*)/);
84
+ if (toolMatch) {
85
+ const [, rawName, args] = toolMatch;
86
+ const name = simplifyToolName(rawName);
87
+ try {
88
+ const parsedArgs = JSON.parse(args);
89
+ let argStr = '';
90
+ if (rawName === 'read_file' && parsedArgs.target_file) {
91
+ argStr = parsedArgs.target_file;
92
+ }
93
+ else if (rawName === 'run_terminal_cmd' && parsedArgs.command) {
94
+ argStr = parsedArgs.command;
95
+ }
96
+ else if (rawName === 'write' && parsedArgs.file_path) {
97
+ argStr = parsedArgs.file_path;
98
+ }
99
+ else if (rawName === 'search_replace' && parsedArgs.file_path) {
100
+ argStr = parsedArgs.file_path;
101
+ }
102
+ else {
103
+ const keys = Object.keys(parsedArgs);
104
+ if (keys.length > 0) {
105
+ argStr = String(parsedArgs[keys[0]]).substring(0, 50);
106
+ }
107
+ }
108
+ content = `${log_constants_1.COLORS.gray}${name}${log_constants_1.COLORS.reset}(${log_constants_1.COLORS.gray}${argStr}${log_constants_1.COLORS.reset})`;
109
+ }
110
+ catch {
111
+ content = `${log_constants_1.COLORS.gray}${name}${log_constants_1.COLORS.reset}: ${args}`;
112
+ }
113
+ }
114
+ break;
115
+ case 'tool_result':
116
+ // Tool results are always compact and gray
117
+ typePrefix = `${log_constants_1.COLORS.gray}📄 RESL${log_constants_1.COLORS.reset}`;
118
+ const resMatch = content.match(/\[Tool Result: ([^\]]+)\]/);
119
+ if (resMatch) {
120
+ const simpleName = simplifyToolName(resMatch[1]);
121
+ content = `${log_constants_1.COLORS.gray}${simpleName} OK${log_constants_1.COLORS.reset}`;
122
+ }
123
+ else {
124
+ content = `${log_constants_1.COLORS.gray}result${log_constants_1.COLORS.reset}`;
125
+ }
126
+ break;
127
+ case 'result':
128
+ case 'success':
129
+ typePrefix = `${log_constants_1.COLORS.green}✅ DONE${log_constants_1.COLORS.reset}`;
130
+ break;
131
+ case 'system':
132
+ typePrefix = `${log_constants_1.COLORS.gray}⚙️ SYS${log_constants_1.COLORS.reset}`;
133
+ break;
134
+ case 'thinking':
135
+ // Thinking is always compact and gray
136
+ typePrefix = `${log_constants_1.COLORS.gray}🤔 THNK${log_constants_1.COLORS.reset}`;
137
+ content = `${log_constants_1.COLORS.gray}${content.substring(0, 100)}${content.length > 100 ? '...' : ''}${log_constants_1.COLORS.reset}`;
138
+ break;
139
+ case 'info':
140
+ typePrefix = `${log_constants_1.COLORS.cyan}ℹ️ INFO${log_constants_1.COLORS.reset}`;
141
+ break;
142
+ case 'warn':
143
+ typePrefix = `${log_constants_1.COLORS.yellow}⚠️ WARN${log_constants_1.COLORS.reset}`;
144
+ break;
145
+ case 'error':
146
+ typePrefix = `${log_constants_1.COLORS.red}❌ ERR${log_constants_1.COLORS.reset}`;
147
+ break;
148
+ }
149
+ if (!typePrefix)
150
+ return `${tsPrefix}${labelPrefix}${content}`;
151
+ // Compact format (single line)
152
+ if (!useBox) {
153
+ return `${tsPrefix}${labelPrefix}${typePrefix.padEnd(12)} ${content}`;
154
+ }
155
+ // Multi-line box format (only for user, assistant, system, result)
156
+ // Emoji width is 2, so we need to account for that in indent calculation
157
+ const lines = content.split('\n');
158
+ const fullPrefix = `${tsPrefix}${labelPrefix}`;
159
+ const strippedPrefix = (0, enhanced_logger_1.stripAnsi)(typePrefix);
160
+ // Count emojis (they take 2 terminal columns but 1-2 chars in string)
161
+ const emojiCount = (strippedPrefix.match(/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2300}-\u{23FF}]|[\u{2B50}-\u{2B55}]|[\u{231A}-\u{231B}]|[\u{23E9}-\u{23F3}]|[\u{23F8}-\u{23FA}]|✅|❌|⚙️|ℹ️|⚠️|🔧|📄|🤔|🧑|🤖/gu) || []).length;
162
+ const visualWidth = strippedPrefix.length + emojiCount; // emoji adds 1 extra width
163
+ const boxWidth = 60;
164
+ const header = `${typePrefix}┌${'─'.repeat(boxWidth)}`;
165
+ let result = `${fullPrefix}${header}\n`;
166
+ const indent = ' '.repeat(visualWidth);
167
+ for (const line of lines) {
168
+ result += `${fullPrefix}${indent}│ ${line}\n`;
169
+ }
170
+ result += `${fullPrefix}${indent}└${'─'.repeat(boxWidth)}`;
171
+ return result;
172
+ }
173
+ /**
174
+ * Detect and format a message that might be a raw JSON string from cursor-agent
175
+ */
176
+ function formatPotentialJsonMessage(message) {
177
+ const trimmed = message.trim();
178
+ if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) {
179
+ return message;
180
+ }
181
+ try {
182
+ const json = JSON.parse(trimmed);
183
+ if (!json.type)
184
+ return message;
185
+ // Convert JSON to a ParsedMessage-like structure for formatting
186
+ let content;
187
+ let type;
188
+ if (json.type === 'thinking' && json.text) {
189
+ content = json.text;
190
+ type = 'thinking';
191
+ }
192
+ else if (json.type === 'assistant' && json.message?.content) {
193
+ content = json.message.content
194
+ .filter((c) => c.type === 'text')
195
+ .map((c) => c.text)
196
+ .join('');
197
+ type = 'assistant';
198
+ }
199
+ else if (json.type === 'user' && json.message?.content) {
200
+ content = json.message.content
201
+ .filter((c) => c.type === 'text')
202
+ .map((c) => c.text)
203
+ .join('');
204
+ type = 'user';
205
+ }
206
+ else if (json.type === 'tool_call' && json.subtype === 'started') {
207
+ const rawToolName = Object.keys(json.tool_call)[0] || 'unknown';
208
+ const args = json.tool_call[rawToolName]?.args || {};
209
+ // Tool name will be simplified in formatMessageForConsole
210
+ content = `[Tool: ${rawToolName}] ${JSON.stringify(args)}`;
211
+ type = 'tool';
212
+ }
213
+ else if (json.type === 'tool_call' && json.subtype === 'completed') {
214
+ const rawToolName = Object.keys(json.tool_call)[0] || 'unknown';
215
+ content = `[Tool Result: ${rawToolName}]`;
216
+ type = 'tool_result';
217
+ }
218
+ else if (json.type === 'result') {
219
+ content = json.result || 'Task completed';
220
+ type = 'result';
221
+ }
222
+ else {
223
+ // Unknown type, return as is
224
+ return message;
225
+ }
226
+ return formatMessageForConsole({
227
+ type: type,
228
+ role: type,
229
+ content,
230
+ timestamp: json.timestamp_ms || Date.now()
231
+ }, { includeTimestamp: false, compact: true });
232
+ }
233
+ catch {
234
+ return message;
235
+ }
236
+ }
237
+ //# sourceMappingURL=log-formatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-formatter.js","sourceRoot":"","sources":["../../src/utils/log-formatter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAuBH,0DAqJC;AAKD,gEAyDC;AAxOD,mDAAyC;AACzC,uDAA6D;AAE7D,mCAAmC;AACnC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAErE;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAY;IACpC,yBAAyB;IACzB,OAAO,IAAI;SACR,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC;SACvC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB,CACrC,GAAkB,EAClB,UAKI,EAAE;IAEN,MAAM,EAAE,gBAAgB,GAAG,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAC3F,MAAM,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,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,KAAK,WAAW,EAAE,CAAC;YACrE,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;YAChE,OAAO,GAAG,iBAAiB,WAAW,GAAG,CAAC;YAC1C,IAAI,GAAG,aAAa,CAAC;QACvB,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,gBAAgB,CAAC;YAC1C,IAAI,GAAG,QAAQ,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,6BAA6B;YAC7B,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,OAAO,uBAAuB,CAAC;YAC7B,IAAI,EAAE,IAAW;YACjB,IAAI,EAAE,IAAI;YACV,OAAO;YACP,SAAS,EAAE,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,GAAG,EAAE;SAC3C,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAEjD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Log Service - Helpers for log processing and filtering
3
+ */
4
+ import { JsonLogEntry } from './enhanced-logger';
5
+ import { LogImportance } from './types';
6
+ export interface MergedLogEntry extends JsonLogEntry {
7
+ laneName: string;
8
+ laneColor: string;
9
+ }
10
+ export declare class LogService {
11
+ /**
12
+ * Determine importance level of a log entry
13
+ */
14
+ static getLogImportance(entry: JsonLogEntry): LogImportance;
15
+ /**
16
+ * Check if an entry meets the minimum importance level
17
+ */
18
+ static meetsImportanceLevel(entry: JsonLogEntry, minLevel: LogImportance): boolean;
19
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Log Service - Helpers for log processing and filtering
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LogService = void 0;
7
+ const types_1 = require("./types");
8
+ class LogService {
9
+ /**
10
+ * Determine importance level of a log entry
11
+ */
12
+ static getLogImportance(entry) {
13
+ if (entry.level === 'error')
14
+ return types_1.LogImportance.CRITICAL;
15
+ if (entry.level === 'stderr')
16
+ return types_1.LogImportance.HIGH;
17
+ const msg = (entry.message || '').toLowerCase();
18
+ if (msg.includes('error') || msg.includes('fail'))
19
+ return types_1.LogImportance.HIGH;
20
+ if (msg.includes('warn'))
21
+ return types_1.LogImportance.MEDIUM;
22
+ if (msg.includes('success') || msg.includes('done') || msg.includes('completed'))
23
+ return types_1.LogImportance.LOW;
24
+ if (entry.level === 'debug')
25
+ return types_1.LogImportance.DEBUG;
26
+ return types_1.LogImportance.INFO;
27
+ }
28
+ /**
29
+ * Check if an entry meets the minimum importance level
30
+ */
31
+ static meetsImportanceLevel(entry, minLevel) {
32
+ const entryLevel = this.getLogImportance(entry);
33
+ const levels = [
34
+ types_1.LogImportance.DEBUG,
35
+ types_1.LogImportance.INFO,
36
+ types_1.LogImportance.LOW,
37
+ types_1.LogImportance.MEDIUM,
38
+ types_1.LogImportance.HIGH,
39
+ types_1.LogImportance.CRITICAL
40
+ ];
41
+ const entryIdx = levels.indexOf(entryLevel);
42
+ const minIdx = levels.indexOf(minLevel);
43
+ return entryIdx >= minIdx;
44
+ }
45
+ }
46
+ exports.LogService = LogService;
47
+ //# sourceMappingURL=log-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-service.js","sourceRoot":"","sources":["../../src/utils/log-service.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,mCAAwC;AAOxC,MAAa,UAAU;IACrB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAmB;QACzC,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO;YAAE,OAAO,qBAAa,CAAC,QAAQ,CAAC;QAC3D,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ;YAAE,OAAO,qBAAa,CAAC,IA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H:MM:SS] emoji TYPE message
5
+ * 컨텍스트 포함 시: [HH:MM:SS] [context] emoji TYPE message
3
6
  */
4
- export declare enum LogLevel {
5
- error = 0,
6
- warn = 1,
7
- info = 2,
8
- debug = 3
9
- }
10
- export declare const COLORS: {
11
- reset: string;
12
- red: string;
13
- yellow: string;
14
- green: string;
15
- blue: string;
16
- cyan: string;
17
- magenta: string;
18
- gray: string;
19
- bold: string;
20
- };
7
+ import { COLORS, LogLevel } from './log-constants';
8
+ export { COLORS, LogLevel };
21
9
  /**
22
10
  * Set log level
23
11
  */
24
12
  export declare function setLogLevel(level: string | number): void;
13
+ /**
14
+ * Get current log level
15
+ */
16
+ export declare function getLogLevel(): number;
17
+ /**
18
+ * Log options interface for contextual logging
19
+ */
20
+ export interface LogOptions {
21
+ /** Context label (e.g., lane name) */
22
+ context?: string;
23
+ /** Custom emoji override */
24
+ emoji?: string;
25
+ /** Skip timestamp */
26
+ noTimestamp?: boolean;
27
+ /** Custom color */
28
+ color?: string;
29
+ /** Use box format */
30
+ box?: boolean;
31
+ }
25
32
  /**
26
33
  * Error log
27
34
  */
28
- export declare function error(message: string, emoji?: string): void;
35
+ export declare function error(message: string, options?: LogOptions | string): void;
29
36
  /**
30
37
  * Warning log
31
38
  */
32
- export declare function warn(message: string, emoji?: string): void;
39
+ export declare function warn(message: string, options?: LogOptions | string): void;
33
40
  /**
34
41
  * Info log
35
42
  */
36
- export declare function info(message: string, emoji?: string): void;
43
+ export declare function info(message: string, options?: LogOptions | string): void;
37
44
  /**
38
45
  * Success log
39
46
  */
40
- export declare function success(message: string, emoji?: string): void;
47
+ export declare function success(message: string, options?: LogOptions | string): void;
41
48
  /**
42
49
  * Debug log
43
50
  */
44
- export declare function debug(message: string, emoji?: string): void;
51
+ export declare function debug(message: string, options?: LogOptions | string): void;
45
52
  /**
46
53
  * Progress log
47
54
  */
48
- export declare function progress(message: string, emoji?: string): void;
55
+ export declare function progress(message: string, options?: LogOptions | string): void;
56
+ /**
57
+ * Create a context-bound logger
58
+ */
59
+ export declare function withContext(context: string): {
60
+ error: (message: string, options?: Omit<LogOptions, "context">) => void;
61
+ warn: (message: string, options?: Omit<LogOptions, "context">) => void;
62
+ info: (message: string, options?: Omit<LogOptions, "context">) => void;
63
+ success: (message: string, options?: Omit<LogOptions, "context">) => void;
64
+ debug: (message: string, options?: Omit<LogOptions, "context">) => void;
65
+ progress: (message: string, options?: Omit<LogOptions, "context">) => void;
66
+ };
49
67
  /**
50
68
  * Section header
51
69
  */
52
70
  export declare function section(message: string): void;
53
71
  /**
54
- * Simple log without formatting
72
+ * Raw output (direct to stdout)
55
73
  */
56
- export declare function log(message: string | any): void;
74
+ export declare function raw(message: string): void;
57
75
  /**
58
- * Log JSON data (pretty print in debug mode)
76
+ * Simple log without formatting
59
77
  */
60
- export declare function json(data: any): void;
78
+ export declare function log(message: string): void;
61
79
  export interface Spinner {
62
80
  start(): void;
63
81
  stop(finalMessage?: string | null): void;
64
82
  succeed(message: string): void;
65
83
  fail(message: string): void;
84
+ update(message: string): void;
66
85
  }
67
86
  /**
68
87
  * Create spinner (simple implementation)