@ainyc/canonry 4.99.0 → 4.100.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 (27) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +13 -1
  2. package/assets/assets/{BacklinksPage-CuWs7I1D.js → BacklinksPage-DWZdWEm3.js} +1 -1
  3. package/assets/assets/{ChartPrimitives-bm37tprp.js → ChartPrimitives-C-ky5206.js} +1 -1
  4. package/assets/assets/ProjectPage-CpbFpi6J.js +6 -0
  5. package/assets/assets/{RunRow-DzhQl87g.js → RunRow-Bj-D4kZe.js} +1 -1
  6. package/assets/assets/{RunsPage-wOaewhbF.js → RunsPage-GktitsAV.js} +1 -1
  7. package/assets/assets/{SettingsPage-CJdhhkkE.js → SettingsPage-AsFLFDS3.js} +1 -1
  8. package/assets/assets/{TrafficPage-BJBeN5Ph.js → TrafficPage-Cf3uCkxs.js} +1 -1
  9. package/assets/assets/{TrafficSourceDetailPage-D3PmH0B1.js → TrafficSourceDetailPage-B5t7nf9C.js} +1 -1
  10. package/assets/assets/{arrow-left-BmITMI6O.js → arrow-left-CZFQuQO_.js} +1 -1
  11. package/assets/assets/{extract-error-message-BGwnyAfP.js → extract-error-message--bieZ2IX.js} +1 -1
  12. package/assets/assets/index-9hI0ODQU.css +1 -0
  13. package/assets/assets/index-Cb2h7KkD.js +210 -0
  14. package/assets/assets/{trash-2-Bd2mkP_w.js → trash-2-sKO0k75f.js} +1 -1
  15. package/assets/index.html +2 -2
  16. package/dist/{chunk-CEHD33NQ.js → chunk-74SOIAIY.js} +262 -119
  17. package/dist/{chunk-CWFTMFEU.js → chunk-ADLS64PG.js} +117 -3
  18. package/dist/{chunk-DJVUNURL.js → chunk-SNHYRSUF.js} +401 -40
  19. package/dist/{chunk-VQN74WWA.js → chunk-UVIHWF45.js} +27 -1
  20. package/dist/cli.js +110 -4
  21. package/dist/index.js +4 -4
  22. package/dist/{intelligence-service-QHBXW4KI.js → intelligence-service-3CRNJLUZ.js} +2 -2
  23. package/dist/mcp.js +2 -2
  24. package/package.json +10 -10
  25. package/assets/assets/ProjectPage-BksYe8FP.js +0 -6
  26. package/assets/assets/index-BSX6r6ju.js +0 -210
  27. package/assets/assets/index-BsZNCwg8.css +0 -1
@@ -24,7 +24,7 @@ import {
24
24
  trafficConnectVercelRequestSchema,
25
25
  trafficConnectWordpressRequestSchema,
26
26
  trafficEventKindSchema
27
- } from "./chunk-CWFTMFEU.js";
27
+ } from "./chunk-ADLS64PG.js";
28
28
 
29
29
  // src/config.ts
30
30
  import fs from "fs";
@@ -3085,6 +3085,18 @@ var getApiV1ProjectsByNameContentGaps = (options) => {
3085
3085
  ...options
3086
3086
  });
3087
3087
  };
3088
+ var getApiV1Portfolio = (options) => {
3089
+ return (options?.client ?? client).get({
3090
+ security: [
3091
+ {
3092
+ scheme: "bearer",
3093
+ type: "http"
3094
+ }
3095
+ ],
3096
+ url: "/api/v1/portfolio",
3097
+ ...options
3098
+ });
3099
+ };
3088
3100
  var getApiV1ProjectsByNameOverview = (options) => {
3089
3101
  return (options.client ?? client).get({
3090
3102
  security: [
@@ -3908,6 +3920,9 @@ var ApiClient = class {
3908
3920
  async apply(config) {
3909
3921
  return this.invoke(() => postApiV1Apply({ client: this.heyClient, body: config }));
3910
3922
  }
3923
+ async getPortfolio() {
3924
+ return this.invoke(() => getApiV1Portfolio({ client: this.heyClient }));
3925
+ }
3911
3926
  async getProjectOverview(project, opts) {
3912
3927
  return this.invoke(
3913
3928
  () => getApiV1ProjectsByNameOverview({
@@ -5681,6 +5696,17 @@ var canonryMcpTools = [
5681
5696
  openApiOperations: ["GET /api/v1/projects/{name}/report"],
5682
5697
  handler: (client2, input) => client2.getReport(input.project, input.period !== void 0 ? { period: input.period } : void 0)
5683
5698
  }),
5699
+ defineTool({
5700
+ name: "canonry_portfolio",
5701
+ title: "Get portfolio change feed (composite)",
5702
+ description: 'One-call cross-project portfolio: a server-ordered "what changed" feed \u2014 citation and mention gains/losses over each project\'s comparable query basket, failed sweeps, critical/high insight echoes, stale-visibility, query-set changes, and never-run projects, ranked by recency then severity \u2014 plus a timestamped recent-runs log carrying BOTH result signals (mentioned vs cited counts, independent) and a per-project state table. Probe runs excluded. Use it to answer "what changed across all my projects" without fanning out per project. `generatedAt` anchors every relative timestamp.',
5703
+ access: "read",
5704
+ tier: "monitoring",
5705
+ inputSchema: emptyInputSchema,
5706
+ annotations: readAnnotations(),
5707
+ openApiOperations: ["GET /api/v1/portfolio"],
5708
+ handler: (client2) => client2.getPortfolio()
5709
+ }),
5684
5710
  defineTool({
5685
5711
  name: "canonry_analytics_metrics",
5686
5712
  title: "Get citation & mention trend",
package/dist/cli.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  setTelemetrySource,
28
28
  showFirstRunNotice,
29
29
  trackEvent
30
- } from "./chunk-CEHD33NQ.js";
30
+ } from "./chunk-74SOIAIY.js";
31
31
  import {
32
32
  CliError,
33
33
  EXIT_SYSTEM_ERROR,
@@ -44,7 +44,7 @@ import {
44
44
  saveConfig,
45
45
  saveConfigPatch,
46
46
  usageError
47
- } from "./chunk-VQN74WWA.js";
47
+ } from "./chunk-UVIHWF45.js";
48
48
  import {
49
49
  apiKeys,
50
50
  createClient,
@@ -52,7 +52,7 @@ import {
52
52
  projects,
53
53
  queries,
54
54
  renderReportHtml
55
- } from "./chunk-DJVUNURL.js";
55
+ } from "./chunk-SNHYRSUF.js";
56
56
  import {
57
57
  BacklinkSources,
58
58
  CcReleaseSyncStatuses,
@@ -72,13 +72,14 @@ import {
72
72
  formatIsoDate,
73
73
  formatMicros,
74
74
  formatRatio,
75
+ formatRelativeTime,
75
76
  formatRunErrorOneLine,
76
77
  normalizeProjectAliases,
77
78
  notificationEventSchema,
78
79
  providerQuotaPolicySchema,
79
80
  resolveProviderInput,
80
81
  winnabilityClassSchema
81
- } from "./chunk-CWFTMFEU.js";
82
+ } from "./chunk-ADLS64PG.js";
82
83
 
83
84
  // src/cli.ts
84
85
  import { pathToFileURL } from "url";
@@ -9594,6 +9595,103 @@ function pct2(value) {
9594
9595
  return `${(value * 100).toFixed(1)}%`;
9595
9596
  }
9596
9597
 
9598
+ // src/commands/portfolio.ts
9599
+ async function showPortfolio(opts) {
9600
+ const client = createApiClient();
9601
+ const portfolio = await client.getPortfolio();
9602
+ if (isMachineFormat(opts.format)) {
9603
+ if (opts.format === "jsonl") {
9604
+ emitJsonl(portfolio.changeFeed);
9605
+ return;
9606
+ }
9607
+ console.log(JSON.stringify(portfolio, null, 2));
9608
+ return;
9609
+ }
9610
+ renderHuman2(portfolio);
9611
+ }
9612
+ function renderHuman2(p) {
9613
+ const now = p.generatedAt;
9614
+ const sweep = p.lastSweepAt ? formatRelativeTime(p.lastSweepAt, now) : "never";
9615
+ console.log(`
9616
+ Portfolio \xB7 ${p.projectCount} project${p.projectCount === 1 ? "" : "s"} \xB7 last sweep ${sweep}
9617
+ `);
9618
+ const moreLabel = p.changeFeedTotal > p.changeFeed.length ? ` (showing ${p.changeFeed.length} of ${p.changeFeedTotal})` : "";
9619
+ console.log(`What changed${moreLabel}:`);
9620
+ if (p.changeFeed.length === 0) {
9621
+ const empty = p.feedEmptyState;
9622
+ console.log(` ${empty ? `${empty.title} \u2014 ${empty.detail}` : "No changes."}`);
9623
+ } else {
9624
+ for (const c of p.changeFeed) {
9625
+ console.log(` ${changeGlyph(c.tone)} ${c.title} (${formatRelativeTime(c.occurredAt, now)})`);
9626
+ if (c.detail) console.log(` ${c.detail}`);
9627
+ }
9628
+ }
9629
+ console.log("\nRecent runs (M mentioned in answer \xB7 C cited in sources):");
9630
+ if (p.recentRuns.length === 0) {
9631
+ console.log(" Run history appears here after the first sweep.");
9632
+ } else {
9633
+ for (const r of p.recentRuns) {
9634
+ console.log(
9635
+ ` ${pad(r.projectName, 20)} ${pad(runResult(r), 20)} ${pad(runWhen(r, now), 20)} ${runDuration(r)}`
9636
+ );
9637
+ }
9638
+ }
9639
+ console.log("\nProjects:");
9640
+ for (const proj of p.projects) {
9641
+ const mentioned = `M ${proj.mentionedOfTotal.mentioned}/${proj.mentionedOfTotal.total}`;
9642
+ const cited = `C ${proj.citedOfTotal.cited}/${proj.citedOfTotal.total}`;
9643
+ console.log(
9644
+ ` ${pad(proj.projectSlug, 20)} ${String(proj.mentionScore).padStart(3)} ${pad(mentioned, 10)} ${pad(cited, 10)} ${projectDelta(proj)}`
9645
+ );
9646
+ }
9647
+ console.log();
9648
+ }
9649
+ function changeGlyph(tone) {
9650
+ switch (tone) {
9651
+ case "negative":
9652
+ return "v";
9653
+ case "positive":
9654
+ return "^";
9655
+ case "caution":
9656
+ return "!";
9657
+ case "neutral":
9658
+ return ".";
9659
+ }
9660
+ }
9661
+ function runResult(r) {
9662
+ if (r.status === "failed") return r.errorSummary ?? "failed";
9663
+ if (r.mentionedCount == null || r.citedCount == null || r.totalCount == null) return "\u2014";
9664
+ return `M ${r.mentionedCount}/${r.totalCount} \xB7 C ${r.citedCount}/${r.totalCount}`;
9665
+ }
9666
+ function runWhen(r, now) {
9667
+ const ts = r.finishedAt ?? r.startedAt ?? r.createdAt;
9668
+ const rel = formatRelativeTime(ts, now);
9669
+ if (r.status === "running") return `started ${rel}`;
9670
+ if (r.status === "queued") return `queued ${rel}`;
9671
+ return `finished ${rel}`;
9672
+ }
9673
+ function runDuration(r) {
9674
+ if (r.durationMs == null) {
9675
+ return r.status === "running" ? "running" : r.status === "queued" ? "waiting" : "\u2014";
9676
+ }
9677
+ const seconds = Math.floor(r.durationMs / 1e3);
9678
+ if (seconds < 1) return "<1s";
9679
+ if (seconds < 60) return `${seconds}s`;
9680
+ return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
9681
+ }
9682
+ function projectDelta(proj) {
9683
+ if (!proj.hasEverRun) return "never run";
9684
+ const parts = [];
9685
+ if (proj.mentionDelta.gained > 0) parts.push(`+${proj.mentionDelta.gained}`);
9686
+ if (proj.mentionDelta.lost > 0) parts.push(`-${proj.mentionDelta.lost}`);
9687
+ if (parts.length === 0) return proj.mentionDelta.comparable ? "no change" : "first sweep";
9688
+ return `${parts.join(" ")} mentioned${proj.mentionDelta.comparable ? "" : "*"}`;
9689
+ }
9690
+ function pad(value, width) {
9691
+ if (value.length >= width) return `${value.slice(0, width - 1)} `;
9692
+ return value.padEnd(width);
9693
+ }
9694
+
9597
9695
  // src/commands/search.ts
9598
9696
  async function searchProject(project, opts) {
9599
9697
  const client = createApiClient();
@@ -9793,6 +9891,14 @@ var INTELLIGENCE_CLI_COMMANDS = [
9793
9891
  await showOverview(project, { format: input.format, location, since });
9794
9892
  }
9795
9893
  },
9894
+ {
9895
+ path: ["portfolio"],
9896
+ usage: "canonry portfolio [--format json|jsonl]",
9897
+ options: {},
9898
+ run: async (input) => {
9899
+ await showPortfolio({ format: input.format });
9900
+ }
9901
+ },
9796
9902
  {
9797
9903
  path: ["search"],
9798
9904
  usage: "canonry search <project> <query> [--limit <n>] [--format json]",
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-CEHD33NQ.js";
3
+ } from "./chunk-74SOIAIY.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-VQN74WWA.js";
7
- import "./chunk-DJVUNURL.js";
8
- import "./chunk-CWFTMFEU.js";
6
+ } from "./chunk-UVIHWF45.js";
7
+ import "./chunk-SNHYRSUF.js";
8
+ import "./chunk-ADLS64PG.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-DJVUNURL.js";
4
- import "./chunk-CWFTMFEU.js";
3
+ } from "./chunk-SNHYRSUF.js";
4
+ import "./chunk-ADLS64PG.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-VQN74WWA.js";
6
+ } from "./chunk-UVIHWF45.js";
7
7
  import {
8
8
  isReadOnlyKey
9
- } from "./chunk-CWFTMFEU.js";
9
+ } from "./chunk-ADLS64PG.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.99.0",
3
+ "version": "4.100.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
  "@ainyc/canonry-api-client": "0.0.0",
66
66
  "@ainyc/canonry-api-routes": "0.0.0",
67
67
  "@ainyc/canonry-contracts": "0.0.0",
68
- "@ainyc/canonry-config": "0.0.0",
69
68
  "@ainyc/canonry-db": "0.0.0",
70
- "@ainyc/canonry-integration-openai-ads": "0.0.0",
71
69
  "@ainyc/canonry-integration-bing": "0.0.0",
72
- "@ainyc/canonry-integration-cloud-run": "0.0.0",
70
+ "@ainyc/canonry-config": "0.0.0",
71
+ "@ainyc/canonry-integration-openai-ads": "0.0.0",
73
72
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
74
73
  "@ainyc/canonry-integration-google": "0.0.0",
75
74
  "@ainyc/canonry-integration-google-business-profile": "0.0.0",
76
- "@ainyc/canonry-integration-traffic": "0.0.0",
77
- "@ainyc/canonry-intelligence": "0.0.0",
75
+ "@ainyc/canonry-integration-cloud-run": "0.0.0",
78
76
  "@ainyc/canonry-integration-google-places": "0.0.0",
77
+ "@ainyc/canonry-integration-traffic": "0.0.0",
78
+ "@ainyc/canonry-integration-wordpress": "0.0.0",
79
79
  "@ainyc/canonry-provider-cdp": "0.0.0",
80
+ "@ainyc/canonry-intelligence": "0.0.0",
80
81
  "@ainyc/canonry-provider-claude": "0.0.0",
81
- "@ainyc/canonry-provider-gemini": "0.0.0",
82
- "@ainyc/canonry-integration-wordpress": "0.0.0",
83
82
  "@ainyc/canonry-provider-local": "0.0.0",
84
- "@ainyc/canonry-provider-openai": "0.0.0",
85
- "@ainyc/canonry-provider-perplexity": "0.0.0"
83
+ "@ainyc/canonry-provider-gemini": "0.0.0",
84
+ "@ainyc/canonry-provider-perplexity": "0.0.0",
85
+ "@ainyc/canonry-provider-openai": "0.0.0"
86
86
  },
87
87
  "scripts": {
88
88
  "build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",