@canonry/canonry 7.102.0 → 7.104.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/assets/agent-workspace/skills/aero/references/ai-traffic-tracking.md +32 -4
- package/assets/agent-workspace/skills/canonry/references/ai-traffic-tracking.md +32 -4
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +20 -2
- package/assets/agent-workspace/skills/canonry/references/server-side-traffic.md +51 -15
- package/assets/assets/{AccessControls-CpSlWN3W.js → AccessControls-CBkDcxwx.js} +1 -1
- package/assets/assets/{AgentSetupPage-0le_Bx7d.js → AgentSetupPage-iGYETW-I.js} +1 -1
- package/assets/assets/{AuditHistoryPanel-BQH1dQ4V.js → AuditHistoryPanel-DiFMK7eE.js} +1 -1
- package/assets/assets/{BacklinksPage-_ffwmtrl.js → BacklinksPage-Cg9LQLMo.js} +1 -1
- package/assets/assets/{ChartPrimitives-6Yq_3ION.js → ChartPrimitives-DYS88Zzt.js} +1 -1
- package/assets/assets/{HistoryPage-DUR17GrK.js → HistoryPage-CmI5CX94.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-dutXSW7s.js → MeasurementPropertyPage-DshJzp9b.js} +1 -1
- package/assets/assets/{ProjectPage-DA-07-jJ.js → ProjectPage-DwVxUhxM.js} +9 -9
- package/assets/assets/{RunsPage-Bs4f0-sW.js → RunsPage-BqvrT8Xm.js} +1 -1
- package/assets/assets/{ServerTrafficSection-qMBbUI-0.js → ServerTrafficSection-CtFe7WDd.js} +1 -1
- package/assets/assets/{SettingsPage-Bccypqbr.js → SettingsPage-snu8wJ8l.js} +1 -1
- package/assets/assets/{ToneBadge-DvK4cIwq.js → ToneBadge-CkTo2T8d.js} +4 -4
- package/assets/assets/{TrafficPage-BPojOqd_.js → TrafficPage-BxiiQjwl.js} +1 -1
- package/assets/assets/TrafficSourceDetailPage-8BKFz7py.js +1 -0
- package/assets/assets/{account-context-evpXzY8L.js → account-context-BlfC71NP.js} +1 -1
- package/assets/assets/{agent-trust-copy-CkaSg2FT.js → agent-trust-copy-C_J3OmRg.js} +1 -1
- package/assets/assets/{card-01OafAPU.js → card-CeXmlLH2.js} +1 -1
- package/assets/assets/{index-StZErOkd.js → index-BKbmkmyo.js} +3 -3
- package/assets/assets/{query-client-D6xwAuZW.js → query-client-DWYnC2Lg.js} +1 -1
- package/assets/assets/{react-query-CdE7FNH6.js → react-query-CQhkmL4O.js} +1 -1
- package/assets/assets/{react-sigma_core.esm.min-DlfcmDYc.js → react-sigma_core.esm.min-YHPB9pkU.js} +1 -1
- package/assets/assets/{server-traffic-yEflW4RI.js → server-traffic-ChxoKQ0y.js} +1 -1
- package/assets/assets/{service-DfuRVpyN.js → service-u1pn5oyA.js} +1 -1
- package/assets/index.html +8 -8
- package/dist/{ads-UDJVYKHF.js → ads-ARJJACSH.js} +3 -3
- package/dist/{agent-EOB54XNS.js → agent-57EQMSOO.js} +7 -7
- package/dist/{agent-ask-5V4LX4VW.js → agent-ask-TF2WTRTO.js} +3 -3
- package/dist/{agent-conversations-OAF6RCFP.js → agent-conversations-5GXNREFK.js} +3 -3
- package/dist/{agent-journeys-GETB4UGM.js → agent-journeys-6CDPI4TE.js} +3 -3
- package/dist/{agent-memory-JXHPH6H5.js → agent-memory-X3FQ4YDE.js} +3 -3
- package/dist/{agent-providers-AAUCUOKY.js → agent-providers-32Z3YXO4.js} +3 -3
- package/dist/{agent-transcript-WT4QH3ZY.js → agent-transcript-2S64XPF2.js} +3 -3
- package/dist/{analytics-JEZWLRTZ.js → analytics-WPCHRXQZ.js} +3 -3
- package/dist/{apply-LDIMMO4N.js → apply-3WHRQBQB.js} +3 -3
- package/dist/{backfill-JOJHBVGV.js → backfill-KR2NSPSE.js} +10 -10
- package/dist/{backlinks-D2O3UM6F.js → backlinks-TRVNCPUB.js} +3 -3
- package/dist/{bing-BG7KZZPK.js → bing-F3B76XX5.js} +3 -3
- package/dist/{bootstrap-IXVATZLB.js → bootstrap-QOAGLWNN.js} +10 -10
- package/dist/{cdp-3AJG7OLP.js → cdp-4I3DNMLG.js} +7 -7
- package/dist/{chunk-C2YVADFC.js → chunk-2AECECUY.js} +1 -1
- package/dist/{chunk-DP3FE2OW.js → chunk-2QWG6HWM.js} +5 -5
- package/dist/{chunk-S7ZOYNW3.js → chunk-2VNQKUCW.js} +2 -2
- package/dist/{chunk-N7773GJW.js → chunk-3V5Y2XTA.js} +1 -1
- package/dist/{chunk-M25KDHD4.js → chunk-52D6WBCZ.js} +1 -1
- package/dist/{chunk-LGTSVS6Q.js → chunk-5FMZGO6R.js} +4 -4
- package/dist/{chunk-QK4IICRM.js → chunk-6AW6ONTF.js} +2 -2
- package/dist/{chunk-G4ODBZO7.js → chunk-7UQZCDYK.js} +1 -1
- package/dist/{chunk-7JJCFGL2.js → chunk-7VKVGR6X.js} +3 -3
- package/dist/{chunk-7I2NJ4BH.js → chunk-BYYP43Q3.js} +128 -1
- package/dist/{chunk-N4VEG6GB.js → chunk-C6RWAAF6.js} +4 -4
- package/dist/{chunk-AENOUFTF.js → chunk-CCHYRLX4.js} +2 -2
- package/dist/{chunk-O5AIKUW3.js → chunk-CJ55MGWI.js} +1 -1
- package/dist/{chunk-WNR3YQAD.js → chunk-D76TB5JS.js} +1 -1
- package/dist/{chunk-GLKR6C2L.js → chunk-DLZCOJCY.js} +1 -1
- package/dist/{chunk-66EXWVMN.js → chunk-FCUUJO3Z.js} +2 -2
- package/dist/{chunk-UX6XWC4F.js → chunk-FUERP5PU.js} +567 -185
- package/dist/{chunk-RXWD25P7.js → chunk-HLM3GYK4.js} +1 -1
- package/dist/{chunk-4CF5536B.js → chunk-HPFT4IKN.js} +1 -1
- package/dist/{chunk-AG6BTE7R.js → chunk-HTGJSXCR.js} +5 -5
- package/dist/{chunk-CZOGOHIN.js → chunk-K32GU473.js} +632 -462
- package/dist/{chunk-BDLHLE2F.js → chunk-LCZZACLE.js} +3 -3
- package/dist/{chunk-NAJ3ZYZ2.js → chunk-MDRAKMCV.js} +3 -3
- package/dist/{chunk-DRNBMKR5.js → chunk-MT2LENZA.js} +6 -6
- package/dist/{chunk-VH424YVI.js → chunk-PL76V2DY.js} +1587 -1516
- package/dist/{chunk-FHK6M4RK.js → chunk-QRR5ZW22.js} +3 -3
- package/dist/{chunk-ZIKPEZ3K.js → chunk-R4VAGCFW.js} +21 -21
- package/dist/{chunk-BG6TVNA6.js → chunk-RBAK7RQX.js} +366 -366
- package/dist/{chunk-YTR2S4MU.js → chunk-SFLSZXLO.js} +4 -4
- package/dist/{chunk-2YLTELT2.js → chunk-SZ64N26K.js} +1 -1
- package/dist/{chunk-ONHBQYSA.js → chunk-T3G44DHS.js} +46 -31
- package/dist/{chunk-EXPBZFN4.js → chunk-TCXITSDO.js} +1 -1
- package/dist/{chunk-NJZVDUKD.js → chunk-TFP6UJXW.js} +3 -3
- package/dist/{chunk-3TPHFDZN.js → chunk-WQQ4TNIY.js} +2 -2
- package/dist/{chunk-NHBXQWE3.js → chunk-WT22Z3I7.js} +63 -4
- package/dist/{chunk-IBRABPHA.js → chunk-ZJFLVXDZ.js} +2 -2
- package/dist/{citations-GM42U2ZH.js → citations-6CW3G5YP.js} +4 -4
- package/dist/{cli-catalog-EMZPMAJP.js → cli-catalog-6B2O2JQE.js} +3 -3
- package/dist/{cli-commands-VDMZAETM.js → cli-commands-RJX2UC5L.js} +7 -7
- package/dist/cli.js +13 -13
- package/dist/{competitor-4ZLKGNQW.js → competitor-D4BVO2KQ.js} +3 -3
- package/dist/{content-YJRMT4JW.js → content-H2PGFRWM.js} +3 -3
- package/dist/{dashboard-L4EE3C5T.js → dashboard-4GWISEMI.js} +6 -6
- package/dist/{demo-3XDVCUT5.js → demo-63JTCWN5.js} +1 -1
- package/dist/{demo-server-7ZJWSGE2.js → demo-server-QA5OSH45.js} +12 -12
- package/dist/{discover-SQGUDXSU.js → discover-K4GIXAN5.js} +4 -4
- package/dist/{discover-eval-BUNKP6EW.js → discover-eval-L4IF5XFV.js} +3 -3
- package/dist/{doctor-HPIGLMRX.js → doctor-OVJTEQCK.js} +3 -3
- package/dist/{evidence-JKEM5BYW.js → evidence-MXQK4YYL.js} +3 -3
- package/dist/{export-cmd-KTQM455W.js → export-cmd-Z3CWJALI.js} +3 -3
- package/dist/{ga-D7ZLTSSA.js → ga-347UNNJP.js} +3 -3
- package/dist/{gbp-OWBX2BFK.js → gbp-47MIYIQC.js} +3 -3
- package/dist/{google-UNAGUCXQ.js → google-7Q3FYNVP.js} +4 -4
- package/dist/{google-marketing-AZC7WHZR.js → google-marketing-TMKWY5AP.js} +1 -1
- package/dist/{health-cmd-XHEDL6CF.js → health-cmd-77TMLQ6T.js} +4 -4
- package/dist/{history-MKQDN6LY.js → history-Q756HPJM.js} +3 -3
- package/dist/index.d.ts +30 -11
- package/dist/index.js +25 -25
- package/dist/{init-W4LWSMCC.js → init-CLSFH5OL.js} +12 -12
- package/dist/{insights-HNJR7UEC.js → insights-TPNHIVNH.js} +3 -3
- package/dist/intelligence-service-TTDFQ2TB.js +16 -0
- package/dist/{journeys-RQBYPWHU.js → journeys-F6UAVPVI.js} +3 -3
- package/dist/{keys-KNZAMXJU.js → keys-Q6VMDIAH.js} +3 -3
- package/dist/{keyword-7SUZG7RB.js → keyword-7BH5P5P7.js} +3 -3
- package/dist/{logs-RTQFOKLJ.js → logs-P2J6XFVJ.js} +3 -3
- package/dist/{mcp-JWBPAYR4.js → mcp-RPXFNAKS.js} +4 -4
- package/dist/mcp.js +9 -9
- package/dist/{measurement-plan-AETWMIGC.js → measurement-plan-KKUB6SLB.js} +5 -5
- package/dist/{notify-DGFNKFVG.js → notify-2IK6NR7Y.js} +3 -3
- package/dist/{organic-evidence-VA47O6HU.js → organic-evidence-N4HIUIHJ.js} +3 -3
- package/dist/{overview-SMXNZLPG.js → overview-FSNB42W5.js} +5 -5
- package/dist/{project-WXEDQJLS.js → project-D5ODS46C.js} +3 -3
- package/dist/{project-setup-VFBTUA5W.js → project-setup-X7NGKC4R.js} +3 -3
- package/dist/{query-C2VIB2XW.js → query-JGCEDLI2.js} +3 -3
- package/dist/{research-76TYES7M.js → research-3S5FLAFX.js} +3 -3
- package/dist/{results-export-F4FKVOQN.js → results-export-YMX4F2K6.js} +3 -3
- package/dist/{run-H6GGXFKQ.js → run-MCJAGAHJ.js} +5 -5
- package/dist/{schedule-KTQNJGMO.js → schedule-CLWDPYZG.js} +3 -3
- package/dist/{search-YRFUC7SW.js → search-X7SXPESS.js} +3 -3
- package/dist/{serve-PWIVPUX7.js → serve-WDUJ36KJ.js} +26 -26
- package/dist/{session-LRR2N6IP.js → session-M66S3VTK.js} +13 -13
- package/dist/{settings-TLDN77K4.js → settings-UZEODHZ3.js} +3 -3
- package/dist/{sitemaps-BQ6JI4EW.js → sitemaps-SK2ZE5EJ.js} +3 -3
- package/dist/{skills-SQBKFXAN.js → skills-SI6C7MPT.js} +2 -2
- package/dist/{snapshot-ICGETMOY.js → snapshot-AOQUU5Q2.js} +3 -3
- package/dist/{src-XW5T4IQS.js → src-BXXLPHVZ.js} +2 -2
- package/dist/{status-VN65JTUD.js → status-TMKQNQ74.js} +5 -5
- package/dist/{technical-aeo-OBCWTN3M.js → technical-aeo-WBLZMCUY.js} +3 -3
- package/dist/{telemetry-ZU6REKKU.js → telemetry-DS22S3C3.js} +4 -4
- package/dist/{tools-RQDMCSZB.js → tools-W63YOE6T.js} +11 -11
- package/dist/{traffic-YLZSRX5P.js → traffic-6AIRXYMI.js} +24 -7
- package/dist/{trends-OWWELIE2.js → trends-LEAXHSM6.js} +3 -3
- package/dist/{users-2ICURHTW.js → users-VCNIWES5.js} +3 -3
- package/dist/{visibility-stats-FJK3MDYE.js → visibility-stats-4XA2YZET.js} +4 -4
- package/dist/{wordpress-UQFA5TFU.js → wordpress-YG3ECQXW.js} +3 -3
- package/package.json +1 -1
- package/assets/assets/TrafficSourceDetailPage-DSoQk94d.js +0 -1
- package/dist/intelligence-service-SWQABQ3X.js +0 -16
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCloudflareTrafficConnectionBySourceId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3V5Y2XTA.js";
|
|
4
4
|
import {
|
|
5
5
|
createApiClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2VNQKUCW.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfigRaw
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HPFT4IKN.js";
|
|
10
10
|
import {
|
|
11
11
|
emitJsonl
|
|
12
12
|
} from "./chunk-Z7IUAJOF.js";
|
|
@@ -23,8 +23,10 @@ import {
|
|
|
23
23
|
DEFAULT_BOT_LIST,
|
|
24
24
|
generateWorkerScript,
|
|
25
25
|
generateWranglerToml
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-K32GU473.js";
|
|
27
27
|
import {
|
|
28
|
+
AgentTrustLevels,
|
|
29
|
+
BrowserAgentRequestKinds,
|
|
28
30
|
RunStatuses,
|
|
29
31
|
TRAFFIC_EVENT_KIND_FILTER_HINT,
|
|
30
32
|
TrafficEventKinds,
|
|
@@ -38,7 +40,7 @@ import {
|
|
|
38
40
|
trafficSamplesQuerySchema,
|
|
39
41
|
trafficSeriesGranularitySchema,
|
|
40
42
|
trafficUnrecognizedAgentsQuerySchema
|
|
41
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WT22Z3I7.js";
|
|
42
44
|
import "./chunk-MLKGABMK.js";
|
|
43
45
|
|
|
44
46
|
// src/commands/traffic.ts
|
|
@@ -973,6 +975,9 @@ async function trafficSync(project, opts) {
|
|
|
973
975
|
console.log(` Crawler hits: ${result.crawlerHits} (${result.crawlerBucketRows} hourly bucket${result.crawlerBucketRows === 1 ? "" : "s"})`);
|
|
974
976
|
console.log(` AI user fetches: ${result.aiUserFetchHits} (${result.aiUserFetchBucketRows} hourly bucket${result.aiUserFetchBucketRows === 1 ? "" : "s"})`);
|
|
975
977
|
console.log(` Likely fake agents: ${result.aiUserFetchLikelyFakeHits} (claimed an AI agent; not counted as AI user fetches)`);
|
|
978
|
+
if (result.aiUserFetchBrowserNonPageHits) {
|
|
979
|
+
console.log(` Browser agent non-page: ${result.aiUserFetchBrowserNonPageHits} (files, data calls and form posts; only page loads count as AI user fetches)`);
|
|
980
|
+
}
|
|
976
981
|
console.log(` AI referral hits: ${result.aiReferralHits} (${result.aiReferralBucketRows} hourly bucket${result.aiReferralBucketRows === 1 ? "" : "s"})`);
|
|
977
982
|
console.log(` Unknown hits: ${result.unknownHits}`);
|
|
978
983
|
console.log(` Sample rows: ${result.sampleRows}`);
|
|
@@ -1113,6 +1118,9 @@ Usage: canonry traffic analytics <project> [--period 7|14|30|90] [--format json]
|
|
|
1113
1118
|
if (activity.aiReferralCountingChangedAt) {
|
|
1114
1119
|
console.log(` AI-referral arrivals counted once per visit since ${activity.aiReferralCountingChangedAt}; earlier hours also counted later requests in a visit and read high.`);
|
|
1115
1120
|
}
|
|
1121
|
+
if (activity.aiUserFetchCountingChangedAt) {
|
|
1122
|
+
console.log(` AI user fetches count only the page loads of browser agents (Google-Agent, Claude-Agent) from ${activity.aiUserFetchCountingChangedAt}; earlier hours were counted differently and can read high or low.`);
|
|
1123
|
+
}
|
|
1116
1124
|
for (const [label, counts] of [
|
|
1117
1125
|
["Verified crawler hits", activity.verifiedCrawlerHits],
|
|
1118
1126
|
["Unverified crawler hits", activity.unverifiedCrawlerHits],
|
|
@@ -1245,13 +1253,22 @@ async function trafficSamples(project, opts) {
|
|
|
1245
1253
|
console.log(`Stored traffic samples for "${project}": ${result.samples.length} of ${result.totalRows} matching sample rows. Sampled tail, not visits; use traffic events for totals.`);
|
|
1246
1254
|
console.log("Retention: 30 days. Caps: 100 per sync, 500 per backfill, 100 per source per push hour.");
|
|
1247
1255
|
console.log("traffic status shows the last-24h sample count per source, including unknown samples. This selection excludes unknown unless requested.");
|
|
1256
|
+
if (result.samples.some((sample) => uncountedBrowserAgentRequestKind(sample.classifier.aiUserFetch) !== null)) {
|
|
1257
|
+
console.log('Browser agents count only page loads. "not counted" marks a resource (a file, data call, prefetch or beacon its page fetched) or an action (a form post).');
|
|
1258
|
+
}
|
|
1248
1259
|
for (const sample of result.samples) {
|
|
1249
1260
|
const classifier = sample.classifier.aiReferral ?? sample.classifier.aiUserFetch ?? sample.classifier.crawler;
|
|
1250
|
-
const
|
|
1251
|
-
const
|
|
1261
|
+
const userFetch = sample.classifier.aiUserFetch;
|
|
1262
|
+
const uncounted = uncountedBrowserAgentRequestKind(userFetch);
|
|
1263
|
+
const qualifiers = [...userFetch?.trust ? [userFetch.trust] : [], ...uncounted ? [`${uncounted}, not counted`] : []];
|
|
1264
|
+
const label = classifier?.product ? qualifiers.length > 0 ? `${classifier.product} (${qualifiers.join("; ")})` : classifier.product : "-";
|
|
1252
1265
|
console.log([sample.ts, sample.kind, sample.status ?? "-", sample.pathNormalized, sample.refererHost ?? "-", label, sample.userAgent ?? "-"].join(" "));
|
|
1253
1266
|
}
|
|
1254
1267
|
}
|
|
1268
|
+
function uncountedBrowserAgentRequestKind(userFetch) {
|
|
1269
|
+
if (!userFetch?.requestKind || userFetch.requestKind === BrowserAgentRequestKinds.page || userFetch.trust === AgentTrustLevels.likely_fake) return null;
|
|
1270
|
+
return userFetch.requestKind;
|
|
1271
|
+
}
|
|
1255
1272
|
async function trafficUnrecognized(project, opts) {
|
|
1256
1273
|
const { format, ...input } = opts;
|
|
1257
1274
|
const parsed = trafficUnrecognizedAgentsQuerySchema.safeParse(input);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createApiClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2VNQKUCW.js";
|
|
4
|
+
import "./chunk-HPFT4IKN.js";
|
|
5
5
|
import "./chunk-AOJU5LKX.js";
|
|
6
6
|
import {
|
|
7
7
|
isMachineFormat
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
TrendUnits,
|
|
12
12
|
formatPercent,
|
|
13
13
|
formatSignedPointDelta
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WT22Z3I7.js";
|
|
15
15
|
import "./chunk-MLKGABMK.js";
|
|
16
16
|
|
|
17
17
|
// src/commands/trends.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createApiClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2VNQKUCW.js";
|
|
4
|
+
import "./chunk-HPFT4IKN.js";
|
|
5
5
|
import {
|
|
6
6
|
emitJsonl
|
|
7
7
|
} from "./chunk-Z7IUAJOF.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
USER_PASSWORD_MIN_LENGTH,
|
|
15
15
|
UserRoles,
|
|
16
16
|
formatIsoDate
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WT22Z3I7.js";
|
|
18
18
|
import "./chunk-MLKGABMK.js";
|
|
19
19
|
|
|
20
20
|
// src/cli-prompt.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
citedBase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2AECECUY.js";
|
|
4
4
|
import {
|
|
5
5
|
createApiClient
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-2VNQKUCW.js";
|
|
7
|
+
import "./chunk-HPFT4IKN.js";
|
|
8
8
|
import {
|
|
9
9
|
emitJsonl
|
|
10
10
|
} from "./chunk-Z7IUAJOF.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
isVisibilityCompareClassMetric,
|
|
18
18
|
shareOfVoiceLabel,
|
|
19
19
|
shareOfVoiceReason
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WT22Z3I7.js";
|
|
21
21
|
import "./chunk-MLKGABMK.js";
|
|
22
22
|
|
|
23
23
|
// src/commands/visibility-stats.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createApiClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2VNQKUCW.js";
|
|
4
|
+
import "./chunk-HPFT4IKN.js";
|
|
5
5
|
import "./chunk-AOJU5LKX.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError,
|
|
8
8
|
isMachineFormat
|
|
9
9
|
} from "./chunk-HGMYEDAQ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-WT22Z3I7.js";
|
|
11
11
|
import "./chunk-MLKGABMK.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/wordpress.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonry/canonry",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.104.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
|
|
6
6
|
"keywords": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,Q as n,b as r,ft as i,n as a,ut as o}from"./vendor-lucide-iE5MEh2-.js";import{r as s}from"./vendor-markdown-BBGbNklj.js";import{p as ee,t as te,u as ne}from"./vendor-tanstack-B90HW50P.js";import{a as c,c as re,d as l,f as ie,i as ae,m as oe,n as se,r as ce}from"./vendor-recharts-D3MLFU3q.js";import{At as le,Ko as u,Wo as d,r as ue,t as de}from"./ToneBadge-DvK4cIwq.js";import{A as fe,a as f,n as pe,r as me,s as he,t as ge}from"./ChartPrimitives-6Yq_3ION.js";import{t as p}from"./InfoTooltip-D29JcNMW.js";import{t as m}from"./card-01OafAPU.js";import{At as _e}from"./index-StZErOkd.js";import{a as ve,l as ye,o as be,t as xe}from"./server-traffic-yEflW4RI.js";import{r as Se}from"./agent-trust-copy-CkaSg2FT.js";var h=e(i(),1),Ce=[{value:`all`,label:`All status`},{value:`2xx`,label:`2xx success`},{value:`3xx`,label:`3xx redirect`},{value:`4xx`,label:`4xx client error`},{value:`5xx`,label:`5xx server error`}],we=[{value:`all`,label:`All claims`},{value:u.verified,label:`Verified`},{value:u.claimed_unverified,label:`Claimed unverified`},{value:u.unknown_ai_like,label:`Unknown AI-like`}];function g(e){return e===`all`?null:Number.parseInt(e[0],10)}function Te(e){switch(e.kind){case d.crawler:case d[`ai-user-fetch`]:return e.botId;case d[`ai-referral`]:return e.product}}function _(e){switch(e.kind){case d.crawler:case d[`ai-user-fetch`]:return e.pathNormalized;case d[`ai-referral`]:return e.landingPathNormalized}}function v(e){switch(e.kind){case d.crawler:case d[`ai-user-fetch`]:return e.verificationStatus;case d[`ai-referral`]:return null}}function y(e,t){return t===`hour`?e:e.slice(0,10)}function Ee(e,t){return t===`hour`?{since:e,until:e}:{since:`${e}T00:00:00.000Z`,until:`${e}T23:59:59.999Z`}}function De(e,t,n){let r=t.pathQuery.trim().toLowerCase(),i=g(t.statusClass);return e.filter(e=>!(t.selectedBucket&&y(e.tsHour,n)!==t.selectedBucket||t.identity&&Te(e)!==t.identity||t.operator&&e.operator!==t.operator||r&&!_(e).toLowerCase().includes(r)||i!==null&&Math.floor(e.status/100)!==i||t.verification!==`all`&&v(e)!==t.verification))}function Oe(e,t){if(!e||typeof e!=`object`)return null;let n=e.activeTooltipIndex,r;if(typeof n==`number`)r=n;else if(typeof n==`string`&&n!==``)r=Number(n);else return null;return!Number.isInteger(r)||r<0||r>=t.length?null:t[r]?.bucket??null}var b=s(),x=[{value:60,label:`1h`,granularity:`hour`,fetchLimit:500},{value:360,label:`6h`,granularity:`hour`,fetchLimit:500},{value:1440,label:`24h`,granularity:`hour`,fetchLimit:500},{value:10080,label:`7d`,granularity:`hour`,fetchLimit:1e3},{value:43200,label:`30d`,granularity:`day`,fetchLimit:2e3},{value:129600,label:`90d`,granularity:`day`,fetchLimit:5e3}],ke=x.find(e=>e.label===`24h`)??x[2],S=50,Ae=5e3,je=f[0],Me=f[2],Ne=f[1],Pe=fe();function C(e){let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()} ${String(t.getHours()).padStart(2,`0`)}:00`}function w(e){let t=new Date(`${e}T00:00:00`);return`${t.getMonth()+1}/${t.getDate()}`}function T(e){if(!e)return`never`;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var E=[`crawler`,`ai-user-fetch`,`ai-referral`];function Fe(e){let t=E.filter(t=>e.has(t));return t.length===0||t.length===E.length?`all`:t.join(`,`)}function Ie({canGoBack:e,className:t}){let n=`inline-flex items-center gap-1`;return e?(0,b.jsxs)(`button`,{type:`button`,onClick:()=>{window.history.back()},className:`${n} ${t??``}`,children:[(0,b.jsx)(o,{className:`size-3`}),` Back`]}):(0,b.jsxs)(ne,{to:`/traffic`,className:`${n} ${t??``}`,children:[(0,b.jsx)(o,{className:`size-3`}),` All sources`]})}function D(){let e=ee({strict:!1}),i=e.projectName??``,a=te(),o=e.sourceId??``,[s,ne]=(0,h.useState)(ke.value),[u,fe]=(0,h.useState)(()=>new Set([`crawler`,`ai-user-fetch`,`ai-referral`])),[f,g]=(0,h.useState)(null),[_,v]=(0,h.useState)(``),[y,C]=(0,h.useState)(``),[w,E]=(0,h.useState)(``),[D,j]=(0,h.useState)(`all`),[M,N]=(0,h.useState)(`all`),[Ve,P]=(0,h.useState)(1),[He,Ue]=(0,h.useState)(null),[We,Ge]=(0,h.useState)(null),F=(0,h.useMemo)(()=>x.find(e=>e.value===s)??ke,[s]),Ke=(0,h.useMemo)(()=>Fe(u),[u]),I=(0,h.useMemo)(()=>f?Ee(f,F.granularity):null,[f,F.granularity]),L=be(i||null,o||null),R=ve(i||null,{kind:`all`,sourceId:o||void 0,sinceMinutes:s,limit:F.fetchLimit,granularity:F.granularity}),qe=Ke!==`all`||I!==null,Je=ve(i||null,{kind:Ke,sourceId:o||void 0,sinceMinutes:s,range:I??void 0,limit:I?Ae:F.fetchLimit,granularity:F.granularity},{enabled:qe}),z=qe?Je:R,B=ye(i||null,o||null),V=L.data,H=z.data?.events??[],U=R.data?.totals,W=z.data?.eventRows,Ye=z.isLoading,G=z.isError?z.error:null,K=(0,h.useMemo)(()=>H.filter(e=>{switch(e.kind){case d.crawler:return u.has(`crawler`);case d[`ai-user-fetch`]:return u.has(`ai-user-fetch`);case d[`ai-referral`]:return u.has(`ai-referral`)}}),[H,u]),Xe=(0,h.useMemo)(()=>{let e=new Set;for(let t of H)e.add(Te(t));return _&&e.add(_),[...e].sort((e,t)=>e.localeCompare(t))},[H,_]),Ze=(0,h.useMemo)(()=>{let e=new Set;for(let t of H)e.add(t.operator);return y&&e.add(y),[...e].sort((e,t)=>e.localeCompare(t))},[H,y]),q=(0,h.useMemo)(()=>De(K,{selectedBucket:null,identity:_,operator:y,pathQuery:w,statusClass:D,verification:M},F.granularity),[K,_,y,w,D,M,F.granularity]);(0,h.useEffect)(()=>{P(1)},[K,f,_,y,w,D,M]);let J=Math.max(1,Math.ceil(q.length/S)),Y=Math.min(Math.max(1,Ve),J),X=(Y-1)*S,Qe=(0,h.useMemo)(()=>q.slice(X,X+S),[q,X]),$e=q.length>S,et=q.length===0?0:X+1,tt=Math.min(X+S,q.length),Z=(0,h.useMemo)(()=>f?Le(f,F.granularity):null,[f,F.granularity]),Q=(0,h.useMemo)(()=>Re(R.data?.series.points??[],F.granularity),[R.data?.series.points,F.granularity]),$=e=>{fe(t=>{let n=new Set(t);return n.has(e)?n.size>1&&n.delete(e):n.add(e),n})},nt=e=>{let t=Oe(e,Q);t&&g(e=>e===t?null:t)},rt=()=>{g(null),v(``),C(``),E(``),j(`all`),N(`all`)},it=!!(f||_||y||w.trim()||D!==`all`||M!==`all`),at=async()=>{Ue(null),Ge(null);try{let e=await B.mutateAsync({sinceMinutes:60});Ge(`Pulled ${e.pulledEvents} entries · ${e.crawlerHits} crawler · ${e.aiUserFetchHits} AI user fetch · ${e.aiUserFetchLikelyFakeHits} likely fake agent · ${e.aiReferralHits} AI referral · ${e.unknownHits} unknown`)}catch(e){Ue(_e(e))}};return!i||!o?(0,b.jsx)(`div`,{className:`page-container`,children:(0,b.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Missing project name or source id in URL.`})}):L.isLoading?(0,b.jsx)(`div`,{className:`page-container`,children:(0,b.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Loading source…`})}):L.isError||!V?(0,b.jsxs)(`div`,{className:`page-container`,children:[(0,b.jsx)(`p`,{className:`text-copy-14 text-negative`,children:`Could not load this source.`}),(0,b.jsx)(Ie,{canGoBack:a,className:`mt-2 text-label-12 text-secondary hover:text-strong`})]}):(0,b.jsxs)(`div`,{className:`page-container space-y-8`,children:[(0,b.jsxs)(`div`,{className:`page-header`,children:[(0,b.jsxs)(`div`,{className:`page-header-left`,children:[(0,b.jsx)(Ie,{canGoBack:a,className:`text-label-12 text-muted hover:text-strong`}),(0,b.jsx)(`h1`,{className:`page-title mt-2`,children:V.displayName}),(0,b.jsxs)(`p`,{className:`page-subtitle`,children:[V.sourceType,` source for `,i]})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(de,{tone:xe(V.status),children:V.status}),!le()&&(0,b.jsxs)(ue,{type:`button`,variant:`outline`,size:`sm`,disabled:B.isPending,onClick:()=>void at(),children:[(0,b.jsx)(r,{className:`size-3.5 ${B.isPending?`animate-spin`:``}`}),B.isPending?`Syncing…`:`Sync now`]})]})]}),He?(0,b.jsx)(`div`,{className:`rounded-md border border-negative-800/50 bg-negative-950/30 px-3 py-2 text-label-14 text-negative-200`,children:He}):null,We?(0,b.jsx)(`div`,{className:`rounded-md border border-positive-800/50 bg-positive-950/30 px-3 py-2 text-label-14 text-positive-200`,children:We}):null,(0,b.jsxs)(`section`,{"aria-labelledby":`traffic-24h-heading`,children:[(0,b.jsx)(`h2`,{id:`traffic-24h-heading`,className:`mb-3 text-heading-14 text-heading`,children:`Last 24 hours`}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 divide-y divide-default border-y border-default sm:grid-cols-3 sm:divide-x sm:divide-y-0`,children:[(0,b.jsx)(A,{label:`Content crawls`,value:V.totals24h.crawlerContentHits,tooltip:`Content and document paths only. Excludes sitemap ${V.totals24h.crawlerSegments.sitemap.toLocaleString(`en-US`)}, robots ${V.totals24h.crawlerSegments.robots.toLocaleString(`en-US`)}, assets ${V.totals24h.crawlerSegments.asset.toLocaleString(`en-US`)}, and ${V.totals24h.crawlerSegments.other.toLocaleString(`en-US`)} other requests such as feeds, API paths, or downloads. Total crawler hits: ${V.totals24h.crawlerHits.toLocaleString(`en-US`)}.`}),(0,b.jsx)(A,{label:`AI user fetches`,value:V.totals24h.aiUserFetchHits,tooltip:`Requests from AI assistants fetching a page for a person (ChatGPT-User, Claude-User, Perplexity-User and others). ${Se(V.totals24h.aiUserFetchLikelyFakeHits)}`}),(0,b.jsx)(A,{label:`AI referral sessions`,value:V.totals24h.aiReferralLandedHits,tooltip:`Browser click-throughs from AI surfaces, identified by Referer or UTM evidence. Excludes ${V.totals24h.aiReferralRedirectedHits.toLocaleString(`en-US`)} request(s) answered with a redirect: a hop is not an arrival. Total including hops: ${V.totals24h.aiReferralHits.toLocaleString(`en-US`)}.`})]})]}),(0,b.jsxs)(`section`,{children:[(0,b.jsx)(`p`,{className:`eyebrow mb-4`,children:`Latest sync run`}),V.latestRun?(0,b.jsxs)(m,{className:`p-4 text-label-14`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-1.5`,children:[(0,b.jsxs)(`span`,{className:`text-heading`,children:[`Status: `,(0,b.jsx)(`span`,{className:`text-label-14-strong`,children:V.latestRun.status})]}),(0,b.jsxs)(`span`,{className:`text-muted`,children:[`Started: `,T(V.latestRun.startedAt)]}),V.latestRun.finishedAt?(0,b.jsxs)(`span`,{className:`text-muted`,children:[`Finished: `,T(V.latestRun.finishedAt)]}):null]}),(0,b.jsxs)(`details`,{className:`mt-3`,children:[(0,b.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Run details`}),(0,b.jsx)(`code`,{className:`mt-2 block text-label-12 text-muted`,children:V.latestRun.runId})]}),V.latestRun.error?(0,b.jsx)(`p`,{className:`mt-2 rounded border border-negative-900/40 bg-negative-950/30 px-3 py-2 text-copy-13 text-negative`,children:V.latestRun.error}):null]}):(0,b.jsx)(m,{className:`px-4 py-3 text-label-14 text-muted`,children:le()?`No traffic-sync runs recorded yet.`:`No traffic-sync runs recorded yet. Hit "Sync now" above to create one.`})]}),(0,b.jsxs)(`section`,{children:[(0,b.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-3`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-label-12-strong normal-case text-muted`,children:`Events`}),(0,b.jsx)(`h2`,{className:`mt-1 text-heading-16 text-primary`,children:F.granularity===`day`?`Daily rollups`:`Hourly rollups`}),U?(0,b.jsxs)(`p`,{className:`mt-1.5 text-copy-13 text-muted`,children:[U.crawlerContentHits.toLocaleString(`en-US`),` content crawls ·`,` `,U.crawlerInfraHits.toLocaleString(`en-US`),` infra (sitemap/robots/assets) ·`,` `,U.aiUserFetchHits.toLocaleString(`en-US`),` AI user fetches ·`,` `,U.aiReferralLandedHits.toLocaleString(`en-US`),` AI referral sessions · last `,F.label,` · `,Pe]}):null]}),(0,b.jsx)(`div`,{className:`inline-flex rounded-md border border-base p-0.5`,role:`toolbar`,"aria-label":`Window`,children:x.map(e=>(0,b.jsx)(`button`,{type:`button`,className:`rounded px-2.5 py-1 text-button-14 ${s===e.value?`bg-bg-elevated text-heading`:`text-secondary hover:text-strong`}`,"aria-pressed":s===e.value,onClick:()=>{ne(e.value),g(null)},children:e.label},e.value))})]}),(0,b.jsxs)(m,{className:`p-4`,children:[(0,b.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,role:`toolbar`,"aria-label":`Series`,children:[(0,b.jsx)(k,{label:`Crawler`,color:je,count:U?.crawlerHits??0,active:u.has(`crawler`),onToggle:()=>$(`crawler`)}),(0,b.jsx)(k,{label:`AI user fetches`,color:Me,count:U?.aiUserFetchHits??0,active:u.has(`ai-user-fetch`),onToggle:()=>$(`ai-user-fetch`)}),(0,b.jsx)(k,{label:`AI referral sessions`,color:Ne,count:U?.aiReferralLandedHits??0,active:u.has(`ai-referral`),onToggle:()=>$(`ai-referral`)})]}),R.isError?(0,b.jsxs)(`p`,{className:`py-12 text-center text-copy-13 text-negative-400`,children:[`Failed to load events: `,R.error instanceof Error?R.error.message:`Unknown error`]}):R.isLoading?(0,b.jsx)(`p`,{className:`py-12 text-center text-copy-13 text-muted`,children:`Loading events…`}):Q.length===0?(0,b.jsx)(`p`,{className:`py-12 text-center text-copy-13 text-muted`,children:`No events in this window.`}):(0,b.jsx)(`div`,{className:`h-72`,children:(0,b.jsx)(oe,{children:(0,b.jsxs)(se,{data:Q,margin:{top:4,right:4,bottom:0,left:0},onClick:nt,style:{cursor:`pointer`},children:[(0,b.jsx)(re,{stroke:me,strokeDasharray:`3 3`}),(0,b.jsx)(ae,{dataKey:`label`,tick:pe,stroke:ge,interval:`preserveStartEnd`,minTickGap:F.granularity===`day`?24:32}),(0,b.jsx)(ce,{tick:pe,stroke:ge,allowDecimals:!1}),(0,b.jsx)(ie,{...he}),u.has(`crawler`)?(0,b.jsx)(c,{dataKey:`crawler`,name:`Crawler`,fill:je,stackId:`a`,children:Q.map(e=>(0,b.jsx)(l,{fillOpacity:f&&f!==e.bucket?.25:1},e.bucket))}):null,u.has(`ai-user-fetch`)?(0,b.jsx)(c,{dataKey:`aiUserFetch`,name:`AI user fetch`,fill:Me,stackId:`a`,children:Q.map(e=>(0,b.jsx)(l,{fillOpacity:f&&f!==e.bucket?.25:1},e.bucket))}):null,u.has(`ai-referral`)?(0,b.jsx)(c,{dataKey:`aiReferral`,name:`AI referral`,fill:Ne,stackId:`a`,children:Q.map(e=>(0,b.jsx)(l,{fillOpacity:f&&f!==e.bucket?.25:1},e.bucket))}):null]})})})]})]}),(0,b.jsxs)(`section`,{children:[(0,b.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-2`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-label-12-strong normal-case text-muted`,children:`Event rows`}),(0,b.jsxs)(`p`,{className:`mt-1 text-copy-13 text-muted`,children:[Ye?`Loading…`:(0,b.jsxs)(b.Fragment,{children:[`Showing `,(0,b.jsx)(`span`,{className:`tabular-nums text-neutral`,children:q.length.toLocaleString(`en-US`)}),` of`,` `,(0,b.jsx)(`span`,{className:`tabular-nums text-muted`,children:K.length.toLocaleString(`en-US`)}),` `,W?.truncated?`loaded events`:`events`,W?.truncated?(0,b.jsxs)(b.Fragment,{children:[` `,`· loaded `,(0,b.jsx)(`span`,{className:`tabular-nums text-neutral`,children:W.returned.toLocaleString(`en-US`)}),` of`,` `,(0,b.jsx)(`span`,{className:`tabular-nums text-muted`,children:W.total.toLocaleString(`en-US`)}),` rows`]}):null]}),` `,`· `,Pe]})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsxs)(`span`,{className:`inline-flex items-center text-secondary`,children:[(0,b.jsxs)(`select`,{"aria-label":`Filter by identity`,value:_,onChange:e=>v(e.target.value),className:`rounded-md border border-base bg-bg px-2.5 py-1.5 text-label-12 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,b.jsx)(`option`,{value:``,children:`All identities`}),Xe.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))]}),(0,b.jsx)(p,{text:`The specific bot or AI product making the request (e.g., GPTBot, ChatGPT-User, Perplexity). One operator usually runs several identities.`})]}),(0,b.jsxs)(`span`,{className:`inline-flex items-center text-secondary`,children:[(0,b.jsxs)(`select`,{"aria-label":`Filter by operator`,value:y,onChange:e=>C(e.target.value),className:`rounded-md border border-base bg-bg px-2.5 py-1.5 text-label-12 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,b.jsx)(`option`,{value:``,children:`All operators`}),Ze.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))]}),(0,b.jsx)(p,{text:`The company that runs the bot or product (e.g., OpenAI, Anthropic, Perplexity). Filtering by operator includes every identity under that company.`})]}),(0,b.jsx)(`select`,{"aria-label":`Filter by HTTP status class`,value:D,onChange:e=>j(e.target.value),className:`rounded-md border border-base bg-bg px-2.5 py-1.5 text-label-12 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:Ce.map(e=>(0,b.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,b.jsx)(`select`,{"aria-label":`Filter by verification claim`,value:M,onChange:e=>N(e.target.value),className:`rounded-md border border-base bg-bg px-2.5 py-1.5 text-label-12 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:we.map(e=>(0,b.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,b.jsx)(`input`,{type:`search`,"aria-label":`Filter by path`,placeholder:`path contains…`,value:w,onChange:e=>E(e.target.value),className:`w-44 rounded-md border border-base bg-bg px-2.5 py-1.5 text-label-12 text-strong placeholder:text-faint focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`})]})]}),it?(0,b.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[Z?(0,b.jsx)(O,{label:`Bucket: ${Z}`,onClear:()=>g(null)}):null,_?(0,b.jsx)(O,{label:`Identity: ${_}`,onClear:()=>v(``)}):null,y?(0,b.jsx)(O,{label:`Operator: ${y}`,onClear:()=>C(``)}):null,w.trim()?(0,b.jsx)(O,{label:`Path: ${w.trim()}`,onClear:()=>E(``)}):null,D===`all`?null:(0,b.jsx)(O,{label:`Status: ${D}`,onClear:()=>j(`all`)}),M===`all`?null:(0,b.jsx)(O,{label:`Claim: ${ze(M)}`,onClear:()=>N(`all`)}),(0,b.jsx)(`button`,{type:`button`,onClick:rt,className:`text-button-14 text-muted underline-offset-4 hover:text-strong hover:underline`,children:`Clear all`})]}):null,G?(0,b.jsxs)(`p`,{className:`py-8 text-center text-copy-13 text-negative-400`,children:[`Failed to load event rows: `,G instanceof Error?G.message:`Unknown error`]}):Ye?(0,b.jsx)(`p`,{className:`py-8 text-center text-copy-13 text-muted`,children:Z?`Loading rows for ${Z}…`:`Loading event rows…`}):(0,b.jsx)(Be,{events:Qe,truncated:W?.truncated??!1}),$e?(0,b.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2 text-label-12 text-secondary`,children:[(0,b.jsxs)(`p`,{className:`tabular-nums`,children:[`Showing `,(0,b.jsx)(`span`,{className:`text-neutral`,children:et.toLocaleString(`en-US`)}),`–`,(0,b.jsx)(`span`,{className:`text-neutral`,children:tt.toLocaleString(`en-US`)}),` of`,` `,(0,b.jsx)(`span`,{className:`text-neutral`,children:q.length.toLocaleString(`en-US`)}),` events`]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>P(e=>Math.max(1,e-1)),disabled:Y<=1,"aria-label":`Previous page`,className:`inline-flex items-center gap-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-strong transition hover:border-strong hover:text-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-base disabled:hover:text-strong`,children:[(0,b.jsx)(t,{className:`size-3.5`}),`Prev`]}),(0,b.jsxs)(`span`,{className:`tabular-nums`,children:[`Page `,(0,b.jsx)(`span`,{className:`text-strong`,children:Y}),` of`,` `,(0,b.jsx)(`span`,{className:`text-strong`,children:J})]}),(0,b.jsxs)(`button`,{type:`button`,onClick:()=>P(e=>Math.min(J,e+1)),disabled:Y>=J,"aria-label":`Next page`,className:`inline-flex items-center gap-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-strong transition hover:border-strong hover:text-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-base disabled:hover:text-strong`,children:[`Next`,(0,b.jsx)(n,{className:`size-3.5`})]})]})]}):null]}),(0,b.jsxs)(`details`,{className:`border-t border-default pt-4`,children:[(0,b.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`How traffic is classified`}),(0,b.jsx)(`p`,{className:`mt-2 max-w-3xl text-copy-14 text-secondary`,children:`Crawler requests, AI user fetches, and referrals are recorded separately. Filters expose the underlying evidence.`})]})]})}function Le(e,t){return t===`day`?w(e):C(e)}function Re(e,t){return e.map(e=>({bucket:e.bucket,label:Le(e.bucket,t),crawler:e.crawlerHits,aiUserFetch:e.aiUserFetchHits,aiReferral:e.aiReferralLandedHits}))}function ze(e){return we.find(t=>t.value===e)?.label??e}function O({label:e,onClear:t}){return(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded border border-strong bg-surface-inset px-2.5 py-1 text-label-14 text-strong`,children:[e,(0,b.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Clear ${e}`,className:`rounded p-0.5 text-secondary hover:bg-mono-700/60 hover:text-heading`,children:(0,b.jsx)(a,{className:`size-3`})})]})}function k({label:e,color:t,count:n,active:r,onToggle:i}){return(0,b.jsxs)(`button`,{type:`button`,onClick:i,"aria-pressed":r,className:`inline-flex items-center gap-2 rounded border px-3 py-1.5 text-button-14 transition ${r?`border-strong bg-surface-inset text-heading`:`border-base bg-transparent text-muted hover:text-neutral`}`,children:[(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-3 items-center justify-center rounded-sm border transition-opacity ${r?`border-transparent opacity-100`:`border-strong opacity-60`}`,style:r?{backgroundColor:t}:void 0,children:r?`✓`:``}),(0,b.jsx)(`span`,{children:e}),(0,b.jsx)(`span`,{className:`tabular-nums ${r?`text-secondary`:`text-faint`}`,children:n.toLocaleString(`en-US`)})]})}function A({label:e,value:t,tooltip:n}){return(0,b.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,b.jsxs)(`p`,{className:`flex items-center gap-1 text-copy-14 text-secondary`,children:[e,n?(0,b.jsx)(p,{text:n}):null]}),(0,b.jsx)(`p`,{className:`mt-1 text-copy-24-strong tabular-nums text-heading`,children:t.toLocaleString(`en-US`)})]})}function j(e){switch(e){case d.crawler:return`Crawler`;case d[`ai-user-fetch`]:return`AI hit`;case d[`ai-referral`]:return`AI referral`}}function M(e){switch(e.kind){case d.crawler:case d[`ai-user-fetch`]:return e.botId;case d[`ai-referral`]:return e.product}}function N(e){switch(e.kind){case d.crawler:case d[`ai-user-fetch`]:return`${e.verificationStatus} · HTTP ${e.status}`;case d[`ai-referral`]:return`${e.evidenceType} · ${e.sourceDomain}`}}function Be({events:e,truncated:t=!1}){return e.length===0?(0,b.jsx)(m,{className:`p-6 text-center text-label-14 text-muted`,children:t?`No matches in the rows loaded so far. More rows exist beyond the load limit, so narrow the time window to search them.`:`No event rows match the current filters.`}):(0,b.jsx)(`div`,{className:`material-base overflow-hidden`,children:(0,b.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,b.jsx)(`thead`,{className:`bg-bg-elevated/50 text-label-12-strong normal-case text-muted`,children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{className:`px-4 py-2 text-left`,children:`Hour`}),(0,b.jsx)(`th`,{className:`px-4 py-2 text-left`,children:`Kind`}),(0,b.jsx)(`th`,{className:`px-4 py-2 text-left`,children:`Identity`}),(0,b.jsx)(`th`,{className:`px-4 py-2 text-left`,children:`Evidence / status`}),(0,b.jsx)(`th`,{className:`px-4 py-2 text-left`,children:`Path`}),(0,b.jsx)(`th`,{className:`px-4 py-2 text-right`,children:(0,b.jsxs)(`span`,{className:`inline-flex items-center`,children:[`Hits`,(0,b.jsx)(p,{text:`Each row is one hour-bucket, not one request. Hits is the number of requests in that hour that shared the same identity, path, HTTP status, and verification claim.`})]})})]})}),(0,b.jsx)(`tbody`,{className:`divide-y divide-mono-800/60`,children:e.map((e,t)=>(0,b.jsxs)(`tr`,{className:`hover:bg-bg-elevated/40 transition-colors`,children:[(0,b.jsx)(`td`,{className:`px-4 py-2 text-label-12-mono text-neutral`,children:C(e.tsHour)}),(0,b.jsx)(`td`,{className:`px-4 py-2 text-neutral`,children:j(e.kind)}),(0,b.jsxs)(`td`,{className:`px-4 py-2 text-heading`,children:[M(e),(0,b.jsx)(`span`,{className:`ml-2 text-label-12 text-muted`,children:e.operator})]}),(0,b.jsx)(`td`,{className:`px-4 py-2 text-neutral`,children:N(e)}),(0,b.jsx)(`td`,{className:`px-4 py-2 truncate text-label-12-mono text-neutral`,children:_(e)}),(0,b.jsx)(`td`,{className:`px-4 py-2 text-right tabular-nums text-heading`,children:e.hits})]},`${e.kind}:${e.tsHour}:${t}`))})]})})}export{Be as EventsTable,A as TrafficKpi,D as TrafficSourceDetailPage,Fe as trafficFetchKind};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HISTORY_WINDOW_RUNS,
|
|
3
|
-
IntelligenceService
|
|
4
|
-
} from "./chunk-DP3FE2OW.js";
|
|
5
|
-
import "./chunk-O5AIKUW3.js";
|
|
6
|
-
import "./chunk-3TPHFDZN.js";
|
|
7
|
-
import "./chunk-VH424YVI.js";
|
|
8
|
-
import "./chunk-CZOGOHIN.js";
|
|
9
|
-
import "./chunk-EXPBZFN4.js";
|
|
10
|
-
import "./chunk-7I2NJ4BH.js";
|
|
11
|
-
import "./chunk-NHBXQWE3.js";
|
|
12
|
-
import "./chunk-MLKGABMK.js";
|
|
13
|
-
export {
|
|
14
|
-
HISTORY_WINDOW_RUNS,
|
|
15
|
-
IntelligenceService
|
|
16
|
-
};
|