@canonry/canonry 7.129.0 → 7.130.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.
Files changed (120) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +3 -3
  2. package/dist/activity-VIJVNTMK.js +13 -0
  3. package/dist/{ads-XOHE65YV.js → ads-PLZRG4BQ.js} +4 -4
  4. package/dist/{agent-R2KM6VDZ.js → agent-RFRMOTLE.js} +8 -8
  5. package/dist/{agent-ask-LK6L5U2G.js → agent-ask-CB756SUB.js} +4 -4
  6. package/dist/{agent-conversations-SPQZA674.js → agent-conversations-RRI7T74B.js} +4 -4
  7. package/dist/{agent-journeys-J4PRNH37.js → agent-journeys-PLYAVLGB.js} +4 -4
  8. package/dist/{agent-memory-HXK5R5H2.js → agent-memory-R5Q7DLRZ.js} +4 -4
  9. package/dist/{agent-providers-YXCFLOAD.js → agent-providers-HNMGZ7GY.js} +4 -4
  10. package/dist/{agent-transcript-XLBIKNTI.js → agent-transcript-N6ZBTF72.js} +4 -4
  11. package/dist/{analytics-CT6X5AIK.js → analytics-W6B2FQSA.js} +4 -4
  12. package/dist/{answerability-PRGBTPYO.js → answerability-BDOOPOJF.js} +4 -4
  13. package/dist/{apply-6AQBJSLU.js → apply-LCANKKT5.js} +4 -4
  14. package/dist/{backfill-UMVXMH2Z.js → backfill-AM2VXWLI.js} +11 -11
  15. package/dist/{backlinks-YAQL5BCW.js → backlinks-ZXSN3XNV.js} +4 -4
  16. package/dist/{bing-A3BZHGVS.js → bing-FMDKRCXN.js} +4 -4
  17. package/dist/{bootstrap-3GXCVZR6.js → bootstrap-IHKKYDBO.js} +11 -11
  18. package/dist/{cdp-NTHQS2VZ.js → cdp-ASPLW35M.js} +8 -8
  19. package/dist/{chunk-T5H4KNSZ.js → chunk-4ISL4JNK.js} +4 -4
  20. package/dist/{chunk-T7EDIDHA.js → chunk-52J7GFCK.js} +2 -2
  21. package/dist/{chunk-CT6J54HN.js → chunk-56TGVPRB.js} +13 -9
  22. package/dist/{chunk-HEWCB5LK.js → chunk-6UU2I6AG.js} +59 -42
  23. package/dist/{chunk-JZDOF24J.js → chunk-7PTUA52C.js} +1 -1
  24. package/dist/{chunk-66ESBZBC.js → chunk-ALU56PI7.js} +1 -1
  25. package/dist/{chunk-AFKCRFVL.js → chunk-AP54KLWN.js} +1 -1
  26. package/dist/{chunk-RHVX66CW.js → chunk-C4JM5HJW.js} +1 -1
  27. package/dist/{chunk-HD73OWIQ.js → chunk-CBREBUUV.js} +5 -5
  28. package/dist/{chunk-MYDVOMA2.js → chunk-FGEBFVHB.js} +179 -16
  29. package/dist/{chunk-2QHWROIF.js → chunk-FI7HVTO6.js} +13 -5
  30. package/dist/{chunk-GUU3LZQ2.js → chunk-GVCL4XBU.js} +3 -3
  31. package/dist/{chunk-APM25SLF.js → chunk-HH6FQW5W.js} +3 -3
  32. package/dist/{chunk-WPYUTGW5.js → chunk-HMCDVKHS.js} +356 -227
  33. package/dist/{chunk-GBYV3WM5.js → chunk-JMJSAK2H.js} +3 -3
  34. package/dist/{chunk-OFW3JZLL.js → chunk-JUZ4ZCOX.js} +4 -4
  35. package/dist/{chunk-H7UFYW34.js → chunk-KQQERQJ2.js} +3 -3
  36. package/dist/{chunk-V5B2CFBF.js → chunk-LJ65QBRP.js} +1 -1
  37. package/dist/{chunk-3HQ5GREG.js → chunk-M3BKRPB7.js} +387 -378
  38. package/dist/{chunk-RXBK4GQX.js → chunk-MARIMDMX.js} +4 -4
  39. package/dist/{chunk-EGTMTGBD.js → chunk-MQFH765X.js} +4 -4
  40. package/dist/{chunk-2DTDECRE.js → chunk-N5GK27RW.js} +5 -5
  41. package/dist/{chunk-BW3SUS45.js → chunk-NUYKLS2R.js} +2 -2
  42. package/dist/{chunk-MWZQPB26.js → chunk-PABT3HDP.js} +2 -2
  43. package/dist/{chunk-KL6LUFZG.js → chunk-QHQZ2226.js} +1 -1
  44. package/dist/{chunk-NJPBDYVK.js → chunk-QRIKJT6Y.js} +1 -1
  45. package/dist/{chunk-JJQ5USIP.js → chunk-S6X3HHSN.js} +7 -6
  46. package/dist/{chunk-SQ7ZF5MT.js → chunk-VEBSXHB2.js} +8 -8
  47. package/dist/{chunk-6S3Z37H7.js → chunk-VEDGR4LZ.js} +2 -2
  48. package/dist/{chunk-YMWRR3HT.js → chunk-VON4PHNS.js} +4 -4
  49. package/dist/{chunk-6TEMKMWL.js → chunk-VRY5M7CR.js} +2 -2
  50. package/dist/{chunk-6HWV3PVJ.js → chunk-WEJOT2VP.js} +5 -5
  51. package/dist/{chunk-5QRZYOHL.js → chunk-WP76HORO.js} +1 -1
  52. package/dist/{chunk-3HW7EDLQ.js → chunk-WZPKPA6I.js} +2 -2
  53. package/dist/{chunk-EF6I66NL.js → chunk-Z77D43M5.js} +2 -2
  54. package/dist/{chunk-YYMXQVGL.js → chunk-ZHWJJVCT.js} +2 -2
  55. package/dist/{chunk-OWT4PYRT.js → chunk-ZHXPH7WB.js} +1 -1
  56. package/dist/{chunk-PQL52QOQ.js → chunk-ZZSKYOHV.js} +4 -4
  57. package/dist/{citations-GNB2QFVP.js → citations-YWXR3WBL.js} +5 -5
  58. package/dist/{cli-catalog-U6DBN4VK.js → cli-catalog-RT3QPDLR.js} +4 -4
  59. package/dist/cli-commands-PSZFKTZM.js +18 -0
  60. package/dist/cli.js +14 -14
  61. package/dist/{competitor-I7Z6SSQP.js → competitor-6ZTA2SZH.js} +4 -4
  62. package/dist/{content-QIBZSUA6.js → content-DJYGQ5CP.js} +4 -4
  63. package/dist/{dashboard-7FYN233W.js → dashboard-QNOTLZUI.js} +7 -7
  64. package/dist/{demo-P2V5SBGO.js → demo-FVTIXDAO.js} +3 -3
  65. package/dist/{demo-server-YYKW42LA.js → demo-server-R7LG5BRB.js} +13 -13
  66. package/dist/{discover-RBTF62HF.js → discover-3E7QM2TL.js} +5 -5
  67. package/dist/{discover-eval-NMDHNYFT.js → discover-eval-NAZPA6PV.js} +4 -4
  68. package/dist/{doctor-4CJAVMAD.js → doctor-OFFSPNBK.js} +4 -4
  69. package/dist/{evidence-7Q4ET24V.js → evidence-VOSSML2G.js} +4 -4
  70. package/dist/{export-cmd-CKK77OJI.js → export-cmd-IVACTDSV.js} +4 -4
  71. package/dist/{ga-EZOQAH3P.js → ga-BX4C7TPI.js} +4 -4
  72. package/dist/{gbp-UL6TC2FY.js → gbp-SV3J2VG3.js} +4 -4
  73. package/dist/{google-7BM3AREH.js → google-J23OD7TR.js} +5 -5
  74. package/dist/{google-marketing-DM6R3K7R.js → google-marketing-TTLXMDMD.js} +2 -2
  75. package/dist/{health-cmd-TDD7FB7Z.js → health-cmd-26AHD5XL.js} +5 -5
  76. package/dist/{history-V5CQNF4Z.js → history-QWBRFDQR.js} +4 -4
  77. package/dist/index.d.ts +10 -10
  78. package/dist/index.js +26 -26
  79. package/dist/{init-KLKQCQ54.js → init-IZVPCO36.js} +13 -13
  80. package/dist/{insights-FRBCFTVP.js → insights-PMTHHZ2H.js} +4 -4
  81. package/dist/intelligence-service-LMVQQRPN.js +15 -0
  82. package/dist/{journeys-J76FXGLW.js → journeys-IA7TF753.js} +4 -4
  83. package/dist/{keys-LZVHDNZH.js → keys-DOHLZTRI.js} +4 -4
  84. package/dist/{keyword-FMDPSY7C.js → keyword-3C2ZU6OB.js} +4 -4
  85. package/dist/{logs-LU33LBEQ.js → logs-P7VRVZ5N.js} +4 -4
  86. package/dist/{mcp-M63QTZK5.js → mcp-6NA62OAY.js} +5 -5
  87. package/dist/mcp.js +10 -10
  88. package/dist/{measurement-plan-C6W7PUMR.js → measurement-plan-RHKCARVE.js} +6 -6
  89. package/dist/{notify-Q54WJSST.js → notify-ODCY7TD3.js} +4 -4
  90. package/dist/{organic-evidence-EGM6MHVP.js → organic-evidence-76P5AYB3.js} +4 -4
  91. package/dist/{overview-EWSJQE2E.js → overview-5T776SEB.js} +7 -7
  92. package/dist/{project-K7U4L5TA.js → project-ITMGW45M.js} +4 -4
  93. package/dist/{project-setup-H6JIED5C.js → project-setup-A3Q6ZX73.js} +4 -4
  94. package/dist/{query-NNFM2KSB.js → query-3QAQITK3.js} +4 -4
  95. package/dist/{research-KHDVC2MP.js → research-R74N3VRL.js} +4 -4
  96. package/dist/{results-export-2HTJWA2Y.js → results-export-23GY45AY.js} +4 -4
  97. package/dist/{run-VWAT66RX.js → run-ID66JYBN.js} +6 -6
  98. package/dist/{schedule-6C26Y5DP.js → schedule-HZ2CRUAL.js} +4 -4
  99. package/dist/{search-DY4JELQM.js → search-DM5WWMTE.js} +4 -4
  100. package/dist/{serve-W6CTWEDL.js → serve-PKDK7ZWB.js} +27 -27
  101. package/dist/{session-IX6YUFT4.js → session-EZ6I5VUF.js} +16 -16
  102. package/dist/{settings-IPTMUYPV.js → settings-SIEKVYD7.js} +4 -4
  103. package/dist/{sitemaps-JHAE7447.js → sitemaps-M4IAZLK2.js} +4 -4
  104. package/dist/{skills-C5KQTJZX.js → skills-J6LWTNU5.js} +3 -3
  105. package/dist/{snapshot-KZDIFYFO.js → snapshot-SM3BVX5M.js} +4 -4
  106. package/dist/{src-JWSI26BC.js → src-VGZVLOM3.js} +2 -2
  107. package/dist/{status-7TFB73LG.js → status-BHJJOUCK.js} +6 -6
  108. package/dist/{support-ZZ2GJP4Z.js → support-FPXXXJPZ.js} +2 -2
  109. package/dist/{technical-aeo-R6GR6JJB.js → technical-aeo-4DJWWPUN.js} +4 -4
  110. package/dist/{telemetry-YTUYOO3M.js → telemetry-LKVQUSO7.js} +5 -5
  111. package/dist/{tools-6N3Q7TRE.js → tools-NFVIW4YP.js} +12 -12
  112. package/dist/{traffic-5IN455SY.js → traffic-QSZYZHFW.js} +6 -6
  113. package/dist/{trends-MULZJCGC.js → trends-WIHWJVJR.js} +4 -4
  114. package/dist/{users-4R5WLGZA.js → users-HQOPQRTP.js} +4 -4
  115. package/dist/{visibility-stats-GFDD6IYA.js → visibility-stats-MCY5CAUC.js} +5 -5
  116. package/dist/{wordpress-S6NFAXJ6.js → wordpress-IB5YOJSM.js} +5 -5
  117. package/package.json +1 -1
  118. package/dist/activity-JOXDL3UF.js +0 -13
  119. package/dist/cli-commands-LQS3WOKR.js +0 -18
  120. package/dist/intelligence-service-APERYL5N.js +0 -15
@@ -14,7 +14,7 @@ import {
14
14
  isRunFailureMessage,
15
15
  isSystemMessage,
16
16
  loadAeroSystemPrompt,
17
- missingProviderMessage,
17
+ missingAgentProvider,
18
18
  readAeroViewEvidenceForTurn,
19
19
  resolveAeroModel,
20
20
  resolveAgentAllowViewers,
@@ -24,18 +24,18 @@ import {
24
24
  resolveConfiguredAgentProvider,
25
25
  resolveSessionProviderAndModel,
26
26
  setAeroSystemPrompt
27
- } from "./chunk-CT6J54HN.js";
27
+ } from "./chunk-56TGVPRB.js";
28
28
  import {
29
29
  AeroToolProfiles,
30
30
  AeroToolScopes,
31
31
  buildAeroStateTools,
32
32
  isAeroToolProfile,
33
33
  truncateToolResult
34
- } from "./chunk-2DTDECRE.js";
34
+ } from "./chunk-N5GK27RW.js";
35
35
  import {
36
36
  answerServiceAdapters,
37
37
  answerServiceDescriptors
38
- } from "./chunk-AFKCRFVL.js";
38
+ } from "./chunk-AP54KLWN.js";
39
39
  import {
40
40
  isManagedCanonryInstall
41
41
  } from "./chunk-XAJS5FH3.js";
@@ -57,7 +57,7 @@ import {
57
57
  removeCloudflareTrafficConnection,
58
58
  removeCloudflareTrafficConnectionBySourceId,
59
59
  upsertCloudflareTrafficConnection
60
- } from "./chunk-5QRZYOHL.js";
60
+ } from "./chunk-WP76HORO.js";
61
61
  import {
62
62
  claudeAdapter,
63
63
  embedQueries,
@@ -69,7 +69,7 @@ import {
69
69
  openrouterAdapter,
70
70
  perplexityAdapter,
71
71
  startTrafficReclassification
72
- } from "./chunk-HD73OWIQ.js";
72
+ } from "./chunk-CBREBUUV.js";
73
73
  import {
74
74
  classifyUsageSurface,
75
75
  createApiUsageTelemetry,
@@ -81,7 +81,7 @@ import {
81
81
  startOutcomeTimer,
82
82
  trackFeatureCompleted,
83
83
  trackInstallState
84
- } from "./chunk-T5H4KNSZ.js";
84
+ } from "./chunk-4ISL4JNK.js";
85
85
  import {
86
86
  isLoopbackBindHost
87
87
  } from "./chunk-TSENU4GG.js";
@@ -89,7 +89,7 @@ import {
89
89
  isApiProviderRegistrable,
90
90
  isCdpProviderRegistrable,
91
91
  registeredProviderNames
92
- } from "./chunk-66ESBZBC.js";
92
+ } from "./chunk-ALU56PI7.js";
93
93
  import {
94
94
  checkLatestVersionForServer,
95
95
  getOrCreateAnonymousId,
@@ -101,17 +101,17 @@ import {
101
101
  recordDashboardEvent,
102
102
  setTelemetryPreference,
103
103
  trackEvent
104
- } from "./chunk-3HW7EDLQ.js";
104
+ } from "./chunk-WZPKPA6I.js";
105
105
  import {
106
106
  createCanonryMcpServer
107
- } from "./chunk-OFW3JZLL.js";
107
+ } from "./chunk-JUZ4ZCOX.js";
108
108
  import {
109
109
  CANONRY_MCP_TIERS,
110
110
  CANONRY_MCP_TOOLKIT_NAMES
111
111
  } from "./chunk-MG4COK23.js";
112
112
  import {
113
113
  ApiClient
114
- } from "./chunk-H7UFYW34.js";
114
+ } from "./chunk-KQQERQJ2.js";
115
115
  import {
116
116
  AGENT_PROVIDERS,
117
117
  PROVIDER_MODELS,
@@ -146,39 +146,39 @@ import {
146
146
  saveConfigPatch,
147
147
  sentimentInstallReadiness,
148
148
  updateSharedProviderExecutionGate
149
- } from "./chunk-T7EDIDHA.js";
149
+ } from "./chunk-52J7GFCK.js";
150
150
  import {
151
151
  getBundledSkillSnapshots
152
- } from "./chunk-EF6I66NL.js";
152
+ } from "./chunk-Z77D43M5.js";
153
153
  import {
154
154
  computeFactorAverages,
155
155
  deleteSiteCrawlGraphLayout,
156
156
  persistSiteCrawlGraphLayout,
157
157
  prepareSiteCrawlGraphLayout,
158
158
  recordedSharePct
159
- } from "./chunk-MWZQPB26.js";
159
+ } from "./chunk-PABT3HDP.js";
160
160
  import {
161
161
  CanonryMcpToolNames,
162
162
  canonryMcpTools
163
- } from "./chunk-JJQ5USIP.js";
163
+ } from "./chunk-S6X3HHSN.js";
164
164
  import {
165
165
  PACKAGE_VERSION
166
166
  } from "./chunk-AOJU5LKX.js";
167
167
  import {
168
168
  CliError
169
- } from "./chunk-NJPBDYVK.js";
169
+ } from "./chunk-QRIKJT6Y.js";
170
170
  import {
171
171
  IntelligenceService
172
- } from "./chunk-6HWV3PVJ.js";
172
+ } from "./chunk-WEJOT2VP.js";
173
173
  import {
174
174
  computeCitedCompetitorDomains,
175
175
  determineCitationState
176
- } from "./chunk-V5B2CFBF.js";
176
+ } from "./chunk-LJ65QBRP.js";
177
177
  import {
178
178
  addLogListener,
179
179
  createFastifyLogger,
180
180
  createLogger
181
- } from "./chunk-6TEMKMWL.js";
181
+ } from "./chunk-VRY5M7CR.js";
182
182
  import {
183
183
  BING_THROTTLE_COOLDOWN_MS,
184
184
  BingApiError,
@@ -288,6 +288,7 @@ import {
288
288
  measurementRunCompleteness,
289
289
  measurementRunSlotState,
290
290
  measurementSlotKey,
291
+ narrowKeyRefused,
291
292
  newerFullSweep,
292
293
  nextRunFromCron,
293
294
  nextRunFromSchedule,
@@ -338,7 +339,7 @@ import {
338
339
  webhookTargetRefusalReason,
339
340
  webhookUserAgent,
340
341
  writeAuditLog
341
- } from "./chunk-WPYUTGW5.js";
342
+ } from "./chunk-HMCDVKHS.js";
342
343
  import {
343
344
  OperationalLogStore,
344
345
  SentimentIdempotencyConflict,
@@ -440,7 +441,7 @@ import {
440
441
  unrecognizedAgentEventsHourly,
441
442
  unrecognizedAgentNotifyState,
442
443
  usageCounters
443
- } from "./chunk-2QHWROIF.js";
444
+ } from "./chunk-FI7HVTO6.js";
444
445
  import {
445
446
  AGENT_MEMORY_VALUE_MAX_BYTES,
446
447
  AI_ENGINE_DOMAINS,
@@ -500,6 +501,7 @@ import {
500
501
  OutcomeSurfaces,
501
502
  OutcomeTriggers,
502
503
  PROVIDER_NAMES,
504
+ PROVIDER_SETUP_STEPS,
503
505
  PricingTiers,
504
506
  ProviderBatchRequestOutcomes,
505
507
  ProviderBatchStatuses,
@@ -621,6 +623,8 @@ import {
621
623
  googleAdsCampaignMetricsQuerySchema,
622
624
  googleAdsRawSnapshotDtoSchema,
623
625
  googleBusinessReviewUrl,
626
+ googleOAuthNotConfigured,
627
+ googleOAuthSetupSteps,
624
628
  gtmAccountsResponseSchema,
625
629
  gtmContainerListResponseSchema,
626
630
  gtmGoogleAdsConversionIdMappingDtoSchema,
@@ -636,6 +640,7 @@ import {
636
640
  hostMatchesDomain,
637
641
  hostOf,
638
642
  inclusiveDayCount,
643
+ integrationNotConnected,
639
644
  isBrowserProvider,
640
645
  isChatGptAeroError,
641
646
  isCitationMeasurable,
@@ -656,6 +661,8 @@ import {
656
661
  missingDependency,
657
662
  mostActionableProviderErrorCode,
658
663
  nextScheduleUpdatedAt,
664
+ noProvider,
665
+ noSnapshotProvider,
659
666
  normalizeAgentSlug,
660
667
  normalizeEmbedProjectTabs,
661
668
  normalizeHostname,
@@ -666,6 +673,7 @@ import {
666
673
  normalizeServedModel,
667
674
  normalizeSiteAuditRunRequest,
668
675
  normalizeUrlPath,
676
+ notConnectedRefusal,
669
677
  notFound,
670
678
  notImplemented,
671
679
  notificationEventSchema,
@@ -726,7 +734,7 @@ import {
726
734
  winnabilityClassLabel,
727
735
  withRetry,
728
736
  withSkippedProviders
729
- } from "./chunk-MYDVOMA2.js";
737
+ } from "./chunk-FGEBFVHB.js";
730
738
 
731
739
  // src/google-marketing-runtime.ts
732
740
  import crypto2 from "crypto";
@@ -2983,7 +2991,7 @@ var ConfigCredentialStore = class {
2983
2991
  const auth = provider === GoogleMarketingProviders["google-ads"] ? getGoogleAdsAuthConfig(this.#config) : getGtmAuthConfig(this.#config);
2984
2992
  if (!auth.clientId || !auth.clientSecret) {
2985
2993
  throw new GoogleMarketingRuntimeError(
2986
- "Google OAuth client credentials are not configured",
2994
+ `Google OAuth client credentials are not configured. ${googleOAuthSetupSteps(null)}`,
2987
2995
  "NOT_CONFIGURED"
2988
2996
  );
2989
2997
  }
@@ -6519,7 +6527,7 @@ function nonBlank(value) {
6519
6527
  return trimmed ? trimmed : void 0;
6520
6528
  }
6521
6529
  function resolveBuildCommit(env = process.env) {
6522
- const embedded = true ? "5d143178e9f0f49e74b4d0686f464e4c331d9bb2" : void 0;
6530
+ const embedded = true ? "0d0fadf1b0c7b9aa5db613c379f61fb949704fa4" : void 0;
6523
6531
  return nonBlank(embedded) ?? nonBlank(env.CANONRY_COMMIT);
6524
6532
  }
6525
6533
  function resolveInstanceIdentity(env = process.env) {
@@ -7059,8 +7067,12 @@ function recordCallLatency(latencies, provider, startedAt) {
7059
7067
  values.push(Math.max(0, Date.now() - startedAt));
7060
7068
  latencies.set(provider, values);
7061
7069
  }
7062
- function classifyRunAbortReason(message) {
7063
- if (/^No providers configured\b/.test(message)) return "no_provider";
7070
+ function classifyRunAbortReason(err, message) {
7071
+ if (err instanceof AppError && err.code === "NO_PROVIDER") return "no_provider";
7072
+ return classifyStoredRunAbortReason(message);
7073
+ }
7074
+ function classifyStoredRunAbortReason(message) {
7075
+ if (/^No (?:runnable answer provider is configured|providers configured)\b/.test(message)) return "no_provider";
7064
7076
  if (/^Project [^ ]+ not found$/.test(message)) return "project_not_found";
7065
7077
  if (/^Daily quota exceeded\b/.test(message)) return "quota_exceeded";
7066
7078
  if (/^Run [^ ]+ not found$/.test(message)) return "run_not_found";
@@ -7308,7 +7320,7 @@ var JobRunner = class {
7308
7320
  });
7309
7321
  }
7310
7322
  if (activeProviders.length === 0) {
7311
- throw new Error("No providers configured. Add at least one provider API key.");
7323
+ throw noProvider(project.name);
7312
7324
  }
7313
7325
  const skipped = existingRun.skippedProviders ?? {};
7314
7326
  const calledProviders = activeProviders.filter((provider) => !(provider.adapter.name in skipped));
@@ -7720,7 +7732,7 @@ var JobRunner = class {
7720
7732
  }).where(and4(eq5(runs.id, runId), inArray3(runs.status, ["queued", "running"]))).run();
7721
7733
  this.flushProviderUsage(providerDispatchCounts, providerReservations);
7722
7734
  const abandoned = this.markBatchesCancelled(batchRowIds, `Cancelled because the run failed: ${errorMessage}`);
7723
- const abortReason2 = classifyRunAbortReason(errorMessage);
7735
+ const abortReason2 = classifyRunAbortReason(err, errorMessage);
7724
7736
  const phases = buildPhases({ startTime, providerCallStart, providerCallEnd });
7725
7737
  if (abortReason2) {
7726
7738
  const domainHash = hashDomain(executionContext.canonicalDomain ?? null);
@@ -8994,7 +9006,7 @@ var JobRunner = class {
8994
9006
  let streak = 0;
8995
9007
  for (const row of recent) {
8996
9008
  if (row.status === "completed") break;
8997
- if (row.status === "failed" && row.error && classifyRunAbortReason(row.error)) continue;
9009
+ if (row.status === "failed" && row.error && classifyStoredRunAbortReason(row.error)) continue;
8998
9010
  streak++;
8999
9011
  }
9000
9012
  return streak;
@@ -9304,7 +9316,7 @@ async function executeGscSync(db, runId, projectId, opts) {
9304
9316
  try {
9305
9317
  const { clientId: googleClientId, clientSecret: googleClientSecret } = getGoogleAuthConfig(opts.config);
9306
9318
  if (!googleClientId || !googleClientSecret) {
9307
- throw withOutcomeReason(new Error("Google OAuth is not configured in the local Canonry config"), OutcomeReasonCodes.NOT_CONNECTED);
9319
+ throw withOutcomeReason(new Error(`Google OAuth is not configured in the local Canonry config. ${googleOAuthSetupSteps()}`), OutcomeReasonCodes.NOT_CONNECTED);
9308
9320
  }
9309
9321
  const project = db.select().from(projects).where(eq8(projects.id, projectId)).get();
9310
9322
  if (!project) {
@@ -9774,7 +9786,7 @@ async function executeGbpSync(db, runId, projectId, opts) {
9774
9786
  try {
9775
9787
  const { clientId, clientSecret } = getGoogleAuthConfig(opts.config);
9776
9788
  if (!clientId || !clientSecret) {
9777
- throw withOutcomeReason(new Error("Google OAuth is not configured in the local Canonry config"), OutcomeReasonCodes.NOT_CONNECTED);
9789
+ throw withOutcomeReason(new Error(`Google OAuth is not configured in the local Canonry config. ${googleOAuthSetupSteps("gbp")}`), OutcomeReasonCodes.NOT_CONNECTED);
9778
9790
  }
9779
9791
  const project = db.select().from(projects).where(eq10(projects.id, projectId)).get();
9780
9792
  if (!project) throw withOutcomeReason(new Error(`Project not found: ${projectId}`), OutcomeReasonCodes.NOT_FOUND);
@@ -11255,7 +11267,7 @@ async function executeInspectSitemap(db, runId, projectId, opts) {
11255
11267
  try {
11256
11268
  const { clientId: googleClientId, clientSecret: googleClientSecret } = getGoogleAuthConfig(opts.config);
11257
11269
  if (!googleClientId || !googleClientSecret) {
11258
- throw withOutcomeReason(new Error("Google OAuth is not configured in the local Canonry config"), OutcomeReasonCodes.NOT_CONNECTED);
11270
+ throw withOutcomeReason(new Error(`Google OAuth is not configured in the local Canonry config. ${googleOAuthSetupSteps()}`), OutcomeReasonCodes.NOT_CONNECTED);
11259
11271
  }
11260
11272
  const project = db.select().from(projects).where(eq12(projects.id, projectId)).get();
11261
11273
  if (!project) {
@@ -18681,7 +18693,7 @@ ${lines.join("\n")}
18681
18693
  const pinned = resolveConfiguredAgentProvider(this.opts.config);
18682
18694
  const stored = coerceAgentProvider(current.provider ?? void 0);
18683
18695
  const provider = preferences?.provider ?? pinned ?? stored ?? detectAgentProvider(this.opts.config);
18684
- if (!provider) throw new Error(missingProviderMessage());
18696
+ if (!provider) throw missingAgentProvider();
18685
18697
  const carried = !preferences?.provider && !pinned && provider === current.provider && current.modelId && (isAgentModelAvailable(provider, current.modelId) || isAgentModelUnchecked(provider, current.modelId) && !!resolveApiKeyFor(provider, this.opts.config)) ? current.modelId : void 0;
18686
18698
  const pinnedModelId = provider === pinned ? this.opts.config.agent?.model ?? void 0 : void 0;
18687
18699
  const modelId = preferences?.modelId ?? pinnedModelId ?? carried ?? getAgentProvider(provider).defaultModel;
@@ -20096,8 +20108,10 @@ function registerAgentRoutes(app, opts) {
20096
20108
  "/projects/:name/agent/transcript",
20097
20109
  // For a viewer this writes nothing: it drops their own in-memory
20098
20110
  // conversation. Everyone else still meets the administrator gate below
20099
- // before anything is written, so the grant widens nothing for them.
20100
- { config: { readSemantic: true } },
20111
+ // before anything is written, so the grant widens nothing for them. No
20112
+ // project-bound key is an administrator, so the auth hook refuses one
20113
+ // with that gate's answer before any scope gate.
20114
+ { config: { readSemantic: true, projectBoundRefusal: narrowKeyRefused } },
20101
20115
  async (request) => {
20102
20116
  const viewerId = viewerAeroCaller(request, opts);
20103
20117
  if (viewerId) {
@@ -20117,8 +20131,9 @@ function registerAgentRoutes(app, opts) {
20117
20131
  // A turn is a paid read: it calls the LLM provider. The marker only lets a
20118
20132
  // read-only principal reach this handler; the handler decides. A viewer is
20119
20133
  // served from their own lane when the install allows it, and every other
20120
- // caller still meets `requireInstanceAdministrator`.
20121
- config: { paidRead: true }
20134
+ // caller still meets `requireInstanceAdministrator`, which no
20135
+ // project-bound key passes (`projectBoundRefusal`).
20136
+ config: { paidRead: true, projectBoundRefusal: narrowKeyRefused }
20122
20137
  }, async (request, reply) => {
20123
20138
  const viewerId = viewerAeroCaller(request, opts);
20124
20139
  if (!viewerId) requireInstanceAdministrator(request);
@@ -20185,6 +20200,7 @@ function registerAgentRoutes(app, opts) {
20185
20200
  );
20186
20201
  app.put(
20187
20202
  "/projects/:name/agent/memory",
20203
+ { config: { projectBoundRefusal: narrowKeyRefused } },
20188
20204
  async (request) => {
20189
20205
  requireInstanceAdministrator(request);
20190
20206
  const project = resolveProject(opts.db, request.params.name);
@@ -20212,6 +20228,7 @@ function registerAgentRoutes(app, opts) {
20212
20228
  );
20213
20229
  app.delete(
20214
20230
  "/projects/:name/agent/memory",
20231
+ { config: { projectBoundRefusal: narrowKeyRefused } },
20215
20232
  async (request) => {
20216
20233
  requireInstanceAdministrator(request);
20217
20234
  const project = resolveProject(opts.db, request.params.name);
@@ -20577,7 +20594,7 @@ var SnapshotService = class {
20577
20594
  if (input.providers !== void 0 || input.providerMode !== void 0) {
20578
20595
  throw validationError(`No configured snapshot providers match the selection (providerMode: ${mode})`);
20579
20596
  }
20580
- throw new Error("No providers configured. Add at least one provider API key before running canonry snapshot.");
20597
+ throw noSnapshotProvider();
20581
20598
  }
20582
20599
  const analysisProvider = pickAnalysisProvider(providers.filter((provider) => provider.adapter.mode === SnapshotProviderModes.api && canGenerateText(provider.adapter)));
20583
20600
  if (!analysisProvider && manualQueries.length === 0) {
@@ -22311,14 +22328,14 @@ async function createServer(opts) {
22311
22328
  authorizationUrl: (input) => {
22312
22329
  const auth = input.provider === GoogleMarketingProviders["google-ads"] ? getGoogleAdsAuthConfig(opts.config) : getGtmAuthConfig(opts.config);
22313
22330
  if (!auth.clientId || !auth.clientSecret) {
22314
- throw new Error("Google OAuth client credentials are not configured.");
22331
+ throw googleOAuthNotConfigured(null);
22315
22332
  }
22316
22333
  return getAuthUrl(auth.clientId, input.redirectUri, [...input.scopes], input.state);
22317
22334
  },
22318
22335
  exchangeCode: async (input) => {
22319
22336
  const auth = input.provider === GoogleMarketingProviders["google-ads"] ? getGoogleAdsAuthConfig(opts.config) : getGtmAuthConfig(opts.config);
22320
22337
  if (!auth.clientId || !auth.clientSecret) {
22321
- throw new Error("Google OAuth client credentials are not configured.");
22338
+ throw googleOAuthNotConfigured(null);
22322
22339
  }
22323
22340
  const tokens = await exchangeCode(
22324
22341
  auth.clientId,
@@ -24172,7 +24189,7 @@ async function createServer(opts) {
24172
24189
  },
24173
24190
  onCdpScreenshot: async (query, targets) => {
24174
24191
  const conn = registry.get("cdp:chatgpt");
24175
- if (!conn) throw new Error("CDP provider not configured");
24192
+ if (!conn) throw notConnectedRefusal(integrationNotConnected, `ChatGPT in Chrome is not connected. ${cdpChromeLaunchHint()}`, "cdp");
24176
24193
  const result = await conn.adapter.executeTrackedQuery(
24177
24194
  { query, canonicalDomains: [], competitorDomains: [] },
24178
24195
  conn.config
@@ -24190,7 +24207,7 @@ async function createServer(opts) {
24190
24207
  onGenerateQueries: async (providerName, count6, project) => {
24191
24208
  const provider = registry.get(providerName);
24192
24209
  if (!provider)
24193
- throw new Error(`Provider "${providerName}" is not configured`);
24210
+ throw validationError(`Provider "${providerName}" is not configured. ${PROVIDER_SETUP_STEPS}`, { reason: "provider-not-configured", provider: providerName, remediation: PROVIDER_SETUP_STEPS });
24194
24211
  if (!canGenerateText(provider.adapter))
24195
24212
  throw validationError(`${provider.adapter.displayName} cannot generate queries. Choose a provider that generates text.`);
24196
24213
  const siteText = await fetchSiteText(project.domain);
@@ -17,7 +17,7 @@ import {
17
17
  hostOf,
18
18
  isLocationRedirectStatus,
19
19
  pathWithoutQuery
20
- } from "./chunk-MYDVOMA2.js";
20
+ } from "./chunk-FGEBFVHB.js";
21
21
 
22
22
  // ../integration-traffic/src/agent-trust.ts
23
23
  var AGENT_TRUST_RULES_VERSION = 3;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  API_PROVIDER_NAMES,
3
3
  ProviderNames
4
- } from "./chunk-MYDVOMA2.js";
4
+ } from "./chunk-FGEBFVHB.js";
5
5
 
6
6
  // src/provider-registration.ts
7
7
  function isApiProviderRegistrable(name, entry) {
@@ -28,7 +28,7 @@ import {
28
28
  unknownUsageObservation,
29
29
  usdToMicros,
30
30
  withRetry
31
- } from "./chunk-MYDVOMA2.js";
31
+ } from "./chunk-FGEBFVHB.js";
32
32
 
33
33
  // ../provider-answer-services/src/core/http.ts
34
34
  var MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  USAGE_TELEMETRY_HEADERS,
3
3
  redactLogString
4
- } from "./chunk-MYDVOMA2.js";
4
+ } from "./chunk-FGEBFVHB.js";
5
5
 
6
6
  // ../api-routes/src/request-context.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createLogger
3
- } from "./chunk-6TEMKMWL.js";
3
+ } from "./chunk-VRY5M7CR.js";
4
4
  import {
5
5
  addLikelyFakeAgentHits,
6
6
  correctBackgroundCallJourneys,
7
7
  mergeSplitJourneyVisitors,
8
8
  repairAiReferralArrivalsOnStartup,
9
9
  writeUnrecognizedAgentBuckets
10
- } from "./chunk-WPYUTGW5.js";
10
+ } from "./chunk-HMCDVKHS.js";
11
11
  import {
12
12
  AGENT_TRUST_RULES_VERSION,
13
13
  BROWSER_AGENT_BOT_IDS,
@@ -31,7 +31,7 @@ import {
31
31
  normalizeTrafficPathPattern,
32
32
  rulesShareVerificationList,
33
33
  unrecognizedAgentName
34
- } from "./chunk-JZDOF24J.js";
34
+ } from "./chunk-7PTUA52C.js";
35
35
  import {
36
36
  RawEventSampleEventTypes,
37
37
  agentJourneyCaptureDays,
@@ -48,7 +48,7 @@ import {
48
48
  trafficReclassificationState,
49
49
  trafficSources,
50
50
  unrecognizedAgentEventsHourly
51
- } from "./chunk-2QHWROIF.js";
51
+ } from "./chunk-FI7HVTO6.js";
52
52
  import {
53
53
  AI_ENGINE_DOMAINS,
54
54
  AI_ENGINE_SELF_DOMAINS,
@@ -84,7 +84,7 @@ import {
84
84
  sortedUnique,
85
85
  usageCount,
86
86
  withRetry
87
- } from "./chunk-MYDVOMA2.js";
87
+ } from "./chunk-FGEBFVHB.js";
88
88
 
89
89
  // ../provider-openai/src/normalize.ts
90
90
  import OpenAI from "openai";