@archangel70/cosmo 1.10.0 → 1.11.0

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +26 -3
  3. package/docs/ARCHITECTURE.md +3 -0
  4. package/docs/DELIVERY.md +2 -1
  5. package/docs/ENTITY-MAP.md +87 -0
  6. package/docs/ROADMAP.md +9 -0
  7. package/package.json +5 -2
  8. package/packages/cli/bin/cosmo.mjs +86 -3
  9. package/packages/cli/lib/adoption.mjs +3 -0
  10. package/packages/cli/lib/audit.mjs +16 -0
  11. package/packages/cli/lib/browser-audit.mjs +1 -0
  12. package/packages/cli/lib/delivery.mjs +3 -2
  13. package/packages/cli/lib/entity-map.mjs +408 -0
  14. package/packages/cli/lib/integrity.mjs +6 -0
  15. package/packages/cli/lib/project.mjs +2 -0
  16. package/packages/cli/lib/status.mjs +3 -1
  17. package/plugins/agent-skills/cosmo/.cosmo-agent.json +1 -1
  18. package/plugins/agent-skills/cosmo/SKILL.md +2 -2
  19. package/plugins/antigravity/cosmo.md +2 -1
  20. package/plugins/claude-code/cosmo/.claude-plugin/plugin.json +1 -1
  21. package/plugins/claude-code/cosmo/agents/cosmo.md +2 -0
  22. package/plugins/claude-code/cosmo/skills/cosmo/SKILL.md +4 -3
  23. package/templates/astro-site/.agents/skills/cosmo/SKILL.md +3 -1
  24. package/templates/astro-site/.cosmo/capabilities/registry.json +2 -1
  25. package/templates/astro-site/.cosmo/entities/candidates.json +5 -0
  26. package/templates/astro-site/.cosmo/entities/config.json +28 -0
  27. package/templates/astro-site/.env.example +6 -0
  28. package/templates/astro-site/AGENTS.md +3 -2
  29. package/templates/astro-site/CLAUDE.md +3 -2
  30. package/templates/astro-site/astro.config.mjs +5 -1
  31. package/templates/astro-site/package.json +1 -1
  32. package/templates/astro-site/src/layouts/BaseLayout.astro +3 -0
  33. package/templates/astro-site/src/pages/robots.txt.ts +2 -1
@@ -0,0 +1,408 @@
1
+ import crypto from 'node:crypto';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import matter from 'gray-matter';
5
+ import { readProject, slugify, writeJson } from './project.mjs';
6
+
7
+ const SPEC = 'https://entitymap.org/spec/v1.0';
8
+ const TYPES = new Set(['Concept', 'ProprietaryTerm', 'Methodology', 'Metric', 'Taxonomy', 'Person', 'Organization', 'SoftwareProduct', 'PhysicalProduct', 'Service', 'Platform', 'Place', 'Event', 'Standard', 'Regulation']);
9
+ const PREDICATES = new Set(['INSTANCE_OF', 'PART_OF', 'INCLUDES', 'DEPENDS_ON', 'REQUIRES', 'MEASURES', 'PRODUCED_BY', 'REGULATED_BY', 'AUTHORED_BY', 'AFFILIATED_WITH', 'COVERS', 'RELATES_TO', 'PRECEDES', 'ENABLES', 'PREVENTS', 'CONFLICTS_WITH', 'DESCRIBED_BY', 'OFFERS', 'IMPROVES', 'DEGRADES', 'LEADS_TO', 'SUITED_FOR', 'TARGETS', 'ACHIEVES']);
10
+ const TIER_THREE = new Set(['IMPROVES', 'DEGRADES', 'LEADS_TO', 'SUITED_FOR', 'TARGETS', 'ACHIEVES']);
11
+
12
+ export const DEFAULT_ENTITY_MAP_CONFIG = {
13
+ version: 1,
14
+ enabled: false,
15
+ includeNoindex: false,
16
+ verificationStatus: 'generator-draft',
17
+ review: { reviewedBy: null, reviewedAt: null },
18
+ approvedMatches: [],
19
+ providers: {
20
+ wikidata: { enabled: true },
21
+ googleKnowledgeGraph: { enabled: false, apiKeyEnv: 'COSMO_GOOGLE_KG_API_KEY' },
22
+ googlePlaces: { enabled: false, apiKeyEnv: 'COSMO_GOOGLE_PLACES_API_KEY' },
23
+ textRazor: { enabled: false, apiKeyEnv: 'COSMO_TEXTRAZOR_API_KEY' },
24
+ },
25
+ };
26
+
27
+ function readJson(file, label) {
28
+ if (!fs.existsSync(file)) throw new Error(`${label} not found: ${file}`);
29
+ try { return JSON.parse(fs.readFileSync(file, 'utf8')); }
30
+ catch { throw new Error(`${label} is not valid JSON: ${file}`); }
31
+ }
32
+
33
+ function configFile(projectDir) {
34
+ return path.join(projectDir, '.cosmo', 'entities', 'config.json');
35
+ }
36
+
37
+ function candidatesFile(projectDir) {
38
+ return path.join(projectDir, '.cosmo', 'entities', 'candidates.json');
39
+ }
40
+
41
+ export function readEntityMapConfig(projectDir, { required = true } = {}) {
42
+ readProject(projectDir);
43
+ const file = configFile(projectDir);
44
+ if (!fs.existsSync(file)) {
45
+ if (!required) return { file, data: null };
46
+ throw new Error(`EntityMap configuration not found: ${file}. Run cosmo entity init first.`);
47
+ }
48
+ const data = readJson(file, 'EntityMap configuration');
49
+ if (data.version !== 1) throw new Error('EntityMap configuration version must be 1.');
50
+ if (typeof data.enabled !== 'boolean') throw new Error('EntityMap enabled must be true or false.');
51
+ if (!['generator-draft', 'self-declared'].includes(data.verificationStatus)) throw new Error('EntityMap verificationStatus must be generator-draft or self-declared.');
52
+ if (data.verificationStatus === 'self-declared' && (!data.review?.reviewedBy || !data.review?.reviewedAt)) throw new Error('A self-declared EntityMap requires an explicit human review record.');
53
+ if (!Array.isArray(data.approvedMatches)) throw new Error('EntityMap approvedMatches must be an array.');
54
+ return { file, data };
55
+ }
56
+
57
+ function updateCapability(projectDir, enabled) {
58
+ const file = path.join(projectDir, '.cosmo', 'capabilities', 'registry.json');
59
+ if (!fs.existsSync(file)) return;
60
+ const registry = readJson(file, 'Capability registry');
61
+ const capability = { id: 'entity-map', version: 1, status: enabled ? 'active' : 'optional', stages: ['brand', 'research', 'plan', 'generate', 'qa', 'release'] };
62
+ const index = registry.capabilities.findIndex((item) => item.id === capability.id);
63
+ if (index >= 0) registry.capabilities[index] = capability;
64
+ else registry.capabilities.push(capability);
65
+ writeJson(file, registry);
66
+ }
67
+
68
+ export function scaffoldEntityMap(projectDir, { enabled = false, replace = false } = {}) {
69
+ readProject(projectDir);
70
+ const file = configFile(projectDir);
71
+ if (fs.existsSync(file) && !replace) {
72
+ const current = readEntityMapConfig(projectDir).data;
73
+ if (enabled && !current.enabled) {
74
+ current.enabled = true;
75
+ writeJson(file, current);
76
+ updateCapability(projectDir, true);
77
+ }
78
+ return { file, data: current, created: false };
79
+ }
80
+ const data = structuredClone(DEFAULT_ENTITY_MAP_CONFIG);
81
+ data.enabled = Boolean(enabled);
82
+ writeJson(file, data);
83
+ writeJson(candidatesFile(projectDir), { version: 1, updatedAt: null, candidates: [] });
84
+ updateCapability(projectDir, data.enabled);
85
+ return { file, data, created: true };
86
+ }
87
+
88
+ function walkMarkdown(directory) {
89
+ if (!fs.existsSync(directory)) return [];
90
+ return fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
91
+ const file = path.join(directory, entry.name);
92
+ return entry.isDirectory() ? walkMarkdown(file) : file.endsWith('.md') ? [file] : [];
93
+ });
94
+ }
95
+
96
+ function contentPages(projectDir, includeNoindex) {
97
+ const root = path.join(projectDir, 'src', 'content', 'pages');
98
+ return walkMarkdown(root).map((file) => {
99
+ const parsed = matter(fs.readFileSync(file, 'utf8'));
100
+ return { id: slugify(path.relative(root, file).replace(/\.md$/, '')), file, data: parsed.data };
101
+ }).filter((page) => page.data.path && page.data.title && page.data.description && (includeNoindex || page.data.indexability !== 'noindex'));
102
+ }
103
+
104
+ function strings(value, key = '') {
105
+ if (typeof value === 'string') return ['href', 'label', 'heading', 'eyebrow', 'title'].includes(key) ? [] : [value.trim()].filter(Boolean);
106
+ if (Array.isArray(value)) return value.flatMap((item) => strings(item, key));
107
+ if (value && typeof value === 'object') return Object.entries(value).flatMap(([childKey, item]) => strings(item, childKey));
108
+ return [];
109
+ }
110
+
111
+ function chunkText(page) {
112
+ const candidates = [page.data.answer?.shortAnswer, ...strings(page.data.sections ?? []), page.data.description].filter((value) => typeof value === 'string' && value.trim());
113
+ const selected = candidates.find((value) => value.length >= 40 && value.length <= 600) ?? page.data.description;
114
+ return selected.trim();
115
+ }
116
+
117
+ function entityIdentity(page, publisher) {
118
+ if ((['home', 'standard'].includes(page.data.pageType) && page.data.path === '/') || page.data.schemaType === 'AboutPage') {
119
+ return { entityId: publisher.id, '@type': 'Organization', name: publisher.officialName, description: publisher.descriptions.short };
120
+ }
121
+ if (page.data.pageType === 'service') {
122
+ const name = page.data.service?.name ?? page.data.primaryTopic;
123
+ return { entityId: `service-${slugify(name)}`, '@type': 'Service', name, description: page.data.description };
124
+ }
125
+ if (page.data.pageType === 'location') {
126
+ const name = page.data.location?.name ?? page.data.primaryTopic;
127
+ return { entityId: `place-${slugify(name)}`, '@type': 'Place', name, description: page.data.description };
128
+ }
129
+ const name = page.data.primaryTopic || page.data.h1;
130
+ return { entityId: `topic-${slugify(name)}`, '@type': 'Concept', name, description: page.data.description };
131
+ }
132
+
133
+ function publicSameAs(config, entityId) {
134
+ const match = config.approvedMatches.find((item) => item.entityId === entityId && item.status === 'accepted' && /^https:\/\/(?:www\.)?(?:wikidata\.org\/wiki\/Q\d+|[^/]*wikipedia\.org\/wiki\/)/i.test(item.uri ?? ''));
135
+ return match?.uri ?? null;
136
+ }
137
+
138
+ function stableGenerated(previous, next) {
139
+ if (!previous) return new Date().toISOString();
140
+ const left = { ...previous, generated: null };
141
+ const right = { ...next, generated: null };
142
+ return JSON.stringify(left) === JSON.stringify(right) ? previous.generated : new Date().toISOString();
143
+ }
144
+
145
+ export function compileEntityMap(projectDir) {
146
+ const project = readProject(projectDir).data;
147
+ const config = readEntityMapConfig(projectDir).data;
148
+ if (!config.enabled) throw new Error('EntityMap is disabled for this project. Run cosmo entity init . --enable.');
149
+ const publisher = readJson(path.join(projectDir, '.cosmo', 'brand', 'entity-canon.json'), 'Entity Canon');
150
+ const pages = contentPages(projectDir, config.includeNoindex === true);
151
+ const grouped = new Map();
152
+ for (const page of pages) {
153
+ const identity = entityIdentity(page, publisher);
154
+ const sourceUrl = new URL(page.data.path, project.site).toString();
155
+ const chunk = { chunkId: `c-${page.id}`, text: chunkText(page), sourceUrl, pageTitle: page.data.title, publisher: publisher.officialName };
156
+ if (page.data.editorial?.updatedAt || page.data.editorial?.publishedAt) chunk.retrieved = page.data.editorial.updatedAt ?? page.data.editorial.publishedAt;
157
+ const current = grouped.get(identity.entityId) ?? { ...identity, hasChunks: [] };
158
+ if (!current.hasChunks.some((item) => item.chunkId === chunk.chunkId) && current.hasChunks.length < 5) current.hasChunks.push(chunk);
159
+ grouped.set(identity.entityId, current);
160
+ }
161
+ const entities = [...grouped.values()];
162
+ const organization = entities.find((item) => item.entityId === publisher.id);
163
+ if (organization) {
164
+ const offered = entities.filter((item) => item['@type'] === 'Service');
165
+ if (offered.length) organization.relations = offered.map((item) => ({ predicate: 'OFFERS', targetId: item.entityId, targetName: item.name }));
166
+ }
167
+ for (const entity of entities) {
168
+ const sameAs = publicSameAs(config, entity.entityId);
169
+ if (sameAs) entity.sameAs = sameAs;
170
+ }
171
+ const rootSameAs = publicSameAs(config, publisher.id);
172
+ const map = {
173
+ version: '1.0', schema: SPEC,
174
+ publisher: { name: publisher.officialName, url: publisher.domain || project.site, ...(rootSameAs ? { sameAs: rootSameAs } : {}) },
175
+ generated: null,
176
+ entities,
177
+ profile: 'core',
178
+ verificationStatus: config.verificationStatus,
179
+ };
180
+ const output = path.join(projectDir, 'public', 'entitymap.json');
181
+ let previous = null;
182
+ try { previous = JSON.parse(fs.readFileSync(output, 'utf8')); } catch {}
183
+ map.generated = stableGenerated(previous, map);
184
+ return { map, config, pages };
185
+ }
186
+
187
+ function issue(findings, severity, code, message, fix) {
188
+ findings.push({ severity, code, message, fix });
189
+ }
190
+
191
+ export function evaluateEntityMap(projectDir, compiled = null) {
192
+ const config = readEntityMapConfig(projectDir, { required: false }).data;
193
+ if (!config || !config.enabled) return { version: 1, passed: true, enabled: false, checkedAt: new Date().toISOString(), summary: { entities: 0, chunks: 0, blocking: 0, warnings: 0 }, findings: [] };
194
+ const { map, pages } = compiled ?? compileEntityMap(projectDir);
195
+ const findings = [];
196
+ if (map.version !== '1.0' || map.schema !== SPEC) issue(findings, 'blocking', 'invalid-root', 'The EntityMap root version or schema is invalid.', 'Restore the v1.0 root contract.');
197
+ const generatedAt = Date.parse(map.generated);
198
+ if (!Number.isFinite(generatedAt)) issue(findings, 'blocking', 'generated-invalid', 'EntityMap generated must be an ISO 8601 timestamp.', 'Rebuild the EntityMap.');
199
+ else if (Date.now() - generatedAt > 30 * 24 * 60 * 60 * 1000) issue(findings, 'warning', 'entitymap-stale', 'The EntityMap is more than 30 days old.', 'Rebuild and review it against current site content.');
200
+ if (!map.publisher?.name || !map.publisher?.url) issue(findings, 'blocking', 'publisher-missing', 'Publisher name and URL are required.', 'Complete the Entity Canon before publishing.');
201
+ try { new URL(map.publisher.url); } catch { issue(findings, 'blocking', 'publisher-url-invalid', 'Publisher URL is invalid.', 'Set the production canonical URL.'); }
202
+ if (/example\.com/i.test(map.publisher?.url ?? '')) issue(findings, 'blocking', 'publisher-placeholder', 'Publisher URL is still a placeholder.', 'Set the production canonical URL.');
203
+ if (!map.entities.length) issue(findings, 'blocking', 'no-entities', 'No eligible public pages produced an entity.', 'Complete at least one public, indexable page or explicitly allow noindex sources.');
204
+ const ids = new Set();
205
+ for (const entity of map.entities) {
206
+ if (ids.has(entity.entityId)) issue(findings, 'blocking', 'duplicate-entity-id', `Duplicate entity id ${entity.entityId}.`, 'Give every entity a stable unique id.');
207
+ ids.add(entity.entityId);
208
+ if (!TYPES.has(entity['@type'])) issue(findings, 'blocking', 'invalid-entity-type', `${entity.entityId} has an unsupported type.`, 'Use an EntityMap v1.0 core type.');
209
+ if (!entity.name || !entity.description) issue(findings, 'blocking', 'entity-incomplete', `${entity.entityId} lacks a name or description.`, 'Complete its approved canonical identity.');
210
+ if (!Array.isArray(entity.hasChunks) || entity.hasChunks.length < 1 || entity.hasChunks.length > 5) issue(findings, 'blocking', 'chunk-count', `${entity.entityId} must have 1–5 chunks.`, 'Select concise passages from public source pages.');
211
+ for (const chunk of entity.hasChunks ?? []) {
212
+ if (!chunk.text || chunk.text.length > 600) issue(findings, 'blocking', 'chunk-length', `${chunk.chunkId} must contain 1–600 characters.`, 'Use a concise extractive passage.');
213
+ if (chunk.publisher !== map.publisher.name) issue(findings, 'blocking', 'publisher-mismatch', `${chunk.chunkId} publisher does not exactly match the root publisher.`, 'Use the canonical publisher name verbatim.');
214
+ if (!pages.some((page) => new URL(page.data.path, map.publisher.url).toString() === chunk.sourceUrl)) issue(findings, 'blocking', 'unknown-source', `${chunk.chunkId} does not resolve to an eligible project page.`, 'Use a canonical public page URL.');
215
+ }
216
+ if (entity['@type'] === 'Concept' && !entity.sameAs) issue(findings, 'warning', 'concept-sameas-missing', `${entity.name} has no approved Wikidata or Wikipedia match.`, 'Review an enrichment candidate; do not guess a match.');
217
+ for (const relation of entity.relations ?? []) {
218
+ if (!PREDICATES.has(relation.predicate)) issue(findings, 'blocking', 'invalid-predicate', `${entity.entityId} uses unknown predicate ${relation.predicate}.`, 'Use the v1.0 predicate vocabulary.');
219
+ if (!relation.targetName) issue(findings, 'blocking', 'relation-target-missing', `${entity.entityId} has a relation without targetName.`, 'Add the human-readable target name.');
220
+ if (relation.targetId && !ids.has(relation.targetId) && !map.entities.some((item) => item.entityId === relation.targetId)) issue(findings, 'blocking', 'relation-target-unknown', `${entity.entityId} points to unknown target ${relation.targetId}.`, 'Use a known internal entity id or an external target URI.');
221
+ if (TIER_THREE.has(relation.predicate) && !['declared', 'inferred'].includes(relation.confidence)) issue(findings, 'blocking', 'relation-confidence-missing', `${relation.predicate} requires confidence.`, 'Record declared or inferred confidence.');
222
+ }
223
+ }
224
+ if (map.verificationStatus === 'generator-draft') issue(findings, 'warning', 'human-review-needed', 'The generated EntityMap has not been explicitly reviewed.', 'Review it before changing status to self-declared.');
225
+ return {
226
+ version: 1, passed: findings.every((item) => item.severity !== 'blocking'), enabled: true, checkedAt: new Date().toISOString(),
227
+ summary: { entities: map.entities.length, chunks: map.entities.reduce((count, item) => count + item.hasChunks.length, 0), blocking: findings.filter((item) => item.severity === 'blocking').length, warnings: findings.filter((item) => item.severity === 'warning').length },
228
+ findings,
229
+ };
230
+ }
231
+
232
+ function escapeHtml(value) {
233
+ return String(value).replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('"', '&quot;').replaceAll("'", '&#39;');
234
+ }
235
+
236
+ function renderEntityMapHtml(map) {
237
+ const entities = map.entities.map((entity) => {
238
+ const relations = (entity.relations ?? []).map((relation) => `<li>${escapeHtml(relation.predicate)} → ${relation.targetId ? `<a href="#${escapeHtml(relation.targetId)}">${escapeHtml(relation.targetName)}</a>` : escapeHtml(relation.targetName)}</li>`).join('');
239
+ const chunks = entity.hasChunks.map((chunk) => `<blockquote data-publisher="${escapeHtml(chunk.publisher)}"><p>${escapeHtml(chunk.text)}</p><cite><a href="${escapeHtml(chunk.sourceUrl)}">${escapeHtml(chunk.pageTitle)}</a> — published by ${escapeHtml(chunk.publisher)}</cite></blockquote>`).join('\n');
240
+ const schemaTypes = { Concept: 'DefinedTerm', ProprietaryTerm: 'DefinedTerm', Methodology: 'HowTo', Metric: 'PropertyValue', Taxonomy: 'DefinedTermSet', Platform: 'SoftwareApplication', Standard: 'CreativeWork', Regulation: 'Legislation' };
241
+ const schema = { '@context': 'https://schema.org', '@type': schemaTypes[entity['@type']] ?? entity['@type'], name: entity.name, description: entity.description, url: entity.hasChunks[0].sourceUrl, ...(entity.sameAs ? { sameAs: entity.sameAs } : {}) };
242
+ return `<article id="${escapeHtml(entity.entityId)}"><h2>${escapeHtml(entity.name)}</h2><p>${escapeHtml(entity.description)}</p>${relations ? `<ul>${relations}</ul>` : ''}${chunks}<script type="application/ld+json">${JSON.stringify(schema).replaceAll('<', '\\u003c')}</script></article>`;
243
+ }).join('\n');
244
+ return `<!doctype html>\n<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>EntityMap — ${escapeHtml(map.publisher.name)}</title><meta name="description" content="AI-readable entity and evidence index for ${escapeHtml(map.publisher.name)}."><link rel="canonical" href="${escapeHtml(new URL('/entitymap.html', map.publisher.url).toString())}"><link rel="alternate" type="application/json" href="/entitymap.json"><style>body{font:16px/1.6 system-ui,sans-serif;max-width:72rem;margin:auto;padding:2rem}article{border-top:1px solid #ccc;padding:1rem 0}blockquote{border-left:3px solid #777;margin:1rem 0;padding-left:1rem}cite{display:block}</style></head><body><main><h1>EntityMap</h1><p>Published by ${escapeHtml(map.publisher.name)}. Generated ${escapeHtml(map.generated)}.</p>${entities}</main></body></html>\n`;
245
+ }
246
+
247
+ export function writeEntityMap(projectDir) {
248
+ const jsonFile = path.join(projectDir, 'public', 'entitymap.json');
249
+ const htmlFile = path.join(projectDir, 'public', 'entitymap.html');
250
+ const distJsonFile = path.join(projectDir, 'dist', 'entitymap.json');
251
+ const distHtmlFile = path.join(projectDir, 'dist', 'entitymap.html');
252
+ const reportFile = path.join(projectDir, '.cosmo', 'reports', 'entity-check.json');
253
+ const config = readEntityMapConfig(projectDir, { required: false }).data;
254
+ if (!config) {
255
+ const report = evaluateEntityMap(projectDir);
256
+ writeJson(reportFile, report);
257
+ return { report, jsonFile: null, htmlFile: null, reportFile };
258
+ }
259
+ if (!config.enabled) {
260
+ for (const file of [jsonFile, htmlFile, distJsonFile, distHtmlFile]) if (fs.existsSync(file)) fs.rmSync(file);
261
+ const report = evaluateEntityMap(projectDir);
262
+ writeJson(reportFile, report);
263
+ return { report, jsonFile: null, htmlFile: null, reportFile };
264
+ }
265
+ const compiled = compileEntityMap(projectDir);
266
+ const report = evaluateEntityMap(projectDir, compiled);
267
+ if (!report.passed) {
268
+ writeJson(reportFile, report);
269
+ return { report, jsonFile: null, htmlFile: null, reportFile };
270
+ }
271
+ const json = `${JSON.stringify(compiled.map, null, 2)}\n`;
272
+ const html = renderEntityMapHtml(compiled.map);
273
+ fs.mkdirSync(path.dirname(jsonFile), { recursive: true });
274
+ if (!fs.existsSync(jsonFile) || fs.readFileSync(jsonFile, 'utf8') !== json) fs.writeFileSync(jsonFile, json);
275
+ if (!fs.existsSync(htmlFile) || fs.readFileSync(htmlFile, 'utf8') !== html) fs.writeFileSync(htmlFile, html);
276
+ if (fs.existsSync(path.join(projectDir, 'dist'))) {
277
+ if (!fs.existsSync(distJsonFile) || fs.readFileSync(distJsonFile, 'utf8') !== json) fs.writeFileSync(distJsonFile, json);
278
+ if (!fs.existsSync(distHtmlFile) || fs.readFileSync(distHtmlFile, 'utf8') !== html) fs.writeFileSync(distHtmlFile, html);
279
+ }
280
+ writeJson(reportFile, report);
281
+ return { report, jsonFile, htmlFile, reportFile };
282
+ }
283
+
284
+ function candidateId(value) {
285
+ return `candidate-${crypto.createHash('sha256').update([value.provider, value.entityId, value.externalId, value.uri].join('|')).digest('hex').slice(0, 16)}`;
286
+ }
287
+
288
+ function entitySubjects(projectDir) {
289
+ const publisher = readJson(path.join(projectDir, '.cosmo', 'brand', 'entity-canon.json'), 'Entity Canon');
290
+ const config = readEntityMapConfig(projectDir).data;
291
+ const pages = contentPages(projectDir, config.includeNoindex === true);
292
+ const subjects = new Map([[publisher.id, { entityId: publisher.id, name: publisher.officialName, type: 'Organization' }]]);
293
+ for (const page of pages) {
294
+ const identity = entityIdentity(page, publisher);
295
+ subjects.set(identity.entityId, { entityId: identity.entityId, name: identity.name, type: identity['@type'] });
296
+ }
297
+ return { subjects: [...subjects.values()], pages, config };
298
+ }
299
+
300
+ async function enrichWikidata(subjects, fetchImpl) {
301
+ const values = [];
302
+ for (const subject of subjects) {
303
+ const url = new URL('https://www.wikidata.org/w/api.php');
304
+ for (const [key, value] of Object.entries({ action: 'wbsearchentities', search: subject.name, language: 'en', uselang: 'en', format: 'json', limit: '5', origin: '*' })) url.searchParams.set(key, value);
305
+ const response = await fetchImpl(url, { headers: { 'user-agent': 'Cosmo EntityMap Builder/1.0' } });
306
+ if (!response.ok) throw new Error(`Wikidata returned HTTP ${response.status}.`);
307
+ const body = await response.json();
308
+ for (const item of body.search ?? []) values.push({ provider: 'wikidata', entityId: subject.entityId, matchedName: item.label, externalId: item.id, uri: item.concepturi ?? `https://www.wikidata.org/wiki/${item.id}`, description: item.description ?? '', score: null });
309
+ }
310
+ return values;
311
+ }
312
+
313
+ async function enrichGoogleKnowledgeGraph(subjects, key, fetchImpl) {
314
+ const values = [];
315
+ for (const subject of subjects) {
316
+ const url = new URL('https://kgsearch.googleapis.com/v1/entities:search');
317
+ for (const [name, value] of Object.entries({ query: subject.name, limit: '5', indent: 'false', key })) url.searchParams.set(name, value);
318
+ const response = await fetchImpl(url);
319
+ if (!response.ok) throw new Error(`Google Knowledge Graph returned HTTP ${response.status}.`);
320
+ const body = await response.json();
321
+ for (const item of body.itemListElement ?? []) {
322
+ const result = item.result ?? {};
323
+ values.push({ provider: 'googleKnowledgeGraph', entityId: subject.entityId, matchedName: result.name, externalId: result['@id'], uri: result.detailedDescription?.url ?? result.url ?? null, description: result.description ?? '', score: item.resultScore ?? null });
324
+ }
325
+ }
326
+ return values;
327
+ }
328
+
329
+ async function enrichGooglePlaces(subjects, key, fetchImpl) {
330
+ const values = [];
331
+ for (const subject of subjects.filter((item) => ['Organization', 'Place'].includes(item.type))) {
332
+ const response = await fetchImpl('https://places.googleapis.com/v1/places:searchText', { method: 'POST', headers: { 'content-type': 'application/json', 'X-Goog-Api-Key': key, 'X-Goog-FieldMask': 'places.id,places.displayName,places.formattedAddress,places.primaryType,places.googleMapsUri,places.websiteUri' }, body: JSON.stringify({ textQuery: subject.name }) });
333
+ if (!response.ok) throw new Error(`Google Places returned HTTP ${response.status}.`);
334
+ const body = await response.json();
335
+ for (const item of body.places ?? []) values.push({ provider: 'googlePlaces', entityId: subject.entityId, matchedName: item.displayName?.text, externalId: item.id, uri: item.googleMapsUri ?? item.websiteUri ?? null, description: [item.primaryType, item.formattedAddress].filter(Boolean).join(' — '), score: null });
336
+ }
337
+ return values;
338
+ }
339
+
340
+ async function enrichTextRazor(subjects, pages, key, fetchImpl) {
341
+ const text = pages.flatMap((page) => [page.data.title, page.data.description, ...strings(page.data.sections ?? [])]).join('\n').slice(0, 200000);
342
+ const body = new URLSearchParams({ text, extractors: 'entities,topics' });
343
+ const response = await fetchImpl('https://api.textrazor.com/', { method: 'POST', headers: { 'x-textrazor-key': key, 'content-type': 'application/x-www-form-urlencoded' }, body });
344
+ if (!response.ok) throw new Error(`TextRazor returned HTTP ${response.status}.`);
345
+ const result = (await response.json()).response ?? {};
346
+ const values = [];
347
+ for (const item of [...(result.entities ?? []), ...(result.topics ?? [])]) {
348
+ const name = item.entityId ?? item.label ?? item.matchedText;
349
+ if (!name) continue;
350
+ const subject = subjects.find((candidate) => candidate.name.toLowerCase() === String(item.matchedText ?? name).toLowerCase());
351
+ values.push({ provider: 'textRazor', entityId: subject?.entityId ?? `topic-${slugify(name)}`, matchedName: name, externalId: item.wikidataId ?? item.entityId ?? String(item.id ?? name), uri: item.wikidataId ? `https://www.wikidata.org/wiki/${item.wikidataId}` : item.wikiLink ?? null, description: '', score: item.relevanceScore ?? item.score ?? item.confidenceScore ?? null });
352
+ }
353
+ return values;
354
+ }
355
+
356
+ export async function enrichEntityMap(projectDir, provider, { fetchImpl = fetch } = {}) {
357
+ const { subjects, pages, config } = entitySubjects(projectDir);
358
+ const providerConfig = config.providers?.[provider];
359
+ if (!providerConfig) throw new Error(`Unknown EntityMap provider: ${provider}`);
360
+ if (!providerConfig.enabled) throw new Error(`${provider} is disabled in .cosmo/entities/config.json.`);
361
+ const key = providerConfig.apiKeyEnv ? process.env[providerConfig.apiKeyEnv] : null;
362
+ if (providerConfig.apiKeyEnv && !key) throw new Error(`Missing ${providerConfig.apiKeyEnv}. Put it in a local environment file; never commit it.`);
363
+ let raw = [];
364
+ if (provider === 'wikidata') raw = await enrichWikidata(subjects, fetchImpl);
365
+ if (provider === 'googleKnowledgeGraph') raw = await enrichGoogleKnowledgeGraph(subjects, key, fetchImpl);
366
+ if (provider === 'googlePlaces') raw = await enrichGooglePlaces(subjects, key, fetchImpl);
367
+ if (provider === 'textRazor') raw = await enrichTextRazor(subjects, pages, key, fetchImpl);
368
+ const file = candidatesFile(projectDir);
369
+ const previous = fs.existsSync(file) ? readJson(file, 'EntityMap candidates') : { candidates: [] };
370
+ const statuses = new Map((previous.candidates ?? []).map((item) => [item.id, { status: item.status, reviewedBy: item.reviewedBy, reviewedAt: item.reviewedAt }]));
371
+ const retrievedAt = new Date().toISOString();
372
+ const additions = raw.filter((item) => item.matchedName && item.externalId).map((item) => {
373
+ const candidate = { ...item, id: candidateId(item), status: 'needs-review', retrievedAt };
374
+ return { ...candidate, ...(statuses.get(candidate.id) ?? {}) };
375
+ });
376
+ const retained = (previous.candidates ?? []).filter((item) => item.provider !== provider);
377
+ const data = { version: 1, updatedAt: retrievedAt, candidates: [...retained, ...additions] };
378
+ writeJson(file, data);
379
+ return { file, provider, candidates: additions };
380
+ }
381
+
382
+ export function acceptEntityCandidate(projectDir, id, reviewedBy) {
383
+ if (!reviewedBy) throw new Error('Candidate acceptance requires --by with the reviewer name.');
384
+ const file = candidatesFile(projectDir);
385
+ const data = readJson(file, 'EntityMap candidates');
386
+ const candidate = data.candidates.find((item) => item.id === id);
387
+ if (!candidate) throw new Error(`Unknown EntityMap candidate: ${id}`);
388
+ const reviewedAt = new Date().toISOString();
389
+ Object.assign(candidate, { status: 'accepted', reviewedBy, reviewedAt });
390
+ writeJson(file, data);
391
+ const config = readEntityMapConfig(projectDir).data;
392
+ config.approvedMatches = config.approvedMatches.filter((item) => !(item.entityId === candidate.entityId && item.provider === candidate.provider));
393
+ config.approvedMatches.push({ entityId: candidate.entityId, provider: candidate.provider, externalId: candidate.externalId, uri: candidate.uri, status: 'accepted', reviewedBy, reviewedAt });
394
+ writeJson(configFile(projectDir), config);
395
+ return candidate;
396
+ }
397
+
398
+ export function approveEntityMap(projectDir, reviewedBy) {
399
+ if (!reviewedBy) throw new Error('EntityMap approval requires --by with the reviewer name.');
400
+ const record = readEntityMapConfig(projectDir);
401
+ const report = evaluateEntityMap(projectDir);
402
+ if (!report.passed) throw new Error('EntityMap cannot be approved while blocking findings remain.');
403
+ record.data.verificationStatus = 'self-declared';
404
+ record.data.review = { reviewedBy, reviewedAt: new Date().toISOString() };
405
+ writeJson(record.file, record.data);
406
+ writeEntityMap(projectDir);
407
+ return record.data.review;
408
+ }
@@ -278,6 +278,7 @@ export function scaffoldIntegrity(projectDir, { replace = false } = {}) {
278
278
  { id: 'bounded-repair', version: 1, status: 'active', stages: ['generate', 'qa'] },
279
279
  { id: 'semantic-content-qa', version: 1, status: 'active', stages: ['qa'] },
280
280
  { id: 'noncommodity-gate', version: 1, status: 'active', stages: ['generate', 'qa'] },
281
+ { id: 'entity-map', version: 1, status: 'optional', stages: ['brand', 'research', 'plan', 'generate', 'qa', 'release'] },
281
282
  ],
282
283
  }],
283
284
  ['intelligence/selection.json', { version: 1, profile: 'lean', packs: [] }],
@@ -303,6 +304,11 @@ export function scaffoldIntegrity(projectDir, { replace = false } = {}) {
303
304
  sentenceStyle: [], preferredVocabulary: [], bannedVocabulary: [], examples: [], appliesTo: ['website'], exceptions: [],
304
305
  }],
305
306
  ['evidence.json', { version: 1, entityId, claims: [], proofs: [] }],
307
+ ['entities/config.json', {
308
+ version: 1, enabled: false, includeNoindex: false, verificationStatus: 'generator-draft', review: { reviewedBy: null, reviewedAt: null }, approvedMatches: [],
309
+ providers: { wikidata: { enabled: true }, googleKnowledgeGraph: { enabled: false, apiKeyEnv: 'COSMO_GOOGLE_KG_API_KEY' }, googlePlaces: { enabled: false, apiKeyEnv: 'COSMO_GOOGLE_PLACES_API_KEY' }, textRazor: { enabled: false, apiKeyEnv: 'COSMO_TEXTRAZOR_API_KEY' } },
310
+ }],
311
+ ['entities/candidates.json', { version: 1, updatedAt: null, candidates: [] }],
306
312
  ];
307
313
  const files = [];
308
314
  for (const [relative, value] of definitions) {
@@ -73,6 +73,8 @@ export function copyStarter(templateDir, targetDir) {
73
73
  || portable === '.cosmo/project.json'
74
74
  || portable === '.cosmo/build-plan.json'
75
75
  || portable === '.cosmo/evidence.json'
76
+ || portable === '.cosmo/entities'
77
+ || portable.startsWith('.cosmo/entities/')
76
78
  || portable === '.cosmo/brand'
77
79
  || portable.startsWith('.cosmo/brand/')
78
80
  || portable === '.cosmo/copy'
@@ -16,7 +16,8 @@ export function collectProjectStatus(projectDir) {
16
16
  const lock = readIntelligenceLock(projectDir).data;
17
17
  const plan = json(path.join(projectDir, '.cosmo', 'build-plan.json'));
18
18
  const progress = json(path.join(projectDir, '.cosmo', 'progress.json'));
19
- const reportNames = ['integrity-check', 'content-check', 'intelligence-check', 'site-check', 'browser-check', ...(fs.existsSync(path.join(projectDir, '.cosmo', 'copy', 'strategy.json')) ? ['copy-check'] : [])];
19
+ const entityMapEnabled = json(path.join(projectDir, '.cosmo', 'entities', 'config.json'))?.enabled === true;
20
+ const reportNames = ['integrity-check', 'content-check', 'intelligence-check', 'site-check', 'browser-check', ...(fs.existsSync(path.join(projectDir, '.cosmo', 'copy', 'strategy.json')) ? ['copy-check'] : []), ...(entityMapEnabled ? ['entity-check'] : [])];
20
21
  const qa = Object.fromEntries(reportNames.map((name) => {
21
22
  const report = json(path.join(projectDir, '.cosmo', 'reports', `${name}.json`));
22
23
  return [name, report ? { passed: report.passed, checkedAt: report.checkedAt ?? report.auditedAt ?? null } : null];
@@ -40,6 +41,7 @@ export function collectProjectStatus(projectDir) {
40
41
  intelligence: { profile: intelligence.data.profile, packs: intelligence.data.packs, installedPackages: lock.packages.map((item) => ({ id: item.id, version: item.version })) },
41
42
  plan: plan ? { version: plan.version, approved: plan.approved, pages: plan.pages?.length ?? 0 } : null,
42
43
  generation: progress ? { complete: progress.complete, pages: Array.isArray(progress.pages) ? progress.pages.length : Object.keys(progress.pages ?? {}).length } : null,
44
+ entityMap: { enabled: entityMapEnabled },
43
45
  qa, release,
44
46
  deployment: deployment ? { provider: deployment.provider, latest: latestDeployment } : null,
45
47
  };
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "cosmo",
3
- "version": "1.10.0"
3
+ "version": "1.11.0"
4
4
  }
@@ -52,7 +52,7 @@ Inventory the existing Astro configuration, routes, content, source, public file
52
52
 
53
53
  ## Create a new site
54
54
 
55
- Collect the target, brand, known URL, business, audience, goal, genuine location scope, justified page count, capability profile, and design mode. Recommend `growth-site` for a typical lead-generation site; use a specialist profile only when the project warrants it. Confirm the summary before initialization, then run `cosmo init`, install dependencies, diagnose the project, start the workflow, and conduct brand and copy discovery.
55
+ Collect the target, brand, known URL, business, audience, goal, genuine location scope, justified page count, capability profile, design mode, and whether the user wants an AI-readable EntityMap. Explain that EntityMap is optional, uses no paid API by default, and requires human review; pass `--entity-map` during initialization when selected. Recommend `growth-site` for a typical lead-generation site; use a specialist profile only when the project warrants it. Confirm the summary before initialization, then run `cosmo init`, install dependencies, diagnose the project, start the workflow, and conduct brand and copy discovery.
56
56
 
57
57
  Do not mark discovery, strategy, plan, copy briefs, design, or final review approved until the user explicitly approves the presented artifact. Use Cosmo workflow commands to record submission and approval.
58
58
 
@@ -68,7 +68,7 @@ For every stage:
68
68
 
69
69
  Before page writing, run `cosmo copy guide <page-id> .`. Keep supplied, observed, inferred, and unknown information distinct. Do not imitate living writers, reproduce source language, fabricate reader psychology, or make unsupported attacks on alternatives. Explore at least three genuinely different visual directions and store the approved choice in `DESIGN-DIRECTION.md`, tokens, components, and Cosmo design artifacts.
70
70
 
71
- Advance generation one state at a time. After two failed repair cycles, leave the page for human review. For release, run the build plus Copy Studio, content, intelligence, integrity, static, browser, and release checks. Deploy production only when the exact current release reports READY.
71
+ Advance generation one state at a time. After two failed repair cycles, leave the page for human review. For release, run the build plus Copy Studio, content, intelligence, integrity, EntityMap when enabled, static, browser, and release checks. Deploy production only when the exact current release reports READY.
72
72
 
73
73
  ## Switching agents
74
74
 
@@ -1,4 +1,4 @@
1
- <!-- cosmo-agent-version: 1.10.0 -->
1
+ <!-- cosmo-agent-version: 1.11.0 -->
2
2
  # Cosmo
3
3
 
4
4
  Use the Cosmo website-building workflow in the current workspace.
@@ -15,5 +15,6 @@ First, look for `.agents/skills/cosmo/SKILL.md` and follow it completely when pr
15
15
  - Never invent evidence or approval, bypass a gate, or place credentials in tracked files.
16
16
  - Use `cosmo doctor .` and `cosmo status . --json` to identify the next safe action.
17
17
  - Explain decisions conversationally so the user does not need to know Cosmo commands.
18
+ - Ask whether a new or adopted project should include the optional AI-readable EntityMap. Never accept enrichment matches or approve it without explicit human review.
18
19
 
19
20
  If this is not yet a Cosmo project, guide the user through the smallest set of questions needed to start or adopt it. If it is already managed by Cosmo, continue the active stage and preserve every approved contract and handoff.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosmo",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "Conversational launcher for starting, adopting, and resuming local-first Cosmo Astro website builds.",
5
5
  "author": {
6
6
  "name": "Cosmo"
@@ -43,3 +43,5 @@ The seven plain-language phases are:
43
43
  7. Preview, approve, and deploy.
44
44
 
45
45
  At every approval point, explain what the user is reviewing, give a recommendation, and ask one unmistakable question. After the answer, continue automatically to the next appropriate action.
46
+
47
+ When starting or adopting a site, ask whether the user wants an optional AI-readable EntityMap. Explain that it works without paid APIs and remains a draft until they review it. Never accept external entity matches or approve the map on the user's behalf.
@@ -91,7 +91,8 @@ Collect only the decisions needed to initialize:
91
91
  1. Target directory, brand/project name, and canonical URL if known.
92
92
  2. Business/niche, primary audience, primary site goal, genuine location scope, and approximate justified page count.
93
93
  3. Design mode: Claude-led, Claude Design-led, or hybrid.
94
- 4. Capability profile. Recommend rather than asking the user to understand the catalog:
94
+ 4. Whether to create an AI-readable EntityMap. Explain that it is optional, works without paid APIs, and remains a generator draft until the user reviews it.
95
+ 5. Capability profile. Recommend rather than asking the user to understand the catalog:
95
96
  - `growth-site`: best general default for a business/lead-generation site.
96
97
  - `search-authority`: research-led authority/content site.
97
98
  - `local-authority`: defensible location strategy.
@@ -102,7 +103,7 @@ Collect only the decisions needed to initialize:
102
103
  Confirm the initialization summary, then run:
103
104
 
104
105
  ```bash
105
- cosmo init <target> --name <slug> --brand "<brand>" --site "<url>" --profile <profile>
106
+ cosmo init <target> --name <slug> --brand "<brand>" --site "<url>" --profile <profile> [--entity-map]
106
107
  cd <target> && npm install
107
108
  cosmo doctor <target>
108
109
  cosmo workflow start <target>
@@ -127,7 +128,7 @@ At every stage:
127
128
  5. Present approval-stage results and wait.
128
129
  6. Submit and approve only through Cosmo CLI commands.
129
130
 
130
- For design, explore at least three genuinely distinct directions and preserve the selected direction in repository artifacts. After the page plan is approved, run `cosmo copy brief --all . --replace`, complete each flexible annotated section contract, and obtain approval. Before drafting a page, run `cosmo copy guide <page-id> .` and follow its separate grounding, drafting, evidence, editorial, reader, and final passes. Never imitate a living writer, import private Lyra files, reproduce copyrighted source wording, fabricate reader psychology, or use unsupported attacks on an alternative. For generation, advance one page gate at a time and respect repair limits. For QA, run `cosmo copy check .` with integrity, content, intelligence, static, and browser checks. For production, require the exact current release to be READY.
131
+ For design, explore at least three genuinely distinct directions and preserve the selected direction in repository artifacts. After the page plan is approved, run `cosmo copy brief --all . --replace`, complete each flexible annotated section contract, and obtain approval. Before drafting a page, run `cosmo copy guide <page-id> .` and follow its separate grounding, drafting, evidence, editorial, reader, and final passes. Never imitate a living writer, import private Lyra files, reproduce copyrighted source wording, fabricate reader psychology, or use unsupported attacks on an alternative. For generation, advance one page gate at a time and respect repair limits. For QA, run `cosmo copy check .` with integrity, content, intelligence, EntityMap when enabled, static, and browser checks. For production, require the exact current release to be READY.
131
132
 
132
133
  ## Help mode
133
134
 
@@ -11,8 +11,10 @@ Never invent business facts, audience observations, evidence, research, credenti
11
11
 
12
12
  If `.cosmo/project.json` is absent, inspect before acting: offer `cosmo adopt` for an existing Astro site, use `cosmo init` only in an empty directory, and never overwrite unrelated files.
13
13
 
14
+ For a new project, ask whether the user wants an AI-readable EntityMap. It is optional, works without paid APIs, and must remain `generator-draft` until the user explicitly reviews it. When selected, initialize with `--entity-map`; never accept enrichment candidates or approve the map for the user.
15
+
14
16
  At each stage, read the contract and selected intelligence guidance, explain the immediate decision, create repository-owned artifacts, run the relevant checks, and wait for explicit user approval where required. Use `cosmo copy guide <page-id> .` before page writing. Keep facts, observations, inferences, and unknowns distinct. Explore at least three genuinely different visual directions; Claude Design is optional, and any capable design authority may satisfy the same repository-owned design contract.
15
17
 
16
- Advance generation one state at a time. After two unsuccessful repair cycles, leave the page for human review. Require the exact release to report READY before production deployment.
18
+ Advance generation one state at a time. After two unsuccessful repair cycles, leave the page for human review. Run `cosmo entity check .` during QA when EntityMap is enabled. Require the exact release to report READY before production deployment.
17
19
 
18
20
  When switching tools, create a durable handoff with `cosmo handoff create . --from <current-agent> --to <next-agent> --note "<summary and open decisions>"`. The next agent must continue from repository state.
@@ -16,6 +16,7 @@
16
16
  { "id": "page-production-pipeline", "version": 1, "status": "active", "stages": ["generate", "qa"] },
17
17
  { "id": "bounded-repair", "version": 1, "status": "active", "stages": ["generate", "qa"] },
18
18
  { "id": "semantic-content-qa", "version": 1, "status": "active", "stages": ["qa"] },
19
- { "id": "noncommodity-gate", "version": 1, "status": "active", "stages": ["generate", "qa"] }
19
+ { "id": "noncommodity-gate", "version": 1, "status": "active", "stages": ["generate", "qa"] },
20
+ { "id": "entity-map", "version": 1, "status": "optional", "stages": ["brand", "research", "plan", "generate", "qa", "release"] }
20
21
  ]
21
22
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "version": 1,
3
+ "updatedAt": null,
4
+ "candidates": []
5
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "version": 1,
3
+ "enabled": false,
4
+ "includeNoindex": false,
5
+ "verificationStatus": "generator-draft",
6
+ "review": {
7
+ "reviewedBy": null,
8
+ "reviewedAt": null
9
+ },
10
+ "approvedMatches": [],
11
+ "providers": {
12
+ "wikidata": {
13
+ "enabled": true
14
+ },
15
+ "googleKnowledgeGraph": {
16
+ "enabled": false,
17
+ "apiKeyEnv": "COSMO_GOOGLE_KG_API_KEY"
18
+ },
19
+ "googlePlaces": {
20
+ "enabled": false,
21
+ "apiKeyEnv": "COSMO_GOOGLE_PLACES_API_KEY"
22
+ },
23
+ "textRazor": {
24
+ "enabled": false,
25
+ "apiKeyEnv": "COSMO_TEXTRAZOR_API_KEY"
26
+ }
27
+ }
28
+ }
@@ -5,3 +5,9 @@ COSMO_DEPLOY_PASSWORD=
5
5
  # COSMO_DEPLOY_PRIVATE_KEY="-----BEGIN OPENSSH PRIVATE KEY-----..."
6
6
  # COSMO_DEPLOY_KEY_PASSPHRASE=
7
7
  # COSMO_DEPLOY_HOST_FINGERPRINT=SHA256:replace-with-server-fingerprint
8
+
9
+ # Optional EntityMap enrichment. Wikidata works without a key.
10
+ # Enable a provider in .cosmo/entities/config.json before using it.
11
+ # COSMO_GOOGLE_KG_API_KEY=
12
+ # COSMO_GOOGLE_PLACES_API_KEY=
13
+ # COSMO_TEXTRAZOR_API_KEY=