mcp-scraper 0.6.0 → 0.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.
- package/dist/bin/api-server.cjs +296 -198
- package/dist/bin/api-server.cjs.map +1 -1
- package/dist/bin/api-server.js +2 -2
- package/dist/bin/mcp-scraper-cli.cjs +1 -1
- package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
- package/dist/bin/mcp-scraper-cli.js +1 -1
- package/dist/bin/mcp-scraper-install.cjs +1 -1
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +1 -1
- package/dist/bin/mcp-stdio-server.cjs +3 -3
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +3 -3
- package/dist/bin/paa-harvest.cjs +166 -74
- package/dist/bin/paa-harvest.cjs.map +1 -1
- package/dist/bin/paa-harvest.js +1 -1
- package/dist/chunk-EGWJ74EX.js +7 -0
- package/dist/chunk-EGWJ74EX.js.map +1 -0
- package/dist/{chunk-APJO2XV5.js → chunk-HL33CGJF.js} +3 -3
- package/dist/{chunk-APJO2XV5.js.map → chunk-HL33CGJF.js.map} +1 -1
- package/dist/{chunk-AUCXKRRH.js → chunk-RMPPYKUV.js} +167 -75
- package/dist/chunk-RMPPYKUV.js.map +1 -0
- package/dist/{chunk-BL7BBSYF.js → chunk-RUGJE5EB.js} +2 -2
- package/dist/{chunk-3K5GT6VG.js → chunk-YGRZU7IR.js} +3 -3
- package/dist/index.cjs +166 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{server-WHM446IZ.js → server-JNY4XPZE.js} +81 -76
- package/dist/server-JNY4XPZE.js.map +1 -0
- package/dist/{site-extract-repository-U476J44K.js → site-extract-repository-NVSZH35Y.js} +3 -3
- package/dist/{worker-KJZ3ZN2N.js → worker-JQTS437L.js} +4 -4
- package/dist/worker-JQTS437L.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-AUCXKRRH.js.map +0 -1
- package/dist/chunk-F2BXETDX.js +0 -7
- package/dist/chunk-F2BXETDX.js.map +0 -1
- package/dist/server-WHM446IZ.js.map +0 -1
- package/dist/worker-KJZ3ZN2N.js.map +0 -1
- package/docs/spec-browser-routing.md +0 -108
- package/docs/spec-kernel-computer-controls.md +0 -166
- package/docs/spec-mcp-tools.md +0 -146
- package/docs/spec-server-instructions.md +0 -94
- package/docs/specs/agent-ready-seo-packet-spec.md +0 -237
- package/docs/specs/audit-visual-demo.md +0 -309
- package/docs/specs/cli-agent-wiring-spec.md +0 -206
- package/docs/specs/local-competitive-audit-spec.md +0 -311
- package/docs/specs/scheduled-workflows-api-spec.md +0 -304
- package/docs/specs/seo-cli-growth-roadmap-spec.md +0 -181
- package/docs/specs/seo-workflow-runner-and-reports-spec.md +0 -241
- /package/dist/{chunk-BL7BBSYF.js.map → chunk-RUGJE5EB.js.map} +0 -0
- /package/dist/{chunk-3K5GT6VG.js.map → chunk-YGRZU7IR.js.map} +0 -0
- /package/dist/{site-extract-repository-U476J44K.js.map → site-extract-repository-NVSZH35Y.js.map} +0 -0
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
# SEO Workflow Runner + Local Reports — Implementation Spec
|
|
2
|
-
|
|
3
|
-
This spec introduces a human CLI workflow runner and a shared artifact/report system. It wraps existing MCP Scraper capabilities into named SEO workflows with predictable local outputs.
|
|
4
|
-
|
|
5
|
-
## Goals
|
|
6
|
-
|
|
7
|
-
- Run high-value SEO workflows from the CLI.
|
|
8
|
-
- Save useful local artifacts every time.
|
|
9
|
-
- Provide local HTML reports that are easy to inspect or share.
|
|
10
|
-
- Keep workflow logic reusable by hosted API schedules later.
|
|
11
|
-
- Avoid duplicating tool logic already implemented in MCP/API handlers.
|
|
12
|
-
|
|
13
|
-
## Command surface
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
mcp-scraper-cli workflow list
|
|
17
|
-
mcp-scraper-cli workflow describe local-competitive-audit
|
|
18
|
-
mcp-scraper-cli workflow run directory --query roofers --state TN --min-pop 100000 --per-city 20
|
|
19
|
-
mcp-scraper-cli workflow run agent-packet --keyword "roof repair Denver" --domain example.com
|
|
20
|
-
mcp-scraper-cli report open last
|
|
21
|
-
mcp-scraper-cli report path last
|
|
22
|
-
mcp-scraper-cli report list
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Global flags:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
--output-dir <path>
|
|
29
|
-
--format html,json,md,csv
|
|
30
|
-
--json
|
|
31
|
-
--no-open
|
|
32
|
-
--api-url <url>
|
|
33
|
-
--api-key <key>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Workflow registry
|
|
37
|
-
|
|
38
|
-
New module:
|
|
39
|
-
|
|
40
|
-
```text
|
|
41
|
-
src/workflows/
|
|
42
|
-
registry.ts
|
|
43
|
-
types.ts
|
|
44
|
-
artifact-writer.ts
|
|
45
|
-
report-renderer.ts
|
|
46
|
-
workflows/
|
|
47
|
-
directory.ts
|
|
48
|
-
agent-packet.ts
|
|
49
|
-
local-competitive-audit.ts
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Types:
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
export interface WorkflowDefinition<TInput, TResult> {
|
|
56
|
-
id: string
|
|
57
|
-
title: string
|
|
58
|
-
description: string
|
|
59
|
-
inputSchema: z.ZodType<TInput>
|
|
60
|
-
estimate(input: TInput): Promise<WorkflowEstimate>
|
|
61
|
-
run(input: TInput, ctx: WorkflowRunContext): Promise<TResult>
|
|
62
|
-
render(result: TResult, ctx: WorkflowRunContext): Promise<WorkflowArtifacts>
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface WorkflowRunContext {
|
|
66
|
-
runId: string
|
|
67
|
-
startedAt: string
|
|
68
|
-
outputDir: string
|
|
69
|
-
apiKey?: string
|
|
70
|
-
apiUrl: string
|
|
71
|
-
logger: WorkflowLogger
|
|
72
|
-
artifacts: ArtifactWriter
|
|
73
|
-
signal?: AbortSignal
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The registry is local code, not model-driven. Agents can discover workflows through `workflow list`, and MCP tools can later expose the same registry through structured content.
|
|
78
|
-
|
|
79
|
-
## Artifact contract
|
|
80
|
-
|
|
81
|
-
Each run creates:
|
|
82
|
-
|
|
83
|
-
```text
|
|
84
|
-
~/Downloads/mcp-scraper/workflows/<workflow>/<timestamp>-<slug>/
|
|
85
|
-
manifest.json
|
|
86
|
-
report.html
|
|
87
|
-
summary.md
|
|
88
|
-
evidence.json
|
|
89
|
-
tasks.md
|
|
90
|
-
exports/*.csv
|
|
91
|
-
logs/attempts.jsonl
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
`manifest.json`:
|
|
95
|
-
|
|
96
|
-
```ts
|
|
97
|
-
interface WorkflowManifest {
|
|
98
|
-
workflow: string
|
|
99
|
-
title: string
|
|
100
|
-
runId: string
|
|
101
|
-
status: 'running' | 'succeeded' | 'partial' | 'failed'
|
|
102
|
-
startedAt: string
|
|
103
|
-
completedAt: string | null
|
|
104
|
-
input: Record<string, unknown>
|
|
105
|
-
artifacts: Array<{
|
|
106
|
-
kind: 'html_report' | 'markdown' | 'json' | 'csv' | 'log'
|
|
107
|
-
label: string
|
|
108
|
-
path: string
|
|
109
|
-
bytes?: number
|
|
110
|
-
rows?: number
|
|
111
|
-
}>
|
|
112
|
-
warnings: string[]
|
|
113
|
-
errors: string[]
|
|
114
|
-
counts: Record<string, number>
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## HTML report renderer
|
|
119
|
-
|
|
120
|
-
No frontend framework required for the first version. Generate standalone HTML with embedded CSS and static tables.
|
|
121
|
-
|
|
122
|
-
Report sections:
|
|
123
|
-
|
|
124
|
-
1. Header: workflow, input, run status, date, artifact links.
|
|
125
|
-
2. Executive summary.
|
|
126
|
-
3. Evidence tables.
|
|
127
|
-
4. Competitors/sources table when available.
|
|
128
|
-
5. Findings.
|
|
129
|
-
6. Recommended actions.
|
|
130
|
-
7. Diagnostics: attempts, partial failures, location confidence, warnings.
|
|
131
|
-
|
|
132
|
-
Files:
|
|
133
|
-
|
|
134
|
-
- `src/workflows/report-renderer.ts`
|
|
135
|
-
- `src/workflows/report-template.ts`
|
|
136
|
-
- `tests/unit/workflow-report-renderer.test.ts`
|
|
137
|
-
|
|
138
|
-
## Local report index
|
|
139
|
-
|
|
140
|
-
Maintain:
|
|
141
|
-
|
|
142
|
-
```text
|
|
143
|
-
~/Downloads/mcp-scraper/workflows/index.json
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
Shape:
|
|
147
|
-
|
|
148
|
-
```ts
|
|
149
|
-
interface WorkflowRunIndex {
|
|
150
|
-
runs: Array<{
|
|
151
|
-
workflow: string
|
|
152
|
-
runId: string
|
|
153
|
-
status: string
|
|
154
|
-
startedAt: string
|
|
155
|
-
reportPath: string | null
|
|
156
|
-
manifestPath: string
|
|
157
|
-
summary: string
|
|
158
|
-
}>
|
|
159
|
-
}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Commands:
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
mcp-scraper-cli report list
|
|
166
|
-
mcp-scraper-cli report open last
|
|
167
|
-
mcp-scraper-cli report open <runId>
|
|
168
|
-
mcp-scraper-cli report path <runId>
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Opening behavior:
|
|
172
|
-
|
|
173
|
-
- macOS: `open <reportPath>`.
|
|
174
|
-
- Other platforms: print path.
|
|
175
|
-
- `--json`: return machine-readable path only.
|
|
176
|
-
|
|
177
|
-
## Initial workflows
|
|
178
|
-
|
|
179
|
-
### `directory`
|
|
180
|
-
|
|
181
|
-
Wrapper around existing `directory_workflow`.
|
|
182
|
-
|
|
183
|
-
Input:
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
--query roofers
|
|
187
|
-
--state TN
|
|
188
|
-
--min-pop 100000
|
|
189
|
-
--per-city 20
|
|
190
|
-
--concurrency 5
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
Output:
|
|
194
|
-
|
|
195
|
-
- Existing directory CSV.
|
|
196
|
-
- HTML summary of markets, city status, result counts, top businesses.
|
|
197
|
-
- `evidence.json` preserving structured `directory_workflow` response.
|
|
198
|
-
|
|
199
|
-
### `agent-packet`
|
|
200
|
-
|
|
201
|
-
Specified in `agent-ready-seo-packet-spec.md`.
|
|
202
|
-
|
|
203
|
-
### `local-competitive-audit`
|
|
204
|
-
|
|
205
|
-
Specified in `local-competitive-audit-spec.md`.
|
|
206
|
-
|
|
207
|
-
## Hosted versus local execution
|
|
208
|
-
|
|
209
|
-
First implementation should call hosted API endpoints when available:
|
|
210
|
-
|
|
211
|
-
- `/directory/run`
|
|
212
|
-
- `/maps/search`
|
|
213
|
-
- `/maps/place-intel`
|
|
214
|
-
- `/serp/...` and `/harvest/...` where already available.
|
|
215
|
-
|
|
216
|
-
Local-only helpers are acceptable for report assembly and artifact writing.
|
|
217
|
-
|
|
218
|
-
Do not directly duplicate extraction code in the CLI.
|
|
219
|
-
|
|
220
|
-
## Error and partial-result behavior
|
|
221
|
-
|
|
222
|
-
Workflow runs should prefer `partial` over `failed` when useful artifacts exist.
|
|
223
|
-
|
|
224
|
-
Examples:
|
|
225
|
-
|
|
226
|
-
- 8 of 10 cities succeed: status `partial`, report includes failed city diagnostics.
|
|
227
|
-
- PAA fails but SERP succeeds: `agent-packet` still writes SERP evidence and missing PAA warning.
|
|
228
|
-
- Review hydration fails for some competitors: audit keeps directory result and marks review fields unavailable.
|
|
229
|
-
|
|
230
|
-
## Tests
|
|
231
|
-
|
|
232
|
-
- `workflow list` contains `directory`, `agent-packet`, `local-competitive-audit`.
|
|
233
|
-
- `directory` workflow with mocked API writes manifest, report, evidence JSON, CSV link.
|
|
234
|
-
- Report renderer escapes HTML.
|
|
235
|
-
- `report open last --json` returns the expected path without launching.
|
|
236
|
-
- Partial runs preserve artifacts and warnings.
|
|
237
|
-
|
|
238
|
-
## MCP description impact
|
|
239
|
-
|
|
240
|
-
When the CLI workflows are stable, expose `workflow_recipe` or `workflow_plan` as a local planning MCP tool only if needed. Do not add a paid MCP workflow runner until the local CLI and hosted API schedule surfaces settle.
|
|
241
|
-
|
|
File without changes
|
|
File without changes
|
/package/dist/{site-extract-repository-U476J44K.js.map → site-extract-repository-NVSZH35Y.js.map}
RENAMED
|
File without changes
|