@yyy9527/openclaw-manager 0.1.0
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/.env.example +37 -0
- package/README.md +195 -0
- package/config/agents.yaml +22 -0
- package/config/channels.yaml +14 -0
- package/config/clawhub-skills.txt +6 -0
- package/config/model-env-templates/README.md +25 -0
- package/config/model-env-templates/dev.env.example +10 -0
- package/config/model-env-templates/master.env.example +10 -0
- package/config/model-env-templates/test.env.example +10 -0
- package/config/openclaw.env +20 -0
- package/config/openclaw.env.example +49 -0
- package/config/versions.lock +9 -0
- package/docker-compose.yml +24 -0
- package/package.json +47 -0
- package/scripts/apply_config.sh +33 -0
- package/scripts/bootstrap_models.sh +133 -0
- package/scripts/check_env.sh +55 -0
- package/scripts/health_check.sh +108 -0
- package/scripts/install_openclaw.sh +119 -0
- package/scripts/openclaw_ctl.sh +323 -0
- package/scripts/set_qwen_vendor_model.sh +142 -0
- package/scripts/setup_env.sh +156 -0
- package/scripts/skills_sync.sh +154 -0
- package/scripts/sync_model_configs.sh +217 -0
- package/src/integrations/feishu/notifier.js +46 -0
- package/src/orchestrator/index.js +30 -0
- package/src/tui/index.js +74 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
|
|
3
|
+
function sign(timestamp, secret) {
|
|
4
|
+
const stringToSign = `${timestamp}\n${secret}`;
|
|
5
|
+
return crypto.createHmac("sha256", stringToSign).digest("base64");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function sendFeishuMessage({
|
|
9
|
+
webhookUrl,
|
|
10
|
+
secret = "",
|
|
11
|
+
title = "OpenClaw 通知",
|
|
12
|
+
text = ""
|
|
13
|
+
}) {
|
|
14
|
+
if (!webhookUrl) {
|
|
15
|
+
return { ok: false, reason: "FEISHU_WEBHOOK_URL 未配置" };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const timestamp = Math.floor(Date.now() / 1000).toString();
|
|
19
|
+
const payload = {
|
|
20
|
+
msg_type: "post",
|
|
21
|
+
content: {
|
|
22
|
+
post: {
|
|
23
|
+
zh_cn: {
|
|
24
|
+
title,
|
|
25
|
+
content: [[{ tag: "text", text }]]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
if (secret) {
|
|
32
|
+
payload.timestamp = timestamp;
|
|
33
|
+
payload.sign = sign(timestamp, secret);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const res = await fetch(webhookUrl, {
|
|
37
|
+
method: "POST",
|
|
38
|
+
headers: { "Content-Type": "application/json" },
|
|
39
|
+
body: JSON.stringify(payload)
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (!res.ok) {
|
|
43
|
+
return { ok: false, reason: `HTTP ${res.status}` };
|
|
44
|
+
}
|
|
45
|
+
return { ok: true };
|
|
46
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
const root = process.cwd();
|
|
5
|
+
const milestoneDir = path.join(root, "docs", "milestones");
|
|
6
|
+
|
|
7
|
+
function now() {
|
|
8
|
+
return new Date().toISOString();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function recordMilestone({ id, title, content }) {
|
|
12
|
+
fs.mkdirSync(milestoneDir, { recursive: true });
|
|
13
|
+
const file = path.join(milestoneDir, `${id}.md`);
|
|
14
|
+
const markdown = [
|
|
15
|
+
`# 里程碑 ${id} - ${title}`,
|
|
16
|
+
"",
|
|
17
|
+
`- 记录时间: ${now()}`,
|
|
18
|
+
"",
|
|
19
|
+
"## 内容",
|
|
20
|
+
content,
|
|
21
|
+
"",
|
|
22
|
+
"## 建议提交信息(中文)",
|
|
23
|
+
`feat(${id}): ${title}`,
|
|
24
|
+
"",
|
|
25
|
+
"## 自测状态",
|
|
26
|
+
"- [ ] 已完成"
|
|
27
|
+
].join("\n");
|
|
28
|
+
fs.writeFileSync(file, markdown, "utf8");
|
|
29
|
+
return file;
|
|
30
|
+
}
|
package/src/tui/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import readline from "node:readline";
|
|
2
|
+
import { execSync } from "node:child_process";
|
|
3
|
+
import { recordMilestone } from "../orchestrator/index.js";
|
|
4
|
+
|
|
5
|
+
const selectedClaw = process.argv[2] || "";
|
|
6
|
+
|
|
7
|
+
const rl = readline.createInterface({
|
|
8
|
+
input: process.stdin,
|
|
9
|
+
output: process.stdout
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
function run(cmd) {
|
|
13
|
+
try {
|
|
14
|
+
const output = execSync(cmd, { stdio: "pipe" }).toString();
|
|
15
|
+
console.log(output || "[完成]");
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error(`[失败] ${cmd}`);
|
|
18
|
+
if (error.stdout) console.error(error.stdout.toString());
|
|
19
|
+
if (error.stderr) console.error(error.stderr.toString());
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function menu() {
|
|
24
|
+
const title = selectedClaw ? `OpenClaw TUI (${selectedClaw})` : "OpenClaw TUI";
|
|
25
|
+
console.log(`\n=== ${title} ===`);
|
|
26
|
+
console.log("1) 查看状态");
|
|
27
|
+
console.log("2) 启动");
|
|
28
|
+
console.log("3) 停止");
|
|
29
|
+
console.log("4) 记录里程碑模板");
|
|
30
|
+
console.log("0) 退出");
|
|
31
|
+
|
|
32
|
+
rl.question("请选择操作: ", (answer) => {
|
|
33
|
+
switch (answer.trim()) {
|
|
34
|
+
case "1":
|
|
35
|
+
run(
|
|
36
|
+
selectedClaw
|
|
37
|
+
? `bash ./scripts/openclaw_ctl.sh status-claw ${selectedClaw}`
|
|
38
|
+
: "bash ./scripts/openclaw_ctl.sh status"
|
|
39
|
+
);
|
|
40
|
+
return menu();
|
|
41
|
+
case "2":
|
|
42
|
+
run(
|
|
43
|
+
selectedClaw
|
|
44
|
+
? `bash ./scripts/openclaw_ctl.sh start-claw ${selectedClaw}`
|
|
45
|
+
: "bash ./scripts/openclaw_ctl.sh start"
|
|
46
|
+
);
|
|
47
|
+
return menu();
|
|
48
|
+
case "3":
|
|
49
|
+
run(
|
|
50
|
+
selectedClaw
|
|
51
|
+
? `bash ./scripts/openclaw_ctl.sh stop-claw ${selectedClaw}`
|
|
52
|
+
: "bash ./scripts/openclaw_ctl.sh stop"
|
|
53
|
+
);
|
|
54
|
+
return menu();
|
|
55
|
+
case "4": {
|
|
56
|
+
const file = recordMilestone({
|
|
57
|
+
id: new Date().toISOString().slice(0, 10).replace(/-/g, ""),
|
|
58
|
+
title: "里程碑记录",
|
|
59
|
+
content: "- 在此填写本阶段实现内容、问题和解决路径。"
|
|
60
|
+
});
|
|
61
|
+
console.log(`已生成: ${file}`);
|
|
62
|
+
return menu();
|
|
63
|
+
}
|
|
64
|
+
case "0":
|
|
65
|
+
rl.close();
|
|
66
|
+
return;
|
|
67
|
+
default:
|
|
68
|
+
console.log("无效选项,请重试。");
|
|
69
|
+
return menu();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
menu();
|