All files / src index.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165                                                                                                                                                                                                                                                                                                                                         
// SPDX-FileCopyrightText: 2024-2026 Hack23 AB
// SPDX-License-Identifier: Apache-2.0
 
/**
 * @module euparliamentmonitor
 * @description European Parliament Intelligence Platform — npm package entry point.
 *
 * This barrel re-exports the reusable library surface of the EU Parliament
 * Monitor so that other projects can consume types, MCP clients, analysis
 * utilities, templates, and language constants without duplicating code.
 *
 * @example
 * ```ts
 * import {
 *   EuropeanParliamentMCPClient,
 *   getEPMCPClient,
 *   ALL_LANGUAGES,
 *   scoreVotingAnomaly,
 *   generateArticleHTML,
 * } from 'euparliamentmonitor';
 * ```
 *
 * @see {@link https://github.com/Hack23/euparliamentmonitor | GitHub Repository}
 * @see {@link https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md | Secure Development Policy}
 */
 
// ─── Types ───────────────────────────────────────────────────────────────────
export * from './types/index.js';
 
// ─── MCP Clients ─────────────────────────────────────────────────────────────
export {
  MCPConnection,
  MCPSessionExpiredError,
  MCPRateLimitError,
  isRetriableError,
  formatRetryAfter,
  parseSSEResponse,
} from './mcp/mcp-connection.js';
 
export {
  EuropeanParliamentMCPClient,
  getEPMCPClient,
  closeEPMCPClient,
} from './mcp/ep-mcp-client.js';
 
export { WorldBankMCPClient, getWBMCPClient, closeWBMCPClient } from './mcp/wb-mcp-client.js';
 
export {
  type CircuitState,
  type CircuitBreakerOptions,
  CircuitBreaker,
  type MCPRetryPolicy,
  withRetry,
} from './mcp/mcp-retry.js';
 
export { type ToolHealthEntry, type HealthSnapshot, MCPHealthMonitor } from './mcp/mcp-health.js';
 
// ─── Intelligence Analysis ───────────────────────────────────────────────────
export {
  scoreVotingAnomaly,
  analyzeCoalitionCohesion,
  scoreMEPInfluence,
  calculateLegislativeVelocity,
  rankBySignificance,
  buildIntelligenceSection,
  buildDefaultStakeholderPerspectives,
  scoreStakeholderInfluence,
  buildStakeholderOutcomeMatrix,
  rankStakeholdersByInfluence,
  computeVotingIntensity,
  detectCoalitionShifts,
  computePolarizationIndex,
  detectVotingTrends,
  computeCrossSessionCoalitionStability,
  rankMEPInfluenceByTopic,
  buildLegislativeVelocityReport,
} from './utils/intelligence-analysis.js';
 
// ─── Intelligence Index ──────────────────────────────────────────────────────
export {
  createEmptyIndex,
  addArticleToIndex,
  buildIndexFromEntries,
  findRelatedArticles,
  generateCrossReferences,
  detectTrends,
  findOrCreateSeries,
  buildRelatedArticlesHTML,
} from './utils/intelligence-index.js';
 
// ─── Article Quality ─────────────────────────────────────────────────────────
export {
  assessAnalysisDepth,
  assessStakeholderCoverage,
  assessVisualizationQuality,
  calculateOverallScore,
  generateRecommendations,
  scoreArticleQuality,
} from './utils/article-quality-scorer.js';
 
// ─── Content Validation ──────────────────────────────────────────────────────
export {
  validateArticleContent,
  validateTranslationCompleteness,
} from './utils/content-validator.js';
 
// ─── HTML Utilities ──────────────────────────────────────────────────────────
export { stripScriptBlocks } from './utils/html-sanitize.js';
 
export {
  parseArticleFilename,
  formatSlug,
  calculateReadTime,
  escapeHTML,
  isSafeURL,
  validateArticleHTML,
  type ArticleValidationResult,
} from './utils/file-utils.js';
 
// ─── Article Category Detection ──────────────────────────────────────────────
export { detectCategory } from './utils/article-category.js';
 
// ─── World Bank Data Utilities ───────────────────────────────────────────────
export {
  EU_COUNTRY_CODES,
  EU_AGGREGATE_CODE,
  POLICY_INDICATORS,
  parseWorldBankCSV,
  formatIndicatorValue,
  getMostRecentValue,
  buildEconomicContext,
  getWorldBankCountryCode,
  isEUMemberState,
  buildEconomicContextHTML,
} from './utils/world-bank-data.js';
 
// ─── Templates ───────────────────────────────────────────────────────────────
export { generateArticleHTML } from './templates/article-template.js';
 
// ─── Constants & Languages ───────────────────────────────────────────────────
export {
  ALL_LANGUAGES,
  LANGUAGE_PRESETS,
  LANGUAGE_FLAGS,
  LANGUAGE_NAMES,
  getLocalizedString,
  isSupportedLanguage,
  getTextDirection,
} from './constants/language-core.js';
 
export {
  WB_INDICATORS,
  type WBIndicatorId,
  type IndicatorMapping,
  type CommitteeIndicatorEntry,
  COMMITTEE_INDICATOR_MAP,
  type CategoryIndicatorEntry,
  CATEGORY_INDICATOR_MAP,
  getCommitteeIndicators,
  getCommitteePrimaryIndicators,
  getCategoryIndicators,
  getIndicatorIdsForCommittees,
  getAllCategoryIndicatorIds,
} from './constants/committee-indicator-map.js';