metanova 0.1.0 → 0.2.1

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/index.d.cts CHANGED
@@ -105,7 +105,11 @@ interface ExtractionDiagnostics {
105
105
  contentType?: string;
106
106
  redirects: RedirectEntry[];
107
107
  sourcesUsed: string[];
108
+ adapterUsed?: string;
109
+ sourcePriority?: string[];
110
+ extractionMethod?: string;
108
111
  warnings: string[];
112
+ fallbacksAttempted?: ExtractionFallbackAttempt[];
109
113
  trace: string[];
110
114
  adapter?: {
111
115
  matched: boolean;
@@ -113,10 +117,43 @@ interface ExtractionDiagnostics {
113
117
  confidence?: number;
114
118
  };
115
119
  errors?: string[];
120
+ retryInfo?: ExtractionRetryInfo;
121
+ providerDiagnostics?: ProviderDiagnostics;
116
122
  selectedImageReason?: string;
123
+ confidenceBreakdown?: ConfidenceBreakdown;
117
124
  fetchDurationMs?: number;
118
125
  extractedAt: string;
119
126
  }
127
+ interface ExtractionFallbackAttempt {
128
+ method: string;
129
+ url?: string;
130
+ ok: boolean;
131
+ statusCode?: number;
132
+ blocked?: boolean;
133
+ error?: string;
134
+ retryAfter?: string;
135
+ }
136
+ interface ExtractionRetryInfo {
137
+ retryable: boolean;
138
+ reason?: string;
139
+ retryAfter?: string;
140
+ retryAfterMs?: number;
141
+ attempts?: number;
142
+ }
143
+ interface ProviderDiagnostics {
144
+ platform: string;
145
+ blocked: boolean;
146
+ statusCode?: number;
147
+ reason?: "provider_verification_required" | "provider_blocked_request" | string;
148
+ suggestedAction?: "retry_on_different_host_or_use_supported_proxy" | string;
149
+ }
150
+ interface ConfidenceBreakdown {
151
+ title: number;
152
+ description: number;
153
+ image: number;
154
+ structuredData: number;
155
+ adapter: number;
156
+ }
120
157
  interface UnifiedMetadata {
121
158
  ok: boolean;
122
159
  url: string;
@@ -124,6 +161,7 @@ interface UnifiedMetadata {
124
161
  type: MetadataType;
125
162
  title?: string;
126
163
  description?: string;
164
+ publishDate?: string;
127
165
  siteName?: string;
128
166
  canonicalUrl?: string;
129
167
  confidence: number;
@@ -406,6 +444,7 @@ interface ReliabilityInput {
406
444
  warnings: string[];
407
445
  }
408
446
  declare function calculateConfidence(input: ConfidenceEngineInput): number;
447
+ declare function calculateConfidenceBreakdown(input: ConfidenceEngineInput): ConfidenceBreakdown;
409
448
  declare function calculateCompleteness(input: CompletenessInput): number;
410
449
  declare function calculateReliability(input: ReliabilityInput): number;
411
450
 
@@ -490,4 +529,4 @@ interface MetaNovaRegistry {
490
529
  declare function registerGlobalPlugin(plugin: MetaNovaPlugin): void;
491
530
  declare function createRegistry(options?: ParseMetadataOptions): MetaNovaRegistry;
492
531
 
493
- export { type AdapterContext, type AdapterExtractionResult, type AdapterRawData, type ApplicationMetadata, type ArticleMetadata, type CompletenessInput, type ConfidenceEngineInput, type CustomExtractor, DEFAULT_ACCEPT, DEFAULT_ACCEPT_ENCODING, DEFAULT_ACCEPT_LANGUAGE, DEFAULT_BROWSER_USER_AGENT, type EmbeddedDataItem, type EmbeddedDataMetadata, type Entity, type ExtractionDiagnostics, type ExtractorContext, type FetchMetadataOptions, type FetchedPage, type HtmlMetadata, type ImageScorer, type ImageScoringContext, type JsonLdMetadata, type JsonLdNode, type MediaAsset, type MediaDiscoveryResult, type MediaKind, MetaNova, type MetaNovaCache, type MetaNovaCacheEntry, type MetaNovaPlugin, type MetaNovaPluginApi, type MetaNovaRegistry, type MetadataSource, type MetadataSourceAttribution, type MetadataType, type OEmbedData, type OEmbedLink, type OEmbedMetadata, type OpenGraphMetadata, type ParseMetadataOptions, type PlaylistMetadata, type PlaylistVideo, type PluginExtractionResult, type PreviewCard, type ProductMetadata, type RawMetadataSources, type RedirectEntry, type RedirectResolution, type ReliabilityInput, SecurityError, type SiteAdapter, type TwitterMetadata, type UnifiedMetadata, type VideoMetadata, addWarning, assertSafeRequestUrl, behanceAdapter, calculateCompleteness, calculateConfidence, calculateReliability, createDiagnostics, createPreviewCard, createRegistry, MetaNova as default, defaultAdapters, detectShortUrl, discoverMedia, extractAudio, extractEmbeddedData, extractHtmlMetadata, extractImages, extractJsonLd, extractOEmbed, extractOpenGraph, extractTwitterCards, extractVideos, facebookAdapter, fetchMetadata, fetchPage, instagramAdapter, normalizeMetadata, normalizeUrl, parseMetadata, parseMetadataAsync, pinterestAdapter, redditAdapter, registerGlobalPlugin, resolveCanonicalUrl, resolveRedirects, resolveUrl, scoreImages, tiktokAdapter, twitterAdapter, validateUrl, youtubeAdapter };
532
+ export { type AdapterContext, type AdapterExtractionResult, type AdapterRawData, type ApplicationMetadata, type ArticleMetadata, type CompletenessInput, type ConfidenceBreakdown, type ConfidenceEngineInput, type CustomExtractor, DEFAULT_ACCEPT, DEFAULT_ACCEPT_ENCODING, DEFAULT_ACCEPT_LANGUAGE, DEFAULT_BROWSER_USER_AGENT, type EmbeddedDataItem, type EmbeddedDataMetadata, type Entity, type ExtractionDiagnostics, type ExtractionFallbackAttempt, type ExtractionRetryInfo, type ExtractorContext, type FetchMetadataOptions, type FetchedPage, type HtmlMetadata, type ImageScorer, type ImageScoringContext, type JsonLdMetadata, type JsonLdNode, type MediaAsset, type MediaDiscoveryResult, type MediaKind, MetaNova, type MetaNovaCache, type MetaNovaCacheEntry, type MetaNovaPlugin, type MetaNovaPluginApi, type MetaNovaRegistry, type MetadataSource, type MetadataSourceAttribution, type MetadataType, type OEmbedData, type OEmbedLink, type OEmbedMetadata, type OpenGraphMetadata, type ParseMetadataOptions, type PlaylistMetadata, type PlaylistVideo, type PluginExtractionResult, type PreviewCard, type ProductMetadata, type ProviderDiagnostics, type RawMetadataSources, type RedirectEntry, type RedirectResolution, type ReliabilityInput, SecurityError, type SiteAdapter, type TwitterMetadata, type UnifiedMetadata, type VideoMetadata, addWarning, assertSafeRequestUrl, behanceAdapter, calculateCompleteness, calculateConfidence, calculateConfidenceBreakdown, calculateReliability, createDiagnostics, createPreviewCard, createRegistry, MetaNova as default, defaultAdapters, detectShortUrl, discoverMedia, extractAudio, extractEmbeddedData, extractHtmlMetadata, extractImages, extractJsonLd, extractOEmbed, extractOpenGraph, extractTwitterCards, extractVideos, facebookAdapter, fetchMetadata, fetchPage, instagramAdapter, normalizeMetadata, normalizeUrl, parseMetadata, parseMetadataAsync, pinterestAdapter, redditAdapter, registerGlobalPlugin, resolveCanonicalUrl, resolveRedirects, resolveUrl, scoreImages, tiktokAdapter, twitterAdapter, validateUrl, youtubeAdapter };
package/dist/index.d.ts CHANGED
@@ -105,7 +105,11 @@ interface ExtractionDiagnostics {
105
105
  contentType?: string;
106
106
  redirects: RedirectEntry[];
107
107
  sourcesUsed: string[];
108
+ adapterUsed?: string;
109
+ sourcePriority?: string[];
110
+ extractionMethod?: string;
108
111
  warnings: string[];
112
+ fallbacksAttempted?: ExtractionFallbackAttempt[];
109
113
  trace: string[];
110
114
  adapter?: {
111
115
  matched: boolean;
@@ -113,10 +117,43 @@ interface ExtractionDiagnostics {
113
117
  confidence?: number;
114
118
  };
115
119
  errors?: string[];
120
+ retryInfo?: ExtractionRetryInfo;
121
+ providerDiagnostics?: ProviderDiagnostics;
116
122
  selectedImageReason?: string;
123
+ confidenceBreakdown?: ConfidenceBreakdown;
117
124
  fetchDurationMs?: number;
118
125
  extractedAt: string;
119
126
  }
127
+ interface ExtractionFallbackAttempt {
128
+ method: string;
129
+ url?: string;
130
+ ok: boolean;
131
+ statusCode?: number;
132
+ blocked?: boolean;
133
+ error?: string;
134
+ retryAfter?: string;
135
+ }
136
+ interface ExtractionRetryInfo {
137
+ retryable: boolean;
138
+ reason?: string;
139
+ retryAfter?: string;
140
+ retryAfterMs?: number;
141
+ attempts?: number;
142
+ }
143
+ interface ProviderDiagnostics {
144
+ platform: string;
145
+ blocked: boolean;
146
+ statusCode?: number;
147
+ reason?: "provider_verification_required" | "provider_blocked_request" | string;
148
+ suggestedAction?: "retry_on_different_host_or_use_supported_proxy" | string;
149
+ }
150
+ interface ConfidenceBreakdown {
151
+ title: number;
152
+ description: number;
153
+ image: number;
154
+ structuredData: number;
155
+ adapter: number;
156
+ }
120
157
  interface UnifiedMetadata {
121
158
  ok: boolean;
122
159
  url: string;
@@ -124,6 +161,7 @@ interface UnifiedMetadata {
124
161
  type: MetadataType;
125
162
  title?: string;
126
163
  description?: string;
164
+ publishDate?: string;
127
165
  siteName?: string;
128
166
  canonicalUrl?: string;
129
167
  confidence: number;
@@ -406,6 +444,7 @@ interface ReliabilityInput {
406
444
  warnings: string[];
407
445
  }
408
446
  declare function calculateConfidence(input: ConfidenceEngineInput): number;
447
+ declare function calculateConfidenceBreakdown(input: ConfidenceEngineInput): ConfidenceBreakdown;
409
448
  declare function calculateCompleteness(input: CompletenessInput): number;
410
449
  declare function calculateReliability(input: ReliabilityInput): number;
411
450
 
@@ -490,4 +529,4 @@ interface MetaNovaRegistry {
490
529
  declare function registerGlobalPlugin(plugin: MetaNovaPlugin): void;
491
530
  declare function createRegistry(options?: ParseMetadataOptions): MetaNovaRegistry;
492
531
 
493
- export { type AdapterContext, type AdapterExtractionResult, type AdapterRawData, type ApplicationMetadata, type ArticleMetadata, type CompletenessInput, type ConfidenceEngineInput, type CustomExtractor, DEFAULT_ACCEPT, DEFAULT_ACCEPT_ENCODING, DEFAULT_ACCEPT_LANGUAGE, DEFAULT_BROWSER_USER_AGENT, type EmbeddedDataItem, type EmbeddedDataMetadata, type Entity, type ExtractionDiagnostics, type ExtractorContext, type FetchMetadataOptions, type FetchedPage, type HtmlMetadata, type ImageScorer, type ImageScoringContext, type JsonLdMetadata, type JsonLdNode, type MediaAsset, type MediaDiscoveryResult, type MediaKind, MetaNova, type MetaNovaCache, type MetaNovaCacheEntry, type MetaNovaPlugin, type MetaNovaPluginApi, type MetaNovaRegistry, type MetadataSource, type MetadataSourceAttribution, type MetadataType, type OEmbedData, type OEmbedLink, type OEmbedMetadata, type OpenGraphMetadata, type ParseMetadataOptions, type PlaylistMetadata, type PlaylistVideo, type PluginExtractionResult, type PreviewCard, type ProductMetadata, type RawMetadataSources, type RedirectEntry, type RedirectResolution, type ReliabilityInput, SecurityError, type SiteAdapter, type TwitterMetadata, type UnifiedMetadata, type VideoMetadata, addWarning, assertSafeRequestUrl, behanceAdapter, calculateCompleteness, calculateConfidence, calculateReliability, createDiagnostics, createPreviewCard, createRegistry, MetaNova as default, defaultAdapters, detectShortUrl, discoverMedia, extractAudio, extractEmbeddedData, extractHtmlMetadata, extractImages, extractJsonLd, extractOEmbed, extractOpenGraph, extractTwitterCards, extractVideos, facebookAdapter, fetchMetadata, fetchPage, instagramAdapter, normalizeMetadata, normalizeUrl, parseMetadata, parseMetadataAsync, pinterestAdapter, redditAdapter, registerGlobalPlugin, resolveCanonicalUrl, resolveRedirects, resolveUrl, scoreImages, tiktokAdapter, twitterAdapter, validateUrl, youtubeAdapter };
532
+ export { type AdapterContext, type AdapterExtractionResult, type AdapterRawData, type ApplicationMetadata, type ArticleMetadata, type CompletenessInput, type ConfidenceBreakdown, type ConfidenceEngineInput, type CustomExtractor, DEFAULT_ACCEPT, DEFAULT_ACCEPT_ENCODING, DEFAULT_ACCEPT_LANGUAGE, DEFAULT_BROWSER_USER_AGENT, type EmbeddedDataItem, type EmbeddedDataMetadata, type Entity, type ExtractionDiagnostics, type ExtractionFallbackAttempt, type ExtractionRetryInfo, type ExtractorContext, type FetchMetadataOptions, type FetchedPage, type HtmlMetadata, type ImageScorer, type ImageScoringContext, type JsonLdMetadata, type JsonLdNode, type MediaAsset, type MediaDiscoveryResult, type MediaKind, MetaNova, type MetaNovaCache, type MetaNovaCacheEntry, type MetaNovaPlugin, type MetaNovaPluginApi, type MetaNovaRegistry, type MetadataSource, type MetadataSourceAttribution, type MetadataType, type OEmbedData, type OEmbedLink, type OEmbedMetadata, type OpenGraphMetadata, type ParseMetadataOptions, type PlaylistMetadata, type PlaylistVideo, type PluginExtractionResult, type PreviewCard, type ProductMetadata, type ProviderDiagnostics, type RawMetadataSources, type RedirectEntry, type RedirectResolution, type ReliabilityInput, SecurityError, type SiteAdapter, type TwitterMetadata, type UnifiedMetadata, type VideoMetadata, addWarning, assertSafeRequestUrl, behanceAdapter, calculateCompleteness, calculateConfidence, calculateConfidenceBreakdown, calculateReliability, createDiagnostics, createPreviewCard, createRegistry, MetaNova as default, defaultAdapters, detectShortUrl, discoverMedia, extractAudio, extractEmbeddedData, extractHtmlMetadata, extractImages, extractJsonLd, extractOEmbed, extractOpenGraph, extractTwitterCards, extractVideos, facebookAdapter, fetchMetadata, fetchPage, instagramAdapter, normalizeMetadata, normalizeUrl, parseMetadata, parseMetadataAsync, pinterestAdapter, redditAdapter, registerGlobalPlugin, resolveCanonicalUrl, resolveRedirects, resolveUrl, scoreImages, tiktokAdapter, twitterAdapter, validateUrl, youtubeAdapter };