@ainyc/canonry 4.10.1 → 4.11.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-BdAFw2Gy.js → index-DOcemxPD.js} +117 -117
- package/assets/index.html +1 -1
- package/dist/{chunk-XRDZ26OZ.js → chunk-3SFDZPKU.js} +1 -1
- package/dist/{chunk-GPJ3GLOE.js → chunk-565T7PMC.js} +69 -0
- package/dist/{chunk-GAC7BSL6.js → chunk-5J5BVJF7.js} +1 -1
- package/dist/{chunk-TNW6Z3TW.js → chunk-PBQ4Z4P4.js} +26 -7
- package/dist/cli.js +5 -5
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-TFDEKAOM.js → intelligence-service-XWOFLEHJ.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +9 -9
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-DOcemxPD.js"></script>
|
|
16
16
|
<link rel="stylesheet" crossorigin href="./assets/index-CGXCbiM_.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
@@ -1209,11 +1209,22 @@ var ga4AiReferralDtoSchema = z12.object({
|
|
|
1209
1209
|
medium: z12.string(),
|
|
1210
1210
|
sessions: z12.number(),
|
|
1211
1211
|
users: z12.number(),
|
|
1212
|
+
/**
|
|
1213
|
+
* The winning attribution dimension for this (source, medium) tuple — the
|
|
1214
|
+
* one with the highest session count. GA4 emits one row per dimension
|
|
1215
|
+
* (session, first_user, manual_utm), but they're overlapping lenses on the
|
|
1216
|
+
* same visit; only the dominant dimension is surfaced here so the table is
|
|
1217
|
+
* not inflated.
|
|
1218
|
+
*/
|
|
1212
1219
|
sourceDimension: ga4SourceDimensionSchema
|
|
1213
1220
|
});
|
|
1214
1221
|
var ga4AiReferralLandingPageDtoSchema = z12.object({
|
|
1215
1222
|
source: z12.string(),
|
|
1216
1223
|
medium: z12.string(),
|
|
1224
|
+
/**
|
|
1225
|
+
* The winning attribution dimension for this (source, medium, landingPage)
|
|
1226
|
+
* tuple — the one with the highest session count.
|
|
1227
|
+
*/
|
|
1217
1228
|
sourceDimension: ga4SourceDimensionSchema,
|
|
1218
1229
|
landingPage: z12.string(),
|
|
1219
1230
|
sessions: z12.number(),
|
|
@@ -2116,6 +2127,64 @@ var CodingAgents = codingAgentSchema.enum;
|
|
|
2116
2127
|
var skillsClientSchema = z19.enum(["claude", "codex", "all"]);
|
|
2117
2128
|
var SkillsClients = skillsClientSchema.enum;
|
|
2118
2129
|
|
|
2130
|
+
// ../contracts/src/traffic.ts
|
|
2131
|
+
import { z as z20 } from "zod";
|
|
2132
|
+
var trafficSourceTypeSchema = z20.enum([
|
|
2133
|
+
"cloud-run",
|
|
2134
|
+
"wordpress",
|
|
2135
|
+
"cloudflare",
|
|
2136
|
+
"vercel",
|
|
2137
|
+
"generic-log"
|
|
2138
|
+
]);
|
|
2139
|
+
var TrafficSourceTypes = trafficSourceTypeSchema.enum;
|
|
2140
|
+
var trafficAdapterCapabilitySchema = z20.enum([
|
|
2141
|
+
"raw-request-events",
|
|
2142
|
+
"aggregate-request-metrics",
|
|
2143
|
+
"request-url",
|
|
2144
|
+
"status-code",
|
|
2145
|
+
"user-agent",
|
|
2146
|
+
"remote-ip",
|
|
2147
|
+
"referer",
|
|
2148
|
+
"cursor-pull"
|
|
2149
|
+
]);
|
|
2150
|
+
var TrafficAdapterCapabilities = trafficAdapterCapabilitySchema.enum;
|
|
2151
|
+
var trafficEvidenceKindSchema = z20.enum(["raw-request", "aggregate-bucket"]);
|
|
2152
|
+
var TrafficEvidenceKinds = trafficEvidenceKindSchema.enum;
|
|
2153
|
+
var trafficEventConfidenceSchema = z20.enum(["observed", "provider-aggregated", "inferred"]);
|
|
2154
|
+
var TrafficEventConfidences = trafficEventConfidenceSchema.enum;
|
|
2155
|
+
var trafficProviderResourceSchema = z20.object({
|
|
2156
|
+
type: z20.string().nullable(),
|
|
2157
|
+
labels: z20.record(z20.string(), z20.string())
|
|
2158
|
+
});
|
|
2159
|
+
var normalizedTrafficRequestSchema = z20.object({
|
|
2160
|
+
sourceType: trafficSourceTypeSchema,
|
|
2161
|
+
evidenceKind: z20.literal(TrafficEvidenceKinds["raw-request"]),
|
|
2162
|
+
confidence: z20.literal(TrafficEventConfidences.observed),
|
|
2163
|
+
eventId: z20.string().min(1),
|
|
2164
|
+
observedAt: z20.string().min(1),
|
|
2165
|
+
method: z20.string().nullable(),
|
|
2166
|
+
requestUrl: z20.string().nullable(),
|
|
2167
|
+
host: z20.string().nullable(),
|
|
2168
|
+
path: z20.string().min(1),
|
|
2169
|
+
queryString: z20.string().nullable(),
|
|
2170
|
+
status: z20.number().int().nullable(),
|
|
2171
|
+
userAgent: z20.string().nullable(),
|
|
2172
|
+
remoteIp: z20.string().nullable(),
|
|
2173
|
+
referer: z20.string().nullable(),
|
|
2174
|
+
latencyMs: z20.number().nullable(),
|
|
2175
|
+
requestSizeBytes: z20.number().int().nullable(),
|
|
2176
|
+
responseSizeBytes: z20.number().int().nullable(),
|
|
2177
|
+
providerResource: trafficProviderResourceSchema,
|
|
2178
|
+
providerLabels: z20.record(z20.string(), z20.string())
|
|
2179
|
+
});
|
|
2180
|
+
var normalizedTrafficPullPageSchema = z20.object({
|
|
2181
|
+
events: z20.array(normalizedTrafficRequestSchema),
|
|
2182
|
+
rawEntryCount: z20.number().int().nonnegative(),
|
|
2183
|
+
skippedEntryCount: z20.number().int().nonnegative(),
|
|
2184
|
+
nextPageToken: z20.string().optional(),
|
|
2185
|
+
filter: z20.string()
|
|
2186
|
+
});
|
|
2187
|
+
|
|
2119
2188
|
export {
|
|
2120
2189
|
__export,
|
|
2121
2190
|
providerQuotaPolicySchema,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
configExists,
|
|
5
5
|
loadConfig,
|
|
6
6
|
saveConfigPatch
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5J5BVJF7.js";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_RUN_HISTORY_LIMIT,
|
|
10
10
|
IntelligenceService,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
runs,
|
|
62
62
|
schedules,
|
|
63
63
|
usageCounters
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-3SFDZPKU.js";
|
|
65
65
|
import {
|
|
66
66
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|
|
67
67
|
AGENT_PROVIDER_IDS,
|
|
@@ -137,7 +137,7 @@ import {
|
|
|
137
137
|
visibilityStateFromAnswerMentioned,
|
|
138
138
|
windowCutoff,
|
|
139
139
|
wordpressEnvSchema
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-565T7PMC.js";
|
|
141
141
|
|
|
142
142
|
// src/telemetry.ts
|
|
143
143
|
import crypto from "crypto";
|
|
@@ -12235,6 +12235,17 @@ function formatSharePct(numerator, total) {
|
|
|
12235
12235
|
if (rounded === 0) return "<1%";
|
|
12236
12236
|
return `${rounded}%`;
|
|
12237
12237
|
}
|
|
12238
|
+
function pickWinningDimension(rows, tupleKey) {
|
|
12239
|
+
const winners = /* @__PURE__ */ new Map();
|
|
12240
|
+
for (const row of rows) {
|
|
12241
|
+
const key = tupleKey(row);
|
|
12242
|
+
const existing = winners.get(key);
|
|
12243
|
+
if (!existing || (row.sessions ?? 0) > (existing.sessions ?? 0)) {
|
|
12244
|
+
winners.set(key, row);
|
|
12245
|
+
}
|
|
12246
|
+
}
|
|
12247
|
+
return [...winners.values()].sort((a, b) => (b.sessions ?? 0) - (a.sessions ?? 0));
|
|
12248
|
+
}
|
|
12238
12249
|
async function refreshOAuthTokenIfNeeded(googleStore, authConfig, canonicalDomain, oauthConn) {
|
|
12239
12250
|
const expiresAt = oauthConn.tokenExpiresAt ? new Date(oauthConn.tokenExpiresAt).getTime() : 0;
|
|
12240
12251
|
const fiveMinutes = 5 * 60 * 1e3;
|
|
@@ -12656,14 +12667,14 @@ async function ga4Routes(app, opts) {
|
|
|
12656
12667
|
directSessions: sql5`COALESCE(SUM(${gaTrafficSnapshots.directSessions}), 0)`,
|
|
12657
12668
|
users: sql5`SUM(${gaTrafficSnapshots.users})`
|
|
12658
12669
|
}).from(gaTrafficSnapshots).where(and9(...snapshotConditions)).groupBy(sql5`COALESCE(${gaTrafficSnapshots.landingPageNormalized}, ${gaTrafficSnapshots.landingPage})`).orderBy(sql5`SUM(${gaTrafficSnapshots.sessions}) DESC`).limit(limit).all();
|
|
12659
|
-
const
|
|
12670
|
+
const aiReferralRows = app.db.select({
|
|
12660
12671
|
source: gaAiReferrals.source,
|
|
12661
12672
|
medium: gaAiReferrals.medium,
|
|
12662
12673
|
sourceDimension: gaAiReferrals.sourceDimension,
|
|
12663
12674
|
sessions: sql5`SUM(${gaAiReferrals.sessions})`,
|
|
12664
12675
|
users: sql5`SUM(${gaAiReferrals.users})`
|
|
12665
|
-
}).from(gaAiReferrals).where(and9(...aiConditions)).groupBy(gaAiReferrals.source, gaAiReferrals.medium, gaAiReferrals.sourceDimension).
|
|
12666
|
-
const
|
|
12676
|
+
}).from(gaAiReferrals).where(and9(...aiConditions)).groupBy(gaAiReferrals.source, gaAiReferrals.medium, gaAiReferrals.sourceDimension).all();
|
|
12677
|
+
const aiReferralLandingPageRows = app.db.select({
|
|
12667
12678
|
source: gaAiReferrals.source,
|
|
12668
12679
|
medium: gaAiReferrals.medium,
|
|
12669
12680
|
sourceDimension: gaAiReferrals.sourceDimension,
|
|
@@ -12675,7 +12686,15 @@ async function ga4Routes(app, opts) {
|
|
|
12675
12686
|
gaAiReferrals.medium,
|
|
12676
12687
|
gaAiReferrals.sourceDimension,
|
|
12677
12688
|
sql5`COALESCE(${gaAiReferrals.landingPageNormalized}, ${gaAiReferrals.landingPage})`
|
|
12678
|
-
).
|
|
12689
|
+
).all();
|
|
12690
|
+
const aiReferrals = pickWinningDimension(
|
|
12691
|
+
aiReferralRows,
|
|
12692
|
+
(r) => `${r.source}\0${r.medium}`
|
|
12693
|
+
);
|
|
12694
|
+
const aiReferralLandingPages = pickWinningDimension(
|
|
12695
|
+
aiReferralLandingPageRows,
|
|
12696
|
+
(r) => `${r.source}\0${r.medium}\0${r.landingPage}`
|
|
12697
|
+
);
|
|
12679
12698
|
const aiDeduped = app.db.select({
|
|
12680
12699
|
sessions: sql5`COALESCE(SUM(max_sessions), 0)`,
|
|
12681
12700
|
users: sql5`COALESCE(SUM(max_users), 0)`
|
package/dist/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
setGoogleAuthConfig,
|
|
19
19
|
showFirstRunNotice,
|
|
20
20
|
trackEvent
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PBQ4Z4P4.js";
|
|
22
22
|
import {
|
|
23
23
|
CliError,
|
|
24
24
|
EXIT_SYSTEM_ERROR,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
saveConfig,
|
|
34
34
|
saveConfigPatch,
|
|
35
35
|
usageError
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-5J5BVJF7.js";
|
|
37
37
|
import {
|
|
38
38
|
apiKeys,
|
|
39
39
|
competitors,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
projects,
|
|
46
46
|
querySnapshots,
|
|
47
47
|
runs
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-3SFDZPKU.js";
|
|
49
49
|
import {
|
|
50
50
|
CcReleaseSyncStatuses,
|
|
51
51
|
CheckScopes,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
providerQuotaPolicySchema,
|
|
65
65
|
resolveProviderInput,
|
|
66
66
|
skillsClientSchema
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-565T7PMC.js";
|
|
68
68
|
|
|
69
69
|
// src/cli.ts
|
|
70
70
|
import { pathToFileURL } from "url";
|
|
@@ -580,7 +580,7 @@ function readStoredGroundingSources(rawResponse) {
|
|
|
580
580
|
return result;
|
|
581
581
|
}
|
|
582
582
|
async function backfillInsightsCommand(project, opts) {
|
|
583
|
-
const { IntelligenceService } = await import("./intelligence-service-
|
|
583
|
+
const { IntelligenceService } = await import("./intelligence-service-XWOFLEHJ.js");
|
|
584
584
|
const config = loadConfig();
|
|
585
585
|
const db = createClient(config.database);
|
|
586
586
|
migrate(db);
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PBQ4Z4P4.js";
|
|
4
4
|
import {
|
|
5
5
|
loadConfig
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5J5BVJF7.js";
|
|
7
|
+
import "./chunk-3SFDZPKU.js";
|
|
8
|
+
import "./chunk-565T7PMC.js";
|
|
9
9
|
export {
|
|
10
10
|
createServer,
|
|
11
11
|
loadConfig
|
package/dist/mcp.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
CliError,
|
|
3
3
|
canonryMcpTools,
|
|
4
4
|
createApiClient
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-5J5BVJF7.js";
|
|
6
|
+
import "./chunk-565T7PMC.js";
|
|
7
7
|
|
|
8
8
|
// src/mcp/cli.ts
|
|
9
9
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainyc/canonry",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.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
|
-
"@ainyc/canonry-config": "0.0.0",
|
|
64
62
|
"@ainyc/canonry-contracts": "0.0.0",
|
|
63
|
+
"@ainyc/canonry-api-routes": "0.0.0",
|
|
65
64
|
"@ainyc/canonry-db": "0.0.0",
|
|
66
|
-
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
67
65
|
"@ainyc/canonry-intelligence": "0.0.0",
|
|
66
|
+
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
68
67
|
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
69
|
-
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
70
68
|
"@ainyc/canonry-integration-google": "0.0.0",
|
|
71
|
-
"@ainyc/canonry-
|
|
69
|
+
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
70
|
+
"@ainyc/canonry-config": "0.0.0",
|
|
72
71
|
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
73
|
-
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
74
|
-
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
75
72
|
"@ainyc/canonry-provider-local": "0.0.0",
|
|
76
|
-
"@ainyc/canonry-provider-
|
|
73
|
+
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
74
|
+
"@ainyc/canonry-provider-perplexity": "0.0.0",
|
|
75
|
+
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
76
|
+
"@ainyc/canonry-provider-gemini": "0.0.0"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
79
79
|
"build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",
|