@ainyc/canonry 4.80.0 → 4.81.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 (25) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +20 -12
  2. package/assets/assets/{BacklinksPage-dRc62jAY.js → BacklinksPage-DHShKKpo.js} +1 -1
  3. package/assets/assets/{ChartPrimitives-D2_IvTkk.js → ChartPrimitives-udHScxjY.js} +1 -1
  4. package/assets/assets/ProjectPage-BsS1anh7.js +6 -0
  5. package/assets/assets/{RunRow-C0MA3yuQ.js → RunRow-CXyPHMVQ.js} +1 -1
  6. package/assets/assets/{RunsPage-4uxTYgGy.js → RunsPage-BpQ_NpFt.js} +1 -1
  7. package/assets/assets/{SettingsPage-3-SLhcJ7.js → SettingsPage-1ep4ch7n.js} +1 -1
  8. package/assets/assets/{TrafficPage-DZ50qwme.js → TrafficPage-C3Hx-sE7.js} +1 -1
  9. package/assets/assets/TrafficSourceDetailPage-B26n2R6G.js +1 -0
  10. package/assets/assets/{arrow-left-BaZIkAXX.js → arrow-left-Dc_IPJxw.js} +1 -1
  11. package/assets/assets/{extract-error-message-cpvfuFqW.js → extract-error-message-B3PoKkHW.js} +1 -1
  12. package/assets/assets/{index-EnY_OBRd.js → index-DhdFTQkU.js} +86 -86
  13. package/assets/assets/{trash-2-JpcztiS5.js → trash-2-BQ69cGl0.js} +1 -1
  14. package/assets/index.html +1 -1
  15. package/dist/{chunk-2QBSRHSN.js → chunk-6XOZSS3Y.js} +72 -8
  16. package/dist/{chunk-AVN6Q6LM.js → chunk-GMT3YPLT.js} +76 -2
  17. package/dist/{chunk-CXIGHPBE.js → chunk-UAQ42NVJ.js} +440 -123
  18. package/dist/{chunk-LCABGFYN.js → chunk-VX5C7DK7.js} +404 -242
  19. package/dist/cli.js +103 -8
  20. package/dist/index.js +4 -4
  21. package/dist/{intelligence-service-ZWW3I3NL.js → intelligence-service-CAAQAKPN.js} +2 -2
  22. package/dist/mcp.js +2 -2
  23. package/package.json +8 -8
  24. package/assets/assets/ProjectPage-DSuvRUIf.js +0 -6
  25. package/assets/assets/TrafficSourceDetailPage-CzK5TMFp.js +0 -1
@@ -1 +1 @@
1
- import{c}from"./index-EnY_OBRd.js";const a=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],h=c("circle-check",a);const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],n=c("circle-question-mark",e);const o=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],s=c("download",o);const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],r=c("trash-2",t);export{h as C,s as D,r as T,n as a};
1
+ import{c}from"./index-DhdFTQkU.js";const a=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],h=c("circle-check",a);const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],n=c("circle-question-mark",e);const o=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],s=c("download",o);const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],r=c("trash-2",t);export{h as C,s as D,r as T,n as a};
package/assets/index.html CHANGED
@@ -12,7 +12,7 @@
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-EnY_OBRd.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-DhdFTQkU.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-Dq7p98wZ.js">
17
17
  <link rel="modulepreload" crossorigin href="./assets/vendor-radix-B57xfQbP.js">
18
18
  <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-ClRVR6aX.js">
@@ -2,6 +2,7 @@ import {
2
2
  AGENT_MEMORY_KEY_MAX_LENGTH,
3
3
  AGENT_MEMORY_VALUE_MAX_BYTES,
4
4
  DISCOVERY_MAX_PROBES_CAP,
5
+ backlinkSourceSchema,
5
6
  competitorBatchRequestSchema,
6
7
  discoveryBucketSchema,
7
8
  discoveryCompetitorTypeSchema,
@@ -22,7 +23,7 @@ import {
22
23
  trafficConnectVercelRequestSchema,
23
24
  trafficConnectWordpressRequestSchema,
24
25
  trafficEventKindSchema
25
- } from "./chunk-AVN6Q6LM.js";
26
+ } from "./chunk-GMT3YPLT.js";
26
27
 
27
28
  // src/config.ts
28
29
  import fs from "fs";
@@ -3221,6 +3222,30 @@ var getApiV1ProjectsByNameBacklinksHistory = (options) => {
3221
3222
  ...options
3222
3223
  });
3223
3224
  };
3225
+ var getApiV1ProjectsByNameBacklinksSources = (options) => {
3226
+ return (options.client ?? client).get({
3227
+ security: [
3228
+ {
3229
+ scheme: "bearer",
3230
+ type: "http"
3231
+ }
3232
+ ],
3233
+ url: "/api/v1/projects/{name}/backlinks/sources",
3234
+ ...options
3235
+ });
3236
+ };
3237
+ var postApiV1ProjectsByNameBacklinksBingSync = (options) => {
3238
+ return (options.client ?? client).post({
3239
+ security: [
3240
+ {
3241
+ scheme: "bearer",
3242
+ type: "http"
3243
+ }
3244
+ ],
3245
+ url: "/api/v1/projects/{name}/backlinks/bing-sync",
3246
+ ...options
3247
+ });
3248
+ };
3224
3249
  var postApiV1ProjectsByNameTrafficConnectCloudRun = (options) => {
3225
3250
  return (options.client ?? client).post({
3226
3251
  security: [
@@ -5060,6 +5085,23 @@ var ApiClient = class {
5060
5085
  })
5061
5086
  );
5062
5087
  }
5088
+ async backlinksBingSync(project) {
5089
+ return this.invoke(
5090
+ () => postApiV1ProjectsByNameBacklinksBingSync({
5091
+ client: this.heyClient,
5092
+ path: { name: project }
5093
+ })
5094
+ );
5095
+ }
5096
+ async backlinksSources(project, opts = {}) {
5097
+ return this.invoke(
5098
+ () => getApiV1ProjectsByNameBacklinksSources({
5099
+ client: this.heyClient,
5100
+ path: { name: project },
5101
+ query: { excludeCrawlers: opts.excludeCrawlers ? "1" : void 0 }
5102
+ })
5103
+ );
5104
+ }
5063
5105
  async backlinksSummary(project, opts = {}) {
5064
5106
  return this.invoke(
5065
5107
  () => getApiV1ProjectsByNameBacklinksSummary({
@@ -5067,7 +5109,8 @@ var ApiClient = class {
5067
5109
  path: { name: project },
5068
5110
  query: {
5069
5111
  release: opts.release,
5070
- excludeCrawlers: opts.excludeCrawlers ? "1" : void 0
5112
+ excludeCrawlers: opts.excludeCrawlers ? "1" : void 0,
5113
+ source: opts.source
5071
5114
  }
5072
5115
  })
5073
5116
  );
@@ -5081,14 +5124,19 @@ var ApiClient = class {
5081
5124
  limit: opts.limit,
5082
5125
  offset: opts.offset,
5083
5126
  release: opts.release,
5084
- excludeCrawlers: opts.excludeCrawlers ? "1" : void 0
5127
+ excludeCrawlers: opts.excludeCrawlers ? "1" : void 0,
5128
+ source: opts.source
5085
5129
  }
5086
5130
  })
5087
5131
  );
5088
5132
  }
5089
- async backlinksHistory(project) {
5133
+ async backlinksHistory(project, opts = {}) {
5090
5134
  return this.invoke(
5091
- () => getApiV1ProjectsByNameBacklinksHistory({ client: this.heyClient, path: { name: project } })
5135
+ () => getApiV1ProjectsByNameBacklinksHistory({
5136
+ client: this.heyClient,
5137
+ path: { name: project },
5138
+ query: { source: opts.source }
5139
+ })
5092
5140
  );
5093
5141
  }
5094
5142
  };
@@ -5332,7 +5380,11 @@ var contentMapInputSchema = z2.object({
5332
5380
  var backlinksDomainsInputSchema = z2.object({
5333
5381
  project: projectNameSchema,
5334
5382
  limit: z2.number().int().positive().max(200).optional().describe("Max linking-domain rows. Default 50, max 200."),
5335
- release: z2.string().optional().describe("Common Crawl release id (e.g., cc-main-2026-jan-feb-mar). Omit for the most recent release with data.")
5383
+ release: z2.string().optional().describe("Window id (Common Crawl release e.g. cc-main-2026-jan-feb-mar, or Bing window e.g. bing-2026-06-15). Omit for the most recent window with data."),
5384
+ source: backlinkSourceSchema.optional().describe("Backlink source: commoncrawl (default) or bing-webmaster.")
5385
+ });
5386
+ var backlinksSourcesInputSchema = z2.object({
5387
+ project: projectNameSchema
5336
5388
  });
5337
5389
  var memoryUpsertInputSchema = z2.object({
5338
5390
  project: projectNameSchema,
@@ -5822,7 +5874,7 @@ var canonryMcpTools = [
5822
5874
  defineTool({
5823
5875
  name: "canonry_backlinks_domains",
5824
5876
  title: "List backlink domains",
5825
- description: "Backlink summary and top linking domains from the most recent ready Common Crawl release for a project. Off-site authority signal that correlates with citation likelihood. Returns null summary when no release sync has completed for this workspace.",
5877
+ description: "Source-aware backlink summary + top linking domains for a project. `source=commoncrawl` (default) reads the most recent ready Common Crawl release; `source=bing-webmaster` reads the latest live Bing Webmaster inbound-link window. Off-site authority signal that correlates with citation likelihood. Returns null summary when the source has no data yet.",
5826
5878
  access: "read",
5827
5879
  tier: "setup",
5828
5880
  inputSchema: backlinksDomainsInputSchema,
@@ -5830,9 +5882,21 @@ var canonryMcpTools = [
5830
5882
  openApiOperations: ["GET /api/v1/projects/{name}/backlinks/domains"],
5831
5883
  handler: (client2, input) => client2.backlinksDomains(input.project, {
5832
5884
  limit: input.limit ?? 50,
5833
- release: input.release
5885
+ release: input.release,
5886
+ source: input.source
5834
5887
  })
5835
5888
  }),
5889
+ defineTool({
5890
+ name: "canonry_backlinks_sources",
5891
+ title: "Backlink source availability",
5892
+ description: "Reports which backlink sources are set up for a project (commoncrawl, bing-webmaster): connected, has data, latest window, linking-domain count, and freshness. Use to decide whether to read CC vs Bing or prompt the operator to connect a source.",
5893
+ access: "read",
5894
+ tier: "setup",
5895
+ inputSchema: backlinksSourcesInputSchema,
5896
+ annotations: readAnnotations(),
5897
+ openApiOperations: ["GET /api/v1/projects/{name}/backlinks/sources"],
5898
+ handler: (client2, input) => client2.backlinksSources(input.project)
5899
+ }),
5836
5900
  defineTool({
5837
5901
  name: "canonry_settings_get",
5838
5902
  title: "Get settings",
@@ -2501,6 +2501,22 @@ var agentMemoryDeleteRequestSchema = z21.object({
2501
2501
 
2502
2502
  // ../contracts/src/backlinks.ts
2503
2503
  import { z as z22 } from "zod";
2504
+ var backlinkSourceSchema = z22.enum(["commoncrawl", "bing-webmaster"]);
2505
+ var BacklinkSources = backlinkSourceSchema.enum;
2506
+ function computeBacklinkSummaryMetrics(rows) {
2507
+ if (rows.length === 0) {
2508
+ return { totalLinkingDomains: 0, totalHosts: 0, top10HostsShare: "0" };
2509
+ }
2510
+ const sorted = [...rows].sort((a, b) => b.numHosts - a.numHosts);
2511
+ const totalHosts = sorted.reduce((acc, r) => acc + r.numHosts, 0);
2512
+ const top10Hosts = sorted.slice(0, 10).reduce((acc, r) => acc + r.numHosts, 0);
2513
+ const share = totalHosts > 0 ? top10Hosts / totalHosts : 0;
2514
+ return {
2515
+ totalLinkingDomains: rows.length,
2516
+ totalHosts,
2517
+ top10HostsShare: share.toFixed(6)
2518
+ };
2519
+ }
2504
2520
  var ccReleaseSyncStatusSchema = z22.enum(["queued", "downloading", "querying", "ready", "failed"]);
2505
2521
  var CcReleaseSyncStatuses = ccReleaseSyncStatusSchema.enum;
2506
2522
  var ccReleaseSyncDtoSchema = z22.object({
@@ -2526,16 +2542,24 @@ var ccReleaseSyncDtoSchema = z22.object({
2526
2542
  });
2527
2543
  var backlinkDomainDtoSchema = z22.object({
2528
2544
  linkingDomain: z22.string(),
2529
- numHosts: z22.number().int()
2545
+ // For Common Crawl this is the count of distinct hosts within the linking
2546
+ // domain; for Bing Webmaster it is the count of distinct linking pages (URLs)
2547
+ // from that linking host. Read alongside `source` — the unit differs per source.
2548
+ numHosts: z22.number().int(),
2549
+ source: backlinkSourceSchema
2530
2550
  });
2531
2551
  var backlinkSummaryDtoSchema = z22.object({
2532
2552
  projectId: z22.string(),
2553
+ // Window identifier. Common Crawl uses the release slug
2554
+ // (`cc-main-YYYY-<mon>-<mon>-<mon>`); Bing Webmaster uses a synthetic
2555
+ // per-sync-day window (`bing-YYYY-MM-DD`).
2533
2556
  release: z22.string(),
2534
2557
  targetDomain: z22.string(),
2535
2558
  totalLinkingDomains: z22.number().int(),
2536
2559
  totalHosts: z22.number().int(),
2537
2560
  top10HostsShare: z22.string(),
2538
2561
  queriedAt: z22.string(),
2562
+ source: backlinkSourceSchema,
2539
2563
  // Populated when the response is filtered (e.g. ?excludeCrawlers=1).
2540
2564
  // Counts the rows omitted from totalLinkingDomains/totalHosts so callers
2541
2565
  // can show "N hidden" hints without re-deriving them.
@@ -2543,6 +2567,9 @@ var backlinkSummaryDtoSchema = z22.object({
2543
2567
  excludedHosts: z22.number().int().optional()
2544
2568
  });
2545
2569
  var backlinkListResponseSchema = z22.object({
2570
+ // The source this response was filtered to (defaults to commoncrawl when the
2571
+ // caller omits `?source`).
2572
+ source: backlinkSourceSchema,
2546
2573
  summary: backlinkSummaryDtoSchema.nullable(),
2547
2574
  total: z22.number().int(),
2548
2575
  rows: z22.array(backlinkDomainDtoSchema)
@@ -2552,7 +2579,38 @@ var backlinkHistoryEntrySchema = z22.object({
2552
2579
  totalLinkingDomains: z22.number().int(),
2553
2580
  totalHosts: z22.number().int(),
2554
2581
  top10HostsShare: z22.string(),
2555
- queriedAt: z22.string()
2582
+ queriedAt: z22.string(),
2583
+ source: backlinkSourceSchema
2584
+ });
2585
+ var backlinkSourceAvailabilityDtoSchema = z22.object({
2586
+ source: backlinkSourceSchema,
2587
+ /**
2588
+ * The source is set up for this project:
2589
+ * - commoncrawl: `autoExtractBacklinks` enabled AND a `ready` release sync exists.
2590
+ * - bing-webmaster: a Bing Webmaster connection exists for the project domain.
2591
+ */
2592
+ connected: z22.boolean(),
2593
+ /** Backlink rows exist for this project + source. */
2594
+ hasData: z22.boolean(),
2595
+ /** Latest window id with data for this source, null when none. */
2596
+ latestRelease: z22.string().nullable(),
2597
+ /**
2598
+ * Linking-domain count in the latest window. Excludes crawler/proxy hosts only
2599
+ * when the request sets `?excludeCrawlers=1` (default off, matching the summary
2600
+ * and domains endpoints); the dashboard passes it so the switcher pill matches
2601
+ * the metric card.
2602
+ */
2603
+ totalLinkingDomains: z22.number().int(),
2604
+ /** Freshness: `queriedAt` of the latest summary for this source, null when none. */
2605
+ lastSyncedAt: z22.string().nullable()
2606
+ });
2607
+ var backlinkSourcesResponseSchema = z22.object({
2608
+ projectId: z22.string(),
2609
+ targetDomain: z22.string(),
2610
+ /** Availability for every known source, in a stable order. */
2611
+ sources: z22.array(backlinkSourceAvailabilityDtoSchema),
2612
+ anyConnected: z22.boolean(),
2613
+ anyData: z22.boolean()
2556
2614
  });
2557
2615
  var backlinksInstallStatusDtoSchema = z22.object({
2558
2616
  duckdbInstalled: z22.boolean(),
@@ -3023,6 +3081,17 @@ function absolutizeProjectUrl(url, canonicalDomain) {
3023
3081
  if (trimmed.startsWith("/")) return `https://${host}${trimmed}`;
3024
3082
  return `https://${host}/${trimmed}`;
3025
3083
  }
3084
+ function hostOf(value) {
3085
+ if (value == null) return null;
3086
+ const trimmed = value.trim();
3087
+ if (!trimmed) return null;
3088
+ try {
3089
+ const url = trimmed.includes("://") ? new URL(trimmed) : new URL(`https://${trimmed}`);
3090
+ return url.hostname.replace(/^www\./, "").toLowerCase();
3091
+ } catch {
3092
+ return null;
3093
+ }
3094
+ }
3026
3095
  function normalizeUrlPath(input) {
3027
3096
  if (input == null) return null;
3028
3097
  let trimmed = input.trim();
@@ -4610,11 +4679,15 @@ export {
4610
4679
  AGENT_MEMORY_KEY_MAX_LENGTH,
4611
4680
  agentMemoryUpsertRequestSchema,
4612
4681
  agentMemoryDeleteRequestSchema,
4682
+ backlinkSourceSchema,
4683
+ BacklinkSources,
4684
+ computeBacklinkSummaryMetrics,
4613
4685
  CcReleaseSyncStatuses,
4614
4686
  ccReleaseSyncDtoSchema,
4615
4687
  backlinkSummaryDtoSchema,
4616
4688
  backlinkListResponseSchema,
4617
4689
  backlinkHistoryEntrySchema,
4690
+ backlinkSourcesResponseSchema,
4618
4691
  backlinksInstallStatusDtoSchema,
4619
4692
  backlinksInstallResultDtoSchema,
4620
4693
  ccAvailableReleaseSchema,
@@ -4643,6 +4716,7 @@ export {
4643
4716
  doctorReportSchema,
4644
4717
  summarizeCheckResults,
4645
4718
  absolutizeProjectUrl,
4719
+ hostOf,
4646
4720
  normalizeUrlPath,
4647
4721
  citationVisibilityResponseSchema,
4648
4722
  emptyCitationVisibility,