docs-combiner 0.1.3 → 0.1.4
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/renderer.js +21 -7
- package/dist/renderer.js.map +1 -1
- package/package.json +1 -1
package/dist/renderer.js
CHANGED
|
@@ -90051,7 +90051,7 @@ function App() {
|
|
|
90051
90051
|
const rest = trimmed.slice(1).trim();
|
|
90052
90052
|
const priceMatch = rest.match(/^(\d+(?:\.\d+)?)$/);
|
|
90053
90053
|
if (priceMatch) {
|
|
90054
|
-
return { price: priceMatch[1], currency: currencySymbolMap[firstChar] };
|
|
90054
|
+
return { price: priceMatch[1], currency: currencySymbolMap[firstChar], currencySymbol: firstChar };
|
|
90055
90055
|
}
|
|
90056
90056
|
}
|
|
90057
90057
|
// Check if last character is a currency symbol (e.g., "48900 ₦" or "48900₦")
|
|
@@ -90060,7 +90060,7 @@ function App() {
|
|
|
90060
90060
|
const rest = trimmed.slice(0, -1).trim();
|
|
90061
90061
|
const priceMatch = rest.match(/^(\d+(?:\.\d+)?)$/);
|
|
90062
90062
|
if (priceMatch) {
|
|
90063
|
-
return { price: priceMatch[1], currency: currencySymbolMap[lastChar] };
|
|
90063
|
+
return { price: priceMatch[1], currency: currencySymbolMap[lastChar], currencySymbol: lastChar };
|
|
90064
90064
|
}
|
|
90065
90065
|
}
|
|
90066
90066
|
// Try to match pattern: number followed by currency code (3 letters)
|
|
@@ -91635,10 +91635,19 @@ function App() {
|
|
|
91635
91635
|
}
|
|
91636
91636
|
// Check if there's reasoning but no images (model might have failed)
|
|
91637
91637
|
if (message.reasoning_details && message.reasoning_details.length > 0) {
|
|
91638
|
+
logToTerminal('error', '❌ No images found in response. Model returned reasoning but no image was generated.');
|
|
91639
|
+
logToTerminal('error', '📋 Full response text:', responseText);
|
|
91640
|
+
logToTerminal('error', '📋 Parsed response data:', JSON.stringify(data, null, 2));
|
|
91641
|
+
logToTerminal('error', '📋 Message object:', JSON.stringify(message, null, 2));
|
|
91642
|
+
logToTerminal('error', '📋 Reasoning details:', JSON.stringify(message.reasoning_details, null, 2));
|
|
91638
91643
|
const reasoningError = new Error('No images found in response. Model returned reasoning but no image was generated.');
|
|
91639
91644
|
reasoningError.hasReasoning = true;
|
|
91640
91645
|
throw reasoningError;
|
|
91641
91646
|
}
|
|
91647
|
+
logToTerminal('error', '❌ No images found in response.');
|
|
91648
|
+
logToTerminal('error', '📋 Full response text:', responseText);
|
|
91649
|
+
logToTerminal('error', '📋 Parsed response data:', JSON.stringify(data, null, 2));
|
|
91650
|
+
logToTerminal('error', '📋 Message object:', JSON.stringify(message, null, 2));
|
|
91642
91651
|
throw new Error(`No images found in response. Message: ${JSON.stringify(message)}`);
|
|
91643
91652
|
}
|
|
91644
91653
|
// Images are returned as base64 data URLs: data:image/png;base64,...
|
|
@@ -92723,15 +92732,17 @@ function App() {
|
|
|
92723
92732
|
alert('Please fill in Product and Geo fields');
|
|
92724
92733
|
return;
|
|
92725
92734
|
}
|
|
92726
|
-
const { price: generatePrice, currency: generateCurrency } = parsePriceAndCurrency(generatePriceWithCurrency);
|
|
92735
|
+
const { price: generatePrice, currency: generateCurrency, currencySymbol } = parsePriceAndCurrency(generatePriceWithCurrency);
|
|
92727
92736
|
if (!generatePrice.trim() || !generateCurrency.trim()) {
|
|
92728
92737
|
logToTerminal('error', '❌ Missing price or currency');
|
|
92729
92738
|
alert('Please fill in Price field (format: "11400 HUF") for image generation');
|
|
92730
92739
|
return;
|
|
92731
92740
|
}
|
|
92741
|
+
// Use original currency symbol if available, otherwise use currency code
|
|
92742
|
+
const currencyForPrompt = currencySymbol || generateCurrency;
|
|
92732
92743
|
logToTerminal('log', '📦 Product:', generateProduct);
|
|
92733
92744
|
logToTerminal('log', '🌍 Geo:', generateGeo);
|
|
92734
|
-
logToTerminal('log', '💰 Price:', generatePrice,
|
|
92745
|
+
logToTerminal('log', '💰 Price:', generatePrice, currencyForPrompt);
|
|
92735
92746
|
if (!driveFolderUrl.trim()) {
|
|
92736
92747
|
logToTerminal('error', '❌ Missing Drive folder URL');
|
|
92737
92748
|
alert('Please fill in Google Drive Folder URL');
|
|
@@ -92766,7 +92777,8 @@ function App() {
|
|
|
92766
92777
|
// Base prompt structure
|
|
92767
92778
|
// NOTE: This generation prompt is intentionally STRICTER than the image validator (`validateCreativeImage`).
|
|
92768
92779
|
// Keep the prompt strict even if validator allows some "acceptable" deviations (e.g. 2-line headline, benefit headline, CTA position, discount emphasis).
|
|
92769
|
-
|
|
92780
|
+
// Use original currency symbol if available, otherwise use currency code
|
|
92781
|
+
const basePromptStructure = (0,_prompts__WEBPACK_IMPORTED_MODULE_1__.getImageGenerationBasePrompt)(generateGeo, generatePrice, currencyForPrompt);
|
|
92770
92782
|
// Generate 5 images with different approaches
|
|
92771
92783
|
const approaches = _prompts__WEBPACK_IMPORTED_MODULE_1__.CREO_APPROACHES;
|
|
92772
92784
|
// Initialize placeholders for 5 images
|
|
@@ -92958,10 +92970,12 @@ function App() {
|
|
|
92958
92970
|
errorMsg.includes('Failed to fetch') ||
|
|
92959
92971
|
errorMsg.includes('Network error') ||
|
|
92960
92972
|
errorMsg.includes('timeout') ||
|
|
92961
|
-
errorMsg.includes('Request timeout')
|
|
92973
|
+
errorMsg.includes('Request timeout') ||
|
|
92974
|
+
errorMsg.includes('Provider returned error') ||
|
|
92975
|
+
errorMsg.toLowerCase().includes('provider error'));
|
|
92962
92976
|
});
|
|
92963
92977
|
if (retryableErrors.length > 0) {
|
|
92964
|
-
addLog(formatLogMessage('log', `🔄 Повтор: найдено ${retryableErrors.length} ошибок (сеть/таймаут/JSON). Пробую ещё раз...`));
|
|
92978
|
+
addLog(formatLogMessage('log', `🔄 Повтор: найдено ${retryableErrors.length} ошибок (сеть/таймаут/JSON/Provider). Пробую ещё раз...`));
|
|
92965
92979
|
const retryIndices = retryableErrors.map(r => r.index).sort((a, b) => a - b);
|
|
92966
92980
|
let retryCursor = 0;
|
|
92967
92981
|
const retryWorkers = Array.from({ length: Math.min(maxParallel, retryIndices.length) }, () => (async () => {
|