mcp-scraper 0.79.1 → 0.79.3
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 +25 -1
- package/README.md +1 -1
- package/dist/{analytics-repository-VEUDEPWI.js → analytics-repository-YOY5KMOD.js} +3 -3
- package/dist/bin/api-server.js +4 -4
- package/dist/bin/mcp-scraper-cli.js +1 -1
- package/dist/bin/mcp-scraper-core.js +7 -7
- package/dist/bin/mcp-scraper-install.js +2 -2
- package/dist/bin/mcp-stdio-server.js +7 -7
- package/dist/bin/paa-harvest.js +3 -3
- package/dist/{chunk-LB2GNACG.js → chunk-3423R23T.js} +3 -3
- package/dist/{chunk-NGLZ6UJR.js → chunk-5UAFBKJR.js} +1 -1
- package/dist/{chunk-B6L73AO4.js → chunk-6HAV7LCE.js} +3 -1
- package/dist/{chunk-NH3EUCZL.js → chunk-7UZAVM4J.js} +138 -11
- package/dist/{chunk-Q5L2OCOQ.js → chunk-C5Z4OFKW.js} +1 -1
- package/dist/{chunk-KAGHJQFO.js → chunk-EQGTEHLZ.js} +1 -1
- package/dist/{chunk-BTQ23KCT.js → chunk-F5GQJWZU.js} +1 -1
- package/dist/{chunk-DUWZQSSJ.js → chunk-HEUMDX4I.js} +1 -1
- package/dist/{chunk-OIGM6VKQ.js → chunk-IHYG52ZW.js} +1 -1
- package/dist/{chunk-OUBH6XMY.js → chunk-K3Z5AQYE.js} +1 -1
- package/dist/{chunk-UFJJGXVO.js → chunk-KNGTQD6U.js} +396 -67
- package/dist/{chunk-R4YRH5PG.js → chunk-MVB25X55.js} +1 -1
- package/dist/{chunk-47ZCUBM5.js → chunk-NVUKO5NN.js} +12 -1
- package/dist/{chunk-QVW5S6BD.js → chunk-TCYZ7HMU.js} +3 -3
- package/dist/{chunk-SL7YVA4S.js → chunk-YBR32LOD.js} +1 -1
- package/dist/{chunk-OU4FV2RP.js → chunk-YXNDOQXN.js} +49 -0
- package/dist/{db-TA567JLA.js → db-Z34LPZNR.js} +5 -1
- package/dist/{extract-bundle-I2GNC25L.js → extract-bundle-S3ZGNFML.js} +3 -3
- package/dist/{gmail-service-GGQVJUC3.js → gmail-service-YFS2OV4S.js} +4 -4
- package/dist/index.cjs +394 -65
- package/dist/index.d.cts +35 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +3 -3
- package/dist/{lead-list-enrichment-repository-5LEWW4X7.js → lead-list-enrichment-repository-36RPVV6N.js} +2 -2
- package/dist/{location-data-repository-AHKDXTEQ.js → location-data-repository-WPRG62GE.js} +2 -2
- package/dist/{server-MNSYIX42.js → server-MDWFOUTS.js} +73 -28
- package/dist/{site-extract-repository-KF736IR6.js → site-extract-repository-WAJMIDPJ.js} +2 -2
- package/dist/{worker-VU6JCCLG.js → worker-3LUFQWWJ.js} +5 -5
- package/package.json +1 -1
|
@@ -6,11 +6,12 @@ import {
|
|
|
6
6
|
LocationMismatchError,
|
|
7
7
|
PUBLIC_SERVICE_UNAVAILABLE_MESSAGE,
|
|
8
8
|
RequestAbortedError,
|
|
9
|
+
attachHarvestAttemptProviderSession,
|
|
9
10
|
buildPublicErrorEnvelope,
|
|
10
11
|
finishHarvestAttempt,
|
|
11
12
|
publicErrorMessage,
|
|
12
13
|
startHarvestAttempt
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YXNDOQXN.js";
|
|
14
15
|
|
|
15
16
|
// src/api/harvest-problems.ts
|
|
16
17
|
function errorMessage(err) {
|
|
@@ -186,6 +187,16 @@ function createHarvestAttemptRecorder(jobId, userId) {
|
|
|
186
187
|
});
|
|
187
188
|
return;
|
|
188
189
|
}
|
|
190
|
+
if (event.type === "provider_session_started") {
|
|
191
|
+
await attachHarvestAttemptProviderSession({
|
|
192
|
+
jobId,
|
|
193
|
+
attemptNumber: event.attemptNumber,
|
|
194
|
+
browserProvider: event.provider,
|
|
195
|
+
providerSessionId: event.providerSessionId,
|
|
196
|
+
observedAt: event.observedAt
|
|
197
|
+
});
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
189
200
|
await finishHarvestAttempt({
|
|
190
201
|
jobId,
|
|
191
202
|
attemptNumber: event.attemptNumber,
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
registerScheduledResultsMcpTools,
|
|
13
13
|
registerSerpIntelligenceCaptureTools,
|
|
14
14
|
resolveDeploymentProfile
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7UZAVM4J.js";
|
|
16
16
|
import {
|
|
17
17
|
renderInstallTerminal
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MVB25X55.js";
|
|
19
19
|
import {
|
|
20
20
|
PACKAGE_VERSION
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-IHYG52ZW.js";
|
|
22
22
|
|
|
23
23
|
// src/mcp/stdio-runtime.ts
|
|
24
24
|
import { readFileSync } from "fs";
|
|
@@ -488,6 +488,7 @@ var CORE_SCHEMA_COLUMNS = {
|
|
|
488
488
|
"debug_json",
|
|
489
489
|
"browser_provider",
|
|
490
490
|
"provider_session_id",
|
|
491
|
+
"provider_session_observed_at",
|
|
491
492
|
"provider_lookup_status",
|
|
492
493
|
"provider_status",
|
|
493
494
|
"provider_error_code",
|
|
@@ -711,6 +712,7 @@ async function migrate(options = {}) {
|
|
|
711
712
|
debug_json TEXT,
|
|
712
713
|
browser_provider TEXT,
|
|
713
714
|
provider_session_id TEXT,
|
|
715
|
+
provider_session_observed_at TEXT,
|
|
714
716
|
provider_lookup_status TEXT,
|
|
715
717
|
provider_status TEXT,
|
|
716
718
|
provider_error_code TEXT,
|
|
@@ -737,6 +739,7 @@ async function migrate(options = {}) {
|
|
|
737
739
|
for (const column of [
|
|
738
740
|
"browser_provider TEXT",
|
|
739
741
|
"provider_session_id TEXT",
|
|
742
|
+
"provider_session_observed_at TEXT",
|
|
740
743
|
"provider_lookup_status TEXT",
|
|
741
744
|
"provider_status TEXT",
|
|
742
745
|
"provider_error_code TEXT",
|
|
@@ -1912,6 +1915,7 @@ function rowToHarvestAttemptLog(row) {
|
|
|
1912
1915
|
browser_close_error: row.browser_close_error != null ? String(row.browser_close_error) : null,
|
|
1913
1916
|
browser_provider: row.browser_provider != null ? String(row.browser_provider) : null,
|
|
1914
1917
|
provider_session_id: row.provider_session_id != null ? String(row.provider_session_id) : null,
|
|
1918
|
+
provider_session_observed_at: row.provider_session_observed_at != null ? String(row.provider_session_observed_at) : null,
|
|
1915
1919
|
provider_lookup_status: row.provider_lookup_status != null ? String(row.provider_lookup_status) : null,
|
|
1916
1920
|
provider_status: row.provider_status != null ? String(row.provider_status) : null,
|
|
1917
1921
|
provider_error_code: row.provider_error_code != null ? String(row.provider_error_code) : null,
|
|
@@ -1991,6 +1995,49 @@ async function startHarvestAttempt(input) {
|
|
|
1991
1995
|
]
|
|
1992
1996
|
});
|
|
1993
1997
|
}
|
|
1998
|
+
async function attachHarvestAttemptProviderSession(input) {
|
|
1999
|
+
const result = await getDb().execute({
|
|
2000
|
+
sql: `
|
|
2001
|
+
UPDATE harvest_attempts SET
|
|
2002
|
+
browser_provider = ?,
|
|
2003
|
+
provider_session_id = ?,
|
|
2004
|
+
provider_session_observed_at = COALESCE(provider_session_observed_at, ?),
|
|
2005
|
+
provider_lookup_status = CASE
|
|
2006
|
+
WHEN provider_lookup_status = 'complete' THEN provider_lookup_status
|
|
2007
|
+
ELSE 'pending'
|
|
2008
|
+
END
|
|
2009
|
+
WHERE job_id = ? AND attempt_number = ? AND status = 'running'
|
|
2010
|
+
`,
|
|
2011
|
+
args: [
|
|
2012
|
+
input.browserProvider,
|
|
2013
|
+
input.providerSessionId,
|
|
2014
|
+
input.observedAt,
|
|
2015
|
+
input.jobId,
|
|
2016
|
+
input.attemptNumber
|
|
2017
|
+
]
|
|
2018
|
+
});
|
|
2019
|
+
return result.rowsAffected === 1;
|
|
2020
|
+
}
|
|
2021
|
+
async function finalizeExpiredHarvestAttempts(jobId, willRetry, completedAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
2022
|
+
const result = await getDb().execute({
|
|
2023
|
+
sql: `
|
|
2024
|
+
UPDATE harvest_attempts SET
|
|
2025
|
+
status = 'finished',
|
|
2026
|
+
outcome = COALESCE(outcome, 'timeout'),
|
|
2027
|
+
question_count = COALESCE(question_count, 0),
|
|
2028
|
+
duration_ms = COALESCE(duration_ms, MAX(0, CAST((julianday(?) - julianday(created_at)) * 86400000 AS INTEGER))),
|
|
2029
|
+
error = COALESCE(error, 'Durable worker lease expired before attempt completion'),
|
|
2030
|
+
will_retry = ?,
|
|
2031
|
+
provider_error_code = COALESCE(provider_error_code, 'timeout'),
|
|
2032
|
+
provider_error_message = COALESCE(provider_error_message, 'Durable worker lease expired before attempt completion'),
|
|
2033
|
+
provider_reason_source = COALESCE(provider_reason_source, 'client_runtime'),
|
|
2034
|
+
completed_at = COALESCE(completed_at, ?)
|
|
2035
|
+
WHERE job_id = ? AND status = 'running'
|
|
2036
|
+
`,
|
|
2037
|
+
args: [completedAt, willRetry ? 1 : 0, completedAt, jobId]
|
|
2038
|
+
});
|
|
2039
|
+
return result.rowsAffected;
|
|
2040
|
+
}
|
|
1994
2041
|
async function finishHarvestAttempt(input) {
|
|
1995
2042
|
await getDb().execute({
|
|
1996
2043
|
sql: `
|
|
@@ -3869,6 +3916,8 @@ export {
|
|
|
3869
3916
|
createRunningJob,
|
|
3870
3917
|
getOrCreateRunningJob,
|
|
3871
3918
|
startHarvestAttempt,
|
|
3919
|
+
attachHarvestAttemptProviderSession,
|
|
3920
|
+
finalizeExpiredHarvestAttempts,
|
|
3872
3921
|
finishHarvestAttempt,
|
|
3873
3922
|
updateHarvestAttemptProviderTelemetry,
|
|
3874
3923
|
listHarvestAttemptsPendingProviderTelemetry,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
SiteAuditPhaseLogRowSchema,
|
|
8
8
|
advanceWorkflowRunStep,
|
|
9
9
|
appendWorkflowArtifacts,
|
|
10
|
+
attachHarvestAttemptProviderSession,
|
|
10
11
|
cancelJob,
|
|
11
12
|
checkRateLimit,
|
|
12
13
|
checkpointDurablePaaJob,
|
|
@@ -49,6 +50,7 @@ import {
|
|
|
49
50
|
failRunningJob,
|
|
50
51
|
failStripeEvent,
|
|
51
52
|
failWorkflowRunRecord,
|
|
53
|
+
finalizeExpiredHarvestAttempts,
|
|
52
54
|
finishHarvestAttempt,
|
|
53
55
|
generateApiKey,
|
|
54
56
|
getBillingLedgerSummary,
|
|
@@ -137,7 +139,7 @@ import {
|
|
|
137
139
|
updateKpoJobState,
|
|
138
140
|
upsertPageSnapshot,
|
|
139
141
|
verifyPassword
|
|
140
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-YXNDOQXN.js";
|
|
141
143
|
export {
|
|
142
144
|
CORE_SCHEMA_VERSION,
|
|
143
145
|
CREDIT_LOTS_EPOCH,
|
|
@@ -147,6 +149,7 @@ export {
|
|
|
147
149
|
SiteAuditPhaseLogRowSchema,
|
|
148
150
|
advanceWorkflowRunStep,
|
|
149
151
|
appendWorkflowArtifacts,
|
|
152
|
+
attachHarvestAttemptProviderSession,
|
|
150
153
|
cancelJob,
|
|
151
154
|
checkRateLimit,
|
|
152
155
|
checkpointDurablePaaJob,
|
|
@@ -189,6 +192,7 @@ export {
|
|
|
189
192
|
failRunningJob,
|
|
190
193
|
failStripeEvent,
|
|
191
194
|
failWorkflowRunRecord,
|
|
195
|
+
finalizeExpiredHarvestAttempts,
|
|
192
196
|
finishHarvestAttempt,
|
|
193
197
|
generateApiKey,
|
|
194
198
|
getBillingLedgerSummary,
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
downloadAsset,
|
|
5
5
|
embedCommonsTexts,
|
|
6
6
|
publicizeExtractionFailure
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-F5GQJWZU.js";
|
|
8
8
|
import {
|
|
9
9
|
createSiteExtractBundleArtifactStream,
|
|
10
10
|
createSiteExtractContentReader,
|
|
11
11
|
createSiteExtractImageArtifact,
|
|
12
12
|
extractJobLimitInfo
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YBR32LOD.js";
|
|
14
14
|
import "./chunk-OZJMVCDK.js";
|
|
15
15
|
import {
|
|
16
16
|
computeIssues,
|
|
@@ -23,7 +23,7 @@ import "./chunk-VFCUGTCF.js";
|
|
|
23
23
|
import "./chunk-GGZEC22A.js";
|
|
24
24
|
import {
|
|
25
25
|
getDb
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YXNDOQXN.js";
|
|
27
27
|
|
|
28
28
|
// src/api/extract-bundle.ts
|
|
29
29
|
import { createWriteStream, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "fs";
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
GmailServiceError,
|
|
8
8
|
normalizeGmailMessage,
|
|
9
9
|
parseGmailAddresses
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-3423R23T.js";
|
|
11
|
+
import "./chunk-C5Z4OFKW.js";
|
|
12
12
|
import "./chunk-T3MZISOF.js";
|
|
13
13
|
import "./chunk-VFCUGTCF.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-5UAFBKJR.js";
|
|
15
|
+
import "./chunk-YXNDOQXN.js";
|
|
16
16
|
export {
|
|
17
17
|
GMAIL_ATTACHMENT_REF_TTL_MS,
|
|
18
18
|
GMAIL_INLINE_BODY_BYTES,
|