@eldrforge/kodrdriv 1.2.124 → 1.2.125

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.
@@ -520,10 +520,11 @@ const executePackage = async (packageName, packageInfo, commandToRun, runConfig,
520
520
  logFilePath = path__default.join(packageDir, outputDir, `${commandName}_${timestamp}.log`);
521
521
  }
522
522
  // Determine output level based on flags
523
- // For publish commands, default to full output to show OpenAI progress and other details
523
+ // For publish and commit commands, default to full output to show AI progress and other details
524
524
  // For other commands, require --verbose or --debug for output
525
525
  const isPublishCommand = isBuiltInCommand && commandToRun.includes('publish');
526
- let showOutput = isPublishCommand ? 'full' : 'none';
526
+ const isCommitCommand = isBuiltInCommand && commandToRun.includes('commit');
527
+ let showOutput = isPublishCommand || isCommitCommand ? 'full' : 'none';
527
528
  if (runConfig.debug) {
528
529
  showOutput = 'full';
529
530
  } else if (runConfig.verbose) {
@@ -531,8 +532,12 @@ const executePackage = async (packageName, packageInfo, commandToRun, runConfig,
531
532
  }
532
533
  // Show package start info - always visible for progress tracking
533
534
  if (runConfig.debug) {
534
- packageLogger.debug(`Starting execution in ${packageDir}`);
535
- packageLogger.debug(`Command: ${commandToRun}`);
535
+ packageLogger.debug('MULTI_PROJECT_START: Starting package execution | Package: %s | Index: %d/%d | Path: %s | Command: %s | Context: tree execution', packageName, index + 1, total, packageDir, commandToRun);
536
+ packageLogger.debug('MULTI_PROJECT_CONTEXT: Execution details | Directory: %s | Built-in Command: %s | Dry Run: %s | Output Level: %s', packageDir, isBuiltInCommand, isDryRun, showOutput);
537
+ // Show dependencies if available
538
+ if (packageInfo.dependencies && Array.isArray(packageInfo.dependencies) && packageInfo.dependencies.length > 0) {
539
+ packageLogger.debug('MULTI_PROJECT_DEPS: Package dependencies | Package: %s | Dependencies: [%s]', packageName, packageInfo.dependencies.join(', '));
540
+ }
536
541
  } else if (runConfig.verbose) {
537
542
  packageLogger.verbose(`Starting execution in ${packageDir}`);
538
543
  } else {
@@ -791,16 +796,16 @@ const executePackage = async (packageName, packageInfo, commandToRun, runConfig,
791
796
  const seconds = (executionDuration / 1000).toFixed(1);
792
797
  if (runConfig.debug || runConfig.verbose) {
793
798
  packageLogger.info(`⏱️ Execution time: ${seconds}s`);
794
- } else if (!isPublishCommand) {
795
- // Show timing in completion message (publish commands have their own completion message)
799
+ } else if (!isPublishCommand && !isCommitCommand) {
800
+ // Show timing in completion message (publish/commit commands have their own completion message)
796
801
  logger.info(`[${index + 1}/${total}] ${packageName}: ✅ Completed (${seconds}s)`);
797
802
  }
798
803
  } else {
799
804
  executionTimer.end(`Package ${packageName} execution`);
800
805
  if (runConfig.debug || runConfig.verbose) {
801
806
  packageLogger.info(`Command completed successfully`);
802
- } else if (!isPublishCommand) {
803
- // Basic completion info (publish commands have their own completion message)
807
+ } else if (!isPublishCommand && !isCommitCommand) {
808
+ // Basic completion info (publish/commit commands have their own completion message)
804
809
  logger.info(`[${index + 1}/${total}] ${packageName}: ✅ Completed`);
805
810
  }
806
811
  }
@@ -822,15 +827,15 @@ const executePackage = async (packageName, packageInfo, commandToRun, runConfig,
822
827
  }
823
828
  }
824
829
  }
825
- // Show completion status (for publish commands, this supplements the timing message above)
830
+ // Show completion status (for publish/commit commands, this supplements the timing message above)
826
831
  if (runConfig.debug || runConfig.verbose) {
827
832
  if (publishWasSkipped) {
828
833
  packageLogger.info(`⊘ Skipped (no code changes)`);
829
834
  } else {
830
835
  packageLogger.info(`✅ Completed successfully`);
831
836
  }
832
- } else if (isPublishCommand) {
833
- // For publish commands, always show completion even without verbose
837
+ } else if (isPublishCommand || isCommitCommand) {
838
+ // For publish/commit commands, always show completion even without verbose
834
839
  // Include timing if available
835
840
  const timeStr = executionDuration !== undefined ? ` (${(executionDuration / 1000).toFixed(1)}s)` : '';
836
841
  if (publishWasSkipped) {
@@ -1930,9 +1935,72 @@ const execute = async (runConfig)=>{
1930
1935
  const packageArgString = packageArg && (builtInCommand === 'link' || builtInCommand === 'unlink' || builtInCommand === 'updates') ? ` "${packageArg}"` : '';
1931
1936
  // Add command-specific options
1932
1937
  let commandSpecificOptions = '';
1938
+ // Commit command options
1939
+ if (builtInCommand === 'commit') {
1940
+ var _runConfig_commit, _runConfig_commit1, _runConfig_commit2, _runConfig_commit3, _runConfig_commit4, _runConfig_commit5, _runConfig_commit6, _runConfig_commit7, _runConfig_commit8, _runConfig_commit9, _runConfig_commit10, _runConfig_commit11, _runConfig_commit12, _runConfig_commit13, _runConfig_commit14, _runConfig_commit15, _runConfig_commit16;
1941
+ if ((_runConfig_commit = runConfig.commit) === null || _runConfig_commit === void 0 ? void 0 : _runConfig_commit.agentic) {
1942
+ commandSpecificOptions += ' --agentic';
1943
+ }
1944
+ if ((_runConfig_commit1 = runConfig.commit) === null || _runConfig_commit1 === void 0 ? void 0 : _runConfig_commit1.selfReflection) {
1945
+ commandSpecificOptions += ' --self-reflection';
1946
+ }
1947
+ if ((_runConfig_commit2 = runConfig.commit) === null || _runConfig_commit2 === void 0 ? void 0 : _runConfig_commit2.add) {
1948
+ commandSpecificOptions += ' --add';
1949
+ }
1950
+ if ((_runConfig_commit3 = runConfig.commit) === null || _runConfig_commit3 === void 0 ? void 0 : _runConfig_commit3.cached) {
1951
+ commandSpecificOptions += ' --cached';
1952
+ }
1953
+ if ((_runConfig_commit4 = runConfig.commit) === null || _runConfig_commit4 === void 0 ? void 0 : _runConfig_commit4.interactive) {
1954
+ commandSpecificOptions += ' --interactive';
1955
+ }
1956
+ if ((_runConfig_commit5 = runConfig.commit) === null || _runConfig_commit5 === void 0 ? void 0 : _runConfig_commit5.amend) {
1957
+ commandSpecificOptions += ' --amend';
1958
+ }
1959
+ if ((_runConfig_commit6 = runConfig.commit) === null || _runConfig_commit6 === void 0 ? void 0 : _runConfig_commit6.skipFileCheck) {
1960
+ commandSpecificOptions += ' --skip-file-check';
1961
+ }
1962
+ if ((_runConfig_commit7 = runConfig.commit) === null || _runConfig_commit7 === void 0 ? void 0 : _runConfig_commit7.maxAgenticIterations) {
1963
+ commandSpecificOptions += ` --max-agentic-iterations ${runConfig.commit.maxAgenticIterations}`;
1964
+ }
1965
+ if ((_runConfig_commit8 = runConfig.commit) === null || _runConfig_commit8 === void 0 ? void 0 : _runConfig_commit8.allowCommitSplitting) {
1966
+ commandSpecificOptions += ' --allow-commit-splitting';
1967
+ }
1968
+ if ((_runConfig_commit9 = runConfig.commit) === null || _runConfig_commit9 === void 0 ? void 0 : _runConfig_commit9.messageLimit) {
1969
+ commandSpecificOptions += ` --message-limit ${runConfig.commit.messageLimit}`;
1970
+ }
1971
+ if ((_runConfig_commit10 = runConfig.commit) === null || _runConfig_commit10 === void 0 ? void 0 : _runConfig_commit10.maxDiffBytes) {
1972
+ commandSpecificOptions += ` --max-diff-bytes ${runConfig.commit.maxDiffBytes}`;
1973
+ }
1974
+ if ((_runConfig_commit11 = runConfig.commit) === null || _runConfig_commit11 === void 0 ? void 0 : _runConfig_commit11.direction) {
1975
+ commandSpecificOptions += ` --direction "${runConfig.commit.direction}"`;
1976
+ }
1977
+ if ((_runConfig_commit12 = runConfig.commit) === null || _runConfig_commit12 === void 0 ? void 0 : _runConfig_commit12.context) {
1978
+ commandSpecificOptions += ` --context "${runConfig.commit.context}"`;
1979
+ }
1980
+ // Push option can be boolean or string (remote name)
1981
+ if ((_runConfig_commit13 = runConfig.commit) === null || _runConfig_commit13 === void 0 ? void 0 : _runConfig_commit13.push) {
1982
+ if (typeof runConfig.commit.push === 'string') {
1983
+ commandSpecificOptions += ` --push "${runConfig.commit.push}"`;
1984
+ } else {
1985
+ commandSpecificOptions += ' --push';
1986
+ }
1987
+ }
1988
+ // Model-specific options for commit
1989
+ if ((_runConfig_commit14 = runConfig.commit) === null || _runConfig_commit14 === void 0 ? void 0 : _runConfig_commit14.model) {
1990
+ commandSpecificOptions += ` --model "${runConfig.commit.model}"`;
1991
+ }
1992
+ if ((_runConfig_commit15 = runConfig.commit) === null || _runConfig_commit15 === void 0 ? void 0 : _runConfig_commit15.openaiReasoning) {
1993
+ commandSpecificOptions += ` --openai-reasoning ${runConfig.commit.openaiReasoning}`;
1994
+ }
1995
+ if ((_runConfig_commit16 = runConfig.commit) === null || _runConfig_commit16 === void 0 ? void 0 : _runConfig_commit16.openaiMaxOutputTokens) {
1996
+ commandSpecificOptions += ` --openai-max-output-tokens ${runConfig.commit.openaiMaxOutputTokens}`;
1997
+ }
1998
+ }
1999
+ // Unlink command options
1933
2000
  if (builtInCommand === 'unlink' && ((_runConfig_tree31 = runConfig.tree) === null || _runConfig_tree31 === void 0 ? void 0 : _runConfig_tree31.cleanNodeModules)) {
1934
2001
  commandSpecificOptions += ' --clean-node-modules';
1935
2002
  }
2003
+ // Link/Unlink externals
1936
2004
  if ((builtInCommand === 'link' || builtInCommand === 'unlink') && ((_runConfig_tree32 = runConfig.tree) === null || _runConfig_tree32 === void 0 ? void 0 : _runConfig_tree32.externals) && runConfig.tree.externals.length > 0) {
1937
2005
  commandSpecificOptions += ` --externals ${runConfig.tree.externals.join(' ')}`;
1938
2006
  }
@@ -2005,6 +2073,55 @@ const execute = async (runConfig)=>{
2005
2073
  logger.info('');
2006
2074
  const executionDescription = isBuiltInCommand ? `built-in command "${builtInCommand}"` : `"${commandToRun}"`;
2007
2075
  logger.info(`${isDryRun ? 'DRY RUN: ' : ''}Executing ${executionDescription} in ${buildOrder.length} packages...`);
2076
+ // Add detailed multi-project execution context for debug mode
2077
+ if (runConfig.debug) {
2078
+ var _runConfig_tree35, _runConfig_tree36;
2079
+ logger.debug('MULTI_PROJECT_PLAN: Execution plan initialized | Total Packages: %d | Command: %s | Built-in: %s | Dry Run: %s | Parallel: %s', buildOrder.length, commandToRun, isBuiltInCommand, isDryRun, ((_runConfig_tree35 = runConfig.tree) === null || _runConfig_tree35 === void 0 ? void 0 : _runConfig_tree35.parallel) || false);
2080
+ // Log package execution order with dependencies
2081
+ logger.debug('MULTI_PROJECT_ORDER: Package execution sequence:');
2082
+ buildOrder.forEach((pkgName, idx)=>{
2083
+ const pkgInfo = dependencyGraph.packages.get(pkgName);
2084
+ if (pkgInfo) {
2085
+ const deps = Array.isArray(pkgInfo.dependencies) ? pkgInfo.dependencies : [];
2086
+ const depStr = deps.length > 0 ? ` | Dependencies: [${deps.join(', ')}]` : ' | Dependencies: none';
2087
+ logger.debug(' %d. %s%s', idx + 1, pkgName, depStr);
2088
+ }
2089
+ });
2090
+ // Log dependency levels for parallel execution understanding
2091
+ const levels = new Map();
2092
+ const calculateLevels = (pkg, visited = new Set())=>{
2093
+ if (levels.has(pkg)) return levels.get(pkg);
2094
+ if (visited.has(pkg)) return 0; // Circular dependency
2095
+ visited.add(pkg);
2096
+ const pkgInfo = dependencyGraph.packages.get(pkg);
2097
+ const deps = Array.isArray(pkgInfo === null || pkgInfo === void 0 ? void 0 : pkgInfo.dependencies) ? pkgInfo.dependencies : [];
2098
+ if (!pkgInfo || deps.length === 0) {
2099
+ levels.set(pkg, 0);
2100
+ return 0;
2101
+ }
2102
+ const maxDepLevel = Math.max(...deps.map((dep)=>calculateLevels(dep, new Set(visited))));
2103
+ const level = maxDepLevel + 1;
2104
+ levels.set(pkg, level);
2105
+ return level;
2106
+ };
2107
+ buildOrder.forEach((pkg)=>calculateLevels(pkg));
2108
+ const maxLevel = Math.max(...Array.from(levels.values()));
2109
+ logger.debug('MULTI_PROJECT_LEVELS: Dependency depth analysis | Max Depth: %d levels', maxLevel + 1);
2110
+ for(let level = 0; level <= maxLevel; level++){
2111
+ const packagesAtLevel = buildOrder.filter((pkg)=>levels.get(pkg) === level);
2112
+ logger.debug(' Level %d (%d packages): %s', level, packagesAtLevel.length, packagesAtLevel.join(', '));
2113
+ }
2114
+ if ((_runConfig_tree36 = runConfig.tree) === null || _runConfig_tree36 === void 0 ? void 0 : _runConfig_tree36.parallel) {
2115
+ var _runConfig_tree_retry1;
2116
+ const os = await import('os');
2117
+ const concurrency = runConfig.tree.maxConcurrency || os.cpus().length;
2118
+ logger.debug('MULTI_PROJECT_PARALLEL: Parallel execution configuration | Max Concurrency: %d | Retry Attempts: %d', concurrency, ((_runConfig_tree_retry1 = runConfig.tree.retry) === null || _runConfig_tree_retry1 === void 0 ? void 0 : _runConfig_tree_retry1.maxAttempts) || 3);
2119
+ }
2120
+ if (isContinue) {
2121
+ const completed = (executionContext === null || executionContext === void 0 ? void 0 : executionContext.completedPackages.length) || 0;
2122
+ logger.debug('MULTI_PROJECT_RESUME: Continuing previous execution | Completed: %d | Remaining: %d', completed, buildOrder.length - completed);
2123
+ }
2124
+ }
2008
2125
  // Show info for publish commands
2009
2126
  if (isBuiltInCommand && builtInCommand === 'publish') {
2010
2127
  logger.info('Inter-project dependencies will be automatically updated before each publish.');
@@ -2015,7 +2132,7 @@ const execute = async (runConfig)=>{
2015
2132
  const startIndex = isContinue && executionContext ? executionContext.completedPackages.length : 0;
2016
2133
  // Check if parallel execution is enabled
2017
2134
  if ((_runConfig_tree34 = runConfig.tree) === null || _runConfig_tree34 === void 0 ? void 0 : _runConfig_tree34.parallel) {
2018
- var _runConfig_tree_retry1, _runConfig_tree_retry2, _runConfig_tree_retry3, _runConfig_tree_retry4;
2135
+ var _runConfig_tree_retry2, _runConfig_tree_retry3, _runConfig_tree_retry4, _runConfig_tree_retry5;
2019
2136
  logger.info('🚀 Using parallel execution mode');
2020
2137
  // If dry run, show preview instead of executing
2021
2138
  if (isDryRun) {
@@ -2033,10 +2150,10 @@ const execute = async (runConfig)=>{
2033
2150
  config: runConfig,
2034
2151
  checkpointPath: runConfig.outputDirectory,
2035
2152
  continue: isContinue,
2036
- maxRetries: ((_runConfig_tree_retry1 = runConfig.tree.retry) === null || _runConfig_tree_retry1 === void 0 ? void 0 : _runConfig_tree_retry1.maxAttempts) || 3,
2037
- initialRetryDelay: ((_runConfig_tree_retry2 = runConfig.tree.retry) === null || _runConfig_tree_retry2 === void 0 ? void 0 : _runConfig_tree_retry2.initialDelayMs) || 5000,
2038
- maxRetryDelay: ((_runConfig_tree_retry3 = runConfig.tree.retry) === null || _runConfig_tree_retry3 === void 0 ? void 0 : _runConfig_tree_retry3.maxDelayMs) || 60000,
2039
- backoffMultiplier: ((_runConfig_tree_retry4 = runConfig.tree.retry) === null || _runConfig_tree_retry4 === void 0 ? void 0 : _runConfig_tree_retry4.backoffMultiplier) || 2
2153
+ maxRetries: ((_runConfig_tree_retry2 = runConfig.tree.retry) === null || _runConfig_tree_retry2 === void 0 ? void 0 : _runConfig_tree_retry2.maxAttempts) || 3,
2154
+ initialRetryDelay: ((_runConfig_tree_retry3 = runConfig.tree.retry) === null || _runConfig_tree_retry3 === void 0 ? void 0 : _runConfig_tree_retry3.initialDelayMs) || 5000,
2155
+ maxRetryDelay: ((_runConfig_tree_retry4 = runConfig.tree.retry) === null || _runConfig_tree_retry4 === void 0 ? void 0 : _runConfig_tree_retry4.maxDelayMs) || 60000,
2156
+ backoffMultiplier: ((_runConfig_tree_retry5 = runConfig.tree.retry) === null || _runConfig_tree_retry5 === void 0 ? void 0 : _runConfig_tree_retry5.backoffMultiplier) || 2
2040
2157
  }, executePackage);
2041
2158
  // Set up progress logging
2042
2159
  createParallelProgressLogger(adapter.getPool(), runConfig);