@ainyc/canonry 4.46.1 → 4.50.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
@@ -21,7 +21,7 @@ import {
21
21
  setTelemetrySource,
22
22
  showFirstRunNotice,
23
23
  trackEvent
24
- } from "./chunk-IYUI74JP.js";
24
+ } from "./chunk-YVP5CTSV.js";
25
25
  import {
26
26
  CliError,
27
27
  EXIT_SYSTEM_ERROR,
@@ -37,14 +37,14 @@ import {
37
37
  saveConfig,
38
38
  saveConfigPatch,
39
39
  usageError
40
- } from "./chunk-PRNO52YC.js";
40
+ } from "./chunk-MYDJ25GO.js";
41
41
  import {
42
42
  apiKeys,
43
43
  createClient,
44
44
  migrate,
45
45
  projects,
46
46
  queries
47
- } from "./chunk-K2TOOQ4F.js";
47
+ } from "./chunk-M4USKXJ4.js";
48
48
  import {
49
49
  CcReleaseSyncStatuses,
50
50
  CheckScopes,
@@ -63,7 +63,7 @@ import {
63
63
  providerQuotaPolicySchema,
64
64
  resolveProviderInput,
65
65
  skillsClientSchema
66
- } from "./chunk-MM3A2CJK.js";
66
+ } from "./chunk-QIG3TKL4.js";
67
67
 
68
68
  // src/cli.ts
69
69
  import { pathToFileURL } from "url";
@@ -2918,6 +2918,9 @@ var GET_CLI_COMMANDS = [
2918
2918
  function getClient6() {
2919
2919
  return createApiClient();
2920
2920
  }
2921
+ function configString(value, fallback = "(unset)") {
2922
+ return typeof value === "string" ? value : fallback;
2923
+ }
2921
2924
  async function trafficConnectWordpress(project, opts) {
2922
2925
  if (!opts.url) {
2923
2926
  throw new CliError({
@@ -2981,8 +2984,8 @@ async function trafficConnectWordpress(project, opts) {
2981
2984
  console.log(` Source ID: ${result.id}`);
2982
2985
  console.log(` Display name: ${result.displayName}`);
2983
2986
  console.log(` Status: ${result.status}`);
2984
- console.log(` Site URL: ${result.config.baseUrl ?? "(unset)"}`);
2985
- console.log(` Username: ${result.config.username ?? "(unset)"}`);
2987
+ console.log(` Site URL: ${configString(result.config.baseUrl)}`);
2988
+ console.log(` Username: ${configString(result.config.username)}`);
2986
2989
  console.log("");
2987
2990
  console.log(`Next: canonry traffic sync ${project} --source ${result.id}`);
2988
2991
  }
@@ -3033,9 +3036,9 @@ async function trafficConnectCloudRun(project, opts) {
3033
3036
  console.log(` Source ID: ${result.id}`);
3034
3037
  console.log(` Display name: ${result.displayName}`);
3035
3038
  console.log(` Status: ${result.status}`);
3036
- console.log(` GCP project: ${result.config.gcpProjectId ?? "(unset)"}`);
3037
- if (result.config.serviceName) console.log(` Service: ${result.config.serviceName}`);
3038
- if (result.config.location) console.log(` Location: ${result.config.location}`);
3039
+ console.log(` GCP project: ${configString(result.config.gcpProjectId)}`);
3040
+ if (result.config.serviceName) console.log(` Service: ${configString(result.config.serviceName)}`);
3041
+ if (result.config.location) console.log(` Location: ${configString(result.config.location)}`);
3039
3042
  console.log("");
3040
3043
  console.log(`Next: canonry traffic sync ${project} --source ${result.id}`);
3041
3044
  }
@@ -3111,9 +3114,9 @@ async function trafficConnectVercel(project, opts) {
3111
3114
  console.log(` Source ID: ${result.id}`);
3112
3115
  console.log(` Display name: ${result.displayName}`);
3113
3116
  console.log(` Status: ${result.status}`);
3114
- console.log(` Project ID: ${result.config.projectId ?? "(unset)"}`);
3115
- console.log(` Team ID: ${result.config.teamId ?? "(unset)"}`);
3116
- console.log(` Environment: ${result.config.environment ?? "(unset)"}`);
3117
+ console.log(` Project ID: ${configString(result.config.projectId)}`);
3118
+ console.log(` Team ID: ${configString(result.config.teamId)}`);
3119
+ console.log(` Environment: ${configString(result.config.environment)}`);
3117
3120
  console.log("");
3118
3121
  console.log(`Next: canonry traffic sync ${project} --source ${result.id}`);
3119
3122
  }
@@ -5604,8 +5607,8 @@ var NOTIFY_CLI_COMMANDS = [
5604
5607
  {
5605
5608
  path: ["notify", "events"],
5606
5609
  usage: "canonry notify events [--format json]",
5607
- run: async (input) => {
5608
- await listEvents(input.format);
5610
+ run: (input) => {
5611
+ listEvents(input.format);
5609
5612
  }
5610
5613
  },
5611
5614
  {
@@ -6555,6 +6558,9 @@ async function triggerRun(project, opts) {
6555
6558
  if (opts?.noLocation) {
6556
6559
  body.noLocation = true;
6557
6560
  }
6561
+ if (opts?.probe) {
6562
+ body.trigger = "probe";
6563
+ }
6558
6564
  const response = await client.triggerRun(project, body);
6559
6565
  if (Array.isArray(response)) {
6560
6566
  const locationRuns = response;
@@ -6821,7 +6827,7 @@ var RUN_CLI_COMMANDS = [
6821
6827
  },
6822
6828
  {
6823
6829
  path: ["run"],
6824
- usage: "canonry run <project|--all> [--provider <name>] [--query <q>...] [--location <label>] [--all-locations] [--no-location] [--wait] [--format json]",
6830
+ usage: "canonry run <project|--all> [--provider <name>] [--query <q>...] [--location <label>] [--all-locations] [--no-location] [--probe] [--wait] [--format json]",
6825
6831
  options: {
6826
6832
  provider: stringOption(),
6827
6833
  query: multiStringOption(),
@@ -6829,7 +6835,12 @@ var RUN_CLI_COMMANDS = [
6829
6835
  all: { type: "boolean", default: false },
6830
6836
  location: stringOption(),
6831
6837
  "all-locations": { type: "boolean", default: false },
6832
- "no-location": { type: "boolean", default: false }
6838
+ "no-location": { type: "boolean", default: false },
6839
+ // Probe runs are operator/agent test runs — they write a snapshot
6840
+ // for inspection but are excluded from dashboard / analytics /
6841
+ // intelligence / notifications. Use when you want to verify a
6842
+ // provider works without polluting the project's metrics.
6843
+ probe: { type: "boolean", default: false }
6833
6844
  },
6834
6845
  run: async (input) => {
6835
6846
  if (getBoolean(input.values, "all")) {
@@ -6873,6 +6884,7 @@ var RUN_CLI_COMMANDS = [
6873
6884
  location: getString(input.values, "location"),
6874
6885
  allLocations: getBoolean(input.values, "all-locations"),
6875
6886
  noLocation: getBoolean(input.values, "no-location"),
6887
+ probe: getBoolean(input.values, "probe"),
6876
6888
  format: input.format
6877
6889
  });
6878
6890
  }
@@ -9808,39 +9820,39 @@ var SYSTEM_CLI_COMMANDS = [
9808
9820
  path: ["stop"],
9809
9821
  usage: "canonry stop [--format json]",
9810
9822
  allowPositionals: false,
9811
- run: async (input) => {
9812
- await stopDaemon(input.format);
9823
+ run: (input) => {
9824
+ stopDaemon(input.format);
9813
9825
  }
9814
9826
  },
9815
9827
  {
9816
9828
  path: ["telemetry", "status"],
9817
9829
  usage: "canonry telemetry status [--format json]",
9818
9830
  allowPositionals: false,
9819
- run: async (input) => {
9820
- await telemetryCommand("status", input.format);
9831
+ run: (input) => {
9832
+ telemetryCommand("status", input.format);
9821
9833
  }
9822
9834
  },
9823
9835
  {
9824
9836
  path: ["telemetry", "enable"],
9825
9837
  usage: "canonry telemetry enable [--format json]",
9826
9838
  allowPositionals: false,
9827
- run: async (input) => {
9828
- await telemetryCommand("enable", input.format);
9839
+ run: (input) => {
9840
+ telemetryCommand("enable", input.format);
9829
9841
  }
9830
9842
  },
9831
9843
  {
9832
9844
  path: ["telemetry", "disable"],
9833
9845
  usage: "canonry telemetry disable [--format json]",
9834
9846
  allowPositionals: false,
9835
- run: async (input) => {
9836
- await telemetryCommand("disable", input.format);
9847
+ run: (input) => {
9848
+ telemetryCommand("disable", input.format);
9837
9849
  }
9838
9850
  },
9839
9851
  {
9840
9852
  path: ["telemetry"],
9841
9853
  usage: "canonry telemetry <status|enable|disable> [--format json]",
9842
- run: async (input) => {
9843
- await unknownSubcommand(input.positionals[0], {
9854
+ run: (input) => {
9855
+ unknownSubcommand(input.positionals[0], {
9844
9856
  command: "telemetry",
9845
9857
  usage: "canonry telemetry <status|enable|disable> [--format json]",
9846
9858
  available: ["status", "enable", "disable"]
@@ -9856,6 +9868,9 @@ import fs12 from "fs";
9856
9868
  function getClient21() {
9857
9869
  return createApiClient();
9858
9870
  }
9871
+ async function loadYamlModule() {
9872
+ return await import("yaml").catch(() => null);
9873
+ }
9859
9874
  function printJson2(value) {
9860
9875
  console.log(JSON.stringify(value, null, 2));
9861
9876
  }
@@ -10190,7 +10205,7 @@ async function wordpressSetSchema(project, body) {
10190
10205
  async function wordpressSchemaDeploy(project, opts) {
10191
10206
  const fs13 = await import("fs/promises");
10192
10207
  const path10 = await import("path");
10193
- const yaml = await import("yaml").catch(() => null);
10208
+ const yaml = await loadYamlModule();
10194
10209
  const filePath = path10.resolve(opts.profile);
10195
10210
  let raw;
10196
10211
  try {
@@ -10205,7 +10220,7 @@ async function wordpressSchemaDeploy(project, opts) {
10205
10220
  }
10206
10221
  let parsed;
10207
10222
  try {
10208
- if (yaml?.parse) {
10223
+ if (yaml) {
10209
10224
  parsed = yaml.parse(raw);
10210
10225
  } else {
10211
10226
  parsed = JSON.parse(raw);
@@ -10301,7 +10316,7 @@ async function wordpressOnboard(project, opts) {
10301
10316
  if (opts.profile) {
10302
10317
  const fs13 = await import("fs/promises");
10303
10318
  const path10 = await import("path");
10304
- const yaml = await import("yaml").catch(() => null);
10319
+ const yaml = await loadYamlModule();
10305
10320
  const filePath = path10.resolve(opts.profile);
10306
10321
  let raw;
10307
10322
  try {
@@ -10315,7 +10330,7 @@ async function wordpressOnboard(project, opts) {
10315
10330
  });
10316
10331
  }
10317
10332
  try {
10318
- profileData = yaml?.parse ? yaml.parse(raw) : JSON.parse(raw);
10333
+ profileData = yaml ? yaml.parse(raw) : JSON.parse(raw);
10319
10334
  } catch {
10320
10335
  throw new CliError({
10321
10336
  code: "INVALID_PROFILE",
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-IYUI74JP.js";
3
+ } from "./chunk-YVP5CTSV.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-PRNO52YC.js";
7
- import "./chunk-K2TOOQ4F.js";
8
- import "./chunk-MM3A2CJK.js";
6
+ } from "./chunk-MYDJ25GO.js";
7
+ import "./chunk-M4USKXJ4.js";
8
+ import "./chunk-QIG3TKL4.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-K2TOOQ4F.js";
4
- import "./chunk-MM3A2CJK.js";
3
+ } from "./chunk-M4USKXJ4.js";
4
+ import "./chunk-QIG3TKL4.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-PRNO52YC.js";
6
- import "./chunk-MM3A2CJK.js";
5
+ } from "./chunk-MYDJ25GO.js";
6
+ import "./chunk-QIG3TKL4.js";
7
7
 
8
8
  // src/mcp/cli.ts
9
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -68,11 +68,12 @@ function toCanonryErrorEnvelope(error) {
68
68
  };
69
69
  }
70
70
  if (hasErrorEnvelope(error)) {
71
+ const { code, message, details } = error.error;
71
72
  return {
72
73
  error: {
73
- code: String(error.error.code ?? "API_ERROR"),
74
- message: String(error.error.message ?? "Canonry API error"),
75
- ...error.error.details !== void 0 ? { details: error.error.details } : {}
74
+ code: typeof code === "string" ? code : "API_ERROR",
75
+ message: typeof message === "string" ? message : "Canonry API error",
76
+ ...details !== void 0 ? { details } : {}
76
77
  }
77
78
  };
78
79
  }
@@ -237,7 +238,7 @@ var DynamicToolCatalog = class {
237
238
  // the SDK's sender for the duration of the batch.
238
239
  batchListChanged(fn) {
239
240
  const host = this.server;
240
- const original = host.sendToolListChanged;
241
+ const original = host.sendToolListChanged.bind(host);
241
242
  let suppressed = false;
242
243
  host.sendToolListChanged = () => {
243
244
  suppressed = true;
@@ -247,7 +248,7 @@ var DynamicToolCatalog = class {
247
248
  } finally {
248
249
  host.sendToolListChanged = original;
249
250
  }
250
- if (suppressed) original.call(host);
251
+ if (suppressed) original();
251
252
  }
252
253
  };
253
254
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainyc/canonry",
3
- "version": "4.46.1",
3
+ "version": "4.50.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",
@@ -53,7 +53,8 @@
53
53
  "pdf-lib": "^1.17.1",
54
54
  "pino-pretty": "^13.1.3",
55
55
  "yaml": "^2.7.1",
56
- "zod": "^4.1.12"
56
+ "zod": "^4.1.12",
57
+ "@ainyc/canonry-api-client": "0.0.0"
57
58
  },
58
59
  "devDependencies": {
59
60
  "@types/better-sqlite3": "^7.6.13",
@@ -61,21 +62,21 @@
61
62
  "tsup": "^8.5.1",
62
63
  "tsx": "^4.19.0",
63
64
  "@ainyc/canonry-api-routes": "0.0.0",
64
- "@ainyc/canonry-config": "0.0.0",
65
65
  "@ainyc/canonry-contracts": "0.0.0",
66
+ "@ainyc/canonry-config": "0.0.0",
66
67
  "@ainyc/canonry-db": "0.0.0",
67
68
  "@ainyc/canonry-intelligence": "0.0.0",
68
- "@ainyc/canonry-integration-cloud-run": "0.0.0",
69
69
  "@ainyc/canonry-integration-bing": "0.0.0",
70
70
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
71
71
  "@ainyc/canonry-integration-google": "0.0.0",
72
+ "@ainyc/canonry-integration-cloud-run": "0.0.0",
72
73
  "@ainyc/canonry-integration-traffic": "0.0.0",
73
74
  "@ainyc/canonry-integration-wordpress": "0.0.0",
74
- "@ainyc/canonry-provider-cdp": "0.0.0",
75
75
  "@ainyc/canonry-provider-claude": "0.0.0",
76
76
  "@ainyc/canonry-provider-local": "0.0.0",
77
- "@ainyc/canonry-provider-openai": "0.0.0",
78
77
  "@ainyc/canonry-provider-gemini": "0.0.0",
78
+ "@ainyc/canonry-provider-cdp": "0.0.0",
79
+ "@ainyc/canonry-provider-openai": "0.0.0",
79
80
  "@ainyc/canonry-provider-perplexity": "0.0.0"
80
81
  },
81
82
  "scripts": {