@ainyc/canonry 4.34.0 → 4.36.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/README.md +2 -2
- package/assets/assets/index-CAmKaZIt.js +302 -0
- package/assets/assets/index-CTrHzgs-.css +1 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-7AF6B3L6.js → chunk-F2G67CIU.js} +1412 -484
- package/dist/{chunk-7256SFYT.js → chunk-JQQXMCQ7.js} +286 -53
- package/dist/{chunk-5EBN7736.js → chunk-O7S623DL.js} +15 -1
- package/dist/{chunk-XW3F5EEW.js → chunk-XJVYVURK.js} +76 -21
- package/dist/cli.js +157 -586
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-3P2DMYRR.js → intelligence-service-7AWRUNI2.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +7 -7
- package/assets/assets/index-47V0U52s.js +0 -302
- package/assets/assets/index-CNKAwZMB.css +0 -1
|
@@ -99,8 +99,12 @@ var citationStateSchema = z2.enum(["cited", "not-cited"]);
|
|
|
99
99
|
var CitationStates = citationStateSchema.enum;
|
|
100
100
|
var visibilityStateSchema = z2.enum(["visible", "not-visible"]);
|
|
101
101
|
var VisibilityStates = visibilityStateSchema.enum;
|
|
102
|
+
var mentionStateSchema = z2.enum(["mentioned", "not-mentioned"]);
|
|
103
|
+
var MentionStates = mentionStateSchema.enum;
|
|
102
104
|
var computedTransitionSchema = z2.enum(["new", "cited", "lost", "emerging", "not-cited"]);
|
|
103
105
|
var ComputedTransitions = computedTransitionSchema.enum;
|
|
106
|
+
var mentionTransitionSchema = z2.enum(["new", "mentioned", "lost", "emerging", "not-mentioned"]);
|
|
107
|
+
var MentionTransitions = mentionTransitionSchema.enum;
|
|
104
108
|
var runTriggerRequestSchema = z2.object({
|
|
105
109
|
kind: z2.literal(RunKinds["answer-visibility"]).optional(),
|
|
106
110
|
trigger: z2.literal(RunTriggers.manual).optional(),
|
|
@@ -211,7 +215,10 @@ var querySnapshotDtoSchema = z2.object({
|
|
|
211
215
|
provider: providerNameSchema,
|
|
212
216
|
citationState: citationStateSchema,
|
|
213
217
|
answerMentioned: z2.boolean().optional(),
|
|
218
|
+
/** @deprecated legacy name for `mentionState`; same data, kept for backwards compatibility. */
|
|
214
219
|
visibilityState: visibilityStateSchema.optional(),
|
|
220
|
+
/** Mention state for this snapshot — see `mentionStateSchema`. Prefer this over the legacy `visibilityState`. */
|
|
221
|
+
mentionState: mentionStateSchema.optional(),
|
|
215
222
|
transition: computedTransitionSchema.optional(),
|
|
216
223
|
answerText: z2.string().nullable().optional(),
|
|
217
224
|
citedDomains: z2.array(z2.string()).default([]),
|
|
@@ -235,8 +242,14 @@ var snapshotDiffRowSchema = z2.object({
|
|
|
235
242
|
run2State: citationStateSchema.nullable(),
|
|
236
243
|
run1AnswerMentioned: z2.boolean().nullable(),
|
|
237
244
|
run2AnswerMentioned: z2.boolean().nullable(),
|
|
245
|
+
/** @deprecated legacy name for `run1MentionState`. */
|
|
238
246
|
run1VisibilityState: visibilityStateSchema.nullable(),
|
|
247
|
+
/** @deprecated legacy name for `run2MentionState`. */
|
|
239
248
|
run2VisibilityState: visibilityStateSchema.nullable(),
|
|
249
|
+
/** Mention state in run 1 — prefer this over the legacy `run1VisibilityState`. */
|
|
250
|
+
run1MentionState: mentionStateSchema.nullable().optional(),
|
|
251
|
+
/** Mention state in run 2 — prefer this over the legacy `run2VisibilityState`. */
|
|
252
|
+
run2MentionState: mentionStateSchema.nullable().optional(),
|
|
240
253
|
changed: z2.boolean(),
|
|
241
254
|
visibilityChanged: z2.boolean()
|
|
242
255
|
});
|
|
@@ -409,6 +422,7 @@ var projectUpsertRequestSchema = z4.object({
|
|
|
409
422
|
displayName: z4.string().min(1),
|
|
410
423
|
canonicalDomain: z4.string().min(1),
|
|
411
424
|
ownedDomains: z4.array(z4.string().min(1)).optional(),
|
|
425
|
+
aliases: z4.array(z4.string()).optional(),
|
|
412
426
|
country: z4.string().length(2),
|
|
413
427
|
language: z4.string().min(2),
|
|
414
428
|
tags: z4.array(z4.string()).optional(),
|
|
@@ -425,6 +439,7 @@ var projectDtoSchema = z4.object({
|
|
|
425
439
|
displayName: z4.string().optional(),
|
|
426
440
|
canonicalDomain: z4.string(),
|
|
427
441
|
ownedDomains: z4.array(z4.string()).default([]),
|
|
442
|
+
aliases: z4.array(z4.string()).default([]),
|
|
428
443
|
country: z4.string().length(2),
|
|
429
444
|
language: z4.string().min(2),
|
|
430
445
|
tags: z4.array(z4.string()).default([]),
|
|
@@ -548,6 +563,31 @@ function effectiveDomains(project) {
|
|
|
548
563
|
}
|
|
549
564
|
return result;
|
|
550
565
|
}
|
|
566
|
+
function normalizeProjectAliases(displayName, aliases) {
|
|
567
|
+
if (!aliases || aliases.length === 0) return [];
|
|
568
|
+
const displayKey = displayName?.trim().toLowerCase() ?? "";
|
|
569
|
+
const seen = /* @__PURE__ */ new Set();
|
|
570
|
+
const result = [];
|
|
571
|
+
for (const raw of aliases) {
|
|
572
|
+
const trimmed = raw.trim();
|
|
573
|
+
if (!trimmed) continue;
|
|
574
|
+
const key = trimmed.toLowerCase();
|
|
575
|
+
if (key === displayKey) continue;
|
|
576
|
+
if (seen.has(key)) continue;
|
|
577
|
+
seen.add(key);
|
|
578
|
+
result.push(trimmed);
|
|
579
|
+
}
|
|
580
|
+
return result;
|
|
581
|
+
}
|
|
582
|
+
function effectiveBrandNames(project) {
|
|
583
|
+
const names = [];
|
|
584
|
+
const display = project.displayName?.trim() ?? "";
|
|
585
|
+
if (display) names.push(display);
|
|
586
|
+
for (const alias of normalizeProjectAliases(project.displayName, project.aliases)) {
|
|
587
|
+
names.push(alias);
|
|
588
|
+
}
|
|
589
|
+
return names;
|
|
590
|
+
}
|
|
551
591
|
|
|
552
592
|
// ../contracts/src/config-schema.ts
|
|
553
593
|
var configMetadataSchema = z5.object({
|
|
@@ -584,6 +624,7 @@ var configSpecSchema = z5.object({
|
|
|
584
624
|
displayName: z5.string().min(1),
|
|
585
625
|
canonicalDomain: z5.string().min(1),
|
|
586
626
|
ownedDomains: z5.array(z5.string().min(1)).optional().default([]),
|
|
627
|
+
aliases: z5.array(z5.string().min(1)).optional().default([]),
|
|
587
628
|
country: z5.string().length(2),
|
|
588
629
|
language: z5.string().min(2),
|
|
589
630
|
queries: configQueryListSchema.optional(),
|
|
@@ -1407,7 +1448,7 @@ var BUSINESS_SUFFIXES = [
|
|
|
1407
1448
|
"inc",
|
|
1408
1449
|
"ltd"
|
|
1409
1450
|
];
|
|
1410
|
-
function extractAnswerMentions(answerText,
|
|
1451
|
+
function extractAnswerMentions(answerText, brandNames, domains) {
|
|
1411
1452
|
if (!answerText) return { mentioned: false, matchedTerms: [] };
|
|
1412
1453
|
const matchedTerms = [];
|
|
1413
1454
|
const lowerAnswer = answerText.toLowerCase();
|
|
@@ -1420,18 +1461,21 @@ function extractAnswerMentions(answerText, displayName, domains) {
|
|
|
1420
1461
|
}
|
|
1421
1462
|
const answerNormalized = normalizeText(answerText);
|
|
1422
1463
|
const answerBrandKey = brandKeyFromText(answerText);
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1464
|
+
for (const brandName of brandNames) {
|
|
1465
|
+
if (!brandName || !brandName.trim()) continue;
|
|
1466
|
+
const normalizedCandidates = brandNormalizedCandidates(brandName);
|
|
1467
|
+
const brandKeyCandidates = brandKeyCandidatesForMatch(brandName);
|
|
1468
|
+
const matchesNormalized = normalizedCandidates.some(
|
|
1469
|
+
(c) => new RegExp(`\\b${escapeRegExp(c)}\\b`).test(answerNormalized)
|
|
1470
|
+
);
|
|
1471
|
+
const matchesBrandKey = brandKeyCandidates.some(
|
|
1472
|
+
(c) => c.length >= MIN_BRAND_KEY_LENGTH && answerBrandKey.includes(c)
|
|
1473
|
+
);
|
|
1474
|
+
if (matchesNormalized || matchesBrandKey) {
|
|
1475
|
+
matchedTerms.push(brandName);
|
|
1476
|
+
}
|
|
1433
1477
|
}
|
|
1434
|
-
const brandTokens = collectBrandTokens(
|
|
1478
|
+
const brandTokens = collectBrandTokens(brandNames, domains);
|
|
1435
1479
|
const allTokens = [...brandTokens.primary, ...brandTokens.secondary];
|
|
1436
1480
|
const secondarySet = new Set(brandTokens.secondary);
|
|
1437
1481
|
let tokenMatches = 0;
|
|
@@ -1454,12 +1498,15 @@ function extractAnswerMentions(answerText, displayName, domains) {
|
|
|
1454
1498
|
});
|
|
1455
1499
|
return { mentioned: dedupedFinal.length > 0, matchedTerms: dedupedFinal };
|
|
1456
1500
|
}
|
|
1457
|
-
function determineAnswerMentioned(answerText,
|
|
1458
|
-
return extractAnswerMentions(answerText,
|
|
1501
|
+
function determineAnswerMentioned(answerText, brandNames, domains) {
|
|
1502
|
+
return extractAnswerMentions(answerText, brandNames, domains).mentioned;
|
|
1459
1503
|
}
|
|
1460
1504
|
function visibilityStateFromAnswerMentioned(answerMentioned) {
|
|
1461
1505
|
return answerMentioned ? "visible" : "not-visible";
|
|
1462
1506
|
}
|
|
1507
|
+
function mentionStateFromAnswerMentioned(answerMentioned) {
|
|
1508
|
+
return answerMentioned ? "mentioned" : "not-mentioned";
|
|
1509
|
+
}
|
|
1463
1510
|
function brandKeyFromText(value) {
|
|
1464
1511
|
return value.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
1465
1512
|
}
|
|
@@ -1472,14 +1519,17 @@ function domainMentioned(lowerAnswer, normalizedDomain) {
|
|
|
1472
1519
|
];
|
|
1473
1520
|
return patterns.some((pattern) => pattern.test(lowerAnswer));
|
|
1474
1521
|
}
|
|
1475
|
-
function collectBrandTokens(
|
|
1522
|
+
function collectBrandTokens(brandNames, domains) {
|
|
1476
1523
|
const primary = /* @__PURE__ */ new Set();
|
|
1477
1524
|
const secondary = /* @__PURE__ */ new Set();
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1525
|
+
for (const brandName of brandNames) {
|
|
1526
|
+
if (!brandName || !brandName.trim()) continue;
|
|
1527
|
+
const distinctiveWords = extractDistinctiveTokens(brandName);
|
|
1528
|
+
if (distinctiveWords.length > 0) {
|
|
1529
|
+
primary.add(distinctiveWords[0]);
|
|
1530
|
+
for (let i = 1; i < distinctiveWords.length; i++) {
|
|
1531
|
+
secondary.add(distinctiveWords[i]);
|
|
1532
|
+
}
|
|
1483
1533
|
}
|
|
1484
1534
|
}
|
|
1485
1535
|
for (const domain of domains) {
|
|
@@ -1808,7 +1858,9 @@ var checkCategorySchema = z17.enum([
|
|
|
1808
1858
|
"providers",
|
|
1809
1859
|
"integrations",
|
|
1810
1860
|
"database",
|
|
1811
|
-
"schedules"
|
|
1861
|
+
"schedules",
|
|
1862
|
+
/** Discoverability checks for agent integrations (skills installed, MCP setup). */
|
|
1863
|
+
"agent"
|
|
1812
1864
|
]);
|
|
1813
1865
|
var CheckCategories = checkCategorySchema.enum;
|
|
1814
1866
|
var checkResultSchema = z17.object({
|
|
@@ -2671,6 +2723,8 @@ export {
|
|
|
2671
2723
|
registrableDomain,
|
|
2672
2724
|
brandLabelFromDomain,
|
|
2673
2725
|
effectiveDomains,
|
|
2726
|
+
normalizeProjectAliases,
|
|
2727
|
+
effectiveBrandNames,
|
|
2674
2728
|
projectConfigSchema,
|
|
2675
2729
|
resolveConfigSpecQueries,
|
|
2676
2730
|
wordpressEnvSchema,
|
|
@@ -2700,6 +2754,7 @@ export {
|
|
|
2700
2754
|
extractAnswerMentions,
|
|
2701
2755
|
determineAnswerMentioned,
|
|
2702
2756
|
visibilityStateFromAnswerMentioned,
|
|
2757
|
+
mentionStateFromAnswerMentioned,
|
|
2703
2758
|
brandKeyFromText,
|
|
2704
2759
|
MemorySources,
|
|
2705
2760
|
AGENT_MEMORY_VALUE_MAX_BYTES,
|