@eldrforge/kodrdriv 1.2.132 ā 1.2.134
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/AI-GUIDE.md +837 -0
- package/LICENSE +1 -1
- package/README.md +35 -6
- package/dist/application.js +2 -0
- package/dist/application.js.map +1 -1
- package/dist/arguments.js +54 -21
- package/dist/arguments.js.map +1 -1
- package/dist/commands/audio-commit.js +2 -1
- package/dist/commands/audio-commit.js.map +1 -1
- package/dist/commands/audio-review.js +4 -2
- package/dist/commands/audio-review.js.map +1 -1
- package/dist/commands/commit.js +91 -133
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/publish.js +3 -6
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/release.js +62 -139
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/review.js +1 -1
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/tree.js +29 -33
- package/dist/commands/tree.js.map +1 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/types.js +282 -0
- package/dist/types.js.map +1 -0
- package/dist/util/storageAdapter.js +9 -2
- package/dist/util/storageAdapter.js.map +1 -1
- package/guide/ai-system.md +522 -0
- package/guide/architecture.md +349 -0
- package/guide/commands.md +383 -0
- package/guide/configuration.md +516 -0
- package/guide/debugging.md +587 -0
- package/guide/development.md +632 -0
- package/guide/index.md +215 -0
- package/guide/integration.md +510 -0
- package/guide/monorepo.md +533 -0
- package/guide/quickstart.md +226 -0
- package/guide/testing.md +463 -0
- package/guide/tree-operations.md +621 -0
- package/guide/usage.md +578 -0
- package/package.json +10 -10
- package/DUPLICATION-CLEANUP.md +0 -104
- package/agentic-reflection-commit-2025-12-27T22-56-06-143Z.md +0 -50
- package/agentic-reflection-commit-2025-12-27T23-01-57-294Z.md +0 -50
- package/agentic-reflection-commit-2025-12-27T23-11-57-811Z.md +0 -50
- package/agentic-reflection-commit-2025-12-27T23-12-50-645Z.md +0 -50
- package/agentic-reflection-commit-2025-12-27T23-13-59-347Z.md +0 -52
- package/agentic-reflection-commit-2025-12-27T23-14-36-001Z.md +0 -50
- package/agentic-reflection-commit-2025-12-27T23-18-59-832Z.md +0 -50
- package/agentic-reflection-commit-2025-12-27T23-25-20-667Z.md +0 -62
package/dist/commands/commit.js
CHANGED
|
@@ -3,22 +3,40 @@ import { Formatter } from '@riotprompt/riotprompt';
|
|
|
3
3
|
import 'dotenv/config';
|
|
4
4
|
import shellescape from 'shell-escape';
|
|
5
5
|
import { DEFAULT_MAX_DIFF_BYTES, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_OUTPUT_DIRECTORY } from '../constants.js';
|
|
6
|
-
import { create, hasCriticalExcludedChanges, getMinimalExcludedPatterns, hasStagedChanges
|
|
6
|
+
import { create, hasCriticalExcludedChanges, getMinimalExcludedPatterns, hasStagedChanges } from '../content/diff.js';
|
|
7
7
|
import { create as create$2 } from '../content/log.js';
|
|
8
8
|
import { create as create$1 } from '../content/files.js';
|
|
9
|
-
import { ValidationError, ExternalDependencyError, CommandError, createStorage,
|
|
9
|
+
import { ValidationError, ExternalDependencyError, CommandError, createStorage, checkForFileDependencies, logFileDependencyWarning, logFileDependencySuggestions } from '@eldrforge/shared';
|
|
10
10
|
import { getDryRunLogger } from '../logging.js';
|
|
11
11
|
import { run, validateString, safeJsonParse, validatePackageJson } from '@eldrforge/git-tools';
|
|
12
12
|
import { sanitizeDirection } from '../util/validation.js';
|
|
13
13
|
import { filterContent } from '../util/stopContext.js';
|
|
14
14
|
import { getOutputPath, getTimestampedResponseFilename, getTimestampedRequestFilename, getTimestampedCommitFilename } from '../util/general.js';
|
|
15
15
|
import { getRecentClosedIssuesForCommit } from '@eldrforge/github-tools';
|
|
16
|
-
import { runAgenticCommit,
|
|
16
|
+
import { runAgenticCommit, requireTTY, generateReflectionReport, getUserChoice, STANDARD_CHOICES, getLLMFeedbackInEditor, editContentInEditor, createCompletionWithRetry, createCommitPrompt } from '@eldrforge/ai-service';
|
|
17
17
|
import { improveContentWithLLM } from '../util/interactive.js';
|
|
18
18
|
import { toAIConfig } from '../util/aiAdapter.js';
|
|
19
19
|
import { createStorageAdapter } from '../util/storageAdapter.js';
|
|
20
20
|
import { createLoggerAdapter } from '../util/loggerAdapter.js';
|
|
21
21
|
|
|
22
|
+
// Helper function to read context files
|
|
23
|
+
async function readContextFiles(contextFiles, logger) {
|
|
24
|
+
if (!contextFiles || contextFiles.length === 0) {
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
const storage = createStorage();
|
|
28
|
+
const contextParts = [];
|
|
29
|
+
for (const filePath of contextFiles){
|
|
30
|
+
try {
|
|
31
|
+
const content = await storage.readFile(filePath, 'utf8');
|
|
32
|
+
contextParts.push(`## Context from ${filePath}\n\n${content}\n`);
|
|
33
|
+
logger.debug(`Read context from file: ${filePath}`);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
logger.warn(`Failed to read context file ${filePath}: ${error.message}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return contextParts.join('\n---\n\n');
|
|
39
|
+
}
|
|
22
40
|
// Helper function to generate self-reflection output using observability module
|
|
23
41
|
async function generateSelfReflection(agenticResult, outputDirectory, storage, logger) {
|
|
24
42
|
try {
|
|
@@ -35,10 +53,8 @@ async function generateSelfReflection(agenticResult, outputDirectory, storage, l
|
|
|
35
53
|
suggestedSplits: agenticResult.suggestedSplits || [],
|
|
36
54
|
logger
|
|
37
55
|
});
|
|
38
|
-
// Save the report
|
|
39
|
-
|
|
40
|
-
const filename = `agentic-reflection-commit-${timestamp}.md`;
|
|
41
|
-
await storageAdapter.writeOutput(filename, report);
|
|
56
|
+
// Save the report to output directory
|
|
57
|
+
await storage.writeFile(reflectionPath, report, 'utf8');
|
|
42
58
|
logger.info('');
|
|
43
59
|
logger.info('ā'.repeat(80));
|
|
44
60
|
logger.info('š SELF-REFLECTION REPORT GENERATED');
|
|
@@ -93,7 +109,7 @@ async function improveCommitMessageWithLLM(commitMessage, runConfig, promptConfi
|
|
|
93
109
|
const userFeedback = await getLLMFeedbackInEditor('commit message', commitMessage);
|
|
94
110
|
// Create AI config from kodrdriv config
|
|
95
111
|
const aiConfig = toAIConfig(runConfig);
|
|
96
|
-
const aiStorageAdapter = createStorageAdapter();
|
|
112
|
+
const aiStorageAdapter = createStorageAdapter(outputDirectory);
|
|
97
113
|
const aiLogger = createLoggerAdapter(false);
|
|
98
114
|
const improvementConfig = {
|
|
99
115
|
contentType: 'commit message',
|
|
@@ -304,7 +320,7 @@ const saveCommitMessage = async (outputDirectory, summary, storage, logger)=>{
|
|
|
304
320
|
}
|
|
305
321
|
};
|
|
306
322
|
const executeInternal = async (runConfig)=>{
|
|
307
|
-
var _runConfig_commit, _runConfig_commit1, _runConfig_commit2, _runConfig_commit3, _runConfig_commit4, _runConfig_commit5, _runConfig_commit6, _runConfig_commit7, _runConfig_commit8, _runConfig_commit9, _runConfig_commit10;
|
|
323
|
+
var _runConfig_commit, _runConfig_commit1, _runConfig_commit2, _runConfig_commit3, _runConfig_commit4, _runConfig_commit5, _runConfig_commit6, _aiConfig_commands_commit, _aiConfig_commands, _runConfig_commit7, _aiConfig_commands_commit1, _aiConfig_commands1, _runConfig_commit8, _runConfig_commit9, _runConfig_commit10, _runConfig_commit11, _runConfig_commit12, _runConfig_commit13, _runConfig_commit14;
|
|
308
324
|
const isDryRun = runConfig.dryRun || false;
|
|
309
325
|
const logger = getDryRunLogger(isDryRun);
|
|
310
326
|
// Track if user explicitly chose to skip in interactive mode
|
|
@@ -323,7 +339,6 @@ const executeInternal = async (runConfig)=>{
|
|
|
323
339
|
// Validate sendit state early - now returns boolean instead of throwing
|
|
324
340
|
validateSenditState(runConfig, cached, isDryRun, logger);
|
|
325
341
|
let diffContent = '';
|
|
326
|
-
let isUsingFileContent = false;
|
|
327
342
|
var _runConfig_commit_maxDiffBytes;
|
|
328
343
|
const maxDiffBytes = (_runConfig_commit_maxDiffBytes = (_runConfig_commit1 = runConfig.commit) === null || _runConfig_commit1 === void 0 ? void 0 : _runConfig_commit1.maxDiffBytes) !== null && _runConfig_commit_maxDiffBytes !== void 0 ? _runConfig_commit_maxDiffBytes : DEFAULT_MAX_DIFF_BYTES;
|
|
329
344
|
var _runConfig_excludedPatterns;
|
|
@@ -340,9 +355,9 @@ const executeInternal = async (runConfig)=>{
|
|
|
340
355
|
if (!hasActualChanges) {
|
|
341
356
|
const criticalChanges = await hasCriticalExcludedChanges();
|
|
342
357
|
if (criticalChanges.hasChanges) {
|
|
343
|
-
var
|
|
358
|
+
var _runConfig_commit15;
|
|
344
359
|
logger.info('CRITICAL_FILES_DETECTED: No changes with exclusion patterns, but critical files modified | Files: %s | Action: May need to include critical files', criticalChanges.files.join(', '));
|
|
345
|
-
if (((
|
|
360
|
+
if (((_runConfig_commit15 = runConfig.commit) === null || _runConfig_commit15 === void 0 ? void 0 : _runConfig_commit15.sendit) && !isDryRun) {
|
|
346
361
|
// In sendit mode, automatically include critical files
|
|
347
362
|
logger.info('SENDIT_INCLUDING_CRITICAL: SendIt mode including critical files in diff | Purpose: Ensure all important changes are captured');
|
|
348
363
|
var _runConfig_excludedPatterns1;
|
|
@@ -374,10 +389,10 @@ const executeInternal = async (runConfig)=>{
|
|
|
374
389
|
}
|
|
375
390
|
}
|
|
376
391
|
} else {
|
|
377
|
-
var
|
|
392
|
+
var _runConfig_commit16;
|
|
378
393
|
// No changes at all - try fallback to file content for new repositories
|
|
379
394
|
logger.info('NO_CHANGES_DETECTED: No changes found in working directory | Status: clean | Action: Nothing to commit');
|
|
380
|
-
if (((
|
|
395
|
+
if (((_runConfig_commit16 = runConfig.commit) === null || _runConfig_commit16 === void 0 ? void 0 : _runConfig_commit16.sendit) && !isDryRun) {
|
|
381
396
|
logger.warn('No changes detected to commit. Skipping commit operation.');
|
|
382
397
|
return 'No changes to commit.';
|
|
383
398
|
} else {
|
|
@@ -394,11 +409,10 @@ const executeInternal = async (runConfig)=>{
|
|
|
394
409
|
if (fileContent && fileContent.trim().length > 0) {
|
|
395
410
|
logger.info('FILE_CONTENT_USING: Using file content for commit message generation | Content Length: %d characters | Source: file content', fileContent.length);
|
|
396
411
|
diffContent = fileContent;
|
|
397
|
-
isUsingFileContent = true;
|
|
398
412
|
hasActualChanges = true; // We have content to work with
|
|
399
413
|
} else {
|
|
400
|
-
var
|
|
401
|
-
if ((
|
|
414
|
+
var _runConfig_commit17;
|
|
415
|
+
if ((_runConfig_commit17 = runConfig.commit) === null || _runConfig_commit17 === void 0 ? void 0 : _runConfig_commit17.sendit) {
|
|
402
416
|
logger.info('COMMIT_SKIPPED: Skipping commit operation | Reason: No changes detected | Action: None');
|
|
403
417
|
return 'No changes to commit.';
|
|
404
418
|
} else {
|
|
@@ -450,124 +464,68 @@ const executeInternal = async (runConfig)=>{
|
|
|
450
464
|
}
|
|
451
465
|
// Create adapters for ai-service
|
|
452
466
|
const aiConfig = toAIConfig(runConfig);
|
|
453
|
-
const aiStorageAdapter = createStorageAdapter();
|
|
467
|
+
const aiStorageAdapter = createStorageAdapter(outputDirectory);
|
|
454
468
|
const aiLogger = createLoggerAdapter(isDryRun);
|
|
455
|
-
//
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
469
|
+
// Read context from files if provided
|
|
470
|
+
const contextFromFiles = await readContextFiles((_runConfig_commit4 = runConfig.commit) === null || _runConfig_commit4 === void 0 ? void 0 : _runConfig_commit4.contextFiles, logger);
|
|
471
|
+
// Combine file context with existing context
|
|
472
|
+
const combinedContext = [
|
|
473
|
+
(_runConfig_commit5 = runConfig.commit) === null || _runConfig_commit5 === void 0 ? void 0 : _runConfig_commit5.context,
|
|
474
|
+
contextFromFiles
|
|
475
|
+
].filter(Boolean).join('\n\n---\n\n');
|
|
476
|
+
// Define promptContext for use in interactive improvements
|
|
462
477
|
const promptContext = {
|
|
463
478
|
logContext,
|
|
464
|
-
context:
|
|
479
|
+
context: combinedContext || undefined,
|
|
465
480
|
directories: runConfig.contextDirectories
|
|
466
481
|
};
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
logger.info('
|
|
506
|
-
|
|
507
|
-
const split = agenticResult.suggestedSplits[i];
|
|
508
|
-
logger.info('\nCommit %d (%d files):', i + 1, split.files.length);
|
|
509
|
-
logger.info(' Files: %s', split.files.join(', '));
|
|
510
|
-
logger.info(' Rationale: %s', split.rationale);
|
|
511
|
-
logger.info(' Message: %s', split.message);
|
|
512
|
-
}
|
|
513
|
-
logger.info('\nā ļø Commit splitting is not yet automated. Please stage and commit files separately.');
|
|
514
|
-
logger.info('Using combined message for now...\n');
|
|
515
|
-
} else if (agenticResult.suggestedSplits.length > 1) {
|
|
516
|
-
logger.debug('Agent suggested %d splits but commit splitting is not enabled', agenticResult.suggestedSplits.length);
|
|
517
|
-
}
|
|
518
|
-
rawSummary = agenticResult.commitMessage;
|
|
519
|
-
} else {
|
|
520
|
-
var _aiConfig_commands_commit2, _aiConfig_commands2, _aiConfig_commands_commit3, _aiConfig_commands3;
|
|
521
|
-
// Traditional single-shot approach
|
|
522
|
-
const prompt = await createCommitPrompt(promptConfig, promptContent, promptContext);
|
|
523
|
-
// Get the appropriate model for the commit command
|
|
524
|
-
const modelToUse = ((_aiConfig_commands2 = aiConfig.commands) === null || _aiConfig_commands2 === void 0 ? void 0 : (_aiConfig_commands_commit2 = _aiConfig_commands2.commit) === null || _aiConfig_commands_commit2 === void 0 ? void 0 : _aiConfig_commands_commit2.model) || aiConfig.model || 'gpt-4o-mini';
|
|
525
|
-
// Use consistent model for debug (fix hardcoded model)
|
|
526
|
-
if (runConfig.debug) {
|
|
527
|
-
const formattedPrompt = Formatter.create({
|
|
528
|
-
logger
|
|
529
|
-
}).formatPrompt(modelToUse, prompt);
|
|
530
|
-
logger.silly('Formatted Prompt: %s', stringifyJSON(formattedPrompt));
|
|
482
|
+
// Announce self-reflection if enabled
|
|
483
|
+
if ((_runConfig_commit6 = runConfig.commit) === null || _runConfig_commit6 === void 0 ? void 0 : _runConfig_commit6.selfReflection) {
|
|
484
|
+
logger.info('š Self-reflection enabled - detailed analysis will be generated');
|
|
485
|
+
}
|
|
486
|
+
// Get list of changed files
|
|
487
|
+
const changedFilesResult = await run(`git diff --name-only ${cached ? '--cached' : ''}`);
|
|
488
|
+
const changedFilesOutput = typeof changedFilesResult === 'string' ? changedFilesResult : changedFilesResult.stdout;
|
|
489
|
+
const changedFiles = changedFilesOutput.split('\n').filter((f)=>f.trim().length > 0);
|
|
490
|
+
logger.debug('Changed files for analysis: %d files', changedFiles.length);
|
|
491
|
+
// Run agentic commit generation
|
|
492
|
+
const agenticResult = await runAgenticCommit({
|
|
493
|
+
changedFiles,
|
|
494
|
+
diffContent,
|
|
495
|
+
userDirection,
|
|
496
|
+
logContext,
|
|
497
|
+
model: ((_aiConfig_commands = aiConfig.commands) === null || _aiConfig_commands === void 0 ? void 0 : (_aiConfig_commands_commit = _aiConfig_commands.commit) === null || _aiConfig_commands_commit === void 0 ? void 0 : _aiConfig_commands_commit.model) || aiConfig.model,
|
|
498
|
+
maxIterations: ((_runConfig_commit7 = runConfig.commit) === null || _runConfig_commit7 === void 0 ? void 0 : _runConfig_commit7.maxAgenticIterations) || 10,
|
|
499
|
+
debug: runConfig.debug,
|
|
500
|
+
debugRequestFile: getOutputPath(outputDirectory, getTimestampedRequestFilename('commit')),
|
|
501
|
+
debugResponseFile: getOutputPath(outputDirectory, getTimestampedResponseFilename('commit')),
|
|
502
|
+
storage: aiStorageAdapter,
|
|
503
|
+
logger: aiLogger,
|
|
504
|
+
openaiReasoning: ((_aiConfig_commands1 = aiConfig.commands) === null || _aiConfig_commands1 === void 0 ? void 0 : (_aiConfig_commands_commit1 = _aiConfig_commands1.commit) === null || _aiConfig_commands_commit1 === void 0 ? void 0 : _aiConfig_commands_commit1.reasoning) || aiConfig.reasoning
|
|
505
|
+
});
|
|
506
|
+
const iterations = agenticResult.iterations || 0;
|
|
507
|
+
const toolCalls = agenticResult.toolCallsExecuted || 0;
|
|
508
|
+
logger.info(`š Analysis complete: ${iterations} iterations, ${toolCalls} tool calls`);
|
|
509
|
+
// Generate self-reflection output if enabled
|
|
510
|
+
if ((_runConfig_commit8 = runConfig.commit) === null || _runConfig_commit8 === void 0 ? void 0 : _runConfig_commit8.selfReflection) {
|
|
511
|
+
await generateSelfReflection(agenticResult, outputDirectory, storage, logger);
|
|
512
|
+
}
|
|
513
|
+
// Check for suggested splits
|
|
514
|
+
if (agenticResult.suggestedSplits.length > 1 && ((_runConfig_commit9 = runConfig.commit) === null || _runConfig_commit9 === void 0 ? void 0 : _runConfig_commit9.allowCommitSplitting)) {
|
|
515
|
+
logger.info('\nš AI suggests splitting this into %d commits:', agenticResult.suggestedSplits.length);
|
|
516
|
+
for(let i = 0; i < agenticResult.suggestedSplits.length; i++){
|
|
517
|
+
const split = agenticResult.suggestedSplits[i];
|
|
518
|
+
logger.info('\nCommit %d (%d files):', i + 1, split.files.length);
|
|
519
|
+
logger.info(' Files: %s', split.files.join(', '));
|
|
520
|
+
logger.info(' Rationale: %s', split.rationale);
|
|
521
|
+
logger.info(' Message: %s', split.message);
|
|
531
522
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
const createRetryCallback = (originalDiffContent)=>async (attempt)=>{
|
|
537
|
-
var _runConfig_commit;
|
|
538
|
-
logger.info('COMMIT_RETRY: Retrying with reduced diff size | Attempt: %d | Strategy: Truncate diff | Reason: Previous attempt failed', attempt);
|
|
539
|
-
// Progressively reduce the diff size on retries
|
|
540
|
-
const reductionFactor = Math.pow(0.5, attempt - 1); // 50% reduction per retry
|
|
541
|
-
const reducedMaxDiffBytes = Math.max(512, Math.floor(maxDiffBytes * reductionFactor));
|
|
542
|
-
logger.debug('Reducing maxDiffBytes from %d to %d for retry', maxDiffBytes, reducedMaxDiffBytes);
|
|
543
|
-
// Re-truncate the diff with smaller limits
|
|
544
|
-
const reducedDiffContent = originalDiffContent.length > reducedMaxDiffBytes ? truncateDiffByFiles(originalDiffContent, reducedMaxDiffBytes) : originalDiffContent;
|
|
545
|
-
// Rebuild the prompt with the reduced diff
|
|
546
|
-
const reducedPromptContent = {
|
|
547
|
-
diffContent: reducedDiffContent,
|
|
548
|
-
userDirection
|
|
549
|
-
};
|
|
550
|
-
const reducedPromptContext = {
|
|
551
|
-
logContext,
|
|
552
|
-
context: (_runConfig_commit = runConfig.commit) === null || _runConfig_commit === void 0 ? void 0 : _runConfig_commit.context,
|
|
553
|
-
directories: runConfig.contextDirectories
|
|
554
|
-
};
|
|
555
|
-
const retryPrompt = await createCommitPrompt(promptConfig, reducedPromptContent, reducedPromptContext);
|
|
556
|
-
const retryRequest = Formatter.create({
|
|
557
|
-
logger
|
|
558
|
-
}).formatPrompt(modelToUse, retryPrompt);
|
|
559
|
-
return retryRequest.messages;
|
|
560
|
-
};
|
|
561
|
-
rawSummary = await createCompletionWithRetry(request.messages, {
|
|
562
|
-
model: modelToUse,
|
|
563
|
-
openaiReasoning: ((_aiConfig_commands3 = aiConfig.commands) === null || _aiConfig_commands3 === void 0 ? void 0 : (_aiConfig_commands_commit3 = _aiConfig_commands3.commit) === null || _aiConfig_commands_commit3 === void 0 ? void 0 : _aiConfig_commands_commit3.reasoning) || aiConfig.reasoning,
|
|
564
|
-
debug: runConfig.debug,
|
|
565
|
-
debugRequestFile: getOutputPath(runConfig.outputDirectory || DEFAULT_OUTPUT_DIRECTORY, getTimestampedRequestFilename('commit')),
|
|
566
|
-
debugResponseFile: getOutputPath(runConfig.outputDirectory || DEFAULT_OUTPUT_DIRECTORY, getTimestampedResponseFilename('commit')),
|
|
567
|
-
storage: aiStorageAdapter,
|
|
568
|
-
logger: aiLogger
|
|
569
|
-
}, createRetryCallback(diffContent));
|
|
523
|
+
logger.info('\nā ļø Commit splitting is not yet automated. Please stage and commit files separately.');
|
|
524
|
+
logger.info('Using combined message for now...\n');
|
|
525
|
+
} else if (agenticResult.suggestedSplits.length > 1) {
|
|
526
|
+
logger.debug('AI suggested %d splits but commit splitting is not enabled', agenticResult.suggestedSplits.length);
|
|
570
527
|
}
|
|
528
|
+
const rawSummary = agenticResult.commitMessage;
|
|
571
529
|
// Apply stop-context filtering to commit message
|
|
572
530
|
const filterResult = filterContent(rawSummary, runConfig.stopContext);
|
|
573
531
|
const summary = filterResult.filtered;
|
|
@@ -575,8 +533,8 @@ const executeInternal = async (runConfig)=>{
|
|
|
575
533
|
await saveCommitMessage(outputDirectory, summary, storage, logger);
|
|
576
534
|
// š”ļø Universal Safety Check: Run before ANY commit operation
|
|
577
535
|
// This protects both direct commits (--sendit) and automated commits (publish, etc.)
|
|
578
|
-
const willCreateCommit = ((
|
|
579
|
-
if (willCreateCommit && !((
|
|
536
|
+
const willCreateCommit = ((_runConfig_commit10 = runConfig.commit) === null || _runConfig_commit10 === void 0 ? void 0 : _runConfig_commit10.sendit) && hasActualChanges && cached;
|
|
537
|
+
if (willCreateCommit && !((_runConfig_commit11 = runConfig.commit) === null || _runConfig_commit11 === void 0 ? void 0 : _runConfig_commit11.skipFileCheck) && !isDryRun) {
|
|
580
538
|
logger.debug('Checking for file: dependencies before commit operation...');
|
|
581
539
|
try {
|
|
582
540
|
const fileDependencyIssues = await checkForFileDependencies(storage, process.cwd());
|
|
@@ -601,11 +559,11 @@ const executeInternal = async (runConfig)=>{
|
|
|
601
559
|
logger.warn('Warning: Could not check for file: dependencies: %s', error.message);
|
|
602
560
|
logger.warn('Proceeding with commit...');
|
|
603
561
|
}
|
|
604
|
-
} else if (((
|
|
562
|
+
} else if (((_runConfig_commit12 = runConfig.commit) === null || _runConfig_commit12 === void 0 ? void 0 : _runConfig_commit12.skipFileCheck) && willCreateCommit) {
|
|
605
563
|
logger.warn('ā ļø Skipping file: dependency check as requested');
|
|
606
564
|
}
|
|
607
565
|
// Handle interactive mode
|
|
608
|
-
if (((
|
|
566
|
+
if (((_runConfig_commit13 = runConfig.commit) === null || _runConfig_commit13 === void 0 ? void 0 : _runConfig_commit13.interactive) && !isDryRun) {
|
|
609
567
|
var _runConfig_commit19;
|
|
610
568
|
requireTTY('Interactive mode requires a terminal. Use --sendit or --dry-run instead.');
|
|
611
569
|
const interactiveResult = await handleInteractiveCommitFeedback(summary, runConfig, promptConfig, promptContext, outputDirectory, storage, diffContent, hasActualChanges, cached);
|
|
@@ -655,7 +613,7 @@ const executeInternal = async (runConfig)=>{
|
|
|
655
613
|
logger.debug('Skipping sendit logic because user chose to skip in interactive mode');
|
|
656
614
|
return summary;
|
|
657
615
|
}
|
|
658
|
-
if ((
|
|
616
|
+
if ((_runConfig_commit14 = runConfig.commit) === null || _runConfig_commit14 === void 0 ? void 0 : _runConfig_commit14.sendit) {
|
|
659
617
|
if (isDryRun) {
|
|
660
618
|
var _runConfig_commit23, _runConfig_commit24;
|
|
661
619
|
logger.info('Would commit with message: \n\n%s\n\n', summary);
|