mcp-scraper 0.79.2 → 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 +4 -0
- 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-JECPQBLZ.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-2RTELL6M.js → chunk-IHYG52ZW.js} +1 -1
- package/dist/{chunk-OUBH6XMY.js → chunk-K3Z5AQYE.js} +1 -1
- package/dist/{chunk-WEEAXPWK.js → chunk-KNGTQD6U.js} +207 -36
- package/dist/{chunk-6FL7ZZCF.js → chunk-MVB25X55.js} +1 -1
- package/dist/{chunk-47ZCUBM5.js → chunk-NVUKO5NN.js} +12 -1
- package/dist/{chunk-XUM2LEGU.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 +205 -34
- 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-5OSHEEVT.js → server-MDWFOUTS.js} +73 -28
- package/dist/{site-extract-repository-KF736IR6.js → site-extract-repository-WAJMIDPJ.js} +2 -2
- package/dist/{worker-2TYCYFPM.js → worker-3LUFQWWJ.js} +5 -5
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
queuedCommonsDocumentCount,
|
|
11
11
|
semanticCommonsEntityScores,
|
|
12
12
|
typeFromMime
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-F5GQJWZU.js";
|
|
14
14
|
import {
|
|
15
15
|
SITE_EXTRACT_ARTIFACT_PREFIX,
|
|
16
16
|
abandonExtractSettlement,
|
|
@@ -41,13 +41,13 @@ import {
|
|
|
41
41
|
setExtractJobTotal,
|
|
42
42
|
settleExtractJob,
|
|
43
43
|
terminalExtractJobStatus
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-YBR32LOD.js";
|
|
45
45
|
import {
|
|
46
46
|
REQUIRED_LOCATION_STATE_CODES,
|
|
47
47
|
importHostedCensusPlacesCsv,
|
|
48
48
|
importHostedZipGroupsCsv,
|
|
49
49
|
listActiveHostedLocationDatasets
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-K3Z5AQYE.js";
|
|
51
51
|
import {
|
|
52
52
|
cancelPendingLeadListEnrichmentRows,
|
|
53
53
|
claimLeadListEnrichmentOutbox,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
saveLeadListEnrichmentRowResult,
|
|
75
75
|
setInitializingLeadListEnrichmentConcurrencyLock,
|
|
76
76
|
stableCanonicalJson
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-EQGTEHLZ.js";
|
|
78
78
|
import {
|
|
79
79
|
ConnectedUsageBillingError,
|
|
80
80
|
ConnectedUsagePreflightInputSchema,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
probeNangoConnectionDirect,
|
|
102
102
|
recordNangoConnectionCost,
|
|
103
103
|
settleConnectedUsage
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-3423R23T.js";
|
|
105
105
|
import {
|
|
106
106
|
ANALYTICS_CONTENT_SORTS,
|
|
107
107
|
AnalyticsIdentityProfileError,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
upsertAnalyticsAdSpend,
|
|
186
186
|
upsertAnalyticsHostGroup,
|
|
187
187
|
verifyAnalyticsWebhookSignature
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-HEUMDX4I.js";
|
|
189
189
|
import {
|
|
190
190
|
claimServiceConnectionAction,
|
|
191
191
|
ensureServiceConnectionsSchema,
|
|
@@ -198,7 +198,7 @@ import {
|
|
|
198
198
|
setServiceConnectionUserLabel,
|
|
199
199
|
signSession,
|
|
200
200
|
verifySession
|
|
201
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-C5Z4OFKW.js";
|
|
202
202
|
import {
|
|
203
203
|
classifyHarvestProblem,
|
|
204
204
|
createHarvestAttemptRecorder,
|
|
@@ -207,7 +207,7 @@ import {
|
|
|
207
207
|
harvestProblemResponse,
|
|
208
208
|
publicErrorBoundary,
|
|
209
209
|
serializeHarvestProblem
|
|
210
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-NVUKO5NN.js";
|
|
211
211
|
import "./chunk-OZJMVCDK.js";
|
|
212
212
|
import {
|
|
213
213
|
BACKUP_LAST_RESORT_ATTEMPTS,
|
|
@@ -229,7 +229,7 @@ import {
|
|
|
229
229
|
serpArrivalUrl,
|
|
230
230
|
validateProviderSessionId,
|
|
231
231
|
withRuntimeUserAgent
|
|
232
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-KNGTQD6U.js";
|
|
233
233
|
import {
|
|
234
234
|
AnalyticsConfirmedPersonProjectionSchema,
|
|
235
235
|
AnalyticsCrmFieldSchema,
|
|
@@ -316,7 +316,7 @@ import {
|
|
|
316
316
|
resolveDeploymentProfile,
|
|
317
317
|
resolveLocalSourcebookSchemaType,
|
|
318
318
|
transcribeMediaUrl
|
|
319
|
-
} from "./chunk-
|
|
319
|
+
} from "./chunk-7UZAVM4J.js";
|
|
320
320
|
import {
|
|
321
321
|
auditImageUrls,
|
|
322
322
|
auditImages,
|
|
@@ -340,7 +340,7 @@ import {
|
|
|
340
340
|
sanitizeAttempts,
|
|
341
341
|
sanitizeHarvestResult,
|
|
342
342
|
sanitizeOutboundDiagnostics
|
|
343
|
-
} from "./chunk-
|
|
343
|
+
} from "./chunk-6HAV7LCE.js";
|
|
344
344
|
import {
|
|
345
345
|
BROWSER_OPEN_MIN_BALANCE_MC,
|
|
346
346
|
CONCURRENCY_PACK_INVOICE_DESCRIPTION,
|
|
@@ -399,7 +399,7 @@ import {
|
|
|
399
399
|
recordKernelSession,
|
|
400
400
|
recordVendorUsage,
|
|
401
401
|
runWithCostContext
|
|
402
|
-
} from "./chunk-
|
|
402
|
+
} from "./chunk-5UAFBKJR.js";
|
|
403
403
|
import {
|
|
404
404
|
listWorkflowDefinitions,
|
|
405
405
|
runWorkflow,
|
|
@@ -435,7 +435,7 @@ import {
|
|
|
435
435
|
} from "./chunk-GGZEC22A.js";
|
|
436
436
|
import {
|
|
437
437
|
PACKAGE_VERSION
|
|
438
|
-
} from "./chunk-
|
|
438
|
+
} from "./chunk-IHYG52ZW.js";
|
|
439
439
|
import {
|
|
440
440
|
CaptchaError,
|
|
441
441
|
MapsSearchIncompletePageError,
|
|
@@ -476,6 +476,7 @@ import {
|
|
|
476
476
|
failJob,
|
|
477
477
|
failStripeEvent,
|
|
478
478
|
failWorkflowRunRecord,
|
|
479
|
+
finalizeExpiredHarvestAttempts,
|
|
479
480
|
getBillingLedgerSummary,
|
|
480
481
|
getClient,
|
|
481
482
|
getDb,
|
|
@@ -546,7 +547,7 @@ import {
|
|
|
546
547
|
updateHarvestAttemptProviderTelemetry,
|
|
547
548
|
upsertPageSnapshot,
|
|
548
549
|
verifyPassword
|
|
549
|
-
} from "./chunk-
|
|
550
|
+
} from "./chunk-YXNDOQXN.js";
|
|
550
551
|
|
|
551
552
|
// src/blog/registry.ts
|
|
552
553
|
var posts = [
|
|
@@ -9647,7 +9648,7 @@ var siteExtractFn = inngest.createFunction(
|
|
|
9647
9648
|
});
|
|
9648
9649
|
}) : null;
|
|
9649
9650
|
const finalized = await step.run("finalize", async () => {
|
|
9650
|
-
const { assembleExtractArtifacts } = await import("./extract-bundle-
|
|
9651
|
+
const { assembleExtractArtifacts } = await import("./extract-bundle-S3ZGNFML.js");
|
|
9651
9652
|
const current = await getExtractJob(jobId2);
|
|
9652
9653
|
if (!current) throw new Error("extract job disappeared before finalization");
|
|
9653
9654
|
const stored = await assembleExtractArtifacts(current, { branding, imageAudit });
|
|
@@ -10607,7 +10608,7 @@ async function resolveUsZipsPath(requestedPath) {
|
|
|
10607
10608
|
async function loadZipGroups(stateAbbr, requestedPath, warnings, sourceMode) {
|
|
10608
10609
|
const mode = resolvedLocationDataMode({ zipSource: sourceMode });
|
|
10609
10610
|
if (mode === "hosted") {
|
|
10610
|
-
const { getHostedZipGroups } = await import("./location-data-repository-
|
|
10611
|
+
const { getHostedZipGroups } = await import("./location-data-repository-WPRG62GE.js");
|
|
10611
10612
|
const hosted = await getHostedZipGroups(stateAbbr);
|
|
10612
10613
|
if (!hosted.dataset) {
|
|
10613
10614
|
throw new DirectoryLocationError(
|
|
@@ -10670,7 +10671,7 @@ async function resolveDirectoryMarkets(options, config = {}) {
|
|
|
10670
10671
|
const sourceUrl = censusStateUrl(state2.fips);
|
|
10671
10672
|
const warnings = [];
|
|
10672
10673
|
if (resolvedLocationDataMode(config) === "hosted") {
|
|
10673
|
-
const { queryHostedLocationMarkets } = await import("./location-data-repository-
|
|
10674
|
+
const { queryHostedLocationMarkets } = await import("./location-data-repository-WPRG62GE.js");
|
|
10674
10675
|
const hosted = await queryHostedLocationMarkets({
|
|
10675
10676
|
state: state2.abbr,
|
|
10676
10677
|
minPopulation: options.minPopulation,
|
|
@@ -12157,7 +12158,7 @@ function summarizePersistedLeadRows(rows, warnings = []) {
|
|
|
12157
12158
|
async function settlePersistedLeadListEnrichment(jobId2) {
|
|
12158
12159
|
const jobs = await listLeadListEnrichmentJobsNeedingSettlement(100);
|
|
12159
12160
|
const job = jobs.find((candidate) => candidate.id === jobId2);
|
|
12160
|
-
const { getLeadListEnrichmentJob: getLeadListEnrichmentJob2 } = await import("./lead-list-enrichment-repository-
|
|
12161
|
+
const { getLeadListEnrichmentJob: getLeadListEnrichmentJob2 } = await import("./lead-list-enrichment-repository-36RPVV6N.js");
|
|
12161
12162
|
const current = job ?? await getLeadListEnrichmentJob2(jobId2);
|
|
12162
12163
|
if (!current) return null;
|
|
12163
12164
|
const rows = await listLeadListEnrichmentRows(jobId2);
|
|
@@ -12213,7 +12214,7 @@ async function reconcileLeadListEnrichmentSettlements(limit = 25) {
|
|
|
12213
12214
|
const persisted = job.result ?? summarizePersistedLeadRows(rows, job.warnings);
|
|
12214
12215
|
const status = job.cancelRequestedAt ? "cancelled" : persisted.failedRows > 0 && persisted.completeRows > 0 ? "partial" : persisted.failedRows > 0 ? "cancelled" : persisted.rowsWithContacts > 0 ? "complete" : "empty";
|
|
12215
12216
|
if (persisted.failedRows > 0 && persisted.completeRows === 0 && !job.cancelRequestedAt) {
|
|
12216
|
-
const { failLeadListEnrichmentJob: failLeadListEnrichmentJob2 } = await import("./lead-list-enrichment-repository-
|
|
12217
|
+
const { failLeadListEnrichmentJob: failLeadListEnrichmentJob2 } = await import("./lead-list-enrichment-repository-36RPVV6N.js");
|
|
12217
12218
|
await failLeadListEnrichmentJob2({
|
|
12218
12219
|
jobId: job.id,
|
|
12219
12220
|
errorCode: "lead_list_all_rows_failed",
|
|
@@ -25946,6 +25947,25 @@ var DIRECT_PAA_MAX_ATTEMPTS = 3;
|
|
|
25946
25947
|
var CHECKPOINT_INTERVAL_MS = 1e4;
|
|
25947
25948
|
var CHECKPOINT_IMPROVEMENT_THRESHOLD = 5;
|
|
25948
25949
|
var LEASE_HEARTBEAT_MS = 1e4;
|
|
25950
|
+
var MAX_DURABLE_INTERACTION_OBSERVATIONS = 250;
|
|
25951
|
+
function summarizePaaInteractions(observations) {
|
|
25952
|
+
const hasSignal = (value, signal) => value.confirmationSignals.includes(signal);
|
|
25953
|
+
return {
|
|
25954
|
+
observations: observations.length,
|
|
25955
|
+
dispatched: observations.filter((value) => value.dispatched).length,
|
|
25956
|
+
confirmed: observations.filter((value) => value.outcome === "confirmed").length,
|
|
25957
|
+
unconfirmed: observations.filter((value) => value.outcome === "unconfirmed").length,
|
|
25958
|
+
dispatchFailures: observations.filter((value) => value.outcome === "dispatch_failed").length,
|
|
25959
|
+
confirmedWithoutDispatchAck: observations.filter((value) => value.outcome === "confirmed" && !value.dispatched).length,
|
|
25960
|
+
expandedSignals: observations.filter((value) => hasSignal(value, "expanded")).length,
|
|
25961
|
+
answerSignals: observations.filter((value) => hasSignal(value, "answer")).length,
|
|
25962
|
+
sourceSignals: observations.filter((value) => hasSignal(value, "source")).length,
|
|
25963
|
+
questionGrowthBatches: new Set(observations.filter((value) => hasSignal(value, "question_growth")).map((value) => value.batchNumber)).size,
|
|
25964
|
+
checkpoint700ms: observations.filter((value) => value.confirmationCheckpointMs === 700).length,
|
|
25965
|
+
checkpoint1000ms: observations.filter((value) => value.confirmationCheckpointMs === 1e3).length,
|
|
25966
|
+
checkpoint1400ms: observations.filter((value) => value.confirmationCheckpointMs === 1400).length
|
|
25967
|
+
};
|
|
25968
|
+
}
|
|
25949
25969
|
function normalizePaaQuestion(value) {
|
|
25950
25970
|
if (typeof value !== "string") return "";
|
|
25951
25971
|
return value.normalize("NFKC").toLocaleLowerCase("en-US").replace(/[^\p{L}\p{N}\s]/gu, "").replace(/\s+/g, " ").trim();
|
|
@@ -26084,6 +26104,7 @@ var ProgressivePaaCheckpoint = class {
|
|
|
26084
26104
|
interruptions = [];
|
|
26085
26105
|
lifecycle = null;
|
|
26086
26106
|
material = null;
|
|
26107
|
+
interactions = /* @__PURE__ */ new Map();
|
|
26087
26108
|
sequence = 0;
|
|
26088
26109
|
attempt = 1;
|
|
26089
26110
|
improvementsSinceWrite = 0;
|
|
@@ -26099,6 +26120,10 @@ var ProgressivePaaCheckpoint = class {
|
|
|
26099
26120
|
for (const interruption of value.interruptions ?? []) this.interruptions.push(interruption);
|
|
26100
26121
|
if (value.lifecycle) this.lifecycle = { ...value.lifecycle };
|
|
26101
26122
|
if (value.material) this.material = structuredClone(value.material);
|
|
26123
|
+
for (const interaction of value.interactions ?? []) {
|
|
26124
|
+
if (!interaction?.id) continue;
|
|
26125
|
+
this.interactions.set(interaction.id, structuredClone(interaction));
|
|
26126
|
+
}
|
|
26102
26127
|
for (const raw of value.records ?? []) {
|
|
26103
26128
|
const incoming = durableRecordFromFlat(raw);
|
|
26104
26129
|
if (!incoming) continue;
|
|
@@ -26134,6 +26159,15 @@ var ProgressivePaaCheckpoint = class {
|
|
|
26134
26159
|
this.improvementsSinceWrite += 1;
|
|
26135
26160
|
}
|
|
26136
26161
|
for (const question of snapshot.clickedQuestions) if (clean2(question)) this.clickedQuestions.add(clean2(question));
|
|
26162
|
+
for (const interaction of snapshot.interactions ?? []) {
|
|
26163
|
+
if (!interaction?.id) continue;
|
|
26164
|
+
this.interactions.set(interaction.id, structuredClone(interaction));
|
|
26165
|
+
}
|
|
26166
|
+
while (this.interactions.size > MAX_DURABLE_INTERACTION_OBSERVATIONS) {
|
|
26167
|
+
const oldest = this.interactions.keys().next().value;
|
|
26168
|
+
if (oldest === void 0) break;
|
|
26169
|
+
this.interactions.delete(oldest);
|
|
26170
|
+
}
|
|
26137
26171
|
for (const raw of snapshot.records) {
|
|
26138
26172
|
const incoming = durableRecordFromFlat(raw);
|
|
26139
26173
|
if (!incoming) continue;
|
|
@@ -26164,6 +26198,7 @@ var ProgressivePaaCheckpoint = class {
|
|
|
26164
26198
|
return [...this.records.values()];
|
|
26165
26199
|
}
|
|
26166
26200
|
checkpoint(phase, error = null) {
|
|
26201
|
+
const interactions = [...this.interactions.values()];
|
|
26167
26202
|
return {
|
|
26168
26203
|
phase,
|
|
26169
26204
|
attempt: this.attempt,
|
|
@@ -26177,7 +26212,9 @@ var ProgressivePaaCheckpoint = class {
|
|
|
26177
26212
|
error,
|
|
26178
26213
|
interruptions: [...this.interruptions],
|
|
26179
26214
|
lifecycle: this.lifecycle ? { ...this.lifecycle } : null,
|
|
26180
|
-
material: this.material ? structuredClone(this.material) : null
|
|
26215
|
+
material: this.material ? structuredClone(this.material) : null,
|
|
26216
|
+
interactions,
|
|
26217
|
+
interactionSummary: summarizePaaInteractions(interactions)
|
|
26181
26218
|
};
|
|
26182
26219
|
}
|
|
26183
26220
|
async flush(phase, options = {}) {
|
|
@@ -26324,7 +26361,8 @@ async function runPaaHarvestJob(jobId2) {
|
|
|
26324
26361
|
};
|
|
26325
26362
|
const onPaaProgress = async (snapshot) => {
|
|
26326
26363
|
progress.accept(snapshot);
|
|
26327
|
-
|
|
26364
|
+
const force = snapshot.phase === "attempt_ending" || snapshot.phase === "click_observed" || snapshot.phase === "expansion_finished";
|
|
26365
|
+
await progress.flush(snapshot.phase === "attempt_ending" ? "failed" : "expanding", { force });
|
|
26328
26366
|
};
|
|
26329
26367
|
const harvestCtx = currentCostContext();
|
|
26330
26368
|
const harvested = await runWithCostContext(
|
|
@@ -26762,6 +26800,7 @@ async function reconcilePaaHarvestSettlements(limit = 25, origin) {
|
|
|
26762
26800
|
let staleFailed = 0;
|
|
26763
26801
|
let requeued = 0;
|
|
26764
26802
|
let redispatched = 0;
|
|
26803
|
+
let attemptsFinalized = 0;
|
|
26765
26804
|
for (const job of stale) {
|
|
26766
26805
|
try {
|
|
26767
26806
|
const recoveryCount = Math.max(0, Number(job.options.paaRecoveryCount ?? 0));
|
|
@@ -26769,7 +26808,12 @@ async function reconcilePaaHarvestSettlements(limit = 25, origin) {
|
|
|
26769
26808
|
if (origin && await dispatchRecovery(origin, job.id)) redispatched += 1;
|
|
26770
26809
|
continue;
|
|
26771
26810
|
}
|
|
26772
|
-
|
|
26811
|
+
const willRetry = recoveryCount < MAX_RUNTIME_RECOVERIES;
|
|
26812
|
+
try {
|
|
26813
|
+
attemptsFinalized += await finalizeExpiredHarvestAttempts(job.id, willRetry);
|
|
26814
|
+
} catch {
|
|
26815
|
+
}
|
|
26816
|
+
if (willRetry && await requeueExpiredDurablePaaJob(job.id, MAX_RUNTIME_RECOVERIES)) {
|
|
26773
26817
|
requeued += 1;
|
|
26774
26818
|
if (origin && await dispatchRecovery(origin, job.id)) redispatched += 1;
|
|
26775
26819
|
continue;
|
|
@@ -26818,7 +26862,8 @@ async function reconcilePaaHarvestSettlements(limit = 25, origin) {
|
|
|
26818
26862
|
failed,
|
|
26819
26863
|
providerChecked,
|
|
26820
26864
|
providerCompleted,
|
|
26821
|
-
providerFailed
|
|
26865
|
+
providerFailed,
|
|
26866
|
+
attemptsFinalized
|
|
26822
26867
|
};
|
|
26823
26868
|
}
|
|
26824
26869
|
|
|
@@ -47766,7 +47811,7 @@ async function callMainOwnedExportPage(identity, input) {
|
|
|
47766
47811
|
});
|
|
47767
47812
|
}
|
|
47768
47813
|
if (connection.providerConfigKey === "google-mail" && input.dataset === "emails") {
|
|
47769
|
-
const { GmailService: GmailService2 } = await import("./gmail-service-
|
|
47814
|
+
const { GmailService: GmailService2 } = await import("./gmail-service-YFS2OV4S.js");
|
|
47770
47815
|
const service = new GmailService2();
|
|
47771
47816
|
const ownerId3 = createHash29("sha256").update(identity.toLowerCase()).digest("hex").slice(0, 24);
|
|
47772
47817
|
const after = Math.floor(Date.parse(input.from) / 1e3);
|
|
@@ -77738,7 +77783,7 @@ app.get("/cron/tick", async (c) => {
|
|
|
77738
77783
|
return c.json({ error: "Unauthorized" }, 401);
|
|
77739
77784
|
}
|
|
77740
77785
|
const startedAt = Date.now();
|
|
77741
|
-
const { drainQueue } = await import("./worker-
|
|
77786
|
+
const { drainQueue } = await import("./worker-3LUFQWWJ.js");
|
|
77742
77787
|
const budget = { maxJobs: 10, deadlineMs: startedAt + CRON_TICK_DRAIN_BUDGET_MS };
|
|
77743
77788
|
const origin = `${new URL(c.req.url).protocol}//${new URL(c.req.url).host}`;
|
|
77744
77789
|
const unfinished = [];
|
|
@@ -77862,8 +77907,8 @@ app.post("/api/internal/extract-refinalize/:id", async (c) => {
|
|
|
77862
77907
|
finishExtractJob: finishExtractJob2,
|
|
77863
77908
|
terminalExtractJobStatus: terminalExtractJobStatus2,
|
|
77864
77909
|
extractJobLimitInfo: extractJobLimitInfo2
|
|
77865
|
-
} = await import("./site-extract-repository-
|
|
77866
|
-
const { assembleExtractArtifacts } = await import("./extract-bundle-
|
|
77910
|
+
} = await import("./site-extract-repository-WAJMIDPJ.js");
|
|
77911
|
+
const { assembleExtractArtifacts } = await import("./extract-bundle-S3ZGNFML.js");
|
|
77867
77912
|
const existing = await getExtractJob2(jobId2);
|
|
77868
77913
|
if (!existing) return c.json({ error: "job not found" }, 404);
|
|
77869
77914
|
if (existing.status !== "failed") {
|
|
@@ -77890,7 +77935,7 @@ app.post("/api/internal/extract-refinalize/:id", async (c) => {
|
|
|
77890
77935
|
if (!updated) return c.json({ error: "job state changed during re-finalization" }, 409);
|
|
77891
77936
|
let settlement = "already_settled_or_refunded";
|
|
77892
77937
|
if (job.billedMc == null && job.userId != null) {
|
|
77893
|
-
const { settleExtractJob: settleExtractJob3, countSuccessfulPages: countSuccessfulPages2 } = await import("./site-extract-repository-
|
|
77938
|
+
const { settleExtractJob: settleExtractJob3, countSuccessfulPages: countSuccessfulPages2 } = await import("./site-extract-repository-WAJMIDPJ.js");
|
|
77894
77939
|
const heldMc = Number(job.options.heldMc ?? 0);
|
|
77895
77940
|
const successful = await countSuccessfulPages2(jobId2);
|
|
77896
77941
|
const usedMc = Math.min(successful * MC_COSTS.page_scrape, heldMc);
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
setExtractJobTotal,
|
|
29
29
|
settleExtractJob,
|
|
30
30
|
terminalExtractJobStatus
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-YBR32LOD.js";
|
|
32
32
|
import "./chunk-DNM65UCK.js";
|
|
33
33
|
import "./chunk-VFCUGTCF.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-YXNDOQXN.js";
|
|
35
35
|
export {
|
|
36
36
|
abandonExtractSettlement,
|
|
37
37
|
claimFailedExtractJobForRefinalize,
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
harvestProblemEnvelope,
|
|
6
6
|
harvestProblemResponse,
|
|
7
7
|
serializeHarvestProblem
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NVUKO5NN.js";
|
|
9
9
|
import "./chunk-OZJMVCDK.js";
|
|
10
10
|
import {
|
|
11
11
|
harvest
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KNGTQD6U.js";
|
|
13
13
|
import {
|
|
14
14
|
sanitizeAttempts,
|
|
15
15
|
sanitizeHarvestResult
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6HAV7LCE.js";
|
|
17
17
|
import {
|
|
18
18
|
MC_COSTS,
|
|
19
19
|
serpActualCostMc
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-OM7HVEJ3.js";
|
|
24
24
|
import {
|
|
25
25
|
runWithCostContext
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5UAFBKJR.js";
|
|
27
27
|
import "./chunk-OWF2JJKN.js";
|
|
28
28
|
import {
|
|
29
29
|
claimPendingJob,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
debitMc,
|
|
33
33
|
failJob,
|
|
34
34
|
listHarvestAttempts
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-YXNDOQXN.js";
|
|
36
36
|
|
|
37
37
|
// src/api/worker.ts
|
|
38
38
|
var MAX_CONCURRENT = 2;
|