mcp-scraper 0.4.6 → 0.4.12
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 +1532 -1351
- 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 +1 -1
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +2 -2
- package/dist/bin/paa-harvest.cjs +13 -4
- package/dist/bin/paa-harvest.cjs.map +1 -1
- package/dist/bin/paa-harvest.js +1 -1
- package/dist/{chunk-5GAD2AN2.js → chunk-2YY46QYT.js} +27 -10
- package/dist/chunk-2YY46QYT.js.map +1 -0
- package/dist/{chunk-IFXACD4K.js → chunk-6EXP6DQG.js} +2 -2
- package/dist/{chunk-IVQYNY45.js → chunk-EMY7ELRU.js} +23 -6
- package/dist/chunk-EMY7ELRU.js.map +1 -0
- package/dist/{chunk-NYAWN7CZ.js → chunk-ONIOF5XW.js} +2 -2
- package/dist/chunk-SHXJQQOH.js +7 -0
- package/dist/chunk-SHXJQQOH.js.map +1 -0
- package/dist/index.cjs +59 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/{server-R3KVQNOT.js → server-UNID3SJU.js} +409 -272
- package/dist/server-UNID3SJU.js.map +1 -0
- package/dist/{site-extract-repository-LI2S3S6E.js → site-extract-repository-HTIY52MW.js} +3 -3
- package/dist/{worker-VASAJ7FZ.js → worker-HTYZAYGB.js} +16 -12
- package/dist/worker-HTYZAYGB.js.map +1 -0
- package/package.json +1 -2
- package/dist/chunk-5BB6Y3BB.js +0 -7
- package/dist/chunk-5BB6Y3BB.js.map +0 -1
- package/dist/chunk-5GAD2AN2.js.map +0 -1
- package/dist/chunk-IVQYNY45.js.map +0 -1
- package/dist/server-R3KVQNOT.js.map +0 -1
- package/dist/worker-VASAJ7FZ.js.map +0 -1
- /package/dist/{chunk-IFXACD4K.js.map → chunk-6EXP6DQG.js.map} +0 -0
- /package/dist/{chunk-NYAWN7CZ.js.map → chunk-ONIOF5XW.js.map} +0 -0
- /package/dist/{site-extract-repository-LI2S3S6E.js.map → site-extract-repository-HTIY52MW.js.map} +0 -0
package/dist/bin/paa-harvest.js
CHANGED
|
@@ -38,16 +38,23 @@ import { randomUUID } from "crypto";
|
|
|
38
38
|
// src/api/cost-rates.ts
|
|
39
39
|
var KERNEL_HEADLESS_USD_PER_SEC = 166667e-10;
|
|
40
40
|
var KERNEL_HEADFUL_USD_PER_SEC = 1333336e-10;
|
|
41
|
-
var HEADLESS_OPS = /* @__PURE__ */ new Set(["
|
|
42
|
-
var
|
|
41
|
+
var HEADLESS_OPS = /* @__PURE__ */ new Set(["serp", "maps_search", "yt_channel", "yt_transcription", "fb_search", "fb_ad", "instagram"]);
|
|
42
|
+
var FAL_WIZPER_USD_PER_COMPUTE_SEC = 111e-5;
|
|
43
|
+
var FAL_WIZPER_WALLCLOCK_TO_COMPUTE_SEC_FACTOR = 4;
|
|
43
44
|
var DEEPINFRA_QWEN_USD_PER_1K_OUT_TOKENS = 4e-4;
|
|
44
45
|
function kernelCostUsd(ms, headful) {
|
|
45
46
|
const sec = Math.max(0, ms) / 1e3;
|
|
46
47
|
return sec * (headful ? KERNEL_HEADFUL_USD_PER_SEC : KERNEL_HEADLESS_USD_PER_SEC);
|
|
47
48
|
}
|
|
48
49
|
function vendorCostUsd(vendor, units) {
|
|
49
|
-
if (vendor === "fal_wizper")
|
|
50
|
+
if (vendor === "fal_wizper") {
|
|
51
|
+
const estimatedComputeSec = Math.max(0, units) / FAL_WIZPER_WALLCLOCK_TO_COMPUTE_SEC_FACTOR;
|
|
52
|
+
return estimatedComputeSec * FAL_WIZPER_USD_PER_COMPUTE_SEC;
|
|
53
|
+
}
|
|
50
54
|
if (vendor === "deepinfra_qwen") return Math.max(0, units) / 1e3 * DEEPINFRA_QWEN_USD_PER_1K_OUT_TOKENS;
|
|
55
|
+
if (vendor === "openrouter") return Math.max(0, units);
|
|
56
|
+
if (vendor === "mcp_memory_video") return Math.max(0, units);
|
|
57
|
+
if (vendor === "mcp_memory_ai") return Math.max(0, units);
|
|
51
58
|
return 0;
|
|
52
59
|
}
|
|
53
60
|
|
|
@@ -88,6 +95,10 @@ async function migrateCostTelemetry() {
|
|
|
88
95
|
await db.execute(`ALTER TABLE kernel_session_log ADD COLUMN proxy_type TEXT`);
|
|
89
96
|
} catch {
|
|
90
97
|
}
|
|
98
|
+
try {
|
|
99
|
+
await db.execute(`ALTER TABLE kernel_session_log ADD COLUMN method TEXT`);
|
|
100
|
+
} catch {
|
|
101
|
+
}
|
|
91
102
|
await db.execute(`
|
|
92
103
|
CREATE TABLE IF NOT EXISTS vendor_usage_log (
|
|
93
104
|
id TEXT PRIMARY KEY,
|
|
@@ -106,6 +117,10 @@ async function migrateCostTelemetry() {
|
|
|
106
117
|
await db.execute(`CREATE INDEX IF NOT EXISTS vendor_usage_log_op ON vendor_usage_log(op)`);
|
|
107
118
|
await db.execute(`CREATE INDEX IF NOT EXISTS vendor_usage_log_probe ON vendor_usage_log(probe_run_id)`);
|
|
108
119
|
await db.execute(`CREATE INDEX IF NOT EXISTS vendor_usage_log_created ON vendor_usage_log(created_at)`);
|
|
120
|
+
try {
|
|
121
|
+
await db.execute(`ALTER TABLE vendor_usage_log ADD COLUMN method TEXT`);
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
109
124
|
await db.execute(`
|
|
110
125
|
CREATE TABLE IF NOT EXISTS cost_probe_runs (
|
|
111
126
|
id TEXT PRIMARY KEY,
|
|
@@ -152,8 +167,8 @@ async function recordKernelSession(r) {
|
|
|
152
167
|
const db = getDb();
|
|
153
168
|
await db.execute({
|
|
154
169
|
sql: `INSERT INTO kernel_session_log
|
|
155
|
-
(id, kernel_session_id, op, source, probe_run_id, user_id, stealth, headless_sent, proxy_used, proxy_source, proxy_type, fallback, opened_at, closed_at, duration_ms, est_cost_usd_headless, est_cost_usd_headful, error)
|
|
156
|
-
VALUES (
|
|
170
|
+
(id, kernel_session_id, op, source, probe_run_id, user_id, stealth, headless_sent, proxy_used, proxy_source, proxy_type, fallback, opened_at, closed_at, duration_ms, est_cost_usd_headless, est_cost_usd_headful, error, method)
|
|
171
|
+
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
|
157
172
|
args: [
|
|
158
173
|
randomUUID(),
|
|
159
174
|
r.kernelSessionId ?? null,
|
|
@@ -172,7 +187,8 @@ async function recordKernelSession(r) {
|
|
|
172
187
|
durationMs,
|
|
173
188
|
kernelCostUsd(durationMs, false),
|
|
174
189
|
kernelCostUsd(durationMs, true),
|
|
175
|
-
r.error ?? null
|
|
190
|
+
r.error ?? null,
|
|
191
|
+
ctx?.subOp ?? null
|
|
176
192
|
]
|
|
177
193
|
});
|
|
178
194
|
} catch (err) {
|
|
@@ -186,8 +202,8 @@ async function recordVendorUsage(r) {
|
|
|
186
202
|
const db = getDb();
|
|
187
203
|
await db.execute({
|
|
188
204
|
sql: `INSERT INTO vendor_usage_log
|
|
189
|
-
(id, op, probe_run_id, user_id, vendor, model, units, unit_type, est_cost_usd, error)
|
|
190
|
-
VALUES (
|
|
205
|
+
(id, op, probe_run_id, user_id, vendor, model, units, unit_type, est_cost_usd, error, method)
|
|
206
|
+
VALUES (?,?,?,?,?,?,?,?,?,?,?)`,
|
|
191
207
|
args: [
|
|
192
208
|
randomUUID(),
|
|
193
209
|
ctx?.op ?? null,
|
|
@@ -198,7 +214,8 @@ async function recordVendorUsage(r) {
|
|
|
198
214
|
r.units,
|
|
199
215
|
r.unitType,
|
|
200
216
|
vendorCostUsd(r.vendor, r.units),
|
|
201
|
-
r.error ?? null
|
|
217
|
+
r.error ?? null,
|
|
218
|
+
ctx?.subOp ?? null
|
|
202
219
|
]
|
|
203
220
|
});
|
|
204
221
|
} catch (err) {
|
|
@@ -3258,4 +3275,4 @@ export {
|
|
|
3258
3275
|
resolveKernelProxyId,
|
|
3259
3276
|
harvest
|
|
3260
3277
|
};
|
|
3261
|
-
//# sourceMappingURL=chunk-
|
|
3278
|
+
//# sourceMappingURL=chunk-2YY46QYT.js.map
|