@litmers/cursorflow-orchestrator 0.2.2 → 0.2.5

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 (95) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +8 -11
  3. package/dist/cli/complete.d.ts +7 -0
  4. package/dist/cli/complete.js +304 -0
  5. package/dist/cli/complete.js.map +1 -0
  6. package/dist/cli/index.js +0 -6
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/cli/logs.js +51 -61
  9. package/dist/cli/logs.js.map +1 -1
  10. package/dist/cli/monitor.js +74 -46
  11. package/dist/cli/monitor.js.map +1 -1
  12. package/dist/cli/resume.js +2 -2
  13. package/dist/cli/resume.js.map +1 -1
  14. package/dist/cli/signal.js +33 -29
  15. package/dist/cli/signal.js.map +1 -1
  16. package/dist/core/auto-recovery.d.ts +2 -117
  17. package/dist/core/auto-recovery.js +4 -487
  18. package/dist/core/auto-recovery.js.map +1 -1
  19. package/dist/core/failure-policy.d.ts +0 -52
  20. package/dist/core/failure-policy.js +7 -174
  21. package/dist/core/failure-policy.js.map +1 -1
  22. package/dist/core/git-lifecycle-manager.js +2 -2
  23. package/dist/core/git-lifecycle-manager.js.map +1 -1
  24. package/dist/core/git-pipeline-coordinator.js +25 -25
  25. package/dist/core/git-pipeline-coordinator.js.map +1 -1
  26. package/dist/core/intervention.d.ts +0 -6
  27. package/dist/core/intervention.js +1 -17
  28. package/dist/core/intervention.js.map +1 -1
  29. package/dist/core/orchestrator.js +18 -10
  30. package/dist/core/orchestrator.js.map +1 -1
  31. package/dist/core/runner/agent.js +18 -15
  32. package/dist/core/runner/agent.js.map +1 -1
  33. package/dist/core/runner/pipeline.js +3 -3
  34. package/dist/core/runner/pipeline.js.map +1 -1
  35. package/dist/core/stall-detection.js +9 -7
  36. package/dist/core/stall-detection.js.map +1 -1
  37. package/dist/hooks/data-accessor.js +2 -2
  38. package/dist/hooks/data-accessor.js.map +1 -1
  39. package/dist/services/logging/buffer.d.ts +1 -2
  40. package/dist/services/logging/buffer.js +22 -63
  41. package/dist/services/logging/buffer.js.map +1 -1
  42. package/dist/services/logging/formatter.d.ts +4 -0
  43. package/dist/services/logging/formatter.js +201 -33
  44. package/dist/services/logging/formatter.js.map +1 -1
  45. package/dist/services/logging/paths.d.ts +0 -3
  46. package/dist/services/logging/paths.js +0 -3
  47. package/dist/services/logging/paths.js.map +1 -1
  48. package/dist/types/config.d.ts +1 -9
  49. package/dist/types/logging.d.ts +1 -1
  50. package/dist/utils/config.js +2 -6
  51. package/dist/utils/config.js.map +1 -1
  52. package/dist/utils/enhanced-logger.d.ts +17 -37
  53. package/dist/utils/enhanced-logger.js +237 -267
  54. package/dist/utils/enhanced-logger.js.map +1 -1
  55. package/dist/utils/logger.js +17 -4
  56. package/dist/utils/logger.js.map +1 -1
  57. package/dist/utils/repro-thinking-logs.js +4 -4
  58. package/dist/utils/repro-thinking-logs.js.map +1 -1
  59. package/package.json +3 -14
  60. package/scripts/monitor-lanes.sh +5 -5
  61. package/scripts/stream-logs.sh +1 -1
  62. package/scripts/test-log-parser.ts +8 -42
  63. package/src/cli/complete.ts +305 -0
  64. package/src/cli/index.ts +0 -6
  65. package/src/cli/logs.ts +46 -60
  66. package/src/cli/monitor.ts +82 -48
  67. package/src/cli/resume.ts +1 -1
  68. package/src/cli/signal.ts +38 -34
  69. package/src/core/auto-recovery.ts +13 -595
  70. package/src/core/failure-policy.ts +7 -228
  71. package/src/core/git-lifecycle-manager.ts +2 -2
  72. package/src/core/git-pipeline-coordinator.ts +25 -25
  73. package/src/core/intervention.ts +0 -18
  74. package/src/core/orchestrator.ts +20 -10
  75. package/src/core/runner/agent.ts +21 -16
  76. package/src/core/runner/pipeline.ts +3 -3
  77. package/src/core/stall-detection.ts +11 -9
  78. package/src/hooks/data-accessor.ts +2 -2
  79. package/src/services/logging/buffer.ts +20 -68
  80. package/src/services/logging/formatter.ts +199 -32
  81. package/src/services/logging/paths.ts +0 -3
  82. package/src/types/config.ts +1 -13
  83. package/src/types/logging.ts +2 -0
  84. package/src/utils/config.ts +2 -6
  85. package/src/utils/enhanced-logger.ts +239 -290
  86. package/src/utils/logger.ts +18 -3
  87. package/src/utils/repro-thinking-logs.ts +4 -4
  88. package/dist/cli/prepare.d.ts +0 -7
  89. package/dist/cli/prepare.js +0 -690
  90. package/dist/cli/prepare.js.map +0 -1
  91. package/dist/utils/log-formatter.d.ts +0 -26
  92. package/dist/utils/log-formatter.js +0 -274
  93. package/dist/utils/log-formatter.js.map +0 -1
  94. package/src/cli/prepare.ts +0 -777
  95. package/src/utils/log-formatter.ts +0 -287
@@ -11,7 +11,7 @@
11
11
  import * as fs from 'fs';
12
12
  import * as path from 'path';
13
13
  import { COLORS, LogLevel } from './log-constants';
14
- import { formatMessageForConsole } from './log-formatter';
14
+ import { formatMessageForConsole } from '../services/logging/formatter';
15
15
 
16
16
  export { COLORS, LogLevel };
17
17
 
@@ -92,14 +92,29 @@ function logInternal(
92
92
  return;
93
93
  }
94
94
 
95
+ // If context is 'git', use the specialized 'git' message type for better coloring
96
+ const effectiveType = options.context === 'git' ? 'git' : type;
97
+
98
+ // If running in a lane, output JSON for the orchestrator to capture and format
99
+ if (process.env.CURSORFLOW_LANE === 'true') {
100
+ const jsonMsg = {
101
+ type: effectiveType,
102
+ content: message,
103
+ timestamp_ms: Date.now(),
104
+ context: options.context ?? defaultContext ?? undefined,
105
+ };
106
+ console.log(JSON.stringify(jsonMsg));
107
+ return;
108
+ }
109
+
95
110
  const formatted = formatMessageForConsole({
96
- type: type as any,
111
+ type: effectiveType as any,
97
112
  role: 'system',
98
113
  content: message,
99
114
  timestamp: Date.now(),
100
115
  }, {
101
116
  includeTimestamp: !options.noTimestamp,
102
- context: options.context ?? defaultContext ?? undefined,
117
+ laneLabel: options.context ?? defaultContext ?? undefined,
103
118
  compact: !options.box
104
119
  });
105
120
 
@@ -11,7 +11,7 @@ async function testThinkingLogs() {
11
11
 
12
12
  console.log('--- Initializing Log Manager ---');
13
13
  const manager = createLogManager(testDir, 'test-lane-thinking', {
14
- keepRawLogs: true
14
+ writeJsonLog: true
15
15
  });
16
16
 
17
17
  manager.setTask('repro-thinking-task', 'sonnet-4.5-thinking');
@@ -31,9 +31,9 @@ async function testThinkingLogs() {
31
31
 
32
32
  manager.close();
33
33
 
34
- console.log('\n--- Verifying terminal-readable.log ---');
35
- const readableLog = fs.readFileSync(path.join(testDir, 'terminal-readable.log'), 'utf8');
36
- console.log(readableLog);
34
+ console.log('\n--- Verifying terminal.jsonl ---');
35
+ const jsonlLog = fs.readFileSync(path.join(testDir, 'terminal.jsonl'), 'utf8');
36
+ console.log(jsonlLog);
37
37
  }
38
38
 
39
39
  testThinkingLogs().catch(console.error);
@@ -1,7 +0,0 @@
1
- /**
2
- * CursorFlow prepare command
3
- *
4
- * Prepare task files for a new feature - Terminal-first approach
5
- */
6
- declare function prepare(args: string[]): Promise<void>;
7
- export = prepare;