@canonry/canonry 7.73.0 → 7.74.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 (80) hide show
  1. package/dist/{ads-TX5622SS.js → ads-L64W5J35.js} +2 -2
  2. package/dist/{agent-AIOQL66U.js → agent-CMQ34CFD.js} +5 -5
  3. package/dist/{agent-ask-A6GIJTBX.js → agent-ask-3KEYJSZV.js} +2 -2
  4. package/dist/{agent-conversations-LHWLKOPQ.js → agent-conversations-4KKPOTCP.js} +2 -2
  5. package/dist/{agent-memory-F54BPEYN.js → agent-memory-VOSRZ57W.js} +2 -2
  6. package/dist/{agent-providers-L74KZOSG.js → agent-providers-SLXTYMDS.js} +2 -2
  7. package/dist/{agent-transcript-IH65H755.js → agent-transcript-Q6OEZROG.js} +2 -2
  8. package/dist/{analytics-YWCY2KSY.js → analytics-LSF6NYII.js} +2 -2
  9. package/dist/{apply-BLUUYG2N.js → apply-7O3RES7N.js} +2 -2
  10. package/dist/{backfill-6WO5CH6Z.js → backfill-7ARSKYDG.js} +2 -2
  11. package/dist/{backlinks-NC7AUGTK.js → backlinks-4YAC374B.js} +2 -2
  12. package/dist/{bing-WQUEYHVC.js → bing-SHAYDXAA.js} +2 -2
  13. package/dist/{bootstrap-AXZV4BBC.js → bootstrap-BHLBGQKJ.js} +5 -5
  14. package/dist/{cdp-DUG5PMUD.js → cdp-QWJE6SFY.js} +5 -5
  15. package/dist/{chunk-HGMTGC34.js → chunk-AJMDETJA.js} +2 -2
  16. package/dist/{chunk-WH2M2MQF.js → chunk-BICUWFV4.js} +1 -1
  17. package/dist/{chunk-PRSQ4R47.js → chunk-DL3LTSBV.js} +1 -1
  18. package/dist/{chunk-JQNVNB63.js → chunk-EXGETCJR.js} +1 -1
  19. package/dist/{chunk-4B6DE7BB.js → chunk-KOWOQ3JZ.js} +2 -2
  20. package/dist/{chunk-4JMTDLFV.js → chunk-L5GIL45X.js} +1 -1
  21. package/dist/{chunk-ETVM3T7K.js → chunk-LS47ZAX2.js} +1 -1
  22. package/dist/{chunk-F5D4GPZQ.js → chunk-MB3IUJ6Z.js} +1 -1
  23. package/dist/{chunk-HKV4UWG5.js → chunk-NXFNXXYM.js} +183 -91
  24. package/dist/{chunk-T5PWWDMJ.js → chunk-O4D66XPL.js} +1 -1
  25. package/dist/{chunk-S77W2XSI.js → chunk-SCRPC2PQ.js} +2 -2
  26. package/dist/{chunk-HIGBV77K.js → chunk-TXUNPPWD.js} +8 -8
  27. package/dist/{chunk-GNBATQS3.js → chunk-WLNYLQTX.js} +2 -2
  28. package/dist/{chunk-B6R223HQ.js → chunk-WY2C6FFA.js} +1 -1
  29. package/dist/{chunk-GUFKUPKZ.js → chunk-YTSE2EZP.js} +1 -1
  30. package/dist/{chunk-3ANSG6YT.js → chunk-ZMDIARSG.js} +307 -307
  31. package/dist/{citations-FUZ6DGP5.js → citations-EENLZULG.js} +2 -2
  32. package/dist/{cli-commands-GMOR67F5.js → cli-commands-7BG5M2KF.js} +4 -4
  33. package/dist/cli.js +7 -7
  34. package/dist/{competitor-QDCH7PLT.js → competitor-CW5LMXJ6.js} +2 -2
  35. package/dist/{content-JX2CPIPR.js → content-BX6UGRRU.js} +2 -2
  36. package/dist/{dashboard-OOWMLMKV.js → dashboard-M2TKT2LW.js} +1 -1
  37. package/dist/{discover-YQSVQRUV.js → discover-2EZUZFNR.js} +2 -2
  38. package/dist/{discover-eval-FN5RL6QI.js → discover-eval-IS2GRYVV.js} +2 -2
  39. package/dist/{doctor-YHJLAEJJ.js → doctor-DPEIBV3E.js} +2 -2
  40. package/dist/{evidence-KUPZMBIK.js → evidence-UGC4ZWNA.js} +2 -2
  41. package/dist/{export-cmd-YSEPTUUF.js → export-cmd-7OVM23C4.js} +2 -2
  42. package/dist/{ga-WNS7Q7TF.js → ga-FUADE4K4.js} +2 -2
  43. package/dist/{gbp-5NYFK4TW.js → gbp-R4M663R5.js} +2 -2
  44. package/dist/{google-T4CF4WCI.js → google-WTOTC5SL.js} +2 -2
  45. package/dist/{health-cmd-2W37CF6J.js → health-cmd-QKDO6VIT.js} +2 -2
  46. package/dist/{history-PA3O6ZHX.js → history-LEBTYXVW.js} +2 -2
  47. package/dist/index.d.ts +65 -65
  48. package/dist/index.js +8 -8
  49. package/dist/{init-I3P7FINF.js → init-BKOT4UY2.js} +7 -7
  50. package/dist/{insights-O5PUVHTW.js → insights-OBHQ5GHV.js} +2 -2
  51. package/dist/{journeys-GU34O3HE.js → journeys-PTMCJHOL.js} +2 -2
  52. package/dist/{keys-RXBFRNUS.js → keys-W2FZNFOR.js} +2 -2
  53. package/dist/{keyword-MASR36DK.js → keyword-Y6WABJPU.js} +2 -2
  54. package/dist/{logs-OTA7MV4P.js → logs-KRSH53GN.js} +2 -2
  55. package/dist/{mcp-ZQYN2NET.js → mcp-6LJW6LEJ.js} +3 -3
  56. package/dist/mcp.js +4 -4
  57. package/dist/{measurement-plan-ZGVO36TN.js → measurement-plan-RHLKXNYG.js} +3 -3
  58. package/dist/{notify-KS5CR3S2.js → notify-HRK2HQTU.js} +2 -2
  59. package/dist/{organic-evidence-CTH52AC5.js → organic-evidence-EX2VL5CE.js} +2 -2
  60. package/dist/{overview-IRCIDE5H.js → overview-254QNXAC.js} +3 -3
  61. package/dist/{project-H5XPI5CT.js → project-UOYX7T4J.js} +2 -2
  62. package/dist/{query-2R6EZG5T.js → query-JMVOMNRS.js} +2 -2
  63. package/dist/{research-OA3UQAV3.js → research-PAPX7KO5.js} +2 -2
  64. package/dist/{results-export-XUXU3WMX.js → results-export-3BXIIDP2.js} +2 -2
  65. package/dist/{run-7IIOB6AS.js → run-WQXLV4MS.js} +3 -3
  66. package/dist/{schedule-DUTPZB5C.js → schedule-3WJ5F3BF.js} +2 -2
  67. package/dist/{search-TWUJD7KH.js → search-RVGFOZAT.js} +2 -2
  68. package/dist/{serve-BYHHULUU.js → serve-BPM2P3GY.js} +9 -9
  69. package/dist/{session-M5XSTGPI.js → session-76DT5W6D.js} +4 -4
  70. package/dist/{settings-GQXU5M3H.js → settings-MRJ566D6.js} +2 -2
  71. package/dist/{snapshot-QFKUO4QK.js → snapshot-7GBDFFVB.js} +2 -2
  72. package/dist/{status-42LPR7YH.js → status-S6CZV2LU.js} +3 -3
  73. package/dist/{technical-aeo-SUILL4MY.js → technical-aeo-Q73ZF2FD.js} +2 -2
  74. package/dist/{telemetry-RITB7YZH.js → telemetry-BT4OOPN6.js} +3 -3
  75. package/dist/{tools-DGWJOLNS.js → tools-HYOV77FY.js} +3 -3
  76. package/dist/{traffic-3YC3HUNT.js → traffic-EFLF62IZ.js} +2 -2
  77. package/dist/{users-BST5DQ5R.js → users-MYXGNUIZ.js} +2 -2
  78. package/dist/{visibility-stats-NCNP4AL2.js → visibility-stats-QENASZW6.js} +2 -2
  79. package/dist/{wordpress-4HQDLQVE.js → wordpress-CYLQHE5L.js} +2 -2
  80. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  trackCliConnection
3
- } from "./chunk-4B6DE7BB.js";
4
- import "./chunk-S77W2XSI.js";
5
- import "./chunk-PRSQ4R47.js";
3
+ } from "./chunk-KOWOQ3JZ.js";
4
+ import "./chunk-SCRPC2PQ.js";
5
+ import "./chunk-DL3LTSBV.js";
6
6
  import {
7
7
  createApiClient
8
- } from "./chunk-WH2M2MQF.js";
9
- import "./chunk-HKV4UWG5.js";
8
+ } from "./chunk-BICUWFV4.js";
9
+ import "./chunk-NXFNXXYM.js";
10
10
  import "./chunk-AOJU5LKX.js";
11
11
  import {
12
12
  isMachineFormat
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import {
7
7
  CliError,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import {
7
7
  CliError,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import {
7
7
  CliError,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import {
7
7
  CliError,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import {
7
7
  CliError,
@@ -10,9 +10,9 @@ import {
10
10
  backfillSnapshotAttributionCommand,
11
11
  backfillTrafficClassificationCommand,
12
12
  replayQueryAuditLog
13
- } from "./chunk-B6R223HQ.js";
13
+ } from "./chunk-WY2C6FFA.js";
14
14
  import "./chunk-6ATKY252.js";
15
- import "./chunk-HKV4UWG5.js";
15
+ import "./chunk-NXFNXXYM.js";
16
16
  import "./chunk-HGMYEDAQ.js";
17
17
  import "./chunk-JPM3VC6A.js";
18
18
  import {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
4
- import "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-BICUWFV4.js";
4
+ import "./chunk-NXFNXXYM.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  trackCliConnection
3
- } from "./chunk-4B6DE7BB.js";
3
+ } from "./chunk-KOWOQ3JZ.js";
4
4
  import {
5
5
  answerServiceDescriptors
6
6
  } from "./chunk-6W5AR4IW.js";
7
7
  import {
8
8
  outcomeFailure
9
- } from "./chunk-S77W2XSI.js";
9
+ } from "./chunk-SCRPC2PQ.js";
10
10
  import {
11
11
  isLoopbackBindHost
12
12
  } from "./chunk-TSENU4GG.js";
@@ -16,10 +16,10 @@ import {
16
16
  import {
17
17
  isTelemetryEnabled,
18
18
  recordInstallRef
19
- } from "./chunk-PRSQ4R47.js";
19
+ } from "./chunk-DL3LTSBV.js";
20
20
  import {
21
21
  createApiClient
22
- } from "./chunk-WH2M2MQF.js";
22
+ } from "./chunk-BICUWFV4.js";
23
23
  import {
24
24
  configExists,
25
25
  getAnswerServiceEnv,
@@ -30,7 +30,7 @@ import {
30
30
  loadConfigRaw,
31
31
  saveConfig,
32
32
  withBootstrapProviderDefaults
33
- } from "./chunk-HKV4UWG5.js";
33
+ } from "./chunk-NXFNXXYM.js";
34
34
  import "./chunk-AOJU5LKX.js";
35
35
  import {
36
36
  CliError,
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  trackCliConnection
3
- } from "./chunk-4B6DE7BB.js";
3
+ } from "./chunk-KOWOQ3JZ.js";
4
4
  import {
5
5
  outcomeFailure
6
- } from "./chunk-S77W2XSI.js";
7
- import "./chunk-PRSQ4R47.js";
6
+ } from "./chunk-SCRPC2PQ.js";
7
+ import "./chunk-DL3LTSBV.js";
8
8
  import {
9
9
  createApiClient
10
- } from "./chunk-WH2M2MQF.js";
10
+ } from "./chunk-BICUWFV4.js";
11
11
  import {
12
12
  loadConfig,
13
13
  saveConfigPatch
14
- } from "./chunk-HKV4UWG5.js";
14
+ } from "./chunk-NXFNXXYM.js";
15
15
  import "./chunk-AOJU5LKX.js";
16
16
  import {
17
17
  CliError,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  configExists,
6
6
  loadConfigRaw
7
- } from "./chunk-HKV4UWG5.js";
7
+ } from "./chunk-NXFNXXYM.js";
8
8
 
9
9
  // src/setup-state.ts
10
10
  import fs from "fs";
@@ -47,7 +47,7 @@ function queueServeHandoff() {
47
47
  async function runPendingServeHandoff(format) {
48
48
  if (!pendingServeHandoff) return;
49
49
  pendingServeHandoff = false;
50
- const { serveCommand } = await import("./serve-BYHHULUU.js");
50
+ const { serveCommand } = await import("./serve-BPM2P3GY.js");
51
51
  await serveCommand(format);
52
52
  }
53
53
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-HKV4UWG5.js";
3
+ } from "./chunk-NXFNXXYM.js";
4
4
  import {
5
5
  PACKAGE_VERSION
6
6
  } from "./chunk-AOJU5LKX.js";
@@ -5,7 +5,7 @@ import {
5
5
  loadConfig,
6
6
  loadConfigRaw,
7
7
  saveConfigPatch
8
- } from "./chunk-HKV4UWG5.js";
8
+ } from "./chunk-NXFNXXYM.js";
9
9
  import {
10
10
  CANONRY_NPM_PACKAGE_URL,
11
11
  compareSemver,
@@ -2,7 +2,7 @@ import {
2
2
  configExists,
3
3
  loadConfigRaw,
4
4
  saveConfigPatch
5
- } from "./chunk-HKV4UWG5.js";
5
+ } from "./chunk-NXFNXXYM.js";
6
6
  import {
7
7
  BUNDLED_SKILL_NAMES,
8
8
  installSkills
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  trackIntegrationConnection
3
- } from "./chunk-S77W2XSI.js";
3
+ } from "./chunk-SCRPC2PQ.js";
4
4
  import {
5
5
  cliRuntimeContext
6
- } from "./chunk-PRSQ4R47.js";
6
+ } from "./chunk-DL3LTSBV.js";
7
7
 
8
8
  // src/cli-connection-telemetry.ts
9
9
  function trackCliConnection(properties) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-WH2M2MQF.js";
3
+ } from "./chunk-BICUWFV4.js";
4
4
  import {
5
5
  emitJsonl
6
6
  } from "./chunk-Z7IUAJOF.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runWithUsageTags
3
- } from "./chunk-WH2M2MQF.js";
3
+ } from "./chunk-BICUWFV4.js";
4
4
  import {
5
5
  CanonryMcpToolNames,
6
6
  canonryMcpTools
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  createApiClient,
8
8
  runWithUsageTags
9
- } from "./chunk-WH2M2MQF.js";
9
+ } from "./chunk-BICUWFV4.js";
10
10
  import {
11
11
  canonryMcpTools,
12
12
  mcpOutputSchema,
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-SF5JLMLG.js";
24
24
 
25
25
  // ../config/src/index.ts
26
- import { z as z4 } from "zod";
26
+ import { z as z5 } from "zod";
27
27
 
28
28
  // ../config/src/sentiment.ts
29
29
  import { z } from "zod";
@@ -84,78 +84,170 @@ var seoInstallConfigSchema = z3.object({
84
84
  }).strict()]))
85
85
  }).strict();
86
86
 
87
+ // ../config/src/mcp-gateway.ts
88
+ import { z as z4 } from "zod";
89
+ var nonempty = z4.string().trim().min(1);
90
+ var identifier = z4.string().regex(/^[a-z0-9][\w-]{0,127}$/i);
91
+ var url = z4.url().refine((value) => {
92
+ const parsed = new URL(value);
93
+ return !parsed.username && !parsed.password && !parsed.hash && !parsed.search;
94
+ }, "URLs must not contain credentials, fragments, or query strings");
95
+ var gatewayTenantSchema = z4.object({
96
+ id: identifier,
97
+ displayName: nonempty.max(200),
98
+ origin: url,
99
+ issuer: url,
100
+ resource: url,
101
+ mcpUrl: url,
102
+ enabled: z4.boolean(),
103
+ allowPrivateNetwork: z4.boolean().default(false),
104
+ protocolVersions: z4.array(nonempty).min(1),
105
+ catalogVersion: z4.literal("canonry-readonly-v1"),
106
+ upstreamClientId: nonempty.optional()
107
+ }).strict();
108
+ var clientSchema = z4.object({
109
+ client_id: identifier,
110
+ client_name: nonempty.max(200),
111
+ redirect_uris: z4.array(z4.url()).min(1),
112
+ token_endpoint_auth_method: z4.literal("none").default("none"),
113
+ grant_types: z4.array(z4.enum(["authorization_code", "refresh_token"])).default(["authorization_code", "refresh_token"]),
114
+ response_types: z4.tuple([z4.literal("code")]).default(["code"])
115
+ }).strict();
116
+ var gatewayConfigSchema = z4.object({
117
+ issuer: url,
118
+ development: z4.boolean().default(false),
119
+ host: nonempty.default("127.0.0.1"),
120
+ port: z4.number().int().min(1).max(65535).default(4101),
121
+ databasePath: nonempty,
122
+ clients: z4.array(clientSchema).min(1),
123
+ tenants: z4.array(gatewayTenantSchema).min(1),
124
+ requestTimeoutMs: z4.number().int().min(100).max(12e4).default(3e4),
125
+ trustedProxyAddresses: z4.array(z4.union([z4.ipv4(), z4.ipv6()])).default([]),
126
+ rateLimitPerMinute: z4.number().int().min(1).max(1e5).default(120),
127
+ maxBodyBytes: z4.number().int().min(1024).max(10 * 1024 * 1024).default(1024 * 1024),
128
+ domainVerificationToken: z4.string().regex(/^[\w-]{1,1024}$/).optional()
129
+ }).strict().superRefine((config, ctx) => {
130
+ const checkTransport = (value, path2) => {
131
+ const parsed = new URL(value);
132
+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(parsed.hostname);
133
+ if (parsed.protocol !== "https:" && !(config.development && loopback && parsed.protocol === "http:")) {
134
+ ctx.addIssue({ code: "custom", path: path2, message: "HTTPS is required except explicit development on loopback" });
135
+ }
136
+ };
137
+ checkTransport(config.issuer, ["issuer"]);
138
+ const issuer = new URL(config.issuer);
139
+ if (issuer.pathname !== "/" || config.issuer.endsWith("/")) {
140
+ ctx.addIssue({ code: "custom", path: ["issuer"], message: "Gateway issuer must be an origin without a trailing slash" });
141
+ }
142
+ if (!config.development && config.databasePath === ":memory:") {
143
+ ctx.addIssue({ code: "custom", path: ["databasePath"], message: "Production requires a durable database path" });
144
+ }
145
+ const tenantIds = /* @__PURE__ */ new Set();
146
+ config.tenants.forEach((tenant, index) => {
147
+ if (tenantIds.has(tenant.id)) ctx.addIssue({ code: "custom", path: ["tenants", index, "id"], message: "Tenant IDs must be unique" });
148
+ tenantIds.add(tenant.id);
149
+ if (new URL(tenant.origin).origin !== tenant.origin) {
150
+ ctx.addIssue({ code: "custom", path: ["tenants", index, "origin"], message: "Tenant origin must be an origin without a path or trailing slash" });
151
+ }
152
+ for (const field of ["origin", "issuer", "resource", "mcpUrl"]) {
153
+ checkTransport(tenant[field], ["tenants", index, field]);
154
+ if (new URL(tenant[field]).origin !== tenant.origin) {
155
+ ctx.addIssue({ code: "custom", path: ["tenants", index, field], message: "Tenant endpoints must belong to the provisioned origin" });
156
+ }
157
+ }
158
+ if (!new URL(tenant.mcpUrl).pathname.endsWith("/api/v1/mcp/readonly")) {
159
+ ctx.addIssue({ code: "custom", path: ["tenants", index, "mcpUrl"], message: "Only the Canonry read-only MCP endpoint is permitted" });
160
+ }
161
+ if (!new URL(tenant.resource).pathname.endsWith("/api/v1/mcp")) {
162
+ ctx.addIssue({ code: "custom", path: ["tenants", index, "resource"], message: "Canonical MCP resource must end in /api/v1/mcp" });
163
+ }
164
+ });
165
+ const clientIds = /* @__PURE__ */ new Set();
166
+ config.clients.forEach((client, index) => {
167
+ if (clientIds.has(client.client_id)) ctx.addIssue({ code: "custom", path: ["clients", index, "client_id"], message: "Client IDs must be unique" });
168
+ clientIds.add(client.client_id);
169
+ client.redirect_uris.forEach((redirect, redirectIndex) => {
170
+ checkTransport(redirect, ["clients", index, "redirect_uris", redirectIndex]);
171
+ const parsed = new URL(redirect);
172
+ if (parsed.username || parsed.password || parsed.hash) {
173
+ ctx.addIssue({ code: "custom", path: ["clients", index, "redirect_uris", redirectIndex], message: "Redirects cannot contain credentials or fragments" });
174
+ }
175
+ });
176
+ });
177
+ });
178
+
87
179
  // ../config/src/index.ts
88
- var dashboardManagedSweepsSchema = z4.boolean().nullish();
89
- var researchAllowViewersSchema = z4.boolean().nullish();
90
- var agentAllowViewersSchema = z4.boolean().nullish();
180
+ var dashboardManagedSweepsSchema = z5.boolean().nullish();
181
+ var researchAllowViewersSchema = z5.boolean().nullish();
182
+ var agentAllowViewersSchema = z5.boolean().nullish();
91
183
  var AGENT_REASONING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
92
- var agentReasoningSchema = z4.enum(AGENT_REASONING_LEVELS).nullish();
93
- var researchViewerDailyRunLimitSchema = z4.number().int().positive().nullish();
94
- var dashboardManagedRunKindsSchema = z4.array(schedulableRunKindSchema).nullish();
184
+ var agentReasoningSchema = z5.enum(AGENT_REASONING_LEVELS).nullish();
185
+ var researchViewerDailyRunLimitSchema = z5.number().int().positive().nullish();
186
+ var dashboardManagedRunKindsSchema = z5.array(schedulableRunKindSchema).nullish();
95
187
  var agentProviderSchema = agentProviderIdSchema.nullish();
96
- var agentModelSchema = z4.string().trim().min(1).nullish();
188
+ var agentModelSchema = z5.string().trim().min(1).nullish();
97
189
  function resolveOperatorApiKeyIds(source) {
98
190
  const raw = source.CANONRY_OPERATOR_KEY_IDS?.trim();
99
191
  if (!raw) return [];
100
- const parsed = z4.array(z4.string().regex(/^[\w-]{1,256}$/)).max(100).safeParse(raw.split(",").map((id) => id.trim()));
192
+ const parsed = z5.array(z5.string().regex(/^[\w-]{1,256}$/)).max(100).safeParse(raw.split(",").map((id) => id.trim()));
101
193
  if (!parsed.success) throw new Error("CANONRY_OPERATOR_KEY_IDS must contain at most 100 comma-separated API key IDs (letters, digits, underscores, hyphens; no wildcards).");
102
194
  return [...new Set(parsed.data)];
103
195
  }
104
- var envSchema = z4.object({
105
- DATABASE_URL: z4.string().default("postgresql://aeo:aeo@postgres:5432/aeo_platform"),
106
- API_PORT: z4.coerce.number().int().positive().default(3e3),
107
- WORKER_PORT: z4.coerce.number().int().positive().default(3001),
108
- WEB_PORT: z4.coerce.number().int().positive().default(4173),
109
- BOOTSTRAP_SECRET: z4.string().default("change-me"),
110
- CANONRY_BASE_PATH: z4.string().default("/"),
196
+ var envSchema = z5.object({
197
+ DATABASE_URL: z5.string().default("postgresql://aeo:aeo@postgres:5432/aeo_platform"),
198
+ API_PORT: z5.coerce.number().int().positive().default(3e3),
199
+ WORKER_PORT: z5.coerce.number().int().positive().default(3001),
200
+ WEB_PORT: z5.coerce.number().int().positive().default(4173),
201
+ BOOTSTRAP_SECRET: z5.string().default("change-me"),
202
+ CANONRY_BASE_PATH: z5.string().default("/"),
111
203
  // Gemini
112
- GEMINI_API_KEY: z4.string().optional(),
113
- GEMINI_MODEL: z4.string().optional(),
114
- GEMINI_BASE_URL: z4.string().optional(),
115
- GEMINI_MAX_CONCURRENCY: z4.coerce.number().int().positive().default(2),
116
- GEMINI_MAX_REQUESTS_PER_MINUTE: z4.coerce.number().int().positive().default(10),
117
- GEMINI_MAX_REQUESTS_PER_DAY: z4.coerce.number().int().positive().default(1e3),
204
+ GEMINI_API_KEY: z5.string().optional(),
205
+ GEMINI_MODEL: z5.string().optional(),
206
+ GEMINI_BASE_URL: z5.string().optional(),
207
+ GEMINI_MAX_CONCURRENCY: z5.coerce.number().int().positive().default(2),
208
+ GEMINI_MAX_REQUESTS_PER_MINUTE: z5.coerce.number().int().positive().default(10),
209
+ GEMINI_MAX_REQUESTS_PER_DAY: z5.coerce.number().int().positive().default(1e3),
118
210
  // Gemini Vertex AI (alternative to API key auth)
119
- GEMINI_VERTEX_PROJECT: z4.string().optional(),
120
- GEMINI_VERTEX_REGION: z4.string().optional(),
121
- GEMINI_VERTEX_CREDENTIALS: z4.string().optional(),
211
+ GEMINI_VERTEX_PROJECT: z5.string().optional(),
212
+ GEMINI_VERTEX_REGION: z5.string().optional(),
213
+ GEMINI_VERTEX_CREDENTIALS: z5.string().optional(),
122
214
  // OpenAI
123
- OPENAI_API_KEY: z4.string().optional(),
124
- OPENAI_MODEL: z4.string().optional(),
125
- OPENAI_BASE_URL: z4.string().optional(),
126
- OPENAI_MAX_CONCURRENCY: z4.coerce.number().int().positive().default(2),
127
- OPENAI_MAX_REQUESTS_PER_MINUTE: z4.coerce.number().int().positive().default(10),
128
- OPENAI_MAX_REQUESTS_PER_DAY: z4.coerce.number().int().positive().default(1e3),
129
- OPENROUTER_API_KEY: z4.string().optional(),
130
- OPENROUTER_MODEL: z4.string().optional(),
131
- OPENROUTER_MAX_CONCURRENCY: z4.coerce.number().int().positive().default(2),
132
- OPENROUTER_MAX_REQUESTS_PER_MINUTE: z4.coerce.number().int().positive().default(10),
133
- OPENROUTER_MAX_REQUESTS_PER_DAY: z4.coerce.number().int().positive().default(1e3),
215
+ OPENAI_API_KEY: z5.string().optional(),
216
+ OPENAI_MODEL: z5.string().optional(),
217
+ OPENAI_BASE_URL: z5.string().optional(),
218
+ OPENAI_MAX_CONCURRENCY: z5.coerce.number().int().positive().default(2),
219
+ OPENAI_MAX_REQUESTS_PER_MINUTE: z5.coerce.number().int().positive().default(10),
220
+ OPENAI_MAX_REQUESTS_PER_DAY: z5.coerce.number().int().positive().default(1e3),
221
+ OPENROUTER_API_KEY: z5.string().optional(),
222
+ OPENROUTER_MODEL: z5.string().optional(),
223
+ OPENROUTER_MAX_CONCURRENCY: z5.coerce.number().int().positive().default(2),
224
+ OPENROUTER_MAX_REQUESTS_PER_MINUTE: z5.coerce.number().int().positive().default(10),
225
+ OPENROUTER_MAX_REQUESTS_PER_DAY: z5.coerce.number().int().positive().default(1e3),
134
226
  // Anthropic / Claude
135
- ANTHROPIC_API_KEY: z4.string().optional(),
136
- ANTHROPIC_MODEL: z4.string().optional(),
137
- ANTHROPIC_MAX_CONCURRENCY: z4.coerce.number().int().positive().default(2),
138
- ANTHROPIC_MAX_REQUESTS_PER_MINUTE: z4.coerce.number().int().positive().default(10),
139
- ANTHROPIC_MAX_REQUESTS_PER_DAY: z4.coerce.number().int().positive().default(1e3),
227
+ ANTHROPIC_API_KEY: z5.string().optional(),
228
+ ANTHROPIC_MODEL: z5.string().optional(),
229
+ ANTHROPIC_MAX_CONCURRENCY: z5.coerce.number().int().positive().default(2),
230
+ ANTHROPIC_MAX_REQUESTS_PER_MINUTE: z5.coerce.number().int().positive().default(10),
231
+ ANTHROPIC_MAX_REQUESTS_PER_DAY: z5.coerce.number().int().positive().default(1e3),
140
232
  // Perplexity
141
- PERPLEXITY_API_KEY: z4.string().optional(),
142
- PERPLEXITY_MODEL: z4.string().optional(),
143
- PERPLEXITY_MAX_CONCURRENCY: z4.coerce.number().int().positive().default(2),
144
- PERPLEXITY_MAX_REQUESTS_PER_MINUTE: z4.coerce.number().int().positive().default(10),
145
- PERPLEXITY_MAX_REQUESTS_PER_DAY: z4.coerce.number().int().positive().default(1e3),
233
+ PERPLEXITY_API_KEY: z5.string().optional(),
234
+ PERPLEXITY_MODEL: z5.string().optional(),
235
+ PERPLEXITY_MAX_CONCURRENCY: z5.coerce.number().int().positive().default(2),
236
+ PERPLEXITY_MAX_REQUESTS_PER_MINUTE: z5.coerce.number().int().positive().default(10),
237
+ PERPLEXITY_MAX_REQUESTS_PER_DAY: z5.coerce.number().int().positive().default(1e3),
146
238
  // Meta Muse
147
- MUSE_API_KEY: z4.string().optional(),
148
- MUSE_MODEL: z4.string().optional(),
149
- MUSE_BASE_URL: z4.string().optional(),
150
- MUSE_MAX_CONCURRENCY: z4.coerce.number().int().positive().default(2),
151
- MUSE_MAX_REQUESTS_PER_MINUTE: z4.coerce.number().int().positive().default(10),
152
- MUSE_MAX_REQUESTS_PER_DAY: z4.coerce.number().int().positive().default(1e3),
239
+ MUSE_API_KEY: z5.string().optional(),
240
+ MUSE_MODEL: z5.string().optional(),
241
+ MUSE_BASE_URL: z5.string().optional(),
242
+ MUSE_MAX_CONCURRENCY: z5.coerce.number().int().positive().default(2),
243
+ MUSE_MAX_REQUESTS_PER_MINUTE: z5.coerce.number().int().positive().default(10),
244
+ MUSE_MAX_REQUESTS_PER_DAY: z5.coerce.number().int().positive().default(1e3),
153
245
  // Secret for HMAC-signing Google OAuth state parameters. Required for
154
246
  // cloud deployments that mount googleRoutes; the plugin refuses to register
155
247
  // without it (see packages/api-routes/src/google.ts).
156
- GOOGLE_STATE_SECRET: z4.string().optional(),
157
- CANONRY_RESEARCH_ALLOW_VIEWERS: z4.string().optional(),
158
- CANONRY_RESEARCH_VIEWER_DAILY_RUN_LIMIT: z4.coerce.number().int().positive().default(DEFAULT_VIEWER_RESEARCH_DAILY_RUN_LIMIT)
248
+ GOOGLE_STATE_SECRET: z5.string().optional(),
249
+ CANONRY_RESEARCH_ALLOW_VIEWERS: z5.string().optional(),
250
+ CANONRY_RESEARCH_VIEWER_DAILY_RUN_LIMIT: z5.coerce.number().int().positive().default(DEFAULT_VIEWER_RESEARCH_DAILY_RUN_LIMIT)
159
251
  });
160
252
  var BOOTSTRAP_PROVIDER_DEFAULT_MODELS = {
161
253
  gemini: "gemini-flash-latest",
@@ -178,33 +270,33 @@ function withBootstrapProviderDefaults(name, entry) {
178
270
  quota: entry.quota ?? { ...BOOTSTRAP_PROVIDER_DEFAULT_QUOTA }
179
271
  };
180
272
  }
181
- var bootstrapEnvSchema = z4.object({
182
- CANONRY_API_KEY: z4.string().optional(),
183
- CANONRY_API_URL: z4.string().optional(),
184
- CANONRY_DATABASE_PATH: z4.string().optional(),
185
- GEMINI_API_KEY: z4.string().optional(),
186
- GEMINI_MODEL: z4.string().optional(),
187
- GEMINI_BASE_URL: z4.string().optional(),
188
- GEMINI_VERTEX_PROJECT: z4.string().optional(),
189
- GEMINI_VERTEX_REGION: z4.string().optional(),
190
- GEMINI_VERTEX_CREDENTIALS: z4.string().optional(),
191
- OPENAI_API_KEY: z4.string().optional(),
192
- OPENAI_MODEL: z4.string().optional(),
193
- OPENAI_BASE_URL: z4.string().optional(),
194
- OPENROUTER_API_KEY: z4.string().optional(),
195
- OPENROUTER_MODEL: z4.string().optional(),
196
- ANTHROPIC_API_KEY: z4.string().optional(),
197
- ANTHROPIC_MODEL: z4.string().optional(),
198
- PERPLEXITY_API_KEY: z4.string().optional(),
199
- PERPLEXITY_MODEL: z4.string().optional(),
200
- MUSE_API_KEY: z4.string().optional(),
201
- MUSE_MODEL: z4.string().optional(),
202
- MUSE_BASE_URL: z4.string().optional(),
203
- LOCAL_BASE_URL: z4.string().optional(),
204
- LOCAL_API_KEY: z4.string().optional(),
205
- LOCAL_MODEL: z4.string().optional(),
206
- GOOGLE_CLIENT_ID: z4.string().optional(),
207
- GOOGLE_CLIENT_SECRET: z4.string().optional()
273
+ var bootstrapEnvSchema = z5.object({
274
+ CANONRY_API_KEY: z5.string().optional(),
275
+ CANONRY_API_URL: z5.string().optional(),
276
+ CANONRY_DATABASE_PATH: z5.string().optional(),
277
+ GEMINI_API_KEY: z5.string().optional(),
278
+ GEMINI_MODEL: z5.string().optional(),
279
+ GEMINI_BASE_URL: z5.string().optional(),
280
+ GEMINI_VERTEX_PROJECT: z5.string().optional(),
281
+ GEMINI_VERTEX_REGION: z5.string().optional(),
282
+ GEMINI_VERTEX_CREDENTIALS: z5.string().optional(),
283
+ OPENAI_API_KEY: z5.string().optional(),
284
+ OPENAI_MODEL: z5.string().optional(),
285
+ OPENAI_BASE_URL: z5.string().optional(),
286
+ OPENROUTER_API_KEY: z5.string().optional(),
287
+ OPENROUTER_MODEL: z5.string().optional(),
288
+ ANTHROPIC_API_KEY: z5.string().optional(),
289
+ ANTHROPIC_MODEL: z5.string().optional(),
290
+ PERPLEXITY_API_KEY: z5.string().optional(),
291
+ PERPLEXITY_MODEL: z5.string().optional(),
292
+ MUSE_API_KEY: z5.string().optional(),
293
+ MUSE_MODEL: z5.string().optional(),
294
+ MUSE_BASE_URL: z5.string().optional(),
295
+ LOCAL_BASE_URL: z5.string().optional(),
296
+ LOCAL_API_KEY: z5.string().optional(),
297
+ LOCAL_MODEL: z5.string().optional(),
298
+ GOOGLE_CLIENT_ID: z5.string().optional(),
299
+ GOOGLE_CLIENT_SECRET: z5.string().optional()
208
300
  });
209
301
  function getBootstrapEnv(source, overrides) {
210
302
  const filtered = overrides ? Object.fromEntries(Object.entries(overrides).filter(([, v]) => v != null)) : {};
@@ -1013,9 +1105,9 @@ Do not use "canonry init --force" for recovery. It replaces credentials without
1013
1105
  const portOverride = process.env.CANONRY_PORT?.trim();
1014
1106
  if (portOverride) {
1015
1107
  try {
1016
- const url = new URL(parsed.apiUrl);
1017
- url.port = portOverride;
1018
- parsed.apiUrl = url.origin;
1108
+ const url2 = new URL(parsed.apiUrl);
1109
+ url2.port = portOverride;
1110
+ parsed.apiUrl = url2.origin;
1019
1111
  } catch {
1020
1112
  }
1021
1113
  }
@@ -1026,9 +1118,9 @@ Do not use "canonry init --force" for recovery. It replaces credentials without
1026
1118
  if (parsed.basePath) {
1027
1119
  const normalizedBase = "/" + parsed.basePath.replace(/^\/|\/$/g, "");
1028
1120
  try {
1029
- const url = new URL(parsed.apiUrl);
1030
- if (normalizedBase !== "/" && !url.pathname.startsWith(normalizedBase)) {
1031
- parsed.apiUrl = url.origin + normalizedBase;
1121
+ const url2 = new URL(parsed.apiUrl);
1122
+ if (normalizedBase !== "/" && !url2.pathname.startsWith(normalizedBase)) {
1123
+ parsed.apiUrl = url2.origin + normalizedBase;
1032
1124
  }
1033
1125
  } catch {
1034
1126
  }
@@ -1053,11 +1145,11 @@ function parseExternalMcpEnv(raw) {
1053
1145
  for (const entry of value) {
1054
1146
  if (!entry || typeof entry !== "object") continue;
1055
1147
  const candidate = entry;
1056
- const url = typeof candidate.url === "string" ? candidate.url.trim() : "";
1148
+ const url2 = typeof candidate.url === "string" ? candidate.url.trim() : "";
1057
1149
  const token = typeof candidate.token === "string" ? candidate.token : "";
1058
- if (!url || !token) continue;
1150
+ if (!url2 || !token) continue;
1059
1151
  const label = typeof candidate.label === "string" ? candidate.label : void 0;
1060
- servers.push({ url, token, ...label ? { label } : {} });
1152
+ servers.push({ url: url2, token, ...label ? { label } : {} });
1061
1153
  }
1062
1154
  return servers.length > 0 ? servers : void 0;
1063
1155
  }
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VJWDBFSL.js";
5
5
  import {
6
6
  createApiClient
7
- } from "./chunk-WH2M2MQF.js";
7
+ } from "./chunk-BICUWFV4.js";
8
8
  import {
9
9
  CliError,
10
10
  isMachineFormat