@vibe-validate/cli 0.10.3 → 0.12.0

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 (108) hide show
  1. package/README.md +84 -92
  2. package/dist/bin.js +137 -20
  3. package/dist/bin.js.map +1 -1
  4. package/dist/commands/cleanup.d.ts +4 -0
  5. package/dist/commands/cleanup.d.ts.map +1 -1
  6. package/dist/commands/cleanup.js +96 -15
  7. package/dist/commands/cleanup.js.map +1 -1
  8. package/dist/commands/config.d.ts +4 -0
  9. package/dist/commands/config.d.ts.map +1 -1
  10. package/dist/commands/config.js +83 -15
  11. package/dist/commands/config.js.map +1 -1
  12. package/dist/commands/doctor.d.ts +4 -0
  13. package/dist/commands/doctor.d.ts.map +1 -1
  14. package/dist/commands/doctor.js +385 -82
  15. package/dist/commands/doctor.js.map +1 -1
  16. package/dist/commands/generate-workflow.d.ts +6 -2
  17. package/dist/commands/generate-workflow.d.ts.map +1 -1
  18. package/dist/commands/generate-workflow.js +188 -33
  19. package/dist/commands/generate-workflow.js.map +1 -1
  20. package/dist/commands/history.d.ts +13 -0
  21. package/dist/commands/history.d.ts.map +1 -0
  22. package/dist/commands/history.js +415 -0
  23. package/dist/commands/history.js.map +1 -0
  24. package/dist/commands/init.d.ts +4 -0
  25. package/dist/commands/init.d.ts.map +1 -1
  26. package/dist/commands/init.js +252 -109
  27. package/dist/commands/init.js.map +1 -1
  28. package/dist/commands/pre-commit.d.ts +4 -0
  29. package/dist/commands/pre-commit.d.ts.map +1 -1
  30. package/dist/commands/pre-commit.js +158 -7
  31. package/dist/commands/pre-commit.js.map +1 -1
  32. package/dist/commands/state.d.ts +5 -1
  33. package/dist/commands/state.d.ts.map +1 -1
  34. package/dist/commands/state.js +192 -23
  35. package/dist/commands/state.js.map +1 -1
  36. package/dist/commands/sync-check.d.ts +4 -0
  37. package/dist/commands/sync-check.d.ts.map +1 -1
  38. package/dist/commands/sync-check.js +101 -14
  39. package/dist/commands/sync-check.js.map +1 -1
  40. package/dist/commands/validate.d.ts +5 -1
  41. package/dist/commands/validate.d.ts.map +1 -1
  42. package/dist/commands/validate.js +184 -28
  43. package/dist/commands/validate.js.map +1 -1
  44. package/dist/commands/watch-pr.d.ts +10 -0
  45. package/dist/commands/watch-pr.d.ts.map +1 -0
  46. package/dist/commands/watch-pr.js +443 -0
  47. package/dist/commands/watch-pr.js.map +1 -0
  48. package/dist/schemas/watch-pr-schema.d.ts +261 -0
  49. package/dist/schemas/watch-pr-schema.d.ts.map +1 -0
  50. package/dist/schemas/watch-pr-schema.js +58 -0
  51. package/dist/schemas/watch-pr-schema.js.map +1 -0
  52. package/dist/scripts/generate-watch-pr-schema.d.ts +12 -0
  53. package/dist/scripts/generate-watch-pr-schema.d.ts.map +1 -0
  54. package/dist/scripts/generate-watch-pr-schema.js +35 -0
  55. package/dist/scripts/generate-watch-pr-schema.js.map +1 -0
  56. package/dist/services/ci-provider-registry.d.ts +38 -0
  57. package/dist/services/ci-provider-registry.d.ts.map +1 -0
  58. package/dist/services/ci-provider-registry.js +53 -0
  59. package/dist/services/ci-provider-registry.js.map +1 -0
  60. package/dist/services/ci-provider.d.ts +165 -0
  61. package/dist/services/ci-provider.d.ts.map +1 -0
  62. package/dist/services/ci-provider.js +11 -0
  63. package/dist/services/ci-provider.js.map +1 -0
  64. package/dist/services/ci-providers/github-actions.d.ts +41 -0
  65. package/dist/services/ci-providers/github-actions.d.ts.map +1 -0
  66. package/dist/services/ci-providers/github-actions.js +314 -0
  67. package/dist/services/ci-providers/github-actions.js.map +1 -0
  68. package/dist/utils/check-validation.d.ts +7 -4
  69. package/dist/utils/check-validation.d.ts.map +1 -1
  70. package/dist/utils/check-validation.js +129 -48
  71. package/dist/utils/check-validation.js.map +1 -1
  72. package/dist/utils/config-loader.d.ts +15 -3
  73. package/dist/utils/config-loader.d.ts.map +1 -1
  74. package/dist/utils/config-loader.js +61 -17
  75. package/dist/utils/config-loader.js.map +1 -1
  76. package/dist/utils/context-detector.d.ts +1 -1
  77. package/dist/utils/context-detector.js +1 -1
  78. package/dist/utils/normalize-line-endings.d.ts +53 -0
  79. package/dist/utils/normalize-line-endings.d.ts.map +1 -0
  80. package/dist/utils/normalize-line-endings.js +57 -0
  81. package/dist/utils/normalize-line-endings.js.map +1 -0
  82. package/dist/utils/run-validation-with-cache.d.ts +48 -0
  83. package/dist/utils/run-validation-with-cache.d.ts.map +1 -0
  84. package/dist/utils/run-validation-with-cache.js +123 -0
  85. package/dist/utils/run-validation-with-cache.js.map +1 -0
  86. package/dist/utils/runner-adapter.d.ts +1 -0
  87. package/dist/utils/runner-adapter.d.ts.map +1 -1
  88. package/dist/utils/runner-adapter.js +25 -17
  89. package/dist/utils/runner-adapter.js.map +1 -1
  90. package/dist/utils/setup-checks/gitignore-check.d.ts +10 -15
  91. package/dist/utils/setup-checks/gitignore-check.d.ts.map +1 -1
  92. package/dist/utils/setup-checks/gitignore-check.js +20 -138
  93. package/dist/utils/setup-checks/gitignore-check.js.map +1 -1
  94. package/dist/utils/template-discovery.d.ts +40 -0
  95. package/dist/utils/template-discovery.d.ts.map +1 -0
  96. package/dist/utils/template-discovery.js +136 -0
  97. package/dist/utils/template-discovery.js.map +1 -0
  98. package/dist/utils/validate-workflow.d.ts +28 -0
  99. package/dist/utils/validate-workflow.d.ts.map +1 -0
  100. package/dist/utils/validate-workflow.js +247 -0
  101. package/dist/utils/validate-workflow.js.map +1 -0
  102. package/dist/utils/validation-cache.d.ts +30 -0
  103. package/dist/utils/validation-cache.d.ts.map +1 -0
  104. package/dist/utils/validation-cache.js +57 -0
  105. package/dist/utils/validation-cache.js.map +1 -0
  106. package/package.json +19 -16
  107. package/watch-pr-result.schema.json +204 -0
  108. package/LICENSE +0 -21
@@ -0,0 +1,261 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for watch-pr command result
4
+ *
5
+ * This schema defines the structure of YAML output from the watch-pr command.
6
+ * Enables validation of watch-pr output in tests and documentation.
7
+ */
8
+ export declare const WatchPRResultSchema: z.ZodObject<{
9
+ pr: z.ZodObject<{
10
+ id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
11
+ title: z.ZodString;
12
+ url: z.ZodString;
13
+ }, "strip", z.ZodTypeAny, {
14
+ id: string | number;
15
+ title: string;
16
+ url: string;
17
+ }, {
18
+ id: string | number;
19
+ title: string;
20
+ url: string;
21
+ }>;
22
+ status: z.ZodEnum<["pending", "in_progress", "completed", "timeout"]>;
23
+ result: z.ZodEnum<["success", "failure", "cancelled", "unknown"]>;
24
+ duration: z.ZodString;
25
+ summary: z.ZodString;
26
+ checks: z.ZodArray<z.ZodObject<{
27
+ name: z.ZodString;
28
+ status: z.ZodString;
29
+ conclusion: z.ZodNullable<z.ZodString>;
30
+ duration: z.ZodOptional<z.ZodString>;
31
+ url: z.ZodOptional<z.ZodString>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ name: string;
34
+ status: string;
35
+ conclusion: string | null;
36
+ url?: string | undefined;
37
+ duration?: string | undefined;
38
+ }, {
39
+ name: string;
40
+ status: string;
41
+ conclusion: string | null;
42
+ url?: string | undefined;
43
+ duration?: string | undefined;
44
+ }>, "many">;
45
+ failures: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ name: z.ZodString;
47
+ checkId: z.ZodString;
48
+ errorSummary: z.ZodOptional<z.ZodString>;
49
+ validationResult: z.ZodOptional<z.ZodObject<{
50
+ passed: z.ZodBoolean;
51
+ timestamp: z.ZodOptional<z.ZodString>;
52
+ treeHash: z.ZodOptional<z.ZodString>;
53
+ failedStep: z.ZodOptional<z.ZodString>;
54
+ rerunCommand: z.ZodOptional<z.ZodString>;
55
+ failedStepOutput: z.ZodOptional<z.ZodString>;
56
+ phases: z.ZodOptional<z.ZodArray<z.ZodObject<{
57
+ name: z.ZodString;
58
+ passed: z.ZodBoolean;
59
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
60
+ name: z.ZodString;
61
+ passed: z.ZodBoolean;
62
+ durationSecs: z.ZodOptional<z.ZodNumber>;
63
+ output: z.ZodOptional<z.ZodString>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ passed: boolean;
66
+ name: string;
67
+ durationSecs?: number | undefined;
68
+ output?: string | undefined;
69
+ }, {
70
+ passed: boolean;
71
+ name: string;
72
+ durationSecs?: number | undefined;
73
+ output?: string | undefined;
74
+ }>, "many">>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ passed: boolean;
77
+ name: string;
78
+ steps?: {
79
+ passed: boolean;
80
+ name: string;
81
+ durationSecs?: number | undefined;
82
+ output?: string | undefined;
83
+ }[] | undefined;
84
+ }, {
85
+ passed: boolean;
86
+ name: string;
87
+ steps?: {
88
+ passed: boolean;
89
+ name: string;
90
+ durationSecs?: number | undefined;
91
+ output?: string | undefined;
92
+ }[] | undefined;
93
+ }>, "many">>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ passed: boolean;
96
+ failedStep?: string | undefined;
97
+ rerunCommand?: string | undefined;
98
+ failedStepOutput?: string | undefined;
99
+ timestamp?: string | undefined;
100
+ treeHash?: string | undefined;
101
+ phases?: {
102
+ passed: boolean;
103
+ name: string;
104
+ steps?: {
105
+ passed: boolean;
106
+ name: string;
107
+ durationSecs?: number | undefined;
108
+ output?: string | undefined;
109
+ }[] | undefined;
110
+ }[] | undefined;
111
+ }, {
112
+ passed: boolean;
113
+ failedStep?: string | undefined;
114
+ rerunCommand?: string | undefined;
115
+ failedStepOutput?: string | undefined;
116
+ timestamp?: string | undefined;
117
+ treeHash?: string | undefined;
118
+ phases?: {
119
+ passed: boolean;
120
+ name: string;
121
+ steps?: {
122
+ passed: boolean;
123
+ name: string;
124
+ durationSecs?: number | undefined;
125
+ output?: string | undefined;
126
+ }[] | undefined;
127
+ }[] | undefined;
128
+ }>>;
129
+ nextSteps: z.ZodArray<z.ZodString, "many">;
130
+ }, "strip", z.ZodTypeAny, {
131
+ name: string;
132
+ checkId: string;
133
+ nextSteps: string[];
134
+ errorSummary?: string | undefined;
135
+ validationResult?: {
136
+ passed: boolean;
137
+ failedStep?: string | undefined;
138
+ rerunCommand?: string | undefined;
139
+ failedStepOutput?: string | undefined;
140
+ timestamp?: string | undefined;
141
+ treeHash?: string | undefined;
142
+ phases?: {
143
+ passed: boolean;
144
+ name: string;
145
+ steps?: {
146
+ passed: boolean;
147
+ name: string;
148
+ durationSecs?: number | undefined;
149
+ output?: string | undefined;
150
+ }[] | undefined;
151
+ }[] | undefined;
152
+ } | undefined;
153
+ }, {
154
+ name: string;
155
+ checkId: string;
156
+ nextSteps: string[];
157
+ errorSummary?: string | undefined;
158
+ validationResult?: {
159
+ passed: boolean;
160
+ failedStep?: string | undefined;
161
+ rerunCommand?: string | undefined;
162
+ failedStepOutput?: string | undefined;
163
+ timestamp?: string | undefined;
164
+ treeHash?: string | undefined;
165
+ phases?: {
166
+ passed: boolean;
167
+ name: string;
168
+ steps?: {
169
+ passed: boolean;
170
+ name: string;
171
+ durationSecs?: number | undefined;
172
+ output?: string | undefined;
173
+ }[] | undefined;
174
+ }[] | undefined;
175
+ } | undefined;
176
+ }>, "many">>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ result: "success" | "failure" | "cancelled" | "unknown";
179
+ checks: {
180
+ name: string;
181
+ status: string;
182
+ conclusion: string | null;
183
+ url?: string | undefined;
184
+ duration?: string | undefined;
185
+ }[];
186
+ pr: {
187
+ id: string | number;
188
+ title: string;
189
+ url: string;
190
+ };
191
+ status: "in_progress" | "completed" | "pending" | "timeout";
192
+ duration: string;
193
+ summary: string;
194
+ failures?: {
195
+ name: string;
196
+ checkId: string;
197
+ nextSteps: string[];
198
+ errorSummary?: string | undefined;
199
+ validationResult?: {
200
+ passed: boolean;
201
+ failedStep?: string | undefined;
202
+ rerunCommand?: string | undefined;
203
+ failedStepOutput?: string | undefined;
204
+ timestamp?: string | undefined;
205
+ treeHash?: string | undefined;
206
+ phases?: {
207
+ passed: boolean;
208
+ name: string;
209
+ steps?: {
210
+ passed: boolean;
211
+ name: string;
212
+ durationSecs?: number | undefined;
213
+ output?: string | undefined;
214
+ }[] | undefined;
215
+ }[] | undefined;
216
+ } | undefined;
217
+ }[] | undefined;
218
+ }, {
219
+ result: "success" | "failure" | "cancelled" | "unknown";
220
+ checks: {
221
+ name: string;
222
+ status: string;
223
+ conclusion: string | null;
224
+ url?: string | undefined;
225
+ duration?: string | undefined;
226
+ }[];
227
+ pr: {
228
+ id: string | number;
229
+ title: string;
230
+ url: string;
231
+ };
232
+ status: "in_progress" | "completed" | "pending" | "timeout";
233
+ duration: string;
234
+ summary: string;
235
+ failures?: {
236
+ name: string;
237
+ checkId: string;
238
+ nextSteps: string[];
239
+ errorSummary?: string | undefined;
240
+ validationResult?: {
241
+ passed: boolean;
242
+ failedStep?: string | undefined;
243
+ rerunCommand?: string | undefined;
244
+ failedStepOutput?: string | undefined;
245
+ timestamp?: string | undefined;
246
+ treeHash?: string | undefined;
247
+ phases?: {
248
+ passed: boolean;
249
+ name: string;
250
+ steps?: {
251
+ passed: boolean;
252
+ name: string;
253
+ durationSecs?: number | undefined;
254
+ output?: string | undefined;
255
+ }[] | undefined;
256
+ }[] | undefined;
257
+ } | undefined;
258
+ }[] | undefined;
259
+ }>;
260
+ export type WatchPRResult = z.infer<typeof WatchPRResultSchema>;
261
+ //# sourceMappingURL=watch-pr-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-pr-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/watch-pr-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyD9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for watch-pr command result
4
+ *
5
+ * This schema defines the structure of YAML output from the watch-pr command.
6
+ * Enables validation of watch-pr output in tests and documentation.
7
+ */
8
+ export const WatchPRResultSchema = z.object({
9
+ pr: z.object({
10
+ id: z.union([z.number(), z.string()]),
11
+ title: z.string(),
12
+ url: z.string().url(),
13
+ }),
14
+ status: z.enum(['pending', 'in_progress', 'completed', 'timeout']),
15
+ result: z.enum(['success', 'failure', 'cancelled', 'unknown']),
16
+ duration: z.string(),
17
+ summary: z.string(),
18
+ checks: z.array(z.object({
19
+ name: z.string(),
20
+ status: z.string(),
21
+ conclusion: z.string().nullable(),
22
+ duration: z.string().optional(),
23
+ url: z.string().url().optional(),
24
+ })),
25
+ failures: z
26
+ .array(z.object({
27
+ name: z.string(),
28
+ checkId: z.string(),
29
+ errorSummary: z.string().optional(),
30
+ validationResult: z
31
+ .object({
32
+ passed: z.boolean(),
33
+ timestamp: z.string().optional(),
34
+ treeHash: z.string().optional(),
35
+ failedStep: z.string().optional(),
36
+ rerunCommand: z.string().optional(),
37
+ failedStepOutput: z.string().optional(),
38
+ phases: z
39
+ .array(z.object({
40
+ name: z.string(),
41
+ passed: z.boolean(),
42
+ steps: z
43
+ .array(z.object({
44
+ name: z.string(),
45
+ passed: z.boolean(),
46
+ durationSecs: z.number().optional(),
47
+ output: z.string().optional(),
48
+ }))
49
+ .optional(),
50
+ }))
51
+ .optional(),
52
+ })
53
+ .optional(),
54
+ nextSteps: z.array(z.string()),
55
+ }))
56
+ .optional(),
57
+ });
58
+ //# sourceMappingURL=watch-pr-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch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+ *
5
+ * This script generates a JSON Schema file from the Zod schema defined in
6
+ * watch-pr-schema.ts. The JSON Schema can be used for:
7
+ * - IDE autocomplete/validation for YAML files
8
+ * - Validating watch-pr output in tests
9
+ * - Documentation generation
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=generate-watch-pr-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-watch-pr-schema.d.ts","sourceRoot":"","sources":["../../src/scripts/generate-watch-pr-schema.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG"}
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Generate JSON Schema for watch-pr command output
4
+ *
5
+ * This script generates a JSON Schema file from the Zod schema defined in
6
+ * watch-pr-schema.ts. The JSON Schema can be used for:
7
+ * - IDE autocomplete/validation for YAML files
8
+ * - Validating watch-pr output in tests
9
+ * - Documentation generation
10
+ */
11
+ import { writeFileSync } from 'fs';
12
+ import { join, dirname } from 'path';
13
+ import { fileURLToPath } from 'url';
14
+ import { zodToJsonSchema } from 'zod-to-json-schema';
15
+ import { WatchPRResultSchema } from '../schemas/watch-pr-schema.js';
16
+ const __filename = fileURLToPath(import.meta.url);
17
+ const __dirname = dirname(__filename);
18
+ // Generate JSON Schema
19
+ const jsonSchema = zodToJsonSchema(WatchPRResultSchema, {
20
+ name: 'WatchPRResult',
21
+ $refStrategy: 'none', // Inline all definitions for simpler schema
22
+ });
23
+ // Add metadata
24
+ const schemaWithMetadata = {
25
+ $schema: 'http://json-schema.org/draft-07/schema#',
26
+ $id: 'https://github.com/jdutton/vibe-validate/blob/main/packages/cli/watch-pr-result.schema.json',
27
+ title: 'vibe-validate watch-pr Result Schema',
28
+ description: 'JSON Schema for vibe-validate watch-pr command YAML output',
29
+ ...jsonSchema,
30
+ };
31
+ // Write to file
32
+ const outputPath = join(__dirname, '../../watch-pr-result.schema.json');
33
+ writeFileSync(outputPath, JSON.stringify(schemaWithMetadata, null, 2));
34
+ console.log('✓ Generated watch-pr-result.schema.json');
35
+ //# sourceMappingURL=generate-watch-pr-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-watch-pr-schema.js","sourceRoot":"","sources":["../../src/scripts/generate-watch-pr-schema.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,uBAAuB;AACvB,MAAM,UAAU,GAAG,eAAe,CAAC,mBAAmB,EAAE;IACtD,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,MAAM,EAAE,4CAA4C;CACnE,CAAC,CAAC;AAEH,eAAe;AACf,MAAM,kBAAkB,GAAG;IACzB,OAAO,EAAE,yCAAyC;IAClD,GAAG,EAAE,6FAA6F;IAClG,KAAK,EAAE,sCAAsC;IAC7C,WAAW,EAAE,4DAA4D;IACzE,GAAG,UAAU;CACd,CAAC;AAEF,gBAAgB;AAChB,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAC;AACxE,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvE,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { CIProvider } from './ci-provider.js';
2
+ /**
3
+ * Registry for CI providers with auto-detection
4
+ *
5
+ * Manages available CI providers and provides auto-detection
6
+ * to determine which provider is usable in current context.
7
+ *
8
+ * Future providers can be added here:
9
+ * - GitLab CI
10
+ * - CircleCI
11
+ * - Jenkins
12
+ * - etc.
13
+ */
14
+ export declare class CIProviderRegistry {
15
+ private providers;
16
+ /**
17
+ * Auto-detect which CI provider is available in current context
18
+ *
19
+ * Checks each registered provider in order until one reports availability.
20
+ *
21
+ * @returns First available provider, or null if none available
22
+ */
23
+ detectProvider(): Promise<CIProvider | null>;
24
+ /**
25
+ * Get specific provider by name
26
+ *
27
+ * @param name - Provider name (e.g., 'github-actions', 'gitlab-ci')
28
+ * @returns Provider instance if found, undefined otherwise
29
+ */
30
+ getProvider(name: string): CIProvider | undefined;
31
+ /**
32
+ * Get all registered provider names
33
+ *
34
+ * @returns Array of provider names
35
+ */
36
+ getProviderNames(): string[];
37
+ }
38
+ //# sourceMappingURL=ci-provider-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-provider-registry.d.ts","sourceRoot":"","sources":["../../src/services/ci-provider-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,SAAS,CAIf;IAEF;;;;;;OAMG;IACG,cAAc,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IASlD;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIjD;;;;OAIG;IACH,gBAAgB,IAAI,MAAM,EAAE;CAG7B"}
@@ -0,0 +1,53 @@
1
+ import { GitHubActionsProvider } from './ci-providers/github-actions.js';
2
+ /**
3
+ * Registry for CI providers with auto-detection
4
+ *
5
+ * Manages available CI providers and provides auto-detection
6
+ * to determine which provider is usable in current context.
7
+ *
8
+ * Future providers can be added here:
9
+ * - GitLab CI
10
+ * - CircleCI
11
+ * - Jenkins
12
+ * - etc.
13
+ */
14
+ export class CIProviderRegistry {
15
+ providers = [
16
+ new GitHubActionsProvider(),
17
+ // new GitLabCIProvider(),
18
+ // new CircleCIProvider(),
19
+ ];
20
+ /**
21
+ * Auto-detect which CI provider is available in current context
22
+ *
23
+ * Checks each registered provider in order until one reports availability.
24
+ *
25
+ * @returns First available provider, or null if none available
26
+ */
27
+ async detectProvider() {
28
+ for (const provider of this.providers) {
29
+ if (await provider.isAvailable()) {
30
+ return provider;
31
+ }
32
+ }
33
+ return null;
34
+ }
35
+ /**
36
+ * Get specific provider by name
37
+ *
38
+ * @param name - Provider name (e.g., 'github-actions', 'gitlab-ci')
39
+ * @returns Provider instance if found, undefined otherwise
40
+ */
41
+ getProvider(name) {
42
+ return this.providers.find((p) => p.name === name);
43
+ }
44
+ /**
45
+ * Get all registered provider names
46
+ *
47
+ * @returns Array of provider names
48
+ */
49
+ getProviderNames() {
50
+ return this.providers.map((p) => p.name);
51
+ }
52
+ }
53
+ //# sourceMappingURL=ci-provider-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-provider-registry.js","sourceRoot":"","sources":["../../src/services/ci-provider-registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAkB;IACrB,SAAS,GAAiB;QAChC,IAAI,qBAAqB,EAAE;QAC3B,0BAA0B;QAC1B,0BAA0B;KAC3B,CAAC;IAEF;;;;;;OAMG;IACH,KAAK,CAAC,cAAc;QAClB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;gBACjC,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,IAAY;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CACF"}
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Abstract CI provider interface for platform-agnostic PR/MR watching
3
+ *
4
+ * This allows vibe-validate to support multiple CI platforms:
5
+ * - GitHub Actions (initial implementation)
6
+ * - GitLab CI (future)
7
+ * - Jenkins (future)
8
+ * - CircleCI (future)
9
+ */
10
+ /**
11
+ * Pull/Merge Request information
12
+ */
13
+ export interface PullRequest {
14
+ /** PR/MR number or ID */
15
+ id: number | string;
16
+ /** PR/MR title */
17
+ title: string;
18
+ /** URL to view PR/MR in browser */
19
+ url: string;
20
+ /** Source branch name */
21
+ branch: string;
22
+ }
23
+ /**
24
+ * Individual check/job result
25
+ */
26
+ export interface CheckResult {
27
+ /** Unique identifier for this check/job */
28
+ id: string;
29
+ /** Human-readable name (e.g., "ubuntu-latest (Node 20)") */
30
+ name: string;
31
+ /** Current execution status */
32
+ status: 'queued' | 'in_progress' | 'completed';
33
+ /** Final result (null if not completed) */
34
+ conclusion: 'success' | 'failure' | 'cancelled' | 'skipped' | 'neutral' | null;
35
+ /** Duration string (e.g., "2m 15s") */
36
+ duration?: string;
37
+ /** URL to view check details */
38
+ url?: string;
39
+ }
40
+ /**
41
+ * Overall status of all checks for a PR/MR
42
+ */
43
+ export interface CheckStatus {
44
+ /** Associated PR/MR */
45
+ pr: PullRequest;
46
+ /** Overall status across all checks */
47
+ status: 'pending' | 'in_progress' | 'completed';
48
+ /** Overall result (only meaningful when status is 'completed') */
49
+ result: 'success' | 'failure' | 'cancelled' | 'unknown';
50
+ /** Individual check results */
51
+ checks: CheckResult[];
52
+ }
53
+ /**
54
+ * Validation result extracted from CI logs
55
+ *
56
+ * Note: This is NOT about the deprecated .vibe-validate-state.yaml file.
57
+ * This represents the validation result that's displayed in CI logs.
58
+ */
59
+ export interface ValidationResultContents {
60
+ /** Whether validation passed */
61
+ passed: boolean;
62
+ /** Timestamp of validation */
63
+ timestamp?: string;
64
+ /** Git tree hash */
65
+ treeHash?: string;
66
+ /** Name of step that failed */
67
+ failedStep?: string;
68
+ /** Command to re-run failed step */
69
+ rerunCommand?: string;
70
+ /** Output from failed step */
71
+ failedStepOutput?: string;
72
+ /** Parsed list of test failures (file:line format) */
73
+ failedTests?: string[];
74
+ /** All phases (if available) */
75
+ phases?: Array<{
76
+ name: string;
77
+ passed: boolean;
78
+ durationSecs?: number;
79
+ output?: string;
80
+ steps?: Array<{
81
+ name: string;
82
+ passed: boolean;
83
+ durationSecs?: number;
84
+ output?: string;
85
+ }>;
86
+ }>;
87
+ }
88
+ /**
89
+ * Detailed failure information including logs
90
+ */
91
+ export interface FailureLogs {
92
+ /** ID of the failed check/run */
93
+ checkId: string;
94
+ /** Name of the failed check */
95
+ checkName: string;
96
+ /** Raw log output (may be very large) */
97
+ rawLogs: string;
98
+ /** Name of the step that failed */
99
+ failedStep?: string;
100
+ /** Concise error summary */
101
+ errorSummary?: string;
102
+ /** Validation result extracted from CI logs (if present) */
103
+ validationResult?: ValidationResultContents;
104
+ }
105
+ /**
106
+ * Abstract CI provider interface
107
+ *
108
+ * Implementations must support:
109
+ * - Detecting if the provider is available in current context
110
+ * - Finding PR/MR from current branch
111
+ * - Fetching check status
112
+ * - Fetching failure logs with error extraction
113
+ */
114
+ export interface CIProvider {
115
+ /** Provider name (e.g., 'github-actions', 'gitlab-ci') */
116
+ readonly name: string;
117
+ /**
118
+ * Detect if this provider is available in current context
119
+ *
120
+ * Should check:
121
+ * - Required CLI tools (gh, glab, etc.)
122
+ * - Git remote matches provider (github.com, gitlab.com, etc.)
123
+ *
124
+ * @returns true if provider is available and usable
125
+ */
126
+ isAvailable(): Promise<boolean>;
127
+ /**
128
+ * Detect PR/MR from current branch
129
+ *
130
+ * Uses provider CLI or API to find open PR/MR for current branch.
131
+ *
132
+ * @returns PR/MR info if found, null otherwise
133
+ */
134
+ detectPullRequest(): Promise<PullRequest | null>;
135
+ /**
136
+ * Fetch current check status for a PR/MR
137
+ *
138
+ * @param _prId - PR/MR number or ID
139
+ * @returns Current status of all checks
140
+ */
141
+ fetchCheckStatus(_prId: number | string): Promise<CheckStatus>;
142
+ /**
143
+ * Fetch detailed logs for a failed check
144
+ *
145
+ * Should attempt to:
146
+ * - Extract vibe-validate state file if present
147
+ * - Identify failed step
148
+ * - Provide concise error summary
149
+ *
150
+ * @param _checkId - Unique identifier for the check/run
151
+ * @returns Detailed failure information
152
+ */
153
+ fetchFailureLogs(_checkId: string): Promise<FailureLogs>;
154
+ /**
155
+ * Extract validation result from CI logs
156
+ *
157
+ * Looks for the validation result display section in workflow logs.
158
+ * This is provider-specific as log formats differ.
159
+ *
160
+ * @param _logs - Raw log output
161
+ * @returns Parsed validation result if found, null otherwise
162
+ */
163
+ extractValidationResult(_logs: string): ValidationResultContents | null;
164
+ }
165
+ //# sourceMappingURL=ci-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-provider.d.ts","sourceRoot":"","sources":["../../src/services/ci-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,MAAM,EA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Y,CAAC,EAAE,MAAM,CAAC;YACtB,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC,CAAC;KACJ,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,wBAAwB,CAAC;CAC7C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;;OAQG;IACH,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhC;;;;;;OAMG;IACH,iBAAiB,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAEjD;;;;;OAKG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/D;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzD;;;;;;;;OAQG;IACH,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,wBAAwB,GAAG,IAAI,CAAC;CACzE"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Abstract CI provider interface for platform-agnostic PR/MR watching
3
+ *
4
+ * This allows vibe-validate to support multiple CI platforms:
5
+ * - GitHub Actions (initial implementation)
6
+ * - GitLab CI (future)
7
+ * - Jenkins (future)
8
+ * - CircleCI (future)
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=ci-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-provider.js","sourceRoot":"","sources":["../../src/services/ci-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}