@snapcommit/cli 3.5.0 → 3.6.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.
|
@@ -504,6 +504,13 @@ async function tryAdvancedConflictResolution() {
|
|
|
504
504
|
async function resolveConflictWithAI(filename, base, ours, theirs) {
|
|
505
505
|
try {
|
|
506
506
|
const axios = (await Promise.resolve().then(() => __importStar(require('axios')))).default;
|
|
507
|
+
const { getAuthConfig } = await Promise.resolve().then(() => __importStar(require('../lib/auth')));
|
|
508
|
+
// Get auth token
|
|
509
|
+
const authConfig = getAuthConfig();
|
|
510
|
+
if (!authConfig || !authConfig.token) {
|
|
511
|
+
console.log(chalk_1.default.yellow('⚠️ Authentication required for AI conflict resolution'));
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
507
514
|
// Get the backend URL from env or default
|
|
508
515
|
const backendUrl = process.env.SNAPCOMMIT_BACKEND_URL || 'https://snapcommit.dev';
|
|
509
516
|
const response = await axios.post(`${backendUrl}/api/ai/resolve-conflict`, {
|
|
@@ -511,6 +518,7 @@ async function resolveConflictWithAI(filename, base, ours, theirs) {
|
|
|
511
518
|
base,
|
|
512
519
|
ours,
|
|
513
520
|
theirs,
|
|
521
|
+
token: authConfig.token,
|
|
514
522
|
}, {
|
|
515
523
|
headers: {
|
|
516
524
|
'Content-Type': 'application/json',
|
|
@@ -524,6 +532,10 @@ async function resolveConflictWithAI(filename, base, ours, theirs) {
|
|
|
524
532
|
}
|
|
525
533
|
catch (error) {
|
|
526
534
|
// AI resolution failed - fall back to manual choice
|
|
535
|
+
if (error.response?.status === 403) {
|
|
536
|
+
console.log(chalk_1.default.red('\n❌ Subscription required for AI conflict resolution'));
|
|
537
|
+
console.log(chalk_1.default.cyan('Visit: https://snapcommit.dev/pricing\n'));
|
|
538
|
+
}
|
|
527
539
|
return null;
|
|
528
540
|
}
|
|
529
541
|
}
|