mcp-scraper 0.79.4 → 0.81.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/CHANGELOG.md +49 -1
- package/README.md +4 -2
- package/dist/bin/api-server.js +2 -2
- package/dist/bin/mcp-scraper-cli.js +1 -1
- package/dist/bin/mcp-scraper-core.js +6 -6
- package/dist/bin/mcp-scraper-install.js +2 -2
- package/dist/bin/mcp-stdio-server.js +6 -6
- package/dist/bin/paa-harvest.js +2 -2
- package/dist/{chunk-ETQ7J2EB.js → chunk-M2A7YSJV.js} +2 -2
- package/dist/{chunk-KNGTQD6U.js → chunk-NH4QAH3X.js} +3 -1
- package/dist/{chunk-5UAFBKJR.js → chunk-OPQIGAFB.js} +24 -5
- package/dist/{chunk-VFCUGTCF.js → chunk-PMONKQGJ.js} +2 -2
- package/dist/{chunk-N63ZFFU2.js → chunk-RSXDHQBA.js} +1 -1
- package/dist/{chunk-3423R23T.js → chunk-VWC7XATD.js} +2 -2
- package/dist/{chunk-YBR32LOD.js → chunk-XBEUZJHS.js} +1 -1
- package/dist/{chunk-RUBI3OXR.js → chunk-XWXCLKXF.js} +6727 -5011
- package/dist/{chunk-PQVLX5WT.js → chunk-Z63DQAO7.js} +3 -3
- package/dist/{extract-bundle-S3ZGNFML.js → extract-bundle-232SA7MI.js} +2 -2
- package/dist/{gmail-service-YFS2OV4S.js → gmail-service-2A3ZZT3M.js} +3 -3
- package/dist/index.cjs +23 -5
- package/dist/index.js +2 -2
- package/dist/{server-BMQKWVCZ.js → server-QRYEMF4H.js} +11101 -4909
- package/dist/{site-extract-repository-WAJMIDPJ.js → site-extract-repository-VDONDDMR.js} +2 -2
- package/dist/{worker-3LUFQWWJ.js → worker-2MY77WYY.js} +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,50 @@ All notable changes to MCP Scraper are documented here. The format is based on [
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.81.0] - 2026-08-31
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Added a Kernel-only Reddit workflow that searches DuckDuckGo with a `site:reddit.com` query, switches the same browser to a residential proxy before clicking the selected result, and reads modern Reddit posts plus bounded rendered-comment expansion through dedicated search, thread, and combined REST endpoints.
|
|
12
|
+
- Added a bounded managed-browser backup for Reddit thread hydration after the primary Kernel attempt fails or returns fewer than the semantic target, capped at 25 comments with measured bandwidth, duration, CAPTCHA, closure, and provider-cost telemetry.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Routed the production `reddit_thread` and `reddit_trending` MCP tools through modern Reddit on Kernel residential sessions, with DuckDuckGo site search for trend discovery; removed Google and old Reddit from their active execution path while preserving tool names, billing rates, bounded partial results, and refunds.
|
|
17
|
+
- Cost probes now include Reddit Kernel sessions and any managed-browser fallback bytes and cost in the same request receipt, and identify when the backup contributed to total cost.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Reconciled delayed managed-browser fallback telemetry back into its linked cost probe, correcting stored vendor totals and both margin estimates after provider finalization; cost probes now label unresolved provider cost as pending instead of reporting a false zero.
|
|
22
|
+
- Measured the package-entrypoint size guard against files selected by the package publish allowlist while continuing to reject source maps anywhere in the built distribution.
|
|
23
|
+
- Account publishing lists accept hosted routing metadata while retaining strict pagination, filtering, and account isolation.
|
|
24
|
+
- Added a private, paginated publishing inventory for each account’s wiki contributions, publication subdomains and editions, and Local Sourcebook listings, with canonical links and current publication status.
|
|
25
|
+
- Validated Twilio and HubSpot X-Ray webhook signatures against the exact public callback URL instead of an internal deployment origin or Vercel rewrite query, allowing genuine provider events to become live evidence after reverse-proxy delivery.
|
|
26
|
+
|
|
27
|
+
## [0.80.0] - 2026-08-29
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- Added a resumable Personal Assistant setup journey that separates product availability, operator activation, provider connections, sender registration and binding, personal-phone enrollment and consent, first-message testing, and per-feature readiness without erasing healthy state when one dependency is unavailable.
|
|
32
|
+
- Added verified recipient enrollment through inbound `START` or a short-lived web challenge, with masked owner-scoped contact records, versioned consent disclosures, safe resend and removal flows, and explicit sender and destination identity throughout Assistant and Scheduling.
|
|
33
|
+
- Added owner-safe diagnostics, fixed-message delivery tests, encrypted unknown-sender quarantine and authenticated claim flows, MMS and attachment lifecycle states, cost and usage controls, and reviewed export, revocation, removal, deletion, and number-release ceremonies.
|
|
34
|
+
- Added `assistant_diagnostics_get` and `assistant_delivery_test`, bringing the public catalog to 356 tools and the governed Assistant surface to 17 tools while preserving its two resources and one setup prompt.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Made Scheduling the only Personal Assistant automation lifecycle owner, with exact draft, readiness, reviewed persistence, activation, accepted readback, connection operations, browser login grants, delivery destinations, fallbacks, quiet hours, urgent exceptions, retry, expiry, and failure-notification parity.
|
|
39
|
+
- Expanded the authenticated Assistant owner API to 77 closed-schema operations and regenerated the OpenAPI, MCP manifest, CLI, cURL, Node, and Python contracts without generic or unknown schema fallbacks.
|
|
40
|
+
- Replaced generic hosted-adapter and “finish setup” failures with component-owned activation blockers, truthful connection health, safe retry guidance, and opaque support receipts.
|
|
41
|
+
|
|
42
|
+
### Security
|
|
43
|
+
|
|
44
|
+
- Kept regulatory contact information separate from delivery consent, prevented ambiguous tenant routing and hidden quarantined content from reaching an assistant, and required exact owner, sender, recipient, consent, grant, schedule, and idempotency evidence at every external-write boundary.
|
|
45
|
+
- Versioned `START`, `STOP`, `HELP`, privacy, terms, enrollment, first-message, and carrier-submission copy so live messaging policy can evolve without rewriting submitted provider evidence.
|
|
46
|
+
|
|
47
|
+
### Migration
|
|
48
|
+
|
|
49
|
+
- Advance the Personal Assistant database schema and deployment contract to `2026-08-28.13` before enabling the new recipient, quarantine, first-text diagnostic, or lifecycle routes. Hosted outbound messaging remains unavailable until the configured vault, Twilio resources, provider clients, administrator write authority, and carrier registration gates are verified.
|
|
50
|
+
|
|
7
51
|
## [0.79.4] - 2026-08-29
|
|
8
52
|
|
|
9
53
|
### Fixed
|
|
@@ -1500,7 +1544,11 @@ All notable changes to MCP Scraper are documented here. The format is based on [
|
|
|
1500
1544
|
- Write actions remain unavailable until the account owner explicitly enables them.
|
|
1501
1545
|
- Provider-specific connection data is normalized into one agent-facing contract.
|
|
1502
1546
|
|
|
1503
|
-
[Unreleased]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.
|
|
1547
|
+
[Unreleased]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.81.0...HEAD
|
|
1548
|
+
[0.81.0]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.80.0...v0.81.0
|
|
1549
|
+
[0.80.0]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.79.4...v0.80.0
|
|
1550
|
+
[0.79.4]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.79.3...v0.79.4
|
|
1551
|
+
[0.79.3]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.79.2...v0.79.3
|
|
1504
1552
|
[0.79.2]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.79.1...v0.79.2
|
|
1505
1553
|
[0.79.1]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.79.0...v0.79.1
|
|
1506
1554
|
[0.79.0]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.78.0...v0.79.0
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
MCP Scraper is an MCP server for live web intelligence tools backed by `https://mcpscraper.dev`.
|
|
4
4
|
|
|
5
|
+
The authenticated [Kernel Reddit API](docs/kernel-reddit.md) provides an ordered DuckDuckGo search, runtime residential-proxy handoff, real result click, and modern Reddit reader at `/kernel-reddit`.
|
|
6
|
+
|
|
5
7
|
## Product repository
|
|
6
8
|
|
|
7
9
|
This repository owns the complete private product runtime while preserving independent service and
|
|
@@ -173,7 +175,7 @@ Build the branded one-click bundle:
|
|
|
173
175
|
npm run build:mcpb
|
|
174
176
|
```
|
|
175
177
|
|
|
176
|
-
The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.
|
|
178
|
+
The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.81.0`, SHA-256 `866faf8d18568514b29f407c6789bc779e895c9780cfcee27eb958cb079cf244`). Install it by opening or dragging it into Claude Desktop. Claude displays the `MCP Scraper` install card, icon, API-key configuration field, and manually curated current-release message from the bundle manifest.
|
|
177
179
|
|
|
178
180
|
The MCPB install exposes every tool — web-intelligence plus all `browser_*` tools — through the one `mcp-scraper` server.
|
|
179
181
|
|
|
@@ -335,7 +337,7 @@ The `mcp-scraper` server (and the MCPB bundle, which runs it) exposes both secti
|
|
|
335
337
|
|
|
336
338
|
All MCP tools return `structuredContent` with the IDs, URLs, CSV paths, transcripts, browser session handles, replay paths, artifacts, recipe fields, or blueprint fields needed by the next step, plus readable text content for compatibility. Runtime `tools/list` omits output schemas so strict clients can register the complete catalog; the generated developer manifest retains every canonical output schema for validation and typed SDK generation. All tools carry MCP annotations; file-writing tools such as replay downloads and annotations state their filesystem side effects.
|
|
337
339
|
|
|
338
|
-
The canonical tool inventory is generated at `docs/mcp-tool-manifest.generated.json`. The unified server exposes
|
|
340
|
+
The canonical tool inventory is generated at `docs/mcp-tool-manifest.generated.json`. The unified server exposes 356 tools: 255 scraper, browser, workflow, billing, connected-service, and personal-assistant tools plus 101 durable-memory tools. The scraper-side inventory includes complete Gmail selection, message, attachment, export, bulk-action, and Memory-import workflows; governed personal-assistant commands, messaging, approvals, grants, number setup, and execution readback; durable PAA starts and status; rendered site-content similarity; governed Local Sourcebook and Transparent Commons workflows; direct site-export reads; Editorial Reading Room and News Publisher templates; and production X-Ray analytics, attribution, CRM policy and receipt, campaign, export, and scheduled-report tools. Successful evidence-compiled Local Sourcebook revisions publish automatically to their canonical `localsourcebook.com` category profile and review URLs; administrator controls handle exceptional rejection or unpublishing. Release verification compares the exact local and hosted tool-name sets, not only the count.
|
|
339
341
|
|
|
340
342
|
For contract parity, stdio and MCPB memory calls invoke the matching public tool on the hosted MCP Scraper `/mcp` endpoint. The hosted aggregate runtime owns MCP Scraper-specific billing, scheduling, credential, and in-process cutover policy; its internal `/memory/mcp-call` bridge is a fallback to the standalone memory service, not the public stdio execution path. Direct `mcp-memory` OAuth and stdio clients continue to use `memory.mcpscraper.dev` and must be verified as a separate dependent release surface.
|
|
341
343
|
|
package/dist/bin/api-server.js
CHANGED
|
@@ -17,8 +17,8 @@ loadDotEnv();
|
|
|
17
17
|
async function main() {
|
|
18
18
|
const [{ serve }, { app, personalAssistantProductionStartup }, { startWorker }, { migrate }] = await Promise.all([
|
|
19
19
|
import("@hono/node-server"),
|
|
20
|
-
import("../server-
|
|
21
|
-
import("../worker-
|
|
20
|
+
import("../server-QRYEMF4H.js"),
|
|
21
|
+
import("../worker-2MY77WYY.js"),
|
|
22
22
|
import("../db-Z34LPZNR.js")
|
|
23
23
|
]);
|
|
24
24
|
const PORT = parseInt(process.env.PORT ?? "3001");
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runMcpScraperStdio
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-Z63DQAO7.js";
|
|
5
|
+
import "../chunk-XWXCLKXF.js";
|
|
6
6
|
import "../chunk-PGJQDMC2.js";
|
|
7
7
|
import "../chunk-DNM65UCK.js";
|
|
8
8
|
import "../chunk-T3MZISOF.js";
|
|
9
9
|
import "../chunk-6HAV7LCE.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-PMONKQGJ.js";
|
|
11
11
|
import "../chunk-OM7HVEJ3.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-OPQIGAFB.js";
|
|
13
|
+
import "../chunk-M2A7YSJV.js";
|
|
14
14
|
import "../chunk-VXLU74YZ.js";
|
|
15
15
|
import "../chunk-GGZEC22A.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-RSXDHQBA.js";
|
|
17
17
|
import "../chunk-YXNDOQXN.js";
|
|
18
18
|
|
|
19
19
|
// src/mcp/thorbit-restricted-tool-surface.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
renderInstallTerminal
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-M2A7YSJV.js";
|
|
5
5
|
import {
|
|
6
6
|
PACKAGE_VERSION
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-RSXDHQBA.js";
|
|
8
8
|
|
|
9
9
|
// bin/mcp-scraper-install.ts
|
|
10
10
|
var noColor = process.argv.includes("--no-color") || process.env.NO_COLOR !== void 0 || process.env.FORCE_COLOR === "0" || !process.stdout.isTTY;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runMcpScraperStdio
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-Z63DQAO7.js";
|
|
5
|
+
import "../chunk-XWXCLKXF.js";
|
|
6
6
|
import "../chunk-PGJQDMC2.js";
|
|
7
7
|
import "../chunk-DNM65UCK.js";
|
|
8
8
|
import "../chunk-T3MZISOF.js";
|
|
9
9
|
import "../chunk-6HAV7LCE.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-PMONKQGJ.js";
|
|
11
11
|
import "../chunk-OM7HVEJ3.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-OPQIGAFB.js";
|
|
13
|
+
import "../chunk-M2A7YSJV.js";
|
|
14
14
|
import "../chunk-VXLU74YZ.js";
|
|
15
15
|
import "../chunk-GGZEC22A.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-RSXDHQBA.js";
|
|
17
17
|
import "../chunk-YXNDOQXN.js";
|
|
18
18
|
|
|
19
19
|
// bin/mcp-stdio-server.ts
|
package/dist/bin/paa-harvest.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
harvest
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NH4QAH3X.js";
|
|
5
5
|
import {
|
|
6
6
|
browserServiceApiKey
|
|
7
7
|
} from "../chunk-OM7HVEJ3.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-OPQIGAFB.js";
|
|
9
9
|
import "../chunk-OWF2JJKN.js";
|
|
10
10
|
import "../chunk-YXNDOQXN.js";
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// release-message.json
|
|
2
2
|
var release_message_default = {
|
|
3
|
-
message: "
|
|
3
|
+
message: "Reddit thread and trending tools now use residential browser retrieval with a bounded backup, honest partial-result handling, and measured fallback cost telemetry."
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
// src/install-terminal.ts
|
|
@@ -55,7 +55,7 @@ function renderInstallTerminal(options) {
|
|
|
55
55
|
"1/1 install surfaces ready",
|
|
56
56
|
colorize(`Newest in v${options.version}: ${release_message_default.message}`, "lime", color),
|
|
57
57
|
"",
|
|
58
|
-
`${colorize("Tools", "cyan", color)} ${colorize("(
|
|
58
|
+
`${colorize("Tools", "cyan", color)} ${colorize("(356 MCP tools)", "muted", color)}`,
|
|
59
59
|
toolRow("search", ["harvest_paa", "search_serp", "maps_search", "maps_place_intel"], color),
|
|
60
60
|
toolRow("extract", ["extract_url", "map_site_urls", "extract_site", "audit_site", "directory_workflow"], color),
|
|
61
61
|
toolRow("build", ["create_editorial_reading_room", "rank_tracker_workflow", "portable HTML"], color),
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
currentCostContext,
|
|
9
9
|
recordKernelSession,
|
|
10
10
|
runWithCostContext
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OPQIGAFB.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_PROXY_MODE,
|
|
14
14
|
HarvestOptionsSchema,
|
|
@@ -5120,7 +5120,9 @@ export {
|
|
|
5120
5120
|
serpArrivalUrl,
|
|
5121
5121
|
buildYouTubeChannelVideosUrl,
|
|
5122
5122
|
BrowserDriver,
|
|
5123
|
+
sanitizeProviderLocalMessage,
|
|
5123
5124
|
validateProviderSessionId,
|
|
5125
|
+
brightDataBrowserEndpoint,
|
|
5124
5126
|
brightDataSerpEnabled,
|
|
5125
5127
|
questionIdFor,
|
|
5126
5128
|
classifyGoogleOutboundLink,
|
|
@@ -33,7 +33,7 @@ var NANGO_USD_PER_CONNECTION_MONTH = envRate("NANGO_USD_PER_CONNECTION_MONTH", 1
|
|
|
33
33
|
var NANGO_USD_PER_FUNCTION_RUN = envRate("NANGO_USD_PER_FUNCTION_RUN", 1e-4);
|
|
34
34
|
var NANGO_USD_PER_PROXY_REQUEST = envRate("NANGO_USD_PER_PROXY_REQUEST", 1e-4);
|
|
35
35
|
var NANGO_USD_PER_COMPUTE_SEC = envRate("NANGO_USD_PER_COMPUTE_SEC", 2e-4);
|
|
36
|
-
var BRIGHTDATA_BROWSER_USD_PER_GB = envRate("BRIGHTDATA_BROWSER_USD_PER_GB",
|
|
36
|
+
var BRIGHTDATA_BROWSER_USD_PER_GB = envRate("BRIGHTDATA_BROWSER_USD_PER_GB", 8);
|
|
37
37
|
function kernelCostUsd(ms, headful) {
|
|
38
38
|
const sec = Math.max(0, ms) / 1e3;
|
|
39
39
|
return sec * (headful ? KERNEL_HEADFUL_USD_PER_SEC : KERNEL_HEADLESS_USD_PER_SEC);
|
|
@@ -74,7 +74,7 @@ async function runCostTelemetryMigration() {
|
|
|
74
74
|
SELECT
|
|
75
75
|
(SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name IN ('kernel_session_log', 'vendor_usage_log', 'cost_probe_runs')) = 3
|
|
76
76
|
AND (SELECT COUNT(*) FROM pragma_table_info('kernel_session_log') WHERE name IN ('proxy_source', 'proxy_type', 'method')) = 3
|
|
77
|
-
AND (SELECT COUNT(*) FROM pragma_table_info('vendor_usage_log') WHERE name IN ('method', 'source_key')) =
|
|
77
|
+
AND (SELECT COUNT(*) FROM pragma_table_info('vendor_usage_log') WHERE name IN ('method', 'source_key', 'provider_duration_ms', 'provider_captcha', 'provider_status')) = 5
|
|
78
78
|
AND (SELECT COUNT(*) FROM sqlite_master WHERE type = 'index' AND name = 'vendor_usage_log_vendor_source_key') = 1
|
|
79
79
|
AND (SELECT COUNT(*) FROM pragma_table_info('cost_probe_runs') WHERE name IN ('units', 'unit_type', 'mode')) = 3
|
|
80
80
|
AS ready
|
|
@@ -132,6 +132,9 @@ async function runCostTelemetryMigration() {
|
|
|
132
132
|
est_cost_usd REAL NOT NULL DEFAULT 0,
|
|
133
133
|
error TEXT,
|
|
134
134
|
source_key TEXT,
|
|
135
|
+
provider_duration_ms INTEGER,
|
|
136
|
+
provider_captcha INTEGER,
|
|
137
|
+
provider_status TEXT,
|
|
135
138
|
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
136
139
|
)
|
|
137
140
|
`);
|
|
@@ -146,6 +149,18 @@ async function runCostTelemetryMigration() {
|
|
|
146
149
|
await db.execute(`ALTER TABLE vendor_usage_log ADD COLUMN source_key TEXT`);
|
|
147
150
|
} catch {
|
|
148
151
|
}
|
|
152
|
+
try {
|
|
153
|
+
await db.execute(`ALTER TABLE vendor_usage_log ADD COLUMN provider_duration_ms INTEGER`);
|
|
154
|
+
} catch {
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
await db.execute(`ALTER TABLE vendor_usage_log ADD COLUMN provider_captcha INTEGER`);
|
|
158
|
+
} catch {
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
await db.execute(`ALTER TABLE vendor_usage_log ADD COLUMN provider_status TEXT`);
|
|
162
|
+
} catch {
|
|
163
|
+
}
|
|
149
164
|
await db.execute(`CREATE UNIQUE INDEX IF NOT EXISTS vendor_usage_log_vendor_source_key ON vendor_usage_log(vendor, source_key) WHERE source_key IS NOT NULL`);
|
|
150
165
|
await db.execute(`
|
|
151
166
|
CREATE TABLE IF NOT EXISTS cost_probe_runs (
|
|
@@ -228,8 +243,8 @@ async function recordVendorUsage(r) {
|
|
|
228
243
|
const db = getDb();
|
|
229
244
|
const result = await db.execute({
|
|
230
245
|
sql: `INSERT OR IGNORE INTO vendor_usage_log
|
|
231
|
-
(id, op, probe_run_id, user_id, vendor, model, units, unit_type, est_cost_usd, error, method, source_key)
|
|
232
|
-
VALUES (
|
|
246
|
+
(id, op, probe_run_id, user_id, vendor, model, units, unit_type, est_cost_usd, error, method, source_key, provider_duration_ms, provider_captcha, provider_status)
|
|
247
|
+
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
|
233
248
|
args: [
|
|
234
249
|
randomUUID(),
|
|
235
250
|
r.op ?? ctx?.op ?? null,
|
|
@@ -242,7 +257,10 @@ async function recordVendorUsage(r) {
|
|
|
242
257
|
vendorCostUsd(r.vendor, r.units),
|
|
243
258
|
r.error ?? null,
|
|
244
259
|
r.method ?? ctx?.subOp ?? null,
|
|
245
|
-
r.sourceKey ?? null
|
|
260
|
+
r.sourceKey ?? null,
|
|
261
|
+
r.providerDurationMs ?? null,
|
|
262
|
+
boolToInt(r.providerCaptcha),
|
|
263
|
+
r.providerStatus ?? null
|
|
246
264
|
]
|
|
247
265
|
});
|
|
248
266
|
return result.rowsAffected === 1;
|
|
@@ -262,6 +280,7 @@ export {
|
|
|
262
280
|
currentCostContext,
|
|
263
281
|
HEADLESS_OPS,
|
|
264
282
|
vendorCostUsd,
|
|
283
|
+
migrateCostTelemetry,
|
|
265
284
|
recordKernelSession,
|
|
266
285
|
recordVendorUsage
|
|
267
286
|
};
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
LedgerOperation,
|
|
20
20
|
MC_PER_CREDIT,
|
|
21
21
|
calculateConnectedUsageCharge
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-PMONKQGJ.js";
|
|
23
23
|
import {
|
|
24
24
|
recordVendorUsage,
|
|
25
25
|
runWithCostContext
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OPQIGAFB.js";
|
|
27
27
|
import {
|
|
28
28
|
debitMcIdempotent,
|
|
29
29
|
getDb,
|