workflow-agent-cli 2.23.0 → 2.23.2

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 (39) hide show
  1. package/README.md +15 -15
  2. package/dist/{auto-fix-7WAESKYO.js → auto-fix-WGRYEFLJ.js} +2 -2
  3. package/dist/{chunk-IWFUJ2DS.js → chunk-DWHIY7R4.js} +20 -9
  4. package/dist/chunk-DWHIY7R4.js.map +1 -0
  5. package/dist/{chunk-D36IFZUZ.js → chunk-EHRI6BI6.js} +15 -4
  6. package/dist/chunk-EHRI6BI6.js.map +1 -0
  7. package/dist/{chunk-M6RHIUSM.js → chunk-K42R54II.js} +147 -54
  8. package/dist/chunk-K42R54II.js.map +1 -0
  9. package/dist/{chunk-XGS2VFBP.js → chunk-MBRMT5ZG.js} +865 -18
  10. package/dist/chunk-MBRMT5ZG.js.map +1 -0
  11. package/dist/{chunk-YELUGXOM.js → chunk-NPJJZHJG.js} +1 -1
  12. package/dist/chunk-NPJJZHJG.js.map +1 -0
  13. package/dist/{chunk-UWJ2ZGEI.js → chunk-OH6TK27N.js} +3 -3
  14. package/dist/{chunk-ZLDJ2OGO.js → chunk-WK7D2AVV.js} +11 -3
  15. package/dist/{chunk-ZLDJ2OGO.js.map → chunk-WK7D2AVV.js.map} +1 -1
  16. package/dist/cli/index.js +771 -285
  17. package/dist/cli/index.js.map +1 -1
  18. package/dist/config/index.js +2 -2
  19. package/dist/index.d.ts +87 -56
  20. package/dist/index.js +26 -10
  21. package/dist/scripts/postinstall.js +1 -1
  22. package/dist/scripts/postinstall.js.map +1 -1
  23. package/dist/sync-HHQM3GKR.js +7 -0
  24. package/dist/validators/index.js +1 -1
  25. package/dist/verify-PA7R6FBJ.js +8 -0
  26. package/package.json +2 -2
  27. package/dist/chunk-3ADL5QDN.js +0 -396
  28. package/dist/chunk-3ADL5QDN.js.map +0 -1
  29. package/dist/chunk-D36IFZUZ.js.map +0 -1
  30. package/dist/chunk-IWFUJ2DS.js.map +0 -1
  31. package/dist/chunk-M6RHIUSM.js.map +0 -1
  32. package/dist/chunk-XGS2VFBP.js.map +0 -1
  33. package/dist/chunk-YELUGXOM.js.map +0 -1
  34. package/dist/sync-6T5TD4QS.js +0 -7
  35. package/dist/verify-TX6LFMI6.js +0 -8
  36. /package/dist/{auto-fix-7WAESKYO.js.map → auto-fix-WGRYEFLJ.js.map} +0 -0
  37. /package/dist/{chunk-UWJ2ZGEI.js.map → chunk-OH6TK27N.js.map} +0 -0
  38. /package/dist/{sync-6T5TD4QS.js.map → sync-HHQM3GKR.js.map} +0 -0
  39. /package/dist/{verify-TX6LFMI6.js.map → verify-PA7R6FBJ.js.map} +0 -0
@@ -2,14 +2,14 @@ import {
2
2
  hasConfig,
3
3
  loadConfig,
4
4
  loadConfigSafe
5
- } from "../chunk-UWJ2ZGEI.js";
5
+ } from "../chunk-OH6TK27N.js";
6
6
  import {
7
7
  WorkflowConfigSchema,
8
8
  analyzeValidationError,
9
9
  applyAutoFixes,
10
10
  autoFixConfigFile,
11
11
  writeFixedConfig
12
- } from "../chunk-YELUGXOM.js";
12
+ } from "../chunk-NPJJZHJG.js";
13
13
  export {
14
14
  WorkflowConfigSchema,
15
15
  analyzeValidationError,
package/dist/index.d.ts CHANGED
@@ -3,60 +3,6 @@ export { BrokenReference, DocumentReference, DocumentValidationResult, Validatio
3
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
- interface CheckDefinition {
7
- name: string;
8
- displayName: string;
9
- command: string;
10
- args: string[];
11
- fixCommand?: string;
12
- fixArgs?: string[];
13
- canAutoFix: boolean;
14
- requiredScript?: string;
15
- fallbackCommand?: string[];
16
- }
17
- interface CheckResult {
18
- check: CheckDefinition;
19
- success: boolean;
20
- output: string;
21
- error?: string;
22
- duration: number;
23
- }
24
- interface AppliedFix {
25
- checkName: string;
26
- displayName: string;
27
- command: string;
28
- timestamp: Date;
29
- }
30
- interface RunAllChecksResult {
31
- success: boolean;
32
- results: CheckResult[];
33
- totalAttempts: number;
34
- fixesApplied: number;
35
- appliedFixes: AppliedFix[];
36
- pendingFixes?: Array<{
37
- check: CheckDefinition;
38
- command: string;
39
- }>;
40
- }
41
- type ProgressType = "info" | "success" | "error" | "warning";
42
- interface CheckRunnerOptions {
43
- maxRetries?: number;
44
- autoFix?: boolean;
45
- dryRun?: boolean;
46
- onProgress?: (message: string, type: ProgressType) => void;
47
- }
48
- declare const QUALITY_CHECKS: CheckDefinition[];
49
- declare function getAvailableScripts(cwd: string): Set<string>;
50
- declare function getApplicableChecks(cwd: string): Promise<CheckDefinition[]>;
51
- declare function runCheck(check: CheckDefinition, cwd: string): Promise<CheckResult>;
52
- declare function applyFix(check: CheckDefinition, cwd: string): Promise<{
53
- success: boolean;
54
- output: string;
55
- }>;
56
- declare function runAllChecks(cwd: string, options?: CheckRunnerOptions): Promise<RunAllChecksResult>;
57
- declare function hasUncommittedChanges(cwd: string): Promise<boolean>;
58
- declare function stageAllChanges(cwd: string): Promise<boolean>;
59
-
60
6
  type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
61
7
 
62
8
  interface ProjectAnalysis {
@@ -118,10 +64,95 @@ interface AuditReport {
118
64
  allDevDependencies: string[];
119
65
  plans: SetupPlan[];
120
66
  }
121
- type FrameworkType = "nextjs" | "remix" | "react" | "vue" | "nuxt" | "svelte" | "node" | "express" | "hono" | "shopify" | "unknown";
67
+ type FrameworkType = "nextjs" | "remix" | "react" | "vue" | "nuxt" | "svelte" | "node" | "express" | "hono" | "shopify-theme" | "shopify-hydrogen" | "wordpress" | "magento" | "woocommerce" | "unknown";
68
+ interface PlatformDetectionResult {
69
+ primary: FrameworkType;
70
+ detected: FrameworkType[];
71
+ }
122
72
  declare function analyzeProject(projectPath?: string): Promise<ProjectAnalysis>;
73
+ declare function detectAllPlatforms(projectPath: string): Promise<PlatformDetectionResult>;
123
74
  declare function generateAuditReport(projectPath?: string): Promise<AuditReport>;
124
75
  declare function formatAuditReport(report: AuditReport): string;
125
76
  declare function runAllSetups(projectPath?: string, onProgress?: (step: string, status: "start" | "done" | "error") => void): Promise<SetupResult[]>;
126
77
 
127
- export { type AppliedFix, type AuditReport, type CheckDefinition, type CheckResult, type CheckRunnerOptions, type ConfigChange, type ExistingConfigs, type ExistingScripts, type FrameworkType, type ProgressType, type ProjectAnalysis, QUALITY_CHECKS, type RunAllChecksResult, type SetupPlan, type SetupResult, analyzeProject, applyFix, formatAuditReport, generateAuditReport, getApplicableChecks, getAvailableScripts, hasUncommittedChanges, runAllChecks, runAllSetups, runCheck, stageAllChanges };
78
+ interface CheckDefinition {
79
+ name: string;
80
+ displayName: string;
81
+ command: string;
82
+ args: string[];
83
+ fixCommand?: string;
84
+ fixArgs?: string[];
85
+ canAutoFix: boolean;
86
+ requiredScript?: string;
87
+ fallbackCommand?: string[];
88
+ }
89
+ interface CheckResult {
90
+ check: CheckDefinition;
91
+ success: boolean;
92
+ output: string;
93
+ error?: string;
94
+ duration: number;
95
+ skipped?: boolean;
96
+ skipReason?: string;
97
+ }
98
+ interface AppliedFix {
99
+ checkName: string;
100
+ displayName: string;
101
+ command: string;
102
+ timestamp: Date;
103
+ }
104
+ interface RunAllChecksResult {
105
+ success: boolean;
106
+ results: CheckResult[];
107
+ totalAttempts: number;
108
+ fixesApplied: number;
109
+ appliedFixes: AppliedFix[];
110
+ pendingFixes?: Array<{
111
+ check: CheckDefinition;
112
+ command: string;
113
+ }>;
114
+ }
115
+ type ProgressType = "info" | "success" | "error" | "warning";
116
+ interface CheckRunnerOptions {
117
+ maxRetries?: number;
118
+ autoFix?: boolean;
119
+ dryRun?: boolean;
120
+ onProgress?: (message: string, type: ProgressType) => void;
121
+ includePlatformChecks?: boolean;
122
+ }
123
+ declare const QUALITY_CHECKS: CheckDefinition[];
124
+ type PlatformType = "shopify-theme" | "shopify-hydrogen" | "wordpress" | "magento" | "woocommerce";
125
+ interface PlatformCLIConfig {
126
+ cli: string;
127
+ install: string;
128
+ requiresComposer: boolean;
129
+ displayName: string;
130
+ }
131
+ interface PlatformCheckDefinition extends CheckDefinition {
132
+ platform: PlatformType;
133
+ }
134
+ declare const PLATFORM_CLI_INSTALL: Record<PlatformType, PlatformCLIConfig>;
135
+ declare const PLATFORM_CHECKS: PlatformCheckDefinition[];
136
+ declare function getAvailableScripts(cwd: string): Set<string>;
137
+ declare function getApplicableChecks(cwd: string): Promise<CheckDefinition[]>;
138
+ declare function ensureComposer(): Promise<void>;
139
+ declare function promptPlatformChoice(detected: FrameworkType[]): Promise<FrameworkType>;
140
+ declare function ensurePlatformCLI(platform: PlatformType): Promise<void>;
141
+ declare function getPlatformChecks(cwd: string): Promise<PlatformCheckDefinition[]>;
142
+ declare const SKIPPABLE_ERROR_PATTERNS: Array<{
143
+ pattern: RegExp;
144
+ reason: string;
145
+ }>;
146
+ declare function isSkippableError(output: string): string | undefined;
147
+ declare function runCheck(check: CheckDefinition, cwd: string): Promise<CheckResult>;
148
+ declare function applyFix(check: CheckDefinition, cwd: string): Promise<{
149
+ success: boolean;
150
+ output: string;
151
+ skipped?: boolean;
152
+ skipReason?: string;
153
+ }>;
154
+ declare function runAllChecks(cwd: string, options?: CheckRunnerOptions): Promise<RunAllChecksResult>;
155
+ declare function hasUncommittedChanges(cwd: string): Promise<boolean>;
156
+ declare function stageAllChanges(cwd: string): Promise<boolean>;
157
+
158
+ export { type AppliedFix, type AuditReport, type CheckDefinition, type CheckResult, type CheckRunnerOptions, type ConfigChange, type ExistingConfigs, type ExistingScripts, type FrameworkType, PLATFORM_CHECKS, PLATFORM_CLI_INSTALL, type PlatformCLIConfig, type PlatformCheckDefinition, type PlatformDetectionResult, type PlatformType, type ProgressType, type ProjectAnalysis, QUALITY_CHECKS, type RunAllChecksResult, SKIPPABLE_ERROR_PATTERNS, type SetupPlan, type SetupResult, analyzeProject, applyFix, detectAllPlatforms, ensureComposer, ensurePlatformCLI, formatAuditReport, generateAuditReport, getApplicableChecks, getAvailableScripts, getPlatformChecks, hasUncommittedChanges, isSkippableError, promptPlatformChoice, runAllChecks, runAllSetups, runCheck, stageAllChanges };
package/dist/index.js CHANGED
@@ -1,9 +1,3 @@
1
- import {
2
- analyzeProject,
3
- formatAuditReport,
4
- generateAuditReport,
5
- runAllSetups
6
- } from "./chunk-XGS2VFBP.js";
7
1
  import {
8
2
  applyReferenceFix,
9
3
  discoverCustomScopes,
@@ -15,31 +9,47 @@ import {
15
9
  validateCommitMessage,
16
10
  validateDocumentReferences,
17
11
  validatePRTitle
18
- } from "./chunk-ZLDJ2OGO.js";
12
+ } from "./chunk-WK7D2AVV.js";
19
13
  import {
20
14
  hasConfig,
21
15
  loadConfig,
22
16
  loadConfigSafe
23
- } from "./chunk-UWJ2ZGEI.js";
17
+ } from "./chunk-OH6TK27N.js";
24
18
  import {
25
19
  WorkflowConfigSchema,
26
20
  analyzeValidationError,
27
21
  applyAutoFixes,
28
22
  autoFixConfigFile,
29
23
  writeFixedConfig
30
- } from "./chunk-YELUGXOM.js";
24
+ } from "./chunk-NPJJZHJG.js";
31
25
  import {
26
+ PLATFORM_CHECKS,
27
+ PLATFORM_CLI_INSTALL,
32
28
  QUALITY_CHECKS,
29
+ SKIPPABLE_ERROR_PATTERNS,
30
+ analyzeProject,
33
31
  applyFix,
32
+ detectAllPlatforms,
33
+ ensureComposer,
34
+ ensurePlatformCLI,
35
+ formatAuditReport,
36
+ generateAuditReport,
34
37
  getApplicableChecks,
35
38
  getAvailableScripts,
39
+ getPlatformChecks,
36
40
  hasUncommittedChanges,
41
+ isSkippableError,
42
+ promptPlatformChoice,
37
43
  runAllChecks,
44
+ runAllSetups,
38
45
  runCheck,
39
46
  stageAllChanges
40
- } from "./chunk-3ADL5QDN.js";
47
+ } from "./chunk-MBRMT5ZG.js";
41
48
  export {
49
+ PLATFORM_CHECKS,
50
+ PLATFORM_CLI_INSTALL,
42
51
  QUALITY_CHECKS,
52
+ SKIPPABLE_ERROR_PATTERNS,
43
53
  WorkflowConfigSchema,
44
54
  analyzeProject,
45
55
  analyzeValidationError,
@@ -47,18 +57,24 @@ export {
47
57
  applyFix,
48
58
  applyReferenceFix,
49
59
  autoFixConfigFile,
60
+ detectAllPlatforms,
50
61
  discoverCustomScopes,
62
+ ensureComposer,
63
+ ensurePlatformCLI,
51
64
  findSimilarFiles,
52
65
  formatAuditReport,
53
66
  generateAuditReport,
54
67
  getAllScopes,
55
68
  getApplicableChecks,
56
69
  getAvailableScripts,
70
+ getPlatformChecks,
57
71
  hasConfig,
58
72
  hasUncommittedChanges,
59
73
  invalidateCustomScopesCache,
74
+ isSkippableError,
60
75
  loadConfig,
61
76
  loadConfigSafe,
77
+ promptPlatformChoice,
62
78
  runAllChecks,
63
79
  runAllSetups,
64
80
  runCheck,
@@ -7,7 +7,7 @@ import {
7
7
  generateCopilotInstructions,
8
8
  installMandatoryTemplates,
9
9
  validateAllScripts
10
- } from "../chunk-IWFUJ2DS.js";
10
+ } from "../chunk-DWHIY7R4.js";
11
11
 
12
12
  // src/scripts/postinstall.ts
13
13
  import { readFileSync, writeFileSync, existsSync } from "fs";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/scripts/postinstall.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * Post-install script that automatically adds the workflow script to package.json\n * when installed as a local dependency (not global).\n *\n * On package update, this will also remove deprecated scripts from older versions.\n */\n\nimport { readFileSync, writeFileSync, existsSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport {\n WORKFLOW_SCRIPTS,\n DEPRECATED_SCRIPTS,\n WORKFLOW_SCRIPTS_VERSION,\n validateAllScripts,\n} from \"./workflow-scripts.js\";\nimport { generateCopilotInstructions } from \"./copilot-instructions-generator.js\";\nimport {\n installMandatoryTemplates,\n findTemplatesDirectory,\n} from \"./template-installer.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Check if we're being installed globally\n */\nexport function isGlobalInstall(): boolean {\n const installPath = process.env.npm_config_global;\n return installPath === \"true\";\n}\n\n/**\n * Find the project root by navigating out of node_modules\n */\nexport function findProjectRoot(): string | null {\n const currentDir = process.cwd();\n\n // Check if we're inside node_modules\n if (currentDir.includes(\"node_modules\")) {\n const parts = currentDir.split(\"node_modules\");\n if (parts.length > 0 && parts[0]) {\n return parts[0].replace(/\\/$/, \"\");\n }\n }\n\n // If not in node_modules, we're probably in a monorepo workspace during development\n return null;\n}\n\n/**\n * Remove deprecated scripts from package.json\n */\nexport function removeDeprecatedScripts(\n scripts: Record<string, string>\n): string[] {\n const removedScripts: string[] = [];\n\n // Remove explicitly deprecated scripts\n for (const deprecatedScript of DEPRECATED_SCRIPTS) {\n if (scripts[deprecatedScript] !== undefined) {\n delete scripts[deprecatedScript];\n removedScripts.push(deprecatedScript);\n }\n }\n\n // Also remove any remaining workflow:* or workflow-* scripts (catch-all)\n const oldScripts = validateAllScripts(scripts);\n for (const oldScript of oldScripts) {\n if (scripts[oldScript] !== undefined) {\n delete scripts[oldScript];\n if (!removedScripts.includes(oldScript)) {\n removedScripts.push(oldScript);\n }\n }\n }\n\n return removedScripts;\n}\n\n/**\n * Add the workflow script to package.json\n */\nexport function addWorkflowScript(\n scripts: Record<string, string>\n): { added: boolean; updated: boolean } {\n const scriptName = \"workflow\";\n const scriptCommand = WORKFLOW_SCRIPTS.workflow;\n\n if (!scripts[scriptName]) {\n scripts[scriptName] = scriptCommand;\n return { added: true, updated: false };\n } else if (scripts[scriptName] !== scriptCommand) {\n scripts[scriptName] = scriptCommand;\n return { added: false, updated: true };\n }\n\n return { added: false, updated: false };\n}\n\n/**\n * Main function to configure workflow scripts in package.json\n */\nexport function addScriptsToPackageJson(): void {\n try {\n // Don't run for global installs\n if (isGlobalInstall()) {\n return;\n }\n\n const projectRoot = findProjectRoot();\n if (!projectRoot) {\n return;\n }\n\n const packageJsonPath = join(projectRoot, \"package.json\");\n\n if (!existsSync(packageJsonPath)) {\n return;\n }\n\n // Read existing package.json\n const packageJsonContent = readFileSync(packageJsonPath, \"utf-8\");\n const packageJson = JSON.parse(packageJsonContent);\n\n // Initialize scripts object if it doesn't exist\n if (!packageJson.scripts) {\n packageJson.scripts = {};\n }\n\n // Step 1: Remove deprecated scripts\n const removedScripts = removeDeprecatedScripts(packageJson.scripts);\n\n // Step 2: Add the workflow script\n const { added, updated } = addWorkflowScript(packageJson.scripts);\n\n const hasChanges = removedScripts.length > 0 || added || updated;\n\n if (hasChanges) {\n // Write back to package.json with proper formatting\n writeFileSync(\n packageJsonPath,\n JSON.stringify(packageJson, null, 2) + \"\\n\",\n \"utf-8\"\n );\n\n console.log(`\\n✓ Workflow Agent v${WORKFLOW_SCRIPTS_VERSION} configured`);\n\n if (added) {\n console.log(`\\n Added \"workflow\" script to package.json`);\n } else if (updated) {\n console.log(`\\n Updated \"workflow\" script in package.json`);\n }\n\n // Log removed deprecated scripts\n if (removedScripts.length > 0) {\n console.log(\n `\\n ⚠️ Removed ${removedScripts.length} deprecated scripts`\n );\n console.log(\n ` (Old workflow:* scripts replaced by single \"workflow\" command)`\n );\n }\n\n console.log(`\\n Usage:`);\n console.log(` npm run workflow -- init`);\n console.log(` npm run workflow -- solution list`);\n console.log(` npm run workflow -- --help`);\n console.log(`\\n Or with pnpm:`);\n console.log(` pnpm workflow init`);\n console.log(` pnpm workflow solution list`);\n console.log(` pnpm workflow --help`);\n console.log(`\\n Or if installed globally:`);\n console.log(` workflow-agent init`);\n console.log(` workflow-agent --help\\n`);\n }\n\n // Install mandatory templates if guidelines directory doesn't exist\n const guidelinesDir = join(projectRoot, \"guidelines\");\n if (!existsSync(guidelinesDir)) {\n const templatesDir = findTemplatesDirectory(__dirname);\n if (templatesDir) {\n const templateResult = installMandatoryTemplates(\n projectRoot,\n templatesDir,\n { silent: false, skipIfExists: true, mandatoryOnly: true }\n );\n if (templateResult.installed.length > 0) {\n console.log(\n `✓ Installed ${templateResult.installed.length} mandatory guideline templates`\n );\n }\n }\n }\n\n // Generate .github/copilot-instructions.md if guidelines exist\n if (existsSync(guidelinesDir)) {\n const result = generateCopilotInstructions(projectRoot, { silent: true });\n if (result.success) {\n const status = result.isNew ? \"Generated\" : \"Updated\";\n console.log(\n `✓ ${status} .github/copilot-instructions.md from ${result.guidelinesCount} guidelines`\n );\n if (result.preservedCustomContent) {\n console.log(\" (Custom content preserved)\");\n }\n }\n }\n } catch (error) {\n // Silently fail - this is a nice-to-have feature\n // We don't want to break the installation if something goes wrong\n }\n}\n\n// Run the script\naddScriptsToPackageJson();\n"],"mappings":";;;;;;;;;;;;AASA,SAAS,cAAc,eAAe,kBAAkB;AACxD,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAa9B,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,QAAQ,UAAU;AAK7B,SAAS,kBAA2B;AACzC,QAAM,cAAc,QAAQ,IAAI;AAChC,SAAO,gBAAgB;AACzB;AAKO,SAAS,kBAAiC;AAC/C,QAAM,aAAa,QAAQ,IAAI;AAG/B,MAAI,WAAW,SAAS,cAAc,GAAG;AACvC,UAAM,QAAQ,WAAW,MAAM,cAAc;AAC7C,QAAI,MAAM,SAAS,KAAK,MAAM,CAAC,GAAG;AAChC,aAAO,MAAM,CAAC,EAAE,QAAQ,OAAO,EAAE;AAAA,IACnC;AAAA,EACF;AAGA,SAAO;AACT;AAKO,SAAS,wBACd,SACU;AACV,QAAM,iBAA2B,CAAC;AAGlC,aAAW,oBAAoB,oBAAoB;AACjD,QAAI,QAAQ,gBAAgB,MAAM,QAAW;AAC3C,aAAO,QAAQ,gBAAgB;AAC/B,qBAAe,KAAK,gBAAgB;AAAA,IACtC;AAAA,EACF;AAGA,QAAM,aAAa,mBAAmB,OAAO;AAC7C,aAAW,aAAa,YAAY;AAClC,QAAI,QAAQ,SAAS,MAAM,QAAW;AACpC,aAAO,QAAQ,SAAS;AACxB,UAAI,CAAC,eAAe,SAAS,SAAS,GAAG;AACvC,uBAAe,KAAK,SAAS;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stall.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * Post-install script that automatically adds the workflow script to package.json\n * when installed as a local dependency (not global).\n *\n * On package update, this will also remove deprecated scripts from older versions.\n */\n\nimport { readFileSync, writeFileSync, existsSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport {\n WORKFLOW_SCRIPTS,\n DEPRECATED_SCRIPTS,\n WORKFLOW_SCRIPTS_VERSION,\n validateAllScripts,\n} from \"./workflow-scripts.js\";\nimport { generateCopilotInstructions } from \"./copilot-instructions-generator.js\";\nimport {\n installMandatoryTemplates,\n findTemplatesDirectory,\n} from \"./template-installer.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Check if we're being installed globally\n */\nexport function isGlobalInstall(): boolean {\n const installPath = process.env.npm_config_global;\n return installPath === \"true\";\n}\n\n/**\n * Find the project root by navigating out of node_modules\n */\nexport function findProjectRoot(): string | null {\n const currentDir = process.cwd();\n\n // Check if we're inside node_modules\n if (currentDir.includes(\"node_modules\")) {\n const parts = currentDir.split(\"node_modules\");\n if (parts.length > 0 && parts[0]) {\n return parts[0].replace(/\\/$/, \"\");\n }\n }\n\n // If not in node_modules, we're probably in a monorepo workspace during development\n return null;\n}\n\n/**\n * Remove deprecated scripts from package.json\n */\nexport function removeDeprecatedScripts(\n scripts: Record<string, string>,\n): string[] {\n const removedScripts: string[] = [];\n\n // Remove explicitly deprecated scripts\n for (const deprecatedScript of DEPRECATED_SCRIPTS) {\n if (scripts[deprecatedScript] !== undefined) {\n delete scripts[deprecatedScript];\n removedScripts.push(deprecatedScript);\n }\n }\n\n // Also remove any remaining workflow:* or workflow-* scripts (catch-all)\n const oldScripts = validateAllScripts(scripts);\n for (const oldScript of oldScripts) {\n if (scripts[oldScript] !== undefined) {\n delete scripts[oldScript];\n if (!removedScripts.includes(oldScript)) {\n removedScripts.push(oldScript);\n }\n }\n }\n\n return removedScripts;\n}\n\n/**\n * Add the workflow script to package.json\n */\nexport function addWorkflowScript(scripts: Record<string, string>): {\n added: boolean;\n updated: boolean;\n} {\n const scriptName = \"workflow\";\n const scriptCommand = WORKFLOW_SCRIPTS.workflow;\n\n if (!scripts[scriptName]) {\n scripts[scriptName] = scriptCommand;\n return { added: true, updated: false };\n } else if (scripts[scriptName] !== scriptCommand) {\n scripts[scriptName] = scriptCommand;\n return { added: false, updated: true };\n }\n\n return { added: false, updated: false };\n}\n\n/**\n * Main function to configure workflow scripts in package.json\n */\nexport function addScriptsToPackageJson(): void {\n try {\n // Don't run for global installs\n if (isGlobalInstall()) {\n return;\n }\n\n const projectRoot = findProjectRoot();\n if (!projectRoot) {\n return;\n }\n\n const packageJsonPath = join(projectRoot, \"package.json\");\n\n if (!existsSync(packageJsonPath)) {\n return;\n }\n\n // Read existing package.json\n const packageJsonContent = readFileSync(packageJsonPath, \"utf-8\");\n const packageJson = JSON.parse(packageJsonContent);\n\n // Initialize scripts object if it doesn't exist\n if (!packageJson.scripts) {\n packageJson.scripts = {};\n }\n\n // Step 1: Remove deprecated scripts\n const removedScripts = removeDeprecatedScripts(packageJson.scripts);\n\n // Step 2: Add the workflow script\n const { added, updated } = addWorkflowScript(packageJson.scripts);\n\n const hasChanges = removedScripts.length > 0 || added || updated;\n\n if (hasChanges) {\n // Write back to package.json with proper formatting\n writeFileSync(\n packageJsonPath,\n JSON.stringify(packageJson, null, 2) + \"\\n\",\n \"utf-8\",\n );\n\n console.log(`\\n✓ Workflow Agent v${WORKFLOW_SCRIPTS_VERSION} configured`);\n\n if (added) {\n console.log(`\\n Added \"workflow\" script to package.json`);\n } else if (updated) {\n console.log(`\\n Updated \"workflow\" script in package.json`);\n }\n\n // Log removed deprecated scripts\n if (removedScripts.length > 0) {\n console.log(\n `\\n ⚠️ Removed ${removedScripts.length} deprecated scripts`,\n );\n console.log(\n ` (Old workflow:* scripts replaced by single \"workflow\" command)`,\n );\n }\n\n console.log(`\\n Usage:`);\n console.log(` npm run workflow -- init`);\n console.log(` npm run workflow -- solution list`);\n console.log(` npm run workflow -- --help`);\n console.log(`\\n Or with pnpm:`);\n console.log(` pnpm workflow init`);\n console.log(` pnpm workflow solution list`);\n console.log(` pnpm workflow --help`);\n console.log(`\\n Or if installed globally:`);\n console.log(` workflow-agent init`);\n console.log(` workflow-agent --help\\n`);\n }\n\n // Install mandatory templates if guidelines directory doesn't exist\n const guidelinesDir = join(projectRoot, \"guidelines\");\n if (!existsSync(guidelinesDir)) {\n const templatesDir = findTemplatesDirectory(__dirname);\n if (templatesDir) {\n const templateResult = installMandatoryTemplates(\n projectRoot,\n templatesDir,\n { silent: false, skipIfExists: true, mandatoryOnly: true },\n );\n if (templateResult.installed.length > 0) {\n console.log(\n `✓ Installed ${templateResult.installed.length} mandatory guideline templates`,\n );\n }\n }\n }\n\n // Generate .github/copilot-instructions.md if guidelines exist\n if (existsSync(guidelinesDir)) {\n const result = generateCopilotInstructions(projectRoot, { silent: true });\n if (result.success) {\n const status = result.isNew ? \"Generated\" : \"Updated\";\n console.log(\n `✓ ${status} .github/copilot-instructions.md from ${result.guidelinesCount} guidelines`,\n );\n if (result.preservedCustomContent) {\n console.log(\" (Custom content preserved)\");\n }\n }\n }\n } catch (error) {\n // Silently fail - this is a nice-to-have feature\n // We don't want to break the installation if something goes wrong\n }\n}\n\n// Run the script\naddScriptsToPackageJson();\n"],"mappings":";;;;;;;;;;;;AASA,SAAS,cAAc,eAAe,kBAAkB;AACxD,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAa9B,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,QAAQ,UAAU;AAK7B,SAAS,kBAA2B;AACzC,QAAM,cAAc,QAAQ,IAAI;AAChC,SAAO,gBAAgB;AACzB;AAKO,SAAS,kBAAiC;AAC/C,QAAM,aAAa,QAAQ,IAAI;AAG/B,MAAI,WAAW,SAAS,cAAc,GAAG;AACvC,UAAM,QAAQ,WAAW,MAAM,cAAc;AAC7C,QAAI,MAA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AS,GAAG;AACvC,kBAAQ;AAAA,YACN,oBAAe,eAAe,UAAU,MAAM;AAAA,UAChD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAGA,QAAI,WAAW,aAAa,GAAG;AAC7B,YAAM,SAAS,4BAA4B,aAAa,EAAE,QAAQ,KAAK,CAAC;AACxE,UAAI,OAAO,SAAS;AAClB,cAAM,SAAS,OAAO,QAAQ,cAAc;AAC5C,gBAAQ;AAAA,UACN,UAAK,MAAM,yCAAyC,OAAO,eAAe;AAAA,QAC5E;AACA,YAAI,OAAO,wBAAwB;AACjC,kBAAQ,IAAI,8BAA8B;AAAA,QAC5C;AAAA,MACF;AAAA,IACF;AAAA,EACF,SAAS,OAAO;AAAA,EAGhB;AACF;AAGA,wBAAwB;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ syncCommand
3
+ } from "./chunk-K42R54II.js";
4
+ export {
5
+ syncCommand
6
+ };
7
+ //# sourceMappingURL=sync-HHQM3GKR.js.map
@@ -9,7 +9,7 @@ import {
9
9
  validateCommitMessage,
10
10
  validateDocumentReferences,
11
11
  validatePRTitle
12
- } from "../chunk-ZLDJ2OGO.js";
12
+ } from "../chunk-WK7D2AVV.js";
13
13
  export {
14
14
  applyReferenceFix,
15
15
  discoverCustomScopes,
@@ -0,0 +1,8 @@
1
+ import {
2
+ verifyCommand
3
+ } from "./chunk-EHRI6BI6.js";
4
+ import "./chunk-MBRMT5ZG.js";
5
+ export {
6
+ verifyCommand
7
+ };
8
+ //# sourceMappingURL=verify-PA7R6FBJ.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workflow-agent-cli",
3
- "version": "2.23.0",
3
+ "version": "2.23.2",
4
4
  "description": "A self-evolving workflow management system for AI agent development",
5
5
  "keywords": [
6
6
  "workflow",
@@ -52,7 +52,7 @@
52
52
  "mustache": "^4.2.0",
53
53
  "picocolors": "^1.0.0",
54
54
  "zod": "^3.22.4",
55
- "@hawkinside_out/workflow-improvement-tracker": "^1.4.0"
55
+ "@hawkinside_out/workflow-improvement-tracker": "^1.4.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/mustache": "^4.2.5",