@ainyc/canonry 4.144.0 → 4.146.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 (36) hide show
  1. package/assets/assets/{AuditHistoryPanel-DxRP9WsD.js → AuditHistoryPanel-IDsSUFI3.js} +1 -1
  2. package/assets/assets/{BacklinksPage-yiEbyV67.js → BacklinksPage-BswN-pyj.js} +1 -1
  3. package/assets/assets/{ChartPrimitives-D2hRlMHn.js → ChartPrimitives-CIe-R58_.js} +1 -1
  4. package/assets/assets/{HistoryPage-CW6MJ-dR.js → HistoryPage-B18Jpq8c.js} +1 -1
  5. package/assets/assets/MeasurementPropertyPage-CvmQeoo7.js +1 -0
  6. package/assets/assets/ProjectPage-BE1MUAB5.js +11 -0
  7. package/assets/assets/{RunRow-Dr607W0P.js → RunRow-3ZwTR4Bv.js} +1 -1
  8. package/assets/assets/{RunsPage-CtF3P7CA.js → RunsPage-BCAJulR1.js} +1 -1
  9. package/assets/assets/{SettingsPage-3-uzs2lp.js → SettingsPage-BT2_l0Do.js} +1 -1
  10. package/assets/assets/{TrafficPage-Bww4KUn8.js → TrafficPage-Cux8rj5G.js} +1 -1
  11. package/assets/assets/{TrafficSourceDetailPage-DiHxUH2H.js → TrafficSourceDetailPage-DI1Ad8KS.js} +1 -1
  12. package/assets/assets/{arrow-left-D-PcVbQ4.js → arrow-left-BMSx9HQB.js} +1 -1
  13. package/assets/assets/extract-error-message-B-9FdQh8.js +1 -0
  14. package/assets/assets/index-C6E5hp28.css +1 -0
  15. package/assets/assets/index-kOXUzdqD.js +213 -0
  16. package/assets/assets/{trash-2-B6aJTnJl.js → trash-2-CyoJtRAr.js} +1 -1
  17. package/assets/assets/v2-overview-adapter-owDeFdUc.js +1 -0
  18. package/assets/assets/{vendor-markdown-6dwjPOKK.js → vendor-markdown-CpDJch4G.js} +1 -1
  19. package/assets/assets/{vendor-radix-CQ77EO2y.js → vendor-radix-DnzzbllM.js} +1 -1
  20. package/assets/assets/{vendor-recharts-DSxTZhaH.js → vendor-recharts-33ACLxsD.js} +1 -1
  21. package/assets/assets/vendor-tanstack-BjS7iY3g.js +1 -0
  22. package/assets/index.html +6 -6
  23. package/dist/{chunk-WADGZMWT.js → chunk-B5H55ZMA.js} +101 -14
  24. package/dist/{chunk-7D2GZU6O.js → chunk-ED7C5TWT.js} +1747 -1015
  25. package/dist/{chunk-Z672VQ7G.js → chunk-UQOTEIA6.js} +1355 -73
  26. package/dist/{chunk-3NYTF3YC.js → chunk-Z7B6BRPP.js} +4 -4
  27. package/dist/cli.js +156 -4
  28. package/dist/index.js +4 -4
  29. package/dist/{intelligence-service-OLIGR6HE.js → intelligence-service-M5UNHF7X.js} +2 -2
  30. package/dist/mcp.js +5 -5
  31. package/package.json +7 -7
  32. package/assets/assets/ProjectPage-Bnr7I5qu.js +0 -9
  33. package/assets/assets/extract-error-message-BRq0yLWg.js +0 -1
  34. package/assets/assets/index-ANFzZ3nU.css +0 -1
  35. package/assets/assets/index-b5M4QpB0.js +0 -213
  36. package/assets/assets/vendor-tanstack-Be8JdV5M.js +0 -1
@@ -10,7 +10,7 @@ import {
10
10
  loadConfig,
11
11
  loadConfigRaw,
12
12
  saveConfigPatch
13
- } from "./chunk-Z672VQ7G.js";
13
+ } from "./chunk-UQOTEIA6.js";
14
14
  import {
15
15
  CC_CACHE_DIR,
16
16
  DUCKDB_SPEC,
@@ -126,7 +126,7 @@ import {
126
126
  siteAuditSnapshots,
127
127
  toAlertView,
128
128
  usageCounters
129
- } from "./chunk-7D2GZU6O.js";
129
+ } from "./chunk-ED7C5TWT.js";
130
130
  import {
131
131
  AGENT_MEMORY_VALUE_MAX_BYTES,
132
132
  AGENT_PROVIDER_IDS,
@@ -217,7 +217,7 @@ import {
217
217
  validationError,
218
218
  winnabilityClassLabel,
219
219
  withRetry
220
- } from "./chunk-WADGZMWT.js";
220
+ } from "./chunk-B5H55ZMA.js";
221
221
 
222
222
  // src/telemetry.ts
223
223
  import crypto from "crypto";
@@ -7420,7 +7420,7 @@ function readStoredGroundingSources(rawResponse) {
7420
7420
  return result;
7421
7421
  }
7422
7422
  async function backfillInsightsCommand(project, opts) {
7423
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-OLIGR6HE.js");
7423
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-M5UNHF7X.js");
7424
7424
  const config = loadConfig();
7425
7425
  const db = createClient(config.database);
7426
7426
  migrate(db);
package/dist/cli.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  showFirstRunNotice,
31
31
  trackCliCommandFinished,
32
32
  trackEvent
33
- } from "./chunk-3NYTF3YC.js";
33
+ } from "./chunk-Z7B6BRPP.js";
34
34
  import {
35
35
  CliError,
36
36
  EXIT_SYSTEM_ERROR,
@@ -47,7 +47,7 @@ import {
47
47
  saveConfig,
48
48
  saveConfigPatch,
49
49
  usageError
50
- } from "./chunk-Z672VQ7G.js";
50
+ } from "./chunk-UQOTEIA6.js";
51
51
  import {
52
52
  apiKeys,
53
53
  createClient,
@@ -55,7 +55,7 @@ import {
55
55
  projects,
56
56
  queries,
57
57
  renderReportHtml
58
- } from "./chunk-7D2GZU6O.js";
58
+ } from "./chunk-ED7C5TWT.js";
59
59
  import {
60
60
  AdsDeliverySnapshotStatuses,
61
61
  AdsHistoricalCampaignRollupStatuses,
@@ -106,7 +106,7 @@ import {
106
106
  providerQuotaPolicySchema,
107
107
  resolveProviderInput,
108
108
  winnabilityClassSchema
109
- } from "./chunk-WADGZMWT.js";
109
+ } from "./chunk-B5H55ZMA.js";
110
110
 
111
111
  // src/cli.ts
112
112
  import { pathToFileURL } from "url";
@@ -15756,8 +15756,131 @@ async function discoverMeasurementTargets(project, sitemapUrl, ruleSource, maxUr
15756
15756
  async function showMeasurementReport(project, revision) {
15757
15757
  console.log(JSON.stringify(await createApiClient().getMeasurementReport(project, revision), null, 2));
15758
15758
  }
15759
+ var METRIC_REASONS = {
15760
+ plan_v1: "not measured (setup update required)",
15761
+ no_completed_run: "not measured (no completed run)",
15762
+ no_population: "not measured (no questions of this type)",
15763
+ evidence_incomplete: "not measured (evidence incomplete)",
15764
+ not_applicable: "not measured (not applicable)"
15765
+ };
15766
+ function metricText(metric) {
15767
+ if (metric.state === "unavailable") return METRIC_REASONS[metric.reason] ?? `not measured (${metric.reason})`;
15768
+ const percent = `${Math.round(metric.value * 100)}%`;
15769
+ return metric.numerator === void 0 || metric.denominator === void 0 ? percent : `${metric.numerator} of ${metric.denominator} (${percent})`;
15770
+ }
15771
+ async function showMeasurementProperty(project, opts) {
15772
+ const response = await createApiClient().getMeasurementOverview(project, {
15773
+ scope: "property",
15774
+ targetKey: opts.targetKey,
15775
+ ...opts.queryClass === void 0 ? {} : { queryClass: opts.queryClass },
15776
+ ...opts.provider === void 0 ? {} : { provider: opts.provider },
15777
+ ...opts.location === void 0 ? {} : { location: opts.location },
15778
+ ...opts.runId === void 0 ? {} : { runId: opts.runId }
15779
+ });
15780
+ if (isMachineFormat(opts.format)) {
15781
+ console.log(JSON.stringify(response, null, 2));
15782
+ return;
15783
+ }
15784
+ printMeasurementProperty(response);
15785
+ }
15786
+ function printMeasurementProperty(response) {
15787
+ const row = response.properties.items.at(0);
15788
+ const lines = [];
15789
+ lines.push(`${response.scope.label} \u2014 ${response.queryClass} questions`);
15790
+ lines.push(`Measurement: ${response.measurement.state}${response.measurement.displayedRunId ? ` \xB7 run ${response.measurement.displayedRunId}` : ""}`);
15791
+ lines.push("");
15792
+ lines.push(`Mentioned ${metricText(row ? row.mentionCoverage : response.metrics.mentionCoverage)}`);
15793
+ lines.push(`Cited ${metricText(row ? row.citationCoverage : response.metrics.citationCoverage)}`);
15794
+ if (row && row.flags > 0) lines.push(`Flagged ${row.flags} ${row.flags === 1 ? "result needs" : "results need"} review`);
15795
+ if (row && row.providers.length > 0) {
15796
+ lines.push("");
15797
+ lines.push(`${"Engine".padEnd(14)}${"Mentioned".padEnd(34)}Cited`);
15798
+ for (const provider of row.providers) {
15799
+ lines.push(`${provider.provider.padEnd(14)}${metricText(provider.mentionCoverage).padEnd(34)}${metricText(provider.citationCoverage)}`);
15800
+ }
15801
+ }
15802
+ console.log(lines.join("\n"));
15803
+ }
15804
+ async function showMeasurementPropertyEvidence(project, opts) {
15805
+ const response = await createApiClient().getMeasurementPropertyEvidence(project, {
15806
+ targetKey: opts.targetKey,
15807
+ ...opts.queryClass === void 0 ? {} : { queryClass: opts.queryClass },
15808
+ ...opts.provider === void 0 ? {} : { provider: opts.provider },
15809
+ ...opts.location === void 0 ? {} : { location: opts.location },
15810
+ ...opts.runId === void 0 ? {} : { runId: opts.runId },
15811
+ ...opts.cursor === void 0 ? {} : { cursor: opts.cursor },
15812
+ ...opts.limit === void 0 ? {} : { limit: opts.limit }
15813
+ });
15814
+ if (opts.format === "jsonl") {
15815
+ emitJsonl([{
15816
+ kind: "measurement-property-evidence-header",
15817
+ property: response.property,
15818
+ queryClass: response.queryClass,
15819
+ measurement: response.measurement,
15820
+ totalEstimate: response.evidence.totalEstimate ?? null,
15821
+ nextCursor: response.evidence.nextCursor ?? null
15822
+ }]);
15823
+ emitJsonl(response.evidence.items);
15824
+ return;
15825
+ }
15826
+ if (opts.format === "json") {
15827
+ console.log(JSON.stringify(response, null, 2));
15828
+ return;
15829
+ }
15830
+ printMeasurementPropertyEvidence(response);
15831
+ }
15832
+ function printMeasurementPropertyEvidence(response) {
15833
+ const lines = [];
15834
+ lines.push(`${response.property.label} \u2014 ${response.queryClass} questions`);
15835
+ if (response.measurement.state === "not_measured") {
15836
+ lines.push("Not measured yet. Run a measurement to collect source evidence.");
15837
+ console.log(lines.join("\n"));
15838
+ return;
15839
+ }
15840
+ const page = response.evidence;
15841
+ lines.push(`Measurement: ${response.measurement.state}${response.measurement.displayedRunId ? ` \xB7 run ${response.measurement.displayedRunId}` : ""}`);
15842
+ if (page.items.length === 0) {
15843
+ lines.push("No source evidence matched this Property in the displayed run.");
15844
+ console.log(lines.join("\n"));
15845
+ return;
15846
+ }
15847
+ lines.push(`${page.items.length} of ${page.totalEstimate ?? page.items.length} evidence rows`);
15848
+ lines.push("");
15849
+ lines.push(`${"Match".padEnd(14)}${"Engine".padEnd(12)}${"Question".padEnd(40)}URL`);
15850
+ for (const item of page.items) {
15851
+ lines.push(`${item.classification.padEnd(14)}${item.provider.padEnd(12)}${item.queryText.slice(0, 39).padEnd(40)}${item.sourceUrl}`);
15852
+ }
15853
+ if (page.nextCursor) lines.push(`
15854
+ More rows: --cursor ${page.nextCursor}`);
15855
+ console.log(lines.join("\n"));
15856
+ }
15759
15857
 
15760
15858
  // src/cli-commands/measurement-plan.ts
15859
+ var QUERY_CLASSES = ["all", "branded", "non-brand"];
15860
+ function queryClassOption(input) {
15861
+ const value = getString(input.values, "query-class");
15862
+ if (value === void 0) return void 0;
15863
+ const match = QUERY_CLASSES.find((candidate) => candidate === value);
15864
+ if (!match) throw usageError(`--query-class must be one of ${QUERY_CLASSES.join(", ")}`);
15865
+ return match;
15866
+ }
15867
+ function propertyScope(input, command, usage) {
15868
+ return {
15869
+ targetKey: requireStringOption(input, "target-key", { command, usage, message: "--target-key is required" }),
15870
+ queryClass: queryClassOption(input),
15871
+ provider: getString(input.values, "provider"),
15872
+ location: getString(input.values, "location"),
15873
+ runId: getString(input.values, "run-id"),
15874
+ format: input.format
15875
+ };
15876
+ }
15877
+ var PROPERTY_SCOPE_OPTIONS = {
15878
+ "target-key": stringOption(),
15879
+ "query-class": stringOption(),
15880
+ provider: stringOption(),
15881
+ location: stringOption(),
15882
+ "run-id": stringOption()
15883
+ };
15761
15884
  var MEASUREMENT_PLAN_CLI_COMMANDS = [
15762
15885
  { path: ["measurement-plan", "show"], usage: "canonry measurement-plan show <project> [--revision N] [--format json]", options: { revision: stringOption() }, run: async (input) => {
15763
15886
  const value = getString(input.values, "revision");
@@ -15816,6 +15939,35 @@ var MEASUREMENT_PLAN_CLI_COMMANDS = [
15816
15939
  }
15817
15940
  return showMeasurementReport(project, revision);
15818
15941
  }
15942
+ },
15943
+ {
15944
+ path: ["measurement-plan", "property"],
15945
+ usage: "canonry measurement-plan property <project> --target-key <key> [--query-class all|branded|non-brand] [--provider <p>] [--location <l>] [--run-id <id>] [--format json]",
15946
+ options: PROPERTY_SCOPE_OPTIONS,
15947
+ run: (input) => {
15948
+ const usage = "canonry measurement-plan property <project> --target-key <key>";
15949
+ const project = requireProject(input, "measurement-plan.property", usage);
15950
+ return showMeasurementProperty(project, propertyScope(input, "measurement-plan.property", usage));
15951
+ }
15952
+ },
15953
+ {
15954
+ path: ["measurement-plan", "property-evidence"],
15955
+ usage: "canonry measurement-plan property-evidence <project> --target-key <key> [--query-class all|branded|non-brand] [--provider <p>] [--location <l>] [--run-id <id>] [--cursor <c>] [--limit N] [--format json|jsonl]",
15956
+ options: { ...PROPERTY_SCOPE_OPTIONS, cursor: stringOption(), limit: stringOption() },
15957
+ run: (input) => {
15958
+ const usage = "canonry measurement-plan property-evidence <project> --target-key <key>";
15959
+ const project = requireProject(input, "measurement-plan.property-evidence", usage);
15960
+ const limitValue = getString(input.values, "limit");
15961
+ const limit = limitValue === void 0 ? void 0 : Number(limitValue);
15962
+ if (limit !== void 0 && (!Number.isInteger(limit) || limit < 1 || limit > 100)) {
15963
+ throw usageError("--limit must be an integer from 1 to 100");
15964
+ }
15965
+ return showMeasurementPropertyEvidence(project, {
15966
+ ...propertyScope(input, "measurement-plan.property-evidence", usage),
15967
+ cursor: getString(input.values, "cursor"),
15968
+ ...limit === void 0 ? {} : { limit }
15969
+ });
15970
+ }
15819
15971
  }
15820
15972
  ];
15821
15973
 
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-3NYTF3YC.js";
3
+ } from "./chunk-Z7B6BRPP.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-Z672VQ7G.js";
7
- import "./chunk-7D2GZU6O.js";
8
- import "./chunk-WADGZMWT.js";
6
+ } from "./chunk-UQOTEIA6.js";
7
+ import "./chunk-ED7C5TWT.js";
8
+ import "./chunk-B5H55ZMA.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-7D2GZU6O.js";
4
- import "./chunk-WADGZMWT.js";
3
+ } from "./chunk-ED7C5TWT.js";
4
+ import "./chunk-B5H55ZMA.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-Z672VQ7G.js";
6
+ } from "./chunk-UQOTEIA6.js";
7
7
  import {
8
8
  isReadOnlyKey
9
- } from "./chunk-WADGZMWT.js";
9
+ } from "./chunk-B5H55ZMA.js";
10
10
 
11
11
  // src/mcp/cli.ts
12
12
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -116,9 +116,9 @@ var CANONRY_MCP_TOOLKITS = [
116
116
  },
117
117
  {
118
118
  name: "setup",
119
- title: "Project configuration",
120
- description: "Manage queries, competitors, schedules, project upsert, and config-as-code roundtrips.",
121
- whenToLoad: "Load when onboarding a new project or editing tracked queries, competitors, or schedules."
119
+ title: "Project setup and measurement",
120
+ description: "Manage project configuration, Advanced Measurement drafts, query assets, competitors, and schedules.",
121
+ whenToLoad: "Load when onboarding a project, editing its measurement plan, or managing tracked queries, competitors, or schedules."
122
122
  },
123
123
  {
124
124
  name: "gsc",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainyc/canonry",
3
- "version": "4.144.0",
3
+ "version": "4.146.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",
@@ -68,23 +68,23 @@
68
68
  "@ainyc/canonry-api-client": "0.0.0",
69
69
  "@ainyc/canonry-api-routes": "0.0.0",
70
70
  "@ainyc/canonry-config": "0.0.0",
71
- "@ainyc/canonry-db": "0.0.0",
72
71
  "@ainyc/canonry-contracts": "0.0.0",
72
+ "@ainyc/canonry-db": "0.0.0",
73
73
  "@ainyc/canonry-integration-bing": "0.0.0",
74
+ "@ainyc/canonry-integration-cloud-run": "0.0.0",
75
+ "@ainyc/canonry-integration-commoncrawl": "0.0.0",
74
76
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
75
77
  "@ainyc/canonry-integration-google": "0.0.0",
76
- "@ainyc/canonry-integration-google-business-profile": "0.0.0",
77
78
  "@ainyc/canonry-integration-google-places": "0.0.0",
78
- "@ainyc/canonry-integration-commoncrawl": "0.0.0",
79
- "@ainyc/canonry-integration-cloud-run": "0.0.0",
80
79
  "@ainyc/canonry-integration-traffic": "0.0.0",
81
80
  "@ainyc/canonry-integration-wordpress": "0.0.0",
82
- "@ainyc/canonry-provider-cdp": "0.0.0",
81
+ "@ainyc/canonry-integration-google-business-profile": "0.0.0",
83
82
  "@ainyc/canonry-intelligence": "0.0.0",
83
+ "@ainyc/canonry-provider-cdp": "0.0.0",
84
84
  "@ainyc/canonry-provider-claude": "0.0.0",
85
- "@ainyc/canonry-provider-gemini": "0.0.0",
86
85
  "@ainyc/canonry-provider-local": "0.0.0",
87
86
  "@ainyc/canonry-provider-openai": "0.0.0",
87
+ "@ainyc/canonry-provider-gemini": "0.0.0",
88
88
  "@ainyc/canonry-provider-perplexity": "0.0.0"
89
89
  },
90
90
  "scripts": {