@canonry/canonry 4.141.0 → 4.142.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 +12 -5
  2. package/assets/assets/{AuditHistoryPanel-DlyLhzqq.js → AuditHistoryPanel-CfaF5B_e.js} +1 -1
  3. package/assets/assets/{BacklinksPage-DNxtwQBF.js → BacklinksPage-BIytWBpL.js} +1 -1
  4. package/assets/assets/{ChartPrimitives-BStLR_NC.js → ChartPrimitives-0tQT6GE7.js} +1 -1
  5. package/assets/assets/{HistoryPage-CIcCgoWK.js → HistoryPage-Bn6IH8WV.js} +1 -1
  6. package/assets/assets/{ProjectPage-BSI3Qum9.js → ProjectPage-DsQic9wX.js} +1 -1
  7. package/assets/assets/{RunRow-C0mFtLlc.js → RunRow-RHd8Bd52.js} +1 -1
  8. package/assets/assets/{RunsPage-C-yo0yoj.js → RunsPage-BsDqqQFX.js} +1 -1
  9. package/assets/assets/{SettingsPage-jg4MXOuo.js → SettingsPage-CX2LkFDB.js} +1 -1
  10. package/assets/assets/{TrafficPage-CnYHIg8t.js → TrafficPage-I19b7i9m.js} +1 -1
  11. package/assets/assets/{TrafficSourceDetailPage-CEdyQT2P.js → TrafficSourceDetailPage-DOLEAPsc.js} +1 -1
  12. package/assets/assets/{arrow-left-DUv0imIl.js → arrow-left-BG9o86__.js} +1 -1
  13. package/assets/assets/{extract-error-message-CCOGDwlm.js → extract-error-message-D0cgM2XG.js} +1 -1
  14. package/assets/assets/{index-D6EP4dQs.js → index-CYGBt2f0.js} +73 -73
  15. package/assets/assets/{trash-2-1Yg9W-vs.js → trash-2-C_THWxO_.js} +1 -1
  16. package/assets/index.html +1 -1
  17. package/dist/{chunk-ZCFQGF3V.js → chunk-D7NJUGNQ.js} +10 -7
  18. package/dist/{chunk-OJOA425V.js → chunk-LS6SEZVF.js} +78 -3
  19. package/dist/{chunk-2LUSZFB6.js → chunk-NR6OGEV3.js} +207 -49
  20. package/dist/{chunk-HXXO2AF5.js → chunk-UFPP5CSN.js} +4 -4
  21. package/dist/cli.js +62 -50
  22. package/dist/index.js +4 -4
  23. package/dist/{intelligence-service-4HQIUC7U.js → intelligence-service-EOUP37XN.js} +2 -2
  24. package/dist/mcp.js +2 -2
  25. package/package.json +7 -7
package/dist/cli.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  showFirstRunNotice,
31
31
  trackCliCommandFinished,
32
32
  trackEvent
33
- } from "./chunk-HXXO2AF5.js";
33
+ } from "./chunk-UFPP5CSN.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-ZCFQGF3V.js";
50
+ } from "./chunk-D7NJUGNQ.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-2LUSZFB6.js";
58
+ } from "./chunk-NR6OGEV3.js";
59
59
  import {
60
60
  AdsDeliverySnapshotStatuses,
61
61
  AdsHistoricalCampaignRollupStatuses,
@@ -101,7 +101,7 @@ import {
101
101
  providerQuotaPolicySchema,
102
102
  resolveProviderInput,
103
103
  winnabilityClassSchema
104
- } from "./chunk-OJOA425V.js";
104
+ } from "./chunk-LS6SEZVF.js";
105
105
 
106
106
  // src/cli.ts
107
107
  import { pathToFileURL } from "url";
@@ -3824,6 +3824,16 @@ Usage: ${usage}`, {
3824
3824
  function getClient7() {
3825
3825
  return createApiClient();
3826
3826
  }
3827
+ function rangeParams(opts, extra) {
3828
+ const params = { ...extra };
3829
+ if (opts?.window) params.window = opts.window;
3830
+ if (opts?.startDate) params.startDate = opts.startDate;
3831
+ if (opts?.endDate) params.endDate = opts.endDate;
3832
+ return Object.keys(params).length > 0 ? params : void 0;
3833
+ }
3834
+ function isRangeScoped(opts) {
3835
+ return Boolean(opts?.window || opts?.startDate || opts?.endDate);
3836
+ }
3827
3837
  async function gaConnect(project, opts) {
3828
3838
  if (!opts.propertyId) {
3829
3839
  throw new CliError({
@@ -3925,10 +3935,8 @@ async function gaSync(project, opts) {
3925
3935
  }
3926
3936
  async function gaTraffic(project, opts) {
3927
3937
  const client = getClient7();
3928
- const params = {};
3929
- if (opts?.limit) params.limit = String(opts.limit);
3930
- if (opts?.window) params.window = opts.window;
3931
- const result = await client.gaTraffic(project, Object.keys(params).length > 0 ? params : void 0);
3938
+ const params = rangeParams(opts, opts?.limit ? { limit: String(opts.limit) } : void 0);
3939
+ const result = await client.gaTraffic(project, params);
3932
3940
  if (isMachineFormat(opts?.format)) {
3933
3941
  console.log(JSON.stringify(result, null, 2));
3934
3942
  return;
@@ -3937,7 +3945,7 @@ async function gaTraffic(project, opts) {
3937
3945
  if (!result.lastSyncedAt) {
3938
3946
  console.log('No GA4 traffic data. Run "canonry ga sync <project>" first.');
3939
3947
  } else {
3940
- console.log(`No GA4 traffic data for the selected period.${opts?.window ? ` Try a wider window or omit --window.` : ""}`);
3948
+ console.log(`No GA4 traffic data for the selected period.${isRangeScoped(opts) ? " Try a wider range, or omit --window / --start / --end." : ""}`);
3941
3949
  }
3942
3950
  return;
3943
3951
  }
@@ -4061,16 +4069,16 @@ async function gaMeasurementAnalysis(project, opts) {
4061
4069
  }
4062
4070
  async function gaAiReferralHistory(project, opts) {
4063
4071
  const client = getClient7();
4064
- const result = await client.gaAiReferralHistory(project, opts?.window ? { window: opts.window } : void 0);
4072
+ const result = await client.gaAiReferralHistory(project, rangeParams(opts));
4065
4073
  if (opts?.format === "json") {
4066
4074
  console.log(JSON.stringify(result, null, 2));
4067
4075
  return;
4068
4076
  } else if (opts?.format === "jsonl") {
4069
- emitJsonl(result.map((row) => ({ project, window: opts?.window, ...row })));
4077
+ emitJsonl(result.map((row) => ({ project, window: opts?.window, startDate: opts?.startDate, endDate: opts?.endDate, ...row })));
4070
4078
  return;
4071
4079
  }
4072
4080
  if (result.length === 0) {
4073
- console.log(`No AI referral history.${opts?.window ? " Try a wider window or omit --window." : ' Run "canonry ga sync <project>" first.'}`);
4081
+ console.log(`No AI referral history.${isRangeScoped(opts) ? " Try a wider range, or omit --window / --start / --end." : ' Run "canonry ga sync <project>" first.'}`);
4074
4082
  return;
4075
4083
  }
4076
4084
  const dateWidth = 12;
@@ -4089,16 +4097,16 @@ async function gaAiReferralHistory(project, opts) {
4089
4097
  }
4090
4098
  async function gaAiReferralDaily(project, opts) {
4091
4099
  const client = getClient7();
4092
- const result = await client.gaAiReferralDaily(project, opts?.window ? { window: opts.window } : void 0);
4100
+ const result = await client.gaAiReferralDaily(project, rangeParams(opts));
4093
4101
  if (opts?.format === "json") {
4094
4102
  console.log(JSON.stringify(result, null, 2));
4095
4103
  return;
4096
4104
  } else if (opts?.format === "jsonl") {
4097
- emitJsonl(result.days.map((day) => ({ project, window: opts?.window, ...day })));
4105
+ emitJsonl(result.days.map((day) => ({ project, window: opts?.window, startDate: opts?.startDate, endDate: opts?.endDate, ...day })));
4098
4106
  return;
4099
4107
  }
4100
4108
  if (result.days.length === 0) {
4101
- console.log(`No AI referral sessions.${opts?.window ? " Try a wider window or omit --window." : ' Run "canonry ga sync <project>" first.'}`);
4109
+ console.log(`No AI referral sessions.${isRangeScoped(opts) ? " Try a wider range, or omit --window / --start / --end." : ' Run "canonry ga sync <project>" first.'}`);
4102
4110
  return;
4103
4111
  }
4104
4112
  const dateWidth = 12;
@@ -4119,16 +4127,16 @@ async function gaAiReferralDaily(project, opts) {
4119
4127
  }
4120
4128
  async function gaSocialReferralHistory(project, opts) {
4121
4129
  const client = getClient7();
4122
- const result = await client.gaSocialReferralHistory(project, opts?.window ? { window: opts.window } : void 0);
4130
+ const result = await client.gaSocialReferralHistory(project, rangeParams(opts));
4123
4131
  if (opts?.format === "json") {
4124
4132
  console.log(JSON.stringify(result, null, 2));
4125
4133
  return;
4126
4134
  } else if (opts?.format === "jsonl") {
4127
- emitJsonl(result.map((row) => ({ project, window: opts?.window, ...row })));
4135
+ emitJsonl(result.map((row) => ({ project, window: opts?.window, startDate: opts?.startDate, endDate: opts?.endDate, ...row })));
4128
4136
  return;
4129
4137
  }
4130
4138
  if (result.length === 0) {
4131
- console.log(`No social referral history.${opts?.window ? " Try a wider window or omit --window." : ' Run "canonry ga sync <project>" first.'}`);
4139
+ console.log(`No social referral history.${isRangeScoped(opts) ? " Try a wider range, or omit --window / --start / --end." : ' Run "canonry ga sync <project>" first.'}`);
4132
4140
  return;
4133
4141
  }
4134
4142
  const dateWidth = 12;
@@ -4147,16 +4155,16 @@ async function gaSocialReferralHistory(project, opts) {
4147
4155
  }
4148
4156
  async function gaSessionHistory(project, opts) {
4149
4157
  const client = getClient7();
4150
- const result = await client.gaSessionHistory(project, opts?.window ? { window: opts.window } : void 0);
4158
+ const result = await client.gaSessionHistory(project, rangeParams(opts));
4151
4159
  if (opts?.format === "json") {
4152
4160
  console.log(JSON.stringify(result, null, 2));
4153
4161
  return;
4154
4162
  } else if (opts?.format === "jsonl") {
4155
- emitJsonl(result.map((row) => ({ project, window: opts?.window, ...row })));
4163
+ emitJsonl(result.map((row) => ({ project, window: opts?.window, startDate: opts?.startDate, endDate: opts?.endDate, ...row })));
4156
4164
  return;
4157
4165
  }
4158
4166
  if (result.length === 0) {
4159
- console.log(`No session history.${opts?.window ? " Try a wider window or omit --window." : ' Run "canonry ga sync <project>" first.'}`);
4167
+ console.log(`No session history.${isRangeScoped(opts) ? " Try a wider range, or omit --window / --start / --end." : ' Run "canonry ga sync <project>" first.'}`);
4160
4168
  return;
4161
4169
  }
4162
4170
  const dateWidth = 12;
@@ -4449,6 +4457,19 @@ async function gaAttribution(project, opts) {
4449
4457
  }
4450
4458
 
4451
4459
  // src/cli-commands/ga.ts
4460
+ var RANGE_OPTIONS = {
4461
+ window: stringOption(),
4462
+ start: stringOption(),
4463
+ end: stringOption()
4464
+ };
4465
+ var RANGE_USAGE = "[--window 30d] [--start YYYY-MM-DD] [--end YYYY-MM-DD]";
4466
+ function rangeValues(values) {
4467
+ return {
4468
+ window: getString(values, "window"),
4469
+ startDate: getString(values, "start"),
4470
+ endDate: getString(values, "end")
4471
+ };
4472
+ }
4452
4473
  var GA_CLI_COMMANDS = [
4453
4474
  {
4454
4475
  path: ["ga", "connect"],
@@ -4530,19 +4551,18 @@ var GA_CLI_COMMANDS = [
4530
4551
  },
4531
4552
  {
4532
4553
  path: ["ga", "traffic"],
4533
- usage: "canonry ga traffic <project> [--limit 50] [--window 30d] [--format json]",
4554
+ usage: `canonry ga traffic <project> [--limit 50] ${RANGE_USAGE} [--format json]`,
4534
4555
  options: {
4535
4556
  limit: stringOption(),
4536
- window: stringOption()
4557
+ ...RANGE_OPTIONS
4537
4558
  },
4538
4559
  run: async (input) => {
4539
- const project = requireProject(input, "ga.traffic", "canonry ga traffic <project> [--limit 50] [--window 30d] [--format json]");
4560
+ const project = requireProject(input, "ga.traffic", `canonry ga traffic <project> [--limit 50] ${RANGE_USAGE} [--format json]`);
4540
4561
  const limitStr = getString(input.values, "limit");
4541
4562
  const limit = limitStr ? parseInt(limitStr, 10) : void 0;
4542
- const window = getString(input.values, "window");
4543
4563
  await gaTraffic(project, {
4544
4564
  limit,
4545
- window,
4565
+ ...rangeValues(input.values),
4546
4566
  format: input.format
4547
4567
  });
4548
4568
  }
@@ -4557,56 +4577,48 @@ var GA_CLI_COMMANDS = [
4557
4577
  },
4558
4578
  {
4559
4579
  path: ["ga", "ai-referral-history"],
4560
- usage: "canonry ga ai-referral-history <project> [--window 30d] [--format json]",
4561
- options: {
4562
- window: stringOption()
4563
- },
4580
+ usage: `canonry ga ai-referral-history <project> ${RANGE_USAGE} [--format json]`,
4581
+ options: { ...RANGE_OPTIONS },
4564
4582
  run: async (input) => {
4565
- const project = requireProject(input, "ga.ai-referral-history", "canonry ga ai-referral-history <project> [--window 30d] [--format json]");
4583
+ const project = requireProject(input, "ga.ai-referral-history", `canonry ga ai-referral-history <project> ${RANGE_USAGE} [--format json]`);
4566
4584
  await gaAiReferralHistory(project, {
4567
- window: getString(input.values, "window"),
4585
+ ...rangeValues(input.values),
4568
4586
  format: input.format
4569
4587
  });
4570
4588
  }
4571
4589
  },
4572
4590
  {
4573
4591
  path: ["ga", "ai-referral-daily"],
4574
- usage: "canonry ga ai-referral-daily <project> [--window 30d] [--format json]",
4575
- options: {
4576
- window: stringOption()
4577
- },
4592
+ usage: `canonry ga ai-referral-daily <project> ${RANGE_USAGE} [--format json]`,
4593
+ options: { ...RANGE_OPTIONS },
4578
4594
  run: async (input) => {
4579
- const project = requireProject(input, "ga.ai-referral-daily", "canonry ga ai-referral-daily <project> [--window 30d] [--format json]");
4595
+ const project = requireProject(input, "ga.ai-referral-daily", `canonry ga ai-referral-daily <project> ${RANGE_USAGE} [--format json]`);
4580
4596
  await gaAiReferralDaily(project, {
4581
- window: getString(input.values, "window"),
4597
+ ...rangeValues(input.values),
4582
4598
  format: input.format
4583
4599
  });
4584
4600
  }
4585
4601
  },
4586
4602
  {
4587
4603
  path: ["ga", "social-referral-history"],
4588
- usage: "canonry ga social-referral-history <project> [--window 30d] [--format json]",
4589
- options: {
4590
- window: stringOption()
4591
- },
4604
+ usage: `canonry ga social-referral-history <project> ${RANGE_USAGE} [--format json]`,
4605
+ options: { ...RANGE_OPTIONS },
4592
4606
  run: async (input) => {
4593
- const project = requireProject(input, "ga.social-referral-history", "canonry ga social-referral-history <project> [--window 30d] [--format json]");
4607
+ const project = requireProject(input, "ga.social-referral-history", `canonry ga social-referral-history <project> ${RANGE_USAGE} [--format json]`);
4594
4608
  await gaSocialReferralHistory(project, {
4595
- window: getString(input.values, "window"),
4609
+ ...rangeValues(input.values),
4596
4610
  format: input.format
4597
4611
  });
4598
4612
  }
4599
4613
  },
4600
4614
  {
4601
4615
  path: ["ga", "session-history"],
4602
- usage: "canonry ga session-history <project> [--window 30d] [--format json]",
4603
- options: {
4604
- window: stringOption()
4605
- },
4616
+ usage: `canonry ga session-history <project> ${RANGE_USAGE} [--format json]`,
4617
+ options: { ...RANGE_OPTIONS },
4606
4618
  run: async (input) => {
4607
- const project = requireProject(input, "ga.session-history", "canonry ga session-history <project> [--window 30d] [--format json]");
4619
+ const project = requireProject(input, "ga.session-history", `canonry ga session-history <project> ${RANGE_USAGE} [--format json]`);
4608
4620
  await gaSessionHistory(project, {
4609
- window: getString(input.values, "window"),
4621
+ ...rangeValues(input.values),
4610
4622
  format: input.format
4611
4623
  });
4612
4624
  }
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-HXXO2AF5.js";
3
+ } from "./chunk-UFPP5CSN.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-ZCFQGF3V.js";
7
- import "./chunk-2LUSZFB6.js";
8
- import "./chunk-OJOA425V.js";
6
+ } from "./chunk-D7NJUGNQ.js";
7
+ import "./chunk-NR6OGEV3.js";
8
+ import "./chunk-LS6SEZVF.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-2LUSZFB6.js";
4
- import "./chunk-OJOA425V.js";
3
+ } from "./chunk-NR6OGEV3.js";
4
+ import "./chunk-LS6SEZVF.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-ZCFQGF3V.js";
6
+ } from "./chunk-D7NJUGNQ.js";
7
7
  import {
8
8
  isReadOnlyKey
9
- } from "./chunk-OJOA425V.js";
9
+ } from "./chunk-LS6SEZVF.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": "@canonry/canonry",
3
- "version": "4.141.0",
3
+ "version": "4.142.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,26 +65,26 @@
65
65
  "@types/node-cron": "^3.0.11",
66
66
  "tsup": "^8.5.1",
67
67
  "tsx": "^4.19.0",
68
- "@ainyc/canonry-config": "0.0.0",
69
68
  "@ainyc/canonry-api-client": "0.0.0",
70
69
  "@ainyc/canonry-contracts": "0.0.0",
71
70
  "@ainyc/canonry-db": "0.0.0",
71
+ "@ainyc/canonry-config": "0.0.0",
72
72
  "@ainyc/canonry-api-routes": "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-openai-ads": "0.0.0",
76
75
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
77
- "@ainyc/canonry-integration-google": "0.0.0",
76
+ "@ainyc/canonry-integration-openai-ads": "0.0.0",
78
77
  "@ainyc/canonry-integration-google-business-profile": "0.0.0",
79
78
  "@ainyc/canonry-integration-google-places": "0.0.0",
80
79
  "@ainyc/canonry-integration-traffic": "0.0.0",
81
- "@ainyc/canonry-intelligence": "0.0.0",
80
+ "@ainyc/canonry-integration-google": "0.0.0",
81
+ "@ainyc/canonry-integration-wordpress": "0.0.0",
82
82
  "@ainyc/canonry-provider-cdp": "0.0.0",
83
- "@ainyc/canonry-provider-gemini": "0.0.0",
83
+ "@ainyc/canonry-intelligence": "0.0.0",
84
84
  "@ainyc/canonry-provider-claude": "0.0.0",
85
+ "@ainyc/canonry-provider-gemini": "0.0.0",
85
86
  "@ainyc/canonry-provider-local": "0.0.0",
86
87
  "@ainyc/canonry-provider-openai": "0.0.0",
87
- "@ainyc/canonry-integration-wordpress": "0.0.0",
88
88
  "@ainyc/canonry-provider-perplexity": "0.0.0"
89
89
  },
90
90
  "scripts": {