File size: 1,163 Bytes
74411f9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | /**
* Bayan — Shared Constants (Single Source of Truth)
*
* ALL shared configuration lives here.
* No hardcoded API URLs, timeouts, or limits elsewhere.
*
* Used by: background.js, analysis-controller.js, config.js (legacy alias)
*/
const BAYAN = {
/** Backend API base URL (HuggingFace Spaces) */
API_BASE: 'https://bayan10-bayan-api.hf.space',
/** Network timeout for API calls (ms) */
API_TIMEOUT_MS: 60000, // FIX-09: Increased from 20s to 60s for cold-start tolerance
/** Max retries on network failure */
MAX_RETRIES: 1,
/** Cache TTL (ms) — 5 minutes */
CACHE_TTL_MS: 300000,
/** Max cache entries */
CACHE_MAX_ENTRIES: 20,
/** Max text length for analysis */
MAX_TEXT_LENGTH: 5000,
/** Min text length to trigger analysis */
MIN_TEXT_LENGTH: 15,
/** Min Arabic characters required */
MIN_ARABIC_CHARS: 5,
/** Min text length for summarization */
MIN_SUMMARIZE_LENGTH: 10,
/** Protected hosts — disable contenteditable injection */
PROTECTED_HOSTS: [
'mail.google.com',
'docs.google.com',
'sheets.google.com',
'slides.google.com',
'notion.so',
'www.notion.so',
],
};
|