@vibe-validate/cli 0.14.2 → 0.14.3
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/dist/bin.js +23 -17
- package/dist/bin.js.map +1 -1
- package/dist/commands/cleanup.d.ts.map +1 -1
- package/dist/commands/cleanup.js +32 -19
- package/dist/commands/cleanup.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +12 -9
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +212 -187
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/generate-workflow.d.ts.map +1 -1
- package/dist/commands/generate-workflow.js +22 -12
- package/dist/commands/generate-workflow.js.map +1 -1
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +46 -34
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pre-commit.d.ts.map +1 -1
- package/dist/commands/pre-commit.js +2 -1
- package/dist/commands/pre-commit.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +8 -9
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +2 -1
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/watch-pr.d.ts.map +1 -1
- package/dist/commands/watch-pr.js +43 -36
- package/dist/commands/watch-pr.js.map +1 -1
- package/dist/schemas/watch-pr-schema.d.ts +31 -31
- package/dist/scripts/generate-watch-pr-schema.js +3 -3
- package/dist/scripts/generate-watch-pr-schema.js.map +1 -1
- package/dist/services/ci-providers/github-actions.d.ts +25 -0
- package/dist/services/ci-providers/github-actions.d.ts.map +1 -1
- package/dist/services/ci-providers/github-actions.js +83 -46
- package/dist/services/ci-providers/github-actions.js.map +1 -1
- package/dist/utils/check-validation.d.ts.map +1 -1
- package/dist/utils/check-validation.js +9 -5
- package/dist/utils/check-validation.js.map +1 -1
- package/dist/utils/config-error-reporter.js +8 -6
- package/dist/utils/config-error-reporter.js.map +1 -1
- package/dist/utils/config-loader.js +5 -5
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/git-detection.d.ts +0 -22
- package/dist/utils/git-detection.d.ts.map +1 -1
- package/dist/utils/git-detection.js +64 -56
- package/dist/utils/git-detection.js.map +1 -1
- package/dist/utils/pid-lock.d.ts.map +1 -1
- package/dist/utils/pid-lock.js +10 -7
- package/dist/utils/pid-lock.js.map +1 -1
- package/dist/utils/project-id.d.ts.map +1 -1
- package/dist/utils/project-id.js +9 -6
- package/dist/utils/project-id.js.map +1 -1
- package/dist/utils/runner-adapter.js +1 -1
- package/dist/utils/runner-adapter.js.map +1 -1
- package/dist/utils/setup-checks/hooks-check.js +3 -3
- package/dist/utils/setup-checks/hooks-check.js.map +1 -1
- package/dist/utils/setup-checks/workflow-check.js +3 -3
- package/dist/utils/setup-checks/workflow-check.js.map +1 -1
- package/dist/utils/template-discovery.d.ts.map +1 -1
- package/dist/utils/template-discovery.js +5 -4
- package/dist/utils/template-discovery.js.map +1 -1
- package/dist/utils/validate-workflow.d.ts.map +1 -1
- package/dist/utils/validate-workflow.js +164 -150
- package/dist/utils/validate-workflow.js.map +1 -1
- package/package.json +6 -6
|
@@ -10,6 +10,157 @@ import { recordValidationHistory, checkWorktreeStability, checkHistoryHealth, re
|
|
|
10
10
|
import { createRunnerConfig } from './runner-adapter.js';
|
|
11
11
|
import chalk from 'chalk';
|
|
12
12
|
import { stringify as yamlStringify } from 'yaml';
|
|
13
|
+
/**
|
|
14
|
+
* Wait for stdout to flush before continuing
|
|
15
|
+
*
|
|
16
|
+
* Critical for YAML output when stdout is redirected to a file (CI).
|
|
17
|
+
* Without this, process.exit() can kill the process before the write buffer flushes.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
async function flushStdout() {
|
|
22
|
+
await new Promise(resolve => {
|
|
23
|
+
if (process.stdout.write('')) {
|
|
24
|
+
resolve();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
process.stdout.once('drain', resolve);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Output validation result as YAML
|
|
33
|
+
*
|
|
34
|
+
* @param result - Validation result to output
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
async function outputYaml(result) {
|
|
38
|
+
// Small delay to ensure stderr is flushed before writing to stdout
|
|
39
|
+
await new Promise(resolve => setTimeout(resolve, 10));
|
|
40
|
+
// Output YAML document separator (RFC 4627)
|
|
41
|
+
process.stdout.write('---\n');
|
|
42
|
+
process.stdout.write(yamlStringify(result));
|
|
43
|
+
await flushStdout();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check cache for passing validation run
|
|
47
|
+
*
|
|
48
|
+
* @param treeHash - Git tree hash to check
|
|
49
|
+
* @param yaml - Whether YAML output mode is enabled
|
|
50
|
+
* @returns Cached result if found, null otherwise
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
async function checkCache(treeHash, yaml) {
|
|
54
|
+
try {
|
|
55
|
+
const historyNote = await readHistoryNote(treeHash);
|
|
56
|
+
if (historyNote && historyNote.runs.length > 0) {
|
|
57
|
+
// Find most recent passing run
|
|
58
|
+
const passingRun = [...historyNote.runs]
|
|
59
|
+
.reverse()
|
|
60
|
+
.find(run => run.passed);
|
|
61
|
+
if (passingRun) {
|
|
62
|
+
if (yaml) {
|
|
63
|
+
await outputYaml(passingRun.result);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const durationSecs = (passingRun.duration / 1000).toFixed(1);
|
|
67
|
+
console.log(chalk.green('✅ Validation already passed for current working tree'));
|
|
68
|
+
console.log(chalk.gray(` Tree hash: ${treeHash.substring(0, 12)}...`));
|
|
69
|
+
console.log(chalk.gray(` Last validated: ${passingRun.timestamp}`));
|
|
70
|
+
console.log(chalk.gray(` Duration: ${durationSecs}s`));
|
|
71
|
+
console.log(chalk.gray(` Branch: ${passingRun.branch}`));
|
|
72
|
+
if (passingRun.result.phases) {
|
|
73
|
+
const totalSteps = passingRun.result.phases.reduce((sum, phase) => sum + phase.steps.length, 0);
|
|
74
|
+
console.log(chalk.gray(` Phases: ${passingRun.result.phases.length}, Steps: ${totalSteps}`));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Mark result as from cache
|
|
78
|
+
const result = passingRun.result;
|
|
79
|
+
result._fromCache = true;
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
// Cache check failed - proceed with validation
|
|
86
|
+
console.debug(`Cache check failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Record validation history with stability check
|
|
92
|
+
*
|
|
93
|
+
* @param treeHashBefore - Tree hash before validation
|
|
94
|
+
* @param result - Validation result to record
|
|
95
|
+
* @param verbose - Whether verbose output is enabled
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
async function recordHistory(treeHashBefore, result, verbose) {
|
|
99
|
+
try {
|
|
100
|
+
// Check if worktree changed during validation
|
|
101
|
+
const stability = await checkWorktreeStability(treeHashBefore);
|
|
102
|
+
if (!stability.stable) {
|
|
103
|
+
console.warn(chalk.yellow('\n⚠️ Worktree changed during validation'));
|
|
104
|
+
console.warn(chalk.yellow(` Before: ${stability.treeHashBefore.slice(0, 12)}...`));
|
|
105
|
+
console.warn(chalk.yellow(` After: ${stability.treeHashAfter.slice(0, 12)}...`));
|
|
106
|
+
console.warn(chalk.yellow(' Results valid but history not recorded (unstable state)'));
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
// Record to git notes
|
|
110
|
+
const recordResult = await recordValidationHistory(treeHashBefore, result);
|
|
111
|
+
if (recordResult.recorded) {
|
|
112
|
+
if (verbose) {
|
|
113
|
+
console.log(chalk.gray(`\n📝 History recorded (tree: ${treeHashBefore.slice(0, 12)})`));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else if (verbose) {
|
|
117
|
+
console.warn(chalk.yellow(`⚠️ History recording failed: ${recordResult.reason}`));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
// Silent failure - don't block validation
|
|
123
|
+
if (verbose) {
|
|
124
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
125
|
+
console.warn(chalk.yellow(`⚠️ History recording error: ${errorMessage}`));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Display failure information and extraction quality feedback
|
|
131
|
+
*
|
|
132
|
+
* @param result - Validation result (failed)
|
|
133
|
+
* @param config - Vibe validate configuration
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
function displayFailureInfo(result, config) {
|
|
137
|
+
console.error(chalk.blue('\n📋 View error details:'), chalk.white('vibe-validate state'));
|
|
138
|
+
if (result.rerunCommand) {
|
|
139
|
+
console.error(chalk.blue('🔄 To retry:'), chalk.white(result.rerunCommand));
|
|
140
|
+
}
|
|
141
|
+
if (result.fullLogFile) {
|
|
142
|
+
console.error(chalk.blue('📄 Full log:'), chalk.gray(result.fullLogFile));
|
|
143
|
+
}
|
|
144
|
+
// Context-aware extraction quality feedback (only when developerFeedback is enabled)
|
|
145
|
+
if (config.developerFeedback) {
|
|
146
|
+
const poorExtractionSteps = result.phases
|
|
147
|
+
?.flatMap(phase => phase.steps)
|
|
148
|
+
.filter(step => !step.passed && step.extractionQuality && step.extractionQuality.score < 50);
|
|
149
|
+
if (poorExtractionSteps && poorExtractionSteps.length > 0) {
|
|
150
|
+
const isDogfooding = process.cwd().includes('vibe-validate');
|
|
151
|
+
console.error('');
|
|
152
|
+
console.error(chalk.yellow('⚠️ Poor extraction quality detected'));
|
|
153
|
+
if (isDogfooding) {
|
|
154
|
+
console.error(chalk.yellow(' 💡 vibe-validate improvement opportunity: Improve extractors in packages/extractors/'));
|
|
155
|
+
console.error(chalk.gray(' See packages/extractors/test/samples/ for how to add test cases'));
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
console.error(chalk.yellow(' 💡 Help improve vibe-validate by reporting this extraction issue'));
|
|
159
|
+
console.error(chalk.gray(' https://github.com/anthropics/vibe-validate/issues/new?template=extractor-improvement.yml'));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
13
164
|
/**
|
|
14
165
|
* Execute validation workflow with caching, history recording, and output formatting.
|
|
15
166
|
*
|
|
@@ -20,6 +171,7 @@ import { stringify as yamlStringify } from 'yaml';
|
|
|
20
171
|
* @returns Validation result
|
|
21
172
|
* @throws Error if validation encounters fatal error
|
|
22
173
|
*/
|
|
174
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- Complexity 27 acceptable for workflow orchestration (down from 81) - coordinates caching, validation, history recording, and output formatting
|
|
23
175
|
export async function runValidateWorkflow(config, options) {
|
|
24
176
|
try {
|
|
25
177
|
// If --check flag is used, only check validation state without running
|
|
@@ -27,8 +179,6 @@ export async function runValidateWorkflow(config, options) {
|
|
|
27
179
|
const yaml = options.yaml ?? false;
|
|
28
180
|
const { checkValidationStatus } = await import('./check-validation.js');
|
|
29
181
|
await checkValidationStatus(config, yaml);
|
|
30
|
-
// checkValidationStatus calls process.exit, so this line never executes
|
|
31
|
-
// But TypeScript doesn't know that, so we need to satisfy the return type
|
|
32
182
|
throw new Error('checkValidationStatus should have exited');
|
|
33
183
|
}
|
|
34
184
|
const verbose = options.verbose ?? false;
|
|
@@ -45,68 +195,20 @@ export async function runValidateWorkflow(config, options) {
|
|
|
45
195
|
try {
|
|
46
196
|
treeHashBefore = await getGitTreeHash();
|
|
47
197
|
}
|
|
48
|
-
catch (
|
|
49
|
-
|
|
198
|
+
catch (error) {
|
|
199
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
50
200
|
if (verbose) {
|
|
51
|
-
console.warn(chalk.yellow(
|
|
201
|
+
console.warn(chalk.yellow(`⚠️ Could not get git tree hash - history recording disabled: ${errorMsg}`));
|
|
52
202
|
}
|
|
53
203
|
}
|
|
54
204
|
// Check cache: if validation already passed for this tree hash, skip re-running
|
|
55
205
|
if (treeHashBefore && !options.force) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// Find most recent passing run
|
|
60
|
-
const passingRun = [...historyNote.runs]
|
|
61
|
-
.reverse()
|
|
62
|
-
.find(run => run.passed);
|
|
63
|
-
if (passingRun) {
|
|
64
|
-
if (yaml) {
|
|
65
|
-
// YAML mode: Output cached result as YAML to stdout
|
|
66
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
67
|
-
// Output YAML document separator (RFC 4627)
|
|
68
|
-
process.stdout.write('---\n');
|
|
69
|
-
process.stdout.write(yamlStringify(passingRun.result));
|
|
70
|
-
// Wait for stdout to flush before exiting
|
|
71
|
-
await new Promise(resolve => {
|
|
72
|
-
if (process.stdout.write('')) {
|
|
73
|
-
resolve();
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
process.stdout.once('drain', resolve);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
// Human-readable mode: Display cache hit message
|
|
82
|
-
const durationSecs = (passingRun.duration / 1000).toFixed(1);
|
|
83
|
-
console.log(chalk.green('✅ Validation already passed for current working tree'));
|
|
84
|
-
console.log(chalk.gray(` Tree hash: ${treeHashBefore.substring(0, 12)}...`));
|
|
85
|
-
console.log(chalk.gray(` Last validated: ${passingRun.timestamp}`));
|
|
86
|
-
console.log(chalk.gray(` Duration: ${durationSecs}s`));
|
|
87
|
-
console.log(chalk.gray(` Branch: ${passingRun.branch}`));
|
|
88
|
-
if (passingRun.result?.phases) {
|
|
89
|
-
const totalSteps = passingRun.result.phases.reduce((sum, phase) => sum + (phase.steps?.length || 0), 0);
|
|
90
|
-
console.log(chalk.gray(` Phases: ${passingRun.result.phases.length}, Steps: ${totalSteps}`));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
// Cache hit - return early without calling process.exit
|
|
94
|
-
// This allows tests to complete without throwing process.exit errors
|
|
95
|
-
// In production, Commander will exit with code 0
|
|
96
|
-
// Mark result as from cache so caller knows not to call process.exit
|
|
97
|
-
const result = passingRun.result;
|
|
98
|
-
result._fromCache = true;
|
|
99
|
-
return result;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
catch (_error) {
|
|
104
|
-
// Cache check failed - proceed with validation
|
|
105
|
-
// This is expected for first-time validation
|
|
206
|
+
const cachedResult = await checkCache(treeHashBefore, yaml);
|
|
207
|
+
if (cachedResult) {
|
|
208
|
+
return cachedResult;
|
|
106
209
|
}
|
|
107
210
|
}
|
|
108
|
-
// Display tree hash before running validation
|
|
109
|
-
// This goes to stderr, so it's visible even in YAML mode
|
|
211
|
+
// Display tree hash before running validation
|
|
110
212
|
if (treeHashBefore) {
|
|
111
213
|
console.error(chalk.gray(`🌳 Working tree: ${treeHashBefore.slice(0, 12)}...`));
|
|
112
214
|
if (!yaml) {
|
|
@@ -115,37 +217,9 @@ export async function runValidateWorkflow(config, options) {
|
|
|
115
217
|
}
|
|
116
218
|
// Run validation
|
|
117
219
|
const result = await runValidation(runnerConfig);
|
|
118
|
-
// Record validation history (if in git repo
|
|
220
|
+
// Record validation history (if in git repo)
|
|
119
221
|
if (treeHashBefore) {
|
|
120
|
-
|
|
121
|
-
// Check if worktree changed during validation
|
|
122
|
-
const stability = await checkWorktreeStability(treeHashBefore);
|
|
123
|
-
if (!stability.stable) {
|
|
124
|
-
console.warn(chalk.yellow('\n⚠️ Worktree changed during validation'));
|
|
125
|
-
console.warn(chalk.yellow(` Before: ${stability.treeHashBefore.slice(0, 12)}...`));
|
|
126
|
-
console.warn(chalk.yellow(` After: ${stability.treeHashAfter.slice(0, 12)}...`));
|
|
127
|
-
console.warn(chalk.yellow(' Results valid but history not recorded (unstable state)'));
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
// Record to git notes
|
|
131
|
-
const recordResult = await recordValidationHistory(treeHashBefore, result);
|
|
132
|
-
if (recordResult.recorded) {
|
|
133
|
-
if (verbose) {
|
|
134
|
-
console.log(chalk.gray(`\n📝 History recorded (tree: ${treeHashBefore.slice(0, 12)})`));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
else if (verbose) {
|
|
138
|
-
console.warn(chalk.yellow(`⚠️ History recording failed: ${recordResult.reason}`));
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
// Silent failure - don't block validation
|
|
144
|
-
if (verbose) {
|
|
145
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
146
|
-
console.warn(chalk.yellow(`⚠️ History recording error: ${errorMessage}`));
|
|
147
|
-
}
|
|
148
|
-
}
|
|
222
|
+
await recordHistory(treeHashBefore, result, verbose);
|
|
149
223
|
}
|
|
150
224
|
// Proactive health check (non-blocking)
|
|
151
225
|
try {
|
|
@@ -160,58 +234,11 @@ export async function runValidateWorkflow(config, options) {
|
|
|
160
234
|
}
|
|
161
235
|
// If validation failed, show agent-friendly error details
|
|
162
236
|
if (!result.passed) {
|
|
163
|
-
|
|
164
|
-
if (result.rerunCommand) {
|
|
165
|
-
console.error(chalk.blue('🔄 To retry:'), chalk.white(result.rerunCommand));
|
|
166
|
-
}
|
|
167
|
-
if (result.fullLogFile) {
|
|
168
|
-
console.error(chalk.blue('📄 Full log:'), chalk.gray(result.fullLogFile));
|
|
169
|
-
}
|
|
170
|
-
// Context-aware extraction quality feedback (only when developerFeedback is enabled)
|
|
171
|
-
if (config.developerFeedback) {
|
|
172
|
-
// Check if any steps had poor extraction quality
|
|
173
|
-
const poorExtractionSteps = result.phases
|
|
174
|
-
?.flatMap(phase => phase.steps || [])
|
|
175
|
-
.filter(step => !step.passed && step.extractionQuality && step.extractionQuality.score < 50);
|
|
176
|
-
if (poorExtractionSteps && poorExtractionSteps.length > 0) {
|
|
177
|
-
// Detect if we're dogfooding (in the vibe-validate project itself)
|
|
178
|
-
const isDogfooding = process.cwd().includes('vibe-validate');
|
|
179
|
-
console.error('');
|
|
180
|
-
console.error(chalk.yellow('⚠️ Poor extraction quality detected'));
|
|
181
|
-
if (isDogfooding) {
|
|
182
|
-
// Developing vibe-validate itself: direct contributor call-to-action
|
|
183
|
-
console.error(chalk.yellow(' 💡 vibe-validate improvement opportunity: Improve extractors in packages/extractors/'));
|
|
184
|
-
console.error(chalk.gray(' See packages/extractors/test/samples/ for how to add test cases'));
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
// External project: user feedback to improve vibe-validate
|
|
188
|
-
console.error(chalk.yellow(' 💡 Help improve vibe-validate by reporting this extraction issue'));
|
|
189
|
-
console.error(chalk.gray(' https://github.com/anthropics/vibe-validate/issues/new?template=extractor-improvement.yml'));
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
237
|
+
displayFailureInfo(result, config);
|
|
193
238
|
}
|
|
194
239
|
// Output YAML validation result if --yaml flag is set
|
|
195
240
|
if (yaml) {
|
|
196
|
-
|
|
197
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
198
|
-
// Output YAML document separator (RFC 4627) to mark transition from stderr to stdout
|
|
199
|
-
process.stdout.write('---\n');
|
|
200
|
-
// Output pure YAML without headers (workflow provides display framing)
|
|
201
|
-
process.stdout.write(yamlStringify(result));
|
|
202
|
-
// CRITICAL: Wait for stdout to flush before exiting
|
|
203
|
-
// When stdout is redirected to a file (CI), process.exit() can kill the process
|
|
204
|
-
// before the write buffer is flushed, causing truncated output
|
|
205
|
-
await new Promise(resolve => {
|
|
206
|
-
if (process.stdout.write('')) {
|
|
207
|
-
// Write buffer is empty, can exit immediately
|
|
208
|
-
resolve();
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
// Wait for drain event
|
|
212
|
-
process.stdout.once('drain', resolve);
|
|
213
|
-
}
|
|
214
|
-
});
|
|
241
|
+
await outputYaml(result);
|
|
215
242
|
}
|
|
216
243
|
return result;
|
|
217
244
|
}
|
|
@@ -225,20 +252,7 @@ export async function runValidateWorkflow(config, options) {
|
|
|
225
252
|
error: error instanceof Error ? error.message : String(error),
|
|
226
253
|
errorStack: error instanceof Error ? error.stack : undefined,
|
|
227
254
|
};
|
|
228
|
-
|
|
229
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
230
|
-
// Output YAML document separator
|
|
231
|
-
process.stdout.write('---\n');
|
|
232
|
-
process.stdout.write(yamlStringify(errorResult));
|
|
233
|
-
// Wait for stdout to flush before exiting
|
|
234
|
-
await new Promise(resolve => {
|
|
235
|
-
if (process.stdout.write('')) {
|
|
236
|
-
resolve();
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
process.stdout.once('drain', resolve);
|
|
240
|
-
}
|
|
241
|
-
});
|
|
255
|
+
await outputYaml(errorResult);
|
|
242
256
|
}
|
|
243
257
|
// Re-throw to allow caller to handle exit
|
|
244
258
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-workflow.js","sourceRoot":"","sources":["../../src/utils/validate-workflow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,S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,MAAM,CAAC,CAAC;QACrC,CAAC;QAED,sDAAsD;QACtD,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,iCAAiC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEnE,iEAAiE;QACjE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,WAAW,GAAG;gBAClB,MAAM,EAAE,KAAK;gBACb,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACnC,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC7D,UAAU,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;aAC7D,CAAC;YAEF,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QAED,0CAA0C;QAC1C,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-validate/cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.3",
|
|
4
4
|
"description": "Command-line interface for vibe-validate validation framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"yaml": "^2.6.1",
|
|
61
61
|
"zod": "^3.24.1",
|
|
62
62
|
"zod-to-json-schema": "^3.24.6",
|
|
63
|
-
"@vibe-validate/
|
|
64
|
-
"@vibe-validate/
|
|
65
|
-
"@vibe-validate/extractors": "0.14.
|
|
66
|
-
"@vibe-validate/git": "0.14.
|
|
67
|
-
"@vibe-validate/history": "0.14.
|
|
63
|
+
"@vibe-validate/config": "0.14.3",
|
|
64
|
+
"@vibe-validate/core": "0.14.3",
|
|
65
|
+
"@vibe-validate/extractors": "0.14.3",
|
|
66
|
+
"@vibe-validate/git": "0.14.3",
|
|
67
|
+
"@vibe-validate/history": "0.14.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/node": "^20.14.8",
|