@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.
- package/CHANGELOG.md +25 -0
- package/README.md +25 -7
- 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 +178 -6
- package/dist/cli/clean.js.map +1 -1
- package/dist/cli/index.js +12 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.js +8 -7
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/logs.js +126 -77
- package/dist/cli/logs.js.map +1 -1
- package/dist/cli/monitor.d.ts +7 -0
- package/dist/cli/monitor.js +1021 -202
- package/dist/cli/monitor.js.map +1 -1
- package/dist/cli/prepare.js +39 -21
- package/dist/cli/prepare.js.map +1 -1
- package/dist/cli/resume.js +268 -163
- package/dist/cli/resume.js.map +1 -1
- package/dist/cli/run.js +11 -5
- 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 +8 -8
- 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 +16 -2
- package/dist/core/orchestrator.js +439 -105
- 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 +374 -164
- 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 +18 -8
- 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 +17 -11
- package/dist/utils/doctor.js.map +1 -1
- package/dist/utils/enhanced-logger.d.ts +10 -33
- package/dist/utils/enhanced-logger.js +108 -20
- package/dist/utils/enhanced-logger.js.map +1 -1
- package/dist/utils/git.d.ts +121 -0
- package/dist/utils/git.js +484 -11
- 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 +25 -0
- package/dist/utils/log-formatter.js +237 -0
- package/dist/utils/log-formatter.js.map +1 -0
- 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/path.d.ts +19 -0
- package/dist/utils/path.js +77 -0
- package/dist/utils/path.js.map +1 -0
- 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 +62 -3
- package/dist/utils/state.js +317 -11
- 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/template.d.ts +14 -0
- package/dist/utils/template.js +122 -0
- package/dist/utils/template.js.map +1 -0
- package/dist/utils/types.d.ts +2 -271
- 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 +187 -6
- package/src/cli/index.ts +12 -1
- package/src/cli/init.ts +8 -7
- package/src/cli/logs.ts +124 -77
- package/src/cli/monitor.ts +1815 -898
- package/src/cli/prepare.ts +41 -21
- package/src/cli/resume.ts +753 -626
- package/src/cli/run.ts +12 -5
- package/src/cli/runs.ts +212 -0
- package/src/cli/setup-commands.ts +0 -0
- package/src/cli/signal.ts +8 -7
- 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 +1131 -704
- package/src/core/reviewer.ts +4 -0
- package/src/core/runner.ts +444 -180
- 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 +18 -8
- package/src/utils/cursor-agent.ts +1 -1
- package/src/utils/dependency.ts +482 -0
- package/src/utils/doctor.ts +18 -11
- package/src/utils/enhanced-logger.ts +122 -60
- package/src/utils/git.ts +517 -11
- 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 +245 -0
- package/src/utils/log-service.ts +49 -0
- package/src/utils/logger.ts +100 -51
- package/src/utils/path.ts +45 -0
- 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 +385 -11
- package/src/utils/task-service.ts +370 -0
- package/src/utils/template.ts +92 -0
- package/src/utils/types.ts +2 -314
- package/templates/basic.json +21 -0
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,274 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared type definitions for CursorFlow
|
|
3
|
+
* Re-exports from central types directory for backward compatibility
|
|
3
4
|
*/
|
|
4
|
-
export
|
|
5
|
-
devPort: number;
|
|
6
|
-
autoCreatePr: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface CursorFlowConfig {
|
|
9
|
-
tasksDir: string;
|
|
10
|
-
logsDir: string;
|
|
11
|
-
baseBranch: string;
|
|
12
|
-
branchPrefix: string;
|
|
13
|
-
executor: 'cursor-agent' | 'cloud';
|
|
14
|
-
pollInterval: number;
|
|
15
|
-
allowDependencyChange: boolean;
|
|
16
|
-
lockfileReadOnly: boolean;
|
|
17
|
-
enableReview: boolean;
|
|
18
|
-
reviewModel: string;
|
|
19
|
-
reviewAllTasks?: boolean;
|
|
20
|
-
maxReviewIterations: number;
|
|
21
|
-
defaultLaneConfig: LaneConfig;
|
|
22
|
-
logLevel: string;
|
|
23
|
-
verboseGit: boolean;
|
|
24
|
-
worktreePrefix: string;
|
|
25
|
-
maxConcurrentLanes: number;
|
|
26
|
-
projectRoot: string;
|
|
27
|
-
/** Output format for cursor-agent (default: 'stream-json') */
|
|
28
|
-
agentOutputFormat: 'stream-json' | 'json' | 'plain';
|
|
29
|
-
webhooks?: WebhookConfig[];
|
|
30
|
-
/** Enhanced logging configuration */
|
|
31
|
-
enhancedLogging?: Partial<EnhancedLogConfig>;
|
|
32
|
-
}
|
|
33
|
-
export interface WebhookConfig {
|
|
34
|
-
enabled?: boolean;
|
|
35
|
-
url: string;
|
|
36
|
-
secret?: string;
|
|
37
|
-
events?: string[];
|
|
38
|
-
headers?: Record<string, string>;
|
|
39
|
-
retries?: number;
|
|
40
|
-
timeoutMs?: number;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Enhanced logging configuration
|
|
44
|
-
*/
|
|
45
|
-
export interface EnhancedLogConfig {
|
|
46
|
-
/** Enable enhanced logging features (default: true) */
|
|
47
|
-
enabled: boolean;
|
|
48
|
-
/** Strip ANSI escape codes from clean logs (default: true) */
|
|
49
|
-
stripAnsi: boolean;
|
|
50
|
-
/** Add timestamps to each line (default: true) */
|
|
51
|
-
addTimestamps: boolean;
|
|
52
|
-
/** Maximum size in bytes before rotation (default: 50MB) */
|
|
53
|
-
maxFileSize: number;
|
|
54
|
-
/** Number of rotated files to keep (default: 5) */
|
|
55
|
-
maxFiles: number;
|
|
56
|
-
/** Write raw output with ANSI codes to separate file (default: true) */
|
|
57
|
-
keepRawLogs: boolean;
|
|
58
|
-
/** Write structured JSON log entries (default: true) */
|
|
59
|
-
writeJsonLog: boolean;
|
|
60
|
-
/** Timestamp format: 'iso' | 'relative' | 'short' (default: 'iso') */
|
|
61
|
-
timestampFormat: 'iso' | 'relative' | 'short';
|
|
62
|
-
}
|
|
63
|
-
export interface CursorFlowEvent<T = Record<string, any>> {
|
|
64
|
-
id: string;
|
|
65
|
-
type: string;
|
|
66
|
-
timestamp: string;
|
|
67
|
-
runId: string;
|
|
68
|
-
payload: T;
|
|
69
|
-
}
|
|
70
|
-
export type EventHandler<T = any> = (event: CursorFlowEvent<T>) => void | Promise<void>;
|
|
71
|
-
export interface OrchestrationStartedPayload {
|
|
72
|
-
runId: string;
|
|
73
|
-
tasksDir: string;
|
|
74
|
-
laneCount: number;
|
|
75
|
-
runRoot: string;
|
|
76
|
-
}
|
|
77
|
-
export interface OrchestrationCompletedPayload {
|
|
78
|
-
runId: string;
|
|
79
|
-
laneCount: number;
|
|
80
|
-
completedCount: number;
|
|
81
|
-
failedCount: number;
|
|
82
|
-
}
|
|
83
|
-
export interface OrchestrationFailedPayload {
|
|
84
|
-
error: string;
|
|
85
|
-
blockedLanes?: string[];
|
|
86
|
-
}
|
|
87
|
-
export interface LaneStartedPayload {
|
|
88
|
-
laneName: string;
|
|
89
|
-
pid?: number;
|
|
90
|
-
logPath: string;
|
|
91
|
-
}
|
|
92
|
-
export interface LaneCompletedPayload {
|
|
93
|
-
laneName: string;
|
|
94
|
-
exitCode: number;
|
|
95
|
-
}
|
|
96
|
-
export interface LaneFailedPayload {
|
|
97
|
-
laneName: string;
|
|
98
|
-
exitCode: number;
|
|
99
|
-
error: string;
|
|
100
|
-
}
|
|
101
|
-
export interface LaneDependencyRequestedPayload {
|
|
102
|
-
laneName: string;
|
|
103
|
-
dependencyRequest: DependencyRequestPlan;
|
|
104
|
-
}
|
|
105
|
-
export interface TaskStartedPayload {
|
|
106
|
-
taskName: string;
|
|
107
|
-
taskBranch: string;
|
|
108
|
-
index: number;
|
|
109
|
-
}
|
|
110
|
-
export interface TaskCompletedPayload {
|
|
111
|
-
taskName: string;
|
|
112
|
-
taskBranch: string;
|
|
113
|
-
status: string;
|
|
114
|
-
}
|
|
115
|
-
export interface TaskFailedPayload {
|
|
116
|
-
taskName: string;
|
|
117
|
-
taskBranch: string;
|
|
118
|
-
error: string;
|
|
119
|
-
}
|
|
120
|
-
export interface AgentPromptSentPayload {
|
|
121
|
-
taskName: string;
|
|
122
|
-
model: string;
|
|
123
|
-
promptLength: number;
|
|
124
|
-
}
|
|
125
|
-
export interface AgentResponseReceivedPayload {
|
|
126
|
-
taskName: string;
|
|
127
|
-
ok: boolean;
|
|
128
|
-
duration: number;
|
|
129
|
-
responseLength: number;
|
|
130
|
-
error?: string;
|
|
131
|
-
}
|
|
132
|
-
export interface ReviewStartedPayload {
|
|
133
|
-
taskName: string;
|
|
134
|
-
taskBranch: string;
|
|
135
|
-
}
|
|
136
|
-
export interface ReviewCompletedPayload {
|
|
137
|
-
taskName: string;
|
|
138
|
-
status: 'approved' | 'needs_changes';
|
|
139
|
-
issueCount: number;
|
|
140
|
-
summary: string;
|
|
141
|
-
}
|
|
142
|
-
export interface ReviewApprovedPayload {
|
|
143
|
-
taskName: string;
|
|
144
|
-
iterations: number;
|
|
145
|
-
}
|
|
146
|
-
export interface ReviewRejectedPayload {
|
|
147
|
-
taskName: string;
|
|
148
|
-
reason: string;
|
|
149
|
-
iterations: number;
|
|
150
|
-
}
|
|
151
|
-
export interface DependencyPolicy {
|
|
152
|
-
allowDependencyChange: boolean;
|
|
153
|
-
lockfileReadOnly: boolean;
|
|
154
|
-
}
|
|
155
|
-
export interface Task {
|
|
156
|
-
name: string;
|
|
157
|
-
prompt: string;
|
|
158
|
-
model?: string;
|
|
159
|
-
/** Acceptance criteria for the AI reviewer to validate */
|
|
160
|
-
acceptanceCriteria?: string[];
|
|
161
|
-
/** Task-level dependencies (format: "lane:task") */
|
|
162
|
-
dependsOn?: string[];
|
|
163
|
-
/** Task execution timeout in milliseconds. Overrides lane-level timeout. */
|
|
164
|
-
timeout?: number;
|
|
165
|
-
}
|
|
166
|
-
export interface RunnerConfig {
|
|
167
|
-
tasks: Task[];
|
|
168
|
-
dependsOn?: string[];
|
|
169
|
-
pipelineBranch?: string;
|
|
170
|
-
branchPrefix?: string;
|
|
171
|
-
worktreeRoot?: string;
|
|
172
|
-
baseBranch?: string;
|
|
173
|
-
model?: string;
|
|
174
|
-
dependencyPolicy: DependencyPolicy;
|
|
175
|
-
enableReview?: boolean;
|
|
176
|
-
/** Output format for cursor-agent (default: 'stream-json') */
|
|
177
|
-
agentOutputFormat?: 'stream-json' | 'json' | 'plain';
|
|
178
|
-
reviewModel?: string;
|
|
179
|
-
reviewAllTasks?: boolean;
|
|
180
|
-
maxReviewIterations?: number;
|
|
181
|
-
acceptanceCriteria?: string[];
|
|
182
|
-
/** Task execution timeout in milliseconds. Default: 600000 (10 minutes) */
|
|
183
|
-
timeout?: number;
|
|
184
|
-
/**
|
|
185
|
-
* Enable intervention feature (stdin piping for message injection).
|
|
186
|
-
* Warning: May cause stdout buffering issues on some systems.
|
|
187
|
-
* Default: false
|
|
188
|
-
*/
|
|
189
|
-
enableIntervention?: boolean;
|
|
190
|
-
/**
|
|
191
|
-
* Disable Git operations (worktree, branch, push, commit).
|
|
192
|
-
* Useful for testing or environments without Git remote.
|
|
193
|
-
* Default: false
|
|
194
|
-
*/
|
|
195
|
-
noGit?: boolean;
|
|
196
|
-
}
|
|
197
|
-
export interface DependencyRequestPlan {
|
|
198
|
-
reason: string;
|
|
199
|
-
changes: string[];
|
|
200
|
-
commands: string[];
|
|
201
|
-
notes?: string;
|
|
202
|
-
}
|
|
203
|
-
export interface TaskExecutionResult {
|
|
204
|
-
taskName: string;
|
|
205
|
-
taskBranch: string;
|
|
206
|
-
status: 'FINISHED' | 'ERROR' | 'BLOCKED_DEPENDENCY';
|
|
207
|
-
error?: string;
|
|
208
|
-
dependencyRequest?: DependencyRequestPlan | null;
|
|
209
|
-
}
|
|
210
|
-
export interface AgentSendResult {
|
|
211
|
-
ok: boolean;
|
|
212
|
-
exitCode: number;
|
|
213
|
-
error?: string;
|
|
214
|
-
sessionId?: string;
|
|
215
|
-
resultText?: string;
|
|
216
|
-
}
|
|
217
|
-
export interface ReviewIssue {
|
|
218
|
-
severity: 'critical' | 'major' | 'minor';
|
|
219
|
-
description: string;
|
|
220
|
-
file?: string;
|
|
221
|
-
suggestion?: string;
|
|
222
|
-
}
|
|
223
|
-
export interface ReviewResult {
|
|
224
|
-
status: 'approved' | 'needs_changes';
|
|
225
|
-
buildSuccess: boolean;
|
|
226
|
-
issues: ReviewIssue[];
|
|
227
|
-
suggestions: string[];
|
|
228
|
-
summary: string;
|
|
229
|
-
raw: string;
|
|
230
|
-
}
|
|
231
|
-
export interface TaskResult {
|
|
232
|
-
taskName: string;
|
|
233
|
-
taskBranch: string;
|
|
234
|
-
acceptanceCriteria?: string[];
|
|
235
|
-
[key: string]: any;
|
|
236
|
-
}
|
|
237
|
-
export interface LaneState {
|
|
238
|
-
label: string;
|
|
239
|
-
status: 'pending' | 'running' | 'completed' | 'failed' | 'paused' | 'waiting' | 'reviewing';
|
|
240
|
-
currentTaskIndex: number;
|
|
241
|
-
totalTasks: number;
|
|
242
|
-
worktreeDir: string | null;
|
|
243
|
-
pipelineBranch: string | null;
|
|
244
|
-
startTime: number;
|
|
245
|
-
endTime: number | null;
|
|
246
|
-
error: string | null;
|
|
247
|
-
dependencyRequest: DependencyRequestPlan | null;
|
|
248
|
-
updatedAt?: number;
|
|
249
|
-
tasksFile?: string;
|
|
250
|
-
dependsOn?: string[];
|
|
251
|
-
pid?: number;
|
|
252
|
-
/** List of completed task names in this lane */
|
|
253
|
-
completedTasks?: string[];
|
|
254
|
-
/** Task-level dependencies currently being waited for (format: "lane:task") */
|
|
255
|
-
waitingFor?: string[];
|
|
256
|
-
}
|
|
257
|
-
export interface ConversationEntry {
|
|
258
|
-
timestamp: string;
|
|
259
|
-
role: 'user' | 'assistant' | 'reviewer' | 'system';
|
|
260
|
-
task: string | null;
|
|
261
|
-
fullText: string;
|
|
262
|
-
textLength: number;
|
|
263
|
-
model: string | null;
|
|
264
|
-
}
|
|
265
|
-
export interface GitLogEntry {
|
|
266
|
-
timestamp: string;
|
|
267
|
-
operation: string;
|
|
268
|
-
[key: string]: any;
|
|
269
|
-
}
|
|
270
|
-
export interface EventEntry {
|
|
271
|
-
timestamp: string;
|
|
272
|
-
event: string;
|
|
273
|
-
[key: string]: any;
|
|
274
|
-
}
|
|
5
|
+
export * from '../types';
|
package/dist/utils/types.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Shared type definitions for CursorFlow
|
|
4
|
+
* Re-exports from central types directory for backward compatibility
|
|
4
5
|
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
5
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
__exportStar(require("../types"), exports);
|
|
6
22
|
//# sourceMappingURL=types.js.map
|
package/dist/utils/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,2CAAyB"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litmers/cursorflow-orchestrator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "Git worktree-based parallel AI agent orchestration system for Cursor",
|
|
5
5
|
"main": "dist/cli/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cursorflow": "dist/cli/index.js",
|
|
8
8
|
"cursorflow-setup": "dist/cli/setup-commands.js"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsc",
|
|
12
|
-
"watch": "tsc -w",
|
|
13
|
-
"test": "jest",
|
|
14
|
-
"prepublishOnly": "npm run build && npm run validate",
|
|
15
|
-
"postinstall": "node scripts/postinstall.js",
|
|
16
|
-
"validate": "npm pack --dry-run",
|
|
17
|
-
"release": "scripts/release.sh",
|
|
18
|
-
"release:patch": "scripts/release.sh patch",
|
|
19
|
-
"release:minor": "scripts/release.sh minor",
|
|
20
|
-
"release:major": "scripts/release.sh major",
|
|
21
|
-
"security:check": "scripts/local-security-gate.sh",
|
|
22
|
-
"security:audit": "npm audit",
|
|
23
|
-
"security:audit:fix": "npm audit fix",
|
|
24
|
-
"security:setup": "scripts/setup-security.sh",
|
|
25
|
-
"verify": "scripts/verify-and-fix.sh",
|
|
26
|
-
"test:lifecycle": "tests/scripts/test-real-cursor-lifecycle.sh",
|
|
27
|
-
"test:comprehensive": "tests/scripts/test-comprehensive-lifecycle.sh",
|
|
28
|
-
"prepare": "husky"
|
|
29
|
-
},
|
|
30
10
|
"keywords": [
|
|
31
11
|
"cursor",
|
|
32
12
|
"cursor-ide",
|
|
@@ -70,5 +50,40 @@
|
|
|
70
50
|
"README.md",
|
|
71
51
|
"LICENSE",
|
|
72
52
|
"CHANGELOG.md"
|
|
73
|
-
]
|
|
74
|
-
|
|
53
|
+
],
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsc",
|
|
56
|
+
"watch": "tsc -w",
|
|
57
|
+
"test": "jest",
|
|
58
|
+
"postinstall": "node scripts/postinstall.js",
|
|
59
|
+
"validate": "pnpm pack",
|
|
60
|
+
"release": "scripts/release.sh",
|
|
61
|
+
"release:patch": "scripts/release.sh patch",
|
|
62
|
+
"release:minor": "scripts/release.sh minor",
|
|
63
|
+
"release:major": "scripts/release.sh major",
|
|
64
|
+
"security:check": "scripts/local-security-gate.sh",
|
|
65
|
+
"security:audit": "pnpm audit",
|
|
66
|
+
"security:audit:fix": "pnpm audit --fix",
|
|
67
|
+
"security:setup": "scripts/setup-security.sh",
|
|
68
|
+
"verify": "scripts/verify-and-fix.sh",
|
|
69
|
+
"monitor": "scripts/monitor-lanes.sh",
|
|
70
|
+
"monitor:watch": "scripts/monitor-lanes.sh --watch",
|
|
71
|
+
"monitor:stream": "scripts/stream-logs.sh",
|
|
72
|
+
"cf": "node dist/cli/index.js",
|
|
73
|
+
"cf:init": "node dist/cli/index.js init",
|
|
74
|
+
"cf:setup": "node dist/cli/index.js setup",
|
|
75
|
+
"cf:prepare": "node dist/cli/index.js prepare",
|
|
76
|
+
"cf:run": "node dist/cli/index.js run",
|
|
77
|
+
"cf:monitor": "node dist/cli/index.js monitor",
|
|
78
|
+
"cf:clean": "node dist/cli/index.js clean",
|
|
79
|
+
"cf:stop": "node dist/cli/index.js stop",
|
|
80
|
+
"cf:resume": "node dist/cli/index.js resume",
|
|
81
|
+
"cf:doctor": "node dist/cli/index.js doctor",
|
|
82
|
+
"cf:signal": "node dist/cli/index.js signal",
|
|
83
|
+
"cf:logs": "node dist/cli/index.js logs",
|
|
84
|
+
"cf:runs": "node dist/cli/index.js runs",
|
|
85
|
+
"cf:models": "node dist/cli/index.js models",
|
|
86
|
+
"test:lifecycle": "tests/scripts/test-real-cursor-lifecycle.sh",
|
|
87
|
+
"test:comprehensive": "tests/scripts/test-comprehensive-lifecycle.sh"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# CursorFlow Lane Monitor
|
|
4
|
+
# Displays the latest logs from all active lanes in the current or latest run.
|
|
5
|
+
|
|
6
|
+
# Colors for output
|
|
7
|
+
BLUE='\033[0;34m'
|
|
8
|
+
GREEN='\033[0;32m'
|
|
9
|
+
YELLOW='\033[1;33m'
|
|
10
|
+
RED='\033[0;31m'
|
|
11
|
+
NC='\033[0m' # No Color
|
|
12
|
+
BOLD='\033[1m'
|
|
13
|
+
|
|
14
|
+
LOGS_DIR_BASE="${1:-.}"
|
|
15
|
+
LOGS_DIR="${LOGS_DIR_BASE}/_cursorflow/logs/runs"
|
|
16
|
+
|
|
17
|
+
# Shift arguments if path was provided
|
|
18
|
+
if [[ -d "$1" && "$1" != "-w" && "$1" != "--watch" ]]; then
|
|
19
|
+
shift
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Ensure we are in the root of the project or target dir
|
|
23
|
+
if [ ! -d "$LOGS_DIR" ]; then
|
|
24
|
+
echo -e "${RED}Error: ${LOGS_DIR} directory not found.${NC}"
|
|
25
|
+
echo "Please run this script from the root of the CursorFlow project or provide a path."
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Find the latest run directory
|
|
30
|
+
LATEST_RUN=$(ls -td ${LOGS_DIR}/run-* 2>/dev/null | head -n 1)
|
|
31
|
+
|
|
32
|
+
if [ -z "$LATEST_RUN" ]; then
|
|
33
|
+
echo -e "${YELLOW}No runs found in ${LOGS_DIR}${NC}"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
RUN_ID=$(basename "$LATEST_RUN")
|
|
38
|
+
|
|
39
|
+
# Clear screen if requested or if using watch
|
|
40
|
+
show_summary() {
|
|
41
|
+
echo -e "${BOLD}CursorFlow Lane Monitor${NC} - Run: ${GREEN}${RUN_ID}${NC}"
|
|
42
|
+
echo -e "Time: $(date '+%Y-%m-%d %H:%M:%S')"
|
|
43
|
+
echo "--------------------------------------------------------------------------------"
|
|
44
|
+
|
|
45
|
+
for lane_dir in "${LATEST_RUN}/lanes"/*; do
|
|
46
|
+
if [ -d "$lane_dir" ]; then
|
|
47
|
+
lane_name=$(basename "$lane_dir")
|
|
48
|
+
log_file="${lane_dir}/terminal-readable.log"
|
|
49
|
+
|
|
50
|
+
# Extract status if possible (last line of log often contains status info)
|
|
51
|
+
if [ -f "$log_file" ]; then
|
|
52
|
+
# Get the last few lines
|
|
53
|
+
LAST_LOG=$(tail -n 1 "$log_file")
|
|
54
|
+
|
|
55
|
+
# Check for completion or errors
|
|
56
|
+
STATUS="${BLUE}RUNNING${NC}"
|
|
57
|
+
if grep -q "✅ Pipeline completed" "$log_file" 2>/dev/null; then
|
|
58
|
+
STATUS="${GREEN}SUCCESS${NC}"
|
|
59
|
+
elif grep -q "❌ Pipeline failed" "$log_file" 2>/dev/null; then
|
|
60
|
+
STATUS="${RED}ERROR${NC}"
|
|
61
|
+
elif grep -q "❌ Task failed" "$log_file" 2>/dev/null; then
|
|
62
|
+
STATUS="${RED}ERROR${NC}"
|
|
63
|
+
elif grep -q "✅ ✓ Configuration valid" "$log_file" 2>/dev/null; then
|
|
64
|
+
STATUS="${BLUE}ACTIVE${NC}"
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
echo -e "[${STATUS}] ${BOLD}${lane_name}${NC}"
|
|
68
|
+
echo -e " ${LAST_LOG:0:100}"
|
|
69
|
+
echo ""
|
|
70
|
+
else
|
|
71
|
+
echo -e "[${YELLOW}WAITING${NC}] ${BOLD}${lane_name}${NC}"
|
|
72
|
+
echo " (No logs yet)"
|
|
73
|
+
echo ""
|
|
74
|
+
fi
|
|
75
|
+
fi
|
|
76
|
+
done
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# Check for watch mode
|
|
80
|
+
if [[ "$1" == "-w" || "$1" == "--watch" ]]; then
|
|
81
|
+
# Use simple loop to avoid argument passing issues with 'watch' command
|
|
82
|
+
while true; do
|
|
83
|
+
clear
|
|
84
|
+
show_summary
|
|
85
|
+
echo "Press Ctrl+C to stop..."
|
|
86
|
+
sleep 2
|
|
87
|
+
done
|
|
88
|
+
else
|
|
89
|
+
show_summary
|
|
90
|
+
echo -e "${NC}Tip: Use ${BOLD}$0 --watch${NC} to monitor in real-time."
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
exit 0
|
|
94
|
+
|
package/scripts/release.sh
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# CursorFlow All Lanes Log Streamer
|
|
4
|
+
# Replicates the output of 'cursorflow run' by streaming logs from all lanes.
|
|
5
|
+
|
|
6
|
+
BLUE='\033[0;34m'
|
|
7
|
+
GREEN='\033[0;32m'
|
|
8
|
+
YELLOW='\033[1;33m'
|
|
9
|
+
RED='\033[0;31m'
|
|
10
|
+
NC='\033[0m' # No Color
|
|
11
|
+
BOLD='\033[1m'
|
|
12
|
+
|
|
13
|
+
LOGS_DIR_BASE="${1:-.}"
|
|
14
|
+
LOGS_DIR="${LOGS_DIR_BASE}/_cursorflow/logs/runs"
|
|
15
|
+
|
|
16
|
+
if [ ! -d "$LOGS_DIR" ]; then
|
|
17
|
+
echo -e "${RED}Error: ${LOGS_DIR} directory not found.${NC}"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
LATEST_RUN=$(ls -td ${LOGS_DIR}/run-* 2>/dev/null | head -n 1)
|
|
22
|
+
|
|
23
|
+
if [ -z "$LATEST_RUN" ]; then
|
|
24
|
+
echo -e "${YELLOW}No runs found in ${LOGS_DIR}${NC}"
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
RUN_ID=$(basename "$LATEST_RUN")
|
|
29
|
+
echo -e "${BOLD}Streaming logs for Run: ${GREEN}${RUN_ID}${NC}"
|
|
30
|
+
echo "--------------------------------------------------------------------------------"
|
|
31
|
+
|
|
32
|
+
# Function to stream a single log file with a prefix
|
|
33
|
+
stream_log() {
|
|
34
|
+
local lane_name=$1
|
|
35
|
+
local log_file=$2
|
|
36
|
+
local color=$3
|
|
37
|
+
|
|
38
|
+
# Check if file exists, if not wait for it
|
|
39
|
+
until [ -f "$log_file" ]; do
|
|
40
|
+
sleep 1
|
|
41
|
+
done
|
|
42
|
+
|
|
43
|
+
# Tail the file and prefix each line
|
|
44
|
+
tail -n +1 -f "$log_file" | while IFS= read -r line; do
|
|
45
|
+
echo -e "${color}[${lane_name}]${NC} ${line}"
|
|
46
|
+
done
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# Colors to rotate through
|
|
50
|
+
COLORS=('\033[0;32m' '\033[0;34m' '\033[0;35m' '\033[0;36m' '\033[1;32m' '\033[1;34m' '\033[1;35m' '\033[1;36m')
|
|
51
|
+
color_idx=0
|
|
52
|
+
|
|
53
|
+
# Clean up background processes on exit
|
|
54
|
+
trap 'kill $(jobs -p) 2>/dev/null' EXIT
|
|
55
|
+
|
|
56
|
+
# Find all lanes and start streaming
|
|
57
|
+
for lane_dir in "${LATEST_RUN}/lanes"/*; do
|
|
58
|
+
if [ -d "$lane_dir" ]; then
|
|
59
|
+
lane_name=$(basename "$lane_dir")
|
|
60
|
+
log_file="${lane_dir}/terminal-readable.log"
|
|
61
|
+
color=${COLORS[$color_idx]}
|
|
62
|
+
|
|
63
|
+
# Start streaming in background
|
|
64
|
+
stream_log "$lane_name" "$log_file" "$color" &
|
|
65
|
+
|
|
66
|
+
color_idx=$(( (color_idx + 1) % ${#COLORS[@]} ))
|
|
67
|
+
fi
|
|
68
|
+
done
|
|
69
|
+
|
|
70
|
+
# Wait for all background processes
|
|
71
|
+
wait
|
|
72
|
+
|
|
File without changes
|