@m14i/sith 1.14.1 → 1.16.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/dist/commands/docker.d.ts.map +1 -1
- package/dist/commands/nix.d.ts +7 -0
- package/dist/commands/nix.d.ts.map +1 -0
- package/dist/commands/skills.d.ts +2 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/components/TerminalUI.d.ts.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +593 -33
- package/dist/package.json +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/skills.d.ts +7 -0
- package/dist/utils/skills.d.ts.map +1 -0
- package/dist/utils/slashCommands.d.ts +1 -1
- package/dist/utils/slashCommands.d.ts.map +1 -1
- package/docker/Dockerfile +3 -14
- package/docker/nix/nix-scripts/02-env-vars.sh +0 -1
- package/docker/nix/nix-scripts/03-directories.sh +2 -0
- package/docker/nix/nix-scripts/06-skills-setup.sh +21 -70
- package/docker/nix/nix-scripts/setup.sh +1 -1
- package/package.json +1 -1
- package/docker/skills/opencode-skills-config.json +0 -62
- package/docker/skills/rtk-config.toml +0 -48
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@m14i/sith","version":"1.
|
|
1
|
+
{"name":"@m14i/sith","version":"1.16.0","description":"Turn your context to the dark side. Standardize and share your OpenCode setup with a fully dockerized environment, designed for seamless collaboration and CI integration.","type":"module","repository":{"type":"git","url":"https://github.com/MerzoukeMansouri/sith.git"},"bin":{"sith":"./dist/index.js"},"scripts":{"build":"ncc build src/index.ts -o dist && rm -rf dist/assets && cp -r assets dist/","dev":"tsx src/index.ts","dev:build":"pnpm build && node dist/index.js","dev:shell":"pnpm build && node dist/index.js shell","typecheck":"tsc --noEmit","clean":"rm -rf dist","prepublishOnly":"pnpm build"},"files":["dist","assets","docker"],"keywords":["opencode","docker","ci","automation","cli","nix"],"author":"","license":"MIT","dependencies":{"@inquirer/prompts":"^5.0.0","chalk":"^5.3.0","commander":"^12.1.0","execa":"^9.0.0","ink":"^7.0.3","ink-text-input":"^6.0.0","react":"^19.2.6","update-notifier":"^7.3.1"},"devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@types/node":"^20.12.7","@types/react":"^19.2.14","@types/update-notifier":"^6.0.8","@vercel/ncc":"^0.38.1","semantic-release":"^24.2.0","tsx":"^4.7.2","typescript":"^5.4.5"},"engines":{"node":">=18"}}
|
package/dist/types.d.ts
CHANGED
|
@@ -10,3 +10,14 @@ export interface DockerCommandOptions {
|
|
|
10
10
|
build?: boolean;
|
|
11
11
|
pull?: boolean;
|
|
12
12
|
}
|
|
13
|
+
export interface NixCommandOptions {
|
|
14
|
+
install?: boolean;
|
|
15
|
+
shell?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface SkillEntry {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
source?: string;
|
|
21
|
+
homepage: string;
|
|
22
|
+
builtinInstructions?: string;
|
|
23
|
+
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
|
|
1
|
+
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SkillEntry } from "../types.js";
|
|
2
|
+
export declare function getSkillsDir(): string;
|
|
3
|
+
export declare function getOpenCodeConfigPath(): string;
|
|
4
|
+
export declare function isInstalled(name: string): boolean;
|
|
5
|
+
export declare function installSkill(skill: SkillEntry): Promise<void>;
|
|
6
|
+
export declare function uninstallSkill(name: string): void;
|
|
7
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/utils/skills.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAc9C,wBAAgB,YAAY,IAAI,MAAM,CAIrC;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAW9C;AAsCD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA6CnE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAMjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommands.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/utils/slashCommands.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"slashCommands.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/utils/slashCommands.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAqBpE;AAED,wBAAgB,oBAAoB,IAAI,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAOtF"}
|
package/docker/Dockerfile
CHANGED
|
@@ -15,10 +15,6 @@ RUN echo "sandbox = false" >> /etc/nix/nix.conf && \
|
|
|
15
15
|
echo "filter-syscalls = false" >> /etc/nix/nix.conf && \
|
|
16
16
|
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
|
17
17
|
|
|
18
|
-
# Copier les fichiers de configuration des skills
|
|
19
|
-
COPY docker/skills/rtk-config.toml /opt/sith/skills/rtk-config.toml
|
|
20
|
-
COPY docker/skills/opencode-skills-config.json /opt/sith/skills/opencode-skills-config.json
|
|
21
|
-
|
|
22
18
|
# Copier les assets (logo, etc.)
|
|
23
19
|
COPY assets/ /opt/sith/assets/
|
|
24
20
|
|
|
@@ -87,16 +83,9 @@ ENV PATH="/root/.opencode/bin:/root/.local/bin:/root/.npm-global/bin:${PATH}"
|
|
|
87
83
|
ENV NPM_CONFIG_PREFIX=/root/.npm-global
|
|
88
84
|
ENV HOME=/root
|
|
89
85
|
|
|
90
|
-
# ===
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
ENV RTK_ENABLED=false
|
|
94
|
-
|
|
95
|
-
# Caveman - Compression de langage en mode ultra (75%+ de réduction)
|
|
96
|
-
ENV CAVEMAN_MODE=ultra
|
|
97
|
-
ENV CAVEMAN_AUTO=true
|
|
98
|
-
|
|
99
|
-
# Réduction totale estimée: 85-95% de tokens par session CI/CD
|
|
86
|
+
# === Skills Configuration ===
|
|
87
|
+
# Skills loaded at runtime via volume mount:
|
|
88
|
+
# docker run -v ~/.sith/skills:/root/.opencode/skills ...
|
|
100
89
|
|
|
101
90
|
# Note: Keep running as root due to Nix permission requirements
|
|
102
91
|
# Nix-shell needs to modify /nix/var/nix/profiles/per-user at runtime
|
|
@@ -8,7 +8,6 @@ export NODE_ENV="${NODE_ENV:-production}"
|
|
|
8
8
|
# Chemins personnalisés
|
|
9
9
|
export PATH="/root/.opencode/bin:$PATH"
|
|
10
10
|
export PATH="/root/.local/bin:$PATH"
|
|
11
|
-
export PATH="/root/.agents/skills/rtk/bin:$PATH"
|
|
12
11
|
export PATH="/root/.npm-global/bin:$PATH"
|
|
13
12
|
|
|
14
13
|
# Configuration npm
|
|
@@ -1,77 +1,28 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
cp /opt/sith/skills/rtk-config.toml /root/.agents/skills/rtk/config/config.toml
|
|
16
|
-
mkdir -p /root/.config/rtk
|
|
17
|
-
ln -sf /root/.agents/skills/rtk/config/config.toml /root/.config/rtk/config.toml
|
|
18
|
-
fi
|
|
19
|
-
|
|
20
|
-
if command -v rtk &> /dev/null; then
|
|
21
|
-
RTK_VERSION=$(rtk --version 2>&1 | head -n1 | awk '{print $2}' || echo "unknown")
|
|
22
|
-
INSTALLED_SKILLS+=("RTK|$RTK_VERSION|https://github.com/rust-token-killer/rtk")
|
|
23
|
-
|
|
24
|
-
if [ -f /root/.bashrc ] && ! grep -q "rtk hook" /root/.bashrc; then
|
|
25
|
-
echo 'eval "$(rtk hook bash)"' >> /root/.bashrc
|
|
26
|
-
fi
|
|
27
|
-
eval "$(rtk hook bash)" 2>/dev/null || true
|
|
28
|
-
fi
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
# 2. Caveman (mode ultra)
|
|
32
|
-
if [ "${CAVEMAN_AUTO:-true}" = "true" ]; then
|
|
33
|
-
mkdir -p /root/.agents/skills
|
|
34
|
-
|
|
35
|
-
if [ ! -d /opt/sith/skills/caveman ]; then
|
|
36
|
-
mkdir -p /opt/sith/skills
|
|
37
|
-
cd /opt/sith/skills
|
|
38
|
-
curl -fsSL https://github.com/JuliusBrussee/caveman/archive/refs/heads/main.zip -o caveman.zip 2>/dev/null
|
|
39
|
-
unzip -q caveman.zip 2>/dev/null
|
|
40
|
-
mv caveman-main caveman 2>/dev/null
|
|
41
|
-
rm caveman.zip 2>/dev/null
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
if [ -d /opt/sith/skills/caveman ]; then
|
|
45
|
-
cp -r /opt/sith/skills/caveman /root/.agents/skills/caveman
|
|
46
|
-
|
|
47
|
-
cat > /root/.agents/skills/caveman/.config << 'EOF'
|
|
48
|
-
mode=ultra
|
|
49
|
-
auto_activate=true
|
|
50
|
-
EOF
|
|
51
|
-
|
|
52
|
-
CAVEMAN_VERSION=$(grep -oP '(?<=version: ).*' /root/.agents/skills/caveman/skill.json 2>/dev/null || echo "main")
|
|
53
|
-
INSTALLED_SKILLS+=("Caveman|$CAVEMAN_VERSION|https://github.com/JuliusBrussee/caveman")
|
|
54
|
-
fi
|
|
55
|
-
fi
|
|
56
|
-
|
|
57
|
-
# 3. Configuration OpenCode skills
|
|
58
|
-
if [ -f /opt/sith/skills/opencode-skills-config.json ]; then
|
|
59
|
-
mkdir -p /root/.local/share/opencode/skills
|
|
60
|
-
cp /opt/sith/skills/opencode-skills-config.json /root/.local/share/opencode/skills/config.json
|
|
2
|
+
# Display active skills mounted via volume at /root/.opencode/skills/
|
|
3
|
+
|
|
4
|
+
SKILLS_DIR="/root/.opencode/skills"
|
|
5
|
+
declare -a ACTIVE_SKILLS=()
|
|
6
|
+
|
|
7
|
+
if [ -d "$SKILLS_DIR" ]; then
|
|
8
|
+
for skill_dir in "$SKILLS_DIR"/*/; do
|
|
9
|
+
[ -d "$skill_dir" ] || continue
|
|
10
|
+
[ -f "$skill_dir/skill.json" ] || continue
|
|
11
|
+
skill_name=$(basename "$skill_dir")
|
|
12
|
+
version=$(grep -o '"version":"[^"]*"' "$skill_dir/skill.json" | cut -d'"' -f4 || echo "local")
|
|
13
|
+
ACTIVE_SKILLS+=("$skill_name|$version")
|
|
14
|
+
done
|
|
61
15
|
fi
|
|
62
16
|
|
|
63
|
-
|
|
64
|
-
if [ ${#INSTALLED_SKILLS[@]} -gt 0 ]; then
|
|
17
|
+
if [ ${#ACTIVE_SKILLS[@]} -gt 0 ]; then
|
|
65
18
|
echo ""
|
|
66
|
-
echo "
|
|
67
|
-
echo "│ Skill │ Version │
|
|
68
|
-
echo "
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
printf "│ %-15s │ %-8s │ %-39s │\n" "$name" "$version" "$github"
|
|
19
|
+
echo "┌─────────────────┬──────────┐"
|
|
20
|
+
echo "│ Skill │ Version │"
|
|
21
|
+
echo "├─────────────────┼──────────┤"
|
|
22
|
+
for skill_info in "${ACTIVE_SKILLS[@]}"; do
|
|
23
|
+
IFS='|' read -r name version <<< "$skill_info"
|
|
24
|
+
printf "│ %-15s │ %-8s │\n" "$name" "$version"
|
|
73
25
|
done
|
|
74
|
-
|
|
75
|
-
echo "└─────────────────┴──────────┴─────────────────────────────────────────┘"
|
|
26
|
+
echo "└─────────────────┴──────────┘"
|
|
76
27
|
echo ""
|
|
77
28
|
fi
|
|
@@ -22,7 +22,7 @@ source "${SCRIPT_DIR}/04-git-config.sh"
|
|
|
22
22
|
# 5. OpenCode CLI installation
|
|
23
23
|
source "${SCRIPT_DIR}/05-opencode-cli.sh"
|
|
24
24
|
|
|
25
|
-
# 6. Skills installation (
|
|
25
|
+
# 6. Skills installation (from volume mount)
|
|
26
26
|
source "${SCRIPT_DIR}/06-skills-setup.sh"
|
|
27
27
|
|
|
28
28
|
# 7. Ready message
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m14i/sith",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "Turn your context to the dark side. Standardize and share your OpenCode setup with a fully dockerized environment, designed for seamless collaboration and CI integration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.2.0",
|
|
3
|
-
"description": "OpenCode Docker token optimization skills configuration",
|
|
4
|
-
"skills": [
|
|
5
|
-
{
|
|
6
|
-
"name": "caveman",
|
|
7
|
-
"enabled": true,
|
|
8
|
-
"mode": "ultra",
|
|
9
|
-
"auto_trigger": true,
|
|
10
|
-
"source": "https://github.com/JuliusBrussee/caveman",
|
|
11
|
-
"description": "Ultra-compressed communication mode - reduces response tokens by ~75%",
|
|
12
|
-
"features": [
|
|
13
|
-
"Caveman-style language compression",
|
|
14
|
-
"Maintains technical accuracy",
|
|
15
|
-
"Auto-activated for all responses",
|
|
16
|
-
"Mode: ultra (maximum compression)"
|
|
17
|
-
],
|
|
18
|
-
"estimated_reduction": "75%"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "rtk",
|
|
22
|
-
"enabled": true,
|
|
23
|
-
"auto_hook": true,
|
|
24
|
-
"source": "https://github.com/rtk-ai/rtk",
|
|
25
|
-
"description": "CLI proxy for command output optimization - reduces command output by 60-90%",
|
|
26
|
-
"features": [
|
|
27
|
-
"Automatic command interception via bash hook",
|
|
28
|
-
"Filters: git, cargo, npm, docker, pytest, jest",
|
|
29
|
-
"Saves full output on failures",
|
|
30
|
-
"Configurable exclusions"
|
|
31
|
-
],
|
|
32
|
-
"estimated_reduction": "60-90%",
|
|
33
|
-
"supported_commands": [
|
|
34
|
-
"git status",
|
|
35
|
-
"git log",
|
|
36
|
-
"git diff",
|
|
37
|
-
"cargo build",
|
|
38
|
-
"cargo test",
|
|
39
|
-
"npm test",
|
|
40
|
-
"npm run",
|
|
41
|
-
"docker ps",
|
|
42
|
-
"docker logs",
|
|
43
|
-
"pytest",
|
|
44
|
-
"jest"
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"combined_effect": {
|
|
49
|
-
"total_reduction": "85-95%",
|
|
50
|
-
"estimated_savings_per_session": "$6-8 (GPT-4 pricing)",
|
|
51
|
-
"best_for": "CI/CD environments with high command frequency"
|
|
52
|
-
},
|
|
53
|
-
"configuration": {
|
|
54
|
-
"rtk_config_path": "/root/.config/rtk/config.toml",
|
|
55
|
-
"caveman_path": "/root/.agents/skills/caveman",
|
|
56
|
-
"environment_variables": {
|
|
57
|
-
"CAVEMAN_MODE": "ultra",
|
|
58
|
-
"CAVEMAN_AUTO": "true",
|
|
59
|
-
"RTK_ENABLED": "true"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# RTK (Rust Token Killer) Configuration
|
|
2
|
-
# Optimizes CLI output for LLM consumption - reduces tokens by 60-90%
|
|
3
|
-
# Used in OpenCode Docker for CI/CD token optimization
|
|
4
|
-
|
|
5
|
-
[hooks]
|
|
6
|
-
# Commands to exclude from RTK interception
|
|
7
|
-
# These commands shouldn't be filtered as they return critical raw data
|
|
8
|
-
exclude_commands = ["curl", "wget", "docker logs", "cat"]
|
|
9
|
-
|
|
10
|
-
[tee]
|
|
11
|
-
# Save full command output to disk when commands fail
|
|
12
|
-
# Useful for debugging while still getting compact output by default
|
|
13
|
-
enabled = true
|
|
14
|
-
mode = "failures" # Options: "failures", "always", "never"
|
|
15
|
-
|
|
16
|
-
[filters]
|
|
17
|
-
# Enable built-in filters for common dev tools
|
|
18
|
-
# Each filter reduces verbose output to essential information only
|
|
19
|
-
|
|
20
|
-
[filters.git]
|
|
21
|
-
enabled = true
|
|
22
|
-
level = "compact" # Options: "compact", "minimal", "full"
|
|
23
|
-
|
|
24
|
-
[filters.cargo]
|
|
25
|
-
enabled = true
|
|
26
|
-
level = "compact"
|
|
27
|
-
|
|
28
|
-
[filters.npm]
|
|
29
|
-
enabled = true
|
|
30
|
-
level = "compact"
|
|
31
|
-
|
|
32
|
-
[filters.docker]
|
|
33
|
-
enabled = true
|
|
34
|
-
level = "compact"
|
|
35
|
-
|
|
36
|
-
[filters.pytest]
|
|
37
|
-
enabled = true
|
|
38
|
-
level = "compact"
|
|
39
|
-
|
|
40
|
-
[filters.jest]
|
|
41
|
-
enabled = true
|
|
42
|
-
level = "compact"
|
|
43
|
-
|
|
44
|
-
# General output limits
|
|
45
|
-
[output]
|
|
46
|
-
max_lines = 500 # Maximum lines per command output
|
|
47
|
-
truncate_long_lines = true
|
|
48
|
-
max_line_length = 200 # Truncate lines longer than this
|