pseolint 0.1.0 → 0.2.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.
- package/README.md +257 -77
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +109 -4
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +69 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +2 -0
- package/dist/mcp.js.map +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,77 +1,257 @@
|
|
|
1
|
-
# pseolint
|
|
2
|
-
|
|
3
|
-
> SpamBrain-proof your pSEO before you publish.
|
|
4
|
-
|
|
5
|
-
The only tool purpose-built for **programmatic SEO compliance**. Audits page *relationships*, not just pages. Detects the exact patterns Google's SpamBrain targets.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npx pseolint http://localhost:3000
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Or install globally:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install -g pseolint
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
# Audit your local dev server (recommended)
|
|
23
|
-
npx pseolint http://localhost:3000
|
|
24
|
-
|
|
25
|
-
# Audit a live site
|
|
26
|
-
npx pseolint https://yoursite.com
|
|
27
|
-
|
|
28
|
-
# Audit a build directory
|
|
29
|
-
npx pseolint ./out --threshold 40
|
|
30
|
-
|
|
31
|
-
# Save an HTML report
|
|
32
|
-
npx pseolint http://localhost:3000 --format html --output report.html
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Options
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
-f, --format <type> console, json, markdown, html (default: "console")
|
|
39
|
-
-t, --threshold <n> Score threshold for CI exit code (default: 40)
|
|
40
|
-
-o, --output <file> Write report to file
|
|
41
|
-
--no-color Disable colored output
|
|
42
|
-
--concurrency <n> Max parallel HTTP fetches (default: 5)
|
|
43
|
-
--timeout <ms> Per-request timeout (default: 30000)
|
|
44
|
-
--sample-size <n> Audit a random subset of N pages
|
|
45
|
-
--ignore <patterns> Comma-separated glob patterns to exclude
|
|
46
|
-
--render Render pages in a browser before auditing
|
|
47
|
-
--browser-ws <url> CDP WebSocket endpoint for rendering
|
|
48
|
-
--no-crawl Disable crawl-based page discovery
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Configuration
|
|
52
|
-
|
|
53
|
-
Create `pseolint.config.ts` in your project root:
|
|
54
|
-
|
|
55
|
-
```typescript
|
|
56
|
-
export default {
|
|
57
|
-
rules: {
|
|
58
|
-
nearDuplicateThreshold: 0.85,
|
|
59
|
-
thinContentMinWords: 500,
|
|
60
|
-
},
|
|
61
|
-
pageGroups: {
|
|
62
|
-
templates: {
|
|
63
|
-
match: '/templates/**',
|
|
64
|
-
rules: ['spam/*', 'content/*'],
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
ignore: ['/api/**', '/admin/**'],
|
|
68
|
-
};
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
##
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
# pseolint
|
|
2
|
+
|
|
3
|
+
> SpamBrain-proof your pSEO before you publish.
|
|
4
|
+
|
|
5
|
+
The only tool purpose-built for **programmatic SEO compliance**. Audits page *relationships*, not just pages. Detects the exact patterns Google's SpamBrain targets.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx pseolint http://localhost:3000
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or install globally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g pseolint
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Audit your local dev server (recommended)
|
|
23
|
+
npx pseolint http://localhost:3000
|
|
24
|
+
|
|
25
|
+
# Audit a live site
|
|
26
|
+
npx pseolint https://yoursite.com
|
|
27
|
+
|
|
28
|
+
# Audit a build directory
|
|
29
|
+
npx pseolint ./out --threshold 40
|
|
30
|
+
|
|
31
|
+
# Save an HTML report
|
|
32
|
+
npx pseolint http://localhost:3000 --format html --output report.html
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Options
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
-f, --format <type> console, json, markdown, html (default: "console")
|
|
39
|
+
-t, --threshold <n> Score threshold for CI exit code (default: 40)
|
|
40
|
+
-o, --output <file> Write report to file
|
|
41
|
+
--no-color Disable colored output
|
|
42
|
+
--concurrency <n> Max parallel HTTP fetches (default: 5)
|
|
43
|
+
--timeout <ms> Per-request timeout (default: 30000)
|
|
44
|
+
--sample-size <n> Audit a random subset of N pages
|
|
45
|
+
--ignore <patterns> Comma-separated glob patterns to exclude
|
|
46
|
+
--render Render pages in a browser before auditing
|
|
47
|
+
--browser-ws <url> CDP WebSocket endpoint for rendering
|
|
48
|
+
--no-crawl Disable crawl-based page discovery
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
Create `pseolint.config.ts` in your project root:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
export default {
|
|
57
|
+
rules: {
|
|
58
|
+
nearDuplicateThreshold: 0.85,
|
|
59
|
+
thinContentMinWords: 500,
|
|
60
|
+
},
|
|
61
|
+
pageGroups: {
|
|
62
|
+
templates: {
|
|
63
|
+
match: '/templates/**',
|
|
64
|
+
rules: ['spam/*', 'content/*'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
ignore: ['/api/**', '/admin/**'],
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Caching and delta audits
|
|
72
|
+
|
|
73
|
+
### HTTP cache
|
|
74
|
+
|
|
75
|
+
Speed up re-runs and cut egress by caching fetches:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pseolint https://example.com --cache
|
|
79
|
+
pseolint https://example.com --cache --cache-ttl 30d
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Cached entries honor `ETag` / `Last-Modified` for 304 revalidation. When servers strip these headers, entries fall back to TTL-based freshness (default 7 days). Negative responses (4xx) are cached for 24h; 5xx are never cached. Redirects are stored as pointer entries so re-runs resolve without a network round-trip.
|
|
83
|
+
|
|
84
|
+
### Run state + delta mode
|
|
85
|
+
|
|
86
|
+
Persist audit state across runs for CI/monitoring:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# First run (writes baseline state)
|
|
90
|
+
pseolint https://example.com --state
|
|
91
|
+
|
|
92
|
+
# Subsequent run: audit only changed pages
|
|
93
|
+
pseolint https://example.com --state --since
|
|
94
|
+
|
|
95
|
+
# Monitoring: fail on new rule ID regressions
|
|
96
|
+
pseolint https://example.com --state --exit-on-regression
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
State is stored at `.pseolint/state.json` by default. Commit it to share baseline across CI workers. On the first run (no prior state), `--since` and `--exit-on-regression` bootstrap gracefully — they audit everything and write state without erroring.
|
|
100
|
+
|
|
101
|
+
Switching between `--render` modes invalidates prior state (different renderMode produces different hashes), triggering a full re-audit.
|
|
102
|
+
|
|
103
|
+
### Stratified sampling
|
|
104
|
+
|
|
105
|
+
When `--sample-size` is set, samples are drawn proportional to `sqrt(cluster_size)` per inferred URL template, ensuring every template is represented instead of biasing toward large clusters:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pseolint https://example.com --sample-size 200 --strategy stratified --max-per-template 20
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Use `--strategy random` to fall back to uniform Fisher-Yates sampling.
|
|
112
|
+
|
|
113
|
+
### Static site: zero egress
|
|
114
|
+
|
|
115
|
+
If your site outputs static HTML (`out/`, `dist/`, `public/`, `_site/`), audit the directory directly — no HTTP fetches at all:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
pseolint ./out
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## AI triage
|
|
122
|
+
|
|
123
|
+
Turn long findings lists into ranked root causes. Opt-in; off by default.
|
|
124
|
+
|
|
125
|
+
### Supported providers
|
|
126
|
+
|
|
127
|
+
| Provider | SDK package | Env var |
|
|
128
|
+
|----------|--------------------------------|------------------------------------|
|
|
129
|
+
| anthropic | @ai-sdk/anthropic (pre-installed) | ANTHROPIC_API_KEY |
|
|
130
|
+
| openai | @ai-sdk/openai | OPENAI_API_KEY |
|
|
131
|
+
| google | @ai-sdk/google | GOOGLE_GENERATIVE_AI_API_KEY |
|
|
132
|
+
| mistral | @ai-sdk/mistral | MISTRAL_API_KEY |
|
|
133
|
+
| groq | @ai-sdk/groq | GROQ_API_KEY |
|
|
134
|
+
| xai | @ai-sdk/xai | XAI_API_KEY |
|
|
135
|
+
| cohere | @ai-sdk/cohere | COHERE_API_KEY |
|
|
136
|
+
| ollama | ollama-ai-provider-v2 (pre-installed) | — (local, no key) |
|
|
137
|
+
|
|
138
|
+
Install only the providers you use: `npm install @ai-sdk/openai`.
|
|
139
|
+
|
|
140
|
+
### Quick start
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Auto-detect from env vars
|
|
144
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
145
|
+
pseolint ./out --ai
|
|
146
|
+
|
|
147
|
+
# Pick explicitly
|
|
148
|
+
pseolint ./out --ai --ai-provider openai --ai-model gpt-4o-mini
|
|
149
|
+
|
|
150
|
+
# Local + private
|
|
151
|
+
ollama serve &
|
|
152
|
+
pseolint ./out --ai --ai-provider ollama --ai-model llama3.1:8b
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Flags
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
--ai Enable AI triage
|
|
159
|
+
--ai-provider <id> Provider (see table above)
|
|
160
|
+
--ai-model <name> Override default model for the chosen provider
|
|
161
|
+
--ai-endpoint <url> Ollama endpoint (default http://localhost:11434)
|
|
162
|
+
--ai-max-tokens <n> Input token cap (default 60000)
|
|
163
|
+
--ai-max-cost <usd> Refuse a call whose pre-flight cost exceeds this USD
|
|
164
|
+
--ai-daily-budget <usd> Refuse triage when today's total spend would exceed this USD
|
|
165
|
+
--ai-cache-ttl <duration> Triage cache TTL (default 30d)
|
|
166
|
+
--no-ai-cache Bypass cache
|
|
167
|
+
--no-ai-suggest Suppress discovery hint
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### How it works
|
|
171
|
+
|
|
172
|
+
After the linter runs, the AI step takes the enriched findings (capped at 200 by severity) and asks the model to identify 1–5 underlying root causes ranked by SEO impact. The findings list is unchanged — triage is an *additional* section above it.
|
|
173
|
+
|
|
174
|
+
### Model reliability
|
|
175
|
+
|
|
176
|
+
Triage uses structured-output generation (JSON matching a strict schema). Not every model handles this reliably at real-world audit sizes.
|
|
177
|
+
|
|
178
|
+
**Recommended (validated):** `claude-sonnet-4-6`, `claude-opus-4-7`, `gpt-4o`, `gemini-2.5-pro`.
|
|
179
|
+
**Works but marginal:** `gpt-4o-mini`, `gemini-2.5-flash` — cheaper, sometimes truncate.
|
|
180
|
+
**Avoid for triage:** `claude-haiku-4-5-20251001` and similar small models — fails schema validation in our smoke tests (~30 findings). If you want cheap, prefer `gpt-4o-mini` or `gemini-2.5-flash`.
|
|
181
|
+
|
|
182
|
+
If your chosen model fails, you'll see `[ai-triage] skipped: ...` on stderr and the audit completes normally. Check `pseolint stats` for skip-reason counters.
|
|
183
|
+
|
|
184
|
+
### Cost and budget
|
|
185
|
+
|
|
186
|
+
- Triage runs as **one** model call per audit. Default input cap: 60k tokens.
|
|
187
|
+
- A pre-flight line is printed before every call: `[ai-triage] calling anthropic:claude-sonnet-4-6 — ~12,000 input / ≤4,000 output tokens, ~$0.12`. You can Ctrl-C before the call lands.
|
|
188
|
+
- **Per-call cap:** `--ai-max-cost 0.50` refuses the call if the pre-flight estimate exceeds $0.50. Recommended for any CI use.
|
|
189
|
+
- **Daily budget:** `--ai-max-cost 0.50 --ai-daily-budget 5.00 --telemetry` reads today's successful-triage spend from your local telemetry JSONL and refuses the call when the running total would breach the budget.
|
|
190
|
+
- Results are cached at `.pseolint/ai-cache/` for 30 days. Re-running on unchanged audit data is free.
|
|
191
|
+
- Cache key includes the prompt version — bumping it auto-invalidates the cache.
|
|
192
|
+
- **Do not put `apiKey` in a committed config file.** Use the provider's env var (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, etc.). A warning is printed if `ai.apiKey` is set.
|
|
193
|
+
- The cost estimate is best-effort based on a hardcoded pricing table for the most common models. Your provider's billing dashboard is authoritative.
|
|
194
|
+
|
|
195
|
+
### Privacy
|
|
196
|
+
|
|
197
|
+
Triage sends finding rule IDs, severities, messages, and (optional) page URLs to the configured provider. Messages may contain page titles or short content excerpts (per existing rule outputs). Use the **Ollama** provider to keep all data on your machine.
|
|
198
|
+
|
|
199
|
+
### Failure modes (fail-open)
|
|
200
|
+
|
|
201
|
+
Any error in the AI step (auth, rate-limit, network, unparseable response, missing SDK) skips triage with a stderr message. The audit completes normally — exit code, JSON output, and findings list are unchanged.
|
|
202
|
+
|
|
203
|
+
## Telemetry (local-only)
|
|
204
|
+
|
|
205
|
+
Opt-in. Writes a JSONL log of your audit runs to `.pseolint/telemetry.jsonl`. **Nothing is sent anywhere** — no network calls, no phoning home. This is yours to inspect.
|
|
206
|
+
|
|
207
|
+
### Enable
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
pseolint ./site --telemetry
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Or in `pseolint.config.ts`:
|
|
214
|
+
```ts
|
|
215
|
+
export default {
|
|
216
|
+
telemetry: { enabled: true },
|
|
217
|
+
};
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### What gets recorded
|
|
221
|
+
|
|
222
|
+
Counts only — no URLs, no page content, no API keys:
|
|
223
|
+
|
|
224
|
+
- Audit: `runId`, `timestamp`, `durationMs`, `score`, `pageCount`, `findingCount`, optional `cacheStats`, optional `triage` metadata (model, token counts, cache hit, cost estimate).
|
|
225
|
+
- Feedback: `runId`, `timestamp`, `rating`.
|
|
226
|
+
|
|
227
|
+
### View
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
pseolint stats # pretty summary
|
|
231
|
+
pseolint stats --json # machine-readable
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Triage feedback
|
|
235
|
+
|
|
236
|
+
When AI triage runs, you'll see a one-line prompt after the section:
|
|
237
|
+
```
|
|
238
|
+
Was this triage helpful? [y/n/skip]
|
|
239
|
+
```
|
|
240
|
+
Skippable. Suppress with `--no-telemetry-prompt` or `telemetry.prompt: false`.
|
|
241
|
+
|
|
242
|
+
In CI (no TTY), the prompt auto-skips. Pass `--triage-feedback helpful|unhelpful` to record a rating non-interactively.
|
|
243
|
+
|
|
244
|
+
### Share
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
pseolint stats-export /tmp/tel.jsonl
|
|
248
|
+
```
|
|
249
|
+
Copies your file so you can inspect it before sharing. No automatic upload.
|
|
250
|
+
|
|
251
|
+
## Documentation
|
|
252
|
+
|
|
253
|
+
See the full documentation at [github.com/ouranos-labs/pseolint](https://github.com/ouranos-labs/pseolint).
|
|
254
|
+
|
|
255
|
+
## License
|
|
256
|
+
|
|
257
|
+
MIT
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA0DA,wBAAsB,MAAM,CAC1B,IAAI,GAAE,MAAM,EAA0B,GACrC,OAAO,CAAC,MAAM,CAAC,CAiMjB"}
|
package/dist/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ export async function runCli(args = process.argv.slice(2)) {
|
|
|
18
18
|
.name("pseolint")
|
|
19
19
|
.description("Programmatic SEO linter — audit sites for SpamBrain risk")
|
|
20
20
|
.version(version)
|
|
21
|
-
.argument("
|
|
21
|
+
.argument("[source]", "Directory path or URL to audit")
|
|
22
22
|
.option("-f, --format <type>", "Output format: console, json, markdown, html", "console")
|
|
23
23
|
.option("-t, --threshold <n>", "SpamBrain Risk Score threshold for CI exit code", "40")
|
|
24
24
|
.option("-o, --output <file>", "Write report to file instead of stdout")
|
|
@@ -29,10 +29,32 @@ export async function runCli(args = process.argv.slice(2)) {
|
|
|
29
29
|
.option("--ignore <patterns>", "Comma-separated glob patterns to exclude")
|
|
30
30
|
.option("--render", "Render pages in a browser before auditing")
|
|
31
31
|
.option("--browser-ws <url>", "CDP WebSocket endpoint for browser rendering")
|
|
32
|
-
.option("--no-crawl", "Disable crawl-based page discovery for URL sources")
|
|
32
|
+
.option("--no-crawl", "Disable crawl-based page discovery for URL sources")
|
|
33
|
+
.option("--data-source <file>", "JSON file with source data for content verification")
|
|
34
|
+
.option("--cache [dir]", "Enable HTTP cache (default dir: .pseolint/cache)")
|
|
35
|
+
.option("--cache-ttl <duration>", "Cache TTL for entries without validators, e.g. 7d, 1h, 30m", "7d")
|
|
36
|
+
.option("--strategy <random|stratified>", "Sampling strategy when --sample-size is set", "stratified")
|
|
37
|
+
.option("--max-per-template <n>", "Cap samples per URL template cluster", "0")
|
|
38
|
+
.option("--state [path]", "Enable state persistence (default path: .pseolint/state.json)")
|
|
39
|
+
.option("--since", "Delta mode: audit only URLs changed since prior --state (requires --state)")
|
|
40
|
+
.option("--exit-on-regression", "Exit non-zero when new rule IDs fire vs prior --state")
|
|
41
|
+
.option("--ai", "Enable AI triage of findings")
|
|
42
|
+
.option("--ai-provider <id>", "AI provider: anthropic | ollama (default: auto-detect)")
|
|
43
|
+
.option("--ai-model <name>", "AI model name (overrides provider default)")
|
|
44
|
+
.option("--ai-endpoint <url>", "AI endpoint (Ollama only; default: http://localhost:11434)")
|
|
45
|
+
.option("--ai-max-tokens <n>", "Input token cap per triage call", (v) => parseInt(v, 10), 60000)
|
|
46
|
+
.option("--ai-cache-ttl <duration>", "Triage cache TTL (e.g. 30d, 12h, 60s)", "30d")
|
|
47
|
+
.option("--no-ai-cache", "Bypass AI triage cache for this run")
|
|
48
|
+
.option("--no-ai-suggest", "Suppress AI discovery hint")
|
|
49
|
+
.option("--mcp", "Start as an MCP server (for AI coding assistants)");
|
|
33
50
|
program.parse(args, { from: "user" });
|
|
34
51
|
const opts = program.opts();
|
|
35
52
|
const source = program.args[0];
|
|
53
|
+
if (opts.mcp) {
|
|
54
|
+
const { startMcpServer } = await import("./mcp.js");
|
|
55
|
+
startMcpServer();
|
|
56
|
+
return 0; // never reached, server runs until stdin closes
|
|
57
|
+
}
|
|
36
58
|
if (!source) {
|
|
37
59
|
program.help();
|
|
38
60
|
return 1;
|
|
@@ -56,8 +78,72 @@ export async function runCli(args = process.argv.slice(2)) {
|
|
|
56
78
|
ignore: opts.ignore ? opts.ignore.split(",").map((s) => s.trim()) : undefined,
|
|
57
79
|
render: opts.render ? { browserWsEndpoint: opts.browserWs } : undefined,
|
|
58
80
|
crawlDiscovery: opts.crawl === false ? false : undefined,
|
|
81
|
+
samplingStrategy: opts.strategy === "random" ? "random" : "stratified",
|
|
82
|
+
maxPerTemplate: opts.maxPerTemplate !== "0" ? Number(opts.maxPerTemplate) : undefined,
|
|
59
83
|
};
|
|
84
|
+
if (opts.cache) {
|
|
85
|
+
try {
|
|
86
|
+
cliFlags.cache = {
|
|
87
|
+
dir: typeof opts.cache === "string" ? opts.cache : undefined,
|
|
88
|
+
ttlMs: parseDuration(opts.cacheTtl),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
93
|
+
console.error(`Error: ${message}`);
|
|
94
|
+
return 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if ((opts.since || opts.exitOnRegression) && !opts.state) {
|
|
98
|
+
console.error("Error: --since and --exit-on-regression require --state to be set");
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
if (opts.state || opts.since || opts.exitOnRegression) {
|
|
102
|
+
cliFlags.state = {
|
|
103
|
+
path: typeof opts.state === "string" ? opts.state : undefined,
|
|
104
|
+
since: Boolean(opts.since),
|
|
105
|
+
exitOnRegression: Boolean(opts.exitOnRegression),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
// AI flags
|
|
109
|
+
let aiCache;
|
|
110
|
+
try {
|
|
111
|
+
aiCache = opts.aiCache === false ? false : { ttlMs: parseDuration(opts.aiCacheTtl) };
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
115
|
+
console.error(`Error: ${message}`);
|
|
116
|
+
return 1;
|
|
117
|
+
}
|
|
118
|
+
if (opts.ai) {
|
|
119
|
+
cliFlags.ai = {
|
|
120
|
+
enabled: true,
|
|
121
|
+
provider: opts.aiProvider,
|
|
122
|
+
model: opts.aiModel,
|
|
123
|
+
endpoint: opts.aiEndpoint,
|
|
124
|
+
maxInputTokens: opts.aiMaxTokens,
|
|
125
|
+
suggest: opts.aiSuggest !== false,
|
|
126
|
+
cache: aiCache,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
else if (opts.aiSuggest === false) {
|
|
130
|
+
// allow suppressing the hint without enabling AI
|
|
131
|
+
cliFlags.ai = { suggest: false };
|
|
132
|
+
}
|
|
60
133
|
const options = mergeOptions(configFile, cliFlags);
|
|
134
|
+
if (opts.dataSource) {
|
|
135
|
+
const { loadDataSource } = await import("@pseolint/core");
|
|
136
|
+
try {
|
|
137
|
+
const records = await loadDataSource(opts.dataSource);
|
|
138
|
+
options.dataSource = { records };
|
|
139
|
+
console.log(`Loaded ${records.length} data source records from ${opts.dataSource}`);
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
143
|
+
console.error(`Error loading data source: ${message}`);
|
|
144
|
+
return 1;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
61
147
|
// Run audit
|
|
62
148
|
let summary;
|
|
63
149
|
try {
|
|
@@ -68,6 +154,11 @@ export async function runCli(args = process.argv.slice(2)) {
|
|
|
68
154
|
console.error(`Error: ${message}`);
|
|
69
155
|
return 1;
|
|
70
156
|
}
|
|
157
|
+
if (summary.cacheStats && summary.cacheStats.total > 0) {
|
|
158
|
+
const { hits, total, bytesSavedEstimate } = summary.cacheStats;
|
|
159
|
+
const mb = (bytesSavedEstimate / (1024 * 1024)).toFixed(2);
|
|
160
|
+
console.error(`Cache: ${hits}/${total} hits (${mb} MB saved)`);
|
|
161
|
+
}
|
|
71
162
|
// Format output
|
|
72
163
|
const output = format === "console"
|
|
73
164
|
? formatConsole(summary, { noColor: !opts.color })
|
|
@@ -83,8 +174,22 @@ export async function runCli(args = process.argv.slice(2)) {
|
|
|
83
174
|
else {
|
|
84
175
|
console.log(output);
|
|
85
176
|
}
|
|
86
|
-
// Exit code based on threshold
|
|
87
|
-
|
|
177
|
+
// Exit code based on threshold + regression
|
|
178
|
+
let exitCode = summary.score >= threshold ? 1 : 0;
|
|
179
|
+
if (summary.hasRegression) {
|
|
180
|
+
console.error("Regression detected: new rule IDs fired vs prior state");
|
|
181
|
+
exitCode = Math.max(exitCode, 1);
|
|
182
|
+
}
|
|
183
|
+
return exitCode;
|
|
184
|
+
}
|
|
185
|
+
function parseDuration(s) {
|
|
186
|
+
const m = s.match(/^(\d+)(ms|s|m|h|d)$/);
|
|
187
|
+
if (!m)
|
|
188
|
+
throw new Error(`invalid duration: ${s}. Use e.g. 1h, 30m, 7d.`);
|
|
189
|
+
const n = Number(m[1]);
|
|
190
|
+
const unit = m[2];
|
|
191
|
+
const mul = { ms: 1, s: 1000, m: 60_000, h: 3_600_000, d: 86_400_000 }[unit] ?? 1;
|
|
192
|
+
return n * mul;
|
|
88
193
|
}
|
|
89
194
|
// Direct execution
|
|
90
195
|
const scriptUrl = `file://${process.argv[1]?.replace(/\\/g, "/")}`;
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,aAAa,EACb,UAAU,EACV,cAAc,EACd,UAAU,GACX,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAItE,MAAM,UAAU,GAA0D;IACxE,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,UAAU;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,WAAW,EAC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AAC,CAAC,IAAI,EAAE,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -9,6 +9,28 @@ export interface CliFlags {
|
|
|
9
9
|
browserWsEndpoint?: string;
|
|
10
10
|
};
|
|
11
11
|
crawlDiscovery?: boolean;
|
|
12
|
+
cache?: {
|
|
13
|
+
dir?: string;
|
|
14
|
+
ttlMs: number;
|
|
15
|
+
};
|
|
16
|
+
samplingStrategy?: "stratified" | "random";
|
|
17
|
+
maxPerTemplate?: number;
|
|
18
|
+
state?: {
|
|
19
|
+
path?: string;
|
|
20
|
+
since?: boolean;
|
|
21
|
+
exitOnRegression?: boolean;
|
|
22
|
+
};
|
|
23
|
+
ai?: {
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
provider?: "anthropic" | "ollama";
|
|
26
|
+
model?: string;
|
|
27
|
+
endpoint?: string;
|
|
28
|
+
maxInputTokens?: number;
|
|
29
|
+
suggest?: boolean;
|
|
30
|
+
cache?: {
|
|
31
|
+
ttlMs?: number;
|
|
32
|
+
} | false;
|
|
33
|
+
};
|
|
12
34
|
}
|
|
13
35
|
export declare function mergeOptions(configFile: AuditOptions, cliFlags: CliFlags): AuditOptions;
|
|
14
36
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA0EnD,wBAAsB,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC,CAUxD;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,gBAAgB,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACvE,EAAE,CAAC,EAAE;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;QAClC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,KAAK,CAAC;KACpC,CAAC;CACH;AAED,wBAAgB,YAAY,CAC1B,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,QAAQ,GACjB,YAAY,CAkCd"}
|
package/dist/config.js
CHANGED
|
@@ -36,6 +36,39 @@ const auditOptionsSchema = z.object({
|
|
|
36
36
|
}).optional(),
|
|
37
37
|
crawlDiscovery: z.boolean().optional(),
|
|
38
38
|
templateGenerated: z.boolean().optional(),
|
|
39
|
+
entityPatterns: z.array(z.object({
|
|
40
|
+
placeholder: z.string(),
|
|
41
|
+
pattern: z.string(),
|
|
42
|
+
flags: z.string().optional(),
|
|
43
|
+
})).optional(),
|
|
44
|
+
cache: z.object({
|
|
45
|
+
dir: z.string().optional(),
|
|
46
|
+
ttlMs: z.number().optional(),
|
|
47
|
+
}).optional(),
|
|
48
|
+
state: z.object({
|
|
49
|
+
path: z.string().optional(),
|
|
50
|
+
since: z.boolean().optional(),
|
|
51
|
+
exitOnRegression: z.boolean().optional(),
|
|
52
|
+
}).optional(),
|
|
53
|
+
samplingStrategy: z.enum(["stratified", "random"]).optional(),
|
|
54
|
+
maxPerTemplate: z.number().optional(),
|
|
55
|
+
ai: z.object({
|
|
56
|
+
enabled: z.boolean().optional(),
|
|
57
|
+
provider: z.enum(["anthropic", "ollama"]).optional(),
|
|
58
|
+
model: z.string().optional(),
|
|
59
|
+
endpoint: z.string().optional(),
|
|
60
|
+
apiKey: z.string().optional(),
|
|
61
|
+
maxInputTokens: z.number().optional(),
|
|
62
|
+
maxOutputTokens: z.number().optional(),
|
|
63
|
+
suggest: z.boolean().optional(),
|
|
64
|
+
cache: z.union([
|
|
65
|
+
z.object({
|
|
66
|
+
ttlMs: z.number().optional(),
|
|
67
|
+
dir: z.string().optional(),
|
|
68
|
+
}),
|
|
69
|
+
z.literal(false),
|
|
70
|
+
]).optional(),
|
|
71
|
+
}).optional(),
|
|
39
72
|
});
|
|
40
73
|
export async function loadConfig() {
|
|
41
74
|
const explorer = cosmiconfig("pseolint");
|
|
@@ -60,6 +93,42 @@ export function mergeOptions(configFile, cliFlags) {
|
|
|
60
93
|
result.render = cliFlags.render;
|
|
61
94
|
if (cliFlags.crawlDiscovery !== undefined)
|
|
62
95
|
result.crawlDiscovery = cliFlags.crawlDiscovery;
|
|
96
|
+
if (cliFlags.cache !== undefined)
|
|
97
|
+
result.cache = cliFlags.cache;
|
|
98
|
+
if (cliFlags.samplingStrategy !== undefined)
|
|
99
|
+
result.samplingStrategy = cliFlags.samplingStrategy;
|
|
100
|
+
if (cliFlags.maxPerTemplate !== undefined)
|
|
101
|
+
result.maxPerTemplate = cliFlags.maxPerTemplate;
|
|
102
|
+
if (cliFlags.state !== undefined)
|
|
103
|
+
result.state = cliFlags.state;
|
|
104
|
+
if (cliFlags.ai !== undefined) {
|
|
105
|
+
const merged = { ...result.ai };
|
|
106
|
+
if (cliFlags.ai.enabled !== undefined)
|
|
107
|
+
merged.enabled = cliFlags.ai.enabled;
|
|
108
|
+
if (cliFlags.ai.provider !== undefined)
|
|
109
|
+
merged.provider = cliFlags.ai.provider;
|
|
110
|
+
if (cliFlags.ai.model !== undefined)
|
|
111
|
+
merged.model = cliFlags.ai.model;
|
|
112
|
+
if (cliFlags.ai.endpoint !== undefined)
|
|
113
|
+
merged.endpoint = cliFlags.ai.endpoint;
|
|
114
|
+
if (cliFlags.ai.maxInputTokens !== undefined)
|
|
115
|
+
merged.maxInputTokens = cliFlags.ai.maxInputTokens;
|
|
116
|
+
if (cliFlags.ai.suggest !== undefined)
|
|
117
|
+
merged.suggest = cliFlags.ai.suggest;
|
|
118
|
+
if (cliFlags.ai.cache !== undefined) {
|
|
119
|
+
if (cliFlags.ai.cache === false) {
|
|
120
|
+
merged.cache = false;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
const prior = typeof result.ai?.cache === "object" ? result.ai.cache : undefined;
|
|
124
|
+
merged.cache = {
|
|
125
|
+
...(prior ?? {}),
|
|
126
|
+
...(cliFlags.ai.cache.ttlMs !== undefined && { ttlMs: cliFlags.ai.cache.ttlMs }),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
result.ai = merged;
|
|
131
|
+
}
|
|
63
132
|
return result;
|
|
64
133
|
}
|
|
65
134
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EA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,GAAG,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC;QAC/E,IAAI,QAAQ,CAAC,EAAE,CAAC,cAAc,KAAK,SAAS;YAAE,MAAM,CAAC,cAAc,GAAG,QAAQ,CAAC,EAAE,CAAC,cAAc,CAAC;QACjG,IAAI,QAAQ,CAAC,EAAE,CAAC,OAAO,KAAK,SAAS;YAAE,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC;QAC5E,IAAI,QAAQ,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,QAAQ,CAAC,EAAE,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;gBAChC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,GAAG,OAAO,MAAM,CAAC,EAAE,EAAE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;gBACjF,MAAM,CAAC,KAAK,GAAG;oBACb,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;oBAChB,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;iBACjF,CAAC;YACJ,CAAC;QACH,CAAC;QACD,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { runCli } from "./cli.js";
|
|
2
|
+
export { startMcpServer } from "./mcp.js";
|
|
2
3
|
export * from "@pseolint/core";
|
|
4
|
+
import type { AuditOptions } from "@pseolint/core";
|
|
5
|
+
export declare function defineConfig(config: AuditOptions): AuditOptions;
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAE/D"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAI/B,MAAM,UAAU,YAAY,CAAC,MAAoB;IAC/C,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/mcp.js
ADDED
package/dist/mcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pseolint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Programmatic SEO linter CLI — SpamBrain-proof your pSEO before you publish",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ouranos Labs <contact@ouranos-labs.dev>",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@pseolint/core": "workspace:*",
|
|
40
|
+
"@pseolint/mcp": "workspace:*",
|
|
40
41
|
"commander": "^14.0.3",
|
|
41
42
|
"cosmiconfig": "^9.0.1",
|
|
42
43
|
"zod": "^4.3.6"
|