@canonry/canonry 4.117.0 → 4.117.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.
@@ -3786,6 +3786,19 @@ var ApiClient = class {
3786
3786
  `
3787
3787
  );
3788
3788
  }
3789
+ const contentType = result.response.headers.get("content-type");
3790
+ if (result.response.ok && contentType?.toLowerCase().startsWith("text/html")) {
3791
+ throw new CliError({
3792
+ code: "UNEXPECTED_RESPONSE_FORMAT",
3793
+ message: `Expected a JSON response from the canonry API at ${result.request.url}, but received ${contentType} (HTTP ${result.response.status}). Check the server URL and base path.`,
3794
+ exitCode: EXIT_SYSTEM_ERROR,
3795
+ details: {
3796
+ requestUrl: result.request.url,
3797
+ contentType,
3798
+ httpStatus: result.response.status
3799
+ }
3800
+ });
3801
+ }
3789
3802
  if (result.error !== void 0 && result.error !== null) {
3790
3803
  const errorObj = typeof result.error === "object" && result.error !== null && "error" in result.error && typeof result.error.error === "object" && result.error.error !== null ? result.error.error : null;
3791
3804
  const msg = errorObj?.message ? String(errorObj.message) : `HTTP ${result.response.status}: ${result.response.statusText}`;
@@ -10,7 +10,7 @@ import {
10
10
  loadConfig,
11
11
  loadConfigRaw,
12
12
  saveConfigPatch
13
- } from "./chunk-PJATAPZW.js";
13
+ } from "./chunk-BMBHUFMI.js";
14
14
  import {
15
15
  CC_CACHE_DIR,
16
16
  DUCKDB_SPEC,
@@ -115,7 +115,7 @@ import {
115
115
  siteAuditPages,
116
116
  siteAuditSnapshots,
117
117
  usageCounters
118
- } from "./chunk-FVVKNMZW.js";
118
+ } from "./chunk-V4SW7SVX.js";
119
119
  import {
120
120
  AGENT_MEMORY_VALUE_MAX_BYTES,
121
121
  AGENT_PROVIDER_IDS,
@@ -6515,7 +6515,7 @@ function readStoredGroundingSources(rawResponse) {
6515
6515
  return result;
6516
6516
  }
6517
6517
  async function backfillInsightsCommand(project, opts) {
6518
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-J7G4CMI5.js");
6518
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-C5YLASIP.js");
6519
6519
  const config = loadConfig();
6520
6520
  const db = createClient(config.database);
6521
6521
  migrate(db);
@@ -12432,7 +12432,8 @@ async function createServer(opts) {
12432
12432
  const url = request.url.split("?")[0];
12433
12433
  const isApiRoute = url.startsWith("/api/") || basePath !== void 0 && url.startsWith(`${basePath}api/`);
12434
12434
  if (isApiRoute) {
12435
- return reply.status(404).send({ error: "Not found", path: request.url });
12435
+ const error = notFound("API route", url);
12436
+ return reply.status(error.statusCode).send(error.toJSON());
12436
12437
  }
12437
12438
  if (basePath && !url.startsWith(basePath)) {
12438
12439
  return reply.status(404).send({ error: "Not found", path: request.url });