zhitalk 0.0.2 → 0.0.4
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/README.md +20 -2
- package/dist/install.js +18 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
A personal AI Agent like OpenClaw, including tools, skills, memory, hook, sub-agent, MCP sever, etc. Run in the terminal.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Docs https://zhitalk.chat/
|
|
8
|
+
|
|
9
|
+
Install
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install zhitalk -g
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Run in terminal
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
zhitalk
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Dev
|
|
22
|
+
|
|
23
|
+
### Tech
|
|
6
24
|
|
|
7
25
|
- runtime: nodejs
|
|
8
26
|
- language: typescript
|
|
@@ -11,7 +29,7 @@ A personal AI Agent like OpenClaw, including tools, skills, memory, hook, sub-ag
|
|
|
11
29
|
- CLI tool: commander.js
|
|
12
30
|
- database: sqlite
|
|
13
31
|
|
|
14
|
-
|
|
32
|
+
### Command
|
|
15
33
|
|
|
16
34
|
```bash
|
|
17
35
|
pnpm dev
|
package/dist/install.js
CHANGED
|
@@ -41,8 +41,8 @@ const child_process_1 = require("child_process");
|
|
|
41
41
|
const config_1 = require("./agent/config");
|
|
42
42
|
const db_1 = require("./agent/db");
|
|
43
43
|
const SKILLS_DIR = path.join(config_1.WORKSPACE_DIR, '.agents', 'skills');
|
|
44
|
-
function run(command) {
|
|
45
|
-
(0, child_process_1.execSync)(command, { stdio: 'inherit' });
|
|
44
|
+
function run(command, options) {
|
|
45
|
+
(0, child_process_1.execSync)(command, { stdio: 'inherit', ...options });
|
|
46
46
|
}
|
|
47
47
|
function installSkill(name, repo, skillPath, targetDir, tempDir) {
|
|
48
48
|
if (fs.existsSync(targetDir)) {
|
|
@@ -53,13 +53,22 @@ function installSkill(name, repo, skillPath, targetDir, tempDir) {
|
|
|
53
53
|
const tarPath = path.join(tempDir, `${name}.tar.gz`);
|
|
54
54
|
const extractDir = path.join(tempDir, `${name}-extract`);
|
|
55
55
|
fs.mkdirSync(extractDir, { recursive: true });
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
try {
|
|
57
|
+
run(`curl -fsSL -o "${tarPath}" "https://github.com/${repo}/archive/refs/heads/main.tar.gz"`, { timeout: 20000 });
|
|
58
|
+
run(`tar -xzf "${tarPath}" -C "${extractDir}"`, { timeout: 20000 });
|
|
59
|
+
const subDir = fs.readdirSync(extractDir)[0];
|
|
60
|
+
fs.cpSync(path.join(extractDir, subDir, skillPath), targetDir, {
|
|
61
|
+
recursive: true,
|
|
62
|
+
});
|
|
63
|
+
console.log(` ✅ ${name} 安装完成`);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (error.killed) {
|
|
67
|
+
console.log(` ⏱️ ${name} 安装超时(超过 20s),已跳过,继续下一步`);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
63
72
|
}
|
|
64
73
|
async function runInstall() {
|
|
65
74
|
console.log('🚀 欢迎使用 Zhitalk!首次使用需要进行初始化配置。\n');
|
package/package.json
CHANGED