@canonry/canonry 7.127.0 → 7.128.1
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/assets/assets/{AccessControls-2bimiIhw.js → AccessControls-QW1RtXqK.js} +2 -2
- package/assets/assets/{AgentSetupPage-BGAU8xzj.js → AgentSetupPage-BFXD__2X.js} +4 -4
- package/assets/assets/{AuditHistoryPanel-Br4LNvcM.js → AuditHistoryPanel-Cn9Tnnxo.js} +1 -1
- package/assets/assets/{BacklinksPage-BBh43gcY.js → BacklinksPage-Bv12EM38.js} +1 -1
- package/assets/assets/{ChartPrimitives-ChO_4pZz.js → ChartPrimitives-DIAAi1Eq.js} +1 -1
- package/assets/assets/{HistoryPage-okXPylcp.js → HistoryPage-Bfn3nVjo.js} +1 -1
- package/assets/assets/MeasurementPropertyPage-BuVvdugZ.js +4 -0
- package/assets/assets/ProjectPage-er2nBpgg.js +15 -0
- package/assets/assets/{RunsPage-4u1VBVOW.js → RunsPage-wtzz8XIJ.js} +1 -1
- package/assets/assets/{ServerTrafficSection-Bl0HTTwh.js → ServerTrafficSection-oViiKz3j.js} +3 -3
- package/assets/assets/{SettingsPage-C05qxsby.js → SettingsPage-CVL6mVTM.js} +1 -1
- package/assets/assets/{ToneBadge-BE2H103M.js → ToneBadge-DSr49xyr.js} +1 -1
- package/assets/assets/{TrafficPage-Bd3ey_0C.js → TrafficPage-drK_F4xY.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-B6Gi-qBP.js → TrafficSourceDetailPage-BdvprrAg.js} +1 -1
- package/assets/assets/{account-context-y7mzU3Ko.js → account-context-CRwUczVQ.js} +1 -1
- package/assets/assets/{agent-trust-copy-CHQ9IAa3.js → agent-trust-copy-DduiTpc0.js} +1 -1
- package/assets/assets/{card-BmJz19vt.js → card-DtN_FyC4.js} +1 -1
- package/assets/assets/index-Bh4Hdh7M.js +43 -0
- package/assets/assets/{preload-helper-BLaGg0Jn.js → preload-helper-CqQPtzI4.js} +1 -1
- package/assets/assets/query-client-DTIKbVqE.js +1 -0
- package/assets/assets/react-query-Bt-PaSFW.js +1 -0
- package/assets/assets/{react-sigma_core.esm.min-DNPGgfTG.js → react-sigma_core.esm.min-DLmrzL1s.js} +1 -1
- package/assets/assets/{server-traffic-ALYWW6k0.js → server-traffic-BApvbZVl.js} +1 -1
- package/assets/assets/service--wSlHsiA.js +1 -0
- package/assets/index.html +9 -9
- package/dist/activity-IDVGFHBZ.js +13 -0
- package/dist/{ads-PB3VFUPV.js → ads-MMIVXXYK.js} +4 -4
- package/dist/{agent-VOL7SOEQ.js → agent-3N6J7AP5.js} +8 -8
- package/dist/{agent-ask-F46ERE3W.js → agent-ask-V5NBRKWB.js} +4 -4
- package/dist/{agent-conversations-T5Q43627.js → agent-conversations-6ZKNOOGK.js} +4 -4
- package/dist/{agent-journeys-GVEVJ5J2.js → agent-journeys-R3TB7RS6.js} +4 -4
- package/dist/{agent-memory-XXN7QXNM.js → agent-memory-VKNEXDCF.js} +4 -4
- package/dist/{agent-providers-U6XIM5JI.js → agent-providers-HV3LM656.js} +4 -4
- package/dist/{agent-transcript-ONEA6JBO.js → agent-transcript-5B7ZSNQO.js} +4 -4
- package/dist/{analytics-XWVTM57N.js → analytics-NRYYKO3D.js} +4 -4
- package/dist/{answerability-GNYSELX5.js → answerability-BMPIAEV4.js} +4 -4
- package/dist/{apply-WXW4KWUK.js → apply-52VDVYIV.js} +4 -4
- package/dist/{backfill-SWDR5M4O.js → backfill-QIXONSLO.js} +11 -11
- package/dist/{backlinks-5LIBLUEG.js → backlinks-B4IMH5VN.js} +4 -4
- package/dist/{bing-4U4ODKGV.js → bing-G56ZWW4V.js} +4 -4
- package/dist/{bootstrap-FY72AHVW.js → bootstrap-74GDJENX.js} +11 -11
- package/dist/{cdp-H5WMBYIF.js → cdp-LVPKD5WH.js} +8 -8
- package/dist/{chunk-XONND7NT.js → chunk-2GA43I45.js} +3 -3
- package/dist/{chunk-GTX7C5Y5.js → chunk-2JW5OBUF.js} +53 -25
- package/dist/{chunk-M4IAXLBT.js → chunk-34CPCOQI.js} +3 -3
- package/dist/{chunk-RDCEFEXP.js → chunk-3TCXYRME.js} +3 -3
- package/dist/{chunk-2VDYFOKB.js → chunk-4MEWPJ7A.js} +8 -8
- package/dist/{chunk-2IU7GJCX.js → chunk-4PFBSPFE.js} +4 -4
- package/dist/{chunk-BAO3PHQP.js → chunk-5JQHOPNE.js} +2 -2
- package/dist/{chunk-HS2HYFPX.js → chunk-5LBYOWQZ.js} +4 -4
- package/dist/{chunk-NEJEHRPT.js → chunk-6RE7O724.js} +2 -2
- package/dist/{chunk-5WDU7ZML.js → chunk-7G6PCF4H.js} +6 -6
- package/dist/{chunk-2PLJ4QG5.js → chunk-A4NXXWFC.js} +4 -4
- package/dist/{chunk-K3YHPTKL.js → chunk-AT2LRVEB.js} +2 -2
- package/dist/{chunk-IIL4NKRU.js → chunk-AVLWYL4G.js} +4 -4
- package/dist/{chunk-PWXLKW2F.js → chunk-BHWR4PBF.js} +3 -3
- package/dist/{chunk-X6DD3OIR.js → chunk-DOXBK2KF.js} +23 -3
- package/dist/{chunk-GRX2DION.js → chunk-EOZLVWOC.js} +4 -4
- package/dist/{chunk-GKQ4CYUM.js → chunk-ETTKN2R4.js} +52 -36
- package/dist/{chunk-FMS7CIEK.js → chunk-F56XOHE2.js} +4 -4
- package/dist/{chunk-G2NIO2J3.js → chunk-FQFL223H.js} +2 -2
- package/dist/{chunk-DY2Q3VIM.js → chunk-G7HRY36G.js} +2 -2
- package/dist/{chunk-PUEARV37.js → chunk-HOR6MC5A.js} +372 -372
- package/dist/{chunk-HQEH4YRO.js → chunk-I4ITDPK7.js} +1 -1
- package/dist/{chunk-GCBFSIKI.js → chunk-KIJCFPN4.js} +1 -1
- package/dist/{chunk-3GE4Z4J3.js → chunk-KZKPWHJA.js} +5 -5
- package/dist/{chunk-2T4OGJWP.js → chunk-O6RKXY2P.js} +1 -1
- package/dist/{chunk-QWD3ABAW.js → chunk-PGKT42YN.js} +1 -1
- package/dist/{chunk-LWRPSAVC.js → chunk-PM23BRHO.js} +1 -1
- package/dist/{chunk-RMLGMB5B.js → chunk-RG5E54VU.js} +1 -1
- package/dist/{chunk-JRWHQVA6.js → chunk-STNPEES2.js} +380 -127
- package/dist/{chunk-A36PZKKS.js → chunk-SXLHTMXA.js} +2 -2
- package/dist/{chunk-ZKIEOEUZ.js → chunk-UXCNYSAB.js} +2 -2
- package/dist/{chunk-GPPTW3HU.js → chunk-V42NDP4R.js} +4 -4
- package/dist/{chunk-QXRI6DRE.js → chunk-WCWWHK7P.js} +2331 -1983
- package/dist/{chunk-OKIAF573.js → chunk-XMPXMQ5X.js} +1 -1
- package/dist/{chunk-FIF4N7DP.js → chunk-XTIOFTFS.js} +1 -1
- package/dist/{chunk-3ZNDJ4OM.js → chunk-YDVXZWWF.js} +5 -5
- package/dist/{chunk-425BZPKK.js → chunk-YW4K74WM.js} +4 -4
- package/dist/{chunk-RPAWPX7B.js → chunk-ZXX7DMBJ.js} +1 -1
- package/dist/{citations-622BWQTR.js → citations-CF7AU3KY.js} +5 -5
- package/dist/{cli-catalog-ACK3FVAX.js → cli-catalog-U6WE3BU7.js} +4 -4
- package/dist/cli-commands-DFFJYIZF.js +18 -0
- package/dist/cli.js +14 -14
- package/dist/{competitor-QYZIWXGC.js → competitor-Q7L6HJ5O.js} +4 -4
- package/dist/{content-PJASAMIV.js → content-5KLBWKCB.js} +4 -4
- package/dist/{dashboard-FQOS3J4B.js → dashboard-KQ3INTH3.js} +7 -7
- package/dist/{demo-ZGGVSKN4.js → demo-5YEH32AM.js} +3 -3
- package/dist/{demo-server-TLXLEPOI.js → demo-server-25MUI3QS.js} +13 -13
- package/dist/{discover-ZLDSXDRI.js → discover-ENDRNDS6.js} +5 -5
- package/dist/{discover-eval-7F5Q3RXS.js → discover-eval-7LJXSHUM.js} +4 -4
- package/dist/{doctor-3KSQZDZ3.js → doctor-3N7TEK5G.js} +4 -4
- package/dist/{evidence-BJZIRJ4U.js → evidence-MAIUNVWP.js} +4 -4
- package/dist/{export-cmd-BYPGV4IU.js → export-cmd-6FJNHZVJ.js} +4 -4
- package/dist/{ga-A3BAZCYH.js → ga-HWFGPMTN.js} +4 -4
- package/dist/{gbp-U6VCRAFN.js → gbp-KIPU2NE6.js} +4 -4
- package/dist/{google-UNQZBUGS.js → google-PKYUSFRS.js} +5 -5
- package/dist/{google-marketing-QSIRQAVH.js → google-marketing-NHQ6VSOK.js} +2 -2
- package/dist/{health-cmd-Z5KTTJQU.js → health-cmd-OGYIMIFA.js} +5 -5
- package/dist/{history-IIGUZMOM.js → history-5NJOUK2A.js} +4 -4
- package/dist/index.d.ts +76 -76
- package/dist/index.js +26 -26
- package/dist/{init-HZANRCMW.js → init-3JXUT7VJ.js} +13 -13
- package/dist/{insights-UQ234W6T.js → insights-CWTPGOPF.js} +4 -4
- package/dist/intelligence-service-7DFVBFXY.js +15 -0
- package/dist/{journeys-2EZIRL7K.js → journeys-VP7LL2DS.js} +4 -4
- package/dist/{keys-NIAANGXE.js → keys-VBZG6BWU.js} +4 -4
- package/dist/{keyword-LHHNG3GL.js → keyword-M7Y4V5MJ.js} +4 -4
- package/dist/{logs-UFOOIKTC.js → logs-NTFQR3S6.js} +4 -4
- package/dist/{mcp-AZYUFL5V.js → mcp-DUN57Q6H.js} +5 -5
- package/dist/mcp.js +10 -10
- package/dist/{measurement-plan-H2HIHJ3D.js → measurement-plan-SGJ7EDVC.js} +6 -6
- package/dist/{notify-TIE2ZJ26.js → notify-4NOHQ6G4.js} +4 -4
- package/dist/{organic-evidence-BX5MGZTK.js → organic-evidence-5NWLGCGE.js} +4 -4
- package/dist/{overview-MGQE43GU.js → overview-EQ3BTXHC.js} +7 -7
- package/dist/{project-2JL4ZW52.js → project-J43SI3ZT.js} +4 -4
- package/dist/{project-setup-CXOVBRLZ.js → project-setup-5WA4RAN3.js} +4 -4
- package/dist/{query-Q5BF63QF.js → query-NMWKGTJ3.js} +4 -4
- package/dist/{research-RQBZ57W5.js → research-UU2JB4JH.js} +4 -4
- package/dist/{results-export-TVCBJNJN.js → results-export-RQMNBKXT.js} +4 -4
- package/dist/{run-L6WG5WP2.js → run-JTIH3ET5.js} +6 -6
- package/dist/{schedule-3HQMG3AM.js → schedule-YVKS4ILU.js} +4 -4
- package/dist/{search-ZLQE4J66.js → search-XCX3SAOT.js} +4 -4
- package/dist/{serve-E4N2XMIC.js → serve-GOZOQL67.js} +42 -31
- package/dist/{session-IJLUYO4T.js → session-H6N6B6RR.js} +14 -14
- package/dist/{settings-T3U7TQOF.js → settings-2GDLWIBA.js} +4 -4
- package/dist/{sitemaps-UZPLGN4W.js → sitemaps-22O75HMK.js} +4 -4
- package/dist/{skills-P4WSSFPF.js → skills-NSUS2XV2.js} +3 -3
- package/dist/{snapshot-ROJPISJE.js → snapshot-UCITZQFF.js} +4 -4
- package/dist/{src-ZYWTGILQ.js → src-OAVTTKVK.js} +2 -2
- package/dist/{status-43XNR3NS.js → status-KJZSA6KP.js} +6 -6
- package/dist/{support-I7E4I3GG.js → support-PWLEDLQT.js} +2 -2
- package/dist/{technical-aeo-D4F2R6M3.js → technical-aeo-P3R7RR52.js} +4 -4
- package/dist/{telemetry-5DMVDDZI.js → telemetry-LA72RJFS.js} +5 -5
- package/dist/{tools-M534GJMS.js → tools-Q6ITEQ4V.js} +12 -12
- package/dist/{traffic-R2UA27AZ.js → traffic-CRLJJFKS.js} +6 -6
- package/dist/{trends-BXOZIWIE.js → trends-A7ST3WIY.js} +4 -4
- package/dist/{users-X6WJV7VJ.js → users-4H7IS7WC.js} +4 -4
- package/dist/{visibility-stats-MCNUXUCL.js → visibility-stats-F2RUTMYR.js} +5 -5
- package/dist/{wordpress-AMGUJUZX.js → wordpress-EVNS3SAF.js} +4 -4
- package/package.json +1 -1
- package/assets/assets/MeasurementPropertyPage-C2otbn5d.js +0 -4
- package/assets/assets/ProjectPage-DGrfKxfG.js +0 -15
- package/assets/assets/index-s7MwkxGB.js +0 -43
- package/assets/assets/query-client-DmQlVZMA.js +0 -1
- package/assets/assets/react-query-BnTbVX2a.js +0 -1
- package/assets/assets/service-BKTlKu2x.js +0 -1
- package/dist/activity-2KFFWLYN.js +0 -13
- package/dist/cli-commands-UH3DRBPC.js +0 -18
- package/dist/intelligence-service-S3GTOTGQ.js +0 -15
|
@@ -24,18 +24,18 @@ import {
|
|
|
24
24
|
resolveConfiguredAgentProvider,
|
|
25
25
|
resolveSessionProviderAndModel,
|
|
26
26
|
setAeroSystemPrompt
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7G6PCF4H.js";
|
|
28
28
|
import {
|
|
29
29
|
AeroToolProfiles,
|
|
30
30
|
AeroToolScopes,
|
|
31
31
|
buildAeroStateTools,
|
|
32
32
|
isAeroToolProfile,
|
|
33
33
|
truncateToolResult
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-YDVXZWWF.js";
|
|
35
35
|
import {
|
|
36
36
|
answerServiceAdapters,
|
|
37
37
|
answerServiceDescriptors
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-PGKT42YN.js";
|
|
39
39
|
import {
|
|
40
40
|
isManagedCanonryInstall
|
|
41
41
|
} from "./chunk-XAJS5FH3.js";
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
removeCloudflareTrafficConnection,
|
|
58
58
|
removeCloudflareTrafficConnectionBySourceId,
|
|
59
59
|
upsertCloudflareTrafficConnection
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-I4ITDPK7.js";
|
|
61
61
|
import {
|
|
62
62
|
claudeAdapter,
|
|
63
63
|
embedQueries,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
openrouterAdapter,
|
|
70
70
|
perplexityAdapter,
|
|
71
71
|
startTrafficReclassification
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-2JW5OBUF.js";
|
|
73
73
|
import {
|
|
74
74
|
classifyUsageSurface,
|
|
75
75
|
createApiUsageTelemetry,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
startOutcomeTimer,
|
|
82
82
|
trackFeatureCompleted,
|
|
83
83
|
trackInstallState
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-V42NDP4R.js";
|
|
85
85
|
import {
|
|
86
86
|
isLoopbackBindHost
|
|
87
87
|
} from "./chunk-TSENU4GG.js";
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
isApiProviderRegistrable,
|
|
90
90
|
isCdpProviderRegistrable,
|
|
91
91
|
registeredProviderNames
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-KIJCFPN4.js";
|
|
93
93
|
import {
|
|
94
94
|
checkLatestVersionForServer,
|
|
95
95
|
getOrCreateAnonymousId,
|
|
@@ -101,17 +101,17 @@ import {
|
|
|
101
101
|
recordDashboardEvent,
|
|
102
102
|
setTelemetryPreference,
|
|
103
103
|
trackEvent
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-G7HRY36G.js";
|
|
105
105
|
import {
|
|
106
106
|
createCanonryMcpServer
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-YW4K74WM.js";
|
|
108
108
|
import {
|
|
109
109
|
CANONRY_MCP_TIERS,
|
|
110
110
|
CANONRY_MCP_TOOLKIT_NAMES
|
|
111
111
|
} from "./chunk-MG4COK23.js";
|
|
112
112
|
import {
|
|
113
113
|
ApiClient
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-2GA43I45.js";
|
|
115
115
|
import {
|
|
116
116
|
AGENT_PROVIDERS,
|
|
117
117
|
PROVIDER_MODELS,
|
|
@@ -146,39 +146,39 @@ import {
|
|
|
146
146
|
saveConfigPatch,
|
|
147
147
|
sentimentInstallReadiness,
|
|
148
148
|
updateSharedProviderExecutionGate
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-F56XOHE2.js";
|
|
150
150
|
import {
|
|
151
151
|
getBundledSkillSnapshots
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-6RE7O724.js";
|
|
153
153
|
import {
|
|
154
154
|
computeFactorAverages,
|
|
155
155
|
deleteSiteCrawlGraphLayout,
|
|
156
156
|
persistSiteCrawlGraphLayout,
|
|
157
157
|
prepareSiteCrawlGraphLayout,
|
|
158
158
|
recordedSharePct
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-AT2LRVEB.js";
|
|
160
160
|
import {
|
|
161
161
|
CanonryMcpToolNames,
|
|
162
162
|
canonryMcpTools
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-5LBYOWQZ.js";
|
|
164
164
|
import {
|
|
165
165
|
PACKAGE_VERSION
|
|
166
166
|
} from "./chunk-AOJU5LKX.js";
|
|
167
167
|
import {
|
|
168
168
|
CliError
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-O6RKXY2P.js";
|
|
170
170
|
import {
|
|
171
171
|
IntelligenceService
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-KZKPWHJA.js";
|
|
173
173
|
import {
|
|
174
174
|
computeCitedCompetitorDomains,
|
|
175
175
|
determineCitationState
|
|
176
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-ZXX7DMBJ.js";
|
|
177
177
|
import {
|
|
178
178
|
addLogListener,
|
|
179
179
|
createFastifyLogger,
|
|
180
180
|
createLogger
|
|
181
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-FQFL223H.js";
|
|
182
182
|
import {
|
|
183
183
|
BING_THROTTLE_COOLDOWN_MS,
|
|
184
184
|
BingApiError,
|
|
@@ -194,6 +194,7 @@ import {
|
|
|
194
194
|
GbpApiError,
|
|
195
195
|
GoogleApiError,
|
|
196
196
|
GoogleAuthError,
|
|
197
|
+
LoginAttemptLimiter,
|
|
197
198
|
MCP_DELEGATED_KEY_MAX_AGE_MS,
|
|
198
199
|
PLUGIN_DIR,
|
|
199
200
|
SITE_REACHABILITY_CHECKS,
|
|
@@ -205,6 +206,7 @@ import {
|
|
|
205
206
|
anyUsersExist,
|
|
206
207
|
apiRoutes,
|
|
207
208
|
applyCompetitorAutoAliases,
|
|
209
|
+
assertCookieWriteOrigin,
|
|
208
210
|
assessConversionTrackingIntegrity,
|
|
209
211
|
auditFromRequest,
|
|
210
212
|
backfillProjectAnswerMentions,
|
|
@@ -310,7 +312,9 @@ import {
|
|
|
310
312
|
registerAgentConversationRoutes,
|
|
311
313
|
registerOAuthAdminRoutes,
|
|
312
314
|
registerOAuthRoutes,
|
|
315
|
+
registerResponseCompression,
|
|
313
316
|
requireInstanceAdministrator,
|
|
317
|
+
resolveCallerKey,
|
|
314
318
|
resolveCloudflareQueueSyncDeadlineMs,
|
|
315
319
|
resolveDestination,
|
|
316
320
|
resolveMeasurementSitemapTarget,
|
|
@@ -334,7 +338,7 @@ import {
|
|
|
334
338
|
webhookTargetRefusalReason,
|
|
335
339
|
webhookUserAgent,
|
|
336
340
|
writeAuditLog
|
|
337
|
-
} from "./chunk-
|
|
341
|
+
} from "./chunk-WCWWHK7P.js";
|
|
338
342
|
import {
|
|
339
343
|
OperationalLogStore,
|
|
340
344
|
SentimentIdempotencyConflict,
|
|
@@ -436,7 +440,7 @@ import {
|
|
|
436
440
|
unrecognizedAgentEventsHourly,
|
|
437
441
|
unrecognizedAgentNotifyState,
|
|
438
442
|
usageCounters
|
|
439
|
-
} from "./chunk-
|
|
443
|
+
} from "./chunk-DOXBK2KF.js";
|
|
440
444
|
import {
|
|
441
445
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
442
446
|
AI_ENGINE_DOMAINS,
|
|
@@ -722,7 +726,7 @@ import {
|
|
|
722
726
|
winnabilityClassLabel,
|
|
723
727
|
withRetry,
|
|
724
728
|
withSkippedProviders
|
|
725
|
-
} from "./chunk-
|
|
729
|
+
} from "./chunk-ETTKN2R4.js";
|
|
726
730
|
|
|
727
731
|
// src/google-marketing-runtime.ts
|
|
728
732
|
import crypto2 from "crypto";
|
|
@@ -4824,6 +4828,12 @@ import os3 from "os";
|
|
|
4824
4828
|
import OpenAI from "openai";
|
|
4825
4829
|
|
|
4826
4830
|
// ../provider-local/src/utils.ts
|
|
4831
|
+
var MAX_RETRY_AFTER_WAIT_MS = 65e3;
|
|
4832
|
+
function isRetryableProviderError(err) {
|
|
4833
|
+
if (!isRetryableHttpError(err)) return false;
|
|
4834
|
+
const asked = retryAfterDelayMs(err);
|
|
4835
|
+
return asked === null || asked <= MAX_RETRY_AFTER_WAIT_MS;
|
|
4836
|
+
}
|
|
4827
4837
|
async function withRetry2(fn, options = {}) {
|
|
4828
4838
|
return withRetry(fn, {
|
|
4829
4839
|
maxRetries: options.maxRetries ?? 3,
|
|
@@ -4833,7 +4843,9 @@ async function withRetry2(fn, options = {}) {
|
|
|
4833
4843
|
// provider has shipped to date (1000, 2000, 4000ms). Enable per-caller
|
|
4834
4844
|
// if you need it.
|
|
4835
4845
|
jitter: false,
|
|
4836
|
-
isRetryable:
|
|
4846
|
+
isRetryable: isRetryableProviderError,
|
|
4847
|
+
computeDelayMs: (_attempt, err, defaultMs) => retryAfterDelayMs(err) ?? defaultMs,
|
|
4848
|
+
...options.sleep ? { sleep: options.sleep } : {},
|
|
4837
4849
|
onRetry: ({ attempt, err, delayMs }) => {
|
|
4838
4850
|
console.warn(
|
|
4839
4851
|
`[provider] Attempt ${attempt + 1} failed, retrying in ${delayMs}ms...`,
|
|
@@ -4845,6 +4857,14 @@ async function withRetry2(fn, options = {}) {
|
|
|
4845
4857
|
|
|
4846
4858
|
// ../provider-local/src/normalize.ts
|
|
4847
4859
|
var DEFAULT_MODEL = "llama3";
|
|
4860
|
+
function createClient(config) {
|
|
4861
|
+
return new OpenAI({
|
|
4862
|
+
baseURL: config.baseUrl,
|
|
4863
|
+
apiKey: config.apiKey || "not-needed",
|
|
4864
|
+
// Retries are canonry's (`withRetry`), not the SDK's.
|
|
4865
|
+
maxRetries: 0
|
|
4866
|
+
});
|
|
4867
|
+
}
|
|
4848
4868
|
function validateConfig(config) {
|
|
4849
4869
|
if (!config.baseUrl || config.baseUrl.length === 0) {
|
|
4850
4870
|
return { ok: false, provider: "local", message: "missing base URL" };
|
|
@@ -4860,10 +4880,7 @@ async function healthcheck(config, signal) {
|
|
|
4860
4880
|
const validation = validateConfig(config);
|
|
4861
4881
|
if (!validation.ok) return validation;
|
|
4862
4882
|
try {
|
|
4863
|
-
const client =
|
|
4864
|
-
baseURL: config.baseUrl,
|
|
4865
|
-
apiKey: config.apiKey || "not-needed"
|
|
4866
|
-
});
|
|
4883
|
+
const client = createClient(config);
|
|
4867
4884
|
const models = await withRetry2(async () => {
|
|
4868
4885
|
const list = await client.models.list({ signal });
|
|
4869
4886
|
const items = [];
|
|
@@ -4908,10 +4925,7 @@ function buildTrackedQueryRequest(input) {
|
|
|
4908
4925
|
async function executeTrackedQuery(input) {
|
|
4909
4926
|
const model = input.config.model ?? DEFAULT_MODEL;
|
|
4910
4927
|
const params = buildTrackedQueryRequest(input).body;
|
|
4911
|
-
const client =
|
|
4912
|
-
baseURL: input.config.baseUrl,
|
|
4913
|
-
apiKey: input.config.apiKey || "not-needed"
|
|
4914
|
-
});
|
|
4928
|
+
const client = createClient(input.config);
|
|
4915
4929
|
let response;
|
|
4916
4930
|
try {
|
|
4917
4931
|
response = await withRetry2(() => client.chat.completions.create(params));
|
|
@@ -4963,10 +4977,7 @@ function extractAnswerText(rawResponse) {
|
|
|
4963
4977
|
}
|
|
4964
4978
|
async function generateText(prompt, config) {
|
|
4965
4979
|
const model = config.model ?? DEFAULT_MODEL;
|
|
4966
|
-
const client =
|
|
4967
|
-
baseURL: config.baseUrl,
|
|
4968
|
-
apiKey: config.apiKey || "not-needed"
|
|
4969
|
-
});
|
|
4980
|
+
const client = createClient(config);
|
|
4970
4981
|
const response = await withRetry2(
|
|
4971
4982
|
() => client.chat.completions.create({
|
|
4972
4983
|
model,
|
|
@@ -5201,13 +5212,16 @@ var CDPConnectionManager = class {
|
|
|
5201
5212
|
}
|
|
5202
5213
|
this.tabs.delete(target.name);
|
|
5203
5214
|
}
|
|
5215
|
+
let createdTargetId = null;
|
|
5216
|
+
let client = null;
|
|
5204
5217
|
try {
|
|
5205
5218
|
const newTarget = await CDP.New({
|
|
5206
5219
|
host: this.host,
|
|
5207
5220
|
port: this.port,
|
|
5208
5221
|
url: target.baseUrl
|
|
5209
5222
|
});
|
|
5210
|
-
|
|
5223
|
+
createdTargetId = newTarget.id;
|
|
5224
|
+
client = await CDP({
|
|
5211
5225
|
host: this.host,
|
|
5212
5226
|
port: this.port,
|
|
5213
5227
|
target: newTarget
|
|
@@ -5229,6 +5243,18 @@ var CDPConnectionManager = class {
|
|
|
5229
5243
|
this.tabs.set(target.name, entry);
|
|
5230
5244
|
return client;
|
|
5231
5245
|
} catch (err) {
|
|
5246
|
+
if (client) {
|
|
5247
|
+
try {
|
|
5248
|
+
await client.close();
|
|
5249
|
+
} catch {
|
|
5250
|
+
}
|
|
5251
|
+
}
|
|
5252
|
+
if (createdTargetId) {
|
|
5253
|
+
try {
|
|
5254
|
+
await CDP.Close({ host: this.host, port: this.port, id: createdTargetId });
|
|
5255
|
+
} catch {
|
|
5256
|
+
}
|
|
5257
|
+
}
|
|
5232
5258
|
throw new CDPProviderError(
|
|
5233
5259
|
"CDP_CONNECTION_REFUSED",
|
|
5234
5260
|
`Failed to connect to Chrome at ${this.host}:${this.port}: ${describeError(err)}`
|
|
@@ -5240,17 +5266,31 @@ var CDPConnectionManager = class {
|
|
|
5240
5266
|
* new conversation URL. This gives a clean slate without losing
|
|
5241
5267
|
* the login session.
|
|
5242
5268
|
*/
|
|
5243
|
-
async prepareForQuery(target) {
|
|
5269
|
+
async prepareForQuery(target, navigationTimeoutMs = 3e4) {
|
|
5244
5270
|
const client = await this.ensureTab(target);
|
|
5271
|
+
let timer;
|
|
5245
5272
|
try {
|
|
5273
|
+
const loadFired = client.Page.loadEventFired();
|
|
5274
|
+
void loadFired.catch(() => {
|
|
5275
|
+
});
|
|
5246
5276
|
await client.Page.navigate({ url: target.newConversationUrl });
|
|
5247
|
-
await
|
|
5277
|
+
await Promise.race([
|
|
5278
|
+
loadFired,
|
|
5279
|
+
new Promise((_, reject) => {
|
|
5280
|
+
timer = setTimeout(
|
|
5281
|
+
() => reject(new Error(`Page load timed out after ${navigationTimeoutMs}ms`)),
|
|
5282
|
+
navigationTimeoutMs
|
|
5283
|
+
);
|
|
5284
|
+
})
|
|
5285
|
+
]);
|
|
5248
5286
|
await sleep(1500);
|
|
5249
5287
|
} catch (err) {
|
|
5250
5288
|
throw new CDPProviderError(
|
|
5251
5289
|
"CDP_TARGET_SELECTOR_FAILED",
|
|
5252
5290
|
`Failed to navigate to ${target.newConversationUrl}: ${describeError(err)}`
|
|
5253
5291
|
);
|
|
5292
|
+
} finally {
|
|
5293
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
5254
5294
|
}
|
|
5255
5295
|
const entry = this.tabs.get(target.name);
|
|
5256
5296
|
if (entry) entry.lastUsed = /* @__PURE__ */ new Date();
|
|
@@ -5609,6 +5649,11 @@ function getConnection(config) {
|
|
|
5609
5649
|
}
|
|
5610
5650
|
return conn;
|
|
5611
5651
|
}
|
|
5652
|
+
async function closeAllCdpConnections() {
|
|
5653
|
+
const managers = [...connectionPool.values()];
|
|
5654
|
+
connectionPool.clear();
|
|
5655
|
+
await Promise.allSettled(managers.map((mgr) => mgr.disconnect()));
|
|
5656
|
+
}
|
|
5612
5657
|
function getScreenshotDir() {
|
|
5613
5658
|
return path2.join(os.homedir(), ".canonry", "screenshots");
|
|
5614
5659
|
}
|
|
@@ -6474,7 +6519,7 @@ function nonBlank(value) {
|
|
|
6474
6519
|
return trimmed ? trimmed : void 0;
|
|
6475
6520
|
}
|
|
6476
6521
|
function resolveBuildCommit(env = process.env) {
|
|
6477
|
-
const embedded = true ? "
|
|
6522
|
+
const embedded = true ? "fd44830607fd03d78e990c0e6dc1d9cf23415e61" : void 0;
|
|
6478
6523
|
return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
|
|
6479
6524
|
}
|
|
6480
6525
|
function resolveInstanceIdentity(env = process.env) {
|
|
@@ -9299,61 +9344,72 @@ async function executeGscSync(db, runId, projectId, opts) {
|
|
|
9299
9344
|
endDate
|
|
9300
9345
|
});
|
|
9301
9346
|
log4.info("fetch.complete", { runId, projectId, rowCount: rows.length });
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
|
|
9347
|
+
const insertNow = (/* @__PURE__ */ new Date()).toISOString();
|
|
9348
|
+
const batchSize = 400;
|
|
9349
|
+
db.transaction((tx) => {
|
|
9350
|
+
tx.delete(gscSearchData).where(
|
|
9351
|
+
and6(
|
|
9352
|
+
eq8(gscSearchData.projectId, projectId),
|
|
9353
|
+
sql3`${gscSearchData.date} >= ${startDate}`,
|
|
9354
|
+
sql3`${gscSearchData.date} <= ${endDate}`
|
|
9355
|
+
)
|
|
9356
|
+
).run();
|
|
9357
|
+
for (let i = 0; i < rows.length; i += batchSize) {
|
|
9358
|
+
const batch = rows.slice(i, i + batchSize).map((row) => {
|
|
9359
|
+
const [query, page, country, device, date] = row.keys;
|
|
9360
|
+
return {
|
|
9361
|
+
id: crypto10.randomUUID(),
|
|
9362
|
+
projectId,
|
|
9363
|
+
syncRunId: runId,
|
|
9364
|
+
date: date ?? "",
|
|
9365
|
+
query: query ?? "",
|
|
9366
|
+
page: page ?? "",
|
|
9367
|
+
country: country ?? null,
|
|
9368
|
+
device: device ?? null,
|
|
9369
|
+
clicks: row.clicks,
|
|
9370
|
+
impressions: row.impressions,
|
|
9371
|
+
ctr: String(row.ctr),
|
|
9372
|
+
position: String(row.position),
|
|
9373
|
+
createdAt: insertNow
|
|
9374
|
+
};
|
|
9375
|
+
});
|
|
9376
|
+
if (batch.length > 0) {
|
|
9377
|
+
tx.insert(gscSearchData).values(batch).run();
|
|
9378
|
+
}
|
|
9330
9379
|
}
|
|
9331
|
-
}
|
|
9380
|
+
});
|
|
9332
9381
|
const totalRows = await fetchSearchAnalytics(accessToken, propertyId, {
|
|
9333
9382
|
startDate,
|
|
9334
9383
|
endDate,
|
|
9335
9384
|
dimensions: ["date"]
|
|
9336
9385
|
});
|
|
9337
|
-
db.delete(gscDailyTotals).where(
|
|
9338
|
-
and6(
|
|
9339
|
-
eq8(gscDailyTotals.projectId, projectId),
|
|
9340
|
-
sql3`${gscDailyTotals.date} >= ${startDate}`,
|
|
9341
|
-
sql3`${gscDailyTotals.date} <= ${endDate}`
|
|
9342
|
-
)
|
|
9343
|
-
).run();
|
|
9344
9386
|
const dailyTotalsNow = (/* @__PURE__ */ new Date()).toISOString();
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9387
|
+
db.transaction((tx) => {
|
|
9388
|
+
tx.delete(gscDailyTotals).where(
|
|
9389
|
+
and6(
|
|
9390
|
+
eq8(gscDailyTotals.projectId, projectId),
|
|
9391
|
+
sql3`${gscDailyTotals.date} >= ${startDate}`,
|
|
9392
|
+
sql3`${gscDailyTotals.date} <= ${endDate}`
|
|
9393
|
+
)
|
|
9394
|
+
).run();
|
|
9395
|
+
for (let i = 0; i < totalRows.length; i += batchSize) {
|
|
9396
|
+
const batch = totalRows.slice(i, i + batchSize).map((row) => {
|
|
9397
|
+
const [date] = row.keys;
|
|
9398
|
+
return {
|
|
9399
|
+
id: crypto10.randomUUID(),
|
|
9400
|
+
projectId,
|
|
9401
|
+
date: date ?? "",
|
|
9402
|
+
clicks: row.clicks,
|
|
9403
|
+
impressions: row.impressions,
|
|
9404
|
+
position: String(row.position),
|
|
9405
|
+
createdAt: dailyTotalsNow
|
|
9406
|
+
};
|
|
9407
|
+
});
|
|
9408
|
+
if (batch.length > 0) {
|
|
9409
|
+
tx.insert(gscDailyTotals).values(batch).run();
|
|
9410
|
+
}
|
|
9411
|
+
}
|
|
9412
|
+
});
|
|
9357
9413
|
const observedThrough = totalRows.map((row) => row.keys[0] ?? "").filter((date) => date !== "").reduce((max2, date) => max2 === null || date > max2 ? date : max2, null);
|
|
9358
9414
|
let dataThroughDate = null;
|
|
9359
9415
|
if (observedThrough !== null || endDate) {
|
|
@@ -9384,20 +9440,11 @@ async function executeGscSync(db, runId, projectId, opts) {
|
|
|
9384
9440
|
endDate,
|
|
9385
9441
|
dimensions: ["date", "query"]
|
|
9386
9442
|
});
|
|
9387
|
-
db.delete(gscQueryDailyTotals).where(
|
|
9388
|
-
and6(
|
|
9389
|
-
eq8(gscQueryDailyTotals.projectId, projectId),
|
|
9390
|
-
sql3`${gscQueryDailyTotals.date} >= ${startDate}`,
|
|
9391
|
-
sql3`${gscQueryDailyTotals.date} <= ${endDate}`
|
|
9392
|
-
)
|
|
9393
|
-
).run();
|
|
9394
9443
|
const queryTotalsNow = (/* @__PURE__ */ new Date()).toISOString();
|
|
9395
|
-
|
|
9396
|
-
for (const row of queryTotalRows) {
|
|
9444
|
+
const validQueryTotals = queryTotalRows.map((row) => {
|
|
9397
9445
|
const [date, query] = row.keys;
|
|
9398
|
-
if (!date || !query)
|
|
9399
|
-
|
|
9400
|
-
db.insert(gscQueryDailyTotals).values({
|
|
9446
|
+
if (!date || !query) return null;
|
|
9447
|
+
return {
|
|
9401
9448
|
id: crypto10.randomUUID(),
|
|
9402
9449
|
projectId,
|
|
9403
9450
|
date,
|
|
@@ -9408,8 +9455,21 @@ async function executeGscSync(db, runId, projectId, opts) {
|
|
|
9408
9455
|
syncedAt: queryTotalsNow,
|
|
9409
9456
|
syncRunId: runId,
|
|
9410
9457
|
createdAt: queryTotalsNow
|
|
9411
|
-
}
|
|
9412
|
-
}
|
|
9458
|
+
};
|
|
9459
|
+
}).filter((row) => row !== null);
|
|
9460
|
+
const queryTotalsStored = validQueryTotals.length;
|
|
9461
|
+
db.transaction((tx) => {
|
|
9462
|
+
tx.delete(gscQueryDailyTotals).where(
|
|
9463
|
+
and6(
|
|
9464
|
+
eq8(gscQueryDailyTotals.projectId, projectId),
|
|
9465
|
+
sql3`${gscQueryDailyTotals.date} >= ${startDate}`,
|
|
9466
|
+
sql3`${gscQueryDailyTotals.date} <= ${endDate}`
|
|
9467
|
+
)
|
|
9468
|
+
).run();
|
|
9469
|
+
for (let i = 0; i < validQueryTotals.length; i += batchSize) {
|
|
9470
|
+
tx.insert(gscQueryDailyTotals).values(validQueryTotals.slice(i, i + batchSize)).run();
|
|
9471
|
+
}
|
|
9472
|
+
});
|
|
9413
9473
|
log4.info("query-totals.complete", { runId, projectId, rowCount: queryTotalRows.length });
|
|
9414
9474
|
let sitemapsStored = null;
|
|
9415
9475
|
try {
|
|
@@ -10922,13 +10982,19 @@ import crypto15 from "crypto";
|
|
|
10922
10982
|
import { eq as eq12 } from "drizzle-orm";
|
|
10923
10983
|
|
|
10924
10984
|
// src/sitemap-parser.ts
|
|
10985
|
+
import { promisify } from "util";
|
|
10986
|
+
import zlib from "zlib";
|
|
10925
10987
|
var log8 = createLogger("SitemapParser");
|
|
10988
|
+
var gunzipAsync = promisify(zlib.gunzip);
|
|
10989
|
+
var SITEMAP_FETCH_TIMEOUT_MS = 15e3;
|
|
10990
|
+
var MAX_SITEMAP_BYTES = 10 * 1024 * 1024;
|
|
10991
|
+
var MAX_SITEMAPS = 100;
|
|
10926
10992
|
var LOC_REGEX = /<loc>([^<]+)<\/loc>/gi;
|
|
10927
10993
|
var SITEMAP_TAG_REGEX = /<sitemap>[\s\S]*?<\/sitemap>/gi;
|
|
10928
10994
|
var sitemapFetch = createGuardedFetch({ allowLoopback: true });
|
|
10929
10995
|
async function fetchSitemap(url) {
|
|
10930
10996
|
try {
|
|
10931
|
-
return await sitemapFetch(url);
|
|
10997
|
+
return await sitemapFetch(url, { signal: AbortSignal.timeout(SITEMAP_FETCH_TIMEOUT_MS) });
|
|
10932
10998
|
} catch (err) {
|
|
10933
10999
|
if (err instanceof EgressRefusedError) {
|
|
10934
11000
|
throw withOutcomeReason(new Error(`Sitemap ${url} rejected: ${err.message}`), OutcomeReasonCodes.BLOCKED_UNSAFE_URL);
|
|
@@ -10939,15 +11005,50 @@ async function fetchSitemap(url) {
|
|
|
10939
11005
|
throw err;
|
|
10940
11006
|
}
|
|
10941
11007
|
}
|
|
11008
|
+
async function readResponseBytesWithLimit(res, maxBytes) {
|
|
11009
|
+
const contentLength = res.headers.get("content-length");
|
|
11010
|
+
if (contentLength !== null) {
|
|
11011
|
+
const declared = Number.parseInt(contentLength, 10);
|
|
11012
|
+
if (Number.isFinite(declared) && declared > maxBytes) {
|
|
11013
|
+
await res.body?.cancel();
|
|
11014
|
+
throw new Error(`Sitemap exceeds maximum size limit of ${maxBytes} bytes`);
|
|
11015
|
+
}
|
|
11016
|
+
}
|
|
11017
|
+
if (!res.body) {
|
|
11018
|
+
const buf = Buffer.from(await res.arrayBuffer());
|
|
11019
|
+
if (buf.byteLength > maxBytes) {
|
|
11020
|
+
throw new Error(`Sitemap exceeds maximum size limit of ${maxBytes} bytes`);
|
|
11021
|
+
}
|
|
11022
|
+
return buf;
|
|
11023
|
+
}
|
|
11024
|
+
const reader = res.body.getReader();
|
|
11025
|
+
const chunks = [];
|
|
11026
|
+
let total = 0;
|
|
11027
|
+
try {
|
|
11028
|
+
while (true) {
|
|
11029
|
+
const { done, value } = await reader.read();
|
|
11030
|
+
if (done) break;
|
|
11031
|
+
if (!value) continue;
|
|
11032
|
+
total += value.byteLength;
|
|
11033
|
+
if (total > maxBytes) {
|
|
11034
|
+
await reader.cancel();
|
|
11035
|
+
throw new Error(`Sitemap exceeds maximum size limit of ${maxBytes} bytes`);
|
|
11036
|
+
}
|
|
11037
|
+
chunks.push(Buffer.from(value.buffer, value.byteOffset, value.byteLength));
|
|
11038
|
+
}
|
|
11039
|
+
} finally {
|
|
11040
|
+
reader.releaseLock();
|
|
11041
|
+
}
|
|
11042
|
+
return Buffer.concat(chunks, total);
|
|
11043
|
+
}
|
|
10942
11044
|
async function readSitemapBody(res) {
|
|
10943
|
-
const
|
|
10944
|
-
const bytes = new Uint8Array(buf);
|
|
11045
|
+
const bytes = await readResponseBytesWithLimit(res, MAX_SITEMAP_BYTES);
|
|
10945
11046
|
const isGzipped = bytes.length >= 2 && bytes[0] === 31 && bytes[1] === 139;
|
|
10946
11047
|
if (!isGzipped) {
|
|
10947
|
-
return
|
|
11048
|
+
return bytes.toString("utf8");
|
|
10948
11049
|
}
|
|
10949
|
-
const decompressed =
|
|
10950
|
-
return
|
|
11050
|
+
const decompressed = await gunzipAsync(bytes, { maxOutputLength: MAX_SITEMAP_BYTES });
|
|
11051
|
+
return decompressed.toString("utf8");
|
|
10951
11052
|
}
|
|
10952
11053
|
async function fetchAndParseSitemap(sitemapUrl) {
|
|
10953
11054
|
const urls = /* @__PURE__ */ new Set();
|
|
@@ -10965,6 +11066,7 @@ async function fetchAndParseSitemap(sitemapUrl) {
|
|
|
10965
11066
|
async function parseSitemapRecursive(url, urls, visited, depth, isChild) {
|
|
10966
11067
|
if (depth > 3) return;
|
|
10967
11068
|
if (visited.has(url)) return;
|
|
11069
|
+
if (visited.size >= MAX_SITEMAPS) return;
|
|
10968
11070
|
visited.add(url);
|
|
10969
11071
|
let res;
|
|
10970
11072
|
try {
|
|
@@ -12156,7 +12258,7 @@ import crypto19 from "crypto";
|
|
|
12156
12258
|
import path5 from "path";
|
|
12157
12259
|
import { and as and12, eq as eq17, sql as sql6 } from "drizzle-orm";
|
|
12158
12260
|
var log14 = createLogger("CommonCrawlSync");
|
|
12159
|
-
var INSERT_CHUNK_SIZE =
|
|
12261
|
+
var INSERT_CHUNK_SIZE = 500;
|
|
12160
12262
|
function defaultDeps2() {
|
|
12161
12263
|
return {
|
|
12162
12264
|
downloadFile,
|
|
@@ -12449,6 +12551,7 @@ async function executeBacklinkExtract(db, runId, projectId, opts = {}) {
|
|
|
12449
12551
|
)
|
|
12450
12552
|
).run();
|
|
12451
12553
|
if (rows.length > 0) {
|
|
12554
|
+
const INSERT_CHUNK_SIZE2 = 500;
|
|
12452
12555
|
const values = rows.map((r) => ({
|
|
12453
12556
|
id: crypto20.randomUUID(),
|
|
12454
12557
|
projectId,
|
|
@@ -12460,7 +12563,9 @@ async function executeBacklinkExtract(db, runId, projectId, opts = {}) {
|
|
|
12460
12563
|
numHosts: r.numHosts,
|
|
12461
12564
|
createdAt: queriedAt
|
|
12462
12565
|
}));
|
|
12463
|
-
|
|
12566
|
+
for (let i = 0; i < values.length; i += INSERT_CHUNK_SIZE2) {
|
|
12567
|
+
tx.insert(backlinkDomains).values(values.slice(i, i + INSERT_CHUNK_SIZE2)).run();
|
|
12568
|
+
}
|
|
12464
12569
|
}
|
|
12465
12570
|
const summary2 = computeSummary(rows);
|
|
12466
12571
|
tx.insert(backlinkSummaries).values({
|
|
@@ -12505,6 +12610,16 @@ async function executeBacklinkExtract(db, runId, projectId, opts = {}) {
|
|
|
12505
12610
|
throw err;
|
|
12506
12611
|
}
|
|
12507
12612
|
}
|
|
12613
|
+
function createBacklinkExtractQueue(runExtract) {
|
|
12614
|
+
let tail = Promise.resolve();
|
|
12615
|
+
return {
|
|
12616
|
+
enqueue(runId, projectId, release2) {
|
|
12617
|
+
const result = tail.then(() => runExtract(runId, projectId, release2));
|
|
12618
|
+
tail = result.then(() => void 0, () => void 0);
|
|
12619
|
+
return result;
|
|
12620
|
+
}
|
|
12621
|
+
};
|
|
12622
|
+
}
|
|
12508
12623
|
function computeSummary(rows) {
|
|
12509
12624
|
return computeBacklinkSummaryMetrics(rows);
|
|
12510
12625
|
}
|
|
@@ -13265,11 +13380,21 @@ function classifySiteCrawlTemplateLinks(db, scope, pagesFetched, placementRulese
|
|
|
13265
13380
|
}
|
|
13266
13381
|
}
|
|
13267
13382
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
13383
|
+
const CHUNKS_PER_TX = 10;
|
|
13384
|
+
const pendingUpdates = [];
|
|
13268
13385
|
for (const group of edgeKeysByValue.values()) {
|
|
13269
13386
|
for (const chunk of chunked(group.edgeKeys)) {
|
|
13270
|
-
|
|
13387
|
+
pendingUpdates.push({ isTemplate: group.isTemplate, templateRatio: group.templateRatio, edgeKeys: chunk });
|
|
13271
13388
|
}
|
|
13272
13389
|
}
|
|
13390
|
+
for (let i = 0; i < pendingUpdates.length; i += CHUNKS_PER_TX) {
|
|
13391
|
+
const slice = pendingUpdates.slice(i, i + CHUNKS_PER_TX);
|
|
13392
|
+
db.transaction((tx) => {
|
|
13393
|
+
for (const update of slice) {
|
|
13394
|
+
tx.update(siteCrawlEdges).set({ isTemplate: update.isTemplate, templateRatio: update.templateRatio, updatedAt: now }).where(and15(scopeFilter, inArray8(siteCrawlEdges.edgeKey, update.edgeKeys))).run();
|
|
13395
|
+
}
|
|
13396
|
+
});
|
|
13397
|
+
}
|
|
13273
13398
|
return {
|
|
13274
13399
|
detection: templateLinkDetection({ placementAvailable, ubiquityAvailable, tally }),
|
|
13275
13400
|
templateEdgeCount,
|
|
@@ -18665,7 +18790,7 @@ ${lines.join("\n")}
|
|
|
18665
18790
|
try {
|
|
18666
18791
|
let agent;
|
|
18667
18792
|
try {
|
|
18668
|
-
const scope =
|
|
18793
|
+
const scope = AeroToolScopes.readOnly;
|
|
18669
18794
|
const profile = this.profiles.get(projectName) ?? AeroToolProfiles.default;
|
|
18670
18795
|
agent = await this.acquireForTurn(projectName, { toolScope: scope, toolProfile: profile });
|
|
18671
18796
|
} catch (err) {
|
|
@@ -21472,6 +21597,10 @@ var keylessFirstRunSetupByServer = /* @__PURE__ */ new WeakMap();
|
|
|
21472
21597
|
function allowsKeylessFirstRunSetup(app) {
|
|
21473
21598
|
return keylessFirstRunSetupByServer.get(app) ?? false;
|
|
21474
21599
|
}
|
|
21600
|
+
var firstRunSetupTokenByServer = /* @__PURE__ */ new WeakMap();
|
|
21601
|
+
function getFirstRunSetupToken(app) {
|
|
21602
|
+
return firstRunSetupTokenByServer.get(app)?.token ?? null;
|
|
21603
|
+
}
|
|
21475
21604
|
var DEFAULT_QUOTA = DEFAULT_PROVIDER_QUOTA;
|
|
21476
21605
|
var SESSION_COOKIE_NAME = "canonry_session";
|
|
21477
21606
|
var SESSION_TTL_MS = 12 * 60 * 60 * 1e3;
|
|
@@ -21628,15 +21757,23 @@ function runtimePathIdentity(runtimePath) {
|
|
|
21628
21757
|
var DASHBOARD_SCRYPT_KEYLEN = 64;
|
|
21629
21758
|
var DASHBOARD_SCRYPT_COST = 1 << 15;
|
|
21630
21759
|
var DASHBOARD_SCRYPT_MAXMEM = 64 * 1024 * 1024;
|
|
21631
|
-
function
|
|
21760
|
+
function scryptAsync(password, salt, keylen, options) {
|
|
21761
|
+
return new Promise((resolve, reject) => {
|
|
21762
|
+
crypto30.scrypt(password, salt, keylen, options, (err, derivedKey) => {
|
|
21763
|
+
if (err) reject(err);
|
|
21764
|
+
else resolve(derivedKey);
|
|
21765
|
+
});
|
|
21766
|
+
});
|
|
21767
|
+
}
|
|
21768
|
+
async function hashDashboardPassword(password) {
|
|
21632
21769
|
const salt = crypto30.randomBytes(16);
|
|
21633
|
-
const derived =
|
|
21770
|
+
const derived = await scryptAsync(password, salt, DASHBOARD_SCRYPT_KEYLEN, {
|
|
21634
21771
|
N: DASHBOARD_SCRYPT_COST,
|
|
21635
21772
|
maxmem: DASHBOARD_SCRYPT_MAXMEM
|
|
21636
21773
|
});
|
|
21637
21774
|
return `scrypt$1$${salt.toString("base64")}$${derived.toString("base64")}`;
|
|
21638
21775
|
}
|
|
21639
|
-
function verifyDashboardPassword(password, storedHash) {
|
|
21776
|
+
async function verifyDashboardPassword(password, storedHash) {
|
|
21640
21777
|
if (storedHash.startsWith("scrypt$1$")) {
|
|
21641
21778
|
const parts = storedHash.split("$");
|
|
21642
21779
|
if (parts.length !== 4) return { ok: false, needsRehash: false };
|
|
@@ -21651,7 +21788,7 @@ function verifyDashboardPassword(password, storedHash) {
|
|
|
21651
21788
|
} catch {
|
|
21652
21789
|
return { ok: false, needsRehash: false };
|
|
21653
21790
|
}
|
|
21654
|
-
const derived =
|
|
21791
|
+
const derived = await scryptAsync(password, salt, expected.length, {
|
|
21655
21792
|
N: DASHBOARD_SCRYPT_COST,
|
|
21656
21793
|
maxmem: DASHBOARD_SCRYPT_MAXMEM
|
|
21657
21794
|
});
|
|
@@ -21954,6 +22091,7 @@ async function createServer(opts) {
|
|
|
21954
22091
|
genReqId: () => crypto30.randomUUID(),
|
|
21955
22092
|
trustProxy
|
|
21956
22093
|
});
|
|
22094
|
+
registerResponseCompression(app);
|
|
21957
22095
|
if (!ownsDefaultConfig) {
|
|
21958
22096
|
const releaseAnonymousIdWrites = holdAnonymousIdWrites();
|
|
21959
22097
|
app.addHook("onClose", async () => {
|
|
@@ -22039,7 +22177,6 @@ async function createServer(opts) {
|
|
|
22039
22177
|
// the default config.yaml, so only the server running from it asks.
|
|
22040
22178
|
...ownsDefaultConfig ? { onFirstActivation: () => maybeShowActivationNotice() } : {}
|
|
22041
22179
|
});
|
|
22042
|
-
jobRunner.recoverStaleRuns();
|
|
22043
22180
|
const seoRuntime = new SeoRuntime(opts.db, () => loadConfig(runtimeConfigPath).seo, () => {
|
|
22044
22181
|
const stat = fs6.statSync(runtimeConfigPath, { bigint: true });
|
|
22045
22182
|
return `${stat.dev}:${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}`;
|
|
@@ -22958,11 +23095,19 @@ async function createServer(opts) {
|
|
|
22958
23095
|
const namedAccountsInUse = () => anyUsersExist(opts.db);
|
|
22959
23096
|
const NAMED_ACCOUNTS_MESSAGE = "This install uses named accounts. Sign in with your name and password.";
|
|
22960
23097
|
const serverApiKeyMissing = () => new AppError("AUTH_INVALID", "Server API key not found \u2014 run canonry bootstrap", 401);
|
|
23098
|
+
const firstRunSetupToken = keylessLocalSetup && dashboardRequirePassword && !opts.config.dashboardPasswordHash && !namedAccountsInUse() ? crypto30.randomBytes(32).toString("hex") : null;
|
|
23099
|
+
if (firstRunSetupToken !== null) {
|
|
23100
|
+
firstRunSetupTokenByServer.set(app, {
|
|
23101
|
+
token: firstRunSetupToken,
|
|
23102
|
+
tokenHash: hashSessionToken(firstRunSetupToken),
|
|
23103
|
+
consumed: false
|
|
23104
|
+
});
|
|
23105
|
+
}
|
|
22961
23106
|
const rejectLegacySessionStoredOnly = async (request, reply) => {
|
|
22962
23107
|
const header = request.headers[STORED_ONLY_HEADER];
|
|
22963
23108
|
if (header !== "1" && header !== "true") return;
|
|
22964
23109
|
const route = request.routeOptions.url ?? request.url;
|
|
22965
|
-
const operation = route.endsWith("/session/setup") ? "POST /api/v1/session/setup" : `${request.method.toUpperCase()} /api/v1/session`;
|
|
23110
|
+
const operation = route.endsWith("/session/setup") ? "POST /api/v1/session/setup" : route.endsWith("/session/setup-token") ? "POST /api/v1/session/setup-token" : `${request.method.toUpperCase()} /api/v1/session`;
|
|
22966
23111
|
const error = storedOnlyRefused("Stored-only mode refuses this operation", { operation, access: OperationAccesses.write });
|
|
22967
23112
|
return reply.status(error.statusCode).send(error.toJSON());
|
|
22968
23113
|
};
|
|
@@ -23017,7 +23162,11 @@ async function createServer(opts) {
|
|
|
23017
23162
|
const err = serverApiKeyMissing();
|
|
23018
23163
|
return reply.status(err.statusCode).send(err.toJSON());
|
|
23019
23164
|
}
|
|
23020
|
-
const passwordHash = hashDashboardPassword(password);
|
|
23165
|
+
const passwordHash = await hashDashboardPassword(password);
|
|
23166
|
+
if (opts.config.dashboardPasswordHash) {
|
|
23167
|
+
const err = validationError("Dashboard password is already configured");
|
|
23168
|
+
return reply.status(err.statusCode).send(err.toJSON());
|
|
23169
|
+
}
|
|
23021
23170
|
opts.config.dashboardPasswordHash = passwordHash;
|
|
23022
23171
|
let sessionId;
|
|
23023
23172
|
try {
|
|
@@ -23041,6 +23190,64 @@ async function createServer(opts) {
|
|
|
23041
23190
|
setSessionCookie(reply, sessionId);
|
|
23042
23191
|
return reply.send({ authenticated: true });
|
|
23043
23192
|
});
|
|
23193
|
+
app.post(apiPrefix + "/session/setup-token", { ...legacySessionRouteOptions, config: { skipInstanceAuth: true } }, async (request, reply) => {
|
|
23194
|
+
if (namedAccountsInUse()) {
|
|
23195
|
+
const err = forbidden(NAMED_ACCOUNTS_MESSAGE);
|
|
23196
|
+
return reply.status(err.statusCode).send(err.toJSON());
|
|
23197
|
+
}
|
|
23198
|
+
if (!dashboardRequirePassword) {
|
|
23199
|
+
return reply.send({ authenticated: true, setupRequired: false });
|
|
23200
|
+
}
|
|
23201
|
+
if (!(keylessLocalSetup && isDirectLocalRequest(request))) {
|
|
23202
|
+
const err = authRequired(
|
|
23203
|
+
"Setting up with the first-run token requires a request made directly from this machine to a loopback-bound server that has no external URL, base path, or trusted proxy configured."
|
|
23204
|
+
);
|
|
23205
|
+
return reply.status(err.statusCode).send(err.toJSON());
|
|
23206
|
+
}
|
|
23207
|
+
if (opts.config.dashboardPasswordHash) {
|
|
23208
|
+
const err = validationError("Dashboard password is already configured");
|
|
23209
|
+
return reply.status(err.statusCode).send(err.toJSON());
|
|
23210
|
+
}
|
|
23211
|
+
const stored = firstRunSetupTokenByServer.get(app);
|
|
23212
|
+
if (stored === void 0 || stored.consumed) {
|
|
23213
|
+
return reply.status(401).send({
|
|
23214
|
+
error: { code: "AUTH_INVALID", message: "Invalid or expired setup token" }
|
|
23215
|
+
});
|
|
23216
|
+
}
|
|
23217
|
+
const presented = request.body?.token?.trim() ?? "";
|
|
23218
|
+
const presentedHash = presented ? hashSessionToken(presented) : "";
|
|
23219
|
+
if (presentedHash.length !== stored.tokenHash.length || !crypto30.timingSafeEqual(Buffer.from(presentedHash, "hex"), Buffer.from(stored.tokenHash, "hex"))) {
|
|
23220
|
+
return reply.status(401).send({
|
|
23221
|
+
error: { code: "AUTH_INVALID", message: "Invalid or expired setup token" }
|
|
23222
|
+
});
|
|
23223
|
+
}
|
|
23224
|
+
const defaultKey = getDefaultApiKey();
|
|
23225
|
+
if (!defaultKey || defaultKey.revokedAt) {
|
|
23226
|
+
const err = serverApiKeyMissing();
|
|
23227
|
+
return reply.status(err.statusCode).send(err.toJSON());
|
|
23228
|
+
}
|
|
23229
|
+
const sessionId = opts.db.transaction((tx) => {
|
|
23230
|
+
writeAuditLog(tx, auditFromRequest(request, {
|
|
23231
|
+
actor: `api-key:${defaultKey.id}`,
|
|
23232
|
+
credentialId: null,
|
|
23233
|
+
requestId: request.id,
|
|
23234
|
+
action: "dashboard-session.created",
|
|
23235
|
+
entityType: "dashboard-session",
|
|
23236
|
+
diff: { authorizedBy: "setup-token" }
|
|
23237
|
+
}));
|
|
23238
|
+
return createSession(defaultKey, true, tx);
|
|
23239
|
+
});
|
|
23240
|
+
stored.consumed = true;
|
|
23241
|
+
setSessionCookie(reply, sessionId);
|
|
23242
|
+
return reply.send({ authenticated: true });
|
|
23243
|
+
});
|
|
23244
|
+
const LEGACY_LOGIN_MAX_FAILURES = 10;
|
|
23245
|
+
const LEGACY_LOGIN_WINDOW_MS = 15 * 6e4;
|
|
23246
|
+
const LEGACY_LOGIN_MAX_GLOBAL_INFLIGHT = 8;
|
|
23247
|
+
const LEGACY_LOGIN_MAX_CALLER_INFLIGHT = 2;
|
|
23248
|
+
const legacyLoginLimiter = new LoginAttemptLimiter(LEGACY_LOGIN_MAX_FAILURES, LEGACY_LOGIN_WINDOW_MS);
|
|
23249
|
+
const legacyLoginInflightByCaller = /* @__PURE__ */ new Map();
|
|
23250
|
+
let legacyLoginGlobalInflight = 0;
|
|
23044
23251
|
app.post(apiPrefix + "/session", legacySessionRouteOptions, async (request, reply) => {
|
|
23045
23252
|
if (namedAccountsInUse()) {
|
|
23046
23253
|
const err2 = forbidden(NAMED_ACCOUNTS_MESSAGE);
|
|
@@ -23058,21 +23265,47 @@ async function createServer(opts) {
|
|
|
23058
23265
|
);
|
|
23059
23266
|
return reply.status(err2.statusCode).send(err2.toJSON());
|
|
23060
23267
|
}
|
|
23061
|
-
const
|
|
23062
|
-
|
|
23063
|
-
|
|
23064
|
-
|
|
23268
|
+
const callerKey = resolveCallerKey(request, trustProxy !== false) ?? "unidentified";
|
|
23269
|
+
const nowMs = Date.now();
|
|
23270
|
+
if (legacyLoginLimiter.isBlocked(callerKey, nowMs)) {
|
|
23271
|
+
return reply.status(429).send({
|
|
23272
|
+
error: { code: "RATE_LIMITED", message: "Too many failed sign-in attempts. Wait before trying again." }
|
|
23273
|
+
});
|
|
23274
|
+
}
|
|
23275
|
+
const callerInflight = legacyLoginInflightByCaller.get(callerKey) ?? 0;
|
|
23276
|
+
if (legacyLoginGlobalInflight >= LEGACY_LOGIN_MAX_GLOBAL_INFLIGHT || callerInflight >= LEGACY_LOGIN_MAX_CALLER_INFLIGHT) {
|
|
23277
|
+
return reply.status(429).send({
|
|
23278
|
+
error: { code: "RATE_LIMITED", message: "Too many concurrent sign-in requests. Try again shortly." }
|
|
23279
|
+
});
|
|
23280
|
+
}
|
|
23281
|
+
legacyLoginGlobalInflight += 1;
|
|
23282
|
+
legacyLoginInflightByCaller.set(callerKey, callerInflight + 1);
|
|
23283
|
+
const storedHash = opts.config.dashboardPasswordHash;
|
|
23284
|
+
let verification;
|
|
23285
|
+
try {
|
|
23286
|
+
verification = await verifyDashboardPassword(
|
|
23287
|
+
password,
|
|
23288
|
+
storedHash
|
|
23289
|
+
);
|
|
23290
|
+
} finally {
|
|
23291
|
+
legacyLoginGlobalInflight -= 1;
|
|
23292
|
+
const remaining = (legacyLoginInflightByCaller.get(callerKey) ?? 1) - 1;
|
|
23293
|
+
if (remaining <= 0) legacyLoginInflightByCaller.delete(callerKey);
|
|
23294
|
+
else legacyLoginInflightByCaller.set(callerKey, remaining);
|
|
23295
|
+
}
|
|
23065
23296
|
const onDisk = verification.ok && verification.needsRehash && persistedConfigPath !== void 0 ? loadConfigRaw(persistedConfigPath) : null;
|
|
23066
|
-
if (!verification.ok || onDisk && onDisk.dashboardPasswordHash !==
|
|
23297
|
+
if (!verification.ok || onDisk && onDisk.dashboardPasswordHash !== storedHash) {
|
|
23298
|
+
legacyLoginLimiter.recordFailure(callerKey, Date.now());
|
|
23067
23299
|
return reply.status(401).send({
|
|
23068
23300
|
error: { code: "AUTH_INVALID", message: "Incorrect password" }
|
|
23069
23301
|
});
|
|
23070
23302
|
}
|
|
23303
|
+
legacyLoginLimiter.clear(callerKey);
|
|
23071
23304
|
if (verification.needsRehash) {
|
|
23072
23305
|
if (persistedConfigPath !== void 0 && fs6.existsSync(persistedConfigPath) && (!onDisk || typeof onDisk !== "object" || Array.isArray(onDisk) || !onDisk.apiUrl || !onDisk.database || !onDisk.apiKey)) {
|
|
23073
23306
|
throw new Error("Cannot migrate dashboard password: config.yaml is unreadable or invalid");
|
|
23074
23307
|
}
|
|
23075
|
-
const migratedHash = hashDashboardPassword(password);
|
|
23308
|
+
const migratedHash = await hashDashboardPassword(password);
|
|
23076
23309
|
if (persistedConfigPath !== void 0) {
|
|
23077
23310
|
saveConfig({ ...onDisk ?? opts.config, dashboardPasswordHash: migratedHash }, persistedConfigPath);
|
|
23078
23311
|
}
|
|
@@ -23085,11 +23318,19 @@ async function createServer(opts) {
|
|
|
23085
23318
|
return reply.send({ authenticated: true });
|
|
23086
23319
|
}
|
|
23087
23320
|
if (apiKey) {
|
|
23321
|
+
const callerKey = resolveCallerKey(request, trustProxy !== false) ?? "unidentified";
|
|
23322
|
+
if (legacyLoginLimiter.isBlocked(callerKey, Date.now())) {
|
|
23323
|
+
return reply.status(429).send({
|
|
23324
|
+
error: { code: "RATE_LIMITED", message: "Too many failed sign-in attempts. Wait before trying again." }
|
|
23325
|
+
});
|
|
23326
|
+
}
|
|
23088
23327
|
const key = opts.db.select().from(apiKeys).where(eq40(apiKeys.keyHash, hashApiKey(apiKey))).get();
|
|
23089
23328
|
if (!key || key.revokedAt) {
|
|
23329
|
+
legacyLoginLimiter.recordFailure(callerKey, Date.now());
|
|
23090
23330
|
const err2 = authInvalid();
|
|
23091
23331
|
return reply.status(err2.statusCode).send(err2.toJSON());
|
|
23092
23332
|
}
|
|
23333
|
+
legacyLoginLimiter.clear(callerKey);
|
|
23093
23334
|
opts.db.update(apiKeys).set({ lastUsedAt: (/* @__PURE__ */ new Date()).toISOString() }).where(eq40(apiKeys.id, key.id)).run();
|
|
23094
23335
|
setSessionCookie(reply, createSession(key));
|
|
23095
23336
|
return reply.send({ authenticated: true });
|
|
@@ -23098,6 +23339,14 @@ async function createServer(opts) {
|
|
|
23098
23339
|
return reply.status(err.statusCode).send(err.toJSON());
|
|
23099
23340
|
});
|
|
23100
23341
|
app.delete(apiPrefix + "/session", legacySessionRouteOptions, async (request, reply) => {
|
|
23342
|
+
try {
|
|
23343
|
+
assertCookieWriteOrigin(request);
|
|
23344
|
+
} catch (err) {
|
|
23345
|
+
if (err instanceof AppError) {
|
|
23346
|
+
return reply.status(err.statusCode).send(err.toJSON());
|
|
23347
|
+
}
|
|
23348
|
+
throw err;
|
|
23349
|
+
}
|
|
23101
23350
|
const sessionId = parseCookieHeader(request.headers.cookie)[SESSION_COOKIE_NAME];
|
|
23102
23351
|
clearSession(sessionId);
|
|
23103
23352
|
reply.header(
|
|
@@ -23345,6 +23594,9 @@ async function createServer(opts) {
|
|
|
23345
23594
|
},
|
|
23346
23595
|
connectionTests
|
|
23347
23596
|
});
|
|
23597
|
+
const backlinkExtractQueue = createBacklinkExtractQueue(
|
|
23598
|
+
(runId, projectId, release2) => executeBacklinkExtract(opts.db, runId, projectId, { release: release2 })
|
|
23599
|
+
);
|
|
23348
23600
|
await app.register(apiRoutes, {
|
|
23349
23601
|
// Outcome telemetry reported from route code (`app.emitOutcome`).
|
|
23350
23602
|
onOutcome: handleRouteOutcome,
|
|
@@ -23590,9 +23842,7 @@ async function createServer(opts) {
|
|
|
23590
23842
|
trigger: RunTriggers.scheduled,
|
|
23591
23843
|
createdAt: now
|
|
23592
23844
|
}).run();
|
|
23593
|
-
|
|
23594
|
-
release: r
|
|
23595
|
-
}).catch((err) => {
|
|
23845
|
+
backlinkExtractQueue.enqueue(runId, projectId, r).catch((err) => {
|
|
23596
23846
|
app.log.error(
|
|
23597
23847
|
{ runId, projectId, err },
|
|
23598
23848
|
"Auto backlink extract failed"
|
|
@@ -23605,7 +23855,7 @@ async function createServer(opts) {
|
|
|
23605
23855
|
});
|
|
23606
23856
|
},
|
|
23607
23857
|
onBacklinkExtractRequested: (runId, projectId, release2) => {
|
|
23608
|
-
|
|
23858
|
+
backlinkExtractQueue.enqueue(runId, projectId, release2).catch(
|
|
23609
23859
|
(err) => {
|
|
23610
23860
|
app.log.error({ runId, err }, "Backlink extract failed");
|
|
23611
23861
|
}
|
|
@@ -24185,6 +24435,7 @@ async function createServer(opts) {
|
|
|
24185
24435
|
app.addHook("onListen", () => {
|
|
24186
24436
|
if (runtimeStartupSettled) return;
|
|
24187
24437
|
try {
|
|
24438
|
+
jobRunner.recoverStaleRuns();
|
|
24188
24439
|
seoRuntime.start();
|
|
24189
24440
|
scheduler.start();
|
|
24190
24441
|
stopSiteLiveness = startSiteLivenessLoop({
|
|
@@ -24240,6 +24491,7 @@ async function createServer(opts) {
|
|
|
24240
24491
|
stopInstallState?.();
|
|
24241
24492
|
stopInstallState = null;
|
|
24242
24493
|
scheduler.stop();
|
|
24494
|
+
await closeAllCdpConnections();
|
|
24243
24495
|
});
|
|
24244
24496
|
return app;
|
|
24245
24497
|
}
|
|
@@ -24306,5 +24558,6 @@ export {
|
|
|
24306
24558
|
createGoogleMarketingRuntime,
|
|
24307
24559
|
waitForServerRuntimeStartup,
|
|
24308
24560
|
allowsKeylessFirstRunSetup,
|
|
24561
|
+
getFirstRunSetupToken,
|
|
24309
24562
|
createServer
|
|
24310
24563
|
};
|