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.
- package/dist/{chunk-4BIDFDSR.js → chunk-B27W7GWP.js} +118 -11
- package/dist/chunk-B27W7GWP.js.map +1 -0
- package/dist/cli/index.js +348 -54
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +8 -3
- package/dist/config/index.js +9 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -3
- package/dist/schema-C1lmnd7L.d.ts +256 -0
- package/dist/validators/index.d.ts +1 -1
- package/package.json +3 -1
- package/dist/chunk-4BIDFDSR.js.map +0 -1
- package/dist/schema-RkQ91pZW.d.ts +0 -161
|
@@ -3,15 +3,37 @@ import { cosmiconfig } from "cosmiconfig";
|
|
|
3
3
|
|
|
4
4
|
// src/config/schema.ts
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
var DEFAULT_RESERVED_SCOPE_NAMES = ["init", "create", "build", "test", "config", "docs", "ci", "deps"];
|
|
7
|
+
function validateScopeName(name, reservedNames = DEFAULT_RESERVED_SCOPE_NAMES) {
|
|
8
|
+
if (reservedNames.includes(name)) {
|
|
9
|
+
const suggestions = {
|
|
10
|
+
"docs": "documentation",
|
|
11
|
+
"test": "testing",
|
|
12
|
+
"config": "configuration",
|
|
13
|
+
"build": "builds",
|
|
14
|
+
"ci": "cicd",
|
|
15
|
+
"deps": "dependencies"
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
valid: false,
|
|
19
|
+
error: `Scope name "${name}" is reserved`,
|
|
20
|
+
suggestion: suggestions[name] || `${name}-scope`
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
24
|
+
return {
|
|
25
|
+
valid: false,
|
|
26
|
+
error: "Scope name must be lowercase alphanumeric with hyphens"
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (name.length === 0 || name.length > 32) {
|
|
30
|
+
return {
|
|
31
|
+
valid: false,
|
|
32
|
+
error: "Scope name must be 1-32 characters"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return { valid: true };
|
|
36
|
+
}
|
|
15
37
|
var BranchTypeSchema = z.enum([
|
|
16
38
|
"feature",
|
|
17
39
|
"bugfix",
|
|
@@ -35,6 +57,14 @@ var ConventionalTypeSchema = z.enum([
|
|
|
35
57
|
"build",
|
|
36
58
|
"revert"
|
|
37
59
|
]);
|
|
60
|
+
var ScopeSchema = z.object({
|
|
61
|
+
name: z.string().min(1).max(32, "Scope name must be 32 characters or less").regex(/^[a-z0-9-]+$/, "Scope name must be lowercase alphanumeric with hyphens"),
|
|
62
|
+
description: z.string().min(10, "Scope description must be at least 10 characters"),
|
|
63
|
+
allowedTypes: z.array(ConventionalTypeSchema).optional(),
|
|
64
|
+
mandatoryGuidelines: z.array(z.string()).optional(),
|
|
65
|
+
emoji: z.string().optional(),
|
|
66
|
+
category: z.enum(["auth", "features", "infrastructure", "documentation", "testing", "performance", "other"]).optional()
|
|
67
|
+
});
|
|
38
68
|
var EnforcementLevelSchema = z.enum(["strict", "advisory", "learning"]);
|
|
39
69
|
var AnalyticsConfigSchema = z.object({
|
|
40
70
|
enabled: z.boolean().default(false),
|
|
@@ -43,7 +73,8 @@ var AnalyticsConfigSchema = z.object({
|
|
|
43
73
|
var HookCheckSchema = z.enum([
|
|
44
74
|
"validate-branch",
|
|
45
75
|
"validate-commit",
|
|
46
|
-
"check-guidelines"
|
|
76
|
+
"check-guidelines",
|
|
77
|
+
"validate-scopes"
|
|
47
78
|
]);
|
|
48
79
|
var HooksConfigSchema = z.object({
|
|
49
80
|
/** Whether hooks are enabled */
|
|
@@ -81,7 +112,24 @@ var WorkflowConfigSchema = z.object({
|
|
|
81
112
|
syncRemote: z.string().optional(),
|
|
82
113
|
hooks: HooksConfigSchema.optional(),
|
|
83
114
|
guidelines: GuidelinesConfigSchema.optional(),
|
|
115
|
+
reservedScopeNames: z.array(z.string()).optional().default(DEFAULT_RESERVED_SCOPE_NAMES),
|
|
84
116
|
ci: CIConfigSchema.optional()
|
|
117
|
+
}).superRefine((config, ctx) => {
|
|
118
|
+
const reservedNames = config.reservedScopeNames || DEFAULT_RESERVED_SCOPE_NAMES;
|
|
119
|
+
config.scopes.forEach((scope, index) => {
|
|
120
|
+
const validation = validateScopeName(scope.name, reservedNames);
|
|
121
|
+
if (!validation.valid) {
|
|
122
|
+
let message = validation.error || "Invalid scope name";
|
|
123
|
+
if (validation.suggestion) {
|
|
124
|
+
message += `. Try renaming to "${validation.suggestion}"`;
|
|
125
|
+
}
|
|
126
|
+
ctx.addIssue({
|
|
127
|
+
code: z.ZodIssueCode.custom,
|
|
128
|
+
path: ["scopes", index, "name"],
|
|
129
|
+
message
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
});
|
|
85
133
|
});
|
|
86
134
|
function validateScopeDefinitions(scopes) {
|
|
87
135
|
const errors = [];
|
|
@@ -107,6 +155,7 @@ function validateScopeDefinitions(scopes) {
|
|
|
107
155
|
// src/config/index.ts
|
|
108
156
|
import { join } from "path";
|
|
109
157
|
import { existsSync } from "fs";
|
|
158
|
+
import { z as z2 } from "zod";
|
|
110
159
|
var explorer = cosmiconfig("workflow", {
|
|
111
160
|
searchPlaces: [
|
|
112
161
|
"workflow.config.ts",
|
|
@@ -126,12 +175,67 @@ async function loadConfig(cwd = process.cwd()) {
|
|
|
126
175
|
const validated = WorkflowConfigSchema.parse(result.config);
|
|
127
176
|
return validated;
|
|
128
177
|
} catch (error) {
|
|
178
|
+
if (error instanceof z2.ZodError) {
|
|
179
|
+
const result = await explorer.search(cwd);
|
|
180
|
+
const formattedErrors = error.errors.map((err) => {
|
|
181
|
+
const path = err.path.join(".");
|
|
182
|
+
if (err.path[0] === "scopes" && typeof err.path[1] === "number") {
|
|
183
|
+
const scopeIndex = err.path[1];
|
|
184
|
+
const scopeName = result?.config?.scopes?.[scopeIndex]?.name || `scope at index ${scopeIndex}`;
|
|
185
|
+
const field = err.path[2] || "definition";
|
|
186
|
+
let message = err.message;
|
|
187
|
+
if (message.includes("reserved word")) {
|
|
188
|
+
const reservedMatch = message.match(/Scope name "([^"]+)" is reserved/);
|
|
189
|
+
if (reservedMatch) {
|
|
190
|
+
const suggestions = {
|
|
191
|
+
"docs": "documentation",
|
|
192
|
+
"test": "testing",
|
|
193
|
+
"config": "configuration",
|
|
194
|
+
"build": "builds",
|
|
195
|
+
"ci": "cicd",
|
|
196
|
+
"deps": "dependencies"
|
|
197
|
+
};
|
|
198
|
+
const badName = reservedMatch[1];
|
|
199
|
+
const suggestion = suggestions[badName] || `${badName}-scope`;
|
|
200
|
+
message = `${message}. Try renaming to "${suggestion}"`;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return field === "definition" ? `Scope "${scopeName}": ${message}` : `Scope "${scopeName}" ${field}: ${message}`;
|
|
204
|
+
}
|
|
205
|
+
return `${path}: ${err.message}`;
|
|
206
|
+
}).join("\n \u2022 ");
|
|
207
|
+
throw new Error(`Invalid workflow configuration:
|
|
208
|
+
\u2022 ${formattedErrors}
|
|
209
|
+
|
|
210
|
+
\u{1F4A1} Fix these issues in workflow.config.json or run: workflow config validate`);
|
|
211
|
+
}
|
|
129
212
|
if (error instanceof Error) {
|
|
130
213
|
throw new Error(`Failed to load workflow config: ${error.message}`);
|
|
131
214
|
}
|
|
132
215
|
throw error;
|
|
133
216
|
}
|
|
134
217
|
}
|
|
218
|
+
async function validateConfig(cwd = process.cwd()) {
|
|
219
|
+
const errors = [];
|
|
220
|
+
const warnings = [];
|
|
221
|
+
try {
|
|
222
|
+
const config = await loadConfig(cwd);
|
|
223
|
+
if (!config) {
|
|
224
|
+
errors.push("No configuration file found");
|
|
225
|
+
return { valid: false, errors, warnings };
|
|
226
|
+
}
|
|
227
|
+
const scopeValidation = validateScopeDefinitions(config.scopes);
|
|
228
|
+
errors.push(...scopeValidation.errors);
|
|
229
|
+
return {
|
|
230
|
+
valid: errors.length === 0,
|
|
231
|
+
errors,
|
|
232
|
+
warnings
|
|
233
|
+
};
|
|
234
|
+
} catch (error) {
|
|
235
|
+
errors.push(error instanceof Error ? error.message : String(error));
|
|
236
|
+
return { valid: false, errors, warnings };
|
|
237
|
+
}
|
|
238
|
+
}
|
|
135
239
|
function hasConfig(cwd = process.cwd()) {
|
|
136
240
|
const configPaths = [
|
|
137
241
|
"workflow.config.ts",
|
|
@@ -144,9 +248,12 @@ function hasConfig(cwd = process.cwd()) {
|
|
|
144
248
|
}
|
|
145
249
|
|
|
146
250
|
export {
|
|
251
|
+
DEFAULT_RESERVED_SCOPE_NAMES,
|
|
252
|
+
validateScopeName,
|
|
147
253
|
WorkflowConfigSchema,
|
|
148
254
|
validateScopeDefinitions,
|
|
149
255
|
loadConfig,
|
|
256
|
+
validateConfig,
|
|
150
257
|
hasConfig
|
|
151
258
|
};
|
|
152
|
-
//# sourceMappingURL=chunk-
|
|
259
|
+
//# sourceMappingURL=chunk-B27W7GWP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config/index.ts","../src/config/schema.ts"],"sourcesContent":["import { cosmiconfig } from 'cosmiconfig';\nimport { WorkflowConfig, WorkflowConfigSchema, validateScopeDefinitions } from './schema.js';\nimport { join } from 'path';\nimport { existsSync } from 'fs';\nimport { z } from 'zod';\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 z.ZodError) {\n // Format Zod errors to be more user-friendly\n const result = await explorer.search(cwd);\n const formattedErrors = error.errors.map(err => {\n const path = err.path.join('.');\n \n // If error is in scopes array, show the scope name\n if (err.path[0] === 'scopes' && typeof err.path[1] === 'number') {\n const scopeIndex = err.path[1];\n const scopeName = result?.config?.scopes?.[scopeIndex]?.name || `scope at index ${scopeIndex}`;\n const field = err.path[2] || 'definition';\n \n // Add helpful suggestions for common errors\n let message = err.message;\n if (message.includes('reserved word')) {\n const reservedMatch = message.match(/Scope name \"([^\"]+)\" is reserved/);\n if (reservedMatch) {\n const suggestions: Record<string, string> = {\n 'docs': 'documentation',\n 'test': 'testing',\n 'config': 'configuration',\n 'build': 'builds',\n 'ci': 'cicd',\n 'deps': 'dependencies',\n };\n const badName = reservedMatch[1];\n const suggestion = suggestions[badName] || `${badName}-scope`;\n message = `${message}. Try renaming to \"${suggestion}\"`;\n }\n }\n \n return field === 'definition' \n ? `Scope \"${scopeName}\": ${message}`\n : `Scope \"${scopeName}\" ${field}: ${message}`;\n }\n \n return `${path}: ${err.message}`;\n }).join('\\n • ');\n \n throw new Error(`Invalid workflow configuration:\\n • ${formattedErrors}\\n\\n💡 Fix these issues in workflow.config.json or run: workflow config validate`);\n }\n \n if (error instanceof Error) {\n throw new Error(`Failed to load workflow config: ${error.message}`);\n }\n throw error;\n }\n}\n\nexport async function validateConfig(cwd: string = process.cwd()): Promise<{\n valid: boolean;\n errors: string[];\n warnings: string[];\n}> {\n const errors: string[] = [];\n const warnings: string[] = [];\n \n try {\n const config = await loadConfig(cwd);\n if (!config) {\n errors.push('No configuration file found');\n return { valid: false, errors, warnings };\n }\n \n // Additional validation beyond schema\n const scopeValidation = validateScopeDefinitions(config.scopes);\n errors.push(...scopeValidation.errors);\n \n return {\n valid: errors.length === 0,\n errors,\n warnings,\n };\n } catch (error) {\n errors.push(error instanceof Error ? error.message : String(error));\n return { valid: false, errors, warnings };\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, validateScopeName, DEFAULT_RESERVED_SCOPE_NAMES } from './schema.js';\n","import { z } from 'zod';\n\n// Default reserved scope names that cannot be used\nexport const DEFAULT_RESERVED_SCOPE_NAMES = ['init', 'create', 'build', 'test', 'config', 'docs', 'ci', 'deps'];\n\n/**\n * Validates a scope name against reserved words and naming rules\n */\nexport function validateScopeName(name: string, reservedNames: string[] = DEFAULT_RESERVED_SCOPE_NAMES): {\n valid: boolean;\n error?: string;\n suggestion?: string;\n} {\n if (reservedNames.includes(name)) {\n // Provide suggestions for common reserved words\n const suggestions: Record<string, string> = {\n 'docs': 'documentation',\n 'test': 'testing',\n 'config': 'configuration',\n 'build': 'builds',\n 'ci': 'cicd',\n 'deps': 'dependencies',\n };\n \n return {\n valid: false,\n error: `Scope name \"${name}\" is reserved`,\n suggestion: suggestions[name] || `${name}-scope`,\n };\n }\n \n if (!/^[a-z0-9-]+$/.test(name)) {\n return {\n valid: false,\n error: 'Scope name must be lowercase alphanumeric with hyphens',\n };\n }\n \n if (name.length === 0 || name.length > 32) {\n return {\n valid: false,\n error: 'Scope name must be 1-32 characters',\n };\n }\n \n return { valid: true };\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 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 description: z.string().min(10, 'Scope description must be at least 10 characters'),\n allowedTypes: z.array(ConventionalTypeSchema).optional(),\n mandatoryGuidelines: z.array(z.string()).optional(),\n emoji: z.string().optional(),\n category: z.enum(['auth', 'features', 'infrastructure', 'documentation', 'testing', 'performance', 'other']).optional(),\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 'validate-scopes',\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 reservedScopeNames: z.array(z.string()).optional().default(DEFAULT_RESERVED_SCOPE_NAMES),\n ci: CIConfigSchema.optional(),\n}).superRefine((config, ctx) => {\n // Validate scopes against reserved names\n const reservedNames = config.reservedScopeNames || DEFAULT_RESERVED_SCOPE_NAMES;\n \n config.scopes.forEach((scope, index) => {\n const validation = validateScopeName(scope.name, reservedNames);\n if (!validation.valid) {\n let message = validation.error || 'Invalid scope name';\n if (validation.suggestion) {\n message += `. Try renaming to \"${validation.suggestion}\"`;\n }\n \n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['scopes', index, 'name'],\n message,\n });\n }\n });\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;AAGX,IAAM,+BAA+B,CAAC,QAAQ,UAAU,SAAS,QAAQ,UAAU,QAAQ,MAAM,MAAM;AAKvG,SAAS,kBAAkB,MAAc,gBAA0B,8BAIxE;AACA,MAAI,cAAc,SAAS,IAAI,GAAG;AAEhC,UAAM,cAAsC;AAAA,MAC1C,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,SAAS;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAEA,WAAO;AAAA,MACL,OAAO;AAAA,MACP,OAAO,eAAe,IAAI;AAAA,MAC1B,YAAY,YAAY,IAAI,KAAK,GAAG,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,MAAI,CAAC,eAAe,KAAK,IAAI,GAAG;AAC9B,WAAO;AAAA,MACL,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,KAAK,WAAW,KAAK,KAAK,SAAS,IAAI;AACzC,WAAO;AAAA,MACL,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,KAAK;AACvB;AAEO,IAAM,mBAAmB,EAAE,KAAK;AA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