@cloudbase/cloudbase-mcp 2.25.3 → 2.25.4

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/index.cjs CHANGED
@@ -29512,6 +29512,22 @@ function buildLoginConfigNextStep(loginMethods) {
29512
29512
  },
29513
29513
  };
29514
29514
  }
29515
+ /**
29516
+ * 短信验证码默认通道提示:开启 phone 登录后即可用云开发默认短信通道收发验证码,
29517
+ * 不需要配置短信签名/模板/自定义 Provider。仅当需要自定义模板、签名或更换短信服务商时,
29518
+ * 才需要配置 SmsVerificationConfig / 自定义短信通道。
29519
+ */
29520
+ function buildSmsHint(loginMethods) {
29521
+ if (!loginMethods.phone) {
29522
+ return undefined;
29523
+ }
29524
+ return {
29525
+ defaultChannelReady: true,
29526
+ message: "短信验证码登录已开启,可直接使用云开发默认短信通道收发验证码,无需配置短信签名/模板/自定义 Provider。" +
29527
+ "前端调用 auth.getVerification({ phone_number }) 发送验证码、auth.signInWithSms({ verificationInfo, verificationCode, phoneNum }) 登录。" +
29528
+ "仅当需要自定义短信模板/签名或更换短信服务商时,才需要配置 SmsVerificationConfig 或接入自定义短信通道。",
29529
+ };
29530
+ }
29515
29531
  function extractProviders(value) {
29516
29532
  const payload = normalizePlainObject(value, "providersResult");
29517
29533
  const providers = payload?.Providers ?? payload?.ProviderList ?? payload?.Data ?? [];
@@ -29692,12 +29708,14 @@ function registerAppAuthTools(server) {
29692
29708
  const loginMethods = buildLoginMethods(result);
29693
29709
  const nextStep = buildLoginConfigNextStep(loginMethods);
29694
29710
  const webSdkHint = buildWebSdkHint(loginMethods);
29711
+ const smsHint = buildSmsHint(loginMethods);
29695
29712
  return buildSupabaseLikeAuthResponse({
29696
29713
  success: true,
29697
29714
  envId,
29698
29715
  loginMethods,
29699
29716
  ...(nextStep ? { next_step: nextStep } : {}),
29700
29717
  ...(webSdkHint ? { webSdkHint } : {}),
29718
+ ...(smsHint ? { smsHint } : {}),
29701
29719
  });
29702
29720
  }
29703
29721
  case "listProviders": {
@@ -29773,7 +29791,7 @@ function registerAppAuthTools(server) {
29773
29791
  }));
29774
29792
  server.registerTool?.("manageAppAuth", {
29775
29793
  title: "管理 CloudBase 应用认证配置",
29776
- description: "CloudBase 应用侧认证配置写入口。用于修改登录方式、provider、client 配置,确保 publishable key,以及创建或删除 API key、自定义登录密钥。⚠️ 本工具为管理端配置工具,不执行用户登录。当任务要求编写客户端登录代码时(例如「用 JS SDK 登录」),应先通过本工具完成配置(如启用 usernamePassword、获取 publishable key),再在项目代码中编写 @cloudbase/js-sdk 客户端登录代码(如 auth.signInWithPassword()),而非使用本工具完成登录。若前端要接受普通用户名样式标识符,应先执行 action=patchLoginStrategy 并传入 patch={ usernamePassword: true },再实现对应前端登录逻辑。⚠️ action=createApiKey 返回体中的 created 字段表示是否真正新建:created=false 说明复用了环境中已存在的 key,此时 keyName/expireIn 入参不会生效,返回的 keyName/expireAt 均为服务端真实值,并会附带 warnings,切勿把它当作临时凭证分发。",
29794
+ description: "CloudBase 应用侧认证配置写入口。用于修改登录方式、provider、client 配置,确保 publishable key,以及创建或删除 API key、自定义登录密钥。⚠️ 本工具为管理端配置工具,不执行用户登录。当任务要求编写客户端登录代码时(例如「用 JS SDK 登录」),应先通过本工具完成配置(如启用 usernamePassword、获取 publishable key),再在项目代码中编写 @cloudbase/js-sdk 客户端登录代码(如 auth.signInWithPassword()),而非使用本工具完成登录。若前端要接受普通用户名样式标识符,应先执行 action=patchLoginStrategy 并传入 patch={ usernamePassword: true },再实现对应前端登录逻辑。⚠️ 短信验证码登录(patch={ phone: true })使用云开发默认短信通道,开启后即可收发验证码,不需要配置短信签名/模板/自定义 Provider;仅当需要自定义模板/签名或更换短信服务商时才需配置 SmsVerificationConfig 或自定义短信通道。⚠️ action=createApiKey 返回体中的 created 字段表示是否真正新建:created=false 说明复用了环境中已存在的 key,此时 keyName/expireIn 入参不会生效,返回的 keyName/expireAt 均为服务端真实值,并会附带 warnings,切勿把它当作临时凭证分发。",
29777
29795
  inputSchema: {
29778
29796
  action: zod_1.z.enum(MANAGE_APP_AUTH_ACTIONS),
29779
29797
  patch: zod_1.z
@@ -29839,12 +29857,14 @@ function registerAppAuthTools(server) {
29839
29857
  const loginMethods = buildLoginMethods(confirmed);
29840
29858
  const nextStep = buildLoginConfigNextStep(loginMethods);
29841
29859
  const webSdkHint = buildWebSdkHint(loginMethods);
29860
+ const smsHint = buildSmsHint(loginMethods);
29842
29861
  return buildSupabaseLikeAuthResponse({
29843
29862
  success: true,
29844
29863
  envId,
29845
29864
  loginMethods,
29846
29865
  ...(nextStep ? { next_step: nextStep } : {}),
29847
29866
  ...(webSdkHint ? { webSdkHint } : {}),
29867
+ ...(smsHint ? { smsHint } : {}),
29848
29868
  });
29849
29869
  }
29850
29870
  case "addProvider": {
@@ -91031,7 +91051,7 @@ const TRIGGER_SCHEMA = zod_1.z.object({
91031
91051
  const CREATE_FUNCTION_SCHEMA = zod_1.z.object({
91032
91052
  name: zod_1.z.string().describe("函数名称"),
91033
91053
  type: zod_1.z.enum(["Event", "HTTP"]).optional().describe("函数类型"),
91034
- protocolType: zod_1.z.enum(["HTTP", "WS"]).optional().describe("HTTP 云函数协议类型"),
91054
+ protocolType: zod_1.z.enum(["WS"]).optional().describe("HTTP 函数访问协议,当前仅支持 WebSockets,取值为 WS(配合 protocolParams.wsParams 使用)。普通 HTTP 函数不要传此字段;传其他值(如 HTTP)会报 InvalidParameterValue.ProtocolType。"),
91035
91055
  protocolParams: zod_1.z
91036
91056
  .object({
91037
91057
  wsParams: zod_1.z
@@ -138335,7 +138355,7 @@ class TelemetryReporter {
138335
138355
  const nodeVersion = process.version; // Node.js版本
138336
138356
  const arch = os_1.default.arch(); // 系统架构
138337
138357
  // 从构建时注入的版本号获取MCP版本信息
138338
- const mcpVersion = process.env.npm_package_version || "2.25.3" || 0;
138358
+ const mcpVersion = process.env.npm_package_version || "2.25.4" || 0;
138339
138359
  return {
138340
138360
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
138341
138361
  deviceId: this.deviceId,
@@ -198748,7 +198768,7 @@ ${envIdSection}
198748
198768
  ## 环境信息
198749
198769
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
198750
198770
  - Node.js版本: ${process.version}
198751
- - MCP 版本:${process.env.npm_package_version || "2.25.3" || 0}
198771
+ - MCP 版本:${process.env.npm_package_version || "2.25.4" || 0}
198752
198772
  - 系统架构: ${os_1.default.arch()}
198753
198773
  - 时间: ${new Date().toISOString()}
198754
198774
  - 请求ID: ${requestId}
@@ -198829,7 +198849,7 @@ function createWrappedHandler(name, handler, server) {
198829
198849
  requestId: (typeof error === 'object' && error && 'requestId' in error) ? error.requestId : '',
198830
198850
  ide: server.ide || process.env.INTEGRATION_IDE || ''
198831
198851
  });
198832
- const mcpVersion = true ? "2.25.3" : 0;
198852
+ const mcpVersion = true ? "2.25.4" : 0;
198833
198853
  const requestIdSuffix = requestId ? `\n🆔 RequestId: ${requestId}` : '';
198834
198854
  const enhancedErrorMessage = `${errorMessage}${requestIdSuffix}\n\n📦 CloudBase MCP v${mcpVersion}\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${issueLink}`;
198835
198855
  // 创建新的错误对象,保持原有的错误类型但更新消息
@@ -215417,7 +215437,7 @@ function registerSetupTools(server) {
215417
215437
  server.registerTool("downloadTemplate", {
215418
215438
  title: "下载项目模板",
215419
215439
  description: `自动下载并部署CloudBase项目模板。
215420
- **Note**: Call this tool when the user requests to create a new project using a CloudBase template.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.25.3" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
215440
+ **Note**: Call this tool when the user requests to create a new project using a CloudBase template.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.25.4" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
215421
215441
  inputSchema: {
215422
215442
  template: zod_1.z
215423
215443
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
@@ -232521,6 +232541,7 @@ const QUERY_GATEWAY_ACTIONS = [
232521
232541
  "listRoutes",
232522
232542
  "getRoute",
232523
232543
  "listCustomDomains",
232544
+ "getPrivilege",
232524
232545
  ];
232525
232546
  const MANAGE_GATEWAY_ACTIONS = [
232526
232547
  "createRoute",
@@ -232528,6 +232549,8 @@ const MANAGE_GATEWAY_ACTIONS = [
232528
232549
  "deleteRoute",
232529
232550
  "bindCustomDomain",
232530
232551
  "deleteCustomDomain",
232552
+ "enableService",
232553
+ "authSwitch",
232531
232554
  ];
232532
232555
  /** DomainType of the environment default HTTP service (gateway) domain. */
232533
232556
  const HTTP_SERVICE_DOMAIN_TYPE = "HTTPSERVICE";
@@ -232624,6 +232647,28 @@ function registerGatewayTools(server) {
232624
232647
  candidates.find((item) => item.Enable !== false) ??
232625
232648
  candidates[0]);
232626
232649
  };
232650
+ const getGatewayPrivilege = async () => {
232651
+ const cloudbase = await getManager();
232652
+ const result = await cloudbase
232653
+ .commonService("tcb", "2018-06-08")
232654
+ .call({
232655
+ Action: "DescribeCloudBaseGWPrivilege",
232656
+ Param: {
232657
+ ServiceId: await resolveEnvId(),
232658
+ },
232659
+ });
232660
+ (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
232661
+ return result ?? {};
232662
+ };
232663
+ const buildPrivilegeDescription = (privilege) => {
232664
+ const serviceStatus = privilege.EnableService === true ? "已开启" : "未开启";
232665
+ const authStatus = privilege.EnableAuth === undefined
232666
+ ? "未知"
232667
+ : privilege.EnableAuth === true
232668
+ ? "已开启"
232669
+ : "未开启";
232670
+ return `HTTP 网关${serviceStatus},访问鉴权${authStatus}`;
232671
+ };
232627
232672
  const resolveDefaultHttpDomain = async () => {
232628
232673
  // Match console DescribeHTTPServiceRoute usage: filter DomainType=HTTPSERVICE.
232629
232674
  // Envs often also expose an IsDefault STATIC_STORE domain (*.tcloudbaseapp.com);
@@ -232796,6 +232841,28 @@ function registerGatewayTools(server) {
232796
232841
  },
232797
232842
  ]);
232798
232843
  }
232844
+ case "getPrivilege": {
232845
+ const privilege = await getGatewayPrivilege();
232846
+ const enableService = privilege.EnableService === true;
232847
+ const enableAuth = privilege.EnableAuth === true;
232848
+ return buildEnvelope({
232849
+ action: input.action,
232850
+ enableService,
232851
+ enableAuth,
232852
+ raw: privilege,
232853
+ }, buildPrivilegeDescription(privilege) +
232854
+ (enableService
232855
+ ? ""
232856
+ : ";若路由创建成功但访问报 HTTPSERVICE_NONACTIVATED(403),请先开启 HTTP 网关"), enableService
232857
+ ? undefined
232858
+ : [
232859
+ {
232860
+ tool: "manageGateway",
232861
+ action: "enableService",
232862
+ reason: "开启 HTTP 网关总开关(EnableService),开启后路由即可通过默认域访问",
232863
+ },
232864
+ ]);
232865
+ }
232799
232866
  default:
232800
232867
  throw new Error(`不支持的操作类型: ${input.action}`);
232801
232868
  }
@@ -232826,6 +232893,28 @@ function registerGatewayTools(server) {
232826
232893
  throw err;
232827
232894
  }
232828
232895
  (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
232896
+ // 探测 HTTP 网关总开关:未开启时提示 HTTPSERVICE_NONACTIVATED 风险并引导开启。
232897
+ // 探测失败不阻断路由创建结果,仅追加弱提示。
232898
+ let privilegeHint = "";
232899
+ let privilegeNextActions = [];
232900
+ try {
232901
+ const privilege = await getGatewayPrivilege();
232902
+ if (privilege.EnableService !== true) {
232903
+ privilegeHint =
232904
+ "⚠️ HTTP 网关总开关未开启,路由创建成功后访问仍将返回 HTTPSERVICE_NONACTIVATED(403);请先调用 manageGateway(action=\"enableService\", enable=true) 开启,再等待 30 秒到 3 分钟访问。";
232905
+ privilegeNextActions = [
232906
+ {
232907
+ tool: "manageGateway",
232908
+ action: "enableService",
232909
+ reason: "开启 HTTP 网关总开关(EnableService),否则访问路由会报 HTTPSERVICE_NONACTIVATED(403)",
232910
+ },
232911
+ ];
232912
+ }
232913
+ }
232914
+ catch {
232915
+ privilegeHint =
232916
+ "(无法确认 HTTP 网关开关状态;若访问报 HTTPSERVICE_NONACTIVATED,请用 queryGateway(action=\"getPrivilege\") 查询后用 manageGateway(action=\"enableService\") 开启)";
232917
+ }
232829
232918
  return buildEnvelope({
232830
232919
  action: input.action,
232831
232920
  model: "httpServiceRoute",
@@ -232848,7 +232937,12 @@ function registerGatewayTools(server) {
232848
232937
  : payload.resolved.enablePathTransmission === false
232849
232938
  ? ";路径透传关闭(网关会剥掉触发路径前缀后再转发给后端)"
232850
232939
  : ";路径透传未显式设置(平台默认 false,会剥掉触发路径前缀)") +
232851
- `。注意:路由配置传播通常需要等待 30 秒到 3 分钟,请勿立即访问。该操作只创建网关入口,不会自动放开上游权限;若上游是云函数且需要匿名或浏览器直接访问,请继续检查函数资源权限。`, routeMutationNextActions(payload.resolved.upstreamResourceName));
232940
+ `。注意:路由配置传播通常需要等待 30 秒到 3 分钟,请勿立即访问。该操作只创建网关入口,不会自动放开上游权限;若上游是云函数且需要匿名或浏览器直接访问,请继续检查函数资源权限。` +
232941
+ (privilegeHint ? ` ${privilegeHint}` : ""), [
232942
+ ...privilegeNextActions,
232943
+ ...(routeMutationNextActions(payload.resolved.upstreamResourceName) ??
232944
+ []),
232945
+ ]);
232852
232946
  }
232853
232947
  case "updateRoute": {
232854
232948
  const cloudbase = await getManager();
@@ -232939,6 +233033,60 @@ function registerGatewayTools(server) {
232939
233033
  raw: result,
232940
233034
  }, "自定义域名删除成功");
232941
233035
  }
233036
+ case "enableService": {
233037
+ if (typeof input.enable !== "boolean") {
233038
+ throw new Error('action=enableService 时必须提供 enable 参数(boolean),如 enable=true 开启 HTTP 网关总开关、enable=false 关闭;禁止省略或传非布尔值。');
233039
+ }
233040
+ const cloudbase = await getManager();
233041
+ const result = await cloudbase.access.switchAuth(input.enable);
233042
+ (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
233043
+ const serviceText = input.enable ? "开启" : "关闭";
233044
+ return buildEnvelope({
233045
+ action: input.action,
233046
+ enable: input.enable,
233047
+ raw: result,
233048
+ }, `HTTP 网关总开关${serviceText}成功`, [
233049
+ {
233050
+ tool: "queryGateway",
233051
+ action: "getPrivilege",
233052
+ reason: "复核 HTTP 网关总开关与访问鉴权状态",
233053
+ },
233054
+ ]);
233055
+ }
233056
+ case "authSwitch": {
233057
+ if (typeof input.enable !== "boolean") {
233058
+ throw new Error('action=authSwitch 时必须提供 enable 参数(boolean),如 enable=true 开启访问鉴权、enable=false 关闭;禁止省略或传非布尔值。');
233059
+ }
233060
+ const cloudbase = await getManager();
233061
+ const result = await cloudbase
233062
+ .commonService("tcb", "2018-06-08")
233063
+ .call({
233064
+ Action: "ModifyCloudBaseGWPrivilege",
233065
+ Param: {
233066
+ ServiceId: await resolveEnvId(),
233067
+ EnableService: input.enable,
233068
+ Options: [
233069
+ {
233070
+ Key: "authswitch",
233071
+ Value: input.enable ? "true" : "false",
233072
+ },
233073
+ ],
233074
+ },
233075
+ });
233076
+ (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
233077
+ const serviceText = input.enable ? "开启" : "关闭";
233078
+ return buildEnvelope({
233079
+ action: input.action,
233080
+ enable: input.enable,
233081
+ raw: result,
233082
+ }, `HTTP 访问服务鉴权${serviceText}成功`, [
233083
+ {
233084
+ tool: "queryGateway",
233085
+ action: "getPrivilege",
233086
+ reason: "复核 HTTP 网关总开关与访问鉴权状态",
233087
+ },
233088
+ ]);
233089
+ }
232942
233090
  default:
232943
233091
  throw new Error(`不支持的操作类型: ${input.action}`);
232944
233092
  }
@@ -232947,12 +233095,14 @@ function registerGatewayTools(server) {
232947
233095
  title: "查询 CloudBase 网关",
232948
233096
  description: "CloudBase HTTP 网关统一只读入口(Domain/Route)。查询域名下路径路由及其上游:" +
232949
233097
  "WEB_SCF/SCF=云函数,CBR=云托管,STATIC_STORE=静态托管,LH=轻量应用服务器。" +
232950
- "主键为 Domain + Path;listRoutes / getRoute / listCustomDomains。" +
233098
+ "主键为 Domain + Path;listRoutes / getRoute / listCustomDomains / getPrivilege。" +
233099
+ "getPrivilege 查询 HTTP 网关总开关(enableService)与访问鉴权(enableAuth)状态。" +
232951
233100
  "实现自定义域名访问前,先 listCustomDomains:若已有自定义域名,优先 createRoute 挂路由(无需证书 ID);仅在没有可用自定义域名时才 bindCustomDomain。",
232952
233101
  inputSchema: {
232953
233102
  action: zod_1.z
232954
233103
  .enum(QUERY_GATEWAY_ACTIONS)
232955
- .describe("只读操作类型:listRoutes、getRoute、listCustomDomains。" +
233104
+ .describe("只读操作类型:listRoutes、getRoute、listCustomDomains、getPrivilege。" +
233105
+ "getPrivilege 无需其他参数,直接返回 HTTP 网关总开关与访问鉴权状态。" +
232956
233106
  "自定义域名访问场景先 listCustomDomains 确认是否已有域名可复用。"),
232957
233107
  targetName: zod_1.z
232958
233108
  .string()
@@ -232985,11 +233135,13 @@ function registerGatewayTools(server) {
232985
233135
  "createRoute 只建网关入口,不改上游权限。" +
232986
233136
  "enablePathTransmission:默认 false 剥触发路径前缀;true 透传完整路径(CBR 多路由、WEB_SCF 自管子路径常需 true;STATIC_STORE 自定义触发路径映射站点根通常 false)。" +
232987
233137
  "⚠️ 自定义域名访问:若环境已有自定义域名(先 queryGateway listCustomDomains),优先 createRoute 并显式传入该 domain,无需 certificateId;" +
232988
- "仅首次绑定全新自定义域名时用 bindCustomDomain(需 certificateId)。CORS/安全域名用 envDomainManagement。",
233138
+ "仅首次绑定全新自定义域名时用 bindCustomDomain(需 certificateId)。CORS/安全域名用 envDomainManagement。" +
233139
+ "enableService/authSwitch:HTTP 网关总开关与访问鉴权开关;createRoute 后若访问报 HTTPSERVICE_NONACTIVATED,通常是总开关未开启(用 queryGateway getPrivilege 查询、enableService 开启)。",
232989
233140
  inputSchema: {
232990
233141
  action: zod_1.z
232991
233142
  .enum(MANAGE_GATEWAY_ACTIONS)
232992
- .describe("写操作:createRoute/updateRoute/deleteRoute 管理路由;bindCustomDomain/deleteCustomDomain 管理自定义域名。" +
233143
+ .describe("写操作:createRoute/updateRoute/deleteRoute 管理路由;bindCustomDomain/deleteCustomDomain 管理自定义域名;" +
233144
+ "enableService/authSwitch 开关 HTTP 网关总开关与访问鉴权(需配合 enable 参数)。" +
232993
233145
  "createRoute/updateRoute 必须提供 upstreamResourceType。" +
232994
233146
  "已有自定义域名时优先 createRoute(domain=已有域名) 实现访问,不必再次 bindCustomDomain / 传入 certificateId;" +
232995
233147
  "bindCustomDomain 仅用于首次绑定新域名。"),
@@ -233055,6 +233207,11 @@ function registerGatewayTools(server) {
233055
233207
  .optional()
233056
233208
  .describe("证书 ID。仅首次 bindCustomDomain 必填。" +
233057
233209
  "在已有自定义域名上 createRoute / updateRoute / deleteRoute 不需要 certificateId。"),
233210
+ enable: zod_1.z
233211
+ .boolean()
233212
+ .optional()
233213
+ .describe("开关目标状态(仅 enableService / authSwitch 使用,必填):" +
233214
+ "enable=true 开启,enable=false 关闭。省略或非布尔值会返回参数错误。"),
233058
233215
  },
233059
233216
  annotations: {
233060
233217
  readOnlyHint: false,