@ainyc/canonry 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/assets/{index-Z2rYL3K8.js → index-D6R1HCPk.js} +2 -2
- package/assets/index.html +1 -1
- package/dist/{chunk-33ATDBGM.js → chunk-QJPPK4WW.js} +13 -1
- package/dist/{chunk-YGIWXQGM.js → chunk-TUXS2Y6C.js} +10 -0
- package/dist/cli.js +20 -10
- package/dist/index.js +2 -2
- package/dist/mcp.js +1 -1
- package/package.json +8 -8
package/assets/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-D6R1HCPk.js"></script>
|
|
16
16
|
<link rel="stylesheet" crossorigin href="./assets/index-DZm9xxNs.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
visibilityStateFromAnswerMentioned,
|
|
63
63
|
windowCutoff,
|
|
64
64
|
wordpressEnvSchema
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-TUXS2Y6C.js";
|
|
66
66
|
import {
|
|
67
67
|
IntelligenceService,
|
|
68
68
|
agentMemory,
|
|
@@ -8694,6 +8694,13 @@ function gaLog(level, action, ctx) {
|
|
|
8694
8694
|
const stream = level === "error" ? process.stderr : process.stdout;
|
|
8695
8695
|
stream.write(JSON.stringify(entry) + "\n");
|
|
8696
8696
|
}
|
|
8697
|
+
function formatSharePct(numerator, total) {
|
|
8698
|
+
if (total <= 0 || numerator <= 0) return "0%";
|
|
8699
|
+
const pct = numerator / total * 100;
|
|
8700
|
+
const rounded = Math.round(pct);
|
|
8701
|
+
if (rounded === 0) return "<1%";
|
|
8702
|
+
return `${rounded}%`;
|
|
8703
|
+
}
|
|
8697
8704
|
async function refreshOAuthTokenIfNeeded(googleStore, authConfig, canonicalDomain, oauthConn) {
|
|
8698
8705
|
const expiresAt = oauthConn.tokenExpiresAt ? new Date(oauthConn.tokenExpiresAt).getTime() : 0;
|
|
8699
8706
|
const fiveMinutes = 5 * 60 * 1e3;
|
|
@@ -9179,6 +9186,11 @@ async function ga4Routes(app, opts) {
|
|
|
9179
9186
|
aiSharePctBySession: total > 0 ? Math.round((aiBySession?.sessions ?? 0) / total * 100) : 0,
|
|
9180
9187
|
directSharePct: total > 0 ? Math.round(totalDirectSessions / total * 100) : 0,
|
|
9181
9188
|
socialSharePct: total > 0 ? Math.round((socialTotals?.sessions ?? 0) / total * 100) : 0,
|
|
9189
|
+
organicSharePctDisplay: formatSharePct(summaryRow?.totalOrganicSessions ?? 0, total),
|
|
9190
|
+
aiSharePctDisplay: formatSharePct(aiDeduped?.sessions ?? 0, total),
|
|
9191
|
+
aiSharePctBySessionDisplay: formatSharePct(aiBySession?.sessions ?? 0, total),
|
|
9192
|
+
directSharePctDisplay: formatSharePct(totalDirectSessions, total),
|
|
9193
|
+
socialSharePctDisplay: formatSharePct(socialTotals?.sessions ?? 0, total),
|
|
9182
9194
|
lastSyncedAt: latestSync?.syncedAt ?? null,
|
|
9183
9195
|
periodStart: (() => {
|
|
9184
9196
|
const start = cutoffDate ?? summaryMeta?.periodStart ?? null;
|
|
@@ -1342,6 +1342,16 @@ var ga4TrafficSummaryDtoSchema = z12.object({
|
|
|
1342
1342
|
directSharePct: z12.number(),
|
|
1343
1343
|
/** Social sessions as a percentage of total sessions (0–100, rounded). */
|
|
1344
1344
|
socialSharePct: z12.number(),
|
|
1345
|
+
/** Display string for organicSharePct ('10%' or '<1%' when there are sessions but the rounded pct is 0). */
|
|
1346
|
+
organicSharePctDisplay: z12.string(),
|
|
1347
|
+
/** Display string for aiSharePct ('5%' or '<1%' when there are sessions but the rounded pct is 0). */
|
|
1348
|
+
aiSharePctDisplay: z12.string(),
|
|
1349
|
+
/** Display string for aiSharePctBySession ('5%' or '<1%' when there are sessions but the rounded pct is 0). */
|
|
1350
|
+
aiSharePctBySessionDisplay: z12.string(),
|
|
1351
|
+
/** Display string for directSharePct ('20%' or '<1%' when there are sessions but the rounded pct is 0). */
|
|
1352
|
+
directSharePctDisplay: z12.string(),
|
|
1353
|
+
/** Display string for socialSharePct ('15%' or '<1%' when there are sessions but the rounded pct is 0). */
|
|
1354
|
+
socialSharePctDisplay: z12.string(),
|
|
1345
1355
|
lastSyncedAt: z12.string().nullable()
|
|
1346
1356
|
});
|
|
1347
1357
|
var ga4AiReferralHistoryEntrySchema = z12.object({
|
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
setGoogleAuthConfig,
|
|
18
18
|
showFirstRunNotice,
|
|
19
19
|
trackEvent
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QJPPK4WW.js";
|
|
21
21
|
import {
|
|
22
22
|
CcReleaseSyncStatuses,
|
|
23
23
|
CheckScopes,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
saveConfig,
|
|
46
46
|
saveConfigPatch,
|
|
47
47
|
usageError
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-TUXS2Y6C.js";
|
|
49
49
|
import {
|
|
50
50
|
apiKeys,
|
|
51
51
|
competitors,
|
|
@@ -2222,6 +2222,11 @@ async function gaAttribution(project, opts) {
|
|
|
2222
2222
|
socialSharePct: traffic.socialSharePct,
|
|
2223
2223
|
organicSharePct: traffic.organicSharePct,
|
|
2224
2224
|
directSharePct: traffic.directSharePct,
|
|
2225
|
+
organicSharePctDisplay: traffic.organicSharePctDisplay,
|
|
2226
|
+
aiSharePctDisplay: traffic.aiSharePctDisplay,
|
|
2227
|
+
aiSharePctBySessionDisplay: traffic.aiSharePctBySessionDisplay,
|
|
2228
|
+
socialSharePctDisplay: traffic.socialSharePctDisplay,
|
|
2229
|
+
directSharePctDisplay: traffic.directSharePctDisplay,
|
|
2225
2230
|
aiReferrals: traffic.aiReferrals,
|
|
2226
2231
|
aiReferralLandingPages: traffic.aiReferralLandingPages,
|
|
2227
2232
|
socialReferrals: traffic.socialReferrals,
|
|
@@ -2239,10 +2244,10 @@ async function gaAttribution(project, opts) {
|
|
|
2239
2244
|
console.log(` Total Users: ${traffic.totalUsers}`);
|
|
2240
2245
|
console.log();
|
|
2241
2246
|
console.log(" CHANNEL BREAKDOWN 7d trend 30d trend");
|
|
2242
|
-
console.log(` Organic Search: ${String(traffic.totalOrganicSessions).padEnd(6)} (${
|
|
2243
|
-
console.log(` Social: ${String(traffic.socialSessions).padEnd(6)} (${
|
|
2244
|
-
console.log(` Direct: ${String(traffic.totalDirectSessions).padEnd(6)} (${
|
|
2245
|
-
console.log(` AI Referrals: ${String(traffic.aiSessionsBySession).padEnd(6)} (${
|
|
2247
|
+
console.log(` Organic Search: ${String(traffic.totalOrganicSessions).padEnd(6)} (${traffic.organicSharePctDisplay.padStart(4)}) ${fmtTrend(trend.organic.trend7dPct).padEnd(12)} ${fmtTrend(trend.organic.trend30dPct)}`);
|
|
2248
|
+
console.log(` Social: ${String(traffic.socialSessions).padEnd(6)} (${traffic.socialSharePctDisplay.padStart(4)}) ${fmtTrend(trend.social.trend7dPct).padEnd(12)} ${fmtTrend(trend.social.trend30dPct)}`);
|
|
2249
|
+
console.log(` Direct: ${String(traffic.totalDirectSessions).padEnd(6)} (${traffic.directSharePctDisplay.padStart(4)}) ${fmtTrend(trend.direct.trend7dPct).padEnd(12)} ${fmtTrend(trend.direct.trend30dPct)}`);
|
|
2250
|
+
console.log(` AI Referrals: ${String(traffic.aiSessionsBySession).padEnd(6)} (${traffic.aiSharePctBySessionDisplay.padStart(4)}) ${fmtTrend(trend.ai.trend7dPct).padEnd(12)} ${fmtTrend(trend.ai.trend30dPct)} (lower bound \u2014 sessionSource only; referrer-stripped traffic falls under Direct)`);
|
|
2246
2251
|
const otherSessions2 = traffic.totalSessions - traffic.totalOrganicSessions - traffic.aiSessionsBySession - traffic.socialSessions - traffic.totalDirectSessions;
|
|
2247
2252
|
if (otherSessions2 > 0) {
|
|
2248
2253
|
const otherPct = traffic.totalSessions > 0 ? Math.round(otherSessions2 / traffic.totalSessions * 100) : 0;
|
|
@@ -2285,6 +2290,11 @@ async function gaAttribution(project, opts) {
|
|
|
2285
2290
|
socialSharePct: traffic.socialSharePct,
|
|
2286
2291
|
organicSharePct: traffic.organicSharePct,
|
|
2287
2292
|
directSharePct: traffic.directSharePct,
|
|
2293
|
+
organicSharePctDisplay: traffic.organicSharePctDisplay,
|
|
2294
|
+
aiSharePctDisplay: traffic.aiSharePctDisplay,
|
|
2295
|
+
aiSharePctBySessionDisplay: traffic.aiSharePctBySessionDisplay,
|
|
2296
|
+
socialSharePctDisplay: traffic.socialSharePctDisplay,
|
|
2297
|
+
directSharePctDisplay: traffic.directSharePctDisplay,
|
|
2288
2298
|
aiReferrals: traffic.aiReferrals,
|
|
2289
2299
|
aiReferralLandingPages: traffic.aiReferralLandingPages,
|
|
2290
2300
|
socialReferrals: traffic.socialReferrals,
|
|
@@ -2303,10 +2313,10 @@ async function gaAttribution(project, opts) {
|
|
|
2303
2313
|
console.log(` Total Users: ${traffic.totalUsers}`);
|
|
2304
2314
|
console.log();
|
|
2305
2315
|
console.log(" CHANNEL BREAKDOWN");
|
|
2306
|
-
console.log(` Organic Search: ${traffic.totalOrganicSessions} sessions (${traffic.
|
|
2307
|
-
console.log(` Social: ${traffic.socialSessions} sessions (${traffic.
|
|
2308
|
-
console.log(` Direct: ${traffic.totalDirectSessions} sessions (${traffic.
|
|
2309
|
-
console.log(` AI Referrals: ${traffic.aiSessionsBySession} sessions (${traffic.
|
|
2316
|
+
console.log(` Organic Search: ${traffic.totalOrganicSessions} sessions (${traffic.organicSharePctDisplay})`);
|
|
2317
|
+
console.log(` Social: ${traffic.socialSessions} sessions (${traffic.socialSharePctDisplay})`);
|
|
2318
|
+
console.log(` Direct: ${traffic.totalDirectSessions} sessions (${traffic.directSharePctDisplay})`);
|
|
2319
|
+
console.log(` AI Referrals: ${traffic.aiSessionsBySession} sessions (${traffic.aiSharePctBySessionDisplay}) (lower bound \u2014 sessionSource only; referrer-stripped traffic falls under Direct)`);
|
|
2310
2320
|
const otherSessions = traffic.totalSessions - traffic.totalOrganicSessions - traffic.aiSessionsBySession - traffic.socialSessions - traffic.totalDirectSessions;
|
|
2311
2321
|
if (otherSessions > 0) {
|
|
2312
2322
|
const otherPct = traffic.totalSessions > 0 ? Math.round(otherSessions / traffic.totalSessions * 100) : 0;
|
package/dist/index.js
CHANGED
package/dist/mcp.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainyc/canonry",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent-first open-source AEO operating platform - track how answer engines cite your domain",
|
|
6
6
|
"license": "FSL-1.1-ALv2",
|
|
@@ -59,21 +59,21 @@
|
|
|
59
59
|
"@types/node-cron": "^3.0.11",
|
|
60
60
|
"tsup": "^8.5.1",
|
|
61
61
|
"tsx": "^4.19.0",
|
|
62
|
-
"@ainyc/canonry-api-routes": "0.0.0",
|
|
63
62
|
"@ainyc/canonry-config": "0.0.0",
|
|
64
|
-
"@ainyc/canonry-
|
|
65
|
-
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
63
|
+
"@ainyc/canonry-api-routes": "0.0.0",
|
|
66
64
|
"@ainyc/canonry-db": "0.0.0",
|
|
67
|
-
"@ainyc/canonry-
|
|
65
|
+
"@ainyc/canonry-intelligence": "0.0.0",
|
|
68
66
|
"@ainyc/canonry-integration-google": "0.0.0",
|
|
69
67
|
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
68
|
+
"@ainyc/canonry-contracts": "0.0.0",
|
|
69
|
+
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
70
70
|
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
71
|
-
"@ainyc/canonry-
|
|
71
|
+
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
72
72
|
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
73
73
|
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
74
74
|
"@ainyc/canonry-provider-local": "0.0.0",
|
|
75
|
-
"@ainyc/canonry-provider-
|
|
76
|
-
"@ainyc/canonry-provider-
|
|
75
|
+
"@ainyc/canonry-provider-perplexity": "0.0.0",
|
|
76
|
+
"@ainyc/canonry-provider-openai": "0.0.0"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
79
79
|
"build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",
|