geo-semantic-layer 2.0.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.
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Core configuration types for Semantic Layer
3
+ * @module types/config
4
+ */
5
+ /**
6
+ * Supported entity types for the root identity
7
+ */
8
+ type IdentityType = 'Organization' | 'Person';
9
+ /**
10
+ * Contact type for Schema.org ContactPoint
11
+ */
12
+ type ContactType = 'customer service' | 'technical support' | 'sales' | 'billing';
13
+ /**
14
+ * Content density levels for GEO optimization
15
+ */
16
+ type ContentDensity = 'high' | 'medium' | 'low';
17
+ /**
18
+ * Cache strategy options
19
+ */
20
+ type CacheStrategy = 'memory' | 'local-storage' | 'redis';
21
+ /**
22
+ * Postal address structure (Schema.org PostalAddress)
23
+ */
24
+ interface PostalAddress {
25
+ '@type'?: 'PostalAddress';
26
+ streetAddress?: string;
27
+ addressLocality?: string;
28
+ addressRegion?: string;
29
+ postalCode?: string;
30
+ addressCountry?: string;
31
+ }
32
+ /**
33
+ * Contact point structure (Schema.org ContactPoint)
34
+ */
35
+ interface ContactPoint {
36
+ '@type'?: 'ContactPoint';
37
+ telephone?: string;
38
+ email?: string;
39
+ contactType?: ContactType;
40
+ areaServed?: string;
41
+ availableLanguage?: string[];
42
+ }
43
+ /**
44
+ * Identity configuration for Organization or Person
45
+ */
46
+ interface IdentityConfig {
47
+ type: IdentityType;
48
+ name: string;
49
+ alternateName?: string;
50
+ description?: string;
51
+ url?: string;
52
+ logoUrl?: string;
53
+ imageUrl?: string;
54
+ /**
55
+ * Critical for entity disambiguation in AI systems
56
+ * Should include: social profiles, Wikidata ID, Wikipedia URL, etc.
57
+ */
58
+ sameAs: string[];
59
+ email?: string;
60
+ telephone?: string;
61
+ address?: PostalAddress;
62
+ contactPoint?: ContactPoint;
63
+ foundingDate?: string;
64
+ founder?: string[];
65
+ jobTitle?: string;
66
+ worksFor?: string;
67
+ }
68
+ /**
69
+ * GEO (Generative Engine Optimization) configuration
70
+ */
71
+ interface GeoConfig {
72
+ /**
73
+ * Validate citations before rendering to prevent hallucinations
74
+ */
75
+ enableHallucinationGuard: boolean;
76
+ /**
77
+ * Content density for token optimization
78
+ */
79
+ contentDensity: ContentDensity;
80
+ /**
81
+ * Auto-inject ClaimReview schemas for facts
82
+ */
83
+ enableCitations: boolean;
84
+ /**
85
+ * AI-powered entity extraction and linking
86
+ */
87
+ autoDetectEntities: boolean;
88
+ }
89
+ /**
90
+ * Cache configuration
91
+ */
92
+ interface CacheConfig {
93
+ strategy: CacheStrategy;
94
+ ttl: number;
95
+ }
96
+ /**
97
+ * Plugin interface for extensibility
98
+ */
99
+ interface SemanticPlugin {
100
+ name: string;
101
+ setup: (config: SemanticConfig) => {
102
+ onSchemaGenerated?: (schema: Record<string, unknown>) => void;
103
+ onValidationError?: (error: Error) => void;
104
+ };
105
+ }
106
+ /**
107
+ * Locale-specific identity configuration
108
+ */
109
+ interface LocaleConfig {
110
+ identity: Partial<IdentityConfig>;
111
+ }
112
+ /**
113
+ * Main semantic layer configuration
114
+ */
115
+ interface SemanticConfig {
116
+ /**
117
+ * Base URL of the website
118
+ */
119
+ siteUrl: string;
120
+ /**
121
+ * Default locale (e.g., 'en-US', 'es-ES')
122
+ */
123
+ defaultLocale: string;
124
+ /**
125
+ * Root identity (Organization or Person)
126
+ */
127
+ identity: IdentityConfig;
128
+ /**
129
+ * GEO optimization settings
130
+ */
131
+ geo?: GeoConfig;
132
+ /**
133
+ * Cache configuration
134
+ */
135
+ cache?: CacheConfig;
136
+ /**
137
+ * Multi-language support
138
+ */
139
+ locales?: Record<string, LocaleConfig>;
140
+ /**
141
+ * Auto-generate hreflang tags
142
+ */
143
+ autoHreflang?: boolean;
144
+ /**
145
+ * Registered plugins
146
+ */
147
+ plugins?: SemanticPlugin[];
148
+ }
149
+
150
+ export type { ContactType as C, GeoConfig as G, IdentityType as I, LocaleConfig as L, PostalAddress as P, SemanticPlugin as S, ContentDensity as a, CacheStrategy as b, ContactPoint as c, IdentityConfig as d, CacheConfig as e, SemanticConfig as f };