@guandata/guanwf 0.1.3 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## @guandata/guanwf 0.1.4 - 2026-06-03
4
+
5
+ - `install-skill` 增加 WorkBuddy skill 安装路径支持。
6
+
3
7
  ## @guandata/guanwf 0.1.3 - 2026-05-28
4
8
 
5
9
  - 优化试用账号场景下的运行上下文识别,提升命令执行记录与问题排查的一致性。
package/README.md CHANGED
@@ -33,6 +33,10 @@ guanwf install-skill
33
33
 
34
34
  ## 版本更新
35
35
 
36
+ ### @guandata/guanwf 0.1.4
37
+
38
+ - `install-skill` 增加 WorkBuddy skill 安装路径支持。
39
+
36
40
  ### 0.1.3
37
41
 
38
42
  - 优化试用账号场景下的运行上下文识别,提升命令执行记录与问题排查的一致性。
package/bin/run.js CHANGED
@@ -5,6 +5,7 @@
5
5
  const { execFileSync, execSync, spawnSync } = require("child_process");
6
6
  const path = require("path");
7
7
  const fs = require("fs");
8
+ const os = require("os");
8
9
 
9
10
  const PLATFORM_MAP = {
10
11
  "darwin-arm64": "guanwf-darwin-arm64",
@@ -35,6 +36,38 @@ function getBinaryPath() {
35
36
  return binaryPath;
36
37
  }
37
38
 
39
+ function copyDirectory(src, dest) {
40
+ fs.mkdirSync(dest, { recursive: true });
41
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
42
+ const srcPath = path.join(src, entry.name);
43
+ const destPath = path.join(dest, entry.name);
44
+ if (entry.isDirectory()) {
45
+ copyDirectory(srcPath, destPath);
46
+ } else if (entry.isSymbolicLink()) {
47
+ fs.symlinkSync(fs.readlinkSync(srcPath), destPath);
48
+ } else {
49
+ fs.copyFileSync(srcPath, destPath);
50
+ }
51
+ }
52
+ }
53
+
54
+ function installCodeBuddySkill(pkgRoot, skill) {
55
+ try {
56
+ const srcDir = path.join(pkgRoot, "skills", skill);
57
+ if (!fs.existsSync(path.join(srcDir, "SKILL.md"))) {
58
+ console.warn(`Warning: skipping CodeBuddy/WorkBuddy install; skill not found: ${srcDir}`);
59
+ return;
60
+ }
61
+
62
+ const configDir = process.env.CODEBUDDY_CONFIG_DIR || path.join(os.homedir(), ".codebuddy");
63
+ const destDir = path.join(configDir, "skills", skill);
64
+ copyDirectory(srcDir, destDir);
65
+ console.log(`Installed ${skill} to CodeBuddy/WorkBuddy: ${destDir}`);
66
+ } catch (err) {
67
+ console.warn(`Warning: CodeBuddy/WorkBuddy install failed for ${skill}: ${err.message}`);
68
+ }
69
+ }
70
+
38
71
  if (process.argv[2] === "version" && process.argv.length === 3) {
39
72
  const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
40
73
  console.log(pkg.version);
@@ -57,7 +90,9 @@ if (process.argv[2] === "install-skill") {
57
90
  console.log("Installing guanwf to AI coding assistants...");
58
91
  const result = spawnSync("npx", args, { stdio: "inherit", env: process.env, shell: true });
59
92
  if (result.error) throw result.error;
60
- process.exit(result.status || 0);
93
+ const status = result.status || 0;
94
+ if (status === 0) installCodeBuddySkill(pkgRoot, "guanwf");
95
+ process.exit(status);
61
96
  }
62
97
 
63
98
  const binary = getBinaryPath();
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "@guandata/guanwf",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "观远工作流数据流编辑工具 - 创建、编辑、导出、预览、保存数据流",
5
5
  "bin": {
6
6
  "guanwf": "bin/run.js"
7
7
  },
8
+ "scripts": {
9
+ "build": "node scripts/build.js && node scripts/sync-skill.js",
10
+ "changelog": "node ../../scripts/generate-release-changelog.js .",
11
+ "check-changelog": "node ../../scripts/check-release-changelog.js .",
12
+ "prepublishOnly": "npm run check-changelog && npm run build && node scripts/preflight.js"
13
+ },
8
14
  "files": [
9
15
  "bin/",
10
16
  "binaries/",
@@ -29,6 +35,7 @@
29
35
  "node": ">=14"
30
36
  },
31
37
  "publishConfig": {
38
+ "registry": "https://registry.npmjs.org/",
32
39
  "access": "public"
33
40
  }
34
41
  }