@canonry/canonry 7.44.0 → 7.44.1

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.
@@ -31,7 +31,7 @@ import {
31
31
  trackFeatureCompleted,
32
32
  trackIntegrationConnection,
33
33
  waitForServerRuntimeStartup
34
- } from "./chunk-QQYQDTFZ.js";
34
+ } from "./chunk-LK7O7RM6.js";
35
35
  import {
36
36
  clearDashboardPassword,
37
37
  configExists,
@@ -19436,7 +19436,7 @@ var SYSTEM_CLI_COMMANDS = [
19436
19436
  options: { access: stringOption() },
19437
19437
  run: async (input) => {
19438
19438
  if (input.positionals.length > 1) throw usageError("Expected at most one command group");
19439
- const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-PNJEQV5H.js"), import("./cli-commands-4UT2CRXX.js")]);
19439
+ const [{ printCliCatalog }, { REGISTERED_CLI_COMMANDS: REGISTERED_CLI_COMMANDS2 }] = await Promise.all([import("./cli-catalog-PNJEQV5H.js"), import("./cli-commands-D3JIQ2ID.js")]);
19440
19440
  printCliCatalog(REGISTERED_CLI_COMMANDS2, input.format, input.positionals[0], getString(input.values, "access"));
19441
19441
  }
19442
19442
  },
@@ -4812,6 +4812,7 @@ function listModels(config, signal) {
4812
4812
  }
4813
4813
 
4814
4814
  // ../provider-gemini/src/adapter.ts
4815
+ import { FinishReason } from "@google/genai";
4815
4816
  function toGeminiConfig(config) {
4816
4817
  return {
4817
4818
  apiKey: config.apiKey ?? "",
@@ -4840,17 +4841,27 @@ function toRawQueryResult(raw) {
4840
4841
  servedModel: raw.servedModel,
4841
4842
  groundingSources: raw.groundingSources,
4842
4843
  searchQueries: raw.searchQueries,
4843
- // Retrieval detection is not implemented for this provider. Its candidate
4844
- // marker is present on 100% of stored rows, so it has never been shown to
4845
- // discriminate a non-retrieving answer and wiring it up would hardcode
4846
- // `used`. `unknown` states what we actually know. The contract is a
4847
- // declaration about how we build the request, so it is always knowable.
4848
- retrievalStatus: "unknown",
4844
+ retrievalStatus: readRetrievalStatus(raw.rawResponse),
4849
4845
  retrievalContract: "native-auto-v1",
4850
4846
  usage: raw.usage,
4851
4847
  stopReason: raw.stopReason
4852
4848
  };
4853
4849
  }
4850
+ function readRetrievalStatus(rawResponse) {
4851
+ const response = rawResponse;
4852
+ if (usageCount(response.usageMetadata?.toolUsePromptTokenCount) > 0) return RetrievalStatuses.used;
4853
+ const candidate = Array.isArray(response.candidates) ? response.candidates[0] : void 0;
4854
+ if (!candidate) return RetrievalStatuses.unknown;
4855
+ const metadata2 = candidate.groundingMetadata;
4856
+ const queries2 = metadata2?.webSearchQueries;
4857
+ const chunks = metadata2?.groundingChunks;
4858
+ if (Array.isArray(queries2) && queries2.some((query) => typeof query === "string" && query.trim().length > 0) || Array.isArray(chunks) && chunks.some((chunk) => typeof chunk.web?.uri === "string" && chunk.web.uri.trim().length > 0)) {
4859
+ return RetrievalStatuses.used;
4860
+ }
4861
+ const parts = candidate.content?.parts;
4862
+ const hasAnswer = Array.isArray(parts) && parts.some((part) => !part.thought && typeof part.text === "string" && part.text.trim().length > 0);
4863
+ return candidate.finishReason === FinishReason.STOP && hasAnswer ? RetrievalStatuses["not-used"] : RetrievalStatuses.unknown;
4864
+ }
4854
4865
  var geminiAdapter = {
4855
4866
  name: "gemini",
4856
4867
  displayName: "Gemini",
@@ -4923,7 +4934,7 @@ var geminiAdapter = {
4923
4934
  citedDomains: normalized.citedDomains,
4924
4935
  groundingSources: normalized.groundingSources,
4925
4936
  searchQueries: normalized.searchQueries,
4926
- retrievalStatus: "unknown"
4937
+ retrievalStatus: readRetrievalStatus(raw.rawResponse)
4927
4938
  };
4928
4939
  },
4929
4940
  async generateText(prompt, config) {
@@ -8357,7 +8368,7 @@ function nonBlank(value) {
8357
8368
  return trimmed ? trimmed : void 0;
8358
8369
  }
8359
8370
  function resolveBuildCommit(env = process.env) {
8360
- const embedded = true ? "89a7b4bb64371e151e3acebd92b4250075933dce" : void 0;
8371
+ const embedded = true ? "e030cb7a90ea9f96ff105df0274d1490664614f1" : void 0;
8361
8372
  return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
8362
8373
  }
8363
8374
  function resolveInstanceIdentity(env = process.env) {
@@ -15534,6 +15545,10 @@ function resolveModelForCapability(provider, capability, modelIdOverride) {
15534
15545
  const baseUrl = base.endsWith("/v1beta") ? base : `${base}/v1beta`;
15535
15546
  return { ...model, baseUrl };
15536
15547
  }
15548
+ if (provider === AgentProviderIds.zai && process.env.ZAI_BASE_URL) {
15549
+ const baseUrl = process.env.ZAI_BASE_URL.replace(/\/+$/, "");
15550
+ return { ...model, baseUrl };
15551
+ }
15537
15552
  return model;
15538
15553
  }
15539
15554
  function isAgentModelAvailable(provider, id) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  REGISTERED_CLI_COMMANDS
3
- } from "./chunk-EJRV7RBZ.js";
4
- import "./chunk-QQYQDTFZ.js";
3
+ } from "./chunk-57MGI2UT.js";
4
+ import "./chunk-LK7O7RM6.js";
5
5
  import "./chunk-5LY7EG4U.js";
6
6
  import "./chunk-3JVF3ULD.js";
7
7
  import "./chunk-RB2F4D3Z.js";
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  buildSetupState,
14
14
  consumePendingServeHandoff,
15
15
  serveCommand
16
- } from "./chunk-EJRV7RBZ.js";
16
+ } from "./chunk-57MGI2UT.js";
17
17
  import {
18
18
  checkLatestVersionForCli,
19
19
  cliRuntimeContext,
@@ -27,7 +27,7 @@ import {
27
27
  showFirstRunNotice,
28
28
  trackCliCommandFinished,
29
29
  trackEvent
30
- } from "./chunk-QQYQDTFZ.js";
30
+ } from "./chunk-LK7O7RM6.js";
31
31
  import "./chunk-5LY7EG4U.js";
32
32
  import {
33
33
  resolveCliAccess
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createGoogleMarketingCredentialStore,
4
4
  createGoogleMarketingRuntime,
5
5
  createServer
6
- } from "./chunk-QQYQDTFZ.js";
6
+ } from "./chunk-LK7O7RM6.js";
7
7
  import {
8
8
  loadConfig
9
9
  } from "./chunk-5LY7EG4U.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonry/canonry",
3
- "version": "7.44.0",
3
+ "version": "7.44.1",
4
4
  "type": "module",
5
5
  "description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
6
6
  "keywords": [
@@ -87,32 +87,32 @@
87
87
  "tsx": "^4.19.0",
88
88
  "@ainyc/canonry-api-client": "0.0.0",
89
89
  "@ainyc/canonry-web": "0.0.0",
90
- "@ainyc/canonry-config": "0.0.0",
91
90
  "@ainyc/canonry-api-routes": "0.0.0",
92
- "@ainyc/canonry-contracts": "0.0.0",
91
+ "@ainyc/canonry-config": "0.0.0",
93
92
  "@ainyc/canonry-db": "0.0.0",
93
+ "@ainyc/canonry-contracts": "0.0.0",
94
94
  "@ainyc/canonry-integration-bing": "0.0.0",
95
95
  "@ainyc/canonry-integration-cloud-run": "0.0.0",
96
96
  "@ainyc/canonry-integration-cloudflare-queue": "0.0.0",
97
97
  "@ainyc/canonry-integration-cloudflare-worker": "0.0.0",
98
98
  "@ainyc/canonry-integration-google": "0.0.0",
99
+ "@ainyc/canonry-integration-google-business-profile": "0.0.0",
99
100
  "@ainyc/canonry-integration-google-ads": "0.0.0",
100
101
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
101
- "@ainyc/canonry-integration-google-business-profile": "0.0.0",
102
102
  "@ainyc/canonry-integration-google-places": "0.0.0",
103
103
  "@ainyc/canonry-integration-google-tag-manager": "0.0.0",
104
104
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
105
- "@ainyc/canonry-integration-traffic": "0.0.0",
106
105
  "@ainyc/canonry-integration-wordpress": "0.0.0",
107
106
  "@ainyc/canonry-intelligence": "0.0.0",
107
+ "@ainyc/canonry-provider-cdp": "0.0.0",
108
+ "@ainyc/canonry-integration-traffic": "0.0.0",
108
109
  "@ainyc/canonry-provider-claude": "0.0.0",
109
110
  "@ainyc/canonry-provider-gemini": "0.0.0",
110
- "@ainyc/canonry-provider-muse": "0.0.0",
111
111
  "@ainyc/canonry-provider-local": "0.0.0",
112
- "@ainyc/canonry-provider-cdp": "0.0.0",
113
- "@ainyc/canonry-provider-openai": "0.0.0",
112
+ "@ainyc/canonry-provider-muse": "0.0.0",
114
113
  "@ainyc/canonry-provider-perplexity": "0.0.0",
115
- "@ainyc/canonry-integration-typesafe": "0.0.0"
114
+ "@ainyc/canonry-integration-typesafe": "0.0.0",
115
+ "@ainyc/canonry-provider-openai": "0.0.0"
116
116
  },
117
117
  "scripts": {
118
118
  "build": "pnpm run build:cli && pnpm run build:web",