@accio-ai/cli 0.1.34 → 0.1.36
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 +1 -1
- package/install.js +0 -85
- package/package.json +7 -8
- package/assets/workctl-skills.zip +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# Work Agent CLI npm Package
|
|
2
2
|
|
|
3
|
-
This package installs the `workctl` executable
|
|
3
|
+
This package installs the `workctl` executable. It does not create, update, or remove Agent skill directories during npm install or upgrade.
|
package/install.js
CHANGED
|
@@ -2,77 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
"use strict";
|
|
4
4
|
|
|
5
|
-
const childProcess = require("child_process");
|
|
6
5
|
const fs = require("fs");
|
|
7
6
|
const os = require("os");
|
|
8
7
|
const path = require("path");
|
|
9
8
|
|
|
10
|
-
const AGENT_DIRS = [
|
|
11
|
-
".agents/skills",
|
|
12
|
-
".claude/skills",
|
|
13
|
-
".cursor/skills",
|
|
14
|
-
".codex/skills",
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
function ensureDir(dir) {
|
|
18
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function run(command, args) {
|
|
22
|
-
childProcess.execFileSync(command, args, { stdio: "inherit" });
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function ensureCleanDir(dir) {
|
|
26
|
-
fs.rmSync(dir, { recursive: true, force: true });
|
|
27
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function copyChildren(srcDir, destDir) {
|
|
31
|
-
ensureDir(destDir);
|
|
32
|
-
for (const entry of fs.readdirSync(srcDir)) {
|
|
33
|
-
fs.cpSync(path.join(srcDir, entry), path.join(destDir, entry), { recursive: true, force: true });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function tryRun(command, args) {
|
|
38
|
-
try {
|
|
39
|
-
childProcess.execFileSync(command, args, { stdio: "pipe" });
|
|
40
|
-
return true;
|
|
41
|
-
} catch {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function extractSkills(zipPath, destDir) {
|
|
47
|
-
ensureCleanDir(destDir);
|
|
48
|
-
if (process.platform === "win32") {
|
|
49
|
-
// tar.exe is built into Windows 10 1803+ and is more reliable than PowerShell
|
|
50
|
-
if (tryRun("tar.exe", ["-xf", zipPath, "-C", destDir])) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
// Re-clean in case tar left partial files
|
|
54
|
-
ensureCleanDir(destDir);
|
|
55
|
-
// Fallback to PowerShell if tar is unavailable
|
|
56
|
-
run("powershell.exe", [
|
|
57
|
-
"-NoLogo",
|
|
58
|
-
"-NoProfile",
|
|
59
|
-
"-Command",
|
|
60
|
-
`Expand-Archive -Path '${zipPath.replace(/'/g, "''")}' -DestinationPath '${destDir.replace(/'/g, "''")}' -Force`,
|
|
61
|
-
]);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
run("unzip", ["-q", zipPath, "-d", destDir]);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function installSkillsToHomes(skillRoot) {
|
|
68
|
-
const homeDir = process.env.HOME || process.env.USERPROFILE;
|
|
69
|
-
if (!homeDir) return;
|
|
70
|
-
|
|
71
|
-
AGENT_DIRS.forEach((agentDir) => {
|
|
72
|
-
copyChildren(skillRoot, path.join(homeDir, agentDir, "workctl"));
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
9
|
function clearWorkctlCache(configDir) {
|
|
77
10
|
const cacheDir = path.join(configDir, "cache");
|
|
78
11
|
if (fs.existsSync(cacheDir)) {
|
|
@@ -82,9 +15,6 @@ function clearWorkctlCache(configDir) {
|
|
|
82
15
|
}
|
|
83
16
|
|
|
84
17
|
function main() {
|
|
85
|
-
const packageRoot = __dirname;
|
|
86
|
-
const assetsDir = path.join(packageRoot, "assets");
|
|
87
|
-
const skillDir = path.join(packageRoot, "share", "skills", "workctl");
|
|
88
18
|
const homeDir = process.env.HOME || process.env.USERPROFILE || os.homedir();
|
|
89
19
|
const configDir = process.env.WORKCTL_CONFIG_DIR || path.join(homeDir, ".workctl");
|
|
90
20
|
|
|
@@ -92,21 +22,6 @@ function main() {
|
|
|
92
22
|
throw new Error("home directory not available for installation");
|
|
93
23
|
}
|
|
94
24
|
|
|
95
|
-
const skillsPath = path.join(assetsDir, "workctl-skills.zip");
|
|
96
|
-
if (!fs.existsSync(skillsPath)) {
|
|
97
|
-
console.warn("warning: skills archive not found, skipping skills installation");
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
extractSkills(skillsPath, skillDir);
|
|
103
|
-
installSkillsToHomes(skillDir);
|
|
104
|
-
} catch (e) {
|
|
105
|
-
console.warn(`warning: skills installation failed (${e.message || e}), skipping`);
|
|
106
|
-
console.warn(" The CLI binary is still usable without skills.");
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// 清除缓存,确保用户立即看到最新命令
|
|
110
25
|
clearWorkctlCache(configDir);
|
|
111
26
|
|
|
112
27
|
console.log("\n✓ Installation complete!");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accio-ai/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.36",
|
|
4
4
|
"description": "Work Agent CLI - AI-native command line interface",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -18,18 +18,17 @@
|
|
|
18
18
|
"postinstall": "node install.js"
|
|
19
19
|
},
|
|
20
20
|
"optionalDependencies": {
|
|
21
|
-
"@accio-ai/cli-darwin-arm64": "0.1.
|
|
22
|
-
"@accio-ai/cli-darwin-x64": "0.1.
|
|
23
|
-
"@accio-ai/cli-linux-arm64": "0.1.
|
|
24
|
-
"@accio-ai/cli-linux-x64": "0.1.
|
|
25
|
-
"@accio-ai/cli-win32-arm64": "0.1.
|
|
26
|
-
"@accio-ai/cli-win32-x64": "0.1.
|
|
21
|
+
"@accio-ai/cli-darwin-arm64": "0.1.36",
|
|
22
|
+
"@accio-ai/cli-darwin-x64": "0.1.36",
|
|
23
|
+
"@accio-ai/cli-linux-arm64": "0.1.36",
|
|
24
|
+
"@accio-ai/cli-linux-x64": "0.1.36",
|
|
25
|
+
"@accio-ai/cli-win32-arm64": "0.1.36",
|
|
26
|
+
"@accio-ai/cli-win32-x64": "0.1.36"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"registry": "https://registry.npmjs.org"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
|
-
"assets",
|
|
33
32
|
"bin",
|
|
34
33
|
"install.js",
|
|
35
34
|
"README.md"
|
|
Binary file
|