workflow-agent-cli 2.0.0 → 2.1.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.
@@ -1,8 +1,13 @@
1
- import { W as WorkflowConfig } from '../schema-RkQ91pZW.js';
2
- export { B as BranchType, C as ConventionalType, S as Scope, a as WorkflowConfigSchema } from '../schema-RkQ91pZW.js';
1
+ import { W as WorkflowConfig } from '../schema-C1lmnd7L.js';
2
+ export { B as BranchType, C as ConventionalType, D as DEFAULT_RESERVED_SCOPE_NAMES, S as Scope, a as WorkflowConfigSchema, v as validateScopeName } from '../schema-C1lmnd7L.js';
3
3
  import 'zod';
4
4
 
5
5
  declare function loadConfig(cwd?: string): Promise<WorkflowConfig | null>;
6
+ declare function validateConfig(cwd?: string): Promise<{
7
+ valid: boolean;
8
+ errors: string[];
9
+ warnings: string[];
10
+ }>;
6
11
  declare function hasConfig(cwd?: string): boolean;
7
12
 
8
- export { WorkflowConfig, hasConfig, loadConfig };
13
+ export { WorkflowConfig, hasConfig, loadConfig, validateConfig };
@@ -1,11 +1,17 @@
1
1
  import {
2
+ DEFAULT_RESERVED_SCOPE_NAMES,
2
3
  WorkflowConfigSchema,
3
4
  hasConfig,
4
- loadConfig
5
- } from "../chunk-4BIDFDSR.js";
5
+ loadConfig,
6
+ validateConfig,
7
+ validateScopeName
8
+ } from "../chunk-B27W7GWP.js";
6
9
  export {
10
+ DEFAULT_RESERVED_SCOPE_NAMES,
7
11
  WorkflowConfigSchema,
8
12
  hasConfig,
9
- loadConfig
13
+ loadConfig,
14
+ validateConfig,
15
+ validateScopeName
10
16
  };
11
17
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { hasConfig, loadConfig } from './config/index.js';
1
+ export { hasConfig, loadConfig, validateConfig } from './config/index.js';
2
2
  export { ValidationResult, discoverCustomScopes, getAllScopes, invalidateCustomScopesCache, validateBranchName, validateCommitMessage, validatePRTitle } from './validators/index.js';
3
- export { B as BranchType, C as ConventionalType, S as Scope, W as WorkflowConfig, a as WorkflowConfigSchema } from './schema-RkQ91pZW.js';
3
+ export { B as BranchType, C as ConventionalType, D as DEFAULT_RESERVED_SCOPE_NAMES, S as Scope, W as WorkflowConfig, a as WorkflowConfigSchema, v as validateScopeName } from './schema-C1lmnd7L.js';
4
4
  import 'zod';
package/dist/index.js CHANGED
@@ -7,11 +7,15 @@ import {
7
7
  validatePRTitle
8
8
  } from "./chunk-X2NQJ2ZY.js";
9
9
  import {
10
+ DEFAULT_RESERVED_SCOPE_NAMES,
10
11
  WorkflowConfigSchema,
11
12
  hasConfig,
12
- loadConfig
13
- } from "./chunk-4BIDFDSR.js";
13
+ loadConfig,
14
+ validateConfig,
15
+ validateScopeName
16
+ } from "./chunk-B27W7GWP.js";
14
17
  export {
18
+ DEFAULT_RESERVED_SCOPE_NAMES,
15
19
  WorkflowConfigSchema,
16
20
  discoverCustomScopes,
17
21
  getAllScopes,
@@ -20,6 +24,8 @@ export {
20
24
  loadConfig,
21
25
  validateBranchName,
22
26
  validateCommitMessage,
23
- validatePRTitle
27
+ validateConfig,
28
+ validatePRTitle,
29
+ validateScopeName
24
30
  };
25
31
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,256 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const DEFAULT_RESERVED_SCOPE_NAMES: string[];
4
+ declare function validateScopeName(name: string, reservedNames?: string[]): {
5
+ valid: boolean;
6
+ error?: string;
7
+ suggestion?: string;
8
+ };
9
+ declare const BranchTypeSchema: z.ZodEnum<["feature", "bugfix", "hotfix", "chore", "refactor", "docs", "test", "release"]>;
10
+ declare const ConventionalTypeSchema: z.ZodEnum<["feat", "fix", "refactor", "chore", "docs", "test", "perf", "style", "ci", "build", "revert"]>;
11
+ declare const ScopeSchema: z.ZodObject<{
12
+ name: z.ZodString;
13
+ description: z.ZodString;
14
+ allowedTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["feat", "fix", "refactor", "chore", "docs", "test", "perf", "style", "ci", "build", "revert"]>, "many">>;
15
+ mandatoryGuidelines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
+ emoji: z.ZodOptional<z.ZodString>;
17
+ category: z.ZodOptional<z.ZodEnum<["auth", "features", "infrastructure", "documentation", "testing", "performance", "other"]>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ name: string;
20
+ description: string;
21
+ allowedTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
22
+ mandatoryGuidelines?: string[] | undefined;
23
+ emoji?: string | undefined;
24
+ category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
25
+ }, {
26
+ name: string;
27
+ description: string;
28
+ allowedTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
29
+ mandatoryGuidelines?: string[] | undefined;
30
+ emoji?: string | undefined;
31
+ category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
32
+ }>;
33
+ declare const WorkflowConfigSchema: z.ZodEffects<z.ZodObject<{
34
+ projectName: z.ZodString;
35
+ scopes: z.ZodArray<z.ZodObject<{
36
+ name: z.ZodString;
37
+ description: z.ZodString;
38
+ allowedTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["feat", "fix", "refactor", "chore", "docs", "test", "perf", "style", "ci", "build", "revert"]>, "many">>;
39
+ mandatoryGuidelines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ emoji: z.ZodOptional<z.ZodString>;
41
+ category: z.ZodOptional<z.ZodEnum<["auth", "features", "infrastructure", "documentation", "testing", "performance", "other"]>>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ name: string;
44
+ description: string;
45
+ allowedTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
46
+ mandatoryGuidelines?: string[] | undefined;
47
+ emoji?: string | undefined;
48
+ category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
49
+ }, {
50
+ name: string;
51
+ description: string;
52
+ allowedTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
53
+ mandatoryGuidelines?: string[] | undefined;
54
+ emoji?: string | undefined;
55
+ category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
56
+ }>, "many">;
57
+ branchTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["feature", "bugfix", "hotfix", "chore", "refactor", "docs", "test", "release"]>, "many">>;
58
+ conventionalTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["feat", "fix", "refactor", "chore", "docs", "test", "perf", "style", "ci", "build", "revert"]>, "many">>;
59
+ enforcement: z.ZodDefault<z.ZodEnum<["strict", "advisory", "learning"]>>;
60
+ language: z.ZodDefault<z.ZodString>;
61
+ analytics: z.ZodOptional<z.ZodObject<{
62
+ enabled: z.ZodDefault<z.ZodBoolean>;
63
+ shareAnonymous: z.ZodDefault<z.ZodBoolean>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ enabled: boolean;
66
+ shareAnonymous: boolean;
67
+ }, {
68
+ enabled?: boolean | undefined;
69
+ shareAnonymous?: boolean | undefined;
70
+ }>>;
71
+ adapter: z.ZodOptional<z.ZodString>;
72
+ syncRemote: z.ZodOptional<z.ZodString>;
73
+ hooks: z.ZodOptional<z.ZodObject<{
74
+ enabled: z.ZodDefault<z.ZodBoolean>;
75
+ preCommit: z.ZodDefault<z.ZodArray<z.ZodEnum<["validate-branch", "validate-commit", "check-guidelines", "validate-scopes"]>, "many">>;
76
+ commitMsg: z.ZodDefault<z.ZodArray<z.ZodEnum<["validate-branch", "validate-commit", "check-guidelines", "validate-scopes"]>, "many">>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ enabled: boolean;
79
+ preCommit: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[];
80
+ commitMsg: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[];
81
+ }, {
82
+ enabled?: boolean | undefined;
83
+ preCommit?: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[] | undefined;
84
+ commitMsg?: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[] | undefined;
85
+ }>>;
86
+ guidelines: z.ZodOptional<z.ZodObject<{
87
+ additionalMandatory: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
88
+ optionalOverrides: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ additionalMandatory?: string[] | undefined;
91
+ optionalOverrides?: string[] | undefined;
92
+ }, {
93
+ additionalMandatory?: string[] | undefined;
94
+ optionalOverrides?: string[] | undefined;
95
+ }>>;
96
+ reservedScopeNames: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
97
+ ci: z.ZodOptional<z.ZodObject<{
98
+ enabled: z.ZodDefault<z.ZodBoolean>;
99
+ provider: z.ZodDefault<z.ZodEnum<["github", "gitlab", "bitbucket"]>>;
100
+ checks: z.ZodDefault<z.ZodArray<z.ZodEnum<["lint", "typecheck", "format", "test", "build"]>, "many">>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ enabled: boolean;
103
+ provider: "github" | "gitlab" | "bitbucket";
104
+ checks: ("test" | "build" | "lint" | "typecheck" | "format")[];
105
+ }, {
106
+ enabled?: boolean | undefined;
107
+ provider?: "github" | "gitlab" | "bitbucket" | undefined;
108
+ checks?: ("test" | "build" | "lint" | "typecheck" | "format")[] | undefined;
109
+ }>>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ projectName: string;
112
+ scopes: {
113
+ name: string;
114
+ description: string;
115
+ allowedTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
116
+ mandatoryGuidelines?: string[] | undefined;
117
+ emoji?: string | undefined;
118
+ category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
119
+ }[];
120
+ enforcement: "strict" | "advisory" | "learning";
121
+ language: string;
122
+ reservedScopeNames: string[];
123
+ ci?: {
124
+ enabled: boolean;
125
+ provider: "github" | "gitlab" | "bitbucket";
126
+ checks: ("test" | "build" | "lint" | "typecheck" | "format")[];
127
+ } | undefined;
128
+ branchTypes?: ("refactor" | "chore" | "docs" | "test" | "feature" | "bugfix" | "hotfix" | "release")[] | undefined;
129
+ conventionalTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
130
+ analytics?: {
131
+ enabled: boolean;
132
+ shareAnonymous: boolean;
133
+ } | undefined;
134
+ adapter?: string | undefined;
135
+ syncRemote?: string | undefined;
136
+ hooks?: {
137
+ enabled: boolean;
138
+ preCommit: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[];
139
+ commitMsg: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[];
140
+ } | undefined;
141
+ guidelines?: {
142
+ additionalMandatory?: string[] | undefined;
143
+ optionalOverrides?: string[] | undefined;
144
+ } | undefined;
145
+ }, {
146
+ projectName: string;
147
+ scopes: {
148
+ name: string;
149
+ description: string;
150
+ allowedTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
151
+ mandatoryGuidelines?: string[] | undefined;
152
+ emoji?: string | undefined;
153
+ category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
154
+ }[];
155
+ ci?: {
156
+ enabled?: boolean | undefined;
157
+ provider?: "github" | "gitlab" | "bitbucket" | undefined;
158
+ checks?: ("test" | "build" | "lint" | "typecheck" | "format")[] | undefined;
159
+ } | undefined;
160
+ branchTypes?: ("refactor" | "chore" | "docs" | "test" | "feature" | "bugfix" | "hotfix" | "release")[] | undefined;
161
+ conventionalTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
162
+ enforcement?: "strict" | "advisory" | "learning" | undefined;
163
+ language?: string | undefined;
164
+ analytics?: {
165
+ enabled?: boolean | undefined;
166
+ shareAnonymous?: boolean | undefined;
167
+ } | undefined;
168
+ adapter?: string | undefined;
169
+ syncRemote?: string | undefined;
170
+ hooks?: {
171
+ enabled?: boolean | undefined;
172
+ preCommit?: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[] | undefined;
173
+ commitMsg?: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[] | undefined;
174
+ } | undefined;
175
+ guidelines?: {
176
+ additionalMandatory?: string[] | undefined;
177
+ optionalOverrides?: string[] | undefined;
178
+ } | undefined;
179
+ reservedScopeNames?: string[] | undefined;
180
+ }>, {
181
+ projectName: string;
182
+ scopes: {
183
+ name: string;
184
+ description: string;
185
+ allowedTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
186
+ mandatoryGuidelines?: string[] | undefined;
187
+ emoji?: string | undefined;
188
+ category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
189
+ }[];
190
+ enforcement: "strict" | "advisory" | "learning";
191
+ language: string;
192
+ reservedScopeNames: string[];
193
+ ci?: {
194
+ enabled: boolean;
195
+ provider: "github" | "gitlab" | "bitbucket";
196
+ checks: ("test" | "build" | "lint" | "typecheck" | "format")[];
197
+ } | undefined;
198
+ branchTypes?: ("refactor" | "chore" | "docs" | "test" | "feature" | "bugfix" | "hotfix" | "release")[] | undefined;
199
+ conventionalTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
200
+ analytics?: {
201
+ enabled: boolean;
202
+ shareAnonymous: boolean;
203
+ } | undefined;
204
+ adapter?: string | undefined;
205
+ syncRemote?: string | undefined;
206
+ hooks?: {
207
+ enabled: boolean;
208
+ preCommit: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[];
209
+ commitMsg: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[];
210
+ } | undefined;
211
+ guidelines?: {
212
+ additionalMandatory?: string[] | undefined;
213
+ optionalOverrides?: string[] | undefined;
214
+ } | undefined;
215
+ }, {
216
+ projectName: string;
217
+ scopes: {
218
+ name: string;
219
+ description: string;
220
+ allowedTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
221
+ mandatoryGuidelines?: string[] | undefined;
222
+ emoji?: string | undefined;
223
+ category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
224
+ }[];
225
+ ci?: {
226
+ enabled?: boolean | undefined;
227
+ provider?: "github" | "gitlab" | "bitbucket" | undefined;
228
+ checks?: ("test" | "build" | "lint" | "typecheck" | "format")[] | undefined;
229
+ } | undefined;
230
+ branchTypes?: ("refactor" | "chore" | "docs" | "test" | "feature" | "bugfix" | "hotfix" | "release")[] | undefined;
231
+ conventionalTypes?: ("feat" | "fix" | "refactor" | "chore" | "docs" | "test" | "perf" | "style" | "ci" | "build" | "revert")[] | undefined;
232
+ enforcement?: "strict" | "advisory" | "learning" | undefined;
233
+ language?: string | undefined;
234
+ analytics?: {
235
+ enabled?: boolean | undefined;
236
+ shareAnonymous?: boolean | undefined;
237
+ } | undefined;
238
+ adapter?: string | undefined;
239
+ syncRemote?: string | undefined;
240
+ hooks?: {
241
+ enabled?: boolean | undefined;
242
+ preCommit?: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[] | undefined;
243
+ commitMsg?: ("validate-branch" | "validate-commit" | "check-guidelines" | "validate-scopes")[] | undefined;
244
+ } | undefined;
245
+ guidelines?: {
246
+ additionalMandatory?: string[] | undefined;
247
+ optionalOverrides?: string[] | undefined;
248
+ } | undefined;
249
+ reservedScopeNames?: string[] | undefined;
250
+ }>;
251
+ type Scope = z.infer<typeof ScopeSchema>;
252
+ type BranchType = z.infer<typeof BranchTypeSchema>;
253
+ type ConventionalType = z.infer<typeof ConventionalTypeSchema>;
254
+ type WorkflowConfig = z.infer<typeof WorkflowConfigSchema>;
255
+
256
+ export { type BranchType as B, type ConventionalType as C, DEFAULT_RESERVED_SCOPE_NAMES as D, type Scope as S, type WorkflowConfig as W, WorkflowConfigSchema as a, validateScopeName as v };
@@ -1,4 +1,4 @@
1
- import { S as Scope, W as WorkflowConfig } from '../schema-RkQ91pZW.js';
1
+ import { S as Scope, W as WorkflowConfig } from '../schema-C1lmnd7L.js';
2
2
  import 'zod';
3
3
 
4
4
  interface ValidationResult {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workflow-agent-cli",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "A self-evolving workflow management system for AI agent development",
5
5
  "keywords": [
6
6
  "workflow",
@@ -52,11 +52,13 @@
52
52
  "fast-glob": "^3.3.2",
53
53
  "mustache": "^4.2.0",
54
54
  "picocolors": "^1.0.0",
55
+ "prompts": "^2.4.2",
55
56
  "zod": "^3.22.4"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/mustache": "^4.2.5",
59
60
  "@types/node": "^20.11.5",
61
+ "@types/prompts": "^2.4.9",
60
62
  "eslint": "^8.56.0",
61
63
  "tsup": "^8.0.1",
62
64
  "typescript": "^5.3.3",
@@ -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(cwd: string = process.cwd()): 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 { WorkflowConfig, WorkflowConfigSchema, Scope, BranchType, ConventionalType } from './schema.js';\n","import { z } from 'zod';\n\n// Reserved scope names that cannot be used\nconst RESERVED_SCOPE_NAMES = ['init', 'create', 'build', 'test', 'config', 'docs', 'ci', 'deps'];\n\nexport const ScopeSchema = z.object({\n name: z.string()\n .min(1)\n .max(32, 'Scope name must be 32 characters or less')\n .regex(/^[a-z0-9-]+$/, 'Scope name must be lowercase alphanumeric with hyphens')\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.string().min(10, 'Scope description must be at least 10 characters'),\n emoji: z.string().optional(),\n category: z.enum(['auth', 'features', 'infrastructure', 'documentation', 'testing', 'performance', 'other']).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(['strict', 'advisory', 'learning']);\n\nexport const AnalyticsConfigSchema = z.object({\n enabled: z.boolean().default(false),\n shareAnonymous: z.boolean().default(false),\n});\n\n// Pre-commit hook check types\nexport const HookCheckSchema = z.enum([\n 'validate-branch',\n 'validate-commit',\n 'check-guidelines',\n]);\n\n// Git hooks configuration\nexport const HooksConfigSchema = z.object({\n /** Whether hooks are enabled */\n enabled: z.boolean().default(true),\n /** Checks to run on pre-commit */\n preCommit: z.array(HookCheckSchema).default(['validate-branch', 'check-guidelines']),\n /** Checks to run on commit-msg */\n commitMsg: z.array(HookCheckSchema).default(['validate-commit']),\n});\n\n// Guidelines configuration with mandatory templates and user overrides\nexport const GuidelinesConfigSchema = z.object({\n /** Additional templates to make mandatory (beyond the core set) */\n additionalMandatory: z.array(z.string()).optional(),\n /** Templates to make optional (override core mandatory templates) */\n optionalOverrides: z.array(z.string()).optional(),\n});\n\n// CI provider types\nexport const CIProviderSchema = z.enum(['github', 'gitlab', 'bitbucket']);\n\n// CI check types\nexport const CICheckSchema = z.enum(['lint', 'typecheck', 'format', 'test', 'build']);\n\n// CI/CD configuration\nexport const CIConfigSchema = z.object({\n /** Whether CI setup is enabled */\n enabled: z.boolean().default(true),\n /** CI provider (currently only github supported) */\n provider: CIProviderSchema.default('github'),\n /** Checks to run in CI pipeline */\n checks: z.array(CICheckSchema).default(['lint', 'typecheck', 'format', 'build', 'test']),\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 hooks: HooksConfigSchema.optional(),\n guidelines: GuidelinesConfigSchema.optional(),\n ci: CIConfigSchema.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 HookCheck = z.infer<typeof HookCheckSchema>;\nexport type HooksConfig = z.infer<typeof HooksConfigSchema>;\nexport type GuidelinesConfig = z.infer<typeof GuidelinesConfigSchema>;\nexport type CIProvider = z.infer<typeof CIProviderSchema>;\nexport type CICheck = z.infer<typeof CICheckSchema>;\nexport type CIConfig = z.infer<typeof CIConfigSchema>;\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,mBAAmB;;;ACA5B,SAAS,SAAS;AAGlB,IAAM,uBAAuB,CAAC,QAAQ,UAAU,SAAS,QAAQ,UAAU,QAAQ,MAAM,MAAM;AAExF,IAAM,cAAc,EAAE,OAAO;AAAA,EAClC,MAAM,EAAE,OAAO,EACZ,IAAI,CAAC,EACL,IAAI,IAAI,0CAA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odObject<{
4
- name: z.ZodEffects<z.ZodString, string, string>;
5
- description: z.ZodString;
6
- emoji: z.ZodOptional<z.ZodString>;
7
- category: z.ZodOptional<z.ZodEnum<["auth", "features", "infrastructure", "documentation", "testing", "performance", "other"]>>;
8
- }, "strip", z.ZodTypeAny, {
9
- name: string;
10
- description: string;
11
- emoji?: string | undefined;
12
- category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
13
- }, {
14
- name: string;
15
- description: string;
16
- emoji?: string | undefined;
17
- category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
18
- }>;
19
- declare const BranchTypeSchema: z.ZodEnum<["feature", "bugfix", "hotfix", "chore", "refactor", "docs", "test", "release"]>;
20
- declare const ConventionalTypeSchema: z.ZodEnum<["feat", "fix", "refactor", "chore", "docs", "test", "perf", "style", "ci", "build", "revert"]>;
21
- declare const WorkflowConfigSchema: z.ZodObject<{
22
- projectName: z.ZodString;
23
- scopes: z.ZodArray<z.ZodObject<{
24
- name: z.ZodEffects<z.ZodString, string, string>;
25
- description: z.ZodString;
26
- emoji: z.ZodOptional<z.ZodString>;
27
- category: z.ZodOptional<z.ZodEnum<["auth", "features", "infrastructure", "documentation", "testing", "performance", "other"]>>;
28
- }, "strip", z.ZodTypeAny, {
29
- name: string;
30
- description: string;
31
- emoji?: string | undefined;
32
- category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
33
- }, {
34
- name: string;
35
- description: string;
36
- emoji?: string | undefined;
37
- category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
38
- }>, "many">;
39
- branchTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["feature", "bugfix", "hotfix", "chore", "refactor", "docs", "test", "release"]>, "many">>;
40
- conventionalTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["feat", "fix", "refactor", "chore", "docs", "test", "perf", "style", "ci", "build", "revert"]>, "many">>;
41
- enforcement: z.ZodDefault<z.ZodEnum<["strict", "advisory", "learning"]>>;
42
- language: z.ZodDefault<z.ZodString>;
43
- analytics: z.ZodOptional<z.ZodObject<{
44
- enabled: z.ZodDefault<z.ZodBoolean>;
45
- shareAnonymous: z.ZodDefault<z.ZodBoolean>;
46
- }, "strip", z.ZodTypeAny, {
47
- enabled: boolean;
48
- shareAnonymous: boolean;
49
- }, {
50
- enabled?: boolean | undefined;
51
- shareAnonymous?: boolean | undefined;
52
- }>>;
53
- adapter: z.ZodOptional<z.ZodString>;
54
- syncRemote: z.ZodOptional<z.ZodString>;
55
- hooks: z.ZodOptional<z.ZodObject<{
56
- enabled: z.ZodDefault<z.ZodBoolean>;
57
- preCommit: z.ZodDefault<z.ZodArray<z.ZodEnum<["validate-branch", "validate-commit", "check-guidelines"]>, "many">>;
58
- commitMsg: z.ZodDefault<z.ZodArray<z.ZodEnum<["validate-branch", "validate-commit", "check-guidelines"]>, "many">>;
59
- }, "strip", z.ZodTypeAny, {
60
- enabled: boolean;
61
- preCommit: ("validate-branch" | "validate-commit" | "check-guidelines")[];
62
- commitMsg: ("validate-branch" | "validate-commit" | "check-guidelines")[];
63
- }, {
64
- enabled?: boolean | undefined;
65
- preCommit?: ("validate-branch" | "validate-commit" | "check-guidelines")[] | undefined;
66
- commitMsg?: ("validate-branch" | "validate-commit" | "check-guidelines")[] | undefined;
67
- }>>;
68
- guidelines: z.ZodOptional<z.ZodObject<{
69
- additionalMandatory: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
70
- optionalOverrides: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
71
- }, "strip", z.ZodTypeAny, {
72
- additionalMandatory?: string[] | undefined;
73
- optionalOverrides?: string[] | undefined;
74
- }, {
75
- additionalMandatory?: string[] | undefined;
76
- optionalOverrides?: string[] | undefined;
77
- }>>;
78
- ci: z.ZodOptional<z.ZodObject<{
79
- enabled: z.ZodDefault<z.ZodBoolean>;
80
- provider: z.ZodDefault<z.ZodEnum<["github", "gitlab", "bitbucket"]>>;
81
- checks: z.ZodDefault<z.ZodArray<z.ZodEnum<["lint", "typecheck", "format", "test", "build"]>, "many">>;
82
- }, "strip", z.ZodTypeAny, {
83
- enabled: boolean;
84
- provider: "github" | "gitlab" | "bitbucket";
85
- checks: ("build" | "test" | "lint" | "typecheck" | "format")[];
86
- }, {
87
- enabled?: boolean | undefined;
88
- provider?: "github" | "gitlab" | "bitbucket" | undefined;
89
- checks?: ("build" | "test" | "lint" | "typecheck" | "format")[] | undefined;
90
- }>>;
91
- }, "strip", z.ZodTypeAny, {
92
- projectName: string;
93
- scopes: {
94
- name: string;
95
- description: string;
96
- emoji?: string | undefined;
97
- category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
98
- }[];
99
- enforcement: "strict" | "advisory" | "learning";
100
- language: string;
101
- ci?: {
102
- enabled: boolean;
103
- provider: "github" | "gitlab" | "bitbucket";
104
- checks: ("build" | "test" | "lint" | "typecheck" | "format")[];
105
- } | undefined;
106
- branchTypes?: ("test" | "docs" | "feature" | "bugfix" | "hotfix" | "chore" | "refactor" | "release")[] | undefined;
107
- conventionalTypes?: ("build" | "test" | "docs" | "ci" | "chore" | "refactor" | "feat" | "fix" | "perf" | "style" | "revert")[] | undefined;
108
- analytics?: {
109
- enabled: boolean;
110
- shareAnonymous: boolean;
111
- } | undefined;
112
- adapter?: string | undefined;
113
- syncRemote?: string | undefined;
114
- hooks?: {
115
- enabled: boolean;
116
- preCommit: ("validate-branch" | "validate-commit" | "check-guidelines")[];
117
- commitMsg: ("validate-branch" | "validate-commit" | "check-guidelines")[];
118
- } | undefined;
119
- guidelines?: {
120
- additionalMandatory?: string[] | undefined;
121
- optionalOverrides?: string[] | undefined;
122
- } | undefined;
123
- }, {
124
- projectName: string;
125
- scopes: {
126
- name: string;
127
- description: string;
128
- emoji?: string | undefined;
129
- category?: "auth" | "features" | "infrastructure" | "documentation" | "testing" | "performance" | "other" | undefined;
130
- }[];
131
- ci?: {
132
- enabled?: boolean | undefined;
133
- provider?: "github" | "gitlab" | "bitbucket" | undefined;
134
- checks?: ("build" | "test" | "lint" | "typecheck" | "format")[] | undefined;
135
- } | undefined;
136
- branchTypes?: ("test" | "docs" | "feature" | "bugfix" | "hotfix" | "chore" | "refactor" | "release")[] | undefined;
137
- conventionalTypes?: ("build" | "test" | "docs" | "ci" | "chore" | "refactor" | "feat" | "fix" | "perf" | "style" | "revert")[] | undefined;
138
- enforcement?: "strict" | "advisory" | "learning" | undefined;
139
- language?: string | undefined;
140
- analytics?: {
141
- enabled?: boolean | undefined;
142
- shareAnonymous?: boolean | undefined;
143
- } | undefined;
144
- adapter?: string | undefined;
145
- syncRemote?: string | undefined;
146
- hooks?: {
147
- enabled?: boolean | undefined;
148
- preCommit?: ("validate-branch" | "validate-commit" | "check-guidelines")[] | undefined;
149
- commitMsg?: ("validate-branch" | "validate-commit" | "check-guidelines")[] | undefined;
150
- } | undefined;
151
- guidelines?: {
152
- additionalMandatory?: string[] | undefined;
153
- optionalOverrides?: string[] | undefined;
154
- } | undefined;
155
- }>;
156
- type Scope = z.infer<typeof ScopeSchema>;
157
- type BranchType = z.infer<typeof BranchTypeSchema>;
158
- type ConventionalType = z.infer<typeof ConventionalTypeSchema>;
159
- type WorkflowConfig = z.infer<typeof WorkflowConfigSchema>;
160
-
161
- export { type BranchType as B, type ConventionalType as C, type Scope as S, type WorkflowConfig as W, WorkflowConfigSchema as a };