@ainyc/canonry 4.2.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/index.html CHANGED
@@ -12,8 +12,8 @@
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-DoJfQkim.js"></script>
16
- <link rel="stylesheet" crossorigin href="./assets/index-D7T5wSBj.css">
15
+ <script type="module" crossorigin src="./assets/index-C2ZxtVjD.js"></script>
16
+ <link rel="stylesheet" crossorigin href="./assets/index-DAS6pOry.css">
17
17
  </head>
18
18
  <body>
19
19
  <div id="root"></div>
@@ -12,7 +12,7 @@ import {
12
12
  queryGenerateRequestSchema,
13
13
  runTriggerRequestSchema,
14
14
  scheduleUpsertRequestSchema
15
- } from "./chunk-T2I6AO7D.js";
15
+ } from "./chunk-IJEP6LB4.js";
16
16
 
17
17
  // src/config.ts
18
18
  import fs from "fs";
@@ -1176,7 +1176,7 @@ var canonryMcpTools = [
1176
1176
  defineTool({
1177
1177
  name: "canonry_report",
1178
1178
  title: "Get aggregated AEO report",
1179
- description: "Returns the full client-facing AEO report bundle for a project \u2014 executive summary, per-query \xD7 per-provider citation matrix, competitor landscape, AI citation sources, GSC/GA4 performance, social and AI referrals, indexing health, citations trend, prioritized insights, and recommended next steps. Same payload `canonry report <project>` consumes to render the self-contained HTML.",
1179
+ description: "Returns the full canonical AEO report bundle for a project \u2014 executive summary, client summary, agency diagnostics, action plan, per-query \xD7 per-provider citation matrix, competitor landscape, AI citation sources, GSC/GA4 performance, social and AI referrals, indexing health, citations trend, prioritized insights, and recommended next steps. Same payload `canonry report <project>` consumes to render audience-specific HTML.",
1180
1180
  access: "read",
1181
1181
  tier: "monitoring",
1182
1182
  inputSchema: projectInputSchema,
@@ -42,6 +42,39 @@ var locationContextSchema = z.object({
42
42
  country: z.string().length(2),
43
43
  timezone: z.string().optional()
44
44
  });
45
+ var PROVIDER_LOCATION_HANDLING = {
46
+ gemini: {
47
+ treatment: "prompt",
48
+ description: "Location appended to the query text the Gemini model receives."
49
+ },
50
+ perplexity: {
51
+ treatment: "prompt",
52
+ description: "Location appended to the query text the Perplexity model receives."
53
+ },
54
+ local: {
55
+ treatment: "prompt",
56
+ description: "Location appended to the system message sent to the local model."
57
+ },
58
+ openai: {
59
+ treatment: "request-param",
60
+ description: "Location sent as a structured `user_location` field on OpenAI\u2019s web_search_preview tool."
61
+ },
62
+ claude: {
63
+ treatment: "request-param",
64
+ description: "Location sent as a structured `user_location` field on Anthropic\u2019s web_search_20250305 tool."
65
+ },
66
+ "cdp:chatgpt": {
67
+ treatment: "browser-geo",
68
+ description: "CDP relies on the browser session\u2019s own geolocation; canonry\u2019s configured location is not forwarded."
69
+ }
70
+ };
71
+ var UNKNOWN_PROVIDER_HANDLING = {
72
+ treatment: "ignored",
73
+ description: "No documented location handling for this provider \u2014 assume the configured location was not applied."
74
+ };
75
+ function getProviderLocationHandling(provider) {
76
+ return PROVIDER_LOCATION_HANDLING[provider] ?? UNKNOWN_PROVIDER_HANDLING;
77
+ }
45
78
 
46
79
  // ../contracts/src/run.ts
47
80
  var runStatusSchema = z2.enum(["queued", "running", "completed", "partial", "failed", "cancelled"]);
@@ -1030,6 +1063,29 @@ function windowCutoff(window) {
1030
1063
 
1031
1064
  // ../contracts/src/source-categories.ts
1032
1065
  var SOURCE_CATEGORY_RULES = [
1066
+ // Directories, marketplaces & review platforms — generic across industries.
1067
+ // Industry-specific directories (NRCA, GAF, etc.) intentionally omitted;
1068
+ // they would slip past for the next vertical and create maintenance churn.
1069
+ { pattern: "yelp.com", category: "directory", label: "Yelp" },
1070
+ { pattern: "angi.com", category: "directory", label: "Angi" },
1071
+ { pattern: "angieslist.com", category: "directory", label: "Angi" },
1072
+ { pattern: "homeadvisor.com", category: "directory", label: "HomeAdvisor" },
1073
+ { pattern: "bbb.org", category: "directory", label: "Better Business Bureau" },
1074
+ { pattern: "trustpilot.com", category: "directory", label: "Trustpilot" },
1075
+ { pattern: "houzz.com", category: "directory", label: "Houzz" },
1076
+ { pattern: "thumbtack.com", category: "directory", label: "Thumbtack" },
1077
+ { pattern: "nextdoor.com", category: "directory", label: "Nextdoor" },
1078
+ { pattern: "yellowpages.com", category: "directory", label: "Yellow Pages" },
1079
+ { pattern: "manta.com", category: "directory", label: "Manta" },
1080
+ { pattern: "foursquare.com", category: "directory", label: "Foursquare" },
1081
+ { pattern: "g2.com", category: "directory", label: "G2" },
1082
+ { pattern: "capterra.com", category: "directory", label: "Capterra" },
1083
+ { pattern: "getapp.com", category: "directory", label: "GetApp" },
1084
+ { pattern: "softwareadvice.com", category: "directory", label: "Software Advice" },
1085
+ { pattern: "trustradius.com", category: "directory", label: "TrustRadius" },
1086
+ { pattern: "producthunt.com", category: "directory", label: "Product Hunt" },
1087
+ { pattern: "glassdoor.com", category: "directory", label: "Glassdoor" },
1088
+ { pattern: "indeed.com", category: "directory", label: "Indeed" },
1033
1089
  // Forums
1034
1090
  { pattern: "reddit.com", category: "forum", label: "Reddit" },
1035
1091
  { pattern: "quora.com", category: "forum", label: "Quora" },
@@ -1090,6 +1146,8 @@ var SOURCE_CATEGORY_RULES = [
1090
1146
  { pattern: ".edu", category: "academic", label: "Academic (.edu)" }
1091
1147
  ];
1092
1148
  var CATEGORY_LABELS = {
1149
+ competitor: "Tracked competitors",
1150
+ directory: "Directories & review sites",
1093
1151
  social: "Social Media",
1094
1152
  forum: "Forums & Q&A",
1095
1153
  news: "News & Media",
@@ -1098,7 +1156,7 @@ var CATEGORY_LABELS = {
1098
1156
  ecommerce: "E-commerce",
1099
1157
  video: "Video",
1100
1158
  academic: "Academic",
1101
- other: "Other"
1159
+ other: "Independent sites"
1102
1160
  };
1103
1161
  function categorizeSource(uri) {
1104
1162
  let domain;
@@ -1116,6 +1174,13 @@ function categorizeSource(uri) {
1116
1174
  }
1117
1175
  return { category: "other", label: CATEGORY_LABELS.other, domain };
1118
1176
  }
1177
+ function categorizeSourceWithCompetitors(uri, competitorDomains, isCompetitorMatch) {
1178
+ const base = categorizeSource(uri);
1179
+ if (isCompetitorMatch(base.domain, competitorDomains)) {
1180
+ return { category: "competitor", label: CATEGORY_LABELS.competitor, domain: base.domain };
1181
+ }
1182
+ return base;
1183
+ }
1119
1184
  function categoryLabel(category) {
1120
1185
  return CATEGORY_LABELS[category];
1121
1186
  }
@@ -1543,10 +1608,32 @@ var projectSearchResponseSchema = z15.object({
1543
1608
  import { z as z16 } from "zod";
1544
1609
  var contentActionSchema = z16.enum(["create", "expand", "refresh", "add-schema"]);
1545
1610
  var ContentActions = contentActionSchema.enum;
1611
+ function contentActionLabel(action) {
1612
+ switch (action) {
1613
+ case "create":
1614
+ return "Create";
1615
+ case "expand":
1616
+ return "Expand";
1617
+ case "refresh":
1618
+ return "Refresh";
1619
+ case "add-schema":
1620
+ return "Add schema";
1621
+ }
1622
+ }
1546
1623
  var demandSourceSchema = z16.enum(["gsc", "competitor-evidence", "both"]);
1547
1624
  var DemandSources = demandSourceSchema.enum;
1548
1625
  var actionConfidenceSchema = z16.enum(["high", "medium", "low"]);
1549
1626
  var ActionConfidences = actionConfidenceSchema.enum;
1627
+ function actionConfidenceLabel(confidence) {
1628
+ switch (confidence) {
1629
+ case "high":
1630
+ return "High";
1631
+ case "medium":
1632
+ return "Medium";
1633
+ case "low":
1634
+ return "Low";
1635
+ }
1636
+ }
1550
1637
  var pageTypeSchema = z16.enum([
1551
1638
  "blog-post",
1552
1639
  "comparison",
@@ -1897,6 +1984,64 @@ function citationStateToCited(state) {
1897
1984
  return state === "cited";
1898
1985
  }
1899
1986
 
1987
+ // ../contracts/src/report.ts
1988
+ function reportActionTone(action) {
1989
+ if (action.horizon === "immediate") return "negative";
1990
+ if (action.confidence === "high") return "caution";
1991
+ if (action.confidence === "low") return "neutral";
1992
+ return "caution";
1993
+ }
1994
+ function reportSeverityLabel(severity) {
1995
+ switch (severity) {
1996
+ case "critical":
1997
+ return "Critical";
1998
+ case "high":
1999
+ return "High";
2000
+ case "medium":
2001
+ return "Medium";
2002
+ case "low":
2003
+ return "Low";
2004
+ }
2005
+ }
2006
+ function reportHorizonLabel(horizon) {
2007
+ switch (horizon) {
2008
+ case "immediate":
2009
+ return "Immediate";
2010
+ case "short-term":
2011
+ return "Short term";
2012
+ case "medium-term":
2013
+ return "Medium term";
2014
+ }
2015
+ }
2016
+ function reportActionCategoryLabel(category) {
2017
+ switch (category) {
2018
+ case "content":
2019
+ return "Content";
2020
+ case "competitors":
2021
+ return "Competitors";
2022
+ case "provider":
2023
+ return "Provider";
2024
+ case "search-demand":
2025
+ return "Search demand";
2026
+ case "indexing":
2027
+ return "Indexing";
2028
+ case "location":
2029
+ return "Location";
2030
+ case "monitoring":
2031
+ return "Monitoring";
2032
+ }
2033
+ }
2034
+ function reportConfidenceLabel(confidence) {
2035
+ switch (confidence) {
2036
+ case "high":
2037
+ return "High";
2038
+ case "medium":
2039
+ return "Medium";
2040
+ case "low":
2041
+ return "Low";
2042
+ }
2043
+ }
2044
+
1900
2045
  // ../contracts/src/skills.ts
1901
2046
  import { z as z19 } from "zod";
1902
2047
  var codingAgentSchema = z19.enum(["claude", "codex"]);
@@ -1911,6 +2056,7 @@ export {
1911
2056
  isBrowserProvider,
1912
2057
  resolveProviderInput,
1913
2058
  locationContextSchema,
2059
+ getProviderLocationHandling,
1914
2060
  notificationEventSchema,
1915
2061
  notificationCreateRequestSchema,
1916
2062
  findDuplicateLocationLabels,
@@ -1960,6 +2106,7 @@ export {
1960
2106
  parseWindow,
1961
2107
  windowCutoff,
1962
2108
  categorizeSource,
2109
+ categorizeSourceWithCompetitors,
1963
2110
  categoryLabel,
1964
2111
  extractAnswerMentions,
1965
2112
  determineAnswerMentioned,
@@ -1972,6 +2119,8 @@ export {
1972
2119
  agentMemoryDeleteRequestSchema,
1973
2120
  CcReleaseSyncStatuses,
1974
2121
  ContentActions,
2122
+ contentActionLabel,
2123
+ actionConfidenceLabel,
1975
2124
  CheckStatuses,
1976
2125
  CheckScopes,
1977
2126
  CheckCategories,
@@ -1980,6 +2129,11 @@ export {
1980
2129
  normalizeUrlPath,
1981
2130
  emptyCitationVisibility,
1982
2131
  citationStateToCited,
2132
+ reportActionTone,
2133
+ reportSeverityLabel,
2134
+ reportHorizonLabel,
2135
+ reportActionCategoryLabel,
2136
+ reportConfidenceLabel,
1983
2137
  CodingAgents,
1984
2138
  skillsClientSchema,
1985
2139
  SkillsClients