@michael-joseph-miller/ant-bot 0.4.0 → 0.4.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.
package/dist/server.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  SettingsSchema,
19
19
  UpdateBotRequest,
20
20
  UpdateConnectorRequest
21
- } from "./chunk-BKF7CUVN.js";
21
+ } from "./chunk-G4IIENWF.js";
22
22
  import {
23
23
  findWebDist,
24
24
  nodeLocateDeps,
@@ -2815,6 +2815,12 @@ var BUILTIN_CATALOG = {
2815
2815
  tools: gmailTools
2816
2816
  }
2817
2817
  };
2818
+ function builtinAlternativeFor(authorizationHost) {
2819
+ for (const [name, def] of Object.entries(BUILTIN_CATALOG)) {
2820
+ if (new URL(def.provider.authorizationEndpoint).host === authorizationHost && !def.provider.dynamicRegistration) return name;
2821
+ }
2822
+ return void 0;
2823
+ }
2818
2824
 
2819
2825
  // daemon/src/connectors/builtin/service.ts
2820
2826
  var BuiltinService = class {
@@ -3069,11 +3075,17 @@ function decideCheck(signals) {
3069
3075
  }
3070
3076
  if (signals.challenge === "auth") {
3071
3077
  const as = signals.discovery?.authServer;
3078
+ const host = as ? new URL(as.authorizationEndpoint).host : void 0;
3079
+ const alternative = host ? builtinAlternativeFor(host) : void 0;
3072
3080
  return {
3073
3081
  status: "needs-sign-in",
3074
3082
  selfRegistration: Boolean(as?.registrationEndpoint),
3075
- provider: as ? new URL(as.authorizationEndpoint).host : void 0,
3076
- tools: signals.probe?.tools ?? []
3083
+ provider: host,
3084
+ tools: signals.probe?.tools ?? [],
3085
+ ...alternative ? {
3086
+ alternative,
3087
+ detail: `${host} does not accept third-party MCP clients here, so a sign-in would not help. Use the built-in instead: antbot mcp add ${alternative}`
3088
+ } : {}
3077
3089
  };
3078
3090
  }
3079
3091
  if (signals.challenge === "unreachable" || signals.probe && !signals.probe.ok) {