@cloudbase/cloudbase-mcp 1.0.5 → 1.0.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/tools/hosting.js +13 -1
- package/package.json +1 -1
package/dist/tools/hosting.js
CHANGED
|
@@ -24,11 +24,23 @@ export function registerHostingTools(server) {
|
|
|
24
24
|
files,
|
|
25
25
|
ignore
|
|
26
26
|
});
|
|
27
|
+
// 获取环境信息
|
|
28
|
+
const envInfo = await cloudbase.env.getEnvInfo();
|
|
29
|
+
// 获取静态网站地址
|
|
30
|
+
let staticDomain = "";
|
|
31
|
+
if (envInfo?.EnvInfo?.StaticStorages && envInfo.EnvInfo.StaticStorages.length > 0) {
|
|
32
|
+
staticDomain = envInfo.EnvInfo.StaticStorages[0].StaticDomain;
|
|
33
|
+
}
|
|
27
34
|
return {
|
|
28
35
|
content: [
|
|
29
36
|
{
|
|
30
37
|
type: "text",
|
|
31
|
-
text: JSON.stringify(
|
|
38
|
+
text: JSON.stringify({
|
|
39
|
+
uploadResult: result,
|
|
40
|
+
staticWebsiteUrl: staticDomain ? `https://${staticDomain}` : "",
|
|
41
|
+
// 返回文件的完整访问URL
|
|
42
|
+
fileUrl: staticDomain && cloudPath ? `https://${staticDomain}/${cloudPath}` : ""
|
|
43
|
+
}, null, 2)
|
|
32
44
|
}
|
|
33
45
|
]
|
|
34
46
|
};
|