skill-mix 0.1.0
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 +64 -0
- package/bin/skills +38 -0
- package/bin/skills-manager +42 -0
- package/dist/electron/main.js +11298 -0
- package/package.json +82 -0
- package/scripts/build-main.mjs +27 -0
- package/scripts/install.sh +195 -0
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skill-mix",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "dist/electron/main.js",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"skills": "bin/skills",
|
|
8
|
+
"skills-manager": "bin/skills-manager",
|
|
9
|
+
"skill-mix": "bin/skills-manager"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin/",
|
|
13
|
+
"scripts/"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "bun src/index.ts",
|
|
17
|
+
"setup": "bun install && bun src/index.ts --install",
|
|
18
|
+
"build": "cd src/renderer && bun x vite build",
|
|
19
|
+
"build:renderer:pack": "cd src/renderer && bun x vite build --outDir ../../dist/renderer/dist --emptyOutDir",
|
|
20
|
+
"build:main": "bun scripts/build-main.mjs",
|
|
21
|
+
"build:pack": "rm -rf dist/electron dist/renderer && bun run build:renderer:pack && bun run build:main",
|
|
22
|
+
"build:appdir": "rm -rf dist/package && mkdir -p dist/package/dist dist/package/dist/renderer && cp -R dist/electron dist/package/dist/electron && cp -R dist/renderer/dist dist/package/dist/renderer/dist && bun -e \"const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); const appPkg = { name: pkg.name, version: pkg.version, main: 'dist/electron/main.js', type: 'module', description: pkg.description || 'Skills Manager desktop app', author: pkg.author || 'Skills Manager' }; fs.writeFileSync('dist/package/package.json', JSON.stringify(appPkg, null, 2) + '\\n');\"",
|
|
23
|
+
"dist:dmg": "bun run build:pack && bun run build:appdir && CSC_IDENTITY_AUTO_DISCOVERY=false bun x electron-builder --mac dmg",
|
|
24
|
+
"dist:win": "bun run build:pack && bun run build:appdir && bun x electron-builder --win nsis zip --x64",
|
|
25
|
+
"electron": "bun run build && NODE_OPTIONS='--import tsx' electron src/electron/main.ts"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@tailwindcss/vite": "^4.2.0",
|
|
29
|
+
"@vitejs/plugin-vue": "^6.0.4",
|
|
30
|
+
"class-variance-authority": "^0.7.1",
|
|
31
|
+
"clsx": "^2.1.1",
|
|
32
|
+
"gray-matter": "^4.0.3",
|
|
33
|
+
"js-yaml": "^4.1.0",
|
|
34
|
+
"lucide-vue-next": "^0.575.0",
|
|
35
|
+
"radix-vue": "^1.9.17",
|
|
36
|
+
"tailwind-merge": "^3.5.0",
|
|
37
|
+
"tailwindcss": "^4.2.0",
|
|
38
|
+
"tiktoken": "^1.0.22",
|
|
39
|
+
"vue": "^3.5.28"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/js-yaml": "^4.0.9",
|
|
43
|
+
"bun-types": "^1.3.8",
|
|
44
|
+
"electron-builder": "^26.0.12",
|
|
45
|
+
"esbuild": "^0.27.0",
|
|
46
|
+
"electron": "^36.0.0",
|
|
47
|
+
"tsx": "^4.20.3",
|
|
48
|
+
"typescript": "^5.7.0",
|
|
49
|
+
"vite": "^7.3.1",
|
|
50
|
+
"vitest": "^4.0.18"
|
|
51
|
+
},
|
|
52
|
+
"build": {
|
|
53
|
+
"appId": "io.github.razbakov.skills-manager",
|
|
54
|
+
"productName": "Skills Manager",
|
|
55
|
+
"artifactName": "Skills.Manager-${version}-${arch}.${ext}",
|
|
56
|
+
"npmRebuild": false,
|
|
57
|
+
"directories": {
|
|
58
|
+
"app": "dist/package",
|
|
59
|
+
"output": "release"
|
|
60
|
+
},
|
|
61
|
+
"mac": {
|
|
62
|
+
"target": [
|
|
63
|
+
"dmg"
|
|
64
|
+
],
|
|
65
|
+
"category": "public.app-category.developer-tools"
|
|
66
|
+
},
|
|
67
|
+
"win": {
|
|
68
|
+
"target": [
|
|
69
|
+
"nsis",
|
|
70
|
+
"zip"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"nsis": {
|
|
74
|
+
"oneClick": false,
|
|
75
|
+
"allowToChangeInstallationDirectory": true
|
|
76
|
+
},
|
|
77
|
+
"files": [
|
|
78
|
+
"dist/**/*",
|
|
79
|
+
"package.json"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cpSync, mkdirSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { build } from "esbuild";
|
|
5
|
+
|
|
6
|
+
const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const outputDir = resolve(projectRoot, "dist", "electron");
|
|
8
|
+
|
|
9
|
+
mkdirSync(outputDir, { recursive: true });
|
|
10
|
+
|
|
11
|
+
await build({
|
|
12
|
+
entryPoints: [resolve(projectRoot, "src", "electron", "main.ts")],
|
|
13
|
+
bundle: true,
|
|
14
|
+
platform: "node",
|
|
15
|
+
format: "esm",
|
|
16
|
+
target: "node20",
|
|
17
|
+
external: ["electron"],
|
|
18
|
+
outfile: resolve(outputDir, "main.js"),
|
|
19
|
+
banner: {
|
|
20
|
+
js: "import { createRequire } from 'node:module';const require = createRequire(import.meta.url);",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
cpSync(
|
|
25
|
+
resolve(projectRoot, "src", "electron", "preload.cjs"),
|
|
26
|
+
resolve(outputDir, "preload.cjs"),
|
|
27
|
+
);
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_URL="${SKILLS_MANAGER_REPO_URL:-https://github.com/razbakov/skills-manager.git}"
|
|
5
|
+
INSTALL_DIR="${SKILLS_MANAGER_HOME:-$HOME/.local/opt/skills-manager}"
|
|
6
|
+
BRANCH="${SKILLS_MANAGER_BRANCH:-main}"
|
|
7
|
+
BUN_INSTALL_SCRIPT_URL="${SKILLS_MANAGER_BUN_INSTALL_SCRIPT_URL:-https://bun.sh/install}"
|
|
8
|
+
|
|
9
|
+
has_cmd() {
|
|
10
|
+
local cmd="$1"
|
|
11
|
+
command -v "$cmd" >/dev/null 2>&1
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
require_cmd() {
|
|
15
|
+
local cmd="$1"
|
|
16
|
+
if ! has_cmd "$cmd"; then
|
|
17
|
+
echo "Missing required command: $cmd" >&2
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
bun_root_dir() {
|
|
23
|
+
if [ -n "${BUN_INSTALL:-}" ]; then
|
|
24
|
+
printf "%s\n" "${BUN_INSTALL%/}"
|
|
25
|
+
return
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
printf "%s\n" "$HOME/.bun"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
bun_bin_dir() {
|
|
32
|
+
printf "%s/bin\n" "$(bun_root_dir)"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
global_bin_dir() {
|
|
36
|
+
if [ -n "${SKILLS_MANAGER_GLOBAL_BIN_DIR:-}" ]; then
|
|
37
|
+
printf "%s\n" "${SKILLS_MANAGER_GLOBAL_BIN_DIR%/}"
|
|
38
|
+
return
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
if [ -n "${BUN_INSTALL:-}" ]; then
|
|
42
|
+
printf "%s/bin\n" "${BUN_INSTALL%/}"
|
|
43
|
+
return
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
printf "%s\n" "$HOME/.bun/bin"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
resolve_bun_cmd() {
|
|
50
|
+
if has_cmd bun; then
|
|
51
|
+
command -v bun
|
|
52
|
+
return 0
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
local fallback_bun
|
|
56
|
+
fallback_bun="$(bun_bin_dir)/bun"
|
|
57
|
+
if [ -x "$fallback_bun" ]; then
|
|
58
|
+
printf "%s\n" "$fallback_bun"
|
|
59
|
+
return 0
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
return 1
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
show_path_instructions() {
|
|
66
|
+
local target_dir="$1"
|
|
67
|
+
local shell_name
|
|
68
|
+
shell_name="$(basename "${SHELL:-}")"
|
|
69
|
+
|
|
70
|
+
echo "Add it to PATH permanently:"
|
|
71
|
+
case "$shell_name" in
|
|
72
|
+
zsh)
|
|
73
|
+
echo " echo 'export PATH=\"$target_dir:\$PATH\"' >> \"$HOME/.zshrc\""
|
|
74
|
+
echo " source \"$HOME/.zshrc\""
|
|
75
|
+
;;
|
|
76
|
+
bash)
|
|
77
|
+
local rc_file="$HOME/.bashrc"
|
|
78
|
+
if [ ! -f "$rc_file" ] && [ -f "$HOME/.bash_profile" ]; then
|
|
79
|
+
rc_file="$HOME/.bash_profile"
|
|
80
|
+
fi
|
|
81
|
+
echo " echo 'export PATH=\"$target_dir:\$PATH\"' >> \"$rc_file\""
|
|
82
|
+
echo " source \"$rc_file\""
|
|
83
|
+
;;
|
|
84
|
+
fish)
|
|
85
|
+
echo " fish_add_path \"$target_dir\""
|
|
86
|
+
;;
|
|
87
|
+
*)
|
|
88
|
+
echo " export PATH=\"$target_dir:\$PATH\""
|
|
89
|
+
;;
|
|
90
|
+
esac
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
ensure_bun() {
|
|
94
|
+
if resolve_bun_cmd >/dev/null 2>&1; then
|
|
95
|
+
return
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
echo "Bun not found. Installing Bun..."
|
|
99
|
+
if has_cmd curl; then
|
|
100
|
+
curl -fsSL "$BUN_INSTALL_SCRIPT_URL" | bash
|
|
101
|
+
elif has_cmd wget; then
|
|
102
|
+
wget -qO- "$BUN_INSTALL_SCRIPT_URL" | bash
|
|
103
|
+
else
|
|
104
|
+
echo "Missing curl or wget. One of them is required to auto-install Bun." >&2
|
|
105
|
+
exit 1
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
if ! resolve_bun_cmd >/dev/null 2>&1; then
|
|
109
|
+
echo "Bun installation completed, but bun is still unavailable in this shell." >&2
|
|
110
|
+
show_path_instructions "$(bun_bin_dir)"
|
|
111
|
+
exit 1
|
|
112
|
+
fi
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
ensure_path_contains_dir() {
|
|
116
|
+
local target_dir="$1"
|
|
117
|
+
case ":$PATH:" in
|
|
118
|
+
*":$target_dir:"*) return ;;
|
|
119
|
+
esac
|
|
120
|
+
|
|
121
|
+
export PATH="$target_dir:$PATH"
|
|
122
|
+
echo "Added $target_dir to PATH for this install session."
|
|
123
|
+
show_path_instructions "$target_dir"
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
check_install_dir() {
|
|
127
|
+
local parent_dir
|
|
128
|
+
parent_dir="$(dirname "$INSTALL_DIR")"
|
|
129
|
+
|
|
130
|
+
mkdir -p "$parent_dir"
|
|
131
|
+
if [ ! -w "$parent_dir" ]; then
|
|
132
|
+
echo "Install parent directory is not writable: $parent_dir" >&2
|
|
133
|
+
exit 1
|
|
134
|
+
fi
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
require_cmd git
|
|
138
|
+
ensure_bun
|
|
139
|
+
check_install_dir
|
|
140
|
+
|
|
141
|
+
BUN_CMD="$(resolve_bun_cmd)"
|
|
142
|
+
ensure_path_contains_dir "$(dirname "$BUN_CMD")"
|
|
143
|
+
|
|
144
|
+
if [ -e "$INSTALL_DIR" ] && [ ! -d "$INSTALL_DIR/.git" ]; then
|
|
145
|
+
echo "Install path exists but is not a git checkout: $INSTALL_DIR" >&2
|
|
146
|
+
echo "Set SKILLS_MANAGER_HOME to another directory and retry." >&2
|
|
147
|
+
exit 1
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
if [ -d "$INSTALL_DIR/.git" ]; then
|
|
151
|
+
echo "Updating skills-manager in $INSTALL_DIR"
|
|
152
|
+
git -C "$INSTALL_DIR" fetch --depth 1 origin "$BRANCH"
|
|
153
|
+
if git -C "$INSTALL_DIR" show-ref --verify --quiet "refs/heads/$BRANCH"; then
|
|
154
|
+
git -C "$INSTALL_DIR" checkout "$BRANCH"
|
|
155
|
+
else
|
|
156
|
+
git -C "$INSTALL_DIR" checkout -b "$BRANCH" "origin/$BRANCH"
|
|
157
|
+
fi
|
|
158
|
+
git -C "$INSTALL_DIR" pull --ff-only origin "$BRANCH"
|
|
159
|
+
else
|
|
160
|
+
echo "Cloning skills-manager into $INSTALL_DIR"
|
|
161
|
+
git clone --depth 1 --branch "$BRANCH" "$REPO_URL" "$INSTALL_DIR"
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
echo "Installing dependencies and global command"
|
|
165
|
+
(
|
|
166
|
+
cd "$INSTALL_DIR"
|
|
167
|
+
"$BUN_CMD" install
|
|
168
|
+
"$BUN_CMD" run build
|
|
169
|
+
"$BUN_CMD" src/index.ts --install
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
SKILLS_BIN_DIR="$(global_bin_dir)"
|
|
173
|
+
SKILLS_CMD_PATH="$SKILLS_BIN_DIR/skills"
|
|
174
|
+
ensure_path_contains_dir "$SKILLS_BIN_DIR"
|
|
175
|
+
|
|
176
|
+
if has_cmd skills && [ "$(command -v skills)" = "$SKILLS_CMD_PATH" ]; then
|
|
177
|
+
echo "Setup complete. Run: skills"
|
|
178
|
+
exit 0
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
if [ -L "$SKILLS_CMD_PATH" ] || [ -x "$SKILLS_CMD_PATH" ]; then
|
|
182
|
+
if has_cmd skills; then
|
|
183
|
+
echo "Setup complete, but 'skills' on PATH points to $(command -v skills)."
|
|
184
|
+
echo "Your new install is at: $SKILLS_CMD_PATH"
|
|
185
|
+
else
|
|
186
|
+
echo "Setup complete, but 'skills' is not currently on your PATH."
|
|
187
|
+
fi
|
|
188
|
+
show_path_instructions "$SKILLS_BIN_DIR"
|
|
189
|
+
echo "You can run it now via: $SKILLS_CMD_PATH"
|
|
190
|
+
exit 0
|
|
191
|
+
fi
|
|
192
|
+
|
|
193
|
+
echo "Setup complete, but the global command could not be located at $SKILLS_CMD_PATH."
|
|
194
|
+
echo "Run this manually to inspect the install state:"
|
|
195
|
+
echo " \"$BUN_CMD\" \"$INSTALL_DIR/src/index.ts\" --install"
|