@ainyc/canonry 4.82.0 → 4.83.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.
Files changed (22) hide show
  1. package/assets/assets/{BacklinksPage-CHclt-pq.js → BacklinksPage-OrSg_iPA.js} +1 -1
  2. package/assets/assets/{ChartPrimitives-2Ub4vNWe.js → ChartPrimitives-DPBhAT_r.js} +1 -1
  3. package/assets/assets/{ProjectPage-UPmHfuxR.js → ProjectPage-CpMcEmtw.js} +1 -1
  4. package/assets/assets/{RunRow-rUL1UeA3.js → RunRow-2Rty0BAH.js} +1 -1
  5. package/assets/assets/{RunsPage-BQpHfUJf.js → RunsPage-B3ahqf8s.js} +1 -1
  6. package/assets/assets/{SettingsPage-DjTJlr_1.js → SettingsPage-BIjeI85q.js} +1 -1
  7. package/assets/assets/{TrafficPage-D7rv3BrH.js → TrafficPage-DjGoj691.js} +1 -1
  8. package/assets/assets/{TrafficSourceDetailPage-BysyuH2H.js → TrafficSourceDetailPage-BgKG-2q3.js} +1 -1
  9. package/assets/assets/{arrow-left-CR_FGlkE.js → arrow-left-Cf7wmru1.js} +1 -1
  10. package/assets/assets/{extract-error-message-BKkAbWNp.js → extract-error-message-CANxezte.js} +1 -1
  11. package/assets/assets/{index-DzzTt20n.js → index-CGlPx_cu.js} +3 -3
  12. package/assets/assets/{trash-2-uSttujvh.js → trash-2-6nHJZrvy.js} +1 -1
  13. package/assets/index.html +1 -1
  14. package/dist/{chunk-KPSFRSS7.js → chunk-BNF3HXBW.js} +5 -0
  15. package/dist/{chunk-IEUTAQUF.js → chunk-GOWH42QV.js} +19 -1
  16. package/dist/{chunk-NSZ3D3MM.js → chunk-NRACXNI7.js} +15 -4
  17. package/dist/{chunk-JLAD6CYH.js → chunk-Y3O3HBMN.js} +1 -1
  18. package/dist/cli.js +8 -7
  19. package/dist/index.js +4 -4
  20. package/dist/{intelligence-service-2UUJ3YGI.js → intelligence-service-FHQM7YMA.js} +2 -2
  21. package/dist/mcp.js +2 -2
  22. package/package.json +10 -10
@@ -1872,6 +1872,11 @@ var discoveryProbeDtoSchema = z17.object({
1872
1872
  bucket: discoveryBucketSchema.nullable().default(null),
1873
1873
  citationState: citationStateSchema,
1874
1874
  citedDomains: z17.array(z17.string()).default([]),
1875
+ // Answer-text mention signal, independent of citationState. Tri-state: true
1876
+ // (named in the answer prose), false (probed, not named), null (unknown: a
1877
+ // legacy probe written before the engine computed it). Consumers must treat
1878
+ // null as unknown, never as false.
1879
+ answerMentioned: z17.boolean().nullable().default(null),
1875
1880
  createdAt: z17.string()
1876
1881
  });
1877
1882
  var discoverySessionDtoSchema = z17.object({
@@ -246,7 +246,7 @@ import {
246
246
  wordpressSchemaDeployResultDtoSchema,
247
247
  wordpressSchemaStatusResultDtoSchema,
248
248
  wordpressStatusDtoSchema
249
- } from "./chunk-KPSFRSS7.js";
249
+ } from "./chunk-BNF3HXBW.js";
250
250
 
251
251
  // src/intelligence-service.ts
252
252
  import { eq as eq36, desc as desc17, asc as asc5, and as and26, ne as ne5, or as or5, inArray as inArray13, gte as gte7, lte as lte4 } from "drizzle-orm";
@@ -1055,6 +1055,10 @@ var discoveryProbes = sqliteTable("discovery_probes", {
1055
1055
  query: text("query").notNull(),
1056
1056
  bucket: text("bucket"),
1057
1057
  citationState: text("citation_state").notNull(),
1058
+ // Answer-text mention signal, independent of citationState. Tri-state: true
1059
+ // (named in the answer prose), false (probed, not named), null (legacy rows
1060
+ // written before this column / never computed). Mirrors querySnapshots.answerMentioned.
1061
+ answerMentioned: integer("answer_mentioned", { mode: "boolean" }),
1058
1062
  citedDomains: text("cited_domains", { mode: "json" }).$type().notNull().default([]),
1059
1063
  rawResponse: text("raw_response"),
1060
1064
  createdAt: text("created_at").notNull()
@@ -3075,6 +3079,16 @@ var MIGRATION_VERSIONS = [
3075
3079
  run: (tx) => {
3076
3080
  addBacklinkSourceDiscriminator(tx);
3077
3081
  }
3082
+ },
3083
+ {
3084
+ // Answer-text mention signal on discovery probes (independent of citation).
3085
+ // Nullable: pre-existing rows were written before the column / never had the
3086
+ // mention computed, so they read back as null (unknown) downstream.
3087
+ version: 79,
3088
+ name: "discovery-probes-answer-mentioned",
3089
+ statements: [
3090
+ `ALTER TABLE discovery_probes ADD COLUMN answer_mentioned INTEGER`
3091
+ ]
3078
3092
  }
3079
3093
  ];
3080
3094
  function rebuildBacklinkTableWithSource(tx, table) {
@@ -32779,6 +32793,9 @@ function serializeProbe(row) {
32779
32793
  bucket: bucketParsed?.success ? bucketParsed.data : null,
32780
32794
  citationState: stateParsed.success ? stateParsed.data : "not-cited",
32781
32795
  citedDomains: row.citedDomains,
32796
+ // Boolean-mode column already reads back as boolean | null; a legacy row
32797
+ // written before the column is null (unknown), never coerced to false.
32798
+ answerMentioned: row.answerMentioned ?? null,
32782
32799
  createdAt: row.createdAt
32783
32800
  };
32784
32801
  }
@@ -32895,6 +32912,7 @@ async function executeDiscovery(opts) {
32895
32912
  query,
32896
32913
  bucket,
32897
32914
  citationState: probe.citationState,
32915
+ answerMentioned: probe.answerMentioned,
32898
32916
  citedDomains: probe.citedDomains,
32899
32917
  rawResponse: JSON.stringify(probe.rawResponse),
32900
32918
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
@@ -9,7 +9,7 @@ import {
9
9
  loadConfig,
10
10
  loadConfigRaw,
11
11
  saveConfigPatch
12
- } from "./chunk-JLAD6CYH.js";
12
+ } from "./chunk-Y3O3HBMN.js";
13
13
  import {
14
14
  CC_CACHE_DIR,
15
15
  DUCKDB_SPEC,
@@ -104,7 +104,7 @@ import {
104
104
  siteAuditPages,
105
105
  siteAuditSnapshots,
106
106
  usageCounters
107
- } from "./chunk-IEUTAQUF.js";
107
+ } from "./chunk-GOWH42QV.js";
108
108
  import {
109
109
  AGENT_MEMORY_VALUE_MAX_BYTES,
110
110
  AGENT_PROVIDER_IDS,
@@ -160,7 +160,7 @@ import {
160
160
  validationError,
161
161
  winnabilityClassLabel,
162
162
  withRetry
163
- } from "./chunk-KPSFRSS7.js";
163
+ } from "./chunk-BNF3HXBW.js";
164
164
 
165
165
  // src/telemetry.ts
166
166
  import crypto from "crypto";
@@ -5376,9 +5376,14 @@ async function executeDiscoveryRun(opts) {
5376
5376
  canonicalDomain: projectRow.canonicalDomain,
5377
5377
  ownedDomains: projectRow.ownedDomains
5378
5378
  });
5379
+ const brandNames = effectiveBrandNames({
5380
+ displayName: projectRow.displayName,
5381
+ aliases: projectRow.aliases
5382
+ });
5379
5383
  const project = {
5380
5384
  id: projectRow.id,
5381
5385
  name: projectRow.name,
5386
+ brandNames,
5382
5387
  canonicalDomains,
5383
5388
  competitorDomains: projectCompetitors
5384
5389
  };
@@ -5466,9 +5471,15 @@ function buildDefaultDeps(registry) {
5466
5471
  const normalized = adapter.normalizeResult(raw);
5467
5472
  const canonical = new Set(input.project.canonicalDomains.map((d) => d.toLowerCase()));
5468
5473
  const isCited = normalized.citedDomains.some((d) => canonical.has(d.toLowerCase()));
5474
+ const answerMentioned = determineAnswerMentioned(
5475
+ normalized.answerText,
5476
+ input.project.brandNames ?? [],
5477
+ input.project.canonicalDomains
5478
+ );
5469
5479
  return {
5470
5480
  citationState: isCited ? "cited" : "not-cited",
5471
5481
  citedDomains: normalized.citedDomains,
5482
+ answerMentioned,
5472
5483
  rawResponse: raw.rawResponse
5473
5484
  };
5474
5485
  },
@@ -6278,7 +6289,7 @@ function readStoredGroundingSources(rawResponse) {
6278
6289
  return result;
6279
6290
  }
6280
6291
  async function backfillInsightsCommand(project, opts) {
6281
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-2UUJ3YGI.js");
6292
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-FHQM7YMA.js");
6282
6293
  const config = loadConfig();
6283
6294
  const db = createClient(config.database);
6284
6295
  migrate(db);
@@ -23,7 +23,7 @@ import {
23
23
  trafficConnectVercelRequestSchema,
24
24
  trafficConnectWordpressRequestSchema,
25
25
  trafficEventKindSchema
26
- } from "./chunk-KPSFRSS7.js";
26
+ } from "./chunk-BNF3HXBW.js";
27
27
 
28
28
  // src/config.ts
29
29
  import fs from "fs";
package/dist/cli.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  setTelemetrySource,
28
28
  showFirstRunNotice,
29
29
  trackEvent
30
- } from "./chunk-NSZ3D3MM.js";
30
+ } from "./chunk-NRACXNI7.js";
31
31
  import {
32
32
  CliError,
33
33
  EXIT_SYSTEM_ERROR,
@@ -44,7 +44,7 @@ import {
44
44
  saveConfig,
45
45
  saveConfigPatch,
46
46
  usageError
47
- } from "./chunk-JLAD6CYH.js";
47
+ } from "./chunk-Y3O3HBMN.js";
48
48
  import {
49
49
  apiKeys,
50
50
  createClient,
@@ -52,7 +52,7 @@ import {
52
52
  projects,
53
53
  queries,
54
54
  renderReportHtml
55
- } from "./chunk-IEUTAQUF.js";
55
+ } from "./chunk-GOWH42QV.js";
56
56
  import {
57
57
  BacklinkSources,
58
58
  CcReleaseSyncStatuses,
@@ -76,7 +76,7 @@ import {
76
76
  providerQuotaPolicySchema,
77
77
  resolveProviderInput,
78
78
  winnabilityClassSchema
79
- } from "./chunk-KPSFRSS7.js";
79
+ } from "./chunk-BNF3HXBW.js";
80
80
 
81
81
  // src/cli.ts
82
82
  import { pathToFileURL } from "url";
@@ -1902,11 +1902,12 @@ function printSessionDetail(session) {
1902
1902
  if (session.probes && session.probes.length > 0) {
1903
1903
  const sorted = [...session.probes].sort((a, b) => (a.bucket ?? "").localeCompare(b.bucket ?? ""));
1904
1904
  console.log(`
1905
- Probes (${session.probes.length}):`);
1905
+ Probes (${session.probes.length}): (cell = [citation][mention]; C=cited c=not, M=mentioned m=not, \u2013=no data)`);
1906
1906
  for (const p of sorted) {
1907
1907
  const bucket = (p.bucket ?? "\u2013").padEnd(15);
1908
- const cit = p.citationState === "cited" ? "C" : "c";
1909
- console.log(` [${cit}] ${bucket} ${p.query}`);
1908
+ const citationGlyph = p.citationState === CitationStates.cited ? "C" : "c";
1909
+ const mentionGlyph = typeof p.answerMentioned === "boolean" ? p.answerMentioned ? "M" : "m" : "\u2013";
1910
+ console.log(` [${citationGlyph}${mentionGlyph}] ${bucket} ${p.query}`);
1910
1911
  }
1911
1912
  }
1912
1913
  }
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-NSZ3D3MM.js";
3
+ } from "./chunk-NRACXNI7.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-JLAD6CYH.js";
7
- import "./chunk-IEUTAQUF.js";
8
- import "./chunk-KPSFRSS7.js";
6
+ } from "./chunk-Y3O3HBMN.js";
7
+ import "./chunk-GOWH42QV.js";
8
+ import "./chunk-BNF3HXBW.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-IEUTAQUF.js";
4
- import "./chunk-KPSFRSS7.js";
3
+ } from "./chunk-GOWH42QV.js";
4
+ import "./chunk-BNF3HXBW.js";
5
5
  export {
6
6
  IntelligenceService
7
7
  };
package/dist/mcp.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  PACKAGE_VERSION,
4
4
  canonryMcpTools,
5
5
  createApiClient
6
- } from "./chunk-JLAD6CYH.js";
6
+ } from "./chunk-Y3O3HBMN.js";
7
7
  import {
8
8
  isReadOnlyKey
9
- } from "./chunk-KPSFRSS7.js";
9
+ } from "./chunk-BNF3HXBW.js";
10
10
 
11
11
  // src/mcp/cli.ts
12
12
  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.82.0",
3
+ "version": "4.83.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",
@@ -62,27 +62,27 @@
62
62
  "@types/node-cron": "^3.0.11",
63
63
  "tsup": "^8.5.1",
64
64
  "tsx": "^4.19.0",
65
- "@ainyc/canonry-api-routes": "0.0.0",
66
- "@ainyc/canonry-api-client": "0.0.0",
67
65
  "@ainyc/canonry-config": "0.0.0",
68
- "@ainyc/canonry-db": "0.0.0",
66
+ "@ainyc/canonry-api-client": "0.0.0",
67
+ "@ainyc/canonry-api-routes": "0.0.0",
69
68
  "@ainyc/canonry-contracts": "0.0.0",
70
- "@ainyc/canonry-integration-bing": "0.0.0",
69
+ "@ainyc/canonry-db": "0.0.0",
71
70
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
72
71
  "@ainyc/canonry-integration-cloud-run": "0.0.0",
72
+ "@ainyc/canonry-integration-bing": "0.0.0",
73
73
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
74
74
  "@ainyc/canonry-integration-google": "0.0.0",
75
- "@ainyc/canonry-integration-google-business-profile": "0.0.0",
76
75
  "@ainyc/canonry-integration-google-places": "0.0.0",
76
+ "@ainyc/canonry-integration-google-business-profile": "0.0.0",
77
77
  "@ainyc/canonry-integration-traffic": "0.0.0",
78
- "@ainyc/canonry-intelligence": "0.0.0",
79
- "@ainyc/canonry-provider-cdp": "0.0.0",
80
78
  "@ainyc/canonry-integration-wordpress": "0.0.0",
79
+ "@ainyc/canonry-provider-cdp": "0.0.0",
81
80
  "@ainyc/canonry-provider-claude": "0.0.0",
82
81
  "@ainyc/canonry-provider-gemini": "0.0.0",
82
+ "@ainyc/canonry-intelligence": "0.0.0",
83
83
  "@ainyc/canonry-provider-local": "0.0.0",
84
- "@ainyc/canonry-provider-perplexity": "0.0.0",
85
- "@ainyc/canonry-provider-openai": "0.0.0"
84
+ "@ainyc/canonry-provider-openai": "0.0.0",
85
+ "@ainyc/canonry-provider-perplexity": "0.0.0"
86
86
  },
87
87
  "scripts": {
88
88
  "build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",