@litmers/cursorflow-orchestrator 0.1.39 → 0.2.2
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 +0 -2
- package/README.md +20 -16
- package/commands/cursorflow-init.md +0 -4
- package/dist/cli/logs.js +108 -9
- package/dist/cli/logs.js.map +1 -1
- package/dist/cli/models.js +20 -3
- package/dist/cli/models.js.map +1 -1
- package/dist/cli/monitor.d.ts +7 -10
- package/dist/cli/monitor.js +1088 -1240
- package/dist/cli/monitor.js.map +1 -1
- package/dist/cli/prepare.js +0 -1
- package/dist/cli/prepare.js.map +1 -1
- package/dist/cli/resume.js +23 -5
- package/dist/cli/resume.js.map +1 -1
- package/dist/cli/run.js +28 -9
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/signal.d.ts +6 -1
- package/dist/cli/signal.js +94 -12
- package/dist/cli/signal.js.map +1 -1
- package/dist/cli/tasks.js +3 -46
- package/dist/cli/tasks.js.map +1 -1
- package/dist/core/agent-supervisor.d.ts +23 -0
- package/dist/core/agent-supervisor.js +42 -0
- package/dist/core/agent-supervisor.js.map +1 -0
- package/dist/core/auto-recovery.d.ts +2 -1
- package/dist/core/auto-recovery.js +6 -1
- package/dist/core/auto-recovery.js.map +1 -1
- package/dist/core/failure-policy.d.ts +0 -1
- package/dist/core/failure-policy.js +0 -1
- package/dist/core/failure-policy.js.map +1 -1
- package/dist/core/git-lifecycle-manager.d.ts +284 -0
- package/dist/core/git-lifecycle-manager.js +778 -0
- package/dist/core/git-lifecycle-manager.js.map +1 -0
- package/dist/core/git-pipeline-coordinator.d.ts +21 -0
- package/dist/core/git-pipeline-coordinator.js +205 -0
- package/dist/core/git-pipeline-coordinator.js.map +1 -0
- package/dist/core/intervention.d.ts +176 -0
- package/dist/core/intervention.js +424 -0
- package/dist/core/intervention.js.map +1 -0
- package/dist/core/lane-state-machine.d.ts +423 -0
- package/dist/core/lane-state-machine.js +890 -0
- package/dist/core/lane-state-machine.js.map +1 -0
- package/dist/core/orchestrator.d.ts +4 -1
- package/dist/core/orchestrator.js +38 -63
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/runner/agent.d.ts +7 -1
- package/dist/core/runner/agent.js +45 -30
- package/dist/core/runner/agent.js.map +1 -1
- package/dist/core/runner/pipeline.js +283 -109
- package/dist/core/runner/pipeline.js.map +1 -1
- package/dist/core/runner/task.d.ts +4 -5
- package/dist/core/runner/task.js +6 -77
- package/dist/core/runner/task.js.map +1 -1
- package/dist/core/runner.js +11 -2
- package/dist/core/runner.js.map +1 -1
- package/dist/core/stall-detection.d.ts +27 -4
- package/dist/core/stall-detection.js +116 -28
- package/dist/core/stall-detection.js.map +1 -1
- package/dist/hooks/contexts/index.d.ts +104 -0
- package/dist/hooks/contexts/index.js +134 -0
- package/dist/hooks/contexts/index.js.map +1 -0
- package/dist/hooks/data-accessor.d.ts +86 -0
- package/dist/hooks/data-accessor.js +410 -0
- package/dist/hooks/data-accessor.js.map +1 -0
- package/dist/hooks/flow-controller.d.ts +136 -0
- package/dist/hooks/flow-controller.js +351 -0
- package/dist/hooks/flow-controller.js.map +1 -0
- package/dist/hooks/index.d.ts +68 -0
- package/dist/hooks/index.js +105 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/manager.d.ts +129 -0
- package/dist/hooks/manager.js +389 -0
- package/dist/hooks/manager.js.map +1 -0
- package/dist/hooks/types.d.ts +463 -0
- package/dist/hooks/types.js +45 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/services/logging/buffer.d.ts +2 -2
- package/dist/services/logging/buffer.js +95 -42
- package/dist/services/logging/buffer.js.map +1 -1
- package/dist/services/logging/console.js +8 -5
- package/dist/services/logging/console.js.map +1 -1
- package/dist/services/logging/formatter.d.ts +9 -3
- package/dist/services/logging/formatter.js +64 -17
- package/dist/services/logging/formatter.js.map +1 -1
- package/dist/services/logging/index.d.ts +0 -1
- package/dist/services/logging/index.js +0 -1
- package/dist/services/logging/index.js.map +1 -1
- package/dist/services/logging/paths.d.ts +8 -0
- package/dist/services/logging/paths.js +48 -0
- package/dist/services/logging/paths.js.map +1 -0
- package/dist/services/logging/raw-log.d.ts +6 -0
- package/dist/services/logging/raw-log.js +37 -0
- package/dist/services/logging/raw-log.js.map +1 -0
- package/dist/services/process/index.js +1 -1
- package/dist/services/process/index.js.map +1 -1
- package/dist/types/agent.d.ts +15 -0
- package/dist/types/config.d.ts +24 -1
- package/dist/types/event-categories.d.ts +601 -0
- package/dist/types/event-categories.js +233 -0
- package/dist/types/event-categories.js.map +1 -0
- package/dist/types/events.d.ts +0 -20
- package/dist/types/flow.d.ts +10 -6
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +17 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/lane.d.ts +1 -1
- package/dist/types/logging.d.ts +1 -1
- package/dist/types/task.d.ts +13 -2
- package/dist/ui/log-viewer.d.ts +3 -0
- package/dist/ui/log-viewer.js +3 -0
- package/dist/ui/log-viewer.js.map +1 -1
- package/dist/utils/config.js +15 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/cursor-agent.d.ts +11 -1
- package/dist/utils/cursor-agent.js +63 -16
- package/dist/utils/cursor-agent.js.map +1 -1
- package/dist/utils/enhanced-logger.d.ts +5 -1
- package/dist/utils/enhanced-logger.js +99 -20
- package/dist/utils/enhanced-logger.js.map +1 -1
- package/dist/utils/event-registry.d.ts +222 -0
- package/dist/utils/event-registry.js +463 -0
- package/dist/utils/event-registry.js.map +1 -0
- package/dist/utils/events.d.ts +1 -13
- package/dist/utils/events.js.map +1 -1
- package/dist/utils/flow.d.ts +10 -0
- package/dist/utils/flow.js +75 -0
- package/dist/utils/flow.js.map +1 -1
- package/dist/utils/git.d.ts +12 -1
- package/dist/utils/git.js +54 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/log-constants.d.ts +1 -0
- package/dist/utils/log-constants.js +2 -1
- package/dist/utils/log-constants.js.map +1 -1
- package/dist/utils/log-formatter.d.ts +3 -2
- package/dist/utils/log-formatter.js +11 -11
- package/dist/utils/log-formatter.js.map +1 -1
- package/dist/utils/logger.d.ts +11 -0
- package/dist/utils/logger.js +82 -3
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/repro-thinking-logs.js +0 -13
- package/dist/utils/repro-thinking-logs.js.map +1 -1
- package/dist/utils/run-service.js +1 -1
- package/dist/utils/run-service.js.map +1 -1
- package/examples/README.md +0 -2
- package/examples/demo-project/README.md +1 -2
- package/package.json +18 -28
- package/scripts/setup-security.sh +0 -1
- package/scripts/test-log-parser.ts +171 -0
- package/scripts/verify-change.sh +272 -0
- package/src/cli/logs.ts +121 -10
- package/src/cli/models.ts +20 -3
- package/src/cli/monitor.ts +1257 -1342
- package/src/cli/prepare.ts +0 -1
- package/src/cli/resume.ts +29 -5
- package/src/cli/run.ts +29 -11
- package/src/cli/signal.ts +115 -17
- package/src/cli/tasks.ts +2 -59
- package/src/core/agent-supervisor.ts +64 -0
- package/src/core/auto-recovery.ts +7 -1
- package/src/core/failure-policy.ts +0 -1
- package/src/core/git-lifecycle-manager.ts +1011 -0
- package/src/core/git-pipeline-coordinator.ts +221 -0
- package/src/core/intervention.ts +481 -0
- package/src/core/lane-state-machine.ts +1097 -0
- package/src/core/orchestrator.ts +45 -62
- package/src/core/runner/agent.ts +66 -33
- package/src/core/runner/pipeline.ts +318 -122
- package/src/core/runner/task.ts +12 -93
- package/src/core/runner.ts +12 -2
- package/src/core/stall-detection.ts +145 -28
- package/src/hooks/contexts/index.ts +256 -0
- package/src/hooks/data-accessor.ts +488 -0
- package/src/hooks/flow-controller.ts +425 -0
- package/src/hooks/index.ts +154 -0
- package/src/hooks/manager.ts +434 -0
- package/src/hooks/types.ts +544 -0
- package/src/services/logging/buffer.ts +104 -43
- package/src/services/logging/console.ts +9 -5
- package/src/services/logging/formatter.ts +74 -17
- package/src/services/logging/index.ts +0 -2
- package/src/services/logging/paths.ts +14 -0
- package/src/services/logging/raw-log.ts +43 -0
- package/src/services/process/index.ts +1 -1
- package/src/types/agent.ts +15 -0
- package/src/types/config.ts +25 -1
- package/src/types/event-categories.ts +663 -0
- package/src/types/events.ts +0 -25
- package/src/types/flow.ts +10 -6
- package/src/types/index.ts +50 -4
- package/src/types/lane.ts +1 -2
- package/src/types/logging.ts +2 -1
- package/src/types/task.ts +13 -2
- package/src/ui/log-viewer.ts +3 -0
- package/src/utils/config.ts +17 -1
- package/src/utils/cursor-agent.ts +68 -16
- package/src/utils/enhanced-logger.ts +106 -20
- package/src/utils/event-registry.ts +595 -0
- package/src/utils/events.ts +0 -16
- package/src/utils/flow.ts +84 -0
- package/src/utils/git.ts +59 -1
- package/src/utils/log-constants.ts +2 -1
- package/src/utils/log-formatter.ts +11 -12
- package/src/utils/logger.ts +49 -3
- package/src/utils/repro-thinking-logs.ts +0 -15
- package/src/utils/run-service.ts +1 -1
- package/dist/services/logging/file-writer.d.ts +0 -71
- package/dist/services/logging/file-writer.js +0 -516
- package/dist/services/logging/file-writer.js.map +0 -1
- package/dist/types/review.d.ts +0 -17
- package/dist/types/review.js +0 -6
- package/dist/types/review.js.map +0 -1
- package/scripts/ai-security-check.js +0 -233
- package/src/services/logging/file-writer.ts +0 -526
- package/src/types/review.ts +0 -20
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# verify-change.sh - Post-change verification script
|
|
4
|
+
#
|
|
5
|
+
# Runs a series of checks to verify that code changes don't break functionality.
|
|
6
|
+
# Use this after making changes to ensure everything still works.
|
|
7
|
+
#
|
|
8
|
+
# Usage:
|
|
9
|
+
# ./scripts/verify-change.sh # Run all checks
|
|
10
|
+
# ./scripts/verify-change.sh --quick # Skip slow tests
|
|
11
|
+
# ./scripts/verify-change.sh --smoke # Only run smoke tests
|
|
12
|
+
#
|
|
13
|
+
|
|
14
|
+
set -e
|
|
15
|
+
|
|
16
|
+
# Colors for output
|
|
17
|
+
RED='\033[0;31m'
|
|
18
|
+
GREEN='\033[0;32m'
|
|
19
|
+
YELLOW='\033[1;33m'
|
|
20
|
+
BLUE='\033[0;34m'
|
|
21
|
+
NC='\033[0m' # No Color
|
|
22
|
+
|
|
23
|
+
# Script directory
|
|
24
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
25
|
+
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
26
|
+
|
|
27
|
+
# Parse arguments
|
|
28
|
+
QUICK_MODE=false
|
|
29
|
+
SMOKE_ONLY=false
|
|
30
|
+
VERBOSE=false
|
|
31
|
+
|
|
32
|
+
while [[ $# -gt 0 ]]; do
|
|
33
|
+
case $1 in
|
|
34
|
+
--quick|-q)
|
|
35
|
+
QUICK_MODE=true
|
|
36
|
+
shift
|
|
37
|
+
;;
|
|
38
|
+
--smoke|-s)
|
|
39
|
+
SMOKE_ONLY=true
|
|
40
|
+
shift
|
|
41
|
+
;;
|
|
42
|
+
--verbose|-v)
|
|
43
|
+
VERBOSE=true
|
|
44
|
+
shift
|
|
45
|
+
;;
|
|
46
|
+
--help|-h)
|
|
47
|
+
echo "Usage: $0 [options]"
|
|
48
|
+
echo ""
|
|
49
|
+
echo "Options:"
|
|
50
|
+
echo " --quick, -q Skip slow tests (integration, e2e)"
|
|
51
|
+
echo " --smoke, -s Only run smoke tests"
|
|
52
|
+
echo " --verbose, -v Show detailed output"
|
|
53
|
+
echo " --help, -h Show this help message"
|
|
54
|
+
exit 0
|
|
55
|
+
;;
|
|
56
|
+
*)
|
|
57
|
+
echo -e "${RED}Unknown option: $1${NC}"
|
|
58
|
+
exit 1
|
|
59
|
+
;;
|
|
60
|
+
esac
|
|
61
|
+
done
|
|
62
|
+
|
|
63
|
+
# Logging functions
|
|
64
|
+
log_step() {
|
|
65
|
+
echo -e "\n${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
66
|
+
echo -e "${BLUE}▶ $1${NC}"
|
|
67
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
log_success() {
|
|
71
|
+
echo -e "${GREEN}✓ $1${NC}"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
log_error() {
|
|
75
|
+
echo -e "${RED}✗ $1${NC}"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
log_warning() {
|
|
79
|
+
echo -e "${YELLOW}⚠ $1${NC}"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# Track results
|
|
83
|
+
RESULTS=()
|
|
84
|
+
FAILED=false
|
|
85
|
+
|
|
86
|
+
run_check() {
|
|
87
|
+
local name="$1"
|
|
88
|
+
local command="$2"
|
|
89
|
+
|
|
90
|
+
if $VERBOSE; then
|
|
91
|
+
echo -e "${YELLOW}Running: $command${NC}"
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
if eval "$command"; then
|
|
95
|
+
log_success "$name"
|
|
96
|
+
RESULTS+=("✓ $name")
|
|
97
|
+
else
|
|
98
|
+
log_error "$name"
|
|
99
|
+
RESULTS+=("✗ $name")
|
|
100
|
+
FAILED=true
|
|
101
|
+
fi
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
cd "$ROOT_DIR"
|
|
105
|
+
|
|
106
|
+
echo -e "${BLUE}"
|
|
107
|
+
echo "╔═══════════════════════════════════════════════════════════╗"
|
|
108
|
+
echo "║ CursorFlow Change Verification ║"
|
|
109
|
+
echo "╚═══════════════════════════════════════════════════════════╝"
|
|
110
|
+
echo -e "${NC}"
|
|
111
|
+
|
|
112
|
+
# Step 1: TypeScript Compilation
|
|
113
|
+
log_step "Step 1: TypeScript Compilation"
|
|
114
|
+
|
|
115
|
+
BUILD_OUTPUT=$(mktemp)
|
|
116
|
+
if npm run build > "$BUILD_OUTPUT" 2>&1; then
|
|
117
|
+
log_success "TypeScript compilation passed"
|
|
118
|
+
RESULTS+=("✓ TypeScript compilation")
|
|
119
|
+
else
|
|
120
|
+
log_error "TypeScript compilation failed"
|
|
121
|
+
echo "Build output:"
|
|
122
|
+
cat "$BUILD_OUTPUT"
|
|
123
|
+
RESULTS+=("✗ TypeScript compilation")
|
|
124
|
+
FAILED=true
|
|
125
|
+
fi
|
|
126
|
+
rm -f "$BUILD_OUTPUT"
|
|
127
|
+
|
|
128
|
+
# Exit early if build failed
|
|
129
|
+
if $FAILED; then
|
|
130
|
+
log_error "Build failed, skipping further checks"
|
|
131
|
+
exit 1
|
|
132
|
+
fi
|
|
133
|
+
|
|
134
|
+
# Step 2: Lint Check (if available)
|
|
135
|
+
log_step "Step 2: Lint Check"
|
|
136
|
+
if command -v eslint &> /dev/null && [ -f ".eslintrc.js" ] || [ -f ".eslintrc.json" ]; then
|
|
137
|
+
run_check "ESLint" "npx eslint src/ --quiet 2>/dev/null || true"
|
|
138
|
+
else
|
|
139
|
+
log_warning "ESLint not configured, skipping"
|
|
140
|
+
RESULTS+=("⚠ ESLint (skipped)")
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
# Step 3: Unit Tests (unless smoke-only mode)
|
|
144
|
+
if ! $SMOKE_ONLY; then
|
|
145
|
+
log_step "Step 3: Unit Tests"
|
|
146
|
+
run_check "Unit tests" "npm run test:unit -- --passWithNoTests --silent"
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
# Step 4: CLI Smoke Tests
|
|
150
|
+
log_step "Step 4: CLI Smoke Tests"
|
|
151
|
+
|
|
152
|
+
# Test 1: Version command
|
|
153
|
+
echo -e "${YELLOW}Testing: cursorflow --version${NC}"
|
|
154
|
+
VERSION_OUTPUT=$(node dist/cli/index.js --version 2>&1 || true)
|
|
155
|
+
if echo "$VERSION_OUTPUT" | grep -qE '[0-9]+\.[0-9]+\.[0-9]+'; then
|
|
156
|
+
log_success "Version command works"
|
|
157
|
+
RESULTS+=("✓ Version command")
|
|
158
|
+
else
|
|
159
|
+
log_error "Version command failed"
|
|
160
|
+
echo "Output: $VERSION_OUTPUT"
|
|
161
|
+
RESULTS+=("✗ Version command")
|
|
162
|
+
FAILED=true
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# Test 2: Help command
|
|
166
|
+
echo -e "${YELLOW}Testing: cursorflow --help${NC}"
|
|
167
|
+
HELP_OUTPUT=$(node dist/cli/index.js --help 2>&1 || true)
|
|
168
|
+
if echo "$HELP_OUTPUT" | grep -qiE 'usage|commands|options'; then
|
|
169
|
+
log_success "Help command works"
|
|
170
|
+
RESULTS+=("✓ Help command")
|
|
171
|
+
else
|
|
172
|
+
log_error "Help command failed"
|
|
173
|
+
echo "Output: $HELP_OUTPUT"
|
|
174
|
+
RESULTS+=("✗ Help command")
|
|
175
|
+
FAILED=true
|
|
176
|
+
fi
|
|
177
|
+
|
|
178
|
+
# Test 3: Doctor command (in a temp directory to avoid git issues)
|
|
179
|
+
echo -e "${YELLOW}Testing: cursorflow doctor${NC}"
|
|
180
|
+
TEMP_DIR=$(mktemp -d)
|
|
181
|
+
cd "$TEMP_DIR"
|
|
182
|
+
git init -q 2>/dev/null || true
|
|
183
|
+
git config user.email "test@test.com" 2>/dev/null || true
|
|
184
|
+
git config user.name "Test" 2>/dev/null || true
|
|
185
|
+
touch README.md
|
|
186
|
+
git add . 2>/dev/null || true
|
|
187
|
+
git commit -m "init" -q 2>/dev/null || true
|
|
188
|
+
|
|
189
|
+
DOCTOR_OUTPUT=$(node "$ROOT_DIR/dist/cli/index.js" doctor 2>&1 || true)
|
|
190
|
+
cd "$ROOT_DIR"
|
|
191
|
+
rm -rf "$TEMP_DIR"
|
|
192
|
+
|
|
193
|
+
# Doctor should produce some output (even if checks fail)
|
|
194
|
+
if [ -n "$DOCTOR_OUTPUT" ] && ! echo "$DOCTOR_OUTPUT" | grep -qiE 'undefined is not|cannot read'; then
|
|
195
|
+
log_success "Doctor command works"
|
|
196
|
+
RESULTS+=("✓ Doctor command")
|
|
197
|
+
else
|
|
198
|
+
log_error "Doctor command has runtime errors"
|
|
199
|
+
echo "Output: $DOCTOR_OUTPUT"
|
|
200
|
+
RESULTS+=("✗ Doctor command")
|
|
201
|
+
FAILED=true
|
|
202
|
+
fi
|
|
203
|
+
|
|
204
|
+
# Step 5: Output Format Verification
|
|
205
|
+
log_step "Step 5: Output Format Verification"
|
|
206
|
+
|
|
207
|
+
# Check for common issues in CLI output
|
|
208
|
+
check_output_format() {
|
|
209
|
+
local cmd="$1"
|
|
210
|
+
local name="$2"
|
|
211
|
+
|
|
212
|
+
OUTPUT=$(node dist/cli/index.js $cmd 2>&1 || true)
|
|
213
|
+
|
|
214
|
+
# Check for runtime errors
|
|
215
|
+
if echo "$OUTPUT" | grep -qiE 'undefined is not|cannot read propert|null is not'; then
|
|
216
|
+
log_error "$name has JavaScript runtime errors"
|
|
217
|
+
return 1
|
|
218
|
+
fi
|
|
219
|
+
|
|
220
|
+
# Check for unhandled stack traces (but allow intentional error messages)
|
|
221
|
+
if echo "$OUTPUT" | grep -qE 'at\s+Object\.<anonymous>|at\s+Module\._compile'; then
|
|
222
|
+
log_warning "$name may have unhandled errors (stack trace detected)"
|
|
223
|
+
fi
|
|
224
|
+
|
|
225
|
+
return 0
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
run_check "Version output format" "check_output_format '--version' 'Version'"
|
|
229
|
+
run_check "Help output format" "check_output_format '--help' 'Help'"
|
|
230
|
+
|
|
231
|
+
# Step 6: Integration Tests (unless quick or smoke-only mode)
|
|
232
|
+
if ! $QUICK_MODE && ! $SMOKE_ONLY; then
|
|
233
|
+
log_step "Step 6: Integration Tests"
|
|
234
|
+
run_check "Integration tests" "npm run test:integration -- --passWithNoTests 2>/dev/null || true"
|
|
235
|
+
fi
|
|
236
|
+
|
|
237
|
+
# Step 7: Jest Smoke Tests
|
|
238
|
+
log_step "Step 7: Jest Smoke Tests"
|
|
239
|
+
if [ -f "tests/smoke/smoke.test.ts" ]; then
|
|
240
|
+
run_check "Jest smoke tests" "npx jest tests/smoke --passWithNoTests --runInBand 2>/dev/null"
|
|
241
|
+
else
|
|
242
|
+
log_warning "Smoke test file not found"
|
|
243
|
+
RESULTS+=("⚠ Jest smoke tests (skipped)")
|
|
244
|
+
fi
|
|
245
|
+
|
|
246
|
+
# Summary
|
|
247
|
+
echo -e "\n${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
248
|
+
echo -e "${BLUE} VERIFICATION SUMMARY ${NC}"
|
|
249
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
250
|
+
|
|
251
|
+
for result in "${RESULTS[@]}"; do
|
|
252
|
+
if [[ "$result" == ✓* ]]; then
|
|
253
|
+
echo -e "${GREEN}$result${NC}"
|
|
254
|
+
elif [[ "$result" == ✗* ]]; then
|
|
255
|
+
echo -e "${RED}$result${NC}"
|
|
256
|
+
else
|
|
257
|
+
echo -e "${YELLOW}$result${NC}"
|
|
258
|
+
fi
|
|
259
|
+
done
|
|
260
|
+
|
|
261
|
+
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
262
|
+
|
|
263
|
+
if $FAILED; then
|
|
264
|
+
echo -e "\n${RED}❌ Verification FAILED${NC}"
|
|
265
|
+
echo -e "${RED}Some checks did not pass. Please fix the issues before committing.${NC}"
|
|
266
|
+
exit 1
|
|
267
|
+
else
|
|
268
|
+
echo -e "\n${GREEN}✅ All verifications PASSED${NC}"
|
|
269
|
+
echo -e "${GREEN}Your changes look good!${NC}"
|
|
270
|
+
exit 0
|
|
271
|
+
fi
|
|
272
|
+
|
package/src/cli/logs.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
JsonLogEntry
|
|
15
15
|
} from '../utils/enhanced-logger';
|
|
16
16
|
import { formatPotentialJsonMessage } from '../utils/log-formatter';
|
|
17
|
+
import { MAIN_LOG_FILENAME } from '../utils/log-constants';
|
|
17
18
|
import { startLogViewer } from '../ui/log-viewer';
|
|
18
19
|
|
|
19
20
|
interface LogsOptions {
|
|
@@ -44,13 +45,13 @@ function printHelp(): void {
|
|
|
44
45
|
console.log(`
|
|
45
46
|
Usage: cursorflow logs [run-dir] [options]
|
|
46
47
|
|
|
47
|
-
View and export
|
|
48
|
+
View and export logs.
|
|
48
49
|
|
|
49
50
|
Options:
|
|
50
51
|
[run-dir] Run directory (default: latest)
|
|
51
52
|
--run <id> Specific run directory
|
|
52
|
-
--lane <name>
|
|
53
|
-
--all, -a View all
|
|
53
|
+
--lane <name> View a specific lane (subprocess) log
|
|
54
|
+
--all, -a View all lane logs merged (sorted by timestamp)
|
|
54
55
|
--format <fmt> Output format: text, json, markdown, html (default: text)
|
|
55
56
|
--output <path> Write output to file instead of stdout
|
|
56
57
|
--tail <n> Show last n lines/entries (default: all)
|
|
@@ -58,13 +59,13 @@ Options:
|
|
|
58
59
|
--interactive, -i Open interactive log viewer
|
|
59
60
|
--filter <pattern> Filter entries by regex pattern
|
|
60
61
|
--level <level> Filter by log level: stdout, stderr, info, error, debug
|
|
61
|
-
--readable, -r Show readable log (parsed AI output) (default)
|
|
62
|
-
--clean
|
|
62
|
+
--readable, -r Show readable lane log (parsed AI output) (default for lanes)
|
|
63
|
+
--clean Strip ANSI codes (default is raw for main logs)
|
|
63
64
|
--raw Show raw terminal logs with ANSI codes
|
|
64
65
|
--help, -h Show help
|
|
65
66
|
|
|
66
67
|
Examples:
|
|
67
|
-
cursorflow logs # View latest run
|
|
68
|
+
cursorflow logs # View latest run main log (raw)
|
|
68
69
|
cursorflow logs --lane api-setup # View readable parsed log (default)
|
|
69
70
|
cursorflow logs --lane api-setup --clean # View clean terminal logs
|
|
70
71
|
cursorflow logs --all # View all lanes merged by time
|
|
@@ -195,6 +196,35 @@ function displayTextLogs(
|
|
|
195
196
|
console.log(lines.join('\n'));
|
|
196
197
|
}
|
|
197
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Read and display main process logs
|
|
201
|
+
*/
|
|
202
|
+
function displayMainLogs(runDir: string, options: LogsOptions): void {
|
|
203
|
+
const logFile = safeJoin(runDir, MAIN_LOG_FILENAME);
|
|
204
|
+
if (!fs.existsSync(logFile)) {
|
|
205
|
+
console.log('No main log file found.');
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let content = fs.readFileSync(logFile, 'utf8');
|
|
210
|
+
let lines = content.split('\n');
|
|
211
|
+
|
|
212
|
+
if (options.filter) {
|
|
213
|
+
const filterLower = options.filter.toLowerCase();
|
|
214
|
+
lines = lines.filter(line => line.toLowerCase().includes(filterLower));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (options.tail && lines.length > options.tail) {
|
|
218
|
+
lines = lines.slice(-options.tail);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (options.clean) {
|
|
222
|
+
lines = lines.map(line => stripAnsi(line));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
console.log(lines.join('\n'));
|
|
226
|
+
}
|
|
227
|
+
|
|
198
228
|
/**
|
|
199
229
|
* Read and display JSON logs
|
|
200
230
|
*/
|
|
@@ -751,6 +781,68 @@ function followLogs(laneDir: string, options: LogsOptions): void {
|
|
|
751
781
|
});
|
|
752
782
|
}
|
|
753
783
|
|
|
784
|
+
/**
|
|
785
|
+
* Follow main process log in real-time
|
|
786
|
+
*/
|
|
787
|
+
function followMainLogs(runDir: string, options: LogsOptions): void {
|
|
788
|
+
const logFile = safeJoin(runDir, MAIN_LOG_FILENAME);
|
|
789
|
+
|
|
790
|
+
if (!fs.existsSync(logFile)) {
|
|
791
|
+
console.log('Waiting for main log file...');
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
let lastSize = 0;
|
|
795
|
+
try {
|
|
796
|
+
lastSize = fs.statSync(logFile).size;
|
|
797
|
+
} catch {
|
|
798
|
+
lastSize = 0;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
console.log(`${logger.COLORS.cyan}Following ${logFile}... (Ctrl+C to stop)${logger.COLORS.reset}\n`);
|
|
802
|
+
|
|
803
|
+
const checkInterval = setInterval(() => {
|
|
804
|
+
let fd: number | null = null;
|
|
805
|
+
try {
|
|
806
|
+
fd = fs.openSync(logFile, 'r');
|
|
807
|
+
const stats = fs.fstatSync(fd);
|
|
808
|
+
if (stats.size > lastSize) {
|
|
809
|
+
const buffer = Buffer.alloc(stats.size - lastSize);
|
|
810
|
+
fs.readSync(fd, buffer, 0, buffer.length, lastSize);
|
|
811
|
+
|
|
812
|
+
let content = buffer.toString();
|
|
813
|
+
|
|
814
|
+
if (options.filter) {
|
|
815
|
+
const filterLower = options.filter.toLowerCase();
|
|
816
|
+
const lines = content.split('\n');
|
|
817
|
+
content = lines.filter(line => line.toLowerCase().includes(filterLower)).join('\n');
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
if (options.clean) {
|
|
821
|
+
content = stripAnsi(content);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
if (content.trim()) {
|
|
825
|
+
process.stdout.write(content);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
lastSize = stats.size;
|
|
829
|
+
}
|
|
830
|
+
} catch {
|
|
831
|
+
// Ignore errors (file might be rotating)
|
|
832
|
+
} finally {
|
|
833
|
+
if (fd !== null) {
|
|
834
|
+
try { fs.closeSync(fd); } catch { /* ignore */ }
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}, 100);
|
|
838
|
+
|
|
839
|
+
process.on('SIGINT', () => {
|
|
840
|
+
clearInterval(checkInterval);
|
|
841
|
+
console.log('\n\nStopped following logs.');
|
|
842
|
+
process.exit(0);
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
|
|
754
846
|
/**
|
|
755
847
|
* Display logs summary for all lanes
|
|
756
848
|
*/
|
|
@@ -865,10 +957,30 @@ async function logs(args: string[]): Promise<void> {
|
|
|
865
957
|
return;
|
|
866
958
|
}
|
|
867
959
|
|
|
868
|
-
// If no lane specified, show
|
|
960
|
+
// If no lane specified, show main process log by default
|
|
869
961
|
if (!options.lane) {
|
|
870
|
-
|
|
871
|
-
|
|
962
|
+
if (options.follow) {
|
|
963
|
+
followMainLogs(runDir, options);
|
|
964
|
+
return;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
if (options.output) {
|
|
968
|
+
const logFile = safeJoin(runDir, MAIN_LOG_FILENAME);
|
|
969
|
+
if (!fs.existsSync(logFile)) {
|
|
970
|
+
console.log('No main log file found.');
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
let content = fs.readFileSync(logFile, 'utf8');
|
|
974
|
+
if (options.clean) {
|
|
975
|
+
content = stripAnsi(content);
|
|
976
|
+
}
|
|
977
|
+
fs.writeFileSync(options.output, content, 'utf8');
|
|
978
|
+
console.log(`Exported main log to: ${options.output}`);
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
displayMainLogs(runDir, options);
|
|
983
|
+
console.log(`${logger.COLORS.gray}Use --lane <name> for lane logs, --all to merge lanes, or --clean to strip ANSI codes.${logger.COLORS.reset}`);
|
|
872
984
|
return;
|
|
873
985
|
}
|
|
874
986
|
|
|
@@ -904,4 +1016,3 @@ async function logs(args: string[]): Promise<void> {
|
|
|
904
1016
|
}
|
|
905
1017
|
|
|
906
1018
|
export = logs;
|
|
907
|
-
|
package/src/cli/models.ts
CHANGED
|
@@ -9,16 +9,33 @@ import { getAvailableModels } from '../utils/cursor-agent';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Model details metadata
|
|
12
|
+
* Reference: docs/CURSOR_AGENT_GUIDE.md (2025.12 version)
|
|
12
13
|
*/
|
|
13
14
|
const MODEL_METADATA: Record<string, { name: string; provider: string; description: string }> = {
|
|
15
|
+
// Special modes
|
|
16
|
+
'composer-1': { name: 'Composer 1', provider: 'Cursor', description: 'Multi-file orchestration mode' },
|
|
17
|
+
'auto': { name: 'Auto', provider: 'Cursor', description: 'Automatic model selection' },
|
|
18
|
+
// Anthropic Claude models
|
|
14
19
|
'sonnet-4.5': { name: 'Claude 3.7 Sonnet', provider: 'Anthropic', description: 'General implementation, fast work (Most versatile)' },
|
|
15
|
-
'sonnet-4.5-thinking': { name: 'Claude 3.7 Sonnet (Thinking)', provider: 'Anthropic', description: '
|
|
20
|
+
'sonnet-4.5-thinking': { name: 'Claude 3.7 Sonnet (Thinking)', provider: 'Anthropic', description: 'Deeper reasoning (Thinking model)' },
|
|
16
21
|
'opus-4.5': { name: 'Claude 4.0 Opus', provider: 'Anthropic', description: 'Complex tasks, high quality (Advanced)' },
|
|
17
22
|
'opus-4.5-thinking': { name: 'Claude 4.0 Opus (Thinking)', provider: 'Anthropic', description: 'Architecture design (Premium)' },
|
|
23
|
+
'opus-4.1': { name: 'Claude 4.1 Opus', provider: 'Anthropic', description: 'Latest Opus model' },
|
|
24
|
+
// Google Gemini models
|
|
25
|
+
'gemini-3-flash': { name: 'Gemini 3 Flash', provider: 'Google', description: 'Fast, general tasks (Default)' },
|
|
26
|
+
'gemini-3-pro': { name: 'Gemini 3 Pro', provider: 'Google', description: 'Advanced reasoning (High performance)' },
|
|
27
|
+
// OpenAI GPT models
|
|
18
28
|
'gpt-5.2': { name: 'GPT-5.2', provider: 'OpenAI', description: 'General tasks' },
|
|
19
29
|
'gpt-5.2-high': { name: 'GPT-5.2 High Reasoning', provider: 'OpenAI', description: 'Advanced reasoning (High performance)' },
|
|
20
|
-
'
|
|
21
|
-
'
|
|
30
|
+
'gpt-5.1': { name: 'GPT-5.1', provider: 'OpenAI', description: 'General tasks' },
|
|
31
|
+
'gpt-5.1-high': { name: 'GPT-5.1 High Reasoning', provider: 'OpenAI', description: 'Advanced reasoning' },
|
|
32
|
+
// OpenAI Codex models
|
|
33
|
+
'gpt-5.1-codex': { name: 'GPT-5.1 Codex', provider: 'OpenAI', description: 'Code-optimized model' },
|
|
34
|
+
'gpt-5.1-codex-high': { name: 'GPT-5.1 Codex High', provider: 'OpenAI', description: 'Code-optimized (High performance)' },
|
|
35
|
+
'gpt-5.1-codex-max': { name: 'GPT-5.1 Codex Max', provider: 'OpenAI', description: 'Code-optimized (Maximum)' },
|
|
36
|
+
'gpt-5.1-codex-max-high': { name: 'GPT-5.1 Codex Max High', provider: 'OpenAI', description: 'Code-optimized (Maximum, High performance)' },
|
|
37
|
+
// xAI
|
|
38
|
+
'grok': { name: 'Grok', provider: 'xAI', description: 'xAI Grok model' },
|
|
22
39
|
};
|
|
23
40
|
|
|
24
41
|
function printHelp(): void {
|