@canonry/canonry 7.102.0 → 7.104.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/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-QD3I5MYX.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-S7ZOYNW3.js → chunk-2VNQKUCW.js} +2 -2
- package/dist/{chunk-N7773GJW.js → chunk-3V5Y2XTA.js} +1 -1
- package/dist/{chunk-DP3FE2OW.js → chunk-47QPY6Y3.js} +5 -5
- package/dist/{chunk-M25KDHD4.js → chunk-52D6WBCZ.js} +1 -1
- package/dist/{chunk-LGTSVS6Q.js → chunk-5FMZGO6R.js} +4 -4
- package/dist/{chunk-N4VEG6GB.js → chunk-5UHNDYUH.js} +4 -4
- package/dist/{chunk-QK4IICRM.js → chunk-6AW6ONTF.js} +2 -2
- package/dist/{chunk-YTR2S4MU.js → chunk-756RPVYB.js} +4 -4
- package/dist/{chunk-G4ODBZO7.js → chunk-7UQZCDYK.js} +1 -1
- package/dist/{chunk-7JJCFGL2.js → chunk-7VKVGR6X.js} +3 -3
- package/dist/{chunk-BG6TVNA6.js → chunk-7XJG2OTB.js} +366 -366
- package/dist/{chunk-7I2NJ4BH.js → chunk-BYYP43Q3.js} +128 -1
- 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-ONHBQYSA.js → chunk-FYRNKI3A.js} +46 -31
- 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-UX6XWC4F.js → chunk-IHY4Q74C.js} +567 -185
- 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-VH424YVI.js → chunk-NGGMSNF6.js} +1714 -1714
- package/dist/{chunk-ZIKPEZ3K.js → chunk-NI2JFXIS.js} +21 -21
- package/dist/{chunk-DRNBMKR5.js → chunk-PU5OA57Z.js} +6 -6
- package/dist/{chunk-FHK6M4RK.js → chunk-QRR5ZW22.js} +3 -3
- package/dist/{chunk-2YLTELT2.js → chunk-SZ64N26K.js} +1 -1
- 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-O46WFSHZ.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-4KP7KKMY.js} +6 -6
- package/dist/{demo-3XDVCUT5.js → demo-NKCOCN6Z.js} +1 -1
- package/dist/{demo-server-7ZJWSGE2.js → demo-server-RQB6VRBH.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 +89 -70
- package/dist/index.js +25 -25
- package/dist/{init-W4LWSMCC.js → init-WDRQTCKK.js} +12 -12
- package/dist/{insights-HNJR7UEC.js → insights-TPNHIVNH.js} +3 -3
- package/dist/intelligence-service-DAUXHAOP.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-UHEE443J.js} +26 -26
- package/dist/{session-LRR2N6IP.js → session-AS2VQ7VL.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-YGKVGB5M.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
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
templateLinkRatio,
|
|
21
21
|
templateLinkUbiquityAvailable,
|
|
22
22
|
validationError
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-WT22Z3I7.js";
|
|
24
24
|
import {
|
|
25
25
|
__export
|
|
26
26
|
} from "./chunk-MLKGABMK.js";
|
|
@@ -2673,6 +2673,19 @@ var trafficSources = sqliteTable2("traffic_sources", {
|
|
|
2673
2673
|
* back to where journeys began, or clears it when no older hour is left.
|
|
2674
2674
|
*/
|
|
2675
2675
|
aiReferralOlderCountUntil: text2("ai_referral_older_count_until"),
|
|
2676
|
+
/**
|
|
2677
|
+
* The exclusive end of the last hour whose hosted browser agent (Google-Agent,
|
|
2678
|
+
* Claude-Agent) AI user fetches this source counted under older rules; hours
|
|
2679
|
+
* from it on count those agents' page loads only. Older hours were counted
|
|
2680
|
+
* differently and can read high (every file, data call and beacon counted)
|
|
2681
|
+
* or low (whole visits judged likely fake); they were not recounted
|
|
2682
|
+
* (hourly rows keep no method or query). NULL when the source holds no such
|
|
2683
|
+
* hour. Set by migration v222 and by the stored traffic pass; a replace-mode
|
|
2684
|
+
* backfill moves it back to the end of the last browser-agent hour before
|
|
2685
|
+
* its window, or clears it when none remains. Trend fits and comparisons
|
|
2686
|
+
* leave earlier hours out.
|
|
2687
|
+
*/
|
|
2688
|
+
aiUserFetchOlderCountUntil: text2("ai_user_fetch_older_count_until"),
|
|
2676
2689
|
archivedAt: text2("archived_at"),
|
|
2677
2690
|
configJson: text2("config_json", { mode: "json" }).$type().notNull().default({}),
|
|
2678
2691
|
// sha256 hex of the per-source bearer token issued at connect time. Only
|
|
@@ -9352,8 +9365,119 @@ var MIGRATION_VERSIONS = [
|
|
|
9352
9365
|
`CREATE INDEX IF NOT EXISTS idx_chatgpt_login_transactions_expires
|
|
9353
9366
|
ON chatgpt_login_transactions(expires_at)`
|
|
9354
9367
|
]
|
|
9368
|
+
},
|
|
9369
|
+
{
|
|
9370
|
+
version: 221,
|
|
9371
|
+
name: "claude-searchbot-own-bot",
|
|
9372
|
+
// Claude-SearchBot, Anthropic's search crawler, now has its own classifier
|
|
9373
|
+
// rule (`claude-searchbot`, purpose search). The `anthropic-claudebot` rule
|
|
9374
|
+
// (purpose training) used to match it too, so its hits were stored as
|
|
9375
|
+
// ClaudeBot. This moves the crawler rows whose sampled user agent is
|
|
9376
|
+
// Claude-SearchBot to the new bot, with their manifest provenance, and
|
|
9377
|
+
// relabels the crawler samples the old rule classified.
|
|
9378
|
+
//
|
|
9379
|
+
// Best effort, as v65's Mistral split: an hourly row is one (project,
|
|
9380
|
+
// source, hour, bot, verification, path, status) and keeps one sampled
|
|
9381
|
+
// user agent, the latest batch's, so a row that counted both bots in the
|
|
9382
|
+
// same hour moves or stays whole by that sample. New traffic splits
|
|
9383
|
+
// exactly. Both rules verify against Anthropic's one crawler manifest, so
|
|
9384
|
+
// a moved row keeps its verification status and provenance.
|
|
9385
|
+
//
|
|
9386
|
+
// A run hook because the statement allowlist is schema-shaped, and because
|
|
9387
|
+
// a legacy database that resumes past the migrations creating these tables
|
|
9388
|
+
// must skip the move rather than fail on a missing table.
|
|
9389
|
+
statements: [],
|
|
9390
|
+
run: (tx) => {
|
|
9391
|
+
moveClaudeSearchBotRows(tx);
|
|
9392
|
+
}
|
|
9393
|
+
},
|
|
9394
|
+
{
|
|
9395
|
+
version: 222,
|
|
9396
|
+
name: "ai-user-fetch-older-count-until",
|
|
9397
|
+
// Hosted browser agents (Google-Agent, Claude-Agent) now count only their
|
|
9398
|
+
// page loads as AI user fetches. Hours a source wrote before were counted
|
|
9399
|
+
// under older rules: every file, data call and beacon their pages made
|
|
9400
|
+
// counted (high), or the older trust rules judged whole visits likely fake
|
|
9401
|
+
// (low). They were not recounted (hourly rows keep no method or query).
|
|
9402
|
+
// Stamp where the older count ended on sources holding such hours: the end
|
|
9403
|
+
// of the last one, or the upgrade time if that is earlier. A fresh install
|
|
9404
|
+
// holds none and stamps nothing.
|
|
9405
|
+
//
|
|
9406
|
+
// A run hook because the statement allowlist is schema-shaped, and because
|
|
9407
|
+
// a legacy database that resumes past the migrations creating the hourly
|
|
9408
|
+
// tables must skip the stamp rather than fail on a missing table.
|
|
9409
|
+
statements: [
|
|
9410
|
+
`ALTER TABLE traffic_sources ADD COLUMN ai_user_fetch_older_count_until TEXT`
|
|
9411
|
+
],
|
|
9412
|
+
run: (tx) => {
|
|
9413
|
+
stampBrowserAgentOlderCount(tx, (/* @__PURE__ */ new Date()).toISOString());
|
|
9414
|
+
}
|
|
9355
9415
|
}
|
|
9356
9416
|
];
|
|
9417
|
+
var V222_BROWSER_AGENT_HOURLY_TABLES = ["ai_user_fetch_events_hourly", "ai_user_fetch_likely_fake_hourly"];
|
|
9418
|
+
function stampBrowserAgentOlderCount(tx, upgradedAt) {
|
|
9419
|
+
const lastHours = V222_BROWSER_AGENT_HOURLY_TABLES.filter((table) => tableExists(tx, table)).map((table) => `SELECT source_id, MAX(ts_hour) AS ts_hour FROM ${table}
|
|
9420
|
+
WHERE bot_id IN ('google-agent', 'claude-agent') GROUP BY source_id`);
|
|
9421
|
+
if (lastHours.length === 0) return;
|
|
9422
|
+
tx.run(sql2`UPDATE traffic_sources
|
|
9423
|
+
SET ai_user_fetch_older_count_until = min(${upgradedAt}, last_hour.hour_end)
|
|
9424
|
+
FROM (
|
|
9425
|
+
SELECT source_id, strftime('%Y-%m-%dT%H:%M:%fZ', MAX(ts_hour), '+1 hour') AS hour_end
|
|
9426
|
+
FROM (${sql2.raw(lastHours.join(" UNION ALL "))})
|
|
9427
|
+
GROUP BY source_id
|
|
9428
|
+
) AS last_hour
|
|
9429
|
+
WHERE traffic_sources.id = last_hour.source_id
|
|
9430
|
+
AND traffic_sources.ai_user_fetch_older_count_until IS NULL`);
|
|
9431
|
+
}
|
|
9432
|
+
function moveClaudeSearchBotRows(tx) {
|
|
9433
|
+
if (tableExists(tx, "crawler_events_hourly")) {
|
|
9434
|
+
tx.run(sql2.raw("DROP TABLE IF EXISTS temp.v221_moved"));
|
|
9435
|
+
tx.run(sql2.raw(
|
|
9436
|
+
`CREATE TEMP TABLE v221_moved AS
|
|
9437
|
+
SELECT rowid AS rid, project_id, source_id, ts_hour, verification_status, path_normalized, status
|
|
9438
|
+
FROM crawler_events_hourly
|
|
9439
|
+
WHERE bot_id = 'anthropic-claudebot' AND sampled_user_agent LIKE '%Claude-SearchBot/%'`
|
|
9440
|
+
));
|
|
9441
|
+
tx.run(sql2.raw(
|
|
9442
|
+
`INSERT INTO crawler_events_hourly (project_id, source_id, ts_hour, bot_id, operator, verification_status, path_normalized, status, hits, sampled_user_agent, created_at, updated_at)
|
|
9443
|
+
SELECT c.project_id, c.source_id, c.ts_hour, 'claude-searchbot', c.operator, c.verification_status, c.path_normalized, c.status, c.hits, c.sampled_user_agent, c.created_at, c.updated_at
|
|
9444
|
+
FROM v221_moved t JOIN crawler_events_hourly c ON c.rowid = t.rid
|
|
9445
|
+
WHERE true
|
|
9446
|
+
ON CONFLICT (project_id, source_id, ts_hour, bot_id, verification_status, path_normalized, status)
|
|
9447
|
+
DO UPDATE SET hits = crawler_events_hourly.hits + excluded.hits,
|
|
9448
|
+
updated_at = max(crawler_events_hourly.updated_at, excluded.updated_at)`
|
|
9449
|
+
));
|
|
9450
|
+
if (tableExists(tx, "crawler_verification_manifests_hourly")) {
|
|
9451
|
+
tx.run(sql2.raw(
|
|
9452
|
+
`INSERT INTO crawler_verification_manifests_hourly (project_id, source_id, ts_hour, bot_id, verification_status, path_normalized, status, manifest_id, manifest_json, hits, created_at, updated_at)
|
|
9453
|
+
SELECT m.project_id, m.source_id, m.ts_hour, 'claude-searchbot', m.verification_status, m.path_normalized, m.status, m.manifest_id, m.manifest_json, m.hits, m.created_at, m.updated_at
|
|
9454
|
+
FROM v221_moved t JOIN crawler_verification_manifests_hourly m
|
|
9455
|
+
ON m.project_id = t.project_id AND m.source_id = t.source_id AND m.ts_hour = t.ts_hour
|
|
9456
|
+
AND m.bot_id = 'anthropic-claudebot' AND m.verification_status = t.verification_status
|
|
9457
|
+
AND m.path_normalized = t.path_normalized AND m.status = t.status
|
|
9458
|
+
WHERE true
|
|
9459
|
+
ON CONFLICT (project_id, source_id, ts_hour, bot_id, verification_status, path_normalized, status, manifest_id)
|
|
9460
|
+
DO UPDATE SET hits = crawler_verification_manifests_hourly.hits + excluded.hits,
|
|
9461
|
+
updated_at = max(crawler_verification_manifests_hourly.updated_at, excluded.updated_at)`
|
|
9462
|
+
));
|
|
9463
|
+
}
|
|
9464
|
+
tx.run(sql2.raw("DELETE FROM crawler_events_hourly WHERE rowid IN (SELECT rid FROM v221_moved)"));
|
|
9465
|
+
tx.run(sql2.raw("DROP TABLE v221_moved"));
|
|
9466
|
+
}
|
|
9467
|
+
if (tableExists(tx, "raw_event_samples")) {
|
|
9468
|
+
tx.run(sql2.raw(
|
|
9469
|
+
`UPDATE raw_event_samples
|
|
9470
|
+
SET classifier_details_json = json_set(classifier_details_json,
|
|
9471
|
+
'$.crawler.botId', 'claude-searchbot',
|
|
9472
|
+
'$.crawler.product', 'Claude-SearchBot',
|
|
9473
|
+
'$.crawler.purpose', 'search')
|
|
9474
|
+
WHERE event_type = 'crawler'
|
|
9475
|
+
AND user_agent LIKE '%Claude-SearchBot/%'
|
|
9476
|
+
AND CASE WHEN json_valid(classifier_details_json)
|
|
9477
|
+
THEN json_extract(classifier_details_json, '$.crawler.botId') END = 'anthropic-claudebot'`
|
|
9478
|
+
));
|
|
9479
|
+
}
|
|
9480
|
+
}
|
|
9357
9481
|
var AERO_LEDGER_REBUILDS = [
|
|
9358
9482
|
{
|
|
9359
9483
|
table: "llm_usage_events",
|
|
@@ -9689,6 +9813,7 @@ function migrate(db, versions = MIGRATION_VERSIONS) {
|
|
|
9689
9813
|
db.run(sql2.raw(statement));
|
|
9690
9814
|
}
|
|
9691
9815
|
const appliedVersion = getAppliedVersion(db);
|
|
9816
|
+
let appliedAny = false;
|
|
9692
9817
|
for (const mv of versions) {
|
|
9693
9818
|
if (mv.version <= appliedVersion) continue;
|
|
9694
9819
|
if (mv.disableForeignKeys) db.run(sql2.raw("PRAGMA foreign_keys = OFF"));
|
|
@@ -9705,10 +9830,12 @@ function migrate(db, versions = MIGRATION_VERSIONS) {
|
|
|
9705
9830
|
mv.run?.(tx);
|
|
9706
9831
|
recordMigration(tx, mv.version, mv.name);
|
|
9707
9832
|
});
|
|
9833
|
+
appliedAny = true;
|
|
9708
9834
|
} finally {
|
|
9709
9835
|
if (mv.disableForeignKeys) db.run(sql2.raw("PRAGMA foreign_keys = ON"));
|
|
9710
9836
|
}
|
|
9711
9837
|
}
|
|
9838
|
+
if (appliedAny) db.all(sql2.raw("PRAGMA wal_checkpoint(TRUNCATE)"));
|
|
9712
9839
|
}
|
|
9713
9840
|
|
|
9714
9841
|
// ../db/src/operational-logs.ts
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-VJWDBFSL.js";
|
|
5
5
|
import {
|
|
6
6
|
createApiClient
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2VNQKUCW.js";
|
|
8
8
|
import {
|
|
9
9
|
CliError,
|
|
10
10
|
isMachineFormat
|
|
11
11
|
} from "./chunk-HGMYEDAQ.js";
|
|
12
12
|
import {
|
|
13
13
|
describeError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WT22Z3I7.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/mcp.ts
|
|
17
17
|
import fs from "fs";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
measurementDraftUpsertGroupRequestSchema,
|
|
24
24
|
measurementDraftUpsertMarketRequestSchema,
|
|
25
25
|
measurementDraftUpsertTargetRequestSchema
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WT22Z3I7.js";
|
|
27
27
|
|
|
28
28
|
// src/measurement-draft-actions.ts
|
|
29
29
|
import { z } from "zod";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
trackIntegrationConnection
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5FMZGO6R.js";
|
|
4
4
|
import {
|
|
5
5
|
cliRuntimeContext
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZJFLVXDZ.js";
|
|
7
7
|
|
|
8
8
|
// src/cli-connection-telemetry.ts
|
|
9
9
|
function trackCliConnection(properties) {
|
|
@@ -8,23 +8,24 @@ import {
|
|
|
8
8
|
reparseStoredResult4,
|
|
9
9
|
reparseStoredResult5,
|
|
10
10
|
resolveStoredApiResponse
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IHY4Q74C.js";
|
|
12
12
|
import {
|
|
13
13
|
loadConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HPFT4IKN.js";
|
|
15
15
|
import {
|
|
16
|
+
CliError,
|
|
16
17
|
isMachineFormat
|
|
17
18
|
} from "./chunk-HGMYEDAQ.js";
|
|
18
19
|
import {
|
|
19
20
|
determineCitationState
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CJ55MGWI.js";
|
|
21
22
|
import {
|
|
22
23
|
backfillProjectAnswerMentions,
|
|
23
24
|
competitorIdentityColumns,
|
|
24
25
|
createRunCompetitorResolver,
|
|
25
26
|
readMarketCompetitorNames,
|
|
26
27
|
refreshSnapshotMentionIdentity
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-NGGMSNF6.js";
|
|
28
29
|
import {
|
|
29
30
|
RawEventSampleEventTypes,
|
|
30
31
|
auditLog,
|
|
@@ -38,7 +39,7 @@ import {
|
|
|
38
39
|
querySnapshots,
|
|
39
40
|
rawEventSamples,
|
|
40
41
|
runs
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-BYYP43Q3.js";
|
|
42
43
|
import {
|
|
43
44
|
ProviderNames,
|
|
44
45
|
RetrievalContracts,
|
|
@@ -51,7 +52,7 @@ import {
|
|
|
51
52
|
extractRecommendedCompetitors,
|
|
52
53
|
normalizeUrlPath,
|
|
53
54
|
openRouterRouteModel
|
|
54
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-WT22Z3I7.js";
|
|
55
56
|
|
|
56
57
|
// src/commands/backfill.ts
|
|
57
58
|
import { setImmediate as yieldToEventLoop } from "timers/promises";
|
|
@@ -429,7 +430,7 @@ No DB writes performed. Re-run without --dry-run to apply.`);
|
|
|
429
430
|
}
|
|
430
431
|
}
|
|
431
432
|
async function backfillInsightsCommand(project, opts) {
|
|
432
|
-
const { IntelligenceService } = await import("./intelligence-service-
|
|
433
|
+
const { IntelligenceService } = await import("./intelligence-service-DAUXHAOP.js");
|
|
433
434
|
const config = loadConfig();
|
|
434
435
|
const db = createClient(config.database);
|
|
435
436
|
migrate(db);
|
|
@@ -777,53 +778,60 @@ async function backfillTrafficClassificationCommand(opts) {
|
|
|
777
778
|
const projectFilter = opts?.project?.trim();
|
|
778
779
|
const isDryRun = opts?.dryRun === true;
|
|
779
780
|
const isJson = isMachineFormat(opts?.format);
|
|
780
|
-
|
|
781
|
-
if (
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
781
|
+
let projectIds;
|
|
782
|
+
if (projectFilter) {
|
|
783
|
+
const project = db.select({ id: projects.id }).from(projects).where(eq(projects.name, projectFilter)).get();
|
|
784
|
+
if (!project) {
|
|
785
|
+
throw new CliError({
|
|
786
|
+
code: "NOT_FOUND",
|
|
787
|
+
message: `Project "${projectFilter}" not found`,
|
|
788
|
+
displayMessage: `Error: no project named "${projectFilter}".`,
|
|
789
|
+
details: { project: projectFilter }
|
|
790
|
+
});
|
|
785
791
|
}
|
|
786
|
-
|
|
787
|
-
return;
|
|
792
|
+
projectIds = [project.id];
|
|
788
793
|
}
|
|
789
794
|
if (!isJson) {
|
|
790
795
|
const mode = isDryRun ? " [DRY RUN \u2014 no writes]" : "";
|
|
791
796
|
const scope = projectFilter ? `"${projectFilter}"` : "all projects";
|
|
792
|
-
process.stderr.write(`Re-classifying stored
|
|
797
|
+
process.stderr.write(`Re-classifying stored traffic under today's rules for ${scope}${mode}...
|
|
793
798
|
`);
|
|
794
799
|
}
|
|
795
|
-
const projectIds = scopedProjects.map((p) => p.id);
|
|
796
800
|
const countUnknown = () => Number(db.select({ n: sql`count(*)` }).from(rawEventSamples).where(and(
|
|
797
801
|
eq(rawEventSamples.eventType, RawEventSampleEventTypes.unknown),
|
|
798
|
-
inArray(rawEventSamples.projectId, projectIds)
|
|
802
|
+
projectIds ? inArray(rawEventSamples.projectId, projectIds) : void 0
|
|
799
803
|
)).get()?.n ?? 0);
|
|
800
804
|
const unknownBefore = countUnknown();
|
|
801
|
-
const stored = await reclassifyStoredTraffic(db, { projectIds, dryRun: isDryRun });
|
|
802
|
-
const
|
|
803
|
-
|
|
805
|
+
const stored = await reclassifyStoredTraffic(db, { projectIds, dryRun: isDryRun, allowVerificationLoss: true });
|
|
806
|
+
const { samples, dryRun, ...sections } = stored;
|
|
807
|
+
const byBot = { ...samples.byBot };
|
|
808
|
+
for (const moved of [sections.unrecognized.byBot, sections.crawlers.byBot]) {
|
|
809
|
+
for (const [bot, hits] of Object.entries(moved)) byBot[bot] = (byBot[bot] ?? 0) + hits;
|
|
810
|
+
}
|
|
804
811
|
emitTrafficClassificationReport({
|
|
805
812
|
project: projectFilter ?? null,
|
|
806
|
-
examined:
|
|
807
|
-
reclassified:
|
|
813
|
+
examined: samples.examined,
|
|
814
|
+
reclassified: samples.reclassified,
|
|
808
815
|
unknownBefore,
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
816
|
+
// A dry run writes nothing, so its count after is what the pass found.
|
|
817
|
+
unknownAfter: dryRun ? unknownBefore - samples.reclassified - samples.removed + sections.crawlers.samplesNowUnknown : countUnknown(),
|
|
818
|
+
samplesCounted: samples.counted,
|
|
819
|
+
samplesRemoved: samples.removed,
|
|
820
|
+
dryRun,
|
|
813
821
|
byBot,
|
|
814
|
-
|
|
815
|
-
agentHits: stored.agentHits,
|
|
816
|
-
agentRequests: stored.agentRequests,
|
|
817
|
-
journeys: stored.journeys,
|
|
818
|
-
journeyMerges: stored.journeyMerges
|
|
822
|
+
...sections
|
|
819
823
|
}, isJson);
|
|
820
824
|
}
|
|
825
|
+
function formatHitsByBot(byBot) {
|
|
826
|
+
return Object.entries(byBot).sort(([, a], [, b]) => b - a).map(([bot, hits]) => `${bot} ${hits}`).join(", ");
|
|
827
|
+
}
|
|
821
828
|
function emitTrafficClassificationReport(result, isJson) {
|
|
822
829
|
if (isJson) {
|
|
823
830
|
console.log(JSON.stringify(result, null, 2));
|
|
824
831
|
return;
|
|
825
832
|
}
|
|
826
833
|
const verb = result.dryRun ? "Would re-classify" : "Re-classified";
|
|
834
|
+
const indent = " ";
|
|
827
835
|
console.log(`
|
|
828
836
|
Traffic classification ${result.dryRun ? "preview" : "recovery"} complete.`);
|
|
829
837
|
console.log(` Examined unknowns: ${result.examined}`);
|
|
@@ -831,10 +839,17 @@ Traffic classification ${result.dryRun ? "preview" : "recovery"} complete.`);
|
|
|
831
839
|
console.log(` Unknown before: ${result.unknownBefore}`);
|
|
832
840
|
console.log(` Unknown after: ${result.unknownAfter}`);
|
|
833
841
|
console.log(` Unrecognized rows: ${result.unrecognized.examined} examined, ${result.unrecognized.moved} moved to a bot (${result.unrecognized.movedHits} hits), ${result.unrecognized.renamed} renamed, ${result.unrecognized.removed} removed`);
|
|
842
|
+
const { crawlers } = result;
|
|
843
|
+
console.log(` Crawler rows: ${crawlers.examined} examined; ${crawlers.moved} moved to the crawler their user agent names today (${crawlers.movedHits} hits), ${crawlers.toUserFetch} to AI user fetch (${crawlers.toUserFetchHits} hits), ${crawlers.toUnrecognized} back to unrecognized agents (${crawlers.toUnrecognizedHits} hits), ${crawlers.removed} of Canonry's own tools removed (${crawlers.removedHits} hits)`);
|
|
844
|
+
if (Object.keys(crawlers.byBot).length > 0) console.log(`${indent}Hits moved to: ${formatHitsByBot(crawlers.byBot)}`);
|
|
845
|
+
console.log(`${indent}${crawlers.unverifiedHits} verified hits no longer verified; ${crawlers.samplesRelabeled} samples relabeled (${crawlers.samplesNowUnknown} now unknown), ${crawlers.samplesRemoved} removed`);
|
|
846
|
+
if (crawlers.unknownBot > 0) console.log(`${indent}${crawlers.unknownBot} rows under a bot this version has no rule for (a newer release wrote them) left as they are`);
|
|
834
847
|
console.log(` Fake agent hits: ${result.agentHits.moved} hourly rows moved to likely fake (${result.agentHits.movedHits} hits)`);
|
|
835
848
|
console.log(` Agent requests: ${result.agentRequests.removed} removed (${result.agentRequests.probes} asked for a scanner path)`);
|
|
849
|
+
console.log(` Browser agent files: ${result.agentRequests.pageResources} stored requests its pages made by themselves removed`);
|
|
836
850
|
console.log(` Journeys: ${result.journeys.visitorsRemoved} visitors and ${result.journeys.visitsRemoved} visits removed, ${result.journeys.visitsRelanded} visits now start at a different page`);
|
|
837
851
|
console.log(` Split visitors: ${result.journeyMerges.visitorsMerged} joined to the same person's first visitor, seen from another IP (${result.journeyMerges.visitsJoined} visits merged)`);
|
|
852
|
+
if (result.orphans > 0) console.log(` Orphaned rows: ${result.orphans} left as they are: their project or traffic source no longer exists`);
|
|
838
853
|
if (Object.keys(result.byBot).length > 0) {
|
|
839
854
|
console.log(` By bot:`);
|
|
840
855
|
const sorted = Object.entries(result.byBot).sort(([, a], [, b]) => b - a);
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
dedupeGscSitemapUrls,
|
|
3
3
|
resolveDiscoveredGscSitemapUrls,
|
|
4
4
|
submitGscSitemapBatches
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DLZCOJCY.js";
|
|
6
6
|
import {
|
|
7
7
|
measurementDraftOperationSchema,
|
|
8
8
|
runMeasurementDraftAction
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-D76TB5JS.js";
|
|
10
10
|
import {
|
|
11
11
|
CliError
|
|
12
12
|
} from "./chunk-HGMYEDAQ.js";
|
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
trendSurfaceSchema,
|
|
196
196
|
visibilityCompareSelectionSchema,
|
|
197
197
|
visibilityReportRequestSchema
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-WT22Z3I7.js";
|
|
199
199
|
|
|
200
200
|
// src/mcp/tool-registry.ts
|
|
201
201
|
import { z as z2 } from "zod";
|
|
@@ -3222,7 +3222,7 @@ var rawCanonryMcpTools = [
|
|
|
3222
3222
|
defineTool({
|
|
3223
3223
|
name: "canonry_traffic_samples",
|
|
3224
3224
|
title: "Read stored traffic samples",
|
|
3225
|
-
description: "Read the stored sampled tail of server-side traffic with 30-day retention. Sample rows are not a count of visits. Default kind excludes unknown requests. Project/source only; Property, Target and market dimensions are unavailable. No provider call or write.",
|
|
3225
|
+
description: "Read the stored sampled tail of server-side traffic with 30-day retention. Sample rows are not a count of visits. Default kind excludes unknown requests. A browser agent's (Google-Agent, Claude-Agent) AI user fetch sample carries classifier.aiUserFetch.requestKind; unless it is likely fake, only a page sample was counted as an AI user fetch. Project/source only; Property, Target and market dimensions are unavailable. No provider call or write.",
|
|
3226
3226
|
access: "read",
|
|
3227
3227
|
tier: "traffic",
|
|
3228
3228
|
inputSchema: trafficSamplesQuerySchema.extend({ project: projectNameSchema }),
|
|
@@ -3373,7 +3373,7 @@ var rawCanonryMcpTools = [
|
|
|
3373
3373
|
defineTool({
|
|
3374
3374
|
name: "canonry_traffic_sync",
|
|
3375
3375
|
title: "Sync traffic source",
|
|
3376
|
-
description: "Pull a Cloud Run, WordPress, Vercel, or Cloudflare Queue traffic source, classify crawler / AI-referral / unknown traffic, and upsert hourly rollups plus raw samples. Time-window pulls clamp forward to lastSyncedAt. WordPress uses a fixed bounded window, defaults a new or idle source to 365d, validates the returned events remain inside that window, and serializes syncs with a source lease.",
|
|
3376
|
+
description: "Pull a Cloud Run, WordPress, Vercel, or Cloudflare Queue traffic source, classify crawler / AI user fetch / AI-referral / unknown traffic, and upsert hourly rollups plus raw samples. A browser agent's (Google-Agent, Claude-Agent) requests other than page loads go to no rollup; the result counts them in aiUserFetchBrowserNonPageHits. Time-window pulls clamp forward to lastSyncedAt. WordPress uses a fixed bounded window, defaults a new or idle source to 365d, validates the returned events remain inside that window, and serializes syncs with a source lease.",
|
|
3377
3377
|
access: "write",
|
|
3378
3378
|
tier: "traffic",
|
|
3379
3379
|
inputSchema: trafficSyncInputSchema,
|