workflow-agent-cli 2.9.0 → 2.10.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.
- package/dist/auto-fix-7WAESKYO.js +13 -0
- package/dist/auto-fix-7WAESKYO.js.map +1 -0
- package/dist/chunk-UWJ2ZGEI.js +98 -0
- package/dist/chunk-UWJ2ZGEI.js.map +1 -0
- package/dist/chunk-YELUGXOM.js +335 -0
- package/dist/chunk-YELUGXOM.js.map +1 -0
- package/dist/{chunk-Y5N3JJTU.js → chunk-YEOQZ7XC.js} +3 -3
- package/dist/cli/index.js +702 -274
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +46 -4
- package/dist/config/index.js +16 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -4
- package/dist/scripts/postinstall.js +1 -1
- package/dist/validators/index.d.ts +1 -1
- package/package.json +2 -1
- package/dist/chunk-DEAF7P4L.js +0 -199
- package/dist/chunk-DEAF7P4L.js.map +0 -1
- package/dist/{chunk-Y5N3JJTU.js.map → chunk-YEOQZ7XC.js.map} +0 -0
- package/dist/{schema-BUu8Cefw.d.ts → schema-D0zTM83x.d.ts} +4 -4
package/dist/config/index.d.ts
CHANGED
|
@@ -1,8 +1,50 @@
|
|
|
1
|
-
import { W as WorkflowConfig } from '../schema-
|
|
2
|
-
export { B as BranchType, C as ConventionalType, S as Scope, a as WorkflowConfigSchema } from '../schema-
|
|
3
|
-
import 'zod';
|
|
1
|
+
import { W as WorkflowConfig } from '../schema-D0zTM83x.js';
|
|
2
|
+
export { B as BranchType, C as ConventionalType, S as Scope, a as WorkflowConfigSchema } from '../schema-D0zTM83x.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
interface ConfigValidationIssue {
|
|
6
|
+
path: string;
|
|
7
|
+
code: string;
|
|
8
|
+
message: string;
|
|
9
|
+
currentValue?: unknown;
|
|
10
|
+
suggestedFix?: {
|
|
11
|
+
description: string;
|
|
12
|
+
newValue: unknown;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
interface AutoFixResult {
|
|
16
|
+
fixed: boolean;
|
|
17
|
+
changes: string[];
|
|
18
|
+
newConfig: unknown;
|
|
19
|
+
}
|
|
20
|
+
declare function analyzeValidationError(error: z.ZodError, rawConfig: unknown): ConfigValidationIssue[];
|
|
21
|
+
declare function applyAutoFixes(rawConfig: unknown, issues: ConfigValidationIssue[]): AutoFixResult;
|
|
22
|
+
declare function writeFixedConfig(configPath: string, config: unknown): Promise<void>;
|
|
23
|
+
declare function autoFixConfigFile(cwd?: string): Promise<{
|
|
24
|
+
success: boolean;
|
|
25
|
+
configPath: string | null;
|
|
26
|
+
changes: string[];
|
|
27
|
+
error?: string;
|
|
28
|
+
}>;
|
|
4
29
|
|
|
5
30
|
declare function loadConfig(cwd?: string): Promise<WorkflowConfig | null>;
|
|
31
|
+
interface SafeConfigResult {
|
|
32
|
+
config: WorkflowConfig | null;
|
|
33
|
+
rawConfig: unknown;
|
|
34
|
+
configPath: string | null;
|
|
35
|
+
issues: Array<{
|
|
36
|
+
path: string;
|
|
37
|
+
code: string;
|
|
38
|
+
message: string;
|
|
39
|
+
currentValue?: unknown;
|
|
40
|
+
suggestedFix?: {
|
|
41
|
+
description: string;
|
|
42
|
+
newValue: unknown;
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
valid: boolean;
|
|
46
|
+
}
|
|
47
|
+
declare function loadConfigSafe(cwd?: string): Promise<SafeConfigResult>;
|
|
6
48
|
declare function hasConfig(cwd?: string): boolean;
|
|
7
49
|
|
|
8
|
-
export { WorkflowConfig, hasConfig, loadConfig };
|
|
50
|
+
export { type AutoFixResult, type ConfigValidationIssue, type SafeConfigResult, WorkflowConfig, analyzeValidationError, applyAutoFixes, autoFixConfigFile, hasConfig, loadConfig, loadConfigSafe, writeFixedConfig };
|
package/dist/config/index.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
WorkflowConfigSchema,
|
|
3
2
|
hasConfig,
|
|
4
|
-
loadConfig
|
|
5
|
-
|
|
3
|
+
loadConfig,
|
|
4
|
+
loadConfigSafe
|
|
5
|
+
} from "../chunk-UWJ2ZGEI.js";
|
|
6
|
+
import {
|
|
7
|
+
WorkflowConfigSchema,
|
|
8
|
+
analyzeValidationError,
|
|
9
|
+
applyAutoFixes,
|
|
10
|
+
autoFixConfigFile,
|
|
11
|
+
writeFixedConfig
|
|
12
|
+
} from "../chunk-YELUGXOM.js";
|
|
6
13
|
export {
|
|
7
14
|
WorkflowConfigSchema,
|
|
15
|
+
analyzeValidationError,
|
|
16
|
+
applyAutoFixes,
|
|
17
|
+
autoFixConfigFile,
|
|
8
18
|
hasConfig,
|
|
9
|
-
loadConfig
|
|
19
|
+
loadConfig,
|
|
20
|
+
loadConfigSafe,
|
|
21
|
+
writeFixedConfig
|
|
10
22
|
};
|
|
11
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { hasConfig, loadConfig } from './config/index.js';
|
|
1
|
+
export { AutoFixResult, ConfigValidationIssue, SafeConfigResult, analyzeValidationError, applyAutoFixes, autoFixConfigFile, hasConfig, loadConfig, loadConfigSafe, writeFixedConfig } from './config/index.js';
|
|
2
2
|
export { BrokenReference, DocumentReference, DocumentValidationResult, ValidationResult, applyReferenceFix, discoverCustomScopes, findSimilarFiles, getAllScopes, invalidateCustomScopesCache, scanDocumentReferences, validateBranchName, validateCommitMessage, validateDocumentReferences, validatePRTitle } from './validators/index.js';
|
|
3
|
-
export { B as BranchType, C as ConventionalType, S as Scope, W as WorkflowConfig, a as WorkflowConfigSchema } from './schema-
|
|
3
|
+
export { B as BranchType, C as ConventionalType, S as Scope, W as WorkflowConfig, a as WorkflowConfigSchema } from './schema-D0zTM83x.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
interface CheckDefinition {
|
package/dist/index.js
CHANGED
|
@@ -23,16 +23,26 @@ import {
|
|
|
23
23
|
validatePRTitle
|
|
24
24
|
} from "./chunk-ZLDJ2OGO.js";
|
|
25
25
|
import {
|
|
26
|
-
WorkflowConfigSchema,
|
|
27
26
|
hasConfig,
|
|
28
|
-
loadConfig
|
|
29
|
-
|
|
27
|
+
loadConfig,
|
|
28
|
+
loadConfigSafe
|
|
29
|
+
} from "./chunk-UWJ2ZGEI.js";
|
|
30
|
+
import {
|
|
31
|
+
WorkflowConfigSchema,
|
|
32
|
+
analyzeValidationError,
|
|
33
|
+
applyAutoFixes,
|
|
34
|
+
autoFixConfigFile,
|
|
35
|
+
writeFixedConfig
|
|
36
|
+
} from "./chunk-YELUGXOM.js";
|
|
30
37
|
export {
|
|
31
38
|
QUALITY_CHECKS,
|
|
32
39
|
WorkflowConfigSchema,
|
|
33
40
|
analyzeProject,
|
|
41
|
+
analyzeValidationError,
|
|
42
|
+
applyAutoFixes,
|
|
34
43
|
applyFix,
|
|
35
44
|
applyReferenceFix,
|
|
45
|
+
autoFixConfigFile,
|
|
36
46
|
discoverCustomScopes,
|
|
37
47
|
findSimilarFiles,
|
|
38
48
|
formatAuditReport,
|
|
@@ -42,6 +52,7 @@ export {
|
|
|
42
52
|
hasUncommittedChanges,
|
|
43
53
|
invalidateCustomScopesCache,
|
|
44
54
|
loadConfig,
|
|
55
|
+
loadConfigSafe,
|
|
45
56
|
runAllChecks,
|
|
46
57
|
runAllSetups,
|
|
47
58
|
runCheck,
|
|
@@ -50,6 +61,7 @@ export {
|
|
|
50
61
|
validateBranchName,
|
|
51
62
|
validateCommitMessage,
|
|
52
63
|
validateDocumentReferences,
|
|
53
|
-
validatePRTitle
|
|
64
|
+
validatePRTitle,
|
|
65
|
+
writeFixedConfig
|
|
54
66
|
};
|
|
55
67
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflow-agent-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "A self-evolving workflow management system for AI agent development",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"workflow",
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"@types/mustache": "^4.2.5",
|
|
103
103
|
"@types/node": "^20.11.5",
|
|
104
104
|
"eslint": "^8.56.0",
|
|
105
|
+
"memfs": "^4.56.2",
|
|
105
106
|
"tsup": "^8.0.1",
|
|
106
107
|
"typescript": "^5.3.3",
|
|
107
108
|
"vitest": "^1.6.1"
|
package/dist/chunk-DEAF7P4L.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
// src/config/index.ts
|
|
2
|
-
import { cosmiconfig } from "cosmiconfig";
|
|
3
|
-
|
|
4
|
-
// src/config/schema.ts
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
var RESERVED_SCOPE_NAMES = [
|
|
7
|
-
"init",
|
|
8
|
-
"create",
|
|
9
|
-
"build",
|
|
10
|
-
"test",
|
|
11
|
-
"config",
|
|
12
|
-
"docs",
|
|
13
|
-
"ci",
|
|
14
|
-
"deps"
|
|
15
|
-
];
|
|
16
|
-
var ScopeSchema = z.object({
|
|
17
|
-
name: z.string().min(1).max(32, "Scope name must be 32 characters or less").regex(
|
|
18
|
-
/^[a-z0-9-]+$/,
|
|
19
|
-
"Scope name must be lowercase alphanumeric with hyphens"
|
|
20
|
-
).refine((name) => !RESERVED_SCOPE_NAMES.includes(name), {
|
|
21
|
-
message: `Scope name cannot be a reserved word: ${RESERVED_SCOPE_NAMES.join(", ")}`
|
|
22
|
-
}),
|
|
23
|
-
description: z.string().min(10, "Scope description must be at least 10 characters"),
|
|
24
|
-
emoji: z.string().optional(),
|
|
25
|
-
category: z.enum([
|
|
26
|
-
"auth",
|
|
27
|
-
"features",
|
|
28
|
-
"infrastructure",
|
|
29
|
-
"documentation",
|
|
30
|
-
"testing",
|
|
31
|
-
"performance",
|
|
32
|
-
"other"
|
|
33
|
-
]).optional()
|
|
34
|
-
});
|
|
35
|
-
var BranchTypeSchema = z.enum([
|
|
36
|
-
"feature",
|
|
37
|
-
"bugfix",
|
|
38
|
-
"hotfix",
|
|
39
|
-
"chore",
|
|
40
|
-
"refactor",
|
|
41
|
-
"docs",
|
|
42
|
-
"test",
|
|
43
|
-
"release"
|
|
44
|
-
]);
|
|
45
|
-
var ConventionalTypeSchema = z.enum([
|
|
46
|
-
"feat",
|
|
47
|
-
"fix",
|
|
48
|
-
"refactor",
|
|
49
|
-
"chore",
|
|
50
|
-
"docs",
|
|
51
|
-
"test",
|
|
52
|
-
"perf",
|
|
53
|
-
"style",
|
|
54
|
-
"ci",
|
|
55
|
-
"build",
|
|
56
|
-
"revert"
|
|
57
|
-
]);
|
|
58
|
-
var EnforcementLevelSchema = z.enum([
|
|
59
|
-
"strict",
|
|
60
|
-
"advisory",
|
|
61
|
-
"learning"
|
|
62
|
-
]);
|
|
63
|
-
var AnalyticsConfigSchema = z.object({
|
|
64
|
-
enabled: z.boolean().default(false),
|
|
65
|
-
shareAnonymous: z.boolean().default(false)
|
|
66
|
-
});
|
|
67
|
-
var CIConfigSchema = z.object({
|
|
68
|
-
provider: z.enum(["github", "gitlab", "azure"]).default("github"),
|
|
69
|
-
nodeVersions: z.array(z.string()).optional(),
|
|
70
|
-
defaultBranch: z.string().default("main"),
|
|
71
|
-
checks: z.array(z.enum(["lint", "typecheck", "format", "build", "test"])).optional()
|
|
72
|
-
});
|
|
73
|
-
var HooksConfigSchema = z.object({
|
|
74
|
-
preCommit: z.array(z.string()).optional(),
|
|
75
|
-
commitMsg: z.array(z.string()).optional(),
|
|
76
|
-
prePush: z.array(z.string()).optional()
|
|
77
|
-
});
|
|
78
|
-
var GuidelinesConfigSchema = z.object({
|
|
79
|
-
mandatoryTemplates: z.array(z.string()).optional(),
|
|
80
|
-
optionalTemplates: z.array(z.string()).optional(),
|
|
81
|
-
customTemplatesDir: z.string().optional(),
|
|
82
|
-
additionalMandatory: z.array(z.string()).optional(),
|
|
83
|
-
optionalOverrides: z.array(z.string()).optional()
|
|
84
|
-
});
|
|
85
|
-
var AdvisoryDepthSchema = z.enum([
|
|
86
|
-
"executive",
|
|
87
|
-
"quick",
|
|
88
|
-
"standard",
|
|
89
|
-
"comprehensive"
|
|
90
|
-
]);
|
|
91
|
-
var AdvisoryQuestionSchema = z.object({
|
|
92
|
-
category: z.string(),
|
|
93
|
-
question: z.string(),
|
|
94
|
-
context: z.string().optional(),
|
|
95
|
-
priority: z.enum(["high", "medium", "low"]).optional()
|
|
96
|
-
});
|
|
97
|
-
var AdvisoryConfigSchema = z.object({
|
|
98
|
-
enabled: z.boolean().default(true),
|
|
99
|
-
defaultDepth: AdvisoryDepthSchema.default("standard"),
|
|
100
|
-
outputDir: z.string().default("docs/advisory"),
|
|
101
|
-
customQuestions: z.array(AdvisoryQuestionSchema).optional(),
|
|
102
|
-
riskThresholds: z.object({
|
|
103
|
-
high: z.number().default(0.7),
|
|
104
|
-
medium: z.number().default(0.4),
|
|
105
|
-
low: z.number().default(0.2)
|
|
106
|
-
}).optional(),
|
|
107
|
-
categories: z.array(z.string()).default([
|
|
108
|
-
"Technology Decisions",
|
|
109
|
-
"Package Utilization",
|
|
110
|
-
"Platform Strategy",
|
|
111
|
-
"Business Alignment",
|
|
112
|
-
"Technical Debt",
|
|
113
|
-
"Growth Opportunities"
|
|
114
|
-
]),
|
|
115
|
-
excludePatterns: z.array(z.string()).optional(),
|
|
116
|
-
includeHealthMetrics: z.boolean().default(false)
|
|
117
|
-
});
|
|
118
|
-
var WorkflowConfigSchema = z.object({
|
|
119
|
-
projectName: z.string().min(1),
|
|
120
|
-
scopes: z.array(ScopeSchema).min(1),
|
|
121
|
-
branchTypes: z.array(BranchTypeSchema).optional(),
|
|
122
|
-
conventionalTypes: z.array(ConventionalTypeSchema).optional(),
|
|
123
|
-
enforcement: EnforcementLevelSchema.default("strict"),
|
|
124
|
-
language: z.string().default("en"),
|
|
125
|
-
analytics: AnalyticsConfigSchema.optional(),
|
|
126
|
-
adapter: z.string().optional(),
|
|
127
|
-
syncRemote: z.string().optional(),
|
|
128
|
-
ci: CIConfigSchema.optional(),
|
|
129
|
-
hooks: HooksConfigSchema.optional(),
|
|
130
|
-
guidelines: GuidelinesConfigSchema.optional(),
|
|
131
|
-
advisory: AdvisoryConfigSchema.optional()
|
|
132
|
-
});
|
|
133
|
-
function validateScopeDefinitions(scopes) {
|
|
134
|
-
const errors = [];
|
|
135
|
-
const seenNames = /* @__PURE__ */ new Set();
|
|
136
|
-
for (const scope of scopes) {
|
|
137
|
-
if (seenNames.has(scope.name)) {
|
|
138
|
-
errors.push(`Duplicate scope name: "${scope.name}"`);
|
|
139
|
-
}
|
|
140
|
-
seenNames.add(scope.name);
|
|
141
|
-
const result = ScopeSchema.safeParse(scope);
|
|
142
|
-
if (!result.success) {
|
|
143
|
-
result.error.errors.forEach((err) => {
|
|
144
|
-
errors.push(`Scope "${scope.name}": ${err.message}`);
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return {
|
|
149
|
-
valid: errors.length === 0,
|
|
150
|
-
errors
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// src/config/index.ts
|
|
155
|
-
import { join } from "path";
|
|
156
|
-
import { existsSync } from "fs";
|
|
157
|
-
var explorer = cosmiconfig("workflow", {
|
|
158
|
-
searchPlaces: [
|
|
159
|
-
"workflow.config.ts",
|
|
160
|
-
"workflow.config.js",
|
|
161
|
-
"workflow.config.json",
|
|
162
|
-
".workflowrc",
|
|
163
|
-
".workflowrc.json",
|
|
164
|
-
"package.json"
|
|
165
|
-
]
|
|
166
|
-
});
|
|
167
|
-
async function loadConfig(cwd = process.cwd()) {
|
|
168
|
-
try {
|
|
169
|
-
const result = await explorer.search(cwd);
|
|
170
|
-
if (!result || !result.config) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
const validated = WorkflowConfigSchema.parse(result.config);
|
|
174
|
-
return validated;
|
|
175
|
-
} catch (error) {
|
|
176
|
-
if (error instanceof Error) {
|
|
177
|
-
throw new Error(`Failed to load workflow config: ${error.message}`);
|
|
178
|
-
}
|
|
179
|
-
throw error;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function hasConfig(cwd = process.cwd()) {
|
|
183
|
-
const configPaths = [
|
|
184
|
-
"workflow.config.ts",
|
|
185
|
-
"workflow.config.js",
|
|
186
|
-
"workflow.config.json",
|
|
187
|
-
".workflowrc",
|
|
188
|
-
".workflowrc.json"
|
|
189
|
-
];
|
|
190
|
-
return configPaths.some((path) => existsSync(join(cwd, path)));
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export {
|
|
194
|
-
WorkflowConfigSchema,
|
|
195
|
-
validateScopeDefinitions,
|
|
196
|
-
loadConfig,
|
|
197
|
-
hasConfig
|
|
198
|
-
};
|
|
199
|
-
//# sourceMappingURL=chunk-DEAF7P4L.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config/index.ts","../src/config/schema.ts"],"sourcesContent":["import { cosmiconfig } from \"cosmiconfig\";\nimport { WorkflowConfig, WorkflowConfigSchema } from \"./schema.js\";\nimport { join } from \"path\";\nimport { existsSync } from \"fs\";\n\nconst explorer = cosmiconfig(\"workflow\", {\n searchPlaces: [\n \"workflow.config.ts\",\n \"workflow.config.js\",\n \"workflow.config.json\",\n \".workflowrc\",\n \".workflowrc.json\",\n \"package.json\",\n ],\n});\n\nexport async function loadConfig(\n cwd: string = process.cwd(),\n): Promise<WorkflowConfig | null> {\n try {\n const result = await explorer.search(cwd);\n\n if (!result || !result.config) {\n return null;\n }\n\n // Validate config against schema\n const validated = WorkflowConfigSchema.parse(result.config);\n return validated;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to load workflow config: ${error.message}`);\n }\n throw error;\n }\n}\n\nexport function hasConfig(cwd: string = process.cwd()): boolean {\n const configPaths = [\n \"workflow.config.ts\",\n \"workflow.config.js\",\n \"workflow.config.json\",\n \".workflowrc\",\n \".workflowrc.json\",\n ];\n\n return configPaths.some((path) => existsSync(join(cwd, path)));\n}\n\nexport {\n WorkflowConfig,\n WorkflowConfigSchema,\n Scope,\n BranchType,\n ConventionalType,\n} from \"./schema.js\";\n","import { z } from \"zod\";\n\n// Reserved scope names that cannot be used\nconst RESERVED_SCOPE_NAMES = [\n \"init\",\n \"create\",\n \"build\",\n \"test\",\n \"config\",\n \"docs\",\n \"ci\",\n \"deps\",\n];\n\nexport const ScopeSchema = z.object({\n name: z\n .string()\n .min(1)\n .max(32, \"Scope name must be 32 characters or less\")\n .regex(\n /^[a-z0-9-]+$/,\n \"Scope name must be lowercase alphanumeric with hyphens\",\n )\n .refine((name) => !RESERVED_SCOPE_NAMES.includes(name), {\n message: `Scope name cannot be a reserved word: ${RESERVED_SCOPE_NAMES.join(\", \")}`,\n }),\n description: z\n .string()\n .min(10, \"Scope description must be at least 10 characters\"),\n emoji: z.string().optional(),\n category: z\n .enum([\n \"auth\",\n \"features\",\n \"infrastructure\",\n \"documentation\",\n \"testing\",\n \"performance\",\n \"other\",\n ])\n .optional(),\n});\n\nexport const BranchTypeSchema = z.enum([\n \"feature\",\n \"bugfix\",\n \"hotfix\",\n \"chore\",\n \"refactor\",\n \"docs\",\n \"test\",\n \"release\",\n]);\n\nexport const ConventionalTypeSchema = z.enum([\n \"feat\",\n \"fix\",\n \"refactor\",\n \"chore\",\n \"docs\",\n \"test\",\n \"perf\",\n \"style\",\n \"ci\",\n \"build\",\n \"revert\",\n]);\n\nexport const EnforcementLevelSchema = z.enum([\n \"strict\",\n \"advisory\",\n \"learning\",\n]);\n\nexport const AnalyticsConfigSchema = z.object({\n enabled: z.boolean().default(false),\n shareAnonymous: z.boolean().default(false),\n});\n\nexport const CIConfigSchema = z.object({\n provider: z.enum([\"github\", \"gitlab\", \"azure\"]).default(\"github\"),\n nodeVersions: z.array(z.string()).optional(),\n defaultBranch: z.string().default(\"main\"),\n checks: z\n .array(z.enum([\"lint\", \"typecheck\", \"format\", \"build\", \"test\"]))\n .optional(),\n});\n\nexport const HooksConfigSchema = z.object({\n preCommit: z.array(z.string()).optional(),\n commitMsg: z.array(z.string()).optional(),\n prePush: z.array(z.string()).optional(),\n});\n\nexport const GuidelinesConfigSchema = z.object({\n mandatoryTemplates: z.array(z.string()).optional(),\n optionalTemplates: z.array(z.string()).optional(),\n customTemplatesDir: z.string().optional(),\n additionalMandatory: z.array(z.string()).optional(),\n optionalOverrides: z.array(z.string()).optional(),\n});\n\nexport const AdvisoryDepthSchema = z.enum([\n \"executive\",\n \"quick\",\n \"standard\",\n \"comprehensive\",\n]);\n\nexport const AdvisoryQuestionSchema = z.object({\n category: z.string(),\n question: z.string(),\n context: z.string().optional(),\n priority: z.enum([\"high\", \"medium\", \"low\"]).optional(),\n});\n\nexport const AdvisoryConfigSchema = z.object({\n enabled: z.boolean().default(true),\n defaultDepth: AdvisoryDepthSchema.default(\"standard\"),\n outputDir: z.string().default(\"docs/advisory\"),\n customQuestions: z.array(AdvisoryQuestionSchema).optional(),\n riskThresholds: z\n .object({\n high: z.number().default(0.7),\n medium: z.number().default(0.4),\n low: z.number().default(0.2),\n })\n .optional(),\n categories: z\n .array(z.string())\n .default([\n \"Technology Decisions\",\n \"Package Utilization\",\n \"Platform Strategy\",\n \"Business Alignment\",\n \"Technical Debt\",\n \"Growth Opportunities\",\n ]),\n excludePatterns: z.array(z.string()).optional(),\n includeHealthMetrics: z.boolean().default(false),\n});\n\nexport const WorkflowConfigSchema = z.object({\n projectName: z.string().min(1),\n scopes: z.array(ScopeSchema).min(1),\n branchTypes: z.array(BranchTypeSchema).optional(),\n conventionalTypes: z.array(ConventionalTypeSchema).optional(),\n enforcement: EnforcementLevelSchema.default(\"strict\"),\n language: z.string().default(\"en\"),\n analytics: AnalyticsConfigSchema.optional(),\n adapter: z.string().optional(),\n syncRemote: z.string().optional(),\n ci: CIConfigSchema.optional(),\n hooks: HooksConfigSchema.optional(),\n guidelines: GuidelinesConfigSchema.optional(),\n advisory: AdvisoryConfigSchema.optional(),\n});\n\nexport type Scope = z.infer<typeof ScopeSchema>;\nexport type BranchType = z.infer<typeof BranchTypeSchema>;\nexport type ConventionalType = z.infer<typeof ConventionalTypeSchema>;\nexport type EnforcementLevel = z.infer<typeof EnforcementLevelSchema>;\nexport type AnalyticsConfig = z.infer<typeof AnalyticsConfigSchema>;\nexport type CIConfig = z.infer<typeof CIConfigSchema>;\nexport type HooksConfig = z.infer<typeof HooksConfigSchema>;\nexport type GuidelinesConfig = z.infer<typeof GuidelinesConfigSchema>;\nexport type AdvisoryDepth = z.infer<typeof AdvisoryDepthSchema>;\nexport type AdvisoryQuestion = z.infer<typeof AdvisoryQuestionSchema>;\nexport type AdvisoryConfig = z.infer<typeof AdvisoryConfigSchema>;\nexport type WorkflowConfig = z.infer<typeof WorkflowConfigSchema>;\n\nexport const defaultBranchTypes: BranchType[] = [\n \"feature\",\n \"bugfix\",\n \"hotfix\",\n \"chore\",\n \"refactor\",\n \"docs\",\n \"test\",\n];\n\nexport const defaultConventionalTypes: ConventionalType[] = [\n \"feat\",\n \"fix\",\n \"refactor\",\n \"chore\",\n \"docs\",\n \"test\",\n \"perf\",\n \"style\",\n];\n\n/**\n * Validates scope definitions for duplicates, description quality, and category values\n * @param scopes Array of scope definitions to validate\n * @returns Object with validation result and error messages\n */\nexport function validateScopeDefinitions(scopes: Scope[]): {\n valid: boolean;\n errors: string[];\n} {\n const errors: string[] = [];\n const seenNames = new Set<string>();\n\n for (const scope of scopes) {\n // Check for duplicate names\n if (seenNames.has(scope.name)) {\n errors.push(`Duplicate scope name: \"${scope.name}\"`);\n }\n seenNames.add(scope.name);\n\n // Validate using schema (this will catch min length, reserved names, etc.)\n const result = ScopeSchema.safeParse(scope);\n if (!result.success) {\n result.error.errors.forEach((err) => {\n errors.push(`Scope \"${scope.name}\": ${err.message}`);\n });\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n };\n}\n"],"mappings":";AAAA,SAAS,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,KAAK,KAAK,IAAI,CAAC,CAAC;AAC/D;","names":[]}
|
|
File without changes
|
|
@@ -189,8 +189,6 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
189
189
|
nodeVersions?: string[] | undefined;
|
|
190
190
|
checks?: ("build" | "test" | "lint" | "typecheck" | "format")[] | undefined;
|
|
191
191
|
} | undefined;
|
|
192
|
-
branchTypes?: ("test" | "docs" | "feature" | "bugfix" | "hotfix" | "chore" | "refactor" | "release")[] | undefined;
|
|
193
|
-
conventionalTypes?: ("build" | "test" | "docs" | "ci" | "chore" | "refactor" | "feat" | "fix" | "perf" | "style" | "revert")[] | undefined;
|
|
194
192
|
advisory?: {
|
|
195
193
|
enabled: boolean;
|
|
196
194
|
defaultDepth: "executive" | "quick" | "standard" | "comprehensive";
|
|
@@ -210,6 +208,8 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
210
208
|
} | undefined;
|
|
211
209
|
excludePatterns?: string[] | undefined;
|
|
212
210
|
} | undefined;
|
|
211
|
+
branchTypes?: ("test" | "docs" | "feature" | "bugfix" | "hotfix" | "chore" | "refactor" | "release")[] | undefined;
|
|
212
|
+
conventionalTypes?: ("build" | "test" | "docs" | "ci" | "chore" | "refactor" | "feat" | "fix" | "perf" | "style" | "revert")[] | undefined;
|
|
213
213
|
analytics?: {
|
|
214
214
|
enabled: boolean;
|
|
215
215
|
shareAnonymous: boolean;
|
|
@@ -242,8 +242,6 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
242
242
|
defaultBranch?: string | undefined;
|
|
243
243
|
checks?: ("build" | "test" | "lint" | "typecheck" | "format")[] | undefined;
|
|
244
244
|
} | undefined;
|
|
245
|
-
branchTypes?: ("test" | "docs" | "feature" | "bugfix" | "hotfix" | "chore" | "refactor" | "release")[] | undefined;
|
|
246
|
-
conventionalTypes?: ("build" | "test" | "docs" | "ci" | "chore" | "refactor" | "feat" | "fix" | "perf" | "style" | "revert")[] | undefined;
|
|
247
245
|
advisory?: {
|
|
248
246
|
enabled?: boolean | undefined;
|
|
249
247
|
defaultDepth?: "executive" | "quick" | "standard" | "comprehensive" | undefined;
|
|
@@ -263,6 +261,8 @@ declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
263
261
|
excludePatterns?: string[] | undefined;
|
|
264
262
|
includeHealthMetrics?: boolean | undefined;
|
|
265
263
|
} | undefined;
|
|
264
|
+
branchTypes?: ("test" | "docs" | "feature" | "bugfix" | "hotfix" | "chore" | "refactor" | "release")[] | undefined;
|
|
265
|
+
conventionalTypes?: ("build" | "test" | "docs" | "ci" | "chore" | "refactor" | "feat" | "fix" | "perf" | "style" | "revert")[] | undefined;
|
|
266
266
|
enforcement?: "strict" | "advisory" | "learning" | undefined;
|
|
267
267
|
language?: string | undefined;
|
|
268
268
|
analytics?: {
|