clawminer-skill 1.1.2 → 1.2.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/SKILL.md +6 -1
- package/package.json +3 -2
- package/scripts/postinstall.js +40 -0
package/SKILL.md
CHANGED
|
@@ -19,7 +19,12 @@ description: 4小时生死战!MingXia ($MXIA) 专属自动 PoW 智能挖矿 Ag
|
|
|
19
19
|
npm install -g clawminer-skill
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
3.
|
|
22
|
+
3. **验证 OpenClaw 注册**(仅 AI Agent 需要):安装脚本会自动将 SKILL.md 复制到 `~/.openclaw/workspace/skills/mingxia/`。如果自动注册失败(权限问题等),你需要手动完成:
|
|
23
|
+
- 创建目录:`mkdir -p ~/.openclaw/workspace/skills/mingxia/`
|
|
24
|
+
- 从 npm 全局安装目录复制 SKILL.md:`cp $(npm prefix -g)/lib/node_modules/clawminer-skill/SKILL.md ~/.openclaw/workspace/skills/mingxia/SKILL.md`
|
|
25
|
+
- 重启 OpenClaw Gateway 使 Skill 生效
|
|
26
|
+
|
|
27
|
+
4. 安装完成后,直接运行疯狂挖矿模式:
|
|
23
28
|
|
|
24
29
|
```bash
|
|
25
30
|
clawminer-skill loop
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawminer-skill",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "MingXia ($MXIA) PoW Mining Skill — 4-Hour Death Match on BSC",
|
|
5
5
|
"main": "scripts/mine.js",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"mine": "node scripts/mine.js",
|
|
18
18
|
"status": "node scripts/mine.js --status",
|
|
19
19
|
"loop": "node scripts/mine.js --loop",
|
|
20
|
-
"faucet": "node scripts/mine.js --faucet"
|
|
20
|
+
"faucet": "node scripts/mine.js --faucet",
|
|
21
|
+
"postinstall": "node scripts/postinstall.js"
|
|
21
22
|
},
|
|
22
23
|
"keywords": [
|
|
23
24
|
"clawminer",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* postinstall.js — 安装后自动将 SKILL.md 复制到 OpenClaw workspace
|
|
5
|
+
*
|
|
6
|
+
* 检测 ~/.openclaw/workspace/skills/ 是否存在,
|
|
7
|
+
* 如果存在,自动创建 mingxia 目录并复制 SKILL.md。
|
|
8
|
+
* 如果不存在(用户没有 OpenClaw),静默跳过。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const os = require('os');
|
|
14
|
+
|
|
15
|
+
const SKILL_NAME = 'mingxia';
|
|
16
|
+
const SOURCE = path.join(__dirname, '..', 'SKILL.md');
|
|
17
|
+
|
|
18
|
+
// OpenClaw workspace skills 目录
|
|
19
|
+
const OPENCLAW_SKILLS = path.join(os.homedir(), '.openclaw', 'workspace', 'skills');
|
|
20
|
+
const DEST_DIR = path.join(OPENCLAW_SKILLS, SKILL_NAME);
|
|
21
|
+
const DEST_FILE = path.join(DEST_DIR, 'SKILL.md');
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
// 只在 OpenClaw 已安装时执行
|
|
25
|
+
if (!fs.existsSync(OPENCLAW_SKILLS)) {
|
|
26
|
+
// OpenClaw 不存在,静默退出
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 创建 skill 目录
|
|
31
|
+
fs.mkdirSync(DEST_DIR, { recursive: true });
|
|
32
|
+
|
|
33
|
+
// 复制 SKILL.md
|
|
34
|
+
fs.copyFileSync(SOURCE, DEST_FILE);
|
|
35
|
+
|
|
36
|
+
console.log(`🦞 MingXia Skill 已自动注册到 OpenClaw: ${DEST_DIR}`);
|
|
37
|
+
} catch (e) {
|
|
38
|
+
// 权限问题等,静默失败不影响安装
|
|
39
|
+
// 用户可以手动复制
|
|
40
|
+
}
|