@canonry/canonry 7.125.6 → 7.126.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/README.md +3 -3
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +1 -1
- package/assets/assets/{AccessControls-CUwUDBp8.js → AccessControls-ogV5Gz4X.js} +2 -2
- package/assets/assets/{AgentSetupPage-vbEPb6yX.js → AgentSetupPage-DEVRQ04Z.js} +4 -4
- package/assets/assets/{AuditHistoryPanel-CutYGRGi.js → AuditHistoryPanel-DyXqEWpq.js} +1 -1
- package/assets/assets/{BacklinksPage-Cjs8Pzjw.js → BacklinksPage-B4powgfU.js} +1 -1
- package/assets/assets/{ChartPrimitives-Bb1-9BLv.js → ChartPrimitives-De8aCfZp.js} +1 -1
- package/assets/assets/{HistoryPage-CMBlL0Ms.js → HistoryPage-CN2VzZeY.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-C9cLyWJo.js → MeasurementPropertyPage-CP9p7C6B.js} +3 -3
- package/assets/assets/ProjectPage-Dq1mGFwA.js +15 -0
- package/assets/assets/{RunsPage-QN5bBEe4.js → RunsPage-p4FSGSzR.js} +1 -1
- package/assets/assets/{ServerTrafficSection-BU9Kj9MT.js → ServerTrafficSection-xzcv0S85.js} +3 -3
- package/assets/assets/{SettingsPage-C2wYKFF9.js → SettingsPage-C6Oh-XQT.js} +1 -1
- package/assets/assets/ToneBadge-CxostV9z.js +60 -0
- package/assets/assets/{TrafficPage-DEQ6eJUy.js → TrafficPage-D5_wyrCY.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-B7sygHig.js → TrafficSourceDetailPage-CGbQlo1a.js} +1 -1
- package/assets/assets/{account-context-BlFU3aZm.js → account-context-Mya_uodz.js} +1 -1
- package/assets/assets/{agent-trust-copy-Dmj9Xp7o.js → agent-trust-copy-DjdjfF7q.js} +1 -1
- package/assets/assets/{card-B6QRK3vg.js → card-B20lVlLX.js} +1 -1
- package/assets/assets/index-rQgaFhmc.js +43 -0
- package/assets/assets/{preload-helper-okiXXeW4.js → preload-helper-DN5snQJ-.js} +1 -1
- package/assets/assets/{query-client-Dn5u8o4X.js → query-client-2aOrFPOz.js} +1 -1
- package/assets/assets/{react-query-CZrEo0vf.js → react-query-CEsVk5jq.js} +1 -1
- package/assets/assets/{react-sigma_core.esm.min-D5s2grLh.js → react-sigma_core.esm.min-DHJ5hJS1.js} +1 -1
- package/assets/assets/{server-traffic-Coma9CV_.js → server-traffic-Cx7fQ2OF.js} +1 -1
- package/assets/assets/{service-LmTWkeKI.js → service-DNaYUxv9.js} +1 -1
- package/assets/index.html +9 -9
- package/dist/activity-D5YDZLCK.js +13 -0
- package/dist/{ads-6ZCVMSJ2.js → ads-7JYMSESY.js} +4 -4
- package/dist/{agent-ZZJO7ET6.js → agent-3AIKIBOZ.js} +8 -8
- package/dist/{agent-ask-CPRHVULM.js → agent-ask-F7OMYKXU.js} +4 -4
- package/dist/{agent-conversations-NIWKSUC2.js → agent-conversations-W3WMXSDE.js} +4 -4
- package/dist/{agent-journeys-SHNRNV5E.js → agent-journeys-SNUC3IGG.js} +4 -4
- package/dist/{agent-memory-4IGCNFR5.js → agent-memory-PFVKTCZC.js} +4 -4
- package/dist/{agent-providers-3Q7NQS7Y.js → agent-providers-TV3SV75C.js} +4 -4
- package/dist/{agent-transcript-M3NYHNNV.js → agent-transcript-X6RMTVV5.js} +4 -4
- package/dist/{analytics-UHBUOG4T.js → analytics-U6CLZESN.js} +4 -4
- package/dist/{answerability-IRXQDOBX.js → answerability-YJSPCE4T.js} +4 -4
- package/dist/{apply-3HP75CA2.js → apply-VBX4BJCQ.js} +4 -4
- package/dist/{backfill-TQWXGQPQ.js → backfill-VY4PWO5A.js} +11 -11
- package/dist/{backlinks-O5IYHDAY.js → backlinks-U7SI3OOX.js} +4 -4
- package/dist/{bing-2MTKNQB2.js → bing-HONIKTUQ.js} +4 -4
- package/dist/{bootstrap-O7FRHURI.js → bootstrap-K7LRU624.js} +11 -11
- package/dist/{cdp-BTXUJFAN.js → cdp-VVETHJFO.js} +10 -9
- package/dist/{chunk-B3F5BMXL.js → chunk-2BSAW7H4.js} +5 -5
- package/dist/{chunk-PDSB34VB.js → chunk-2CRAVATO.js} +1 -1
- package/dist/{chunk-C5EK4TJ5.js → chunk-2RF4RB53.js} +3 -3
- package/dist/{chunk-U2LYHQHF.js → chunk-2WT4IQD7.js} +1 -1
- package/dist/{chunk-TOKRH24Q.js → chunk-3CYLLBEC.js} +172 -64
- package/dist/{chunk-KIO37ZVB.js → chunk-474HYXOY.js} +4 -4
- package/dist/{chunk-OH3HQENA.js → chunk-4IC3FHM5.js} +4 -4
- package/dist/{chunk-CD3XPOHP.js → chunk-5UJ5CG6J.js} +1 -1
- package/dist/{chunk-JTIFRAGE.js → chunk-6JQ5ZM5H.js} +3 -3
- package/dist/{chunk-DI5EEYDP.js → chunk-6ZJKEUGC.js} +2 -2
- package/dist/{chunk-QRA6GFXX.js → chunk-CF6R6DUA.js} +1 -1
- package/dist/{chunk-SFJCLIKB.js → chunk-CFGVH4K5.js} +425 -372
- package/dist/{chunk-SYRMAQVM.js → chunk-CWV3JV2S.js} +5 -5
- package/dist/{chunk-A75GIIWP.js → chunk-DP2SUDRW.js} +1 -1
- package/dist/{chunk-3OZ5WKRH.js → chunk-DRNCCGUW.js} +3362 -3284
- package/dist/{chunk-K7BROEPL.js → chunk-DU26WF7A.js} +3 -3
- package/dist/{chunk-35NITZHC.js → chunk-FVPJ5CRH.js} +1 -1
- package/dist/{chunk-3FQMXAES.js → chunk-GNQZBQ5X.js} +4 -4
- package/dist/{chunk-ML7G6NS3.js → chunk-I3MJISLF.js} +2 -2
- package/dist/{chunk-VUL3BACZ.js → chunk-IOXAYJ4Z.js} +4 -4
- package/dist/{chunk-2MDEKCDU.js → chunk-KTRRC5P4.js} +3 -3
- package/dist/{chunk-PAP62URW.js → chunk-LLKNKNEB.js} +6 -6
- package/dist/{chunk-VD6Q7ZUX.js → chunk-MVTPR7ZY.js} +1 -1
- package/dist/{chunk-WVNVKP4F.js → chunk-N3QGWIWL.js} +1 -1
- package/dist/{chunk-YYBYRAMI.js → chunk-N7NL4SCF.js} +4 -4
- package/dist/{chunk-MB7VQPWX.js → chunk-NCOW55N3.js} +2 -2
- package/dist/{chunk-AVKRYSYT.js → chunk-OU7TJX25.js} +11 -9
- package/dist/{chunk-VP3F4BOG.js → chunk-QQXE2GUM.js} +2 -2
- package/dist/{chunk-OL6HAMWW.js → chunk-RKM6YN3X.js} +2 -2
- package/dist/{chunk-VTOST3CL.js → chunk-SBAQZ6PY.js} +6 -6
- package/dist/{chunk-WAVN2EIK.js → chunk-SF2KLXZM.js} +214 -70
- package/dist/{chunk-QCEXADUT.js → chunk-UQG5TWLM.js} +2 -2
- package/dist/{chunk-BY2RGFQH.js → chunk-UQXWOIPI.js} +8 -8
- package/dist/{chunk-3G5FQLF7.js → chunk-V3GIVVXW.js} +2 -2
- package/dist/{chunk-46YT33GB.js → chunk-V7LDAQAK.js} +4 -4
- package/dist/{chunk-XQUGLXAN.js → chunk-VNCDWND5.js} +2 -2
- package/dist/{chunk-RSZ3L5FJ.js → chunk-VRBKUMA3.js} +1 -1
- package/dist/{chunk-QQFTJVHT.js → chunk-WCRFVAYB.js} +1 -1
- package/dist/{citations-5JSLIPNI.js → citations-UREMIMHU.js} +5 -5
- package/dist/{cli-catalog-U3DKCQC5.js → cli-catalog-JXAESW3A.js} +4 -4
- package/dist/cli-commands-X4XPZQZH.js +18 -0
- package/dist/cli.js +14 -14
- package/dist/{competitor-AMA7WPH4.js → competitor-DIM5OLHQ.js} +4 -4
- package/dist/{content-7HZ23UXM.js → content-A2V3BCU6.js} +4 -4
- package/dist/{dashboard-XFLFU4JL.js → dashboard-ZOBWCHMG.js} +7 -7
- package/dist/{demo-CPO4IUJL.js → demo-6OE36ZR7.js} +3 -3
- package/dist/{demo-server-KBU3NECG.js → demo-server-GIUEYO52.js} +13 -13
- package/dist/{discover-TJXKEHVP.js → discover-Y67SDM3U.js} +5 -5
- package/dist/{discover-eval-MUS46MSL.js → discover-eval-Z6DAQNRE.js} +4 -4
- package/dist/{doctor-5CIMYYUA.js → doctor-XBAVQYHA.js} +4 -4
- package/dist/{evidence-MY4Z6VNC.js → evidence-OYRYCO3J.js} +4 -4
- package/dist/{export-cmd-VBULRDSJ.js → export-cmd-MZRJI63B.js} +4 -4
- package/dist/{ga-ORQCNNJ6.js → ga-VPVM2NI3.js} +4 -4
- package/dist/{gbp-LWVNCHMT.js → gbp-SKZQA4E5.js} +4 -4
- package/dist/{google-U6LQOAQ3.js → google-6LWEJTAC.js} +5 -5
- package/dist/{google-marketing-6RA4AOMN.js → google-marketing-X2FOU4W2.js} +2 -2
- package/dist/{health-cmd-LQGRFFT3.js → health-cmd-XF5PCISV.js} +5 -5
- package/dist/{history-LYJAA6QI.js → history-TP6O4LMA.js} +4 -4
- package/dist/index.d.ts +72 -72
- package/dist/index.js +26 -26
- package/dist/{init-RWJPBYTI.js → init-YMFUF4YJ.js} +13 -13
- package/dist/{insights-OP7ZJLC5.js → insights-ZKTREJVG.js} +4 -4
- package/dist/intelligence-service-LNXDWZ3F.js +15 -0
- package/dist/{journeys-ENN25PA5.js → journeys-T65PNRFS.js} +4 -4
- package/dist/{keys-FVPHQIOM.js → keys-U54Y36FC.js} +4 -4
- package/dist/{keyword-ELCUWNQC.js → keyword-JHQKINGN.js} +4 -4
- package/dist/{logs-SVKY3HXZ.js → logs-6RH3NGMN.js} +4 -4
- package/dist/{mcp-W7AMWAST.js → mcp-JVJUVT3I.js} +5 -5
- package/dist/mcp.js +21 -15
- package/dist/{measurement-plan-F3ZZ4MCG.js → measurement-plan-MOBOCU7X.js} +6 -6
- package/dist/{notify-U253YRTY.js → notify-M3YPFBKX.js} +4 -4
- package/dist/{organic-evidence-4GI6HG56.js → organic-evidence-VDSGYYEB.js} +4 -4
- package/dist/{overview-TPZI3OKL.js → overview-FAJ5KKSI.js} +7 -7
- package/dist/{project-BZPMAZAH.js → project-3X4JNUQ2.js} +4 -4
- package/dist/{project-setup-2NSUAFXD.js → project-setup-CMIASV25.js} +9 -6
- package/dist/{query-4AL5P6DI.js → query-NLTDZVPT.js} +4 -4
- package/dist/{research-3WAJ6RWX.js → research-DATD7M5T.js} +4 -4
- package/dist/{results-export-VHA6BPC2.js → results-export-ONHLJT35.js} +4 -4
- package/dist/{run-3EEHYWIA.js → run-ZZ65W4T2.js} +6 -6
- package/dist/{schedule-7CXVWV75.js → schedule-L6NQQWZP.js} +4 -4
- package/dist/{search-EPPXH2TK.js → search-JBV4A3JB.js} +4 -4
- package/dist/{serve-LGXPVEMJ.js → serve-JTVUXC5V.js} +27 -27
- package/dist/{session-IGKCPAMH.js → session-L5ZT52AV.js} +14 -14
- package/dist/{settings-UKIPQVIX.js → settings-N3HNIFMB.js} +4 -4
- package/dist/{sitemaps-L2OOCCHX.js → sitemaps-HQV366MP.js} +4 -4
- package/dist/{skills-VJSJNLWC.js → skills-6MCHPZAQ.js} +3 -3
- package/dist/{snapshot-SYVUVM7F.js → snapshot-SJKZGC7B.js} +4 -4
- package/dist/{src-VYDX5USM.js → src-BUUBDKML.js} +2 -2
- package/dist/{status-ALZWCQ7W.js → status-T3LFFLRY.js} +6 -6
- package/dist/{support-XRKYBNND.js → support-BIPNOY7V.js} +2 -2
- package/dist/{technical-aeo-JNYI6Q7L.js → technical-aeo-APUKKLVK.js} +88 -31
- package/dist/{telemetry-ZENJ5BDE.js → telemetry-RGSGE6ED.js} +5 -5
- package/dist/{tools-LMDXNPS7.js → tools-LPL4IECG.js} +12 -12
- package/dist/{traffic-JXNISEMN.js → traffic-SU7KRKO3.js} +6 -6
- package/dist/{trends-3755UQT3.js → trends-3NJBRFXS.js} +4 -4
- package/dist/{users-7XCGU7BU.js → users-SU4AONBT.js} +4 -4
- package/dist/{visibility-stats-QJBO7HFN.js → visibility-stats-EQEBABZR.js} +5 -5
- package/dist/{wordpress-VC6UN5UK.js → wordpress-SNOM6ETD.js} +4 -4
- package/package.json +1 -1
- package/assets/assets/ProjectPage-CP1-aTy-.js +0 -15
- package/assets/assets/ToneBadge-DXhSJm1L.js +0 -60
- package/assets/assets/index-MwrSHGLh.js +0 -43
- package/dist/activity-KCUWSNHF.js +0 -13
- package/dist/cli-commands-6OR7VA33.js +0 -18
- package/dist/intelligence-service-74VHHBUU.js +0 -15
|
@@ -19,14 +19,14 @@ import {
|
|
|
19
19
|
normalizeTrafficPathPattern,
|
|
20
20
|
sessionizeJourneyRequests,
|
|
21
21
|
verifyRequestSignature
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-N3QGWIWL.js";
|
|
23
23
|
import {
|
|
24
24
|
currentOutcomeAttribution,
|
|
25
25
|
getRequestContext,
|
|
26
26
|
registerRequestContext,
|
|
27
27
|
requestAuditIdentity,
|
|
28
28
|
sanitizeRequestContext
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-DP2SUDRW.js";
|
|
30
30
|
import {
|
|
31
31
|
RawEventSampleEventTypes,
|
|
32
32
|
SentimentIdempotencyConflict,
|
|
@@ -191,7 +191,7 @@ import {
|
|
|
191
191
|
userSessions,
|
|
192
192
|
users,
|
|
193
193
|
writeNegativeReviewMaxStars
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-FVPJ5CRH.js";
|
|
195
195
|
import {
|
|
196
196
|
ADS_ACTIVATE_SCOPE,
|
|
197
197
|
ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES,
|
|
@@ -404,6 +404,7 @@ import {
|
|
|
404
404
|
ProviderConnectionUsageSources,
|
|
405
405
|
ProviderConnectionsUnavailableReasons,
|
|
406
406
|
ProviderDispatchModes,
|
|
407
|
+
ProviderErrorCodes,
|
|
407
408
|
ProviderKinds,
|
|
408
409
|
ProviderNames,
|
|
409
410
|
ProviderWorkflows,
|
|
@@ -727,6 +728,7 @@ import {
|
|
|
727
728
|
createdApiKeyDtoSchema,
|
|
728
729
|
credentialRedactionValues,
|
|
729
730
|
deduplicateResearchQueries,
|
|
731
|
+
defaultProviderDisplayName,
|
|
730
732
|
deliveryFailed,
|
|
731
733
|
deltaPercent,
|
|
732
734
|
deriveCitedUrlCandidates,
|
|
@@ -786,6 +788,7 @@ import {
|
|
|
786
788
|
formatRunErrorOneLine,
|
|
787
789
|
formatSignedPercent,
|
|
788
790
|
formatValidationIssues,
|
|
791
|
+
formatZonedTimestamp,
|
|
789
792
|
ga4AiReferralDailyDtoSchema,
|
|
790
793
|
ga4AiReferralHistoryEntrySchema,
|
|
791
794
|
ga4PropertiesDtoSchema,
|
|
@@ -1128,6 +1131,7 @@ import {
|
|
|
1128
1131
|
providerDispatchModeSchema,
|
|
1129
1132
|
providerError,
|
|
1130
1133
|
providerErrorOutcomeReason,
|
|
1134
|
+
providerFailureLabel,
|
|
1131
1135
|
providerReloadRequestSchema,
|
|
1132
1136
|
providerReloadResponseDtoSchema,
|
|
1133
1137
|
providerRouteName,
|
|
@@ -1407,7 +1411,7 @@ import {
|
|
|
1407
1411
|
wordpressSchemaDeployResultDtoSchema,
|
|
1408
1412
|
wordpressSchemaStatusResultDtoSchema,
|
|
1409
1413
|
wordpressStatusDtoSchema
|
|
1410
|
-
} from "./chunk-
|
|
1414
|
+
} from "./chunk-DRNCCGUW.js";
|
|
1411
1415
|
|
|
1412
1416
|
// ../api-routes/src/user-session.ts
|
|
1413
1417
|
import crypto2 from "crypto";
|
|
@@ -16534,6 +16538,7 @@ var HEALTH_CHECK_LABELS = {
|
|
|
16534
16538
|
"gsc.sync.recent-failures": "Search Console sync failing",
|
|
16535
16539
|
"bing.sync.recent-failures": "Bing sync failing",
|
|
16536
16540
|
"config.providers": "AI provider keys",
|
|
16541
|
+
"providers.account-failures": "AI provider account failing",
|
|
16537
16542
|
"config.agent-providers": "Agent provider keys",
|
|
16538
16543
|
"traffic.source.connected": "Traffic sync failing",
|
|
16539
16544
|
"traffic.source.recent-data": "Traffic data stopped",
|
|
@@ -16569,7 +16574,9 @@ var HEALTH_FIXED_LINES = {
|
|
|
16569
16574
|
"seo.data.refresh-failed": "SEO refreshes complete again.",
|
|
16570
16575
|
"seo.data.refresh-partial": "SEO refreshes complete again.",
|
|
16571
16576
|
"seo.data.overdue": "SEO data is current again.",
|
|
16572
|
-
"seo.data.schedule-invalid": "The SEO refresh schedule can run again."
|
|
16577
|
+
"seo.data.schedule-invalid": "The SEO refresh schedule can run again.",
|
|
16578
|
+
"providers.account.held": "Every AI provider is back in this project's checks.",
|
|
16579
|
+
"providers.account.failing": "AI provider accounts work again."
|
|
16573
16580
|
};
|
|
16574
16581
|
function firstSentence(text, max3 = 180) {
|
|
16575
16582
|
if (!text) return null;
|
|
@@ -23593,6 +23600,13 @@ function surfaceableSiteAuditFilters(projectId) {
|
|
|
23593
23600
|
notProbeRun()
|
|
23594
23601
|
];
|
|
23595
23602
|
}
|
|
23603
|
+
function storedPartialCrawl(db, projectId, run) {
|
|
23604
|
+
if (run.status !== RunStatuses.partial) return void 0;
|
|
23605
|
+
return db.select({ termination: siteCrawlSnapshots.termination }).from(siteCrawlSnapshots).where(and47(
|
|
23606
|
+
eq57(siteCrawlSnapshots.projectId, projectId),
|
|
23607
|
+
eq57(siteCrawlSnapshots.runId, run.id)
|
|
23608
|
+
)).get();
|
|
23609
|
+
}
|
|
23596
23610
|
function siteAuditRunPhase(status, attempt, layoutState) {
|
|
23597
23611
|
switch (status) {
|
|
23598
23612
|
case RunStatuses.queued:
|
|
@@ -25730,6 +25744,7 @@ async function technicalAeoRoutes(app, opts) {
|
|
|
25730
25744
|
eq57(siteCrawlGraphLayouts.runId, run.id),
|
|
25731
25745
|
eq57(siteCrawlGraphLayouts.attemptId, attempt.id)
|
|
25732
25746
|
)).get() : void 0;
|
|
25747
|
+
const partialSnapshot = storedPartialCrawl(app.db, project.id, run);
|
|
25733
25748
|
const layoutState = persistedLayout?.state === "ready" || persistedLayout?.state === "unavailable" ? persistedLayout.state : run.status === RunStatuses.completed || run.status === RunStatuses.partial ? "unavailable" : "pending";
|
|
25734
25749
|
return {
|
|
25735
25750
|
project: project.name,
|
|
@@ -25755,7 +25770,8 @@ async function technicalAeoRoutes(app, opts) {
|
|
|
25755
25770
|
failureCode: persistedLayout?.failureCode ?? null,
|
|
25756
25771
|
updatedAt: persistedLayout?.updatedAt ?? null
|
|
25757
25772
|
},
|
|
25758
|
-
|
|
25773
|
+
...partialSnapshot,
|
|
25774
|
+
error: run.status === RunStatuses.cancelled ? parseRunError(run.error)?.message ?? attempt?.error ?? run.error ?? null : run.error ?? attempt?.error ?? null
|
|
25759
25775
|
};
|
|
25760
25776
|
});
|
|
25761
25777
|
for (const path8 of agentReadinessRoutes("/runs/:runId/page-health-preview")) app.get(path8, async (request) => app.db.transaction((tx) => {
|
|
@@ -27562,7 +27578,8 @@ function agentReadinessTrack(db, projectId, run) {
|
|
|
27562
27578
|
}
|
|
27563
27579
|
const state = runStatusOf(run);
|
|
27564
27580
|
const active = isActive(state);
|
|
27565
|
-
const
|
|
27581
|
+
const hasDiagnostic = state === RunStatuses.failed || state === RunStatuses.partial;
|
|
27582
|
+
const attempt = active || hasDiagnostic ? db.select().from(siteCrawlAttempts).where(and49(eq59(siteCrawlAttempts.projectId, projectId), eq59(siteCrawlAttempts.runId, run.id))).orderBy(desc22(siteCrawlAttempts.attemptNumber), desc22(siteCrawlAttempts.updatedAt)).limit(1).get() : void 0;
|
|
27566
27583
|
return {
|
|
27567
27584
|
state,
|
|
27568
27585
|
runId: run.id,
|
|
@@ -27578,7 +27595,8 @@ function agentReadinessTrack(db, projectId, run) {
|
|
|
27578
27595
|
} : null,
|
|
27579
27596
|
result: hasResult(state) ? scanResult(db, projectId, run.id) : null,
|
|
27580
27597
|
// A scan stores its reason as plain text (its crawl attempt keeps the same one).
|
|
27581
|
-
error: state === RunStatuses.
|
|
27598
|
+
error: hasDiagnostic || state === RunStatuses.completed ? run.error ?? attempt?.error ?? null : null,
|
|
27599
|
+
...storedPartialCrawl(db, projectId, run)
|
|
27582
27600
|
};
|
|
27583
27601
|
}
|
|
27584
27602
|
function scanPageBudget(db, projectId, runId) {
|
|
@@ -28505,10 +28523,10 @@ async function resolveMeasurementSitemapTarget(rawUrl, options = {}) {
|
|
|
28505
28523
|
if (!hostname) return { ok: false, message: "the URL has no hostname" };
|
|
28506
28524
|
const literalFamily = net2.isIPv6(hostname) ? 6 : net2.isIPv4(hostname) ? 4 : null;
|
|
28507
28525
|
const addresses = literalFamily ? [{ address: hostname, family: literalFamily }] : await (options.resolveAddresses ?? resolveSitemapAddresses)(hostname);
|
|
28508
|
-
if (addresses.length === 0) return { ok: false, message: `${hostname} does not resolve
|
|
28526
|
+
if (addresses.length === 0) return { ok: false, message: `${hostname} does not resolve`, unresolved: true };
|
|
28509
28527
|
for (const entry of addresses) {
|
|
28510
28528
|
const reason = blockedAddressReason(entry.address);
|
|
28511
|
-
if (reason) return { ok: false, message: `${hostname} resolves to ${entry.address}, ${reason}
|
|
28529
|
+
if (reason) return { ok: false, message: `${hostname} resolves to ${entry.address}, ${reason}`, blocked: true };
|
|
28512
28530
|
}
|
|
28513
28531
|
return { ok: true, target: { url: parsed, address: addresses[0].address, family: addresses[0].family } };
|
|
28514
28532
|
}
|
|
@@ -53707,7 +53725,11 @@ async function keysRoutes(app) {
|
|
|
53707
53725
|
if (!row) {
|
|
53708
53726
|
throw notFound("API key", id);
|
|
53709
53727
|
}
|
|
53710
|
-
return {
|
|
53728
|
+
return {
|
|
53729
|
+
...toApiKeyDto({ ...row, scopes: request.apiKey?.scopes ?? row.scopes }, projectNameById(app.db)),
|
|
53730
|
+
operator: request.operatorAccess === true,
|
|
53731
|
+
namedAccount: row.delegatedUserId !== null
|
|
53732
|
+
};
|
|
53711
53733
|
});
|
|
53712
53734
|
app.post("/keys", async (request) => {
|
|
53713
53735
|
requireAdminSession(request);
|
|
@@ -81610,6 +81632,121 @@ var PROVIDERS_CHECKS = [
|
|
|
81610
81632
|
agentProvidersConfiguredCheck
|
|
81611
81633
|
];
|
|
81612
81634
|
|
|
81635
|
+
// ../api-routes/src/doctor/checks/provider-accounts.ts
|
|
81636
|
+
import { and as and107, desc as desc58, eq as eq126, gt as gt11, inArray as inArray58 } from "drizzle-orm";
|
|
81637
|
+
var CHECK_ID = "providers.account-failures";
|
|
81638
|
+
function firstAndCount(providers) {
|
|
81639
|
+
const first = defaultProviderDisplayName(providers[0]);
|
|
81640
|
+
return providers.length > 1 ? `${first} and ${providers.length - 1} more` : first;
|
|
81641
|
+
}
|
|
81642
|
+
function newestCheckAccountFailures(ctx, project) {
|
|
81643
|
+
const newest = ctx.db.select({ id: runs.id, error: runs.error, createdAt: runs.createdAt }).from(runs).where(and107(
|
|
81644
|
+
eq126(runs.projectId, project.id),
|
|
81645
|
+
eq126(runs.kind, RunKinds["answer-visibility"]),
|
|
81646
|
+
inArray58(runs.status, [RunStatuses.completed, RunStatuses.partial, RunStatuses.failed])
|
|
81647
|
+
)).orderBy(desc58(runs.createdAt), desc58(runs.id)).limit(1).get();
|
|
81648
|
+
if (!newest) return null;
|
|
81649
|
+
const families = ctx.providerRouteFamilies ?? void 0;
|
|
81650
|
+
const runnable = ctx.getRunnableProviderNames?.();
|
|
81651
|
+
const byConnection = /* @__PURE__ */ new Map();
|
|
81652
|
+
for (const [name, entry] of Object.entries(parseRunError(newest.error)?.providers ?? {})) {
|
|
81653
|
+
if (entry.skipped || !entry.code || !isProviderAccountFailure(entry.code)) continue;
|
|
81654
|
+
if (runnable && !isProviderAvailable(name, runnable, families)) continue;
|
|
81655
|
+
const connection = providerConnectionName(name, families);
|
|
81656
|
+
if (!byConnection.has(connection)) byConnection.set(connection, { provider: connection, code: entry.code });
|
|
81657
|
+
}
|
|
81658
|
+
if (byConnection.size === 0) return { runId: newest.id, failures: [] };
|
|
81659
|
+
const fixed = new Set(ctx.db.select({ entityId: auditLog.entityId, action: auditLog.action, diff: auditLog.diff }).from(auditLog).where(and107(
|
|
81660
|
+
eq126(auditLog.entityType, "provider"),
|
|
81661
|
+
inArray58(auditLog.entityId, [...byConnection.keys()]),
|
|
81662
|
+
gt11(auditLog.createdAt, newest.createdAt)
|
|
81663
|
+
)).all().filter((change2) => providerSettingsChangeCouldFix(change2.action, change2.diff)).map((change2) => change2.entityId));
|
|
81664
|
+
return { runId: newest.id, failures: [...byConnection.values()].filter((failure) => !fixed.has(failure.provider)) };
|
|
81665
|
+
}
|
|
81666
|
+
var REMEDIATION = "Fix it in the provider's console (a new key, restored access, or more credit). Then save the key with `canonry settings provider <name> --api-key <key>` and confirm it with `canonry settings provider test <name>`. Saving a new key, model or endpoint ends a hold at once; added credit is picked up when Canonry calls the provider again.";
|
|
81667
|
+
function nextStep(failure) {
|
|
81668
|
+
return failure.code === ProviderErrorCodes.PROVIDER_BILLING ? `Add credit in ${defaultProviderDisplayName(failure.provider)}'s console.` : `Save a working key with \`canonry settings provider ${failure.provider} --api-key <key>\`.`;
|
|
81669
|
+
}
|
|
81670
|
+
function gradeProviderAccounts(ctx, project) {
|
|
81671
|
+
const admission = runAdmissionState(ctx.db, {
|
|
81672
|
+
projectId: project.id,
|
|
81673
|
+
now: (/* @__PURE__ */ new Date()).toISOString(),
|
|
81674
|
+
runnableProviders: ctx.getRunnableProviderNames?.(),
|
|
81675
|
+
routeFamilies: ctx.providerRouteFamilies,
|
|
81676
|
+
selection: RunTriggers.scheduled
|
|
81677
|
+
});
|
|
81678
|
+
const newest = newestCheckAccountFailures(ctx, project);
|
|
81679
|
+
const heldConnections = /* @__PURE__ */ new Map();
|
|
81680
|
+
for (const [provider, streak] of Object.entries(admission.providers)) {
|
|
81681
|
+
const connection = providerConnectionName(provider, ctx.providerRouteFamilies ?? void 0);
|
|
81682
|
+
if (!heldConnections.has(connection)) heldConnections.set(connection, streak);
|
|
81683
|
+
}
|
|
81684
|
+
const held = [...heldConnections];
|
|
81685
|
+
if (held.length > 0) {
|
|
81686
|
+
const [firstProvider, first] = held[0];
|
|
81687
|
+
const lines = held.map(([provider, streak]) => `${defaultProviderDisplayName(provider)} (${providerFailureLabel(streak.code)}, left out until ${formatZonedTimestamp(streak.retryAfter) ?? streak.retryAfter})`);
|
|
81688
|
+
const names = firstAndCount(held.map(([provider]) => provider));
|
|
81689
|
+
return {
|
|
81690
|
+
status: CheckStatuses.fail,
|
|
81691
|
+
code: "providers.account.held",
|
|
81692
|
+
summary: admission.refused ? `This project's checks are on hold: every provider they call failed on its account in each of its last ${PROVIDER_ACCOUNT_FAILURE_STREAK} runs. ${lines.join("; ")}.` : `${held.length === 1 ? "1 provider is" : `${held.length} providers are`} left out of this project's checks after failing on its account in each of its last ${PROVIDER_ACCOUNT_FAILURE_STREAK} runs: ${lines.join("; ")}.`,
|
|
81693
|
+
remediation: REMEDIATION,
|
|
81694
|
+
details: { refused: admission.refused, retryAfter: admission.retryAfter, providers: admission.providers },
|
|
81695
|
+
alert: {
|
|
81696
|
+
label: admission.refused ? "AI checks on hold" : `${names} left out of AI checks`,
|
|
81697
|
+
line: admission.refused ? `Every AI provider this project calls failed on its account ${PROVIDER_ACCOUNT_FAILURE_STREAK} runs in a row, so its checks are paused.` : `${names} failed on ${held.length === 1 ? "its account" : "their accounts"} ${PROVIDER_ACCOUNT_FAILURE_STREAK} runs in a row, so this project's checks run without ${held.length === 1 ? "it" : "them"}.`,
|
|
81698
|
+
next: nextStep({ provider: firstProvider, code: first.code })
|
|
81699
|
+
}
|
|
81700
|
+
};
|
|
81701
|
+
}
|
|
81702
|
+
if (!newest) {
|
|
81703
|
+
return {
|
|
81704
|
+
status: CheckStatuses.skipped,
|
|
81705
|
+
code: "providers.account.no-runs",
|
|
81706
|
+
summary: "This project has no finished AI Visibility check yet, so no provider has been called for it.",
|
|
81707
|
+
remediation: null
|
|
81708
|
+
};
|
|
81709
|
+
}
|
|
81710
|
+
if (newest.failures.length > 0) {
|
|
81711
|
+
const lines = newest.failures.map((failure) => `${defaultProviderDisplayName(failure.provider)} (${providerFailureLabel(failure.code)})`);
|
|
81712
|
+
const names = firstAndCount(newest.failures.map((failure) => failure.provider));
|
|
81713
|
+
const first = newest.failures[0];
|
|
81714
|
+
const one = newest.failures.length === 1;
|
|
81715
|
+
return {
|
|
81716
|
+
status: CheckStatuses.warn,
|
|
81717
|
+
code: "providers.account.failing",
|
|
81718
|
+
summary: `${lines.join(", ")} failed on ${one ? "its account" : "their accounts"} in this project's newest check. After ${PROVIDER_ACCOUNT_FAILURE_STREAK} such runs in a row, checks leave a provider out until it is fixed.`,
|
|
81719
|
+
remediation: REMEDIATION,
|
|
81720
|
+
details: { runId: newest.runId, providers: Object.fromEntries(newest.failures.map((failure) => [failure.provider, failure.code])) },
|
|
81721
|
+
alert: {
|
|
81722
|
+
label: first.code === ProviderErrorCodes.PROVIDER_BILLING ? "AI provider out of credit" : "AI provider key rejected",
|
|
81723
|
+
line: `${names} failed on ${one ? "its account" : "their accounts"} in the newest check, so ${one ? "its" : "their"} answers are missing.`,
|
|
81724
|
+
next: nextStep(first)
|
|
81725
|
+
}
|
|
81726
|
+
};
|
|
81727
|
+
}
|
|
81728
|
+
return {
|
|
81729
|
+
status: CheckStatuses.ok,
|
|
81730
|
+
code: "providers.account.ok",
|
|
81731
|
+
summary: "No provider failed on its account in this project's newest check, and none is left out of its checks.",
|
|
81732
|
+
remediation: null,
|
|
81733
|
+
details: { runId: newest.runId }
|
|
81734
|
+
};
|
|
81735
|
+
}
|
|
81736
|
+
var providerAccountFailuresCheck = {
|
|
81737
|
+
id: CHECK_ID,
|
|
81738
|
+
category: CheckCategories.providers,
|
|
81739
|
+
scope: CheckScopes.project,
|
|
81740
|
+
title: "Provider accounts",
|
|
81741
|
+
run: (ctx) => {
|
|
81742
|
+
if (!ctx.project) {
|
|
81743
|
+
return { status: CheckStatuses.skipped, code: "providers.account.no-project", summary: "Project context required.", remediation: null };
|
|
81744
|
+
}
|
|
81745
|
+
return gradeProviderAccounts(ctx, ctx.project);
|
|
81746
|
+
}
|
|
81747
|
+
};
|
|
81748
|
+
var PROVIDER_ACCOUNT_CHECKS = [providerAccountFailuresCheck];
|
|
81749
|
+
|
|
81613
81750
|
// ../api-routes/src/doctor/checks/runtime-state.ts
|
|
81614
81751
|
import fs7 from "fs";
|
|
81615
81752
|
var dbFilePresentCheck = {
|
|
@@ -81839,6 +81976,7 @@ var ALL_CHECKS = [
|
|
|
81839
81976
|
...GOOGLE_MARKETING_DOCTOR_CHECKS,
|
|
81840
81977
|
...INTEGRATION_SYNC_CHECKS,
|
|
81841
81978
|
...PROVIDERS_CHECKS,
|
|
81979
|
+
...PROVIDER_ACCOUNT_CHECKS,
|
|
81842
81980
|
...TRAFFIC_SOURCE_CHECKS,
|
|
81843
81981
|
...BACKLINKS_CHECKS,
|
|
81844
81982
|
...CONTENT_CHECKS,
|
|
@@ -81977,6 +82115,8 @@ async function doctorRoutes(app, opts) {
|
|
|
81977
82115
|
getPlacesConfig: opts.getPlacesConfig,
|
|
81978
82116
|
redirectUri,
|
|
81979
82117
|
providerSummary: opts.providerSummary,
|
|
82118
|
+
getRunnableProviderNames: opts.getRunnableProviderNames,
|
|
82119
|
+
providerRouteFamilies: opts.providerRouteFamilies,
|
|
81980
82120
|
getAgentProviderSummary: opts.getAgentProviderSummary,
|
|
81981
82121
|
getAgentPin: opts.getAgentPin,
|
|
81982
82122
|
callerIsInstanceAdministrator: isInstanceAdministrator(request),
|
|
@@ -82012,6 +82152,8 @@ async function doctorRoutes(app, opts) {
|
|
|
82012
82152
|
getPlacesConfig: opts.getPlacesConfig,
|
|
82013
82153
|
redirectUri,
|
|
82014
82154
|
providerSummary: opts.providerSummary,
|
|
82155
|
+
getRunnableProviderNames: opts.getRunnableProviderNames,
|
|
82156
|
+
providerRouteFamilies: opts.providerRouteFamilies,
|
|
82015
82157
|
getAgentProviderSummary: opts.getAgentProviderSummary,
|
|
82016
82158
|
getAgentPin: opts.getAgentPin,
|
|
82017
82159
|
callerIsInstanceAdministrator: isInstanceAdministrator(request),
|
|
@@ -82029,7 +82171,7 @@ async function doctorRoutes(app, opts) {
|
|
|
82029
82171
|
|
|
82030
82172
|
// ../api-routes/src/discovery/routes.ts
|
|
82031
82173
|
import crypto64 from "crypto";
|
|
82032
|
-
import { and as
|
|
82174
|
+
import { and as and108, desc as desc59, eq as eq127, gte as gte34, inArray as inArray59, isNull as isNull21, or as or22 } from "drizzle-orm";
|
|
82033
82175
|
var MAX_INFLIGHT_DISCOVERY_AGE_MS = 2 * 60 * 60 * 1e3;
|
|
82034
82176
|
async function discoveryRoutes(app, opts) {
|
|
82035
82177
|
app.post("/projects/:name/discover/run", async (request, reply) => {
|
|
@@ -82063,13 +82205,13 @@ async function discoveryRoutes(app, opts) {
|
|
|
82063
82205
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
82064
82206
|
const ageFloorIso = new Date(Date.now() - MAX_INFLIGHT_DISCOVERY_AGE_MS).toISOString();
|
|
82065
82207
|
const decision = app.db.transaction((tx) => {
|
|
82066
|
-
const existing = tx.select({ id: discoverySessions.id, runId: discoverySessions.runId }).from(discoverySessions).where(
|
|
82067
|
-
|
|
82068
|
-
|
|
82208
|
+
const existing = tx.select({ id: discoverySessions.id, runId: discoverySessions.runId }).from(discoverySessions).where(and108(
|
|
82209
|
+
eq127(discoverySessions.projectId, project.id),
|
|
82210
|
+
eq127(discoverySessions.icpDescription, icpDescription),
|
|
82069
82211
|
// Buyer is part of session identity: it changes the seed prompt's
|
|
82070
82212
|
// semantics, so a request with a different (or no) buyer must start
|
|
82071
82213
|
// its own session, never adopt another buyer's probes.
|
|
82072
|
-
parsed.data.buyerDescription == null ? isNull21(discoverySessions.buyerDescription) :
|
|
82214
|
+
parsed.data.buyerDescription == null ? isNull21(discoverySessions.buyerDescription) : eq127(discoverySessions.buyerDescription, parsed.data.buyerDescription),
|
|
82073
82215
|
// Locations are identity too: a different service-area subset seeds
|
|
82074
82216
|
// and probes a different geo, so it must never reuse another geo's
|
|
82075
82217
|
// session. resolveLocations is deterministic (project-config order),
|
|
@@ -82079,18 +82221,18 @@ async function discoveryRoutes(app, opts) {
|
|
|
82079
82221
|
// locations a NULL row's subset is unknowable, so it conservatively
|
|
82080
82222
|
// never reuses — a one-time, bounded (2h window) non-reuse after
|
|
82081
82223
|
// upgrade, never a wrong reuse.
|
|
82082
|
-
locations.length === 0 ? or22(isNull21(discoverySessions.locations),
|
|
82224
|
+
locations.length === 0 ? or22(isNull21(discoverySessions.locations), eq127(discoverySessions.locations, locations)) : eq127(discoverySessions.locations, locations),
|
|
82083
82225
|
// Seed provider set is identity: a different phrasing distribution
|
|
82084
82226
|
// must never reuse another set's session. Null (= Gemini-only
|
|
82085
82227
|
// default, including explicit ['gemini']) matches legacy rows.
|
|
82086
|
-
seedProviders == null ? isNull21(discoverySessions.seedProviders) :
|
|
82087
|
-
|
|
82228
|
+
seedProviders == null ? isNull21(discoverySessions.seedProviders) : eq127(discoverySessions.seedProviders, seedProviders),
|
|
82229
|
+
inArray59(discoverySessions.status, [
|
|
82088
82230
|
DiscoverySessionStatuses.queued,
|
|
82089
82231
|
DiscoverySessionStatuses.seeding,
|
|
82090
82232
|
DiscoverySessionStatuses.probing
|
|
82091
82233
|
]),
|
|
82092
82234
|
gte34(discoverySessions.createdAt, ageFloorIso)
|
|
82093
|
-
)).orderBy(
|
|
82235
|
+
)).orderBy(desc59(discoverySessions.createdAt)).get();
|
|
82094
82236
|
if (existing && existing.runId) {
|
|
82095
82237
|
return { reused: true, sessionId: existing.id, runId: existing.runId };
|
|
82096
82238
|
}
|
|
@@ -82159,7 +82301,7 @@ async function discoveryRoutes(app, opts) {
|
|
|
82159
82301
|
const project = resolveProject(app.db, request.params.name);
|
|
82160
82302
|
const parsedLimit = parseInt(request.query.limit ?? "", 10);
|
|
82161
82303
|
const limit = Number.isNaN(parsedLimit) || parsedLimit <= 0 ? 50 : parsedLimit;
|
|
82162
|
-
const rows = app.db.select().from(discoverySessions).where(
|
|
82304
|
+
const rows = app.db.select().from(discoverySessions).where(eq127(discoverySessions.projectId, project.id)).orderBy(desc59(discoverySessions.createdAt)).limit(limit).all();
|
|
82163
82305
|
return reply.send(rows.map(serializeSession));
|
|
82164
82306
|
}
|
|
82165
82307
|
);
|
|
@@ -82167,11 +82309,11 @@ async function discoveryRoutes(app, opts) {
|
|
|
82167
82309
|
"/projects/:name/discover/sessions/:id",
|
|
82168
82310
|
async (request, reply) => {
|
|
82169
82311
|
const project = resolveProject(app.db, request.params.name);
|
|
82170
|
-
const session = app.db.select().from(discoverySessions).where(
|
|
82312
|
+
const session = app.db.select().from(discoverySessions).where(eq127(discoverySessions.id, request.params.id)).get();
|
|
82171
82313
|
if (!session || session.projectId !== project.id) {
|
|
82172
82314
|
throw notFound("Discovery session", request.params.id);
|
|
82173
82315
|
}
|
|
82174
|
-
const probeRows = app.db.select().from(discoveryProbes).where(
|
|
82316
|
+
const probeRows = app.db.select().from(discoveryProbes).where(eq127(discoveryProbes.sessionId, session.id)).all();
|
|
82175
82317
|
const detail = {
|
|
82176
82318
|
...serializeSession(session),
|
|
82177
82319
|
probes: probeRows.map(serializeProbe)
|
|
@@ -82185,7 +82327,7 @@ async function discoveryRoutes(app, opts) {
|
|
|
82185
82327
|
requireAdminSession(request);
|
|
82186
82328
|
requirePaidReadScope(request, [], "Discovery harvest requires wildcard (*) API key scope because it can call the embedding provider.");
|
|
82187
82329
|
const project = resolveProject(app.db, request.params.name);
|
|
82188
|
-
const session = app.db.select().from(discoverySessions).where(
|
|
82330
|
+
const session = app.db.select().from(discoverySessions).where(eq127(discoverySessions.id, request.params.id)).get();
|
|
82189
82331
|
if (!session || session.projectId !== project.id) {
|
|
82190
82332
|
throw notFound("Discovery session", request.params.id);
|
|
82191
82333
|
}
|
|
@@ -82193,7 +82335,7 @@ async function discoveryRoutes(app, opts) {
|
|
|
82193
82335
|
const minProbeHits = Number.isNaN(parsedFloor) || parsedFloor < 1 ? 1 : parsedFloor;
|
|
82194
82336
|
const applyAnchor = request.query.anchor !== "false";
|
|
82195
82337
|
const provider = session.seedProvider ?? "gemini";
|
|
82196
|
-
const probeRows = app.db.select().from(discoveryProbes).where(
|
|
82338
|
+
const probeRows = app.db.select().from(discoveryProbes).where(eq127(discoveryProbes.sessionId, session.id)).all();
|
|
82197
82339
|
const extract = opts.harvestSearchQueries;
|
|
82198
82340
|
const probesWithQueries = probeRows.map((row) => {
|
|
82199
82341
|
if (!extract || !row.rawResponse) return { searchQueries: [] };
|
|
@@ -82204,7 +82346,7 @@ async function discoveryRoutes(app, opts) {
|
|
|
82204
82346
|
return { searchQueries: [] };
|
|
82205
82347
|
}
|
|
82206
82348
|
});
|
|
82207
|
-
const trackedQueries = app.db.select({ query: queries.query }).from(queries).where(
|
|
82349
|
+
const trackedQueries = app.db.select({ query: queries.query }).from(queries).where(eq127(queries.projectId, project.id)).all().map((r) => r.query);
|
|
82208
82350
|
const anchorTerms = buildHarvestAnchorTerms(
|
|
82209
82351
|
[session.icpDescription ?? "", ...trackedQueries],
|
|
82210
82352
|
effectiveDomains(project)
|
|
@@ -82251,11 +82393,11 @@ async function discoveryRoutes(app, opts) {
|
|
|
82251
82393
|
"/projects/:name/discover/sessions/:id/promote",
|
|
82252
82394
|
async (request, reply) => {
|
|
82253
82395
|
const project = resolveProject(app.db, request.params.name);
|
|
82254
|
-
const session = app.db.select().from(discoverySessions).where(
|
|
82396
|
+
const session = app.db.select().from(discoverySessions).where(eq127(discoverySessions.id, request.params.id)).get();
|
|
82255
82397
|
if (!session || session.projectId !== project.id) {
|
|
82256
82398
|
throw notFound("Discovery session", request.params.id);
|
|
82257
82399
|
}
|
|
82258
|
-
const probeRows = app.db.select().from(discoveryProbes).where(
|
|
82400
|
+
const probeRows = app.db.select().from(discoveryProbes).where(eq127(discoveryProbes.sessionId, session.id)).all();
|
|
82259
82401
|
const cited = /* @__PURE__ */ new Set();
|
|
82260
82402
|
const aspirational = /* @__PURE__ */ new Set();
|
|
82261
82403
|
const wasted = /* @__PURE__ */ new Set();
|
|
@@ -82290,7 +82432,7 @@ async function discoveryRoutes(app, opts) {
|
|
|
82290
82432
|
);
|
|
82291
82433
|
app.post("/projects/:name/discover/sessions/:id/promote", async (request, reply) => {
|
|
82292
82434
|
const project = resolveProject(app.db, request.params.name);
|
|
82293
|
-
const session = app.db.select().from(discoverySessions).where(
|
|
82435
|
+
const session = app.db.select().from(discoverySessions).where(eq127(discoverySessions.id, request.params.id)).get();
|
|
82294
82436
|
if (!session || session.projectId !== project.id) {
|
|
82295
82437
|
throw notFound("Discovery session", request.params.id);
|
|
82296
82438
|
}
|
|
@@ -82313,7 +82455,7 @@ async function discoveryRoutes(app, opts) {
|
|
|
82313
82455
|
const bucketSet = new Set(buckets);
|
|
82314
82456
|
const includeCompetitors = parsed.data.includeCompetitors ?? true;
|
|
82315
82457
|
const competitorTypes = parsed.data.competitorTypes ?? DEFAULT_DISCOVERY_PROMOTE_COMPETITOR_TYPES;
|
|
82316
|
-
const probeRows = app.db.select().from(discoveryProbes).where(
|
|
82458
|
+
const probeRows = app.db.select().from(discoveryProbes).where(eq127(discoveryProbes.sessionId, session.id)).all();
|
|
82317
82459
|
const candidateQueries = /* @__PURE__ */ new Set();
|
|
82318
82460
|
for (const probe of probeRows) {
|
|
82319
82461
|
if (!probe.bucket) continue;
|
|
@@ -82321,7 +82463,7 @@ async function discoveryRoutes(app, opts) {
|
|
|
82321
82463
|
if (bucket.success && bucketSet.has(bucket.data)) candidateQueries.add(probe.query);
|
|
82322
82464
|
}
|
|
82323
82465
|
const existingQueries = new Set(
|
|
82324
|
-
app.db.select({ query: queries.query }).from(queries).where(
|
|
82466
|
+
app.db.select({ query: queries.query }).from(queries).where(eq127(queries.projectId, project.id)).all().map((r) => r.query.toLowerCase())
|
|
82325
82467
|
);
|
|
82326
82468
|
const promotedQueries = [];
|
|
82327
82469
|
const skippedQueries = [];
|
|
@@ -82535,7 +82677,7 @@ function planCompetitorPromotion(input) {
|
|
|
82535
82677
|
|
|
82536
82678
|
// ../api-routes/src/discovery/orchestrate.ts
|
|
82537
82679
|
import crypto65 from "crypto";
|
|
82538
|
-
import { eq as
|
|
82680
|
+
import { eq as eq128 } from "drizzle-orm";
|
|
82539
82681
|
var DEFAULT_MAX_PROBES = 100;
|
|
82540
82682
|
var ABSOLUTE_MAX_PROBES = 500;
|
|
82541
82683
|
function classifyProbeBucket(input) {
|
|
@@ -82621,7 +82763,7 @@ async function executeDiscovery(opts) {
|
|
|
82621
82763
|
status: DiscoverySessionStatuses.seeding,
|
|
82622
82764
|
dedupThreshold,
|
|
82623
82765
|
startedAt
|
|
82624
|
-
}).where(
|
|
82766
|
+
}).where(eq128(discoverySessions.id, opts.sessionId)).run();
|
|
82625
82767
|
const seedResult = await opts.deps.seed({
|
|
82626
82768
|
project: opts.project,
|
|
82627
82769
|
icpDescription: opts.icpDescription,
|
|
@@ -82682,7 +82824,7 @@ async function executeDiscovery(opts) {
|
|
|
82682
82824
|
dedupBandPairFraction: dedupStats.bandPairFraction,
|
|
82683
82825
|
dedupPairsTotal: dedupStats.pairsTotal,
|
|
82684
82826
|
warning
|
|
82685
|
-
}).where(
|
|
82827
|
+
}).where(eq128(discoverySessions.id, opts.sessionId)).run();
|
|
82686
82828
|
const probeLocation = opts.locations?.[0];
|
|
82687
82829
|
const probeResults = await mapWithConcurrency(
|
|
82688
82830
|
probedCanonicals,
|
|
@@ -82736,7 +82878,7 @@ async function executeDiscovery(opts) {
|
|
|
82736
82878
|
wastedCount: buckets["wasted-surface"],
|
|
82737
82879
|
competitorMap,
|
|
82738
82880
|
finishedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
82739
|
-
}).where(
|
|
82881
|
+
}).where(eq128(discoverySessions.id, opts.sessionId)).run();
|
|
82740
82882
|
upsertDomainClassifications(opts.db, opts.project.id, opts.sessionId, competitorMap);
|
|
82741
82883
|
return {
|
|
82742
82884
|
buckets,
|
|
@@ -82776,7 +82918,7 @@ function markSessionFailed(db, sessionId, error) {
|
|
|
82776
82918
|
status: DiscoverySessionStatuses.failed,
|
|
82777
82919
|
error,
|
|
82778
82920
|
finishedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
82779
|
-
}).where(
|
|
82921
|
+
}).where(eq128(discoverySessions.id, sessionId)).run();
|
|
82780
82922
|
}
|
|
82781
82923
|
function dedupeStrings(input) {
|
|
82782
82924
|
const seen2 = /* @__PURE__ */ new Set();
|
|
@@ -82793,7 +82935,7 @@ function dedupeStrings(input) {
|
|
|
82793
82935
|
}
|
|
82794
82936
|
|
|
82795
82937
|
// ../api-routes/src/trends.ts
|
|
82796
|
-
import { and as
|
|
82938
|
+
import { and as and109, asc as asc30, eq as eq129 } from "drizzle-orm";
|
|
82797
82939
|
function parseSurface(value) {
|
|
82798
82940
|
const parsed = trendSurfaceSchema.safeParse(value);
|
|
82799
82941
|
if (!parsed.success) {
|
|
@@ -82849,8 +82991,8 @@ async function trendsRoutes(app) {
|
|
|
82849
82991
|
function readSurface(app, projectId, surface) {
|
|
82850
82992
|
switch (surface) {
|
|
82851
82993
|
case TrendSurfaces["index-coverage"]: {
|
|
82852
|
-
const google = app.db.select({ date: gscCoverageSnapshots.date, indexed: gscCoverageSnapshots.indexed, notIndexed: gscCoverageSnapshots.notIndexed }).from(gscCoverageSnapshots).where(
|
|
82853
|
-
const bing = app.db.select({ date: bingCoverageSnapshots.date, indexed: bingCoverageSnapshots.indexed, notIndexed: bingCoverageSnapshots.notIndexed }).from(bingCoverageSnapshots).where(
|
|
82994
|
+
const google = app.db.select({ date: gscCoverageSnapshots.date, indexed: gscCoverageSnapshots.indexed, notIndexed: gscCoverageSnapshots.notIndexed }).from(gscCoverageSnapshots).where(eq129(gscCoverageSnapshots.projectId, projectId)).orderBy(asc30(gscCoverageSnapshots.date)).all();
|
|
82995
|
+
const bing = app.db.select({ date: bingCoverageSnapshots.date, indexed: bingCoverageSnapshots.indexed, notIndexed: bingCoverageSnapshots.notIndexed }).from(bingCoverageSnapshots).where(eq129(bingCoverageSnapshots.projectId, projectId)).orderBy(asc30(bingCoverageSnapshots.date)).all();
|
|
82854
82996
|
const coverage = (key, label, rows) => ({
|
|
82855
82997
|
key,
|
|
82856
82998
|
label,
|
|
@@ -82862,7 +83004,7 @@ function readSurface(app, projectId, surface) {
|
|
|
82862
83004
|
return [coverage("google", "Google", google), coverage("bing", "Bing", bing)];
|
|
82863
83005
|
}
|
|
82864
83006
|
case TrendSurfaces["site-health"]: {
|
|
82865
|
-
const rows = app.db.select({ auditedAt: siteAuditSnapshots.auditedAt, aggregateScore: siteAuditSnapshots.aggregateScore, pagesAudited: siteAuditSnapshots.pagesAudited }).from(siteAuditSnapshots).innerJoin(runs,
|
|
83007
|
+
const rows = app.db.select({ auditedAt: siteAuditSnapshots.auditedAt, aggregateScore: siteAuditSnapshots.aggregateScore, pagesAudited: siteAuditSnapshots.pagesAudited }).from(siteAuditSnapshots).innerJoin(runs, eq129(siteAuditSnapshots.runId, runs.id)).where(and109(...surfaceableSiteAuditFilters(projectId))).orderBy(asc30(siteAuditSnapshots.auditedAt)).all();
|
|
82866
83008
|
return [{
|
|
82867
83009
|
key: "site-health",
|
|
82868
83010
|
label: "Agent Readiness",
|
|
@@ -82874,7 +83016,7 @@ function readSurface(app, projectId, surface) {
|
|
|
82874
83016
|
}
|
|
82875
83017
|
case TrendSurfaces.backlinks: {
|
|
82876
83018
|
const totals = computeFilteredReleaseTotals(app.db, projectId, BacklinkSources.commoncrawl);
|
|
82877
|
-
const rows = app.db.select({ release: backlinkSummaries.release, totalLinkingDomains: backlinkSummaries.totalLinkingDomains, queriedAt: backlinkSummaries.queriedAt }).from(backlinkSummaries).where(
|
|
83019
|
+
const rows = app.db.select({ release: backlinkSummaries.release, totalLinkingDomains: backlinkSummaries.totalLinkingDomains, queriedAt: backlinkSummaries.queriedAt }).from(backlinkSummaries).where(and109(eq129(backlinkSummaries.projectId, projectId), eq129(backlinkSummaries.source, BacklinkSources.commoncrawl))).all().sort((a, b) => compareReleaseIds(a.release, b.release)).map((row) => {
|
|
82878
83020
|
const filtered = totals.get(row.release);
|
|
82879
83021
|
const known = (filtered?.domainRows ?? 0) > 0 || row.totalLinkingDomains === 0;
|
|
82880
83022
|
const windowEnd = releaseWindowEndMonth(row.release);
|
|
@@ -82904,7 +83046,7 @@ function readSurface(app, projectId, surface) {
|
|
|
82904
83046
|
// ../api-routes/src/research.ts
|
|
82905
83047
|
import crypto66 from "crypto";
|
|
82906
83048
|
import { z as z7 } from "zod";
|
|
82907
|
-
import { and as
|
|
83049
|
+
import { and as and110, count as count11, desc as desc60, eq as eq130, gte as gte35, lt as lt21, or as or23, sql as sql53 } from "drizzle-orm";
|
|
82908
83050
|
var sameLocation = (a, b) => a.label === b.label && a.city === b.city && a.region === b.region && a.country === b.country && a.timezone === b.timezone;
|
|
82909
83051
|
var BATCH_RECEIPT_PREFIX = "__canonry_research_batch__:";
|
|
82910
83052
|
async function researchRoutes(app, opts) {
|
|
@@ -82923,7 +83065,7 @@ async function researchRoutes(app, opts) {
|
|
|
82923
83065
|
const input = parsed.data;
|
|
82924
83066
|
if (input.idempotencyKey?.startsWith(BATCH_RECEIPT_PREFIX)) throw validationError("This idempotency key prefix is reserved for internal research batch receipts.");
|
|
82925
83067
|
const requestHash2 = directResearchRequestHash(input);
|
|
82926
|
-
const existingReceipt = input.idempotencyKey ? app.db.select().from(researchRuns).where(
|
|
83068
|
+
const existingReceipt = input.idempotencyKey ? app.db.select().from(researchRuns).where(and110(eq130(researchRuns.projectId, project.id), eq130(researchRuns.idempotencyKey, input.idempotencyKey))).get() : void 0;
|
|
82927
83069
|
if (existingReceipt) {
|
|
82928
83070
|
assertSameDirectResearchRequest(existingReceipt, input, requestHash2);
|
|
82929
83071
|
const result2 = getDetail(app, project.id, existingReceipt.id);
|
|
@@ -82958,7 +83100,7 @@ async function researchRoutes(app, opts) {
|
|
|
82958
83100
|
const initiatedBy = researchPrincipal(request);
|
|
82959
83101
|
const decision = app.db.transaction((tx) => {
|
|
82960
83102
|
if (input.idempotencyKey) {
|
|
82961
|
-
const existing = tx.select().from(researchRuns).where(
|
|
83103
|
+
const existing = tx.select().from(researchRuns).where(and110(eq130(researchRuns.projectId, project.id), eq130(researchRuns.idempotencyKey, input.idempotencyKey))).get();
|
|
82962
83104
|
if (existing) {
|
|
82963
83105
|
assertSameDirectResearchRequest(existing, input, requestHash2);
|
|
82964
83106
|
return { reused: true, id: existing.id, shouldDispatch: existing.status === ResearchRunStatuses.queued };
|
|
@@ -82966,8 +83108,8 @@ async function researchRoutes(app, opts) {
|
|
|
82966
83108
|
}
|
|
82967
83109
|
if (initiatedBy?.limited) {
|
|
82968
83110
|
const { start, end, date } = utcDayBounds(now);
|
|
82969
|
-
const used = tx.select({ value: count11() }).from(researchRuns).where(
|
|
82970
|
-
|
|
83111
|
+
const used = tx.select({ value: count11() }).from(researchRuns).where(and110(
|
|
83112
|
+
eq130(researchRuns.projectId, project.id),
|
|
82971
83113
|
gte35(researchRuns.createdAt, start),
|
|
82972
83114
|
lt21(researchRuns.createdAt, end),
|
|
82973
83115
|
sql53`(json_extract(${researchRuns.initiatedBy}, '$.role') = ${UserRoles.viewer} OR json_extract(${researchRuns.initiatedBy}, '$.limited') = 1)`
|
|
@@ -82998,15 +83140,15 @@ async function researchRoutes(app, opts) {
|
|
|
82998
83140
|
if (input.idempotencyKey.startsWith(BATCH_RECEIPT_PREFIX)) throw validationError("This idempotency key prefix is reserved for internal research batch receipts.");
|
|
82999
83141
|
const requestHash2 = researchBatchRequestHash(input);
|
|
83000
83142
|
const receiptKeys = input.runs.map((_run, index) => batchChildReceiptKey(input.idempotencyKey, index));
|
|
83001
|
-
const firstReceipt = app.db.select().from(researchRuns).where(
|
|
83002
|
-
|
|
83003
|
-
|
|
83143
|
+
const firstReceipt = app.db.select().from(researchRuns).where(and110(
|
|
83144
|
+
eq130(researchRuns.projectId, project.id),
|
|
83145
|
+
eq130(researchRuns.idempotencyKey, receiptKeys[0])
|
|
83004
83146
|
)).get();
|
|
83005
83147
|
if (firstReceipt) {
|
|
83006
83148
|
if (firstReceipt.requestHash !== requestHash2) throw alreadyExists("Research batch idempotency key", input.idempotencyKey);
|
|
83007
|
-
const saved = receiptKeys.map((key) => app.db.select().from(researchRuns).where(
|
|
83008
|
-
|
|
83009
|
-
|
|
83149
|
+
const saved = receiptKeys.map((key) => app.db.select().from(researchRuns).where(and110(
|
|
83150
|
+
eq130(researchRuns.projectId, project.id),
|
|
83151
|
+
eq130(researchRuns.idempotencyKey, key)
|
|
83010
83152
|
)).get());
|
|
83011
83153
|
if (saved.some((row) => !row || row.requestHash !== requestHash2)) throw alreadyExists("Research batch idempotency key", input.idempotencyKey);
|
|
83012
83154
|
const runs3 = saved.map((row) => getDetail(app, project.id, row.id));
|
|
@@ -83022,8 +83164,8 @@ async function researchRoutes(app, opts) {
|
|
|
83022
83164
|
const decision = app.db.transaction((tx) => {
|
|
83023
83165
|
if (initiatedBy?.limited) {
|
|
83024
83166
|
const { start, end, date } = utcDayBounds(now);
|
|
83025
|
-
const used = tx.select({ value: count11() }).from(researchRuns).where(
|
|
83026
|
-
|
|
83167
|
+
const used = tx.select({ value: count11() }).from(researchRuns).where(and110(
|
|
83168
|
+
eq130(researchRuns.projectId, project.id),
|
|
83027
83169
|
gte35(researchRuns.createdAt, start),
|
|
83028
83170
|
lt21(researchRuns.createdAt, end),
|
|
83029
83171
|
sql53`(json_extract(${researchRuns.initiatedBy}, '$.role') = ${UserRoles.viewer} OR json_extract(${researchRuns.initiatedBy}, '$.limited') = 1)`
|
|
@@ -83077,10 +83219,10 @@ async function researchRoutes(app, opts) {
|
|
|
83077
83219
|
const requested = Number.parseInt(request.query.limit ?? "", 10);
|
|
83078
83220
|
const limit = Number.isInteger(requested) && requested > 0 ? Math.min(requested, 100) : 20;
|
|
83079
83221
|
const cursor = request.query.cursor ? parseResearchCursor(request.query.cursor, project.id) : null;
|
|
83080
|
-
const rows = app.db.select().from(researchRuns).where(
|
|
83081
|
-
|
|
83082
|
-
cursor ? or23(lt21(researchRuns.createdAt, cursor.createdAt),
|
|
83083
|
-
)).orderBy(
|
|
83222
|
+
const rows = app.db.select().from(researchRuns).where(and110(
|
|
83223
|
+
eq130(researchRuns.projectId, project.id),
|
|
83224
|
+
cursor ? or23(lt21(researchRuns.createdAt, cursor.createdAt), and110(eq130(researchRuns.createdAt, cursor.createdAt), lt21(researchRuns.id, cursor.id))) : void 0
|
|
83225
|
+
)).orderBy(desc60(researchRuns.createdAt), desc60(researchRuns.id)).limit(limit + 1).all();
|
|
83084
83226
|
const runs2 = rows.slice(0, limit).map(serializeRun);
|
|
83085
83227
|
const last = runs2.at(-1);
|
|
83086
83228
|
const nextCursor = rows.length > limit && last ? Buffer.from(JSON.stringify({ projectId: project.id, createdAt: last.createdAt, id: last.id })).toString("base64url") : null;
|
|
@@ -83229,9 +83371,9 @@ function resolveStoredResearchTemplate(stored, selection, idempotencyKey) {
|
|
|
83229
83371
|
return stored;
|
|
83230
83372
|
}
|
|
83231
83373
|
function resolveResearchTemplate(app, projectId, selection, scope, location) {
|
|
83232
|
-
const savedTemplate = app.db.select().from(measurementQueryTemplates).where(
|
|
83233
|
-
|
|
83234
|
-
|
|
83374
|
+
const savedTemplate = app.db.select().from(measurementQueryTemplates).where(and110(
|
|
83375
|
+
eq130(measurementQueryTemplates.projectId, projectId),
|
|
83376
|
+
eq130(measurementQueryTemplates.id, selection.templateId)
|
|
83235
83377
|
)).get();
|
|
83236
83378
|
if (!savedTemplate) throw validationError("Unknown or stale research template. Reload the selected template and try again.");
|
|
83237
83379
|
const templateVersion = savedTemplate.updatedAt;
|
|
@@ -83240,7 +83382,7 @@ function resolveResearchTemplate(app, projectId, selection, scope, location) {
|
|
|
83240
83382
|
}
|
|
83241
83383
|
const bindingLocation = selection.bindingLocation === void 0 ? location : selection.bindingLocation;
|
|
83242
83384
|
if (bindingLocation) {
|
|
83243
|
-
const project = app.db.select({ locations: projects.locations }).from(projects).where(
|
|
83385
|
+
const project = app.db.select({ locations: projects.locations }).from(projects).where(eq130(projects.id, projectId)).get();
|
|
83244
83386
|
if (!project.locations.some((item2) => sameLocation(item2, bindingLocation))) throw validationError("Research template binding location must match a configured project location.");
|
|
83245
83387
|
}
|
|
83246
83388
|
const { bindings, output } = expandResearchTemplate(savedTemplate, scope, bindingLocation);
|
|
@@ -83253,9 +83395,9 @@ function classifyResearchQueries(project, plan, queries2) {
|
|
|
83253
83395
|
return queries2.map((query2) => classifier?.classify(query2) ?? null);
|
|
83254
83396
|
}
|
|
83255
83397
|
function getDetail(app, projectId, id) {
|
|
83256
|
-
const row = app.db.select().from(researchRuns).where(
|
|
83398
|
+
const row = app.db.select().from(researchRuns).where(and110(eq130(researchRuns.id, id), eq130(researchRuns.projectId, projectId))).get();
|
|
83257
83399
|
if (!row) throw notFound("Research run", id);
|
|
83258
|
-
const queries2 = app.db.select().from(researchRunQueries).where(
|
|
83400
|
+
const queries2 = app.db.select().from(researchRunQueries).where(eq130(researchRunQueries.researchRunId, id)).orderBy(researchRunQueries.position).all().map((query2) => serializeQuery(query2, row.provider));
|
|
83259
83401
|
return { ...serializeRun(row), queries: queries2 };
|
|
83260
83402
|
}
|
|
83261
83403
|
function serializeRun(row) {
|
|
@@ -83316,7 +83458,7 @@ function utcDayBounds(now) {
|
|
|
83316
83458
|
|
|
83317
83459
|
// ../api-routes/src/simple-measurement-definitions.ts
|
|
83318
83460
|
import crypto67 from "crypto";
|
|
83319
|
-
import { and as
|
|
83461
|
+
import { and as and111, eq as eq131 } from "drizzle-orm";
|
|
83320
83462
|
function captureSimpleMeasurementDefinition(db, input) {
|
|
83321
83463
|
return db.transaction((tx) => {
|
|
83322
83464
|
const run = tx.select({
|
|
@@ -83324,7 +83466,7 @@ function captureSimpleMeasurementDefinition(db, input) {
|
|
|
83324
83466
|
trigger: runs.trigger,
|
|
83325
83467
|
status: runs.status,
|
|
83326
83468
|
measurementPlanVersionId: runs.measurementPlanVersionId
|
|
83327
|
-
}).from(runs).where(
|
|
83469
|
+
}).from(runs).where(and111(eq131(runs.projectId, input.projectId), eq131(runs.id, input.runId))).get();
|
|
83328
83470
|
if (!run) throw notFound("Run", input.runId);
|
|
83329
83471
|
if (run.kind !== RunKinds["answer-visibility"] || run.trigger === RunTriggers.probe || run.measurementPlanVersionId !== null) {
|
|
83330
83472
|
return null;
|
|
@@ -83345,7 +83487,7 @@ function captureSimpleMeasurementDefinition(db, input) {
|
|
|
83345
83487
|
throw validationError("Qualified aliases must be a sorted subset of the captured aliases.");
|
|
83346
83488
|
}
|
|
83347
83489
|
}
|
|
83348
|
-
const existing = tx.select().from(simpleMeasurementDefinitions).where(
|
|
83490
|
+
const existing = tx.select().from(simpleMeasurementDefinitions).where(and111(eq131(simpleMeasurementDefinitions.projectId, input.projectId), eq131(simpleMeasurementDefinitions.runId, input.runId))).get();
|
|
83349
83491
|
if (existing) {
|
|
83350
83492
|
const frozen = simpleMeasurementDefinitionSchema.parse(existing.definition);
|
|
83351
83493
|
const { qualifiedAliases: _liveQualifiedAliases, ...liveIdentity } = definition2.identity;
|
|
@@ -83371,15 +83513,15 @@ function captureSimpleMeasurementDefinition(db, input) {
|
|
|
83371
83513
|
if (run.status !== RunStatuses.running) {
|
|
83372
83514
|
throw validationError("Only a running run can capture a new measurement definition.");
|
|
83373
83515
|
}
|
|
83374
|
-
if (tx.select({ id: querySnapshots.id }).from(querySnapshots).where(
|
|
83516
|
+
if (tx.select({ id: querySnapshots.id }).from(querySnapshots).where(eq131(querySnapshots.runId, input.runId)).limit(1).get()) {
|
|
83375
83517
|
throw validationError("This run already has stored answers. Its measurement definition cannot be inferred afterward.");
|
|
83376
83518
|
}
|
|
83377
|
-
const projectQueryIds = new Set(tx.select({ id: queries.id }).from(queries).where(
|
|
83519
|
+
const projectQueryIds = new Set(tx.select({ id: queries.id }).from(queries).where(eq131(queries.projectId, input.projectId)).all().map((query2) => query2.id));
|
|
83378
83520
|
if (definition2.queries.some((query2) => !projectQueryIds.has(query2.queryId))) {
|
|
83379
83521
|
throw validationError("Every captured query must belong to the run project.");
|
|
83380
83522
|
}
|
|
83381
83523
|
if (definition2.competitors !== void 0) {
|
|
83382
|
-
const liveCompetitorDomains = new Set(tx.select({ domain: competitors.domain }).from(competitors).where(
|
|
83524
|
+
const liveCompetitorDomains = new Set(tx.select({ domain: competitors.domain }).from(competitors).where(eq131(competitors.projectId, input.projectId)).orderBy(competitors.domain).all().map((competitor) => competitor.domain));
|
|
83383
83525
|
const capturedDomains = new Set(definition2.competitors.map((competitor) => competitor.domain));
|
|
83384
83526
|
if (liveCompetitorDomains.size !== capturedDomains.size || [...liveCompetitorDomains].some((domain) => !capturedDomains.has(domain))) {
|
|
83385
83527
|
throw validationError("Captured competitors must exactly match the project competitors dispatched for this run.");
|
|
@@ -83803,6 +83945,8 @@ async function apiRoutes(app, opts) {
|
|
|
83803
83945
|
getPlacesConfig: opts.getPlacesConfig,
|
|
83804
83946
|
publicUrl: opts.publicUrl,
|
|
83805
83947
|
providerSummary: opts.providerSummary,
|
|
83948
|
+
getRunnableProviderNames: opts.getRunnableProviderNames,
|
|
83949
|
+
providerRouteFamilies: providerRouteFamilies2,
|
|
83806
83950
|
getAgentProviderSummary: opts.getAgentProviderSummary,
|
|
83807
83951
|
getAgentPin: opts.getAgentPin,
|
|
83808
83952
|
trafficSourceValidators: buildTrafficSourceValidators(opts),
|