@canonry/canonry 7.52.0 → 7.54.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 (147) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +24 -1
  2. package/assets/assets/AgentSetupPage-Dr7UsGcq.js +17 -0
  3. package/assets/assets/AuditHistoryPanel-Dg9ZNNQw.js +1 -0
  4. package/assets/assets/BacklinksPage-DSgwyFCi.js +1 -0
  5. package/assets/assets/{HistoryPage-aOd198dT.js → HistoryPage-DaX20IWP.js} +1 -1
  6. package/assets/assets/MeasurementPropertyPage-FGhKdZAP.js +4 -0
  7. package/assets/assets/ProjectPage-BTJYS9gc.js +7 -0
  8. package/assets/assets/RunsPage-D06GJ47B.js +1 -0
  9. package/assets/assets/SettingsPage-MSgC8Zrc.js +1 -0
  10. package/assets/assets/SiteHealthSection-4PXTNjon.js +2 -0
  11. package/assets/assets/ToneBadge-AoUA_EpE.js +60 -0
  12. package/assets/assets/TrafficPage-DikPWmaU.js +40 -0
  13. package/assets/assets/TrafficSourceDetailPage-C1hfimWW.js +1 -0
  14. package/assets/assets/account-context-CHtJm4fz.js +1 -0
  15. package/assets/assets/card-BO6dtEV9.js +1 -0
  16. package/assets/assets/extract-error-message-Q9pkEqUE.js +1 -0
  17. package/assets/assets/{format-helpers-BWnMmkiO.js → format-helpers-Gj1ekh6p.js} +1 -1
  18. package/assets/assets/index-B8W65ejO.css +1 -0
  19. package/assets/assets/index-BBfEsbxI.js +56 -0
  20. package/assets/assets/query-client-C22j0Z7h.js +1 -0
  21. package/assets/assets/react-query-BLKqSvlU.js +1 -0
  22. package/assets/assets/{react-sigma_core.esm.min-hGyOC4V_.js → react-sigma_core.esm.min-j5DWE8Rk.js} +1 -1
  23. package/assets/assets/service-2DEngBCR.js +1 -0
  24. package/assets/index.html +9 -7
  25. package/dist/{ads-MREK2AGL.js → ads-A5S2NQBZ.js} +3 -3
  26. package/dist/{agent-4RUZ3MC4.js → agent-BV7G7QN7.js} +7 -7
  27. package/dist/{agent-ask-YLTYBEYH.js → agent-ask-5ALAHZ6T.js} +3 -3
  28. package/dist/{agent-conversations-QA6IKDGR.js → agent-conversations-MJPQCJYR.js} +3 -3
  29. package/dist/{agent-memory-MEQAJOB3.js → agent-memory-Z3VPA5KH.js} +3 -3
  30. package/dist/{agent-providers-AXYPDJHL.js → agent-providers-FP3LAZPG.js} +3 -3
  31. package/dist/{agent-transcript-SMNQNYCD.js → agent-transcript-4GXCOC73.js} +3 -3
  32. package/dist/{analytics-4OR64IGV.js → analytics-TOLSUYSN.js} +3 -3
  33. package/dist/{apply-CQXCFXAH.js → apply-EU5JAFVZ.js} +3 -3
  34. package/dist/{backfill-TMXCNVOB.js → backfill-3263IYJH.js} +9 -9
  35. package/dist/{backlinks-6KFAQGYV.js → backlinks-XQ5JTN6W.js} +3 -3
  36. package/dist/{bing-HFCACTAC.js → bing-LYHRD7BF.js} +3 -3
  37. package/dist/{bootstrap-SQVQXOJC.js → bootstrap-AKWTIMMH.js} +17 -9
  38. package/dist/{cdp-IACL7EXU.js → cdp-N4PQJWGQ.js} +7 -7
  39. package/dist/{chunk-K5I45PZI.js → chunk-2SY2FYFW.js} +556 -255
  40. package/dist/{chunk-KXAOMTXN.js → chunk-4LVJFSPH.js} +5 -5
  41. package/dist/{chunk-GNKOBKPW.js → chunk-5P7DSHNK.js} +4 -4
  42. package/dist/{chunk-6BPZHNDC.js → chunk-6WTSWWP6.js} +2 -2
  43. package/dist/{chunk-MJNUSPO4.js → chunk-75CFTTBF.js} +2 -2
  44. package/dist/{chunk-TALC5DX5.js → chunk-B37SDIGU.js} +1 -1
  45. package/dist/chunk-BQKKAPMW.js +1211 -0
  46. package/dist/{chunk-LK2BG6EX.js → chunk-D234NBWI.js} +11 -1
  47. package/dist/{chunk-QLPLENDT.js → chunk-EIG2V6UI.js} +1 -1
  48. package/dist/{chunk-MKAC7HKH.js → chunk-GFRIXUDK.js} +38 -4
  49. package/dist/{chunk-BBOHY2DQ.js → chunk-H6EQMYGT.js} +1 -1
  50. package/dist/{chunk-EGIZNSDA.js → chunk-J7VN3FZ3.js} +1 -1
  51. package/dist/{chunk-DSNSD5J3.js → chunk-K5MBEK4S.js} +19 -9
  52. package/dist/{chunk-SNFBJKAW.js → chunk-LCTYTGSE.js} +3 -3
  53. package/dist/{chunk-5N6245R7.js → chunk-MARVEIWH.js} +4 -4
  54. package/dist/{chunk-7XE2IRBG.js → chunk-OHVXKFQI.js} +1 -1
  55. package/dist/{chunk-O4RMPA6H.js → chunk-OMXWBR2R.js} +7294 -6533
  56. package/dist/{chunk-O77IBNVO.js → chunk-PFPTUCMG.js} +326 -324
  57. package/dist/{chunk-YSEC6TIB.js → chunk-PRNO5TLE.js} +1206 -405
  58. package/dist/{chunk-7244X3K6.js → chunk-QFKDFU73.js} +2 -2
  59. package/dist/chunk-R4AFXPM4.js +959 -0
  60. package/dist/{chunk-V5D4XNWV.js → chunk-RHCDUPD6.js} +39 -2
  61. package/dist/{chunk-AWCWIQAU.js → chunk-SKZVEZZK.js} +231 -5
  62. package/dist/{chunk-RVUCY4ZV.js → chunk-T63KVDWY.js} +6 -4
  63. package/dist/{chunk-IIOEAJTV.js → chunk-VB47PTY7.js} +3 -3
  64. package/dist/{chunk-ILDT4LPB.js → chunk-VCTP2RG6.js} +26 -240
  65. package/dist/{chunk-JY3RLZGB.js → chunk-VF7XGX2I.js} +1 -1
  66. package/dist/{chunk-I6KNMZ77.js → chunk-VMCVLESK.js} +4 -4
  67. package/dist/{chunk-R2J4SNKF.js → chunk-WDJMIIY2.js} +1 -1
  68. package/dist/{chunk-BU3VAG5J.js → chunk-XJVCTI2N.js} +3 -3
  69. package/dist/{chunk-HEGXGCGL.js → chunk-Y2YBRLSS.js} +3 -3
  70. package/dist/{chunk-Y4GK7GCV.js → chunk-YOZ35ZTT.js} +1 -1
  71. package/dist/{chunk-BYOK6Z4F.js → chunk-ZA7D7CCN.js} +2 -2
  72. package/dist/{chunk-FC4XND45.js → chunk-ZILJZNMQ.js} +1 -1
  73. package/dist/{citations-NSBBWRZ4.js → citations-JK3ZMAR7.js} +3 -3
  74. package/dist/{cli-catalog-OFWJMNMD.js → cli-catalog-P2I6IYNI.js} +3 -3
  75. package/dist/{cli-commands-WVBL337U.js → cli-commands-YDRKG6OC.js} +7 -7
  76. package/dist/cli.js +13 -13
  77. package/dist/{competitor-V4OHORBC.js → competitor-5CJPM36M.js} +3 -3
  78. package/dist/{content-RUXRI5IC.js → content-5FEDXNHR.js} +3 -3
  79. package/dist/{dashboard-JXB2YAQJ.js → dashboard-ME7MBJTX.js} +6 -6
  80. package/dist/{demo-55ZNUOXU.js → demo-N7MEASQP.js} +1 -1
  81. package/dist/{demo-server-XO7PHM4I.js → demo-server-IGTBANDC.js} +11 -11
  82. package/dist/{discover-JJQ564HS.js → discover-EAISVTA6.js} +3 -3
  83. package/dist/{discover-eval-KLEKZ6U4.js → discover-eval-JIBKK44Q.js} +3 -3
  84. package/dist/{doctor-JAMQZCMZ.js → doctor-HSQYOZ4C.js} +3 -3
  85. package/dist/{evidence-YRSB7GFE.js → evidence-PSYAWKPP.js} +3 -3
  86. package/dist/{export-cmd-MHML4OYU.js → export-cmd-MWJN6H7W.js} +3 -3
  87. package/dist/{ga-LSXPE2MN.js → ga-WSQWECYY.js} +3 -3
  88. package/dist/{gbp-RMKMLOC7.js → gbp-OD26AEPF.js} +3 -3
  89. package/dist/{google-JQ4T6JTQ.js → google-FMJ7IWAF.js} +4 -4
  90. package/dist/{google-marketing-J6SEODYC.js → google-marketing-66JL4V24.js} +1 -1
  91. package/dist/{health-cmd-MV2JM2C3.js → health-cmd-2RO5LAI4.js} +3 -3
  92. package/dist/{history-SRRH7A2E.js → history-X6CNPW7G.js} +3 -3
  93. package/dist/index.d.ts +518 -50
  94. package/dist/index.js +24 -23
  95. package/dist/{init-ZJZFUERV.js → init-25III66S.js} +11 -11
  96. package/dist/{insights-PMMGNWZH.js → insights-6IWWA6JU.js} +3 -3
  97. package/dist/intelligence-service-N334P6FH.js +15 -0
  98. package/dist/{keys-TS7NZANS.js → keys-ABXAPISY.js} +3 -3
  99. package/dist/{keyword-VNCKDUGC.js → keyword-LERAVMI3.js} +3 -3
  100. package/dist/{logs-VH3WOTZJ.js → logs-BTAB5SNZ.js} +3 -3
  101. package/dist/{mcp-DG2RROB3.js → mcp-5E42RT6R.js} +2 -2
  102. package/dist/mcp.js +9 -9
  103. package/dist/{measurement-plan-4T35TUGG.js → measurement-plan-MRZRNBJG.js} +5 -5
  104. package/dist/{notify-BWHUSKL7.js → notify-YQYGC5UZ.js} +3 -3
  105. package/dist/{organic-evidence-QX4SXXJP.js → organic-evidence-6QT4YT3K.js} +3 -3
  106. package/dist/{overview-7IHUTKUV.js → overview-EHZ3FTS2.js} +4 -4
  107. package/dist/{project-JXLSWDE2.js → project-RNLV2ARE.js} +3 -3
  108. package/dist/{query-S75EL25H.js → query-IM2RXI4L.js} +3 -3
  109. package/dist/{research-KFTV3IP4.js → research-4FALR336.js} +25 -10
  110. package/dist/{results-export-GTKVBU34.js → results-export-4ETSRUGO.js} +3 -3
  111. package/dist/{run-26HDIRHF.js → run-QL7226N7.js} +4 -4
  112. package/dist/{schedule-N6G4SVHQ.js → schedule-GJE634VO.js} +3 -3
  113. package/dist/{search-MI32EPYM.js → search-7OQL67R6.js} +3 -3
  114. package/dist/{serve-XLGE42AG.js → serve-UN2OEK2Q.js} +25 -24
  115. package/dist/{session-W5DXWIYM.js → session-5M54TVY5.js} +16 -15
  116. package/dist/{settings-T7WI2UVE.js → settings-2QOL7YBM.js} +15 -3
  117. package/dist/{skills-F3WPKPTK.js → skills-GPLAAU3I.js} +2 -2
  118. package/dist/{snapshot-PD3EAVEX.js → snapshot-5YMJFRJS.js} +8 -6
  119. package/dist/{src-XDUXMJC3.js → src-YF3JLURF.js} +2 -2
  120. package/dist/{status-PUH7JFZ4.js → status-WGWC6FLN.js} +33 -5
  121. package/dist/{technical-aeo-AUFWWJIP.js → technical-aeo-RNMLD7OL.js} +3 -3
  122. package/dist/{telemetry-XBYT7G2K.js → telemetry-7U3ZICU4.js} +4 -4
  123. package/dist/{tools-GVHIRWSN.js → tools-CSKTZTKT.js} +11 -11
  124. package/dist/{traffic-B3HW2ZWG.js → traffic-QIAXLW6J.js} +5 -5
  125. package/dist/{users-M5HNQZYI.js → users-I6X5P5AO.js} +3 -3
  126. package/dist/{visibility-stats-Y7GJKMHN.js → visibility-stats-33OUKQQL.js} +3 -3
  127. package/dist/{wordpress-GCIURYPN.js → wordpress-3IO3O27D.js} +3 -3
  128. package/package.json +3 -1
  129. package/assets/assets/AccessControls-CteIuEGI.js +0 -1
  130. package/assets/assets/AuditHistoryPanel-DqJGiLsf.js +0 -1
  131. package/assets/assets/BacklinksPage-DotWEPQt.js +0 -1
  132. package/assets/assets/MeasurementPropertyPage-CuaKVK8x.js +0 -4
  133. package/assets/assets/ProjectPage-O9oufMgi.js +0 -8
  134. package/assets/assets/RunsPage-DIXMrc-N.js +0 -1
  135. package/assets/assets/SettingsPage-BuGb6AGa.js +0 -1
  136. package/assets/assets/SiteHealthSection-CweaKjCo.js +0 -2
  137. package/assets/assets/TrafficPage-B7MaQalp.js +0 -40
  138. package/assets/assets/TrafficSourceDetailPage-BPtjnF9s.js +0 -1
  139. package/assets/assets/card-DoV-8Txo.js +0 -60
  140. package/assets/assets/extract-error-message-DKQJJlZ-.js +0 -1
  141. package/assets/assets/index-CsPsaUr7.css +0 -1
  142. package/assets/assets/index-Z63c4PeO.js +0 -39
  143. package/assets/assets/query-client-vB35tVTz.js +0 -1
  144. package/assets/assets/react-query-BI0567qs.js +0 -1
  145. package/assets/assets/service-c4YvpVKX.js +0 -1
  146. package/dist/chunk-OFL4PTYU.js +0 -644
  147. package/dist/intelligence-service-KCSU6ZUJ.js +0 -15
@@ -5,250 +5,46 @@ import {
5
5
  isStoredPageReadTool,
6
6
  isStoredReadTool,
7
7
  truncateToolResult
8
- } from "./chunk-5N6245R7.js";
8
+ } from "./chunk-MARVEIWH.js";
9
9
  import {
10
10
  CANONRY_MCP_TOOLKITS
11
11
  } from "./chunk-4MJYGB56.js";
12
12
  import {
13
- AGENT_REASONING_LEVELS
14
- } from "./chunk-OFL4PTYU.js";
13
+ AGENT_REASONING_LEVELS,
14
+ aeroStreamFn,
15
+ agentProviderApiKeyEnvVar,
16
+ agentProvidersByPriority,
17
+ coerceAgentProvider,
18
+ defaultAgentReasoning,
19
+ getAgentProvider,
20
+ isAgentModelUnchecked,
21
+ refreshAgentModels,
22
+ resolveApiKeyFor,
23
+ resolveModelForProvider,
24
+ validateAgentProviderRegistry
25
+ } from "./chunk-BQKKAPMW.js";
15
26
  import {
16
27
  CanonryMcpToolNames,
17
28
  canonryMcpTools
18
- } from "./chunk-RVUCY4ZV.js";
29
+ } from "./chunk-T63KVDWY.js";
19
30
  import {
20
31
  agentToolEvents,
21
32
  llmUsageEvents
22
- } from "./chunk-MKAC7HKH.js";
33
+ } from "./chunk-GFRIXUDK.js";
23
34
  import {
24
- AGENT_PROVIDER_IDS,
25
- AgentProviderIds,
26
- LLM_CAPABILITIES,
27
- LlmCapabilities,
28
35
  MeasurementPortfolioLists,
29
36
  agentTurnLimitsSchema,
30
37
  agentVisibilityEvidence,
31
- isAgentProviderId,
38
+ describeError,
32
39
  validationError,
33
40
  visibilityReportRequestSchema
34
- } from "./chunk-O4RMPA6H.js";
41
+ } from "./chunk-OMXWBR2R.js";
35
42
 
36
43
  // src/agent/session.ts
37
44
  import fs3 from "fs";
38
45
  import path3 from "path";
39
46
  import { Agent } from "@earendil-works/pi-agent-core";
40
47
 
41
- // src/agent/providers.ts
42
- import "@earendil-works/pi-ai";
43
-
44
- // src/agent/pi-models.ts
45
- import "@earendil-works/pi-ai";
46
- import { builtinModels } from "@earendil-works/pi-ai/providers/all";
47
- var aeroModels = builtinModels();
48
- var DEFAULT_MAX_RETRIES = 2;
49
- var DEFAULT_MAX_OUTPUT_TOKENS = 32e3;
50
- var CANONRY_USER_AGENT = "canonry";
51
- var STAINLESS_HOST_HEADERS = {
52
- "X-Stainless-OS": null,
53
- "X-Stainless-Arch": null,
54
- "X-Stainless-Runtime-Version": null
55
- };
56
- var HOST_HEADERS = {
57
- "anthropic-messages": STAINLESS_HOST_HEADERS,
58
- "openai-responses": STAINLESS_HOST_HEADERS,
59
- "openai-completions": STAINLESS_HOST_HEADERS,
60
- "google-generative-ai": { "x-goog-api-client": CANONRY_USER_AGENT }
61
- };
62
- function outputCap(model) {
63
- return Math.min(model.maxTokens, DEFAULT_MAX_OUTPUT_TOKENS);
64
- }
65
- function canonryDefaults(model, options) {
66
- return {
67
- ...options,
68
- maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES,
69
- maxTokens: options?.maxTokens ?? outputCap(model),
70
- headers: { "User-Agent": CANONRY_USER_AGENT, ...HOST_HEADERS[model.api], ...options?.headers }
71
- };
72
- }
73
- var aeroStreamFn = (model, context, options) => aeroModels.streamSimple(model, context, canonryDefaults(model, options));
74
- function completeOnce(model, context, options = {}) {
75
- return aeroModels.complete(model, context, canonryDefaults(model, options));
76
- }
77
-
78
- // src/agent/providers.ts
79
- var PROVIDER_MODELS = {
80
- [AgentProviderIds.claude]: {
81
- [LlmCapabilities.agent]: "claude-opus-4-7",
82
- [LlmCapabilities.analyze]: "claude-sonnet-4-6",
83
- [LlmCapabilities.classify]: "claude-haiku-4-5"
84
- },
85
- [AgentProviderIds.openai]: {
86
- [LlmCapabilities.agent]: "gpt-5.1",
87
- [LlmCapabilities.analyze]: "gpt-5-mini",
88
- [LlmCapabilities.classify]: "gpt-5-nano"
89
- },
90
- [AgentProviderIds.gemini]: {
91
- // Gemini's Flash is already cheap + capable; Flash-Lite is the
92
- // dedicated micro tier for classify. Analyze stays on flash because
93
- // flash-lite drops too much quality for structured synthesis.
94
- // Exact IDs, never Google's `-latest` aliases: pi-ai derives request
95
- // options (thinking level) from the catalog entry for the ID it is given,
96
- // and an alias entry can lag the model it serves. `gemini-flash-latest`
97
- // allows MINIMAL thinking while the 3.8 Flash it resolves to rejects it,
98
- // so every Aero turn failed. Sweeps can use the alias; Aero cannot.
99
- [LlmCapabilities.agent]: "gemini-3.8-flash",
100
- [LlmCapabilities.analyze]: "gemini-3.8-flash",
101
- [LlmCapabilities.classify]: "gemini-3.5-flash-lite"
102
- },
103
- [AgentProviderIds.zai]: {
104
- // GLM lineage: 5.2 replaced 5.1, which pi-ai 0.87 dropped from its
105
- // catalog; 5-turbo is the cheaper tier good for structured tasks and
106
- // classification.
107
- [LlmCapabilities.agent]: "glm-5.2",
108
- [LlmCapabilities.analyze]: "glm-5-turbo",
109
- [LlmCapabilities.classify]: "glm-5-turbo"
110
- }
111
- };
112
- var PROVIDER_DEFAULT_REASONING = {
113
- [AgentProviderIds.claude]: "off",
114
- [AgentProviderIds.openai]: "low",
115
- [AgentProviderIds.gemini]: "off",
116
- [AgentProviderIds.zai]: "off"
117
- };
118
- var AGENT_PROVIDERS = {
119
- [AgentProviderIds.claude]: {
120
- piAiProvider: "anthropic",
121
- label: "Anthropic (Claude)",
122
- defaultModel: PROVIDER_MODELS[AgentProviderIds.claude][LlmCapabilities.agent],
123
- autoDetectPriority: 0
124
- },
125
- [AgentProviderIds.openai]: {
126
- piAiProvider: "openai",
127
- label: "OpenAI",
128
- defaultModel: PROVIDER_MODELS[AgentProviderIds.openai][LlmCapabilities.agent],
129
- autoDetectPriority: 1
130
- },
131
- [AgentProviderIds.gemini]: {
132
- piAiProvider: "google",
133
- label: "Google (Gemini)",
134
- defaultModel: PROVIDER_MODELS[AgentProviderIds.gemini][LlmCapabilities.agent],
135
- autoDetectPriority: 2
136
- },
137
- [AgentProviderIds.zai]: {
138
- piAiProvider: "zai",
139
- label: "Z.ai (GLM)",
140
- defaultModel: PROVIDER_MODELS[AgentProviderIds.zai][LlmCapabilities.agent],
141
- autoDetectPriority: 3
142
- }
143
- };
144
- var AgentProviders = AgentProviderIds;
145
- function agentProvidersByPriority() {
146
- return Object.keys(AGENT_PROVIDERS).slice().sort((a, b) => AGENT_PROVIDERS[a].autoDetectPriority - AGENT_PROVIDERS[b].autoDetectPriority);
147
- }
148
- function listAgentProviders() {
149
- return AGENT_PROVIDER_IDS;
150
- }
151
- function getAgentProvider(name) {
152
- return AGENT_PROVIDERS[name];
153
- }
154
- function coerceAgentProvider(value) {
155
- if (!value) return void 0;
156
- return isAgentProviderId(value) ? value : void 0;
157
- }
158
- function resolveModelForProvider(provider, modelId) {
159
- return resolveModelForCapability(provider, LlmCapabilities.agent, modelId);
160
- }
161
- function resolveModelForCapability(provider, capability, modelIdOverride) {
162
- const entry = AGENT_PROVIDERS[provider];
163
- const id = modelIdOverride ?? PROVIDER_MODELS[provider][capability];
164
- const model = aeroModels.getModel(entry.piAiProvider, id);
165
- if (!model) {
166
- throw new Error(
167
- `Model '${id}' not found for pi-ai provider '${entry.piAiProvider}'. Verify PROVIDER_MODELS[${provider}][${capability}] against the installed @earendil-works/pi-ai catalog.`
168
- );
169
- }
170
- if (provider === AgentProviderIds.gemini && process.env.GEMINI_BASE_URL) {
171
- const base = process.env.GEMINI_BASE_URL.replace(/\/+$/, "");
172
- const baseUrl = base.endsWith("/v1beta") ? base : `${base}/v1beta`;
173
- return { ...model, baseUrl };
174
- }
175
- if (provider === AgentProviderIds.zai && process.env.ZAI_BASE_URL) {
176
- const baseUrl = process.env.ZAI_BASE_URL.replace(/\/+$/, "");
177
- return { ...model, baseUrl };
178
- }
179
- return model;
180
- }
181
- function isAgentModelAvailable(provider, id) {
182
- return !!aeroModels.getModel(AGENT_PROVIDERS[provider].piAiProvider, id);
183
- }
184
- function validateAgentProviderRegistry() {
185
- for (const provider of listAgentProviders()) {
186
- for (const capability of LLM_CAPABILITIES) {
187
- resolveModelForCapability(provider, capability);
188
- }
189
- const entry = AGENT_PROVIDERS[provider];
190
- const agentModel = PROVIDER_MODELS[provider][LlmCapabilities.agent];
191
- if (entry.defaultModel !== agentModel) {
192
- throw new Error(
193
- `AGENT_PROVIDERS[${provider}].defaultModel ('${entry.defaultModel}') does not match PROVIDER_MODELS[${provider}].agent ('${agentModel}'). The two must stay in sync \u2014 defaultModel is a backward-compat shortcut to the agent-tier model.`
194
- );
195
- }
196
- }
197
- }
198
- function resolveApiKeyFor(providerOrPiAi, config) {
199
- return resolveApiKeySource(providerOrPiAi, config)?.key;
200
- }
201
- function resolveApiKeySource(providerOrPiAi, config) {
202
- const id = resolveAgentId(providerOrPiAi);
203
- if (!id) return void 0;
204
- const fromConfig = config.providers?.[id]?.apiKey;
205
- if (fromConfig) return { key: fromConfig, source: "config" };
206
- const fromEnv = agentProviderApiKeyEnvVars(id).map((name) => process.env[name]).find((value) => !!value);
207
- if (fromEnv) return { key: fromEnv, source: "env" };
208
- return void 0;
209
- }
210
- var CATALOG_API_KEY_ENV_VARS = {
211
- anthropic: ["ANTHROPIC_OAUTH_TOKEN", "ANTHROPIC_API_KEY"],
212
- openai: ["OPENAI_API_KEY"],
213
- google: ["GEMINI_API_KEY"],
214
- zai: ["ZAI_API_KEY"]
215
- };
216
- function agentProviderApiKeyEnvVars(id) {
217
- const entry = AGENT_PROVIDERS[id];
218
- return CATALOG_API_KEY_ENV_VARS[entry.piAiProvider] ?? [`${entry.piAiProvider.toUpperCase()}_API_KEY`];
219
- }
220
- function agentProviderApiKeyEnvVar(id) {
221
- const names = agentProviderApiKeyEnvVars(id);
222
- return names[names.length - 1];
223
- }
224
- function resolveAgentId(providerOrPiAi) {
225
- if (isAgentProviderId(providerOrPiAi)) return providerOrPiAi;
226
- for (const id of AGENT_PROVIDER_IDS) {
227
- if (AGENT_PROVIDERS[id].piAiProvider === providerOrPiAi) return id;
228
- }
229
- return void 0;
230
- }
231
- function buildAgentProvidersResponse(config) {
232
- const pinned = coerceAgentProvider(config.agent?.provider ?? void 0);
233
- const pinnedModel = pinned ? config.agent?.model ?? void 0 : void 0;
234
- const providers = listAgentProviders().map((id) => {
235
- const entry = AGENT_PROVIDERS[id];
236
- const source = resolveApiKeySource(id, config);
237
- return {
238
- id,
239
- label: entry.label,
240
- defaultModel: id === pinned && pinnedModel ? pinnedModel : entry.defaultModel,
241
- configured: source !== void 0,
242
- keySource: source?.source ?? null
243
- };
244
- });
245
- const firstConfigured = agentProvidersByPriority().find((p) => resolveApiKeySource(p, config));
246
- return {
247
- providers,
248
- defaultProvider: pinned ?? firstConfigured ?? null
249
- };
250
- }
251
-
252
48
  // src/agent-config.ts
253
49
  function resolveAgentEnabled(env, config) {
254
50
  const raw = env.CANONRY_AGENT_DISABLED?.trim();
@@ -269,10 +65,10 @@ function resolveAgentAllowViewers(env, config) {
269
65
  if (raw) return raw === "1" || raw.toLowerCase() === "true";
270
66
  return config.agent?.allowViewers === true;
271
67
  }
272
- function resolveAgentReasoning(env, config, provider) {
68
+ function resolveAgentReasoning(env, config, provider, modelId) {
273
69
  const raw = env.CANONRY_AGENT_REASONING?.trim().toLowerCase();
274
70
  if (raw && AGENT_REASONING_LEVELS.includes(raw)) return raw;
275
- return config.agent?.reasoning ?? PROVIDER_DEFAULT_REASONING[provider];
71
+ return config.agent?.reasoning ?? defaultAgentReasoning(provider, modelId);
276
72
  }
277
73
 
278
74
  // src/agent/skill-paths.ts
@@ -1132,20 +928,22 @@ function missingProviderMessage() {
1132
928
  function resolveConfiguredAgentProvider(config) {
1133
929
  return coerceAgentProvider(config.agent?.provider);
1134
930
  }
1135
- function describeAgentPin(config) {
931
+ async function describeAgentPin(config) {
1136
932
  const provider = resolveConfiguredAgentProvider(config);
1137
933
  if (!provider) return null;
934
+ const configured = Boolean(resolveApiKeyFor(provider, config));
935
+ if (configured) await refreshAgentModels(provider);
1138
936
  const model = config.agent?.model ?? getAgentProvider(provider).defaultModel;
1139
937
  let modelError = null;
1140
938
  try {
1141
939
  resolveAeroModel(provider, model);
1142
940
  } catch (err) {
1143
- modelError = err instanceof Error ? err.message : String(err);
941
+ if (!isAgentModelUnchecked(provider, model)) modelError = describeError(err);
1144
942
  }
1145
943
  return {
1146
944
  provider,
1147
945
  model,
1148
- configured: Boolean(resolveApiKeyFor(provider, config)),
946
+ configured,
1149
947
  envVar: agentProviderApiKeyEnvVar(provider),
1150
948
  modelError
1151
949
  };
@@ -1171,7 +969,7 @@ function createAeroSession(opts) {
1171
969
  const provider = opts.provider ?? detectAgentProvider(opts.config);
1172
970
  if (!provider) throw new Error(missingProviderMessage());
1173
971
  const model = resolveAeroModel(provider, opts.modelId);
1174
- const thinkingLevel = resolveAgentReasoning(process.env, opts.config, provider);
972
+ const thinkingLevel = resolveAgentReasoning(process.env, opts.config, provider, model.id);
1175
973
  const toolScope = opts.toolScope ?? AeroToolScopes.all;
1176
974
  const toolProfile = opts.toolProfile ?? AeroToolProfiles.default;
1177
975
  const toolCtx = {
@@ -1232,18 +1030,6 @@ function resolveSessionProviderAndModel(config, opts) {
1232
1030
  }
1233
1031
 
1234
1032
  export {
1235
- completeOnce,
1236
- AGENT_PROVIDERS,
1237
- AgentProviders,
1238
- agentProvidersByPriority,
1239
- listAgentProviders,
1240
- getAgentProvider,
1241
- coerceAgentProvider,
1242
- resolveModelForCapability,
1243
- isAgentModelAvailable,
1244
- resolveApiKeyFor,
1245
- agentProviderApiKeyEnvVar,
1246
- buildAgentProvidersResponse,
1247
1033
  resolveAgentEnabled,
1248
1034
  resolveAgentProactiveEnabled,
1249
1035
  resolveAgentAllowViewers,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  API_PROVIDER_NAMES,
3
3
  ProviderNames
4
- } from "./chunk-O4RMPA6H.js";
4
+ } from "./chunk-OMXWBR2R.js";
5
5
 
6
6
  // src/provider-registration.ts
7
7
  function isApiProviderRegistrable(name, entry) {
@@ -2,13 +2,13 @@ import {
2
2
  bucketCliCommandDuration,
3
3
  isTelemetryEnabled,
4
4
  trackEvent
5
- } from "./chunk-7244X3K6.js";
5
+ } from "./chunk-QFKDFU73.js";
6
6
  import {
7
7
  getConfigDir
8
- } from "./chunk-OFL4PTYU.js";
8
+ } from "./chunk-BQKKAPMW.js";
9
9
  import {
10
10
  currentOutcomeAttribution
11
- } from "./chunk-QLPLENDT.js";
11
+ } from "./chunk-EIG2V6UI.js";
12
12
  import {
13
13
  AGENT_NONE,
14
14
  OutcomeSurfaces,
@@ -19,7 +19,7 @@ import {
19
19
  integrationConnectionPropertiesSchema,
20
20
  normalizeAgentSlug,
21
21
  usageSurfaceSchema
22
- } from "./chunk-O4RMPA6H.js";
22
+ } from "./chunk-OMXWBR2R.js";
23
23
 
24
24
  // src/outcome-telemetry.ts
25
25
  import fs from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cloudflareQueueNameSchema
3
- } from "./chunk-O4RMPA6H.js";
3
+ } from "./chunk-OMXWBR2R.js";
4
4
 
5
5
  // src/cloudflare-traffic-config.ts
6
6
  function unsupportedDeliveryMode(deliveryMode) {
@@ -3,7 +3,7 @@ import {
3
3
  resolveCliAccess,
4
4
  resolveCliAccessForInvocation,
5
5
  windowOptions
6
- } from "./chunk-BBOHY2DQ.js";
6
+ } from "./chunk-H6EQMYGT.js";
7
7
  import {
8
8
  emitJsonl
9
9
  } from "./chunk-Z7IUAJOF.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-HGMYEDAQ.js";
15
15
  import {
16
16
  OperationAccesses
17
- } from "./chunk-O4RMPA6H.js";
17
+ } from "./chunk-OMXWBR2R.js";
18
18
 
19
19
  // src/cli-catalog.ts
20
20
  import { createRequire } from "module";
@@ -111,7 +111,7 @@ async function dispatchRegisteredCommand(args, fallbackFormat, specs) {
111
111
  const accessValue = accessFilterFromArgs(argsWithoutHelp);
112
112
  validateAccessFilter(accessValue);
113
113
  if (fallbackFormat !== "text") {
114
- const { printCliCatalog: printCliCatalog2 } = await import("./cli-catalog-OFWJMNMD.js");
114
+ const { printCliCatalog: printCliCatalog2 } = await import("./cli-catalog-P2I6IYNI.js");
115
115
  const group2 = argsWithoutHelp.find((arg) => !arg.startsWith("--"));
116
116
  printCliCatalog2(specs, fallbackFormat, group2, accessValue);
117
117
  return true;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-V5D4XNWV.js";
3
+ } from "./chunk-RHCDUPD6.js";
4
4
  import {
5
5
  emitJsonl
6
6
  } from "./chunk-Z7IUAJOF.js";
7
7
  import {
8
8
  measurementDraftOperationSchema,
9
9
  runMeasurementDraftAction
10
- } from "./chunk-LK2BG6EX.js";
10
+ } from "./chunk-D234NBWI.js";
11
11
  import {
12
12
  isMachineFormat,
13
13
  systemError
@@ -37,7 +37,7 @@ import {
37
37
  unattributedAnswersLabel,
38
38
  uncheckedSourcesLabel,
39
39
  visibilityReportRequestSchema
40
- } from "./chunk-O4RMPA6H.js";
40
+ } from "./chunk-OMXWBR2R.js";
41
41
 
42
42
  // src/commands/measurement-plan.ts
43
43
  import crypto from "crypto";
@@ -7,7 +7,7 @@ import {
7
7
  classifyAiReferralTrafficClass,
8
8
  hostMatchesDomain,
9
9
  hostOf
10
- } from "./chunk-O4RMPA6H.js";
10
+ } from "./chunk-OMXWBR2R.js";
11
11
 
12
12
  // ../integration-traffic/src/ip-ranges/amazonbot.json
13
13
  var amazonbot_default = {
@@ -5,7 +5,7 @@ import {
5
5
  siteCrawlGraphNodes,
6
6
  siteCrawlPages,
7
7
  siteCrawlSnapshots
8
- } from "./chunk-MKAC7HKH.js";
8
+ } from "./chunk-GFRIXUDK.js";
9
9
  import {
10
10
  SITE_CRAWL_GRAPH_MAX_EDGES,
11
11
  SITE_CRAWL_GRAPH_MAX_NODES,
@@ -15,7 +15,7 @@ import {
15
15
  factorStatusFromDistribution,
16
16
  factorStatusFromScore,
17
17
  roundPreservingTotal
18
- } from "./chunk-O4RMPA6H.js";
18
+ } from "./chunk-OMXWBR2R.js";
19
19
 
20
20
  // src/site-audit-factors.ts
21
21
  function recordedSharePct(factor) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  hostMatchesDomain
3
- } from "./chunk-O4RMPA6H.js";
3
+ } from "./chunk-OMXWBR2R.js";
4
4
 
5
5
  // src/citation-utils.ts
6
6
  function pickProjectCitedDomain(citedDomains, projectDomains) {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-V5D4XNWV.js";
4
- import "./chunk-OFL4PTYU.js";
3
+ } from "./chunk-RHCDUPD6.js";
4
+ import "./chunk-BQKKAPMW.js";
5
5
  import "./chunk-AOJU5LKX.js";
6
6
  import "./chunk-HGMYEDAQ.js";
7
- import "./chunk-O4RMPA6H.js";
7
+ import "./chunk-OMXWBR2R.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
 
10
10
  // src/commands/citations.ts
@@ -3,11 +3,11 @@ import {
3
3
  buildCliCatalog,
4
4
  printCliCatalog,
5
5
  renderTopLevelHelp
6
- } from "./chunk-BU3VAG5J.js";
7
- import "./chunk-BBOHY2DQ.js";
6
+ } from "./chunk-XJVCTI2N.js";
7
+ import "./chunk-H6EQMYGT.js";
8
8
  import "./chunk-Z7IUAJOF.js";
9
9
  import "./chunk-HGMYEDAQ.js";
10
- import "./chunk-O4RMPA6H.js";
10
+ import "./chunk-OMXWBR2R.js";
11
11
  import "./chunk-MLKGABMK.js";
12
12
  export {
13
13
  CLI_ROOT_SUMMARIES,
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  REGISTERED_CLI_COMMANDS
3
- } from "./chunk-O77IBNVO.js";
3
+ } from "./chunk-PFPTUCMG.js";
4
4
  import "./chunk-6GO5VVAC.js";
5
- import "./chunk-HEGXGCGL.js";
5
+ import "./chunk-Y2YBRLSS.js";
6
6
  import "./chunk-VJWDBFSL.js";
7
7
  import "./chunk-TSENU4GG.js";
8
- import "./chunk-V5D4XNWV.js";
9
- import "./chunk-OFL4PTYU.js";
10
- import "./chunk-BBOHY2DQ.js";
8
+ import "./chunk-RHCDUPD6.js";
9
+ import "./chunk-BQKKAPMW.js";
10
+ import "./chunk-H6EQMYGT.js";
11
11
  import "./chunk-Z7IUAJOF.js";
12
- import "./chunk-LK2BG6EX.js";
12
+ import "./chunk-D234NBWI.js";
13
13
  import "./chunk-AOJU5LKX.js";
14
14
  import "./chunk-HGMYEDAQ.js";
15
- import "./chunk-O4RMPA6H.js";
15
+ import "./chunk-OMXWBR2R.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
18
18
  REGISTERED_CLI_COMMANDS
package/dist/cli.js CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node --import tsx
2
2
  import {
3
3
  REGISTERED_CLI_COMMANDS
4
- } from "./chunk-O77IBNVO.js";
4
+ } from "./chunk-PFPTUCMG.js";
5
5
  import "./chunk-6GO5VVAC.js";
6
6
  import {
7
7
  buildSetupState,
8
8
  runPendingServeHandoff
9
- } from "./chunk-GNKOBKPW.js";
10
- import "./chunk-HEGXGCGL.js";
9
+ } from "./chunk-5P7DSHNK.js";
10
+ import "./chunk-Y2YBRLSS.js";
11
11
  import "./chunk-VJWDBFSL.js";
12
12
  import "./chunk-TSENU4GG.js";
13
- import "./chunk-JY3RLZGB.js";
13
+ import "./chunk-VF7XGX2I.js";
14
14
  import {
15
15
  checkLatestVersionForCli,
16
16
  cliRuntimeContext,
@@ -24,24 +24,24 @@ import {
24
24
  showFirstRunNotice,
25
25
  trackCliCommandFinished,
26
26
  trackEvent
27
- } from "./chunk-7244X3K6.js";
27
+ } from "./chunk-QFKDFU73.js";
28
28
  import {
29
29
  autoSyncSkills,
30
30
  formatAutoSyncNotice
31
- } from "./chunk-IIOEAJTV.js";
32
- import "./chunk-V5D4XNWV.js";
33
- import "./chunk-OFL4PTYU.js";
31
+ } from "./chunk-VB47PTY7.js";
32
+ import "./chunk-RHCDUPD6.js";
33
+ import "./chunk-BQKKAPMW.js";
34
34
  import {
35
35
  accessFilterFromArgs,
36
36
  dispatchRegisteredCommand,
37
37
  printCliCatalog
38
- } from "./chunk-BU3VAG5J.js";
38
+ } from "./chunk-XJVCTI2N.js";
39
39
  import {
40
40
  resolveCliAccess
41
- } from "./chunk-BBOHY2DQ.js";
41
+ } from "./chunk-H6EQMYGT.js";
42
42
  import "./chunk-Z7IUAJOF.js";
43
- import "./chunk-TALC5DX5.js";
44
- import "./chunk-LK2BG6EX.js";
43
+ import "./chunk-B37SDIGU.js";
44
+ import "./chunk-D234NBWI.js";
45
45
  import "./chunk-AOJU5LKX.js";
46
46
  import {
47
47
  CliError,
@@ -52,7 +52,7 @@ import {
52
52
  } from "./chunk-HGMYEDAQ.js";
53
53
  import {
54
54
  OperationAccesses
55
- } from "./chunk-O4RMPA6H.js";
55
+ } from "./chunk-OMXWBR2R.js";
56
56
  import "./chunk-MLKGABMK.js";
57
57
 
58
58
  // src/cli.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-V5D4XNWV.js";
4
- import "./chunk-OFL4PTYU.js";
3
+ } from "./chunk-RHCDUPD6.js";
4
+ import "./chunk-BQKKAPMW.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -21,7 +21,7 @@ import {
21
21
  normalizeCompetitorDomain,
22
22
  shareOfVoiceLabel,
23
23
  shareOfVoiceReason
24
- } from "./chunk-O4RMPA6H.js";
24
+ } from "./chunk-OMXWBR2R.js";
25
25
  import "./chunk-MLKGABMK.js";
26
26
 
27
27
  // src/commands/competitor.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-V5D4XNWV.js";
4
- import "./chunk-OFL4PTYU.js";
3
+ } from "./chunk-RHCDUPD6.js";
4
+ import "./chunk-BQKKAPMW.js";
5
5
  import {
6
6
  emitJsonl
7
7
  } from "./chunk-Z7IUAJOF.js";
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  contentTargetDismissRequestSchema,
16
16
  formatPercent
17
- } from "./chunk-O4RMPA6H.js";
17
+ } from "./chunk-OMXWBR2R.js";
18
18
  import "./chunk-MLKGABMK.js";
19
19
 
20
20
  // src/commands/content.ts
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  clearDashboardPassword,
3
3
  loadConfigRaw
4
- } from "./chunk-OFL4PTYU.js";
4
+ } from "./chunk-BQKKAPMW.js";
5
5
  import {
6
6
  isMachineFormat
7
7
  } from "./chunk-HGMYEDAQ.js";
8
8
  import {
9
9
  anyUsersExist
10
- } from "./chunk-YSEC6TIB.js";
11
- import "./chunk-Y4GK7GCV.js";
12
- import "./chunk-QLPLENDT.js";
10
+ } from "./chunk-PRNO5TLE.js";
11
+ import "./chunk-YOZ35ZTT.js";
12
+ import "./chunk-EIG2V6UI.js";
13
13
  import {
14
14
  createClient
15
- } from "./chunk-MKAC7HKH.js";
16
- import "./chunk-O4RMPA6H.js";
15
+ } from "./chunk-GFRIXUDK.js";
16
+ import "./chunk-OMXWBR2R.js";
17
17
  import "./chunk-MLKGABMK.js";
18
18
 
19
19
  // src/commands/dashboard.ts
@@ -40,7 +40,7 @@ function parseDemoTrustedProxies(values) {
40
40
  async function demoCommand(options) {
41
41
  const { host, port } = parseDemoListenOptions(options);
42
42
  const trustProxy = parseDemoTrustedProxies(options.trustProxy);
43
- const { createDemoServer } = await import("./demo-server-XO7PHM4I.js");
43
+ const { createDemoServer } = await import("./demo-server-IGTBANDC.js");
44
44
  const app = await createDemoServer({ trustProxy });
45
45
  let stopping = false;
46
46
  const stop = () => {