@mdvp/cli 1.6.0 → 1.7.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 (2) hide show
  1. package/cli.mjs +15 -3
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -84,11 +84,23 @@ function apiPost(path, data, apiKey, baseUrl = API) {
84
84
  async function cmdAudit(domain, { json }) {
85
85
  domain = parseDomain(domain)
86
86
  process.stderr.write(`${DIM}fetching ${domain}...${R}\n`)
87
- const data = await apiGet(`/dataset?limit=800`)
88
- const site = (data.sites ?? []).find((s) => s.id === domain)
87
+
88
+ // Try direct lookup first, fall back to full scan
89
+ let site = null
90
+ try {
91
+ const direct = await apiGet(`/dataset/${domain}`)
92
+ if (direct && direct.id) site = direct
93
+ } catch (_) {}
94
+
95
+ if (!site) {
96
+ const data = await apiGet(`/dataset?limit=1000`)
97
+ site = (data.sites ?? []).find((s) => s.id === domain) ?? null
98
+ }
99
+
89
100
  if (!site) {
90
101
  if (json) { console.log(JSON.stringify({ error: "not_in_dataset", domain }, null, 2)); process.exit(1) }
91
- console.error(`${RED}not in dataset: ${domain}${R}\n${DIM}run: npx mdvp submit ${domain}${R}`)
102
+ console.error(`${RED}not in dataset: ${domain}${R}`)
103
+ console.error(`${DIM}submit for crawl: npx @mdvp/cli submit ${domain}${R}`)
92
104
  process.exit(1)
93
105
  }
94
106
  const bd = site.scores?.breakdown ?? []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdvp/cli",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Machine Design Vision Protocol — gives agents eyes to understand design quality",
5
5
  "bin": {
6
6
  "mdvp": "./cli.mjs"