@ainyc/canonry 4.7.2 → 4.8.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/assets/{index-Ca3kZYGw.js → index-C2ZxtVjD.js} +68 -68
- package/assets/index.html +1 -1
- package/dist/{chunk-VDEMEI64.js → chunk-5KIFQH52.js} +1 -1
- package/dist/{chunk-XAW66QUX.js → chunk-IJEP6LB4.js} +78 -0
- package/dist/{chunk-DVTPGC6O.js → chunk-O4VXWABZ.js} +632 -178
- package/dist/{chunk-OOADR2Q5.js → chunk-QEPFB7UW.js} +48 -2
- package/dist/cli.js +5 -5
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-ABHO5HHA.js → intelligence-service-X7CBN7S4.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +9 -9
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
categoryLabel,
|
|
9
9
|
determineAnswerMentioned,
|
|
10
10
|
normalizeProjectDomain
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IJEP6LB4.js";
|
|
12
12
|
|
|
13
13
|
// src/intelligence-service.ts
|
|
14
14
|
import { eq, desc, asc, and, or, inArray } from "drizzle-orm";
|
|
@@ -2203,7 +2203,10 @@ function buildContentTargetRows(input) {
|
|
|
2203
2203
|
existingAction: input.inProgressActions.get(targetRef) ?? null
|
|
2204
2204
|
});
|
|
2205
2205
|
}
|
|
2206
|
-
return
|
|
2206
|
+
return dedupeByIntent(
|
|
2207
|
+
rows.sort((a, b) => b.score - a.score),
|
|
2208
|
+
input.queryIntentModifiers ?? []
|
|
2209
|
+
);
|
|
2207
2210
|
}
|
|
2208
2211
|
function buildContentSourceRows(input) {
|
|
2209
2212
|
return input.candidateQueries.map((cq) => ({
|
|
@@ -2274,6 +2277,49 @@ function computeAiReferralFactor(totalAiReferralSessions, competitorCount) {
|
|
|
2274
2277
|
const competitorBoost = competitorCount > 0 ? 0.1 : 0;
|
|
2275
2278
|
return Math.min(baseline + competitorBoost, 1);
|
|
2276
2279
|
}
|
|
2280
|
+
var QUERY_INTENT_STOPWORDS = /* @__PURE__ */ new Set([
|
|
2281
|
+
"a",
|
|
2282
|
+
"an",
|
|
2283
|
+
"and",
|
|
2284
|
+
"at",
|
|
2285
|
+
"by",
|
|
2286
|
+
"for",
|
|
2287
|
+
"from",
|
|
2288
|
+
"in",
|
|
2289
|
+
"near",
|
|
2290
|
+
"of",
|
|
2291
|
+
"on",
|
|
2292
|
+
"or",
|
|
2293
|
+
"the",
|
|
2294
|
+
"to"
|
|
2295
|
+
]);
|
|
2296
|
+
function dedupeByIntent(rows, modifiers) {
|
|
2297
|
+
if (rows.length <= 1 || modifiers.length === 0) return rows;
|
|
2298
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2299
|
+
const result = [];
|
|
2300
|
+
const modifierTokens = new Set(
|
|
2301
|
+
modifiers.flatMap(tokenizeQuery).map(normalizeToken).filter(Boolean)
|
|
2302
|
+
);
|
|
2303
|
+
for (const row of rows) {
|
|
2304
|
+
const key = intentKey(row.query, modifierTokens);
|
|
2305
|
+
if (!key || seen.has(key)) continue;
|
|
2306
|
+
seen.add(key);
|
|
2307
|
+
result.push(row);
|
|
2308
|
+
}
|
|
2309
|
+
return result;
|
|
2310
|
+
}
|
|
2311
|
+
function intentKey(query, modifierTokens) {
|
|
2312
|
+
const tokens = tokenizeQuery(query).map(normalizeToken).filter(Boolean).filter((token) => !QUERY_INTENT_STOPWORDS.has(token)).filter((token) => !modifierTokens.has(token));
|
|
2313
|
+
return [...new Set(tokens)].sort().join(" ");
|
|
2314
|
+
}
|
|
2315
|
+
function tokenizeQuery(value) {
|
|
2316
|
+
return value.toLowerCase().match(/[a-z0-9]+/g) ?? [];
|
|
2317
|
+
}
|
|
2318
|
+
function normalizeToken(token) {
|
|
2319
|
+
if (token.length > 4 && token.endsWith("ies")) return `${token.slice(0, -3)}y`;
|
|
2320
|
+
if (token.length > 4 && token.endsWith("s") && !token.endsWith("ss")) return token.slice(0, -1);
|
|
2321
|
+
return token;
|
|
2322
|
+
}
|
|
2277
2323
|
function pickTopCompetitor(competitors2) {
|
|
2278
2324
|
if (competitors2.length === 0) return null;
|
|
2279
2325
|
const top = [...competitors2].sort((a, b) => b.citationCount - a.citationCount)[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-O4VXWABZ.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-5KIFQH52.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-QEPFB7UW.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-IJEP6LB4.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-X7CBN7S4.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-O4VXWABZ.js";
|
|
4
4
|
import {
|
|
5
5
|
loadConfig
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5KIFQH52.js";
|
|
7
|
+
import "./chunk-QEPFB7UW.js";
|
|
8
|
+
import "./chunk-IJEP6LB4.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-5KIFQH52.js";
|
|
6
|
+
import "./chunk-IJEP6LB4.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.8.0",
|
|
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-contracts": "0.0.0",
|
|
63
62
|
"@ainyc/canonry-api-routes": "0.0.0",
|
|
63
|
+
"@ainyc/canonry-config": "0.0.0",
|
|
64
|
+
"@ainyc/canonry-contracts": "0.0.0",
|
|
64
65
|
"@ainyc/canonry-intelligence": "0.0.0",
|
|
65
|
-
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
66
66
|
"@ainyc/canonry-db": "0.0.0",
|
|
67
|
-
"@ainyc/canonry-integration-
|
|
67
|
+
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
68
68
|
"@ainyc/canonry-integration-google": "0.0.0",
|
|
69
|
-
"@ainyc/canonry-
|
|
70
|
-
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
69
|
+
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
71
70
|
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
72
71
|
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
73
|
-
"@ainyc/canonry-
|
|
72
|
+
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
74
73
|
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
75
|
-
"@ainyc/canonry-provider-
|
|
76
|
-
"@ainyc/canonry-provider-perplexity": "0.0.0"
|
|
74
|
+
"@ainyc/canonry-provider-local": "0.0.0",
|
|
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",
|