@ainyc/canonry 2.13.1 → 2.13.2

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.
@@ -59,7 +59,7 @@ import {
59
59
  visibilityStateFromAnswerMentioned,
60
60
  windowCutoff,
61
61
  wordpressEnvSchema
62
- } from "./chunk-2ROM4GUC.js";
62
+ } from "./chunk-XJS7NALL.js";
63
63
  import {
64
64
  IntelligenceService,
65
65
  agentMemory,
@@ -1367,6 +1367,22 @@ var GENERIC_TOKENS = /* @__PURE__ */ new Set([
1367
1367
  "systems",
1368
1368
  "tech"
1369
1369
  ]);
1370
+ var MIN_BRAND_KEY_LENGTH = 6;
1371
+ var BUSINESS_SUFFIXES = [
1372
+ "incorporated",
1373
+ "corporation",
1374
+ "limited",
1375
+ "company",
1376
+ "gmbh",
1377
+ "pllc",
1378
+ "corp",
1379
+ "group",
1380
+ "llp",
1381
+ "plc",
1382
+ "llc",
1383
+ "inc",
1384
+ "ltd"
1385
+ ];
1370
1386
  function extractAnswerMentions(answerText, displayName, domains) {
1371
1387
  if (!answerText) return { mentioned: false, matchedTerms: [] };
1372
1388
  const matchedTerms = [];
@@ -1378,8 +1394,15 @@ function extractAnswerMentions(answerText, displayName, domains) {
1378
1394
  matchedTerms.push(normalizedDomain);
1379
1395
  }
1380
1396
  }
1381
- const normalizedDisplayName = normalizeText(displayName);
1382
- if (normalizedDisplayName && normalizeText(answerText).includes(normalizedDisplayName)) {
1397
+ const answerNormalized = normalizeText(answerText);
1398
+ const answerBrandKey = brandKeyFromText(answerText);
1399
+ const normalizedCandidates = brandNormalizedCandidates(displayName);
1400
+ const brandKeyCandidates = brandKeyCandidatesForMatch(displayName);
1401
+ const matchesNormalized = normalizedCandidates.some((c) => answerNormalized.includes(c));
1402
+ const matchesBrandKey = brandKeyCandidates.some(
1403
+ (c) => c.length >= MIN_BRAND_KEY_LENGTH && answerBrandKey.includes(c)
1404
+ );
1405
+ if (matchesNormalized || matchesBrandKey) {
1383
1406
  matchedTerms.push(displayName);
1384
1407
  }
1385
1408
  const tokens = collectDistinctiveTokens(displayName, domains);
@@ -1445,6 +1468,29 @@ function isDistinctiveToken(token) {
1445
1468
  function normalizeText(value) {
1446
1469
  return value.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
1447
1470
  }
1471
+ function brandNormalizedCandidates(displayName) {
1472
+ const original = normalizeText(displayName);
1473
+ if (!original) return [];
1474
+ const stripped = stripBusinessSuffix(original, " ");
1475
+ if (!stripped || stripped === original) return [original];
1476
+ if (brandKeyFromText(stripped).length < MIN_BRAND_KEY_LENGTH) return [original];
1477
+ return [original, stripped];
1478
+ }
1479
+ function brandKeyCandidatesForMatch(displayName) {
1480
+ const original = brandKeyFromText(displayName);
1481
+ if (!original) return [];
1482
+ const stripped = stripBusinessSuffix(original, "");
1483
+ return stripped && stripped !== original ? [original, stripped] : [original];
1484
+ }
1485
+ function stripBusinessSuffix(value, separator) {
1486
+ for (const suffix of BUSINESS_SUFFIXES) {
1487
+ const trailing = `${separator}${suffix}`;
1488
+ if (value.endsWith(trailing) && value.length - trailing.length >= 3) {
1489
+ return value.slice(0, -trailing.length);
1490
+ }
1491
+ }
1492
+ return value;
1493
+ }
1448
1494
  function escapeRegExp(value) {
1449
1495
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1450
1496
  }
package/dist/cli.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  setGoogleAuthConfig,
18
18
  showFirstRunNotice,
19
19
  trackEvent
20
- } from "./chunk-X2F5CUCQ.js";
20
+ } from "./chunk-DHMCIJMQ.js";
21
21
  import {
22
22
  CcReleaseSyncStatuses,
23
23
  CheckScopes,
@@ -44,7 +44,7 @@ import {
44
44
  saveConfig,
45
45
  saveConfigPatch,
46
46
  usageError
47
- } from "./chunk-2ROM4GUC.js";
47
+ } from "./chunk-XJS7NALL.js";
48
48
  import {
49
49
  apiKeys,
50
50
  competitors,
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-X2F5CUCQ.js";
3
+ } from "./chunk-DHMCIJMQ.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-2ROM4GUC.js";
6
+ } from "./chunk-XJS7NALL.js";
7
7
  import "./chunk-UM6RDSRJ.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
  export {
package/dist/mcp.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  projectUpsertRequestSchema,
11
11
  runTriggerRequestSchema,
12
12
  scheduleUpsertRequestSchema
13
- } from "./chunk-2ROM4GUC.js";
13
+ } from "./chunk-XJS7NALL.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // src/mcp/cli.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainyc/canonry",
3
- "version": "2.13.1",
3
+ "version": "2.13.2",
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",
@@ -60,19 +60,19 @@
60
60
  "tsup": "^8.5.1",
61
61
  "tsx": "^4.19.0",
62
62
  "@ainyc/canonry-api-routes": "0.0.0",
63
+ "@ainyc/canonry-db": "0.0.0",
63
64
  "@ainyc/canonry-config": "0.0.0",
64
- "@ainyc/canonry-contracts": "0.0.0",
65
- "@ainyc/canonry-intelligence": "0.0.0",
66
65
  "@ainyc/canonry-integration-bing": "0.0.0",
66
+ "@ainyc/canonry-intelligence": "0.0.0",
67
67
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
68
- "@ainyc/canonry-db": "0.0.0",
69
68
  "@ainyc/canonry-integration-google": "0.0.0",
70
- "@ainyc/canonry-provider-claude": "0.0.0",
71
69
  "@ainyc/canonry-integration-wordpress": "0.0.0",
72
70
  "@ainyc/canonry-provider-cdp": "0.0.0",
73
- "@ainyc/canonry-provider-local": "0.0.0",
74
- "@ainyc/canonry-provider-openai": "0.0.0",
71
+ "@ainyc/canonry-provider-claude": "0.0.0",
72
+ "@ainyc/canonry-contracts": "0.0.0",
75
73
  "@ainyc/canonry-provider-gemini": "0.0.0",
74
+ "@ainyc/canonry-provider-openai": "0.0.0",
75
+ "@ainyc/canonry-provider-local": "0.0.0",
76
76
  "@ainyc/canonry-provider-perplexity": "0.0.0"
77
77
  },
78
78
  "scripts": {