@ainyc/canonry 4.13.1 → 4.14.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.
package/dist/cli.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  setGoogleAuthConfig,
19
19
  showFirstRunNotice,
20
20
  trackEvent
21
- } from "./chunk-RIGQFQJJ.js";
21
+ } from "./chunk-UQHWSCTE.js";
22
22
  import {
23
23
  CliError,
24
24
  EXIT_SYSTEM_ERROR,
@@ -33,7 +33,7 @@ import {
33
33
  saveConfig,
34
34
  saveConfigPatch,
35
35
  usageError
36
- } from "./chunk-LNRDWAG3.js";
36
+ } from "./chunk-5NYG5EC7.js";
37
37
  import {
38
38
  apiKeys,
39
39
  competitors,
@@ -45,7 +45,7 @@ import {
45
45
  projects,
46
46
  querySnapshots,
47
47
  runs
48
- } from "./chunk-DCE3B6KD.js";
48
+ } from "./chunk-7HBZCGRL.js";
49
49
  import {
50
50
  CcReleaseSyncStatuses,
51
51
  CheckScopes,
@@ -64,7 +64,7 @@ import {
64
64
  providerQuotaPolicySchema,
65
65
  resolveProviderInput,
66
66
  skillsClientSchema
67
- } from "./chunk-YDGT5CAY.js";
67
+ } from "./chunk-6QTH5NS5.js";
68
68
 
69
69
  // src/cli.ts
70
70
  import { pathToFileURL } from "url";
@@ -580,7 +580,7 @@ function readStoredGroundingSources(rawResponse) {
580
580
  return result;
581
581
  }
582
582
  async function backfillInsightsCommand(project, opts) {
583
- const { IntelligenceService } = await import("./intelligence-service-NT24OLLA.js");
583
+ const { IntelligenceService } = await import("./intelligence-service-BCKXIKIL.js");
584
584
  const config = loadConfig();
585
585
  const db = createClient(config.database);
586
586
  migrate(db);
@@ -2378,6 +2378,10 @@ async function gaAttribution(project, opts) {
2378
2378
  aiSharePctBySessionDisplay: traffic.aiSharePctBySessionDisplay,
2379
2379
  socialSharePctDisplay: traffic.socialSharePctDisplay,
2380
2380
  directSharePctDisplay: traffic.directSharePctDisplay,
2381
+ otherSessions: traffic.otherSessions,
2382
+ otherSharePct: traffic.otherSharePct,
2383
+ otherSharePctDisplay: traffic.otherSharePctDisplay,
2384
+ channelBreakdown: traffic.channelBreakdown,
2381
2385
  aiReferrals: traffic.aiReferrals,
2382
2386
  aiReferralLandingPages: traffic.aiReferralLandingPages,
2383
2387
  socialReferrals: traffic.socialReferrals,
@@ -2395,15 +2399,11 @@ async function gaAttribution(project, opts) {
2395
2399
  console.log(` Total Users: ${traffic.totalUsers}`);
2396
2400
  console.log();
2397
2401
  console.log(" CHANNEL BREAKDOWN 7d trend 30d trend");
2398
- console.log(` Organic Search: ${String(traffic.totalOrganicSessions).padEnd(6)} (${traffic.organicSharePctDisplay.padStart(4)}) ${fmtTrend(trend.organic.trend7dPct).padEnd(12)} ${fmtTrend(trend.organic.trend30dPct)}`);
2399
- console.log(` Social: ${String(traffic.socialSessions).padEnd(6)} (${traffic.socialSharePctDisplay.padStart(4)}) ${fmtTrend(trend.social.trend7dPct).padEnd(12)} ${fmtTrend(trend.social.trend30dPct)}`);
2400
- console.log(` Direct: ${String(traffic.totalDirectSessions).padEnd(6)} (${traffic.directSharePctDisplay.padStart(4)}) ${fmtTrend(trend.direct.trend7dPct).padEnd(12)} ${fmtTrend(trend.direct.trend30dPct)}`);
2401
- console.log(` AI Referrals: ${String(traffic.aiSessionsBySession).padEnd(6)} (${traffic.aiSharePctBySessionDisplay.padStart(4)}) ${fmtTrend(trend.ai.trend7dPct).padEnd(12)} ${fmtTrend(trend.ai.trend30dPct)} (lower bound \u2014 sessionSource only; referrer-stripped traffic falls under Direct)`);
2402
- const otherSessions2 = traffic.totalSessions - traffic.totalOrganicSessions - traffic.aiSessionsBySession - traffic.socialSessions - traffic.totalDirectSessions;
2403
- if (otherSessions2 > 0) {
2404
- const otherPct = traffic.totalSessions > 0 ? Math.round(otherSessions2 / traffic.totalSessions * 100) : 0;
2405
- console.log(` Other: ${String(otherSessions2).padEnd(6)} (${String(otherPct).padStart(2)}%)`);
2406
- }
2402
+ console.log(` Organic Search: ${String(traffic.channelBreakdown.organic.sessions).padEnd(6)} (${traffic.channelBreakdown.organic.sharePctDisplay.padStart(4)}) ${fmtTrend(trend.organic.trend7dPct).padEnd(12)} ${fmtTrend(trend.organic.trend30dPct)}`);
2403
+ console.log(` Social: ${String(traffic.channelBreakdown.social.sessions).padEnd(6)} (${traffic.channelBreakdown.social.sharePctDisplay.padStart(4)}) ${fmtTrend(trend.social.trend7dPct).padEnd(12)} ${fmtTrend(trend.social.trend30dPct)}`);
2404
+ console.log(` Direct: ${String(traffic.channelBreakdown.direct.sessions).padEnd(6)} (${traffic.channelBreakdown.direct.sharePctDisplay.padStart(4)}) ${fmtTrend(trend.direct.trend7dPct).padEnd(12)} ${fmtTrend(trend.direct.trend30dPct)}`);
2405
+ console.log(` AI Referrals: ${String(traffic.channelBreakdown.ai.sessions).padEnd(6)} (${traffic.channelBreakdown.ai.sharePctDisplay.padStart(4)}) ${fmtTrend(trend.ai.trend7dPct).padEnd(12)} ${fmtTrend(trend.ai.trend30dPct)} (lower bound \u2014 sessionSource only; referrer-stripped traffic falls under Direct)`);
2406
+ console.log(` Other: ${String(traffic.channelBreakdown.other.sessions).padEnd(6)} (${traffic.channelBreakdown.other.sharePctDisplay.padStart(4)})`);
2407
2407
  console.log(` \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`);
2408
2408
  console.log(` Total: ${String(traffic.totalSessions).padEnd(6)} ${fmtTrend(trend.total.trend7dPct).padEnd(12)} ${fmtTrend(trend.total.trend30dPct)}`);
2409
2409
  if (trend.aiBiggestMover) {
@@ -2446,6 +2446,10 @@ async function gaAttribution(project, opts) {
2446
2446
  aiSharePctBySessionDisplay: traffic.aiSharePctBySessionDisplay,
2447
2447
  socialSharePctDisplay: traffic.socialSharePctDisplay,
2448
2448
  directSharePctDisplay: traffic.directSharePctDisplay,
2449
+ otherSessions: traffic.otherSessions,
2450
+ otherSharePct: traffic.otherSharePct,
2451
+ otherSharePctDisplay: traffic.otherSharePctDisplay,
2452
+ channelBreakdown: traffic.channelBreakdown,
2449
2453
  aiReferrals: traffic.aiReferrals,
2450
2454
  aiReferralLandingPages: traffic.aiReferralLandingPages,
2451
2455
  socialReferrals: traffic.socialReferrals,
@@ -2464,15 +2468,11 @@ async function gaAttribution(project, opts) {
2464
2468
  console.log(` Total Users: ${traffic.totalUsers}`);
2465
2469
  console.log();
2466
2470
  console.log(" CHANNEL BREAKDOWN");
2467
- console.log(` Organic Search: ${traffic.totalOrganicSessions} sessions (${traffic.organicSharePctDisplay})`);
2468
- console.log(` Social: ${traffic.socialSessions} sessions (${traffic.socialSharePctDisplay})`);
2469
- console.log(` Direct: ${traffic.totalDirectSessions} sessions (${traffic.directSharePctDisplay})`);
2470
- console.log(` AI Referrals: ${traffic.aiSessionsBySession} sessions (${traffic.aiSharePctBySessionDisplay}) (lower bound \u2014 sessionSource only; referrer-stripped traffic falls under Direct)`);
2471
- const otherSessions = traffic.totalSessions - traffic.totalOrganicSessions - traffic.aiSessionsBySession - traffic.socialSessions - traffic.totalDirectSessions;
2472
- if (otherSessions > 0) {
2473
- const otherPct = traffic.totalSessions > 0 ? Math.round(otherSessions / traffic.totalSessions * 100) : 0;
2474
- console.log(` Other: ${otherSessions} sessions (${otherPct}%)`);
2475
- }
2471
+ console.log(` Organic Search: ${traffic.channelBreakdown.organic.sessions} sessions (${traffic.channelBreakdown.organic.sharePctDisplay})`);
2472
+ console.log(` Social: ${traffic.channelBreakdown.social.sessions} sessions (${traffic.channelBreakdown.social.sharePctDisplay})`);
2473
+ console.log(` Direct: ${traffic.channelBreakdown.direct.sessions} sessions (${traffic.channelBreakdown.direct.sharePctDisplay})`);
2474
+ console.log(` AI Referrals: ${traffic.channelBreakdown.ai.sessions} sessions (${traffic.channelBreakdown.ai.sharePctDisplay}) (lower bound \u2014 sessionSource only; referrer-stripped traffic falls under Direct)`);
2475
+ console.log(` Other: ${traffic.channelBreakdown.other.sessions} sessions (${traffic.channelBreakdown.other.sharePctDisplay})`);
2476
2476
  if (traffic.aiReferrals.length > 0) {
2477
2477
  console.log();
2478
2478
  console.log(" AI SOURCES");
@@ -8368,6 +8368,7 @@ async function initCommand(opts) {
8368
8368
  skillsTip = 'Run "canonry skills install" in a project directory to add the canonry + Aero playbook to .claude/skills/ and .codex/skills/.';
8369
8369
  }
8370
8370
  }
8371
+ const nextSteps = buildNextSteps();
8371
8372
  if (format === "json") {
8372
8373
  console.log(JSON.stringify({
8373
8374
  initialized: true,
@@ -8378,7 +8379,8 @@ async function initCommand(opts) {
8378
8379
  providers: providerNames,
8379
8380
  googleConfigured: !!google,
8380
8381
  skills: skillsSummary,
8381
- skillsTip
8382
+ skillsTip,
8383
+ nextSteps
8382
8384
  }, null, 2));
8383
8385
  } else {
8384
8386
  console.log(`
@@ -8419,14 +8421,44 @@ ${skillsTip}`);
8419
8421
  }
8420
8422
  if (format !== "json") {
8421
8423
  showFirstRunNotice();
8422
- console.log('Run "canonry serve" to start the server.');
8424
+ console.log("\nNext steps:");
8425
+ for (const line of nextSteps) {
8426
+ console.log(` ${line}`);
8427
+ }
8423
8428
  }
8424
8429
  trackEvent("cli.init", {
8425
8430
  providerCount: providerNames.length,
8426
- providers: providerNames
8431
+ providers: providerNames,
8432
+ setupState: encodeSetupState({
8433
+ hasProvider: !!hasProvider,
8434
+ hasGoogle: !!google,
8435
+ hasAgent: !!agentLLM
8436
+ }),
8437
+ skillsInstalled: !!skillsSummary
8427
8438
  });
8428
8439
  return agentLLM;
8429
8440
  }
8441
+ function buildNextSteps() {
8442
+ return [
8443
+ "1. Create a project for the domain you want to track:",
8444
+ " canonry project create my-site --domain example.com --country US --language en",
8445
+ "",
8446
+ "2. Add the questions your customers ask AI assistants:",
8447
+ ' canonry query add my-site "best <category> for <use case>"',
8448
+ "",
8449
+ "3. Run your first sweep:",
8450
+ " canonry run my-site",
8451
+ "",
8452
+ 'Tip: "canonry doctor" verifies your setup. "canonry serve" opens the dashboard.'
8453
+ ];
8454
+ }
8455
+ function encodeSetupState(state) {
8456
+ const flags = [];
8457
+ if (state.hasProvider) flags.push("provider");
8458
+ if (state.hasGoogle) flags.push("google");
8459
+ if (state.hasAgent) flags.push("agent");
8460
+ return flags.length > 0 ? flags.sort().join("|") : "none";
8461
+ }
8430
8462
 
8431
8463
  // src/commands/serve.ts
8432
8464
  function resolveServePort(envPort, configPort) {
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-RIGQFQJJ.js";
3
+ } from "./chunk-UQHWSCTE.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-LNRDWAG3.js";
7
- import "./chunk-DCE3B6KD.js";
8
- import "./chunk-YDGT5CAY.js";
6
+ } from "./chunk-5NYG5EC7.js";
7
+ import "./chunk-7HBZCGRL.js";
8
+ import "./chunk-6QTH5NS5.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-DCE3B6KD.js";
4
- import "./chunk-YDGT5CAY.js";
3
+ } from "./chunk-7HBZCGRL.js";
4
+ import "./chunk-6QTH5NS5.js";
5
5
  export {
6
6
  IntelligenceService
7
7
  };
package/dist/mcp.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  CliError,
3
3
  canonryMcpTools,
4
4
  createApiClient
5
- } from "./chunk-LNRDWAG3.js";
6
- import "./chunk-YDGT5CAY.js";
5
+ } from "./chunk-5NYG5EC7.js";
6
+ import "./chunk-6QTH5NS5.js";
7
7
 
8
8
  // src/mcp/cli.ts
9
9
  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.13.1",
3
+ "version": "4.14.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",
@@ -60,20 +60,20 @@
60
60
  "tsup": "^8.5.1",
61
61
  "tsx": "^4.19.0",
62
62
  "@ainyc/canonry-api-routes": "0.0.0",
63
- "@ainyc/canonry-contracts": "0.0.0",
64
- "@ainyc/canonry-db": "0.0.0",
65
63
  "@ainyc/canonry-config": "0.0.0",
66
- "@ainyc/canonry-integration-bing": "0.0.0",
67
64
  "@ainyc/canonry-intelligence": "0.0.0",
65
+ "@ainyc/canonry-contracts": "0.0.0",
66
+ "@ainyc/canonry-db": "0.0.0",
68
67
  "@ainyc/canonry-integration-cloud-run": "0.0.0",
68
+ "@ainyc/canonry-integration-bing": "0.0.0",
69
+ "@ainyc/canonry-integration-commoncrawl": "0.0.0",
69
70
  "@ainyc/canonry-integration-google": "0.0.0",
70
71
  "@ainyc/canonry-integration-traffic": "0.0.0",
72
+ "@ainyc/canonry-provider-claude": "0.0.0",
71
73
  "@ainyc/canonry-provider-cdp": "0.0.0",
72
74
  "@ainyc/canonry-integration-wordpress": "0.0.0",
73
- "@ainyc/canonry-provider-claude": "0.0.0",
74
75
  "@ainyc/canonry-provider-gemini": "0.0.0",
75
76
  "@ainyc/canonry-provider-local": "0.0.0",
76
- "@ainyc/canonry-integration-commoncrawl": "0.0.0",
77
77
  "@ainyc/canonry-provider-openai": "0.0.0",
78
78
  "@ainyc/canonry-provider-perplexity": "0.0.0"
79
79
  },