@ian2018cs/agenthub 0.1.12 → 0.1.13
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: html-deploy
|
|
3
|
-
description: 将 HTML 内容部署为可访问的网页。使用场景:(1) 用户要求将生成的 HTML/网页部署上线或发布,(2) 用户要求更新已部署的页面内容,(3) 用户提到"部署"、"发布"、"上线"HTML 页面,(
|
|
3
|
+
description: 将 HTML 内容部署为可访问的网页。使用场景:(1) 用户要求将生成的 HTML/网页部署上线或发布,(2) 用户要求更新已部署的页面内容,(3) 用户要求删除已部署的页面,(4) 用户提到"部署"、"发布"、"上线"HTML 页面,(5) 用户要求预览生成的网页效果。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# HTML Deploy
|
|
@@ -10,8 +10,8 @@ description: 将 HTML 内容部署为可访问的网页。使用场景:(1) 用
|
|
|
10
10
|
## 使用流程
|
|
11
11
|
|
|
12
12
|
1. 根据用户需求生成完整的 HTML 页面,写入文件
|
|
13
|
-
2.
|
|
14
|
-
3.
|
|
13
|
+
2. 调用脚本部署、更新或删除,传入相应参数
|
|
14
|
+
3. 将结果告知用户
|
|
15
15
|
|
|
16
16
|
### 部署新页面
|
|
17
17
|
|
|
@@ -28,3 +28,13 @@ python3 skills/html-deploy/scripts/update.py <page_id> <html_file>
|
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
page_id 不存在时会报 404 错误。
|
|
31
|
+
|
|
32
|
+
### 删除已有页面
|
|
33
|
+
|
|
34
|
+
从之前的部署 URL 中提取 page_id(UUID 部分):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python3 skills/html-deploy/scripts/delete.py <page_id>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
page_id 不存在时会报 404 错误。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""删除已部署的页面。
|
|
3
|
+
|
|
4
|
+
用法: delete.py <page_id>
|
|
5
|
+
输出: 删除结果
|
|
6
|
+
"""
|
|
7
|
+
import sys
|
|
8
|
+
import json
|
|
9
|
+
import urllib.request
|
|
10
|
+
|
|
11
|
+
API_BASE = "http://10.0.0.252:11004"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def main():
|
|
15
|
+
if len(sys.argv) != 2:
|
|
16
|
+
print(f"用法: {sys.argv[0]} <page_id>", file=sys.stderr)
|
|
17
|
+
sys.exit(1)
|
|
18
|
+
|
|
19
|
+
page_id = sys.argv[1]
|
|
20
|
+
req = urllib.request.Request(
|
|
21
|
+
f"{API_BASE}/deploy/{page_id}",
|
|
22
|
+
method="DELETE",
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
with urllib.request.urlopen(req) as resp:
|
|
26
|
+
result = json.loads(resp.read())
|
|
27
|
+
print(result["detail"])
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
if __name__ == "__main__":
|
|
31
|
+
main()
|