zhitalk 0.0.3 → 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.
Files changed (2) hide show
  1. package/dist/install.js +18 -9
  2. package/package.json +1 -1
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
- run(`curl -fsSL -o "${tarPath}" "https://github.com/${repo}/archive/refs/heads/main.tar.gz"`);
57
- run(`tar -xzf "${tarPath}" -C "${extractDir}"`);
58
- const subDir = fs.readdirSync(extractDir)[0];
59
- fs.cpSync(path.join(extractDir, subDir, skillPath), targetDir, {
60
- recursive: true,
61
- });
62
- console.log(` ✅ ${name} 安装完成`);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zhitalk",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "A personal AI Agent like OpenClaw, including tools, skills, memory, hook, sub-agent, MCP server, etc. Run in the terminal.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",