@cloudbase/cloudbase-mcp 2.34.5 → 2.34.6

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
@@ -204343,8 +204343,8 @@ const types_js_1 = __webpack_require__(89921);
204343
204343
  exports.functions = (0, types_js_1.defineModule)({
204344
204344
  // ---- 工具 meta ----
204345
204345
  queryTitle: "查询 CloudBase 云函数",
204346
- queryDescription: "CloudBase 云函数统一只读入口。通过更自解释的 action 查询 CloudBase 云函数列表、函数详情、执行日志、层、触发器和代码下载地址。" +
204347
- "\n\n**分页说明**:`listFunctions`、`listLayers` 支持 `limit` 和 `offset` 参数。" +
204346
+ queryDescription: "CloudBase 云函数统一只读入口。通过更自解释的 action 查询 CloudBase 云函数列表、函数详情、执行日志、层、触发器、代码下载地址、已发布版本与流量别名。" +
204347
+ "\n\n**分页说明**:`listFunctions`、`listLayers`、`listVersionByFunction` 支持 `limit` 和 `offset` 参数。" +
204348
204348
  "\n- `limit`: 分页数量,默认值由后端决定" +
204349
204349
  "\n- `offset`: 分页偏移,从 0 开始" +
204350
204350
  "\n- 示例:`queryFunctions(action=\"listFunctions\", offset=10, limit=10)`" +
@@ -204352,6 +204352,7 @@ exports.functions = (0, types_js_1.defineModule)({
204352
204352
  "\n- 示例:`queryFunctions(action=\"listFunctionLogs\", functionName=\"my-function\")`" +
204353
204353
  "\n- 如需查看日志详情:`queryFunctions(action=\"getFunctionLogDetail\", requestId=\"xxx\")`" +
204354
204354
  "\n\n**定时任务 / cron / 定时跑**:使用 `listFunctionTriggers` 查询函数的 timer 触发器配置。" +
204355
+ "\n\n**版本与流量路由**:`listVersionByFunction` 列出已发布版本(对齐 tcb fn list-function-versions);`getFunctionAlias` 查看别名/灰度配置(对齐 tcb fn get-route,aliasName 默认 `$DEFAULT`)。" +
204355
204356
  "\n\n**层(Layer)说明**:" +
204356
204357
  "\n- 层为 SCF 账号级共享命名空间:不同环境创建同名层会共享同一层的版本序列;删除某版本会影响所有绑定该版本的环境的函数" +
204357
204358
  "\n- 创建层必须用带环境标识的唯一层名,固定格式:`{layerName}_{当前envId}`(如 `common_cloud1-d9ghadgak3edf6b36`)。不要在不同环境使用相同裸层名,创建前先 `listLayers` 查重" +
@@ -204360,8 +204361,9 @@ exports.functions = (0, types_js_1.defineModule)({
204360
204361
  "\n- 本工具用于查询特定 CloudBase 云函数的执行日志" +
204361
204362
  "\n- `queryLogs` 工具用于搜索 CLS 日志服务(跨服务日志聚合)",
204362
204363
  manageTitle: "管理 CloudBase 云函数",
204363
- manageDescription: "CloudBase 云函数统一写入口。支持创建函数、更新代码、更新配置、调用函数、管理定时跑 / 定时任务 / scheduled job 的 timer 触发器和层绑定。" +
204364
+ manageDescription: "CloudBase 云函数统一写入口。支持创建函数、更新代码、更新配置、调用函数、发布版本、配置流量别名、管理定时跑 / 定时任务 / scheduled job 的 timer 触发器和层绑定。" +
204364
204365
  "如果要创建 cron 定时任务,先用 createFunction 创建函数,再用 createFunctionTrigger 创建 timer 触发器(支持7段cron表达式),deleteFunctionTrigger 删除触发器。" +
204366
+ "版本发布:`publishVersion` 对齐 tcb fn publish-version / SDK publishVersion;灰度/切流:`updateFunctionAliasConfig` 对齐 tcb fn config-route / SDK updateFunctionAliasConfig(aliasName 默认 `$DEFAULT`)。" +
204365
204367
  "HTTP 云函数镜像构建部署:createFunction / updateFunctionCode 通过 func.buildStrategy 区分。" +
204366
204368
  "func.buildStrategy=image(已有镜像,填 func.imageConfig.imageUri)直接创建/更新 HTTP 函数;" +
204367
204369
  "func.buildStrategy=local(本地 Docker 构建推送)、cloud(CloudApp 云端构建)走镜像构建部署编排(需要 func.imageConfig;build 非必填,缺省仓库坐标自动补齐:namespace 默认 envId、repository 默认函数名)," +
@@ -204464,6 +204466,12 @@ exports.functions = (0, types_js_1.defineModule)({
204464
204466
  "reason.imageNextIteration": "后续迭代只需用新镜像 tag 调用 updateFunctionCode 更新镜像",
204465
204467
  "reason.imageGatewayRoute": "如需通过 URL 访问镜像 HTTP 函数,显式创建 Domain/Route 访问入口并传 type=\"HTTP\"(映射 WEB_SCF)",
204466
204468
  "reason.latestConfig": "确认最新函数配置",
204469
+ "reason.publishVersion": "发布函数新版本(对齐 tcb fn publish-version)",
204470
+ "reason.getFunctionAlias": "查看函数流量别名配置(对齐 tcb fn get-route)",
204471
+ "reason.updateFunctionAlias": "更新函数流量别名/灰度路由(对齐 tcb fn config-route)",
204472
+ "reason.listVersions": "查看函数已发布版本列表(对齐 tcb fn list-function-versions)",
204473
+ "reason.routeTraffic": "将流量切到新版本或配置灰度权重",
204474
+ "reason.confirmAlias": "确认别名与流量配置已生效",
204467
204475
  // ---- 成功 message ----
204468
204476
  listedFunctions: "已获取 {count} 个云函数",
204469
204477
  gotFunctionDetail: "已获取函数 {fnName} 的详情",
@@ -204475,6 +204483,10 @@ exports.functions = (0, types_js_1.defineModule)({
204475
204483
  gotLayerVersionDetail: "已获取层 {layerName} 版本 {layerVersion} 的详情",
204476
204484
  gotFunctionTriggers: "已获取函数 {fnName} 的触发器列表",
204477
204485
  gotDownloadUrl: "已获取函数 {fnName} 的代码下载链接",
204486
+ gotFunctionVersions: "已获取函数 {fnName} 的版本列表",
204487
+ gotFunctionAlias: "已获取函数 {fnName} 的别名 {aliasName}",
204488
+ publishedVersion: "已发布函数 {fnName} 的新版本 {version}",
204489
+ updatedFunctionAlias: "已更新函数 {fnName} 别名 {aliasName}(主版本 {version})",
204478
204490
  createdHttpFunctionMessage: "已创建 HTTP 函数 {fnName}。如果后续需要通过 URL 访问,请显式调用 manageGateway(action=\"createRoute\"),并把 upstreamResourceType=\"WEB_SCF\" 一起传入,再按实际路径和鉴权需求创建访问入口。评测或其他外部调用方可能会以匿名身份访问,而且失败后不一定会把 EXCEED_AUTHORITY 再反馈给 AI;交付前请主动确认访问路径和函数安全规则,若已出现 EXCEED_AUTHORITY,请先调用 queryPermissions(action=\"getResourcePermission\", resourceType=\"function\", resourceId=\"{fnName}\") 查看当前规则,再按需要使用 managePermissions(action=\"updateResourcePermission\") 调整权限。",
204479
204491
  createdFunction: "已创建函数 {fnName}",
204480
204492
  imageCreatedMessage: "已基于镜像 {imageUri} 创建 HTTP 函数 {fnName}。请确认 TCR、SCF 与构建管道处于同一地域;如需通过 URL 访问,请显式调用 manageGateway(action=\"createRoute\", upstreamResourceType=\"WEB_SCF\") 并按需调整函数安全规则。部署后可用 queryFunctions(action=\"getFunctionDetail\") 确认函数已就绪。",
@@ -204542,8 +204554,8 @@ exports.functions = (0, types_js_1.defineModule)({
204542
204554
  "schema.create.layers": "Layer 配置",
204543
204555
  "schema.manageLayer.name": "层名称",
204544
204556
  "schema.manageLayer.version": "层版本号",
204545
- "schema.query.action": "只读操作类型:\n- `listFunctions`: 列出所有 CloudBase 云函数\n- `getFunctionDetail`: 获取 CloudBase 云函数详情(需要 functionName)\n- `listFunctionLogs`: 查询 CloudBase 云函数执行日志(需要 functionName)\n- `getFunctionLogDetail`: 获取日志详情(需要 requestId)\n- `listFunctionLayers`: 列出函数绑定的层\n- `listLayers`: 列出所有层(账号级视图,含其他环境创建的层)\n- `listLayerVersions`: 列出层的版本(注意:是 Versions 不是 Version;账号级视图)\n- `getLayerVersionDetail`: 获取层版本详情(账号级视图)\n- `listFunctionTriggers`: 列出函数触发器(用于查看定时任务 / cron / timer 配置)\n- `getFunctionDownloadUrl`: 获取函数代码下载地址\n- `getFunctionDeployStatus`: 按 taskId 查询异步部署状态、阶段进度和最终结果。返回 data.build(构建子状态)、data.deploy(部署子状态)、data.progress(阶段事件);status=running 时 data.result 与 data.error 一律为 null,不得报告部署完成。调用方必须持续轮询直到 status=succeeded/failed;status=expired 表示任务超过最长保留时间(2 小时)被终结,云端可能仍在部署,需用 getFunctionDetail 确认。任务只保存在 MCP 进程内存中,过期或 MCP Server 重启后返回 errorCode=DEPLOY_TASK_NOT_FOUND;任务按环境隔离,只能查到当前环境自己发起的部署。cloud mode 下本 action 不可用:异步任务只由 buildStrategy=cloud/local 的真实部署创建,而这两种策略在 cloud mode 下都不支持真实执行,image 策略则走同步部署不产生 taskId。",
204546
- "schema.query.functionName": "CloudBase 云函数名称。`getFunctionDetail`、`listFunctionLogs`、`listFunctionLayers`、`listFunctionTriggers`、`getFunctionDownloadUrl` 时必填",
204557
+ "schema.query.action": "只读操作类型:\n- `listFunctions`: 列出所有 CloudBase 云函数\n- `getFunctionDetail`: 获取 CloudBase 云函数详情(需要 functionName)\n- `listFunctionLogs`: 查询 CloudBase 云函数执行日志(需要 functionName)\n- `getFunctionLogDetail`: 获取日志详情(需要 requestId)\n- `listFunctionLayers`: 列出函数绑定的层\n- `listLayers`: 列出所有层(账号级视图,含其他环境创建的层)\n- `listLayerVersions`: 列出层的版本(注意:是 Versions 不是 Version;账号级视图)\n- `getLayerVersionDetail`: 获取层版本详情(账号级视图)\n- `listFunctionTriggers`: 列出函数触发器(用于查看定时任务 / cron / timer 配置)\n- `getFunctionDownloadUrl`: 获取函数代码下载地址\n- `getFunctionDeployStatus`: 按 taskId 查询异步部署状态、阶段进度和最终结果。返回 data.build(构建子状态)、data.deploy(部署子状态)、data.progress(阶段事件);status=running 时 data.result 与 data.error 一律为 null,不得报告部署完成。调用方必须持续轮询直到 status=succeeded/failed;status=expired 表示任务超过最长保留时间(2 小时)被终结,云端可能仍在部署,需用 getFunctionDetail 确认。任务只保存在 MCP 进程内存中,过期或 MCP Server 重启后返回 errorCode=DEPLOY_TASK_NOT_FOUND;任务按环境隔离,只能查到当前环境自己发起的部署。cloud mode 下本 action 不可用:异步任务只由 buildStrategy=cloud/local 的真实部署创建,而这两种策略在 cloud mode 下都不支持真实执行,image 策略则走同步部署不产生 taskId。\n- `listVersionByFunction`: 列出函数已发布版本(对齐 tcb fn list-function-versions / SDK listVersionByFunction;需要 functionName)\n- `getFunctionAlias`: 查询函数别名与流量路由(对齐 tcb fn get-route / SDK getFunctionAlias;需要 functionName;aliasName 默认 $DEFAULT)",
204558
+ "schema.query.functionName": "CloudBase 云函数名称。`getFunctionDetail`、`listFunctionLogs`、`listFunctionLayers`、`listFunctionTriggers`、`getFunctionDownloadUrl`、`listVersionByFunction`、`getFunctionAlias` 时必填",
204547
204559
  "schema.query.limit": "分页数量(limit)。列表类 action 可选,默认值由后端决定",
204548
204560
  "schema.query.offset": "分页偏移(offset)。列表类 action 可选,默认 0",
204549
204561
  "schema.query.codeSecret": "代码保护密钥,用于解密函数代码",
@@ -204557,11 +204569,14 @@ exports.functions = (0, types_js_1.defineModule)({
204557
204569
  "schema.query.layerName": "层名称。`listLayerVersions`、`getLayerVersionDetail` 操作必填。层为账号级共享命名空间;推荐固定格式 `{layerName}_{当前envId}`(如 common_cloud1-d9ghadgak3edf6b36)",
204558
204570
  "schema.query.layerVersion": "层版本号。`getLayerVersionDetail` 操作必填",
204559
204571
  "schema.query.taskId": "`getFunctionDeployStatus` 操作时的异步部署任务 ID(由 manageFunctions 的 wait=false 返回)。任务仅保存在当前 MCP 进程内存中:终态任务保留约 30 分钟,运行中任务最长保留 2 小时。",
204560
- "schema.manage.action": "写操作类型,例如 createFunction、updateFunctionCode、incrementalDeployFunction、invokeFunction、deleteFunction、createFunctionTrigger(定时任务 / cron / timer)、deleteFunctionTrigger、createLayerVersion、deleteLayerVersion、attachLayer、detachLayer、updateFunctionLayers。层名推荐固定格式 `{layerName}_{当前envId}`(如 common_cloud1-d9ghadgak3edf6b36)",
204572
+ "schema.query.order": "`listVersionByFunction` 排序方向,如 ASC / DESC",
204573
+ "schema.query.orderBy": "`listVersionByFunction` 排序字段,如 AddTime / ModTime",
204574
+ "schema.query.aliasName": "`getFunctionAlias` 的别名名称。省略时默认 `$DEFAULT`(与 tcb fn get-route 一致)",
204575
+ "schema.manage.action": "写操作类型,例如 createFunction、updateFunctionCode、incrementalDeployFunction、invokeFunction、deleteFunction、createFunctionTrigger(定时任务 / cron / timer)、deleteFunctionTrigger、createLayerVersion、deleteLayerVersion、attachLayer、detachLayer、updateFunctionLayers、publishVersion(发布新版本,对齐 tcb fn publish-version)、updateFunctionAliasConfig(更新别名/流量路由,对齐 tcb fn config-route)。层名推荐固定格式 `{layerName}_{当前envId}`(如 common_cloud1-d9ghadgak3edf6b36)",
204561
204576
  "schema.manage.func": "createFunction / updateFunctionCode 的函数配置。镜像/构建部署通过 func.buildStrategy(zip/cloud/local/image)区分,镜像相关字段收敛在 func.imageConfig 命名空间下。",
204562
204577
  "schema.manage.functionRootPath": "创建或更新函数代码时默认推荐的本地目录方式。必须是直接包含函数文件夹的目录绝对路径(如 /abs/path/cloudfunctions 或 /abs/path/functions),不要传项目根目录(如 /abs/path),也不要传到函数名子目录(如 /abs/path/cloudfunctions/hello)。本地应按 cloudfunctions/<functionName>/index.js 或 functions/<functionName>/index.js 布局,此参数传 cloudfunctions 或 functions 目录的绝对路径。SDK 会自动拼接函数名子目录,无需预先压缩 zip 或 base64 编码。",
204563
204578
  "schema.manage.force": "createFunction 时是否覆盖",
204564
- "schema.manage.functionName": "目标函数名称(顶层)。updateFunctionCode / updateFunctionConfig / invokeFunction 等 action 使用此字段。不要只写在 func.name:createFunction 用 func.name,其它 action 用顶层 functionName。若误传 func.name,也会被识别为 functionName。",
204579
+ "schema.manage.functionName": "目标函数名称(顶层)。updateFunctionCode / updateFunctionConfig / invokeFunction / publishVersion / updateFunctionAliasConfig 等 action 使用此字段。不要只写在 func.name:createFunction 用 func.name,其它 action 用顶层 functionName。若误传 func.name,也会被识别为 functionName。",
204565
204580
  "schema.manage.zipFile": "仅兼容特殊场景:预先准备好的代码包 base64 编码。普通 createFunction/updateFunctionCode 默认不要先压缩 zip,优先使用 functionRootPath。",
204566
204581
  "schema.manage.handler": "函数入口",
204567
204582
  "schema.manage.timeout": "配置更新时的超时时间",
@@ -204575,7 +204590,7 @@ exports.functions = (0, types_js_1.defineModule)({
204575
204590
  "schema.manage.contentPath": "层内容路径,可为目录或 ZIP 文件",
204576
204591
  "schema.manage.base64Content": "层内容的 base64 编码",
204577
204592
  "schema.manage.runtimes": "层适用的运行时列表",
204578
- "schema.manage.description": "层版本描述",
204593
+ "schema.manage.description": "描述信息。createLayerVersion 时为层版本描述;publishVersion / updateFunctionAliasConfig 时为版本或别名描述",
204579
204594
  "schema.manage.licenseInfo": "层许可证信息",
204580
204595
  "schema.manage.layers": "updateFunctionLayers 的目标层列表,顺序即最终顺序",
204581
204596
  "schema.manage.codeSecret": "层绑定时的代码保护密钥",
@@ -204584,11 +204599,22 @@ exports.functions = (0, types_js_1.defineModule)({
204584
204599
  "schema.manage.autoGrant": "镜像部署是否允许 manager-node 自动补齐固定白名单 CAM 策略。默认 false;仅在明确确认权限变更时设为 true。",
204585
204600
  "schema.manage.confirm": "危险操作确认开关。deleteFunction、deleteFunctionTrigger、deleteLayerVersion、detachLayer 等删除类操作以及镜像构建部署(func.buildStrategy=cloud/local)真实执行需要显式传入 confirm=true",
204586
204601
  "schema.manage.incrementalFile": "incrementalDeployFunction 增量部署时的变更文件路径",
204602
+ "schema.manage.aliasName": "`updateFunctionAliasConfig` 的别名名称。省略时默认 `$DEFAULT`(与 tcb fn config-route 一致)",
204603
+ "schema.manage.functionVersion": "`updateFunctionAliasConfig` 的主版本。可为具体版本号或 `$LATEST`",
204604
+ "schema.manage.routingConfig": "`updateFunctionAliasConfig` 的流量路由配置。AdditionalVersionWeights 用于灰度权重;AddtionVersionMatchs 为 SCF/SDK 历史字段名(含拼写)",
204605
+ "schema.routing.version": "附加流量版本号",
204606
+ "schema.routing.weight": "附加流量权重(0-1 或百分比,按 SCF 约定)",
204607
+ "schema.routing.matchVersion": "匹配规则指向的版本号",
204608
+ "schema.routing.matchKey": "匹配规则的 Header/Query Key",
204609
+ "schema.routing.matchMethod": "匹配方法,如 Exact / Regex",
204610
+ "schema.routing.matchExpression": "匹配表达式",
204611
+ "schema.routing.additionalWeights": "附加版本权重列表(灰度发布)",
204612
+ "schema.routing.additionalMatches": "附加版本匹配规则列表(字段名保持 SCF AddtionVersionMatchs)",
204587
204613
  }, {
204588
204614
  // ---- Tool meta ----
204589
204615
  queryTitle: "Query CloudBase Cloud Functions",
204590
- queryDescription: "Unified read-only entry for CloudBase cloud functions. Query function lists, function details, execution logs, layers, triggers, and code download URLs through self-explanatory actions." +
204591
- "\n\n**Pagination**: `listFunctions` and `listLayers` support `limit` and `offset` parameters." +
204616
+ queryDescription: "Unified read-only entry for CloudBase cloud functions. Query function lists, function details, execution logs, layers, triggers, code download URLs, published versions, and traffic aliases through self-explanatory actions." +
204617
+ "\n\n**Pagination**: `listFunctions`, `listLayers`, and `listVersionByFunction` support `limit` and `offset` parameters." +
204592
204618
  "\n- `limit`: page size, the default is decided by the backend" +
204593
204619
  "\n- `offset`: pagination offset, starting from 0" +
204594
204620
  "\n- Example: `queryFunctions(action=\"listFunctions\", offset=10, limit=10)`" +
@@ -204596,6 +204622,7 @@ exports.functions = (0, types_js_1.defineModule)({
204596
204622
  "\n- Example: `queryFunctions(action=\"listFunctionLogs\", functionName=\"my-function\")`" +
204597
204623
  "\n- To view log details: `queryFunctions(action=\"getFunctionLogDetail\", requestId=\"xxx\")`" +
204598
204624
  "\n\n**Scheduled tasks / cron / timers**: use `listFunctionTriggers` to query a function's timer trigger configuration." +
204625
+ "\n\n**Versions and traffic routing**: `listVersionByFunction` lists published versions (aligns with tcb fn list-function-versions); `getFunctionAlias` views alias / canary config (aligns with tcb fn get-route; aliasName defaults to `$DEFAULT`)." +
204599
204626
  "\n\n**Layers**:" +
204600
204627
  "\n- Layers are account-level shared namespaces in SCF: same-named layers created in different environments share one version sequence; deleting a version affects functions in every environment bound to it" +
204601
204628
  "\n- When creating a layer, use a unique name with the environment suffix, in the fixed format `{layerName}_{current envId}` (e.g. `common_cloud1-d9ghadgak3edf6b36`). Do not reuse the same bare layer name across environments; check with `listLayers` before creating" +
@@ -204604,8 +204631,9 @@ exports.functions = (0, types_js_1.defineModule)({
204604
204631
  "\n- This tool queries execution logs of a specific CloudBase cloud function" +
204605
204632
  "\n- The `queryLogs` tool searches the CLS log service (cross-service log aggregation)",
204606
204633
  manageTitle: "Manage CloudBase Cloud Functions",
204607
- manageDescription: "Unified write entry for CloudBase cloud functions. Supports creating functions, updating code, updating configuration, invoking functions, and managing timer triggers (scheduled jobs / cron) and layer bindings." +
204634
+ manageDescription: "Unified write entry for CloudBase cloud functions. Supports creating functions, updating code, updating configuration, invoking functions, publishing versions, configuring traffic aliases, and managing timer triggers (scheduled jobs / cron) and layer bindings." +
204608
204635
  " To create a cron scheduled task, first create the function with createFunction, then create the timer trigger with createFunctionTrigger (7-field cron expression supported), and delete triggers with deleteFunctionTrigger." +
204636
+ " Version publish: `publishVersion` aligns with tcb fn publish-version / SDK publishVersion; canary / traffic shift: `updateFunctionAliasConfig` aligns with tcb fn config-route / SDK updateFunctionAliasConfig (aliasName defaults to `$DEFAULT`)." +
204609
204637
  " HTTP function image build & deploy: createFunction / updateFunctionCode distinguish via func.buildStrategy." +
204610
204638
  " func.buildStrategy=image (existing image, set func.imageConfig.imageUri) creates/updates the HTTP function directly;" +
204611
204639
  " func.buildStrategy=local (local Docker build & push) and cloud (CloudApp cloud build) go through the image build/deploy orchestration (func.imageConfig required; build optional — missing registry coordinates are auto-filled: namespace defaults to envId, repository defaults to the function name)," +
@@ -204708,6 +204736,12 @@ exports.functions = (0, types_js_1.defineModule)({
204708
204736
  "reason.imageNextIteration": "For later iterations, just call updateFunctionCode with the new image tag to update the image",
204709
204737
  "reason.imageGatewayRoute": "To access the image HTTP function via URL, explicitly create a Domain/Route access entry and pass type=\"HTTP\" (mapped to WEB_SCF)",
204710
204738
  "reason.latestConfig": "Confirm the latest function configuration",
204739
+ "reason.publishVersion": "Publish a new function version (aligns with tcb fn publish-version)",
204740
+ "reason.getFunctionAlias": "View function traffic alias config (aligns with tcb fn get-route)",
204741
+ "reason.updateFunctionAlias": "Update function traffic alias / canary routing (aligns with tcb fn config-route)",
204742
+ "reason.listVersions": "List published function versions (aligns with tcb fn list-function-versions)",
204743
+ "reason.routeTraffic": "Shift traffic to the new version or configure canary weights",
204744
+ "reason.confirmAlias": "Confirm the alias and traffic config have taken effect",
204711
204745
  // ---- Success messages ----
204712
204746
  listedFunctions: "Retrieved {count} cloud functions",
204713
204747
  gotFunctionDetail: "Retrieved details of function {fnName}",
@@ -204719,6 +204753,10 @@ exports.functions = (0, types_js_1.defineModule)({
204719
204753
  gotLayerVersionDetail: "Retrieved details of layer {layerName} version {layerVersion}",
204720
204754
  gotFunctionTriggers: "Retrieved the trigger list of function {fnName}",
204721
204755
  gotDownloadUrl: "Retrieved the code download URL of function {fnName}",
204756
+ gotFunctionVersions: "Retrieved the version list of function {fnName}",
204757
+ gotFunctionAlias: "Retrieved alias {aliasName} of function {fnName}",
204758
+ publishedVersion: "Published new version {version} of function {fnName}",
204759
+ updatedFunctionAlias: "Updated alias {aliasName} of function {fnName} (primary version {version})",
204722
204760
  createdHttpFunctionMessage: "Created HTTP function {fnName} from the image. If URL access is needed later, explicitly call manageGateway(action=\"createRoute\") with upstreamResourceType=\"WEB_SCF\", then create the access entry according to the actual path and auth requirements. Evaluators or other external callers may access anonymously, and failures may not feed EXCEED_AUTHORITY back to the AI; before delivery, proactively confirm the access path and the function security rules. If EXCEED_AUTHORITY has already appeared, first call queryPermissions(action=\"getResourcePermission\", resourceType=\"function\", resourceId=\"{fnName}\") to view the current rules, then adjust permissions with managePermissions(action=\"updateResourcePermission\") as needed.",
204723
204761
  createdFunction: "Created function {fnName}",
204724
204762
  imageCreatedMessage: "Created HTTP function {fnName} from image {imageUri}. Please confirm TCR, SCF, and the build pipeline are in the same region; for URL access, explicitly call manageGateway(action=\"createRoute\", upstreamResourceType=\"WEB_SCF\") and adjust the function security rules as needed. After deployment, use queryFunctions(action=\"getFunctionDetail\") to confirm the function is ready.",
@@ -204786,8 +204824,8 @@ exports.functions = (0, types_js_1.defineModule)({
204786
204824
  "schema.create.layers": "Layer configuration",
204787
204825
  "schema.manageLayer.name": "Layer name",
204788
204826
  "schema.manageLayer.version": "Layer version number",
204789
- "schema.query.action": "Read-only action type:\n- `listFunctions`: list all CloudBase cloud functions\n- `getFunctionDetail`: get function details (requires functionName)\n- `listFunctionLogs`: query function execution logs (requires functionName)\n- `getFunctionLogDetail`: get log details (requires requestId)\n- `listFunctionLayers`: list layers bound to a function\n- `listLayers`: list all layers (account-level view, including layers from other environments)\n- `listLayerVersions`: list layer versions (Versions, not Version; account-level view)\n- `getLayerVersionDetail`: get layer version details (account-level view)\n- `listFunctionTriggers`: list function triggers (scheduled task / cron / timer configuration)\n- `getFunctionDownloadUrl`: get the function code download URL\n- `getFunctionDeployStatus`: query async deployment status, stage progress, and final result by taskId. Returns data.build, data.deploy, and data.progress. While status=running, data.result and data.error are null and deployment must not be reported as complete. Keep polling until status=succeeded/failed. status=expired means the task exceeded the 2-hour retention limit; cloud deployment may still be running, so confirm with getFunctionDetail. Tasks exist only in MCP process memory; expired tasks or a restarted MCP Server return errorCode=DEPLOY_TASK_NOT_FOUND. Tasks are isolated by environment. This action is unavailable in cloud mode because real cloud/local builds cannot run there, while image deployment is synchronous and creates no taskId.",
204790
- "schema.query.functionName": "CloudBase cloud function name. Required for `getFunctionDetail`, `listFunctionLogs`, `listFunctionLayers`, `listFunctionTriggers`, and `getFunctionDownloadUrl`.",
204827
+ "schema.query.action": "Read-only action type:\n- `listFunctions`: list all CloudBase cloud functions\n- `getFunctionDetail`: get function details (requires functionName)\n- `listFunctionLogs`: query function execution logs (requires functionName)\n- `getFunctionLogDetail`: get log details (requires requestId)\n- `listFunctionLayers`: list layers bound to a function\n- `listLayers`: list all layers (account-level view, including layers from other environments)\n- `listLayerVersions`: list layer versions (Versions, not Version; account-level view)\n- `getLayerVersionDetail`: get layer version details (account-level view)\n- `listFunctionTriggers`: list function triggers (scheduled task / cron / timer configuration)\n- `getFunctionDownloadUrl`: get the function code download URL\n- `getFunctionDeployStatus`: query async deployment status, stage progress, and final result by taskId. Returns data.build, data.deploy, and data.progress. While status=running, data.result and data.error are null and deployment must not be reported as complete. Keep polling until status=succeeded/failed. status=expired means the task exceeded the 2-hour retention limit; cloud deployment may still be running, so confirm with getFunctionDetail. Tasks exist only in MCP process memory; expired tasks or a restarted MCP Server return errorCode=DEPLOY_TASK_NOT_FOUND. Tasks are isolated by environment. This action is unavailable in cloud mode because real cloud/local builds cannot run there, while image deployment is synchronous and creates no taskId.\n- `listVersionByFunction`: list published function versions (aligns with tcb fn list-function-versions / SDK listVersionByFunction; requires functionName)\n- `getFunctionAlias`: get function alias and traffic routing (aligns with tcb fn get-route / SDK getFunctionAlias; requires functionName; aliasName defaults to $DEFAULT)",
204828
+ "schema.query.functionName": "CloudBase cloud function name. Required for `getFunctionDetail`, `listFunctionLogs`, `listFunctionLayers`, `listFunctionTriggers`, `getFunctionDownloadUrl`, `listVersionByFunction`, and `getFunctionAlias`.",
204791
204829
  "schema.query.limit": "Page size (limit). Optional for list actions; the backend determines the default.",
204792
204830
  "schema.query.offset": "Pagination offset. Optional for list actions; defaults to 0.",
204793
204831
  "schema.query.codeSecret": "Code protection secret used to decrypt function code.",
@@ -204801,11 +204839,14 @@ exports.functions = (0, types_js_1.defineModule)({
204801
204839
  "schema.query.layerName": "Layer name. Required for `listLayerVersions` and `getLayerVersionDetail`. Layers use an account-level shared namespace; use the fixed format `{layerName}_{current envId}` (for example, common_cloud1-d9ghadgak3edf6b36).",
204802
204840
  "schema.query.layerVersion": "Layer version number. Required for `getLayerVersionDetail`.",
204803
204841
  "schema.query.taskId": "Async deployment task ID for `getFunctionDeployStatus` (returned by manageFunctions with wait=false). Tasks exist only in current MCP process memory: terminal tasks are retained for about 30 minutes and running tasks for at most 2 hours.",
204804
- "schema.manage.action": "Write action type, such as createFunction, updateFunctionCode, incrementalDeployFunction, invokeFunction, deleteFunction, createFunctionTrigger (scheduled task / cron / timer), deleteFunctionTrigger, createLayerVersion, deleteLayerVersion, attachLayer, detachLayer, or updateFunctionLayers. Use the fixed layer naming format `{layerName}_{current envId}` (for example, common_cloud1-d9ghadgak3edf6b36).",
204842
+ "schema.query.order": "Sort direction for `listVersionByFunction`, such as ASC / DESC.",
204843
+ "schema.query.orderBy": "Sort field for `listVersionByFunction`, such as AddTime / ModTime.",
204844
+ "schema.query.aliasName": "Alias name for `getFunctionAlias`. Defaults to `$DEFAULT` when omitted (same as tcb fn get-route).",
204845
+ "schema.manage.action": "Write action type, such as createFunction, updateFunctionCode, incrementalDeployFunction, invokeFunction, deleteFunction, createFunctionTrigger (scheduled task / cron / timer), deleteFunctionTrigger, createLayerVersion, deleteLayerVersion, attachLayer, detachLayer, updateFunctionLayers, publishVersion (publish a new version; aligns with tcb fn publish-version), or updateFunctionAliasConfig (update alias / traffic routing; aligns with tcb fn config-route). Use the fixed layer naming format `{layerName}_{current envId}` (for example, common_cloud1-d9ghadgak3edf6b36).",
204805
204846
  "schema.manage.func": "Function configuration for createFunction / updateFunctionCode. Image/build deployment is selected by func.buildStrategy (zip/cloud/local/image), with image fields under func.imageConfig.",
204806
204847
  "schema.manage.functionRootPath": "Recommended local-directory input for creating or updating function code. It must be the absolute directory that directly contains function folders (for example, /abs/path/cloudfunctions or /abs/path/functions), not the project root or the function subdirectory. Local layout should be cloudfunctions/<functionName>/index.js or functions/<functionName>/index.js. Pass the absolute cloudfunctions/functions directory; the SDK appends the function subdirectory. Do not precompress ZIP or base64 content.",
204807
204848
  "schema.manage.force": "Whether createFunction overwrites an existing function.",
204808
- "schema.manage.functionName": "Target function name at the top level. Used by updateFunctionCode, updateFunctionConfig, invokeFunction, and similar actions. createFunction uses func.name; other actions use top-level functionName. A mistakenly supplied func.name is also recognized as functionName.",
204849
+ "schema.manage.functionName": "Target function name at the top level. Used by updateFunctionCode, updateFunctionConfig, invokeFunction, publishVersion, updateFunctionAliasConfig, and similar actions. createFunction uses func.name; other actions use top-level functionName. A mistakenly supplied func.name is also recognized as functionName.",
204809
204850
  "schema.manage.zipFile": "Compatibility only: base64-encoded prebuilt code package. For ordinary createFunction/updateFunctionCode, do not create a ZIP first; prefer functionRootPath.",
204810
204851
  "schema.manage.handler": "Function entry point",
204811
204852
  "schema.manage.timeout": "Timeout used for configuration updates.",
@@ -204819,7 +204860,7 @@ exports.functions = (0, types_js_1.defineModule)({
204819
204860
  "schema.manage.contentPath": "Layer content path, either a directory or ZIP file.",
204820
204861
  "schema.manage.base64Content": "Base64-encoded layer content.",
204821
204862
  "schema.manage.runtimes": "Runtimes supported by the layer.",
204822
- "schema.manage.description": "Layer version description.",
204863
+ "schema.manage.description": "Description. Layer version description for createLayerVersion; version or alias description for publishVersion / updateFunctionAliasConfig.",
204823
204864
  "schema.manage.licenseInfo": "Layer license information.",
204824
204865
  "schema.manage.layers": "Target layer list for updateFunctionLayers; array order becomes final order.",
204825
204866
  "schema.manage.codeSecret": "Code protection secret used when binding a layer.",
@@ -204828,6 +204869,17 @@ exports.functions = (0, types_js_1.defineModule)({
204828
204869
  "schema.manage.autoGrant": "Whether manager-node may automatically add the fixed allowlist of CAM policies for image deployment. Defaults to false; set true only after explicitly confirming permission changes.",
204829
204870
  "schema.manage.confirm": "Dangerous-operation confirmation. deleteFunction, deleteFunctionTrigger, deleteLayerVersion, detachLayer, other delete actions, and real image build deployment (func.buildStrategy=cloud/local) require confirm=true.",
204830
204871
  "schema.manage.incrementalFile": "Changed-file path for incrementalDeployFunction incremental deployment.",
204872
+ "schema.manage.aliasName": "Alias name for `updateFunctionAliasConfig`. Defaults to `$DEFAULT` when omitted (same as tcb fn config-route).",
204873
+ "schema.manage.functionVersion": "Primary version for `updateFunctionAliasConfig`. May be a concrete version number or `$LATEST`.",
204874
+ "schema.manage.routingConfig": "Traffic routing config for `updateFunctionAliasConfig`. AdditionalVersionWeights is used for canary weights; AddtionVersionMatchs keeps the SCF/SDK historical field name (including the typo).",
204875
+ "schema.routing.version": "Additional traffic version number",
204876
+ "schema.routing.weight": "Additional traffic weight (0-1 or percentage per SCF convention)",
204877
+ "schema.routing.matchVersion": "Version targeted by a match rule",
204878
+ "schema.routing.matchKey": "Header/Query key for a match rule",
204879
+ "schema.routing.matchMethod": "Match method, such as Exact / Regex",
204880
+ "schema.routing.matchExpression": "Match expression",
204881
+ "schema.routing.additionalWeights": "Additional version weight list (canary release)",
204882
+ "schema.routing.additionalMatches": "Additional version match rules (field name keeps SCF AddtionVersionMatchs)",
204831
204883
  });
204832
204884
 
204833
204885
 
@@ -205161,10 +205213,11 @@ exports.hosting = (0, types_js_1.defineModule)({
205161
205213
  queryDescription: "查询 CloudBase 静态托管的只读信息。适合 AI 先做发现再决定下一步:action=websiteConfig 查询首页/错误页/路由规则与站点域名信息;action=status 查询托管服务状态;action=findFiles 按前缀查找文件;action=listFiles 列出全部托管文件;action=domainStatus 查询自定义域名的当前状态与配置。该工具不会产生任何副作用。",
205162
205214
  manageTitle: "管理 CloudBase 静态托管",
205163
205215
  manageDescription: "管理 CloudBase 静态托管的变更操作。action=upload 上传本地构建产物到共享域名(域名格式:<envId>-<appId>.tcloudbaseapp.com/<cloudPath>);action=delete 删除托管文件或目录(必须 confirm=true);action=setWebsiteDocument 设置首页/错误页/路由规则;action=enableService 开通静态托管;action=bindDomain / unbindDomain / updateDomain 管理自定义域名;action=downloadFile / downloadDirectory 下载托管内容到本地。⚠️ 底层每次托管操作都会请求 DescribeStaticStore 管控接口(20 次/秒 QPS 限制):批量删除多个文件请逐次调用并保持间隔(建议每秒不超过 10 次),同一目录下多个文件可优先用 isDir=true 一次删除整个目录;若报错含 \"frequency limit\" 说明触发了限流,请等待 1-2 秒后重试,不要连续快速重试。⚠️ 本工具没有关闭默认域名(*.tcloudbaseapp.com)的 action;要禁用该默认公网域名,请用 manageGateway(action=\"disableRoute\", domain=该 STATIC_STORE IsDefault 域名, path=\"/\")(底层 ModifyHTTPServiceRoute,不是 ModifyGatewayRoute)。⚠️ 新项目部署优先使用 manageApps(部署到独立子域名),本工具适合已有老项目继续使用或作为 manageApps 的 fallback。manageApps 与 manageHosting 域名不同,切换会导致老链接失效。若任务只是查看配置、文件或域名状态,请改用 queryHosting。",
205216
+ manageDescriptionCloud: "管理 CloudBase 静态托管的变更操作(cloud mode 版本)。⚠️ 依赖本地文件路径的 action 在 cloud mode 下不可用:action=upload / downloadFile / downloadDirectory 会直接报错,请勿调用。部署静态站点请改用 manageApps 云端链路:queryApps(action=\"getUploadUrl\", serviceName=\"<应用名>\") 获取预签名上传 URL → 将代码 zip PUT 上传到 uploadUrl(带 uploadHeaders 与 Content-Type: application/zip)→ manageApps(action=\"deployApp\", serviceName, cosTimestamp=<返回的 unixTimestamp>) 触发部署。可正常使用的远端管理操作:action=delete 删除托管文件或目录(必须 confirm=true);action=setWebsiteDocument 设置首页/错误页/路由规则;action=enableService 开通静态托管;action=bindDomain / unbindDomain / updateDomain 管理自定义域名。⚠️ 底层每次托管操作都会请求 DescribeStaticStore 管控接口(20 次/秒 QPS 限制):批量删除多个文件请逐次调用并保持间隔(建议每秒不超过 10 次);若报错含 \"frequency limit\" 说明触发了限流,请等待 1-2 秒后重试。若任务只是查看配置、文件或域名状态,请改用 queryHosting。",
205164
205217
  commonServiceUnsupported: "当前 CloudBase Manager 实例不支持 commonService.call,无法执行 {action}。",
205165
205218
  managerUnavailable: "CloudBase Manager 实例不可用。",
205166
205219
  hostingStoreMissing: "当前环境 {envId} 未发现静态托管资源配置,无法上传文件。请先确认 MCP 已绑定到已开通静态托管的 CloudBase 环境;如需切换环境,请调用 auth(action=\"set_env\", envId=\"目标环境ID\") 后重试。",
205167
- cloudModeLocalActionUnavailable: "manageHosting(action=\"{action}\") 在 cloud mode 下不可用,因为该操作依赖本地文件路径。请改用本地模式执行;若只需要远端管理静态托管,可继续使用 delete / setWebsiteDocument / enableService / bindDomain / unbindDomain / updateDomain。",
205220
+ cloudModeLocalActionUnavailable: "manageHosting(action=\"{action}\") 在 cloud mode 下不可用,因为该操作依赖本地文件路径。若需要部署静态站点,请改用 manageApps 云端链路:queryApps(action=\"getUploadUrl\", serviceName=\"<应用名>\") 获取预签名上传 URL → 将代码 zip PUT 上传到 uploadUrl(带 uploadHeaders 与 Content-Type: application/zip)→ manageApps(action=\"deployApp\", serviceName, cosTimestamp=<返回的 unixTimestamp>) 触发部署;若只是要上传/下载已有托管文件且无本地文件系统,该操作在云端没有替代路径,请改用本地模式执行。远端管理操作(delete / setWebsiteDocument / enableService / bindDomain / unbindDomain / updateDomain)不受影响,可继续使用。",
205168
205221
  uploadArgsRequired: "manageHosting(action=\"upload\") 需要提供 localPath + cloudPath,或提供 files 多文件上传列表。",
205169
205222
  uploadSuccess: "静态托管文件上传成功。若需要校验上传结果,请继续调用 queryHosting(action=\"findFiles\") 或 queryHosting(action=\"listFiles\")。",
205170
205223
  uploadRouteDisabledWithFallback: "静态托管文件上传成功。默认静态托管域名的网关路由已禁用(访问会返回 GATEWAY_ROUTE_DISABLED),已改用其他可达域名作为 accessUrl。可用 manageGateway(action=\"updateRoute\", route.enable=true) 重新启用默认域路由。",
@@ -205264,10 +205317,11 @@ exports.hosting = (0, types_js_1.defineModule)({
205264
205317
  queryDescription: "Read-only information about CloudBase static hosting. Lets the AI discover state first and then decide the next step: action=websiteConfig queries the index/error document, routing rules, and site domain info; action=status queries the hosting service status; action=findFiles finds files by prefix; action=listFiles lists all hosted files; action=domainStatus queries the current status and configuration of custom domains. This tool has no side effects.",
205265
205318
  manageTitle: "Manage CloudBase static hosting",
205266
205319
  manageDescription: "Mutation operations for CloudBase static hosting. action=upload uploads local build artifacts to the shared domain (domain format: <envId>-<appId>.tcloudbaseapp.com/<cloudPath>); action=delete deletes hosted files or directories (confirm=true required); action=setWebsiteDocument sets the index/error document and routing rules; action=enableService enables static hosting; action=bindDomain / unbindDomain / updateDomain manage custom domains; action=downloadFile / downloadDirectory download hosted content to local disk. ⚠️ Every hosting operation calls the DescribeStaticStore control-plane API underneath (20 req/s QPS limit): when deleting multiple files, call sequentially with intervals (no more than 10 calls per second recommended); for multiple files in the same directory, prefer isDir=true to delete the whole directory in one call. If the error contains \"frequency limit\", rate limiting was triggered — wait 1-2 seconds and retry; do not retry in rapid succession. ⚠️ This tool has no action to disable the default domain (*.tcloudbaseapp.com); to disable that default public domain, use manageGateway(action=\"disableRoute\", domain=the STATIC_STORE IsDefault domain, path=\"/\") (backed by ModifyHTTPServiceRoute, not ModifyGatewayRoute). ⚠️ For new projects prefer manageApps (deploys to a dedicated subdomain); this tool suits existing legacy projects or as a fallback for manageApps. manageApps and manageHosting use different domains, so switching invalidates old links. If the task is only inspecting config, files, or domain status, use queryHosting instead.",
205320
+ manageDescriptionCloud: "Mutation operations for CloudBase static hosting (cloud mode variant). ⚠️ Actions that depend on local file paths are unavailable in cloud mode: action=upload / downloadFile / downloadDirectory will fail immediately — do not call them. To deploy a static site, use the manageApps cloud path instead: queryApps(action=\"getUploadUrl\", serviceName=\"<app name>\") to get a presigned upload URL → PUT the code zip to uploadUrl (with uploadHeaders and Content-Type: application/zip) → manageApps(action=\"deployApp\", serviceName, cosTimestamp=<returned unixTimestamp>) to trigger deployment. Remote-only management actions remain available: action=delete deletes hosted files or directories (confirm=true required); action=setWebsiteDocument sets the index/error document and routing rules; action=enableService enables static hosting; action=bindDomain / unbindDomain / updateDomain manage custom domains. ⚠️ Every hosting operation calls the DescribeStaticStore control-plane API underneath (20 req/s QPS limit): when deleting multiple files, call sequentially with intervals (no more than 10 calls per second recommended); if the error contains \"frequency limit\", rate limiting was triggered — wait 1-2 seconds and retry. If the task is only inspecting config, files, or domain status, use queryHosting instead.",
205267
205321
  commonServiceUnsupported: "The current CloudBase Manager instance does not support commonService.call; cannot execute {action}.",
205268
205322
  managerUnavailable: "CloudBase manager is unavailable.",
205269
205323
  hostingStoreMissing: "No static hosting storage config found for environment {envId}; cannot upload files. Make sure MCP is bound to a CloudBase environment with static hosting enabled; to switch environments, call auth(action=\"set_env\", envId=\"<target env ID>\") and retry.",
205270
- cloudModeLocalActionUnavailable: "manageHosting(action=\"{action}\") is unavailable in cloud mode because the operation depends on local file paths. Run MCP in local mode instead; for remote-only static hosting management, you can still use delete / setWebsiteDocument / enableService / bindDomain / unbindDomain / updateDomain.",
205324
+ cloudModeLocalActionUnavailable: "manageHosting(action=\"{action}\") is unavailable in cloud mode because the operation depends on local file paths. To deploy a static site, use the manageApps cloud path instead: queryApps(action=\"getUploadUrl\", serviceName=\"<app name>\") to get a presigned upload URL → PUT the code zip to uploadUrl (with uploadHeaders and Content-Type: application/zip) → manageApps(action=\"deployApp\", serviceName, cosTimestamp=<returned unixTimestamp>) to trigger deployment. If you only need to upload/download existing hosted files and there is no local filesystem, there is no cloud alternative for this action — run MCP in local mode instead. Remote-only management actions (delete / setWebsiteDocument / enableService / bindDomain / unbindDomain / updateDomain) are unaffected and remain available.",
205271
205325
  uploadArgsRequired: "manageHosting(action=\"upload\") requires localPath + cloudPath, or a files list for multi-file upload.",
205272
205326
  uploadSuccess: "Static hosting files uploaded. To verify the upload result, call queryHosting(action=\"findFiles\") or queryHosting(action=\"listFiles\").",
205273
205327
  uploadRouteDisabledWithFallback: "Static hosting files uploaded. The gateway route for the default static hosting domain is disabled (access returns GATEWAY_ROUTE_DISABLED); another reachable domain is used as accessUrl. Use manageGateway(action=\"updateRoute\", route.enable=true) to re-enable the default domain route.",
@@ -205996,6 +206050,8 @@ exports.rag = (0, types_js_1.defineModule)({
205996
206050
  findByNameSuccess: "CloudBase 文档查找成功",
205997
206051
  readDocSuccess: "CloudBase 文档读取成功",
205998
206052
  readDocNotMarkdown: "文档 {docPath} 没有可用的 Markdown 版本(站点对该路径返回了 HTML 页面)。请用 action=searchDocs 或 action=findByName 确认正确地址后重试;也可以直接抓取网页版:{pageUrl}",
206053
+ readDocUrlNotAllowed: "readDoc 只读取 CloudBase 官方文档站({host})上的文档,不接受其他主机的地址:{docPath}。请改传站内相对路径(如 /quick-start),或该文档站上的地址。",
206054
+ readDocPathEmpty: "readDoc 需要一个具体文档路径,{docPath} 里没有路径部分。例如传 /quick-start,或传 action=findByName / action=searchDocs 返回的文档地址。",
205999
206055
  searchDocsSuccess: "CloudBase 文档搜索成功",
206000
206056
  skillNotFound: "未找到技能文档 \"{skillName}\"。可用技能文档:{available}。{remoteHint}",
206001
206057
  skillRemoteHint: " 你也可以直接从这个地址获取技能文档:{url}",
@@ -206016,7 +206072,7 @@ exports.rag = (0, types_js_1.defineModule)({
206016
206072
  "schema.action": "仅 mode=docs 时指定;mode=openapi 不要传 action。CloudBase 文档操作类型:listModules=列出所有文档模块,listModuleDocs=获取指定模块的目录结构,findByName=按名称/路径/URL 智能查找,readDoc=读取指定文档 Markdown,searchDocs=全文搜索官方文档。",
206017
206073
  "schema.moduleName": "mode=docs 且 action=listModuleDocs 时指定。模块名称。",
206018
206074
  "schema.input": "mode=docs 且 action=findByName 时指定。支持模块名、文档标题、层级路径或 URL。",
206019
- "schema.docPath": "mode=docs 且 action=readDoc 时指定。文档相对路径或完整 URL。",
206075
+ "schema.docPath": "mode=docs 且 action=readDoc 时指定。站内相对路径(如 /quick-start),或 action=findByName / action=searchDocs 返回的文档地址 —— 传地址时只取其中的路径,主机部分一律忽略。",
206020
206076
  "schema.query": "mode=docs 且 action=searchDocs 时指定。全文检索关键词。",
206021
206077
  }, {
206022
206078
  title: "CloudBase knowledge base search",
@@ -206052,6 +206108,8 @@ exports.rag = (0, types_js_1.defineModule)({
206052
206108
  findByNameSuccess: "CloudBase doc lookup succeeded",
206053
206109
  readDocSuccess: "CloudBase doc read successfully",
206054
206110
  readDocNotMarkdown: "No Markdown version is available for {docPath} (the site returned an HTML page for it). Use action=searchDocs or action=findByName to confirm the correct address and retry; you can also fetch the rendered page directly: {pageUrl}",
206111
+ readDocUrlNotAllowed: "readDoc only reads documents on the official CloudBase docs site ({host}); other hosts are not accepted: {docPath}. Pass a site-relative path such as /quick-start, or an address on that docs site.",
206112
+ readDocPathEmpty: "readDoc needs a concrete document path; {docPath} carries no path. For example pass /quick-start, or a document address returned by action=findByName / action=searchDocs.",
206055
206113
  searchDocsSuccess: "CloudBase doc search succeeded",
206056
206114
  skillNotFound: "Skill document \"{skillName}\" not found. Available skill docs: {available}.{remoteHint}",
206057
206115
  skillRemoteHint: " You can also try fetching the skill doc directly from: {url}",
@@ -206072,7 +206130,7 @@ exports.rag = (0, types_js_1.defineModule)({
206072
206130
  "schema.action": "Only for mode=docs; do not pass action with mode=openapi. CloudBase documentation action: listModules lists all documentation modules; listModuleDocs gets the catalog for a module; findByName searches intelligently by name, path, or URL; readDoc reads document Markdown; searchDocs performs a full-text search of the official documentation.",
206073
206131
  "schema.moduleName": "Required when mode=docs and action=listModuleDocs. The module name.",
206074
206132
  "schema.input": "Required when mode=docs and action=findByName. Accepts a module name, document title, hierarchical path, or URL.",
206075
- "schema.docPath": "Required when mode=docs and action=readDoc. A relative document path or full URL.",
206133
+ "schema.docPath": "Required when mode=docs and action=readDoc. A site-relative path such as /quick-start, or a document address returned by action=findByName / action=searchDocs — only the path is used; any host is ignored.",
206076
206134
  "schema.query": "Required when mode=docs and action=searchDocs. Full-text search keywords.",
206077
206135
  });
206078
206136
 
@@ -208535,6 +208593,8 @@ exports.SERVICE_VERSIONS = {
208535
208593
  tag: ["2018-08-13"],
208536
208594
  billing: ["2018-07-09"],
208537
208595
  region: ["2022-06-27"],
208596
+ // 备案
208597
+ ba: ["2020-07-20"],
208538
208598
  // 计算 / 容器 / 存储
208539
208599
  cvm: ["2017-03-12"],
208540
208600
  lighthouse: ["2020-03-24"],
@@ -223270,7 +223330,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
223270
223330
  return (mod && mod.__esModule) ? mod : { "default": mod };
223271
223331
  };
223272
223332
  Object.defineProperty(exports, "__esModule", ({ value: true }));
223273
- exports.CUSTOM_IMAGE_RUNTIME = exports.MASKED_ENV_VALUE = exports.LAYER_SOFT_WARN = exports.MANAGE_FUNCTION_ACTIONS = exports.QUERY_FUNCTION_ACTIONS = exports.TRIGGER_CONFIG_EXAMPLES = exports.SUPPORTED_TRIGGER_TYPES = exports.DEFAULT_NODEJS_RUNTIME = exports.SUPPORTED_NODEJS_RUNTIMES = exports.RECOMMENDED_RUNTIMES = exports.DEFAULT_RUNTIME = exports.ALL_SUPPORTED_RUNTIMES = exports.SUPPORTED_RUNTIMES = void 0;
223333
+ exports.CUSTOM_IMAGE_RUNTIME = exports.MASKED_ENV_VALUE = exports.LAYER_SOFT_WARN = exports.DEFAULT_FUNCTION_ALIAS = exports.MANAGE_FUNCTION_ACTIONS = exports.QUERY_FUNCTION_ACTIONS = exports.TRIGGER_CONFIG_EXAMPLES = exports.SUPPORTED_TRIGGER_TYPES = exports.DEFAULT_NODEJS_RUNTIME = exports.SUPPORTED_NODEJS_RUNTIMES = exports.RECOMMENDED_RUNTIMES = exports.DEFAULT_RUNTIME = exports.ALL_SUPPORTED_RUNTIMES = exports.SUPPORTED_RUNTIMES = void 0;
223274
223334
  exports.formatRuntimeList = formatRuntimeList;
223275
223335
  exports.layerNameIncludesEnvId = layerNameIncludesEnvId;
223276
223336
  exports.buildCreateLayerNameWarning = buildCreateLayerNameWarning;
@@ -223369,6 +223429,8 @@ exports.QUERY_FUNCTION_ACTIONS = [
223369
223429
  "listFunctionTriggers",
223370
223430
  "getFunctionDownloadUrl",
223371
223431
  "getFunctionDeployStatus",
223432
+ "listVersionByFunction",
223433
+ "getFunctionAlias",
223372
223434
  ];
223373
223435
  exports.MANAGE_FUNCTION_ACTIONS = [
223374
223436
  "createFunction",
@@ -223383,8 +223445,12 @@ exports.MANAGE_FUNCTION_ACTIONS = [
223383
223445
  "attachLayer",
223384
223446
  "detachLayer",
223385
223447
  "updateFunctionLayers",
223448
+ "publishVersion",
223449
+ "updateFunctionAliasConfig",
223386
223450
  "incrementalDeployFunction", // 增量部署,需通过 pluginOptions.functions 注入实现
223387
223451
  ];
223452
+ /** Default SCF traffic alias used by CloudBase CLI `fn get-route` / `fn config-route`. */
223453
+ exports.DEFAULT_FUNCTION_ALIAS = "$DEFAULT";
223388
223454
  /** Layer soft-warn copy — account-scoped SCF LayerName guidance (no hard fail). */
223389
223455
  exports.LAYER_SOFT_WARN = {
223390
223456
  createNameFormat: (envId) => (0, index_js_1.t)("functions.layerWarn.createNameFormat", { envId }),
@@ -223544,6 +223610,27 @@ const MANAGE_LAYER_SCHEMA = zod_1.z.object({
223544
223610
  layerName: zod_1.z.string().describe("functions.schema.manageLayer.name"),
223545
223611
  layerVersion: zod_1.z.number().describe("functions.schema.manageLayer.version"),
223546
223612
  });
223613
+ const FUNCTION_VERSION_WEIGHT_SCHEMA = zod_1.z.object({
223614
+ Version: zod_1.z.string().describe("functions.schema.routing.version"),
223615
+ Weight: zod_1.z.number().describe("functions.schema.routing.weight"),
223616
+ });
223617
+ const FUNCTION_VERSION_MATCH_SCHEMA = zod_1.z.object({
223618
+ Version: zod_1.z.string().describe("functions.schema.routing.matchVersion"),
223619
+ Key: zod_1.z.string().describe("functions.schema.routing.matchKey"),
223620
+ Method: zod_1.z.string().describe("functions.schema.routing.matchMethod"),
223621
+ Expression: zod_1.z.string().describe("functions.schema.routing.matchExpression"),
223622
+ });
223623
+ const FUNCTION_ROUTING_CONFIG_SCHEMA = zod_1.z.object({
223624
+ AdditionalVersionWeights: zod_1.z
223625
+ .array(FUNCTION_VERSION_WEIGHT_SCHEMA)
223626
+ .optional()
223627
+ .describe("functions.schema.routing.additionalWeights"),
223628
+ // Keep SCF/SDK historical field name (typo included) as the public contract.
223629
+ AddtionVersionMatchs: zod_1.z
223630
+ .array(FUNCTION_VERSION_MATCH_SCHEMA)
223631
+ .optional()
223632
+ .describe("functions.schema.routing.additionalMatches"),
223633
+ });
223547
223634
  /**
223548
223635
  * Prefer top-level functionName; fall back to func.name for the common
223549
223636
  * mistake of nesting the target name under func (createFunction shape).
@@ -224110,6 +224197,78 @@ function registerFunctionTools(server) {
224110
224197
  raw: result,
224111
224198
  }, (0, index_js_1.t)("functions.gotDownloadUrl", { fnName: input.functionName }));
224112
224199
  }
224200
+ case "listVersionByFunction": {
224201
+ if (!input.functionName) {
224202
+ throw new Error((0, index_js_1.t)("functions.paramRequired", { action: input.action, param: "functionName" }));
224203
+ }
224204
+ const cloudbase = await getManager();
224205
+ const result = await cloudbase.functions.listVersionByFunction({
224206
+ functionName: input.functionName,
224207
+ offset: input.offset,
224208
+ limit: input.limit,
224209
+ order: input.order,
224210
+ orderBy: input.orderBy,
224211
+ });
224212
+ (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
224213
+ return buildEnvelope({
224214
+ action: input.action,
224215
+ functionName: input.functionName,
224216
+ functionVersions: result.FunctionVersion || [],
224217
+ versions: result.Versions || [],
224218
+ totalCount: result.TotalCount,
224219
+ requestId: result.RequestId,
224220
+ raw: result,
224221
+ }, (0, index_js_1.t)("functions.gotFunctionVersions", { fnName: input.functionName }), [
224222
+ {
224223
+ tool: "manageFunctions",
224224
+ action: "publishVersion",
224225
+ reason: (0, index_js_1.t)("functions.reason.publishVersion"),
224226
+ },
224227
+ {
224228
+ tool: "queryFunctions",
224229
+ action: "getFunctionAlias",
224230
+ reason: (0, index_js_1.t)("functions.reason.getFunctionAlias"),
224231
+ },
224232
+ ]);
224233
+ }
224234
+ case "getFunctionAlias": {
224235
+ if (!input.functionName) {
224236
+ throw new Error((0, index_js_1.t)("functions.paramRequired", { action: input.action, param: "functionName" }));
224237
+ }
224238
+ const aliasName = input.aliasName || exports.DEFAULT_FUNCTION_ALIAS;
224239
+ const cloudbase = await getManager();
224240
+ const result = await cloudbase.functions.getFunctionAlias({
224241
+ functionName: input.functionName,
224242
+ name: aliasName,
224243
+ });
224244
+ (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
224245
+ return buildEnvelope({
224246
+ action: input.action,
224247
+ functionName: input.functionName,
224248
+ aliasName,
224249
+ functionVersion: result.FunctionVersion,
224250
+ routingConfig: result.RoutingConfig,
224251
+ description: result.Description,
224252
+ addTime: result.AddTime,
224253
+ modTime: result.ModTime,
224254
+ requestId: result.RequestId,
224255
+ raw: result,
224256
+ }, (0, index_js_1.t)("functions.gotFunctionAlias", {
224257
+ fnName: input.functionName,
224258
+ aliasName,
224259
+ }), [
224260
+ {
224261
+ tool: "manageFunctions",
224262
+ action: "updateFunctionAliasConfig",
224263
+ reason: (0, index_js_1.t)("functions.reason.updateFunctionAlias"),
224264
+ },
224265
+ {
224266
+ tool: "queryFunctions",
224267
+ action: "listVersionByFunction",
224268
+ reason: (0, index_js_1.t)("functions.reason.listVersions"),
224269
+ },
224270
+ ]);
224271
+ }
224113
224272
  default:
224114
224273
  throw new Error((0, index_js_1.t)("functions.unsupportedAction", { action: input.action }));
224115
224274
  }
@@ -224948,6 +225107,94 @@ function registerFunctionTools(server) {
224948
225107
  },
224949
225108
  ], bindWarnings);
224950
225109
  }
225110
+ case "publishVersion": {
225111
+ if (!input.functionName) {
225112
+ throw new Error((0, index_js_1.t)("functions.paramRequired", { action: input.action, param: "functionName" }));
225113
+ }
225114
+ const cloudbase = await getManager();
225115
+ const result = await cloudbase.functions.publishVersion({
225116
+ functionName: input.functionName,
225117
+ description: input.description,
225118
+ });
225119
+ (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
225120
+ return buildEnvelope({
225121
+ action: input.action,
225122
+ functionName: input.functionName,
225123
+ functionVersion: result.FunctionVersion,
225124
+ description: result.Description,
225125
+ codeSize: result.CodeSize,
225126
+ memorySize: result.MemorySize,
225127
+ handler: result.Handler,
225128
+ timeout: result.Timeout,
225129
+ runtime: result.Runtime,
225130
+ namespace: result.Namespace,
225131
+ requestId: result.RequestId,
225132
+ raw: result,
225133
+ }, (0, index_js_1.t)("functions.publishedVersion", {
225134
+ fnName: input.functionName,
225135
+ version: result.FunctionVersion,
225136
+ }), [
225137
+ {
225138
+ tool: "queryFunctions",
225139
+ action: "listVersionByFunction",
225140
+ reason: (0, index_js_1.t)("functions.reason.listVersions"),
225141
+ },
225142
+ {
225143
+ tool: "manageFunctions",
225144
+ action: "updateFunctionAliasConfig",
225145
+ reason: (0, index_js_1.t)("functions.reason.routeTraffic"),
225146
+ suggested_args: {
225147
+ functionName: input.functionName,
225148
+ functionVersion: result.FunctionVersion,
225149
+ aliasName: exports.DEFAULT_FUNCTION_ALIAS,
225150
+ },
225151
+ },
225152
+ ]);
225153
+ }
225154
+ case "updateFunctionAliasConfig": {
225155
+ if (!input.functionName) {
225156
+ throw new Error((0, index_js_1.t)("functions.paramRequired", { action: input.action, param: "functionName" }));
225157
+ }
225158
+ if (!input.functionVersion) {
225159
+ throw new Error((0, index_js_1.t)("functions.paramRequired", {
225160
+ action: input.action,
225161
+ param: "functionVersion",
225162
+ }));
225163
+ }
225164
+ const aliasName = input.aliasName || exports.DEFAULT_FUNCTION_ALIAS;
225165
+ const cloudbase = await getManager();
225166
+ const result = await cloudbase.functions.updateFunctionAliasConfig({
225167
+ functionName: input.functionName,
225168
+ name: aliasName,
225169
+ functionVersion: input.functionVersion,
225170
+ description: input.description,
225171
+ routingConfig: input.routingConfig,
225172
+ });
225173
+ (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
225174
+ return buildEnvelope({
225175
+ action: input.action,
225176
+ functionName: input.functionName,
225177
+ aliasName,
225178
+ functionVersion: input.functionVersion,
225179
+ routingConfig: input.routingConfig,
225180
+ requestId: result.RequestId,
225181
+ raw: result,
225182
+ }, (0, index_js_1.t)("functions.updatedFunctionAlias", {
225183
+ fnName: input.functionName,
225184
+ aliasName,
225185
+ version: input.functionVersion,
225186
+ }), [
225187
+ {
225188
+ tool: "queryFunctions",
225189
+ action: "getFunctionAlias",
225190
+ reason: (0, index_js_1.t)("functions.reason.confirmAlias"),
225191
+ suggested_args: {
225192
+ functionName: input.functionName,
225193
+ aliasName,
225194
+ },
225195
+ },
225196
+ ]);
225197
+ }
224951
225198
  default:
224952
225199
  // incrementalDeployFunction:无默认实现,必须通过 pluginOptions 注入
224953
225200
  if (input.action === 'incrementalDeployFunction') {
@@ -225007,6 +225254,12 @@ function registerFunctionTools(server) {
225007
225254
  .string()
225008
225255
  .optional()
225009
225256
  .describe("functions.schema.query.taskId"),
225257
+ order: zod_1.z.string().optional().describe("functions.schema.query.order"),
225258
+ orderBy: zod_1.z.string().optional().describe("functions.schema.query.orderBy"),
225259
+ aliasName: zod_1.z
225260
+ .string()
225261
+ .optional()
225262
+ .describe("functions.schema.query.aliasName"),
225010
225263
  },
225011
225264
  annotations: {
225012
225265
  readOnlyHint: true,
@@ -225075,6 +225328,15 @@ function registerFunctionTools(server) {
225075
225328
  .describe("functions.schema.manage.autoGrant"),
225076
225329
  confirm: zod_1.z.boolean().optional().describe("functions.schema.manage.confirm"),
225077
225330
  incrementalFile: zod_1.z.string().optional().describe("functions.schema.manage.incrementalFile"),
225331
+ aliasName: zod_1.z
225332
+ .string()
225333
+ .optional()
225334
+ .describe("functions.schema.manage.aliasName"),
225335
+ functionVersion: zod_1.z
225336
+ .string()
225337
+ .optional()
225338
+ .describe("functions.schema.manage.functionVersion"),
225339
+ routingConfig: FUNCTION_ROUTING_CONFIG_SCHEMA.optional().describe("functions.schema.manage.routingConfig"),
225078
225340
  },
225079
225341
  annotations: {
225080
225342
  readOnlyHint: false,
@@ -227215,7 +227477,12 @@ function registerHostingTools(server) {
227215
227477
  });
227216
227478
  server.registerTool('manageHosting', {
227217
227479
  title: 'hosting.manageTitle',
227218
- description: 'hosting.manageDescription',
227480
+ // cloud mode 下注册期即切换描述:upload/download 系 action 不可用、部署引导走
227481
+ // manageApps 云端链路(getUploadUrl → PUT zip → deployApp(cosTimestamp)),
227482
+ // 让 agent 在 tools/list 阶段就避开必败调用,而不是等报错后浪费一轮。
227483
+ description: (0, cloud_mode_js_1.isCloudMode)()
227484
+ ? 'hosting.manageDescriptionCloud'
227485
+ : 'hosting.manageDescription',
227219
227486
  inputSchema: manageHostingInputSchema,
227220
227487
  annotations: {
227221
227488
  readOnlyHint: false,
@@ -229737,9 +230004,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
229737
230004
  return (mod && mod.__esModule) ? mod : { "default": mod };
229738
230005
  };
229739
230006
  Object.defineProperty(exports, "__esModule", ({ value: true }));
229740
- exports.SKILL_REMOTE_BASE_URL = void 0;
230007
+ exports.DOCS_BASE_HOST = exports.SKILL_REMOTE_BASE_URL = void 0;
229741
230008
  exports.resolveSkillSearchRoots = resolveSkillSearchRoots;
229742
230009
  exports.resolveDocsMarkdownPath = resolveDocsMarkdownPath;
230010
+ exports.toSiteRelativeDocPath = toSiteRelativeDocPath;
230011
+ exports.assertNoHostInDocPath = assertNoHostInDocPath;
229743
230012
  exports.isDocsHtmlFallback = isDocsHtmlFallback;
229744
230013
  exports.registerRagTools = registerRagTools;
229745
230014
  exports.buildSkillRawUrl = buildSkillRawUrl;
@@ -230168,6 +230437,74 @@ function resolveDocsMarkdownPath(docPath) {
230168
230437
  : `${base.replace(/\/index$/i, "")}.md`;
230169
230438
  return `${normalized}${hash}`;
230170
230439
  }
230440
+ /**
230441
+ * 交给 `DocsService.readDoc()` 的地址**永远不含 host**。
230442
+ *
230443
+ * Manager SDK 的 `DocsService.readDoc()` 见到 `http` 前缀就把入参原样 fetch、并把整段响应体
230444
+ * 回显给调用方(`@cloudbase/manager-node/lib/docs/index.js:101`)。等于 docPath 是一条「由服务端
230445
+ * 发起任意 HTTP 请求、把响应交给调用方」的通路:只要入参能带主机,`http://127.0.0.1/...`、
230446
+ * `http://169.254.169.254/...`(云主机元数据)就能把工具变成 SSRF 原语。
230447
+ *
230448
+ * 而 docPath 收到完整 URL 是**主线用法**,不能靠「拒绝一切 URL」收口:`findByName` /
230449
+ * `listModuleDocs` 的数据源 `category.json` 里 1016 个文档值全部是
230450
+ * `https://docs.cloudbase.net/...` 形态,`searchDocs`(Algolia)返回的 `url` 也是完整地址,
230451
+ * AI 拿到之后自然是原样喂回 readDoc。
230452
+ *
230453
+ * 所以这里的做法是**剥掉主机**:官方文档站的地址只取 pathname(+ 锚点),其余主机直接拒绝。
230454
+ * 效果比白名单更强 —— 不是「允许的 host 恰好只有一个」,而是**没有任何 host 能走到 fetch**,
230455
+ * 请求目标恒为 SDK 里的 `DOCS_BASE_URL`;顺带也让 `resolveDocsMarkdownPath` 的 `.md` 后缀
230456
+ * 拼接不再可能作用在主机上(旧实现里裸主机名会被拼成 `docs.cloudbase.net.md`——`.md` 是
230457
+ * 可被第三方注册的国家顶级域)。
230458
+ */
230459
+ exports.DOCS_BASE_HOST = "docs.cloudbase.net";
230460
+ /** 带 scheme 的绝对地址(`//host/path` 这类 protocol-relative 也算「指定了主机」)。 */
230461
+ const ABSOLUTE_DOC_URL_PATTERN = /^[a-z][a-z0-9+.-]*:\/\//i;
230462
+ function parseAbsoluteDocUrl(value) {
230463
+ const candidate = value.startsWith("//") ? `https:${value}` : value;
230464
+ if (!ABSOLUTE_DOC_URL_PATTERN.test(candidate)) {
230465
+ return null;
230466
+ }
230467
+ try {
230468
+ return new URL(candidate);
230469
+ }
230470
+ catch {
230471
+ return null;
230472
+ }
230473
+ }
230474
+ /**
230475
+ * 把 docPath 折成站内相对路径:官方文档站地址**丢掉 host**只留路径,非首方主机直接拒绝。
230476
+ *
230477
+ * 查询串一并丢弃:站点用 `<路径>.md` 寻址,query 不属于寻址的一部分,留着只会拼出
230478
+ * `.../x.md?foo` 这种畸形地址。锚点保留(`resolveDocsMarkdownPath` 本就支持 `#`)。
230479
+ */
230480
+ function toSiteRelativeDocPath(docPath) {
230481
+ const raw = docPath.trim();
230482
+ const parsed = parseAbsoluteDocUrl(raw);
230483
+ if (!parsed) {
230484
+ return raw;
230485
+ }
230486
+ const host = parsed.hostname.toLowerCase().replace(/\.$/, "");
230487
+ const isAllowedProtocol = parsed.protocol === "http:" || parsed.protocol === "https:";
230488
+ if (!isAllowedProtocol || host !== exports.DOCS_BASE_HOST) {
230489
+ throw new Error((0, index_js_1.t)("rag.readDocUrlNotAllowed", { docPath: raw, host: exports.DOCS_BASE_HOST }));
230490
+ }
230491
+ const sitePath = `${parsed.pathname}${parsed.hash}`;
230492
+ if (!sitePath.replace(/^\/+|\/+$/g, "")) {
230493
+ throw new Error((0, index_js_1.t)("rag.readDocPathEmpty", { docPath: raw }));
230494
+ }
230495
+ return sitePath;
230496
+ }
230497
+ /**
230498
+ * invariant:走到 SDK 的地址不能含 host。
230499
+ *
230500
+ * 归一化之后再过一次,保证「fetch 目标恒为首方基址」这条性质不依赖
230501
+ * `resolveDocsMarkdownPath` 的实现细节 —— 它以后改动了也漏不掉。
230502
+ */
230503
+ function assertNoHostInDocPath(sitePath) {
230504
+ if (parseAbsoluteDocUrl(sitePath.trim())) {
230505
+ throw new Error((0, index_js_1.t)("rag.readDocUrlNotAllowed", { docPath: sitePath, host: exports.DOCS_BASE_HOST }));
230506
+ }
230507
+ }
230171
230508
  /**
230172
230509
  * 识别 SPA 兜底页:站点对不存在的 markdown 路径同样返回 200,正文是站点 HTML 外壳。
230173
230510
  * 用于把「静默返回一坨 HTML」换成明确的失败信息。
@@ -230288,14 +230625,22 @@ async function registerRagTools(server) {
230288
230625
  }
230289
230626
  if (resolvedAction === "readDoc") {
230290
230627
  const resolvedDocPath = requireStringParam(docPath, "docPath", resolvedAction);
230291
- const markdownPath = resolveDocsMarkdownPath(resolvedDocPath);
230628
+ // 先剥掉 host(非首方主机直接拒绝),再做 `.md` 归一化,最后复核一遍不含 host。
230629
+ // 三者顺序不能换:归一化会给路径补后缀,若让它作用在主机上就会把
230630
+ // `docs.cloudbase.net` 拼成 `docs.cloudbase.net.md`(`.md` 是第三方可注册的 TLD)。
230631
+ const siteDocPath = toSiteRelativeDocPath(resolvedDocPath);
230632
+ const markdownPath = resolveDocsMarkdownPath(siteDocPath);
230633
+ assertNoHostInDocPath(markdownPath);
230292
230634
  const markdown = await docsManager.readDoc(markdownPath);
230293
230635
  // 站点对没有 markdown 的路径也返回 200 + HTML 外壳,必须显式判失败,
230294
230636
  // 否则会把整页 HTML 当成文档正文交给模型(旧行为就是这样静默出错的)。
230295
230637
  if (isDocsHtmlFallback(markdown)) {
230638
+ // 「网页版」退路必须是绝对地址:走到这里 markdownPath 已不含 host,只给路径
230639
+ // 调用方没法直接抓。
230640
+ const pageUrl = `https://${exports.DOCS_BASE_HOST}${markdownPath.replace(/\.md(?=#|$)/i, "")}`;
230296
230641
  throw new Error((0, index_js_1.t)("rag.readDocNotMarkdown", {
230297
230642
  docPath: markdownPath,
230298
- pageUrl: markdownPath.replace(/\.md(?=#|$)/i, ""),
230643
+ pageUrl,
230299
230644
  }));
230300
230645
  }
230301
230646
  return (0, json_content_js_1.jsonContent)(buildDocsEnvelope(resolvedAction, { docPath: resolvedDocPath, markdownPath, content: markdown }, (0, index_js_1.t)("rag.readDocSuccess")));
@@ -233689,7 +234034,7 @@ class TelemetryReporter {
233689
234034
  const arch = os_1.default.arch(); // 系统架构
233690
234035
  // Build-time injected version; guard for vitest / non-webpack runtimes.
233691
234036
  const mcpVersion = process.env.npm_package_version ||
233692
- ( true ? "2.34.5" : 0);
234037
+ ( true ? "2.34.6" : 0);
233693
234038
  return {
233694
234039
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
233695
234040
  deviceId: this.deviceId,
@@ -234412,7 +234757,7 @@ ${envIdSection}
234412
234757
  ## 环境信息
234413
234758
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
234414
234759
  - Node.js版本: ${process.version}
234415
- - MCP 版本:${( true ? "2.34.5" : 0) || 0 || 0}
234760
+ - MCP 版本:${( true ? "2.34.6" : 0) || 0 || 0}
234416
234761
  - 系统架构: ${os_1.default.arch()}
234417
234762
  - 时间: ${new Date().toISOString()}
234418
234763
  - 请求ID: ${requestId}
@@ -234501,7 +234846,7 @@ function createWrappedHandler(name, handler, server) {
234501
234846
  requestId,
234502
234847
  ide: server.ide || process.env.INTEGRATION_IDE || ''
234503
234848
  });
234504
- const mcpVersion = true ? "2.34.5" : 0;
234849
+ const mcpVersion = true ? "2.34.6" : 0;
234505
234850
  const requestIdSuffix = requestId ? `\n🆔 RequestId: ${requestId}` : '';
234506
234851
  const enhancedErrorMessage = `${errorMessage}${requestIdSuffix}\n\n📦 CloudBase MCP v${mcpVersion}\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${issueLink}`;
234507
234852
  // 创建新的错误对象,保持原有的错误类型但更新消息