@ainyc/canonry 4.142.0 → 4.143.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 (28) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +33 -0
  2. package/assets/assets/{AuditHistoryPanel-CfaF5B_e.js → AuditHistoryPanel--kNrRAQm.js} +1 -1
  3. package/assets/assets/{BacklinksPage-BIytWBpL.js → BacklinksPage-CtW1w9lh.js} +1 -1
  4. package/assets/assets/{ChartPrimitives-0tQT6GE7.js → ChartPrimitives-C-nMEqdu.js} +1 -1
  5. package/assets/assets/{HistoryPage-Bn6IH8WV.js → HistoryPage-CAPJDSbc.js} +1 -1
  6. package/assets/assets/ProjectPage-79R3wJW6.js +9 -0
  7. package/assets/assets/{RunRow-RHd8Bd52.js → RunRow-aDzTzGSK.js} +1 -1
  8. package/assets/assets/{RunsPage-BsDqqQFX.js → RunsPage-Dy9oWMBK.js} +1 -1
  9. package/assets/assets/{SettingsPage-CX2LkFDB.js → SettingsPage-DTAs1BrZ.js} +1 -1
  10. package/assets/assets/{TrafficPage-I19b7i9m.js → TrafficPage-B4ADqeKG.js} +1 -1
  11. package/assets/assets/{TrafficSourceDetailPage-DOLEAPsc.js → TrafficSourceDetailPage-CFcoL_PR.js} +1 -1
  12. package/assets/assets/{arrow-left-BG9o86__.js → arrow-left-DV9xcX1v.js} +1 -1
  13. package/assets/assets/{extract-error-message-D0cgM2XG.js → extract-error-message-DXtgw8Q8.js} +1 -1
  14. package/assets/assets/{index-BDo9nl4O.css → index-CYA3jd24.css} +1 -1
  15. package/assets/assets/index-H2iFFrr1.js +213 -0
  16. package/assets/assets/{trash-2-C_THWxO_.js → trash-2-DMV6uGU1.js} +1 -1
  17. package/assets/index.html +2 -2
  18. package/dist/{chunk-D7NJUGNQ.js → chunk-3G5B3IMZ.js} +310 -1
  19. package/dist/{chunk-LS6SEZVF.js → chunk-KUPTGRME.js} +4259 -3034
  20. package/dist/{chunk-UFPP5CSN.js → chunk-TJ6SDLXL.js} +4 -4
  21. package/dist/{chunk-NR6OGEV3.js → chunk-VN3CI6K6.js} +3148 -1193
  22. package/dist/cli.js +129 -19
  23. package/dist/index.js +4 -4
  24. package/dist/{intelligence-service-EOUP37XN.js → intelligence-service-V6JYDYGF.js} +2 -2
  25. package/dist/mcp.js +2 -2
  26. package/package.json +7 -7
  27. package/assets/assets/ProjectPage-DsQic9wX.js +0 -8
  28. package/assets/assets/index-CYGBt2f0.js +0 -213
package/dist/cli.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  showFirstRunNotice,
31
31
  trackCliCommandFinished,
32
32
  trackEvent
33
- } from "./chunk-UFPP5CSN.js";
33
+ } from "./chunk-TJ6SDLXL.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-D7NJUGNQ.js";
50
+ } from "./chunk-3G5B3IMZ.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-NR6OGEV3.js";
58
+ } from "./chunk-VN3CI6K6.js";
59
59
  import {
60
60
  AdsDeliverySnapshotStatuses,
61
61
  AdsHistoricalCampaignRollupStatuses,
@@ -96,12 +96,15 @@ import {
96
96
  formatMicros,
97
97
  formatRatio,
98
98
  formatRunErrorOneLine,
99
+ measurementDiscoveryRequestSchema,
100
+ measurementDiscoveryRuleSchema,
101
+ measurementPlanInputSchema,
99
102
  normalizeProjectAliases,
100
103
  notificationEventSchema,
101
104
  providerQuotaPolicySchema,
102
105
  resolveProviderInput,
103
106
  winnabilityClassSchema
104
- } from "./chunk-LS6SEZVF.js";
107
+ } from "./chunk-KUPTGRME.js";
105
108
 
106
109
  // src/cli.ts
107
110
  import { pathToFileURL } from "url";
@@ -3847,9 +3850,9 @@ async function gaConnect(project, opts) {
3847
3850
  propertyId: opts.propertyId
3848
3851
  };
3849
3852
  if (opts.keyFile) {
3850
- const fs16 = await import("fs");
3853
+ const fs17 = await import("fs");
3851
3854
  try {
3852
- const content = fs16.readFileSync(opts.keyFile, "utf-8");
3855
+ const content = fs17.readFileSync(opts.keyFile, "utf-8");
3853
3856
  JSON.parse(content);
3854
3857
  body.keyJson = content;
3855
3858
  } catch (e) {
@@ -5298,9 +5301,9 @@ async function trafficConnectWordpress(project, opts) {
5298
5301
  }
5299
5302
  let applicationPassword = opts.appPassword?.trim() ?? "";
5300
5303
  if (!applicationPassword && opts.appPasswordFile) {
5301
- const fs16 = await import("fs");
5304
+ const fs17 = await import("fs");
5302
5305
  try {
5303
- applicationPassword = fs16.readFileSync(opts.appPasswordFile, "utf-8").trim();
5306
+ applicationPassword = fs17.readFileSync(opts.appPasswordFile, "utf-8").trim();
5304
5307
  } catch (e) {
5305
5308
  const msg = e instanceof Error ? e.message : String(e);
5306
5309
  throw new CliError({
@@ -5356,10 +5359,10 @@ async function trafficConnectCloudRun(project, opts) {
5356
5359
  details: { project }
5357
5360
  });
5358
5361
  }
5359
- const fs16 = await import("fs");
5362
+ const fs17 = await import("fs");
5360
5363
  let keyJson;
5361
5364
  try {
5362
- keyJson = fs16.readFileSync(opts.serviceAccountKey, "utf-8");
5365
+ keyJson = fs17.readFileSync(opts.serviceAccountKey, "utf-8");
5363
5366
  JSON.parse(keyJson);
5364
5367
  } catch (e) {
5365
5368
  const msg = e instanceof Error ? e.message : String(e);
@@ -5419,9 +5422,9 @@ async function trafficConnectVercel(project, opts) {
5419
5422
  }
5420
5423
  let token = opts.token?.trim() ?? "";
5421
5424
  if (!token && opts.tokenFile) {
5422
- const fs16 = await import("fs");
5425
+ const fs17 = await import("fs");
5423
5426
  try {
5424
- token = fs16.readFileSync(opts.tokenFile, "utf-8").trim();
5427
+ token = fs17.readFileSync(opts.tokenFile, "utf-8").trim();
5425
5428
  } catch (e) {
5426
5429
  const msg = e instanceof Error ? e.message : String(e);
5427
5430
  throw new CliError({
@@ -14118,12 +14121,12 @@ async function wordpressSetMeta(project, body) {
14118
14121
  printPageDetail(result);
14119
14122
  }
14120
14123
  async function wordpressBulkSetMeta(project, opts) {
14121
- const fs16 = await import("fs/promises");
14124
+ const fs17 = await import("fs/promises");
14122
14125
  const path12 = await import("path");
14123
14126
  const filePath = path12.resolve(opts.from);
14124
14127
  let raw;
14125
14128
  try {
14126
- raw = await fs16.readFile(filePath, "utf8");
14129
+ raw = await fs17.readFile(filePath, "utf8");
14127
14130
  } catch {
14128
14131
  throw new CliError({
14129
14132
  code: "FILE_READ_ERROR",
@@ -14220,13 +14223,13 @@ async function wordpressSetSchema(project, body) {
14220
14223
  printManualAssist(`Schema update for "${body.slug}"`, result);
14221
14224
  }
14222
14225
  async function wordpressSchemaDeploy(project, opts) {
14223
- const fs16 = await import("fs/promises");
14226
+ const fs17 = await import("fs/promises");
14224
14227
  const path12 = await import("path");
14225
14228
  const yaml = await loadYamlModule();
14226
14229
  const filePath = path12.resolve(opts.profile);
14227
14230
  let raw;
14228
14231
  try {
14229
- raw = await fs16.readFile(filePath, "utf8");
14232
+ raw = await fs17.readFile(filePath, "utf8");
14230
14233
  } catch {
14231
14234
  throw new CliError({
14232
14235
  code: "FILE_READ_ERROR",
@@ -14331,13 +14334,13 @@ async function wordpressOnboard(project, opts) {
14331
14334
  }
14332
14335
  let profileData;
14333
14336
  if (opts.profile) {
14334
- const fs16 = await import("fs/promises");
14337
+ const fs17 = await import("fs/promises");
14335
14338
  const path12 = await import("path");
14336
14339
  const yaml = await loadYamlModule();
14337
14340
  const filePath = path12.resolve(opts.profile);
14338
14341
  let raw;
14339
14342
  try {
14340
- raw = await fs16.readFile(filePath, "utf8");
14343
+ raw = await fs17.readFile(filePath, "utf8");
14341
14344
  } catch {
14342
14345
  throw new CliError({
14343
14346
  code: "FILE_READ_ERROR",
@@ -15451,6 +15454,112 @@ Usage: ${usage}`, {
15451
15454
  }
15452
15455
  ];
15453
15456
 
15457
+ // src/commands/measurement-plan.ts
15458
+ import fs16 from "fs";
15459
+ import { parse } from "yaml";
15460
+ function readPlan(source) {
15461
+ const content = source === "-" ? fs16.readFileSync(0, "utf8") : fs16.readFileSync(source, "utf8");
15462
+ const parsed = source.endsWith(".json") ? JSON.parse(content) : parse(content);
15463
+ return measurementPlanInputSchema.parse(parsed);
15464
+ }
15465
+ function readDiscoveryRule(source) {
15466
+ const content = source === "-" ? fs16.readFileSync(0, "utf8") : fs16.readFileSync(source, "utf8");
15467
+ const parsed = source.endsWith(".json") ? JSON.parse(content) : parse(content);
15468
+ return measurementDiscoveryRuleSchema.parse(parsed);
15469
+ }
15470
+ async function showMeasurementPlan(project, revision) {
15471
+ const client = createApiClient();
15472
+ console.log(JSON.stringify(revision === void 0 ? await client.getMeasurementPlan(project) : await client.getMeasurementPlanVersion(project, revision), null, 2));
15473
+ }
15474
+ async function listMeasurementPlanVersions(project) {
15475
+ console.log(JSON.stringify(await createApiClient().listMeasurementPlanVersions(project), null, 2));
15476
+ }
15477
+ async function publishMeasurementPlan(project, source) {
15478
+ const client = createApiClient();
15479
+ const plan = readPlan(source);
15480
+ const current = await client.getMeasurementPlan(project);
15481
+ console.log(JSON.stringify(await client.publishMeasurementPlan(project, {
15482
+ expectedActiveRevision: current.active?.revision ?? null,
15483
+ plan
15484
+ }), null, 2));
15485
+ }
15486
+ async function retireMeasurementPlanSegment(project, stableKey) {
15487
+ console.log(JSON.stringify(await createApiClient().retireMeasurementPlanSegment(project, stableKey), null, 2));
15488
+ }
15489
+ async function discoverMeasurementTargets(project, sitemapUrl, ruleSource, maxUrls) {
15490
+ const request = measurementDiscoveryRequestSchema.parse({
15491
+ sitemapUrl,
15492
+ rule: readDiscoveryRule(ruleSource),
15493
+ ...maxUrls === void 0 ? {} : { maxUrls }
15494
+ });
15495
+ console.log(JSON.stringify(await createApiClient().discoverMeasurementTargets(project, request), null, 2));
15496
+ }
15497
+ async function showMeasurementReport(project, revision) {
15498
+ console.log(JSON.stringify(await createApiClient().getMeasurementReport(project, revision), null, 2));
15499
+ }
15500
+
15501
+ // src/cli-commands/measurement-plan.ts
15502
+ var MEASUREMENT_PLAN_CLI_COMMANDS = [
15503
+ { path: ["measurement-plan", "show"], usage: "canonry measurement-plan show <project> [--revision N] [--format json]", options: { revision: stringOption() }, run: async (input) => {
15504
+ const value = getString(input.values, "revision");
15505
+ const revision = value === void 0 ? void 0 : Number(value);
15506
+ if (revision !== void 0 && (!Number.isInteger(revision) || revision <= 0)) throw usageError("--revision must be a positive integer");
15507
+ await showMeasurementPlan(requireProject(input, "measurement-plan.show", "canonry measurement-plan show <project> [--revision N]"), revision);
15508
+ } },
15509
+ { path: ["measurement-plan", "versions"], usage: "canonry measurement-plan versions <project> [--format json]", run: (input) => listMeasurementPlanVersions(requireProject(input, "measurement-plan.versions", "canonry measurement-plan versions <project>")) },
15510
+ { path: ["measurement-plan", "publish"], usage: "canonry measurement-plan publish <project> <yaml|json|-> [--format json]", run: (input) => {
15511
+ const project = requireProject(input, "measurement-plan.publish", "canonry measurement-plan publish <project> <yaml|json|->");
15512
+ const source = input.positionals[1];
15513
+ if (!source) throw usageError("plan file path or - is required");
15514
+ return publishMeasurementPlan(project, source);
15515
+ } },
15516
+ { path: ["measurement-plan", "retire"], usage: "canonry measurement-plan retire <project> <stable-key> [--format json]", run: (input) => {
15517
+ const project = requireProject(input, "measurement-plan.retire", "canonry measurement-plan retire <project> <stable-key>");
15518
+ const stableKey = input.positionals[1];
15519
+ if (!stableKey) throw usageError("stable segment key is required");
15520
+ return retireMeasurementPlanSegment(project, stableKey);
15521
+ } },
15522
+ {
15523
+ path: ["measurement-plan", "discover"],
15524
+ usage: "canonry measurement-plan discover <project> --sitemap-url <url> --rule <yaml|json|-> [--max-urls N] [--format json]",
15525
+ options: { "sitemap-url": stringOption(), rule: stringOption(), "max-urls": stringOption() },
15526
+ run: (input) => {
15527
+ const usage = "canonry measurement-plan discover <project> --sitemap-url <url> --rule <yaml|json|-> [--max-urls N]";
15528
+ const project = requireProject(input, "measurement-plan.discover", usage);
15529
+ const sitemapUrl = requireStringOption(input, "sitemap-url", {
15530
+ command: "measurement-plan.discover",
15531
+ usage,
15532
+ message: "--sitemap-url is required"
15533
+ });
15534
+ const rule = requireStringOption(input, "rule", {
15535
+ command: "measurement-plan.discover",
15536
+ usage,
15537
+ message: "--rule is required"
15538
+ });
15539
+ const maxUrlsValue = getString(input.values, "max-urls");
15540
+ const maxUrls = maxUrlsValue === void 0 ? void 0 : Number(maxUrlsValue);
15541
+ if (maxUrls !== void 0 && (!Number.isInteger(maxUrls) || maxUrls < 1 || maxUrls > 1e4)) {
15542
+ throw usageError("--max-urls must be an integer from 1 to 10000");
15543
+ }
15544
+ return discoverMeasurementTargets(project, sitemapUrl, rule, maxUrls);
15545
+ }
15546
+ },
15547
+ {
15548
+ path: ["measurement-plan", "report"],
15549
+ usage: "canonry measurement-plan report <project> --revision N [--format json]",
15550
+ options: { revision: stringOption() },
15551
+ run: (input) => {
15552
+ const project = requireProject(input, "measurement-plan.report", "canonry measurement-plan report <project> --revision N");
15553
+ const value = getString(input.values, "revision");
15554
+ const revision = value === void 0 ? void 0 : Number(value);
15555
+ if (revision === void 0 || !Number.isInteger(revision) || revision <= 0) {
15556
+ throw usageError("--revision must be a positive integer");
15557
+ }
15558
+ return showMeasurementReport(project, revision);
15559
+ }
15560
+ }
15561
+ ];
15562
+
15454
15563
  // src/cli-commands.ts
15455
15564
  var REGISTERED_CLI_COMMANDS = [
15456
15565
  ...BACKFILL_CLI_COMMANDS,
@@ -15487,7 +15596,8 @@ var REGISTERED_CLI_COMMANDS = [
15487
15596
  ...TECHNICAL_AEO_CLI_COMMANDS,
15488
15597
  ...DOCTOR_CLI_COMMANDS,
15489
15598
  ...GET_CLI_COMMANDS,
15490
- ...MCP_CLI_COMMANDS
15599
+ ...MCP_CLI_COMMANDS,
15600
+ ...MEASUREMENT_PLAN_CLI_COMMANDS
15491
15601
  ];
15492
15602
 
15493
15603
  // src/setup-nudge.ts
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-UFPP5CSN.js";
3
+ } from "./chunk-TJ6SDLXL.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-D7NJUGNQ.js";
7
- import "./chunk-NR6OGEV3.js";
8
- import "./chunk-LS6SEZVF.js";
6
+ } from "./chunk-3G5B3IMZ.js";
7
+ import "./chunk-VN3CI6K6.js";
8
+ import "./chunk-KUPTGRME.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-NR6OGEV3.js";
4
- import "./chunk-LS6SEZVF.js";
3
+ } from "./chunk-VN3CI6K6.js";
4
+ import "./chunk-KUPTGRME.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-D7NJUGNQ.js";
6
+ } from "./chunk-3G5B3IMZ.js";
7
7
  import {
8
8
  isReadOnlyKey
9
- } from "./chunk-LS6SEZVF.js";
9
+ } from "./chunk-KUPTGRME.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.142.0",
3
+ "version": "4.143.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",
@@ -65,24 +65,24 @@
65
65
  "@types/node-cron": "^3.0.11",
66
66
  "tsup": "^8.5.1",
67
67
  "tsx": "^4.19.0",
68
+ "@ainyc/canonry-api-routes": "0.0.0",
68
69
  "@ainyc/canonry-api-client": "0.0.0",
69
70
  "@ainyc/canonry-config": "0.0.0",
70
- "@ainyc/canonry-api-routes": "0.0.0",
71
71
  "@ainyc/canonry-contracts": "0.0.0",
72
72
  "@ainyc/canonry-db": "0.0.0",
73
73
  "@ainyc/canonry-integration-bing": "0.0.0",
74
74
  "@ainyc/canonry-integration-cloud-run": "0.0.0",
75
- "@ainyc/canonry-integration-commoncrawl": "0.0.0",
76
75
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
77
- "@ainyc/canonry-integration-google-business-profile": "0.0.0",
78
- "@ainyc/canonry-integration-google": "0.0.0",
79
76
  "@ainyc/canonry-integration-google-places": "0.0.0",
77
+ "@ainyc/canonry-integration-google": "0.0.0",
80
78
  "@ainyc/canonry-integration-traffic": "0.0.0",
79
+ "@ainyc/canonry-integration-commoncrawl": "0.0.0",
81
80
  "@ainyc/canonry-integration-wordpress": "0.0.0",
81
+ "@ainyc/canonry-integration-google-business-profile": "0.0.0",
82
82
  "@ainyc/canonry-intelligence": "0.0.0",
83
- "@ainyc/canonry-provider-claude": "0.0.0",
84
- "@ainyc/canonry-provider-gemini": "0.0.0",
85
83
  "@ainyc/canonry-provider-cdp": "0.0.0",
84
+ "@ainyc/canonry-provider-gemini": "0.0.0",
85
+ "@ainyc/canonry-provider-claude": "0.0.0",
86
86
  "@ainyc/canonry-provider-local": "0.0.0",
87
87
  "@ainyc/canonry-provider-openai": "0.0.0",
88
88
  "@ainyc/canonry-provider-perplexity": "0.0.0"