@archangel70/cosmo 1.16.2 → 1.16.4
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/CHANGELOG.md +16 -0
- package/README.md +5 -3
- package/package.json +4 -2
- package/packages/cli/bin/cosmo.mjs +1 -1
- package/packages/cli/lib/entity-map.mjs +10 -4
- package/plugins/agent-skills/cosmo/.cosmo-agent.json +1 -1
- package/plugins/antigravity/cosmo.md +1 -1
- package/plugins/claude-code/cosmo/.claude-plugin/plugin.json +1 -1
- package/scripts/audit-dependencies.mjs +76 -0
- package/templates/astro-site/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable Cosmo changes are recorded here.
|
|
4
4
|
|
|
5
|
+
## 1.16.4 — Reliable native EntityMap metadata
|
|
6
|
+
|
|
7
|
+
- Preserved apostrophes and quote characters inside native Astro HTML metadata instead of truncating descriptions at the first apostrophe.
|
|
8
|
+
- Accepted both Wikidata `/entity/Q…` API identifiers and public `/wiki/Q…` identifiers for reviewed `sameAs` matches.
|
|
9
|
+
- Canonicalized Wikidata enrichment candidates and published matches to `https://www.wikidata.org/wiki/Q…`.
|
|
10
|
+
- Added regression coverage for adopted native descriptions and previously saved Wikidata entity URLs.
|
|
11
|
+
- Removed the now-unnecessary `picomatch` audit exception after the dependency graph updated to a clean release.
|
|
12
|
+
|
|
13
|
+
## 1.16.3 — Unified dependency security gate
|
|
14
|
+
|
|
15
|
+
- Upgraded `basic-ftp` to 6.2.6, resolving the published directory-listing and credential newline denial-of-service advisories in Cosmo's FTP deployment path.
|
|
16
|
+
- Made Verify and Release run the same package smoke test and dependency-security gate before publication.
|
|
17
|
+
- Pinned the trusted-publishing runner to npm 11.21.3 so npm 12 lifecycle-policy changes cannot silently bypass Cosmo's launcher installation smoke test.
|
|
18
|
+
- Added one exact, documented exception for the unpatched `picomatch` advisory, limited to its dependency chain and expiring December 17, 2026.
|
|
19
|
+
- Made the exception fail closed when it expires, when a different high-severity advisory appears, or when the upstream finding disappears and the exception should be removed.
|
|
20
|
+
|
|
5
21
|
## 1.16.2 — Native Astro intelligence resilience
|
|
6
22
|
|
|
7
23
|
- Stopped intelligence checks from parsing Astro's JavaScript and TypeScript frontmatter as YAML on adopted native sites.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Cosmo helps an AI coding assistant build a complete, original Astro website for
|
|
|
4
4
|
|
|
5
5
|
You do **not** need to know how to code. Cosmo supports Claude Code, Codex, and Google Antigravity.
|
|
6
6
|
|
|
7
|
-
Current version: **1.16.
|
|
7
|
+
Current version: **1.16.4**
|
|
8
8
|
|
|
9
9
|
## Quick install
|
|
10
10
|
|
|
@@ -82,7 +82,7 @@ This is the only part of the beginner setup that uses a terminal. It is one inst
|
|
|
82
82
|
cosmo --version
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
You should see `1.16.
|
|
85
|
+
You should see `1.16.4` or a newer version. Cosmo automatically installs its Claude, Codex, and Antigravity launchers.
|
|
86
86
|
|
|
87
87
|
### On Windows
|
|
88
88
|
|
|
@@ -99,7 +99,7 @@ You should see `1.16.2` or a newer version. Cosmo automatically installs its Cla
|
|
|
99
99
|
cosmo --version
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
You should see `1.16.
|
|
102
|
+
You should see `1.16.4` or a newer version. Cosmo automatically installs its Claude, Codex, and Antigravity launchers.
|
|
103
103
|
|
|
104
104
|
## Step 4: create your website folder
|
|
105
105
|
|
|
@@ -452,6 +452,8 @@ Cosmo publishes `/entitymap.json` and `/entitymap.html`, adds the discovery link
|
|
|
452
452
|
|
|
453
453
|
On an adopted Astro site, EntityMap uses the approved native route inventory and the site's built HTML. It does not require `src/content/pages`, replace hand-authored `.astro` pages, or change the existing design. Home and about represent the Organization, service and service-area routes become Services and Places, and other routes become Concepts unless a reviewed route override supplies a different name or core type.
|
|
454
454
|
|
|
455
|
+
Cosmo preserves complete HTML metadata, including apostrophes inside descriptions. Accepted Wikidata `/entity/Q…` and `/wiki/Q…` identifiers are normalized to the public `https://www.wikidata.org/wiki/Q…` form before they appear in the EntityMap.
|
|
456
|
+
|
|
455
457
|
Advanced users can run:
|
|
456
458
|
|
|
457
459
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archangel70/cosmo",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.4",
|
|
4
4
|
"description": "Local-first, multi-agent Astro website builder for Claude, Codex, Antigravity, and the command line.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"docs/WORKFLOWS.md",
|
|
60
60
|
"CHANGELOG.md",
|
|
61
61
|
"SECURITY.md",
|
|
62
|
+
"scripts/audit-dependencies.mjs",
|
|
62
63
|
"scripts/postinstall.mjs"
|
|
63
64
|
],
|
|
64
65
|
"repository": {
|
|
@@ -84,13 +85,14 @@
|
|
|
84
85
|
"entity:qa": "node packages/cli/bin/cosmo.mjs entity check templates/astro-site",
|
|
85
86
|
"browser:qa": "node packages/cli/bin/cosmo.mjs browser check templates/astro-site",
|
|
86
87
|
"package:smoke": "node scripts/smoke-package.mjs",
|
|
88
|
+
"audit:dependencies": "node scripts/audit-dependencies.mjs",
|
|
87
89
|
"postinstall": "node scripts/postinstall.mjs",
|
|
88
90
|
"test": "node --test packages/cli/test/*.test.mjs",
|
|
89
91
|
"verify": "npm run test && npm run check && npm run integrity:qa && npm run entity:qa && npm run qa && npm run copy:qa && npm run content:qa && npm run intelligence:qa && npm run browser:qa"
|
|
90
92
|
},
|
|
91
93
|
"dependencies": {
|
|
92
94
|
"axe-core": "^4.13.0",
|
|
93
|
-
"basic-ftp": "^6.2.
|
|
95
|
+
"basic-ftp": "^6.2.6",
|
|
94
96
|
"chrome-launcher": "^1.2.1",
|
|
95
97
|
"gray-matter": "^4.0.3",
|
|
96
98
|
"lighthouse": "^13.4.1",
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
workflowSummary,
|
|
68
68
|
} from '../lib/workflow.mjs';
|
|
69
69
|
|
|
70
|
-
const VERSION = '1.16.
|
|
70
|
+
const VERSION = '1.16.4';
|
|
71
71
|
const cliDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
72
72
|
const templateDirectory = path.resolve(cliDirectory, '../../../templates/astro-site');
|
|
73
73
|
const [command = 'start', ...rawArgs] = process.argv.slice(2);
|
|
@@ -142,7 +142,8 @@ function plainText(value) {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
function attribute(tag, name) {
|
|
145
|
-
|
|
145
|
+
const match = tag.match(new RegExp(`\\b${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, 'i'));
|
|
146
|
+
return (match?.[1] ?? match?.[2])?.trim() ?? '';
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
function metaContent(html, name) {
|
|
@@ -264,8 +265,13 @@ function entityIdentity(page, publisher) {
|
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
function publicSameAs(config, entityId) {
|
|
267
|
-
const
|
|
268
|
-
|
|
268
|
+
const canonical = (uri) => {
|
|
269
|
+
const wikidata = String(uri ?? '').match(/^https?:\/\/(?:www\.)?wikidata\.org\/(?:wiki|entity)\/(Q\d+)$/i);
|
|
270
|
+
if (wikidata) return `https://www.wikidata.org/wiki/${wikidata[1].toUpperCase()}`;
|
|
271
|
+
return /^https:\/\/[^/]*wikipedia\.org\/wiki\//i.test(uri ?? '') ? uri : null;
|
|
272
|
+
};
|
|
273
|
+
const match = config.approvedMatches.find((item) => item.entityId === entityId && item.status === 'accepted' && canonical(item.uri));
|
|
274
|
+
return match ? canonical(match.uri) : null;
|
|
269
275
|
}
|
|
270
276
|
|
|
271
277
|
function stableGenerated(previous, next) {
|
|
@@ -470,7 +476,7 @@ async function enrichWikidata(subjects, fetchImpl, {
|
|
|
470
476
|
}
|
|
471
477
|
if (!response.ok) throw new Error(`Wikidata returned HTTP ${response.status}.`);
|
|
472
478
|
const body = await response.json();
|
|
473
|
-
for (const item of body.search ?? []) values.push({ provider: 'wikidata', entityId: subject.entityId, matchedName: item.label, externalId: item.id, uri:
|
|
479
|
+
for (const item of body.search ?? []) values.push({ provider: 'wikidata', entityId: subject.entityId, matchedName: item.label, externalId: item.id, uri: `https://www.wikidata.org/wiki/${item.id}`, description: item.description ?? '', score: null });
|
|
474
480
|
}
|
|
475
481
|
return values;
|
|
476
482
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
3
|
+
|
|
4
|
+
export const AUDIT_EXCEPTIONS = [];
|
|
5
|
+
|
|
6
|
+
const severityRank = { info: 0, low: 1, moderate: 2, high: 3, critical: 4 };
|
|
7
|
+
|
|
8
|
+
function rootAdvisories(vulnerabilities, name, visiting = new Set()) {
|
|
9
|
+
if (visiting.has(name)) return [{ source: `cycle:${name}`, advisory: null, package: name }];
|
|
10
|
+
const vulnerability = vulnerabilities[name];
|
|
11
|
+
if (!vulnerability) return [{ source: `dependency:${name}`, advisory: null, package: name }];
|
|
12
|
+
const next = new Set(visiting);
|
|
13
|
+
next.add(name);
|
|
14
|
+
const roots = [];
|
|
15
|
+
for (const via of vulnerability.via ?? []) {
|
|
16
|
+
if (typeof via === 'string') roots.push(...rootAdvisories(vulnerabilities, via, next));
|
|
17
|
+
else roots.push({
|
|
18
|
+
source: String(via.source),
|
|
19
|
+
advisory: typeof via.url === 'string' ? via.url.split('/').pop() : null,
|
|
20
|
+
package: via.name ?? name,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return roots.length ? roots : [{ source: `dependency:${name}`, advisory: null, package: name }];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function evaluateAudit(report, { exceptions = AUDIT_EXCEPTIONS, now = new Date(), minimumSeverity = 'high' } = {}) {
|
|
27
|
+
const vulnerabilities = report?.vulnerabilities ?? {};
|
|
28
|
+
const threshold = severityRank[minimumSeverity] ?? severityRank.high;
|
|
29
|
+
const exceptionBySource = new Map(exceptions.map((item) => [String(item.source), item]));
|
|
30
|
+
const used = new Set();
|
|
31
|
+
const accepted = [];
|
|
32
|
+
const unexpected = [];
|
|
33
|
+
|
|
34
|
+
for (const [name, vulnerability] of Object.entries(vulnerabilities)) {
|
|
35
|
+
if ((severityRank[vulnerability.severity] ?? 0) < threshold) continue;
|
|
36
|
+
const roots = rootAdvisories(vulnerabilities, name);
|
|
37
|
+
const matched = roots.map((root) => ({ root, exception: exceptionBySource.get(root.source) }));
|
|
38
|
+
const allowed = matched.length > 0 && matched.every(({ exception }) => exception && Date.parse(exception.expiresAt) > now.getTime());
|
|
39
|
+
if (allowed) {
|
|
40
|
+
for (const { exception } of matched) used.add(String(exception.source));
|
|
41
|
+
accepted.push({ name, severity: vulnerability.severity, advisories: [...new Set(matched.map(({ exception }) => exception.advisory))] });
|
|
42
|
+
} else {
|
|
43
|
+
unexpected.push({ name, severity: vulnerability.severity, roots });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const expired = exceptions.filter((item) => Date.parse(item.expiresAt) <= now.getTime());
|
|
48
|
+
const stale = exceptions.filter((item) => !expired.includes(item) && !used.has(String(item.source)));
|
|
49
|
+
return { passed: unexpected.length === 0 && expired.length === 0 && stale.length === 0, accepted, unexpected, expired, stale };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function run() {
|
|
53
|
+
const audit = spawnSync('npm', ['audit', '--json'], { encoding: 'utf8', maxBuffer: 20 * 1024 * 1024 });
|
|
54
|
+
let report;
|
|
55
|
+
try {
|
|
56
|
+
report = JSON.parse(audit.stdout);
|
|
57
|
+
} catch {
|
|
58
|
+
console.error('Dependency audit failed: npm did not return a readable JSON report.');
|
|
59
|
+
if (audit.stderr) console.error(audit.stderr.trim());
|
|
60
|
+
process.exitCode = 1;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const result = evaluateAudit(report);
|
|
65
|
+
for (const item of result.accepted) console.warn(`Accepted temporary advisory exception: ${item.name} (${item.advisories.join(', ')}).`);
|
|
66
|
+
for (const item of result.unexpected) console.error(`Unaccepted ${item.severity} dependency finding: ${item.name}.`);
|
|
67
|
+
for (const item of result.expired) console.error(`Dependency-audit exception expired: ${item.advisory} on ${item.expiresAt}.`);
|
|
68
|
+
for (const item of result.stale) console.error(`Dependency-audit exception is no longer needed and must be removed: ${item.advisory}.`);
|
|
69
|
+
if (!result.passed) {
|
|
70
|
+
process.exitCode = 1;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
console.log(`Dependency audit passed with ${result.accepted.length} finding(s) covered by an explicit temporary exception.`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) run();
|