clawcupid-agent 0.0.1 → 0.0.2
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/cli.js +13 -3
- package/package.json +3 -2
package/dist/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ import os from 'node:os';
|
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { ZipFile } from 'yazl';
|
|
8
|
+
import extract from 'extract-zip';
|
|
8
9
|
function usage() {
|
|
9
10
|
console.log('Usage: clawcupid-agent <install|pack> [--out <path>]');
|
|
10
11
|
process.exit(1);
|
|
@@ -17,6 +18,11 @@ async function ensureOpenclaw() {
|
|
|
17
18
|
throw new Error('openclaw CLI not found. Install OpenClaw first.');
|
|
18
19
|
}
|
|
19
20
|
}
|
|
21
|
+
async function skillsDir() {
|
|
22
|
+
// OpenClaw stores state under ~/.openclaw by default.
|
|
23
|
+
// Use ~/.openclaw/skills as the default local skill install location.
|
|
24
|
+
return path.join(os.homedir(), '.openclaw', 'skills');
|
|
25
|
+
}
|
|
20
26
|
async function addDir(zip, dir, prefix) {
|
|
21
27
|
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
22
28
|
for (const e of entries) {
|
|
@@ -69,10 +75,14 @@ async function main() {
|
|
|
69
75
|
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'clawcupid-agent-'));
|
|
70
76
|
const skillPath = path.join(tmp, 'clawcupid-agent.skill');
|
|
71
77
|
await packSkill(skillPath);
|
|
72
|
-
// Install into OpenClaw
|
|
73
|
-
|
|
78
|
+
// Install into OpenClaw by extracting the .skill (zip) into ~/.openclaw/skills
|
|
79
|
+
const dst = await skillsDir();
|
|
80
|
+
await fs.mkdir(dst, { recursive: true });
|
|
81
|
+
// Extract yields: <dst>/clawcupid-agent/*
|
|
82
|
+
await extract(skillPath, { dir: dst });
|
|
83
|
+
// Restart gateway so skill discovery refreshes
|
|
74
84
|
await execa('openclaw', ['gateway', 'restart'], { stdio: 'inherit' });
|
|
75
|
-
console.log('Installed clawcupid-agent skill.');
|
|
85
|
+
console.log('Installed clawcupid-agent skill to:', path.join(dst, 'clawcupid-agent'));
|
|
76
86
|
console.log('Next: in Telegram, say: clawcupid install');
|
|
77
87
|
return;
|
|
78
88
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawcupid-agent",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "ClawCupid agent skill installer for OpenClaw (
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "ClawCupid agent skill installer for OpenClaw (packs .skill and installs by extracting into the OpenClaw skills directory).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"clawcupid-agent": "dist/cli.js"
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"execa": "^9.6.0",
|
|
22
|
+
"extract-zip": "^2.0.1",
|
|
22
23
|
"yazl": "^3.3.1"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|