@m14i/sith 1.15.0 β 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/skills.d.ts.map +1 -1
- package/dist/components/TerminalUI.d.ts.map +1 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +151 -38
- package/dist/package.json +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/skills.d.ts +1 -0
- package/dist/utils/skills.d.ts.map +1 -1
- package/docker/Dockerfile +2 -4
- package/docker/nix/nix-scripts/02-env-vars.sh +0 -1
- package/docker/nix/nix-scripts/03-directories.sh +2 -1
- package/docker/nix/nix-scripts/06-skills-setup.sh +14 -20
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/commands/skills.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/commands/skills.tsx"],"names":[],"mappings":"AAoGA,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalUI.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/components/TerminalUI.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TerminalUI.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/components/TerminalUI.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAqKrD,wBAAgB,UAAU,IAAI,KAAK,CAAC,YAAY,CAuL/C;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export declare const DOCKER_CONFIG: {
|
|
|
6
6
|
readonly folderName: "docker";
|
|
7
7
|
readonly dockerfileName: "Dockerfile";
|
|
8
8
|
readonly workspaceMount: "/workspace";
|
|
9
|
-
readonly skillsMount: "/
|
|
9
|
+
readonly skillsMount: "/root/.opencode/skills";
|
|
10
|
+
readonly opencodeConfigMount: "/root/.config/opencode/opencode.json";
|
|
10
11
|
readonly shellEntrypoint: "/opt/sith/nix/shell.nix";
|
|
11
12
|
};
|
|
12
13
|
export declare const NIX_CONFIG: {
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,eAAO,MAAM,cAAc,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,eAAO,MAAM,cAAc,EAAE,UAAU,EA6CtC,CAAC;AAGF,eAAO,MAAM,aAAa;;;;;;;;;CAShB,CAAC;AAGX,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AAGX,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAGX,eAAO,MAAM,UAAU,mOAOb,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -43289,9 +43289,11 @@ async function buildDocker() {
|
|
|
43289
43289
|
}
|
|
43290
43290
|
}
|
|
43291
43291
|
async function runShell() {
|
|
43292
|
+
const skillsDir = (0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_7__/* .getSkillsDir */ .YJ)();
|
|
43293
|
+
const opencodeConfigPath = (0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_7__/* .getOpenCodeConfigPath */ .Jn)();
|
|
43292
43294
|
console.log("π Starting interactive shell...");
|
|
43293
43295
|
console.log(`Mounting workspace to ${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.workspaceMount}`);
|
|
43294
|
-
console.log(`Mounting skills from ${
|
|
43296
|
+
console.log(`Mounting skills from ${skillsDir} to ${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.skillsMount}`);
|
|
43295
43297
|
console.log('Press Ctrl+D or type "exit" to leave');
|
|
43296
43298
|
console.log();
|
|
43297
43299
|
// Try to get GitHub token from gh CLI if not in env
|
|
@@ -43312,7 +43314,9 @@ async function runShell() {
|
|
|
43312
43314
|
"-v",
|
|
43313
43315
|
`${process.cwd()}:${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.workspaceMount}`,
|
|
43314
43316
|
"-v",
|
|
43315
|
-
`${
|
|
43317
|
+
`${skillsDir}:${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.skillsMount}`,
|
|
43318
|
+
"-v",
|
|
43319
|
+
`${opencodeConfigPath}:${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.opencodeConfigMount}`,
|
|
43316
43320
|
"-e",
|
|
43317
43321
|
`GITHUB_TOKEN=${githubToken}`,
|
|
43318
43322
|
"--entrypoint",
|
|
@@ -43544,6 +43548,16 @@ ink__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await
|
|
|
43544
43548
|
|
|
43545
43549
|
|
|
43546
43550
|
|
|
43551
|
+
function statusIcon(row) {
|
|
43552
|
+
switch (row.status) {
|
|
43553
|
+
case "working":
|
|
43554
|
+
return "β³";
|
|
43555
|
+
case "error":
|
|
43556
|
+
return "β";
|
|
43557
|
+
default:
|
|
43558
|
+
return row.installed ? "β
" : "β";
|
|
43559
|
+
}
|
|
43560
|
+
}
|
|
43547
43561
|
function SkillsMenu() {
|
|
43548
43562
|
const { exit } = (0,ink__WEBPACK_IMPORTED_MODULE_1__/* .useApp */ .nm)();
|
|
43549
43563
|
const [selectedIndex, setSelectedIndex] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
|
|
@@ -43551,7 +43565,23 @@ function SkillsMenu() {
|
|
|
43551
43565
|
function setRow(index, patch) {
|
|
43552
43566
|
setRows((prev) => prev.map((r, i) => (i === index ? { ...r, ...patch } : r)));
|
|
43553
43567
|
}
|
|
43554
|
-
|
|
43568
|
+
async function toggleSkill(index, skill, installed) {
|
|
43569
|
+
setRow(index, { status: "working", message: installed ? "Uninstalling..." : "Downloading..." });
|
|
43570
|
+
try {
|
|
43571
|
+
if (installed) {
|
|
43572
|
+
(0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_3__/* .uninstallSkill */ .wW)(skill.name);
|
|
43573
|
+
setRow(index, { installed: false, status: "done", message: "Uninstalled" });
|
|
43574
|
+
}
|
|
43575
|
+
else {
|
|
43576
|
+
await (0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_3__/* .installSkill */ .rP)(skill);
|
|
43577
|
+
setRow(index, { installed: true, status: "done", message: "Installed" });
|
|
43578
|
+
}
|
|
43579
|
+
}
|
|
43580
|
+
catch (e) {
|
|
43581
|
+
setRow(index, { status: "error", message: e instanceof Error ? e.message : "Failed" });
|
|
43582
|
+
}
|
|
43583
|
+
}
|
|
43584
|
+
(0,ink__WEBPACK_IMPORTED_MODULE_1__/* .useInput */ .Ge)((input, key) => {
|
|
43555
43585
|
if (key.upArrow) {
|
|
43556
43586
|
setSelectedIndex((p) => (p > 0 ? p - 1 : _config_js__WEBPACK_IMPORTED_MODULE_2__/* .SKILLS_CATALOG */ .XI.length - 1));
|
|
43557
43587
|
return;
|
|
@@ -43561,33 +43591,13 @@ function SkillsMenu() {
|
|
|
43561
43591
|
return;
|
|
43562
43592
|
}
|
|
43563
43593
|
if (key.return) {
|
|
43564
|
-
const skill = _config_js__WEBPACK_IMPORTED_MODULE_2__/* .SKILLS_CATALOG */ .XI[selectedIndex];
|
|
43565
43594
|
const row = rows[selectedIndex];
|
|
43566
|
-
if (row.status
|
|
43567
|
-
|
|
43568
|
-
if (row.installed) {
|
|
43569
|
-
setRow(selectedIndex, { status: "working", message: "Uninstalling..." });
|
|
43570
|
-
try {
|
|
43571
|
-
(0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_3__/* .uninstallSkill */ .wW)(skill.name);
|
|
43572
|
-
setRow(selectedIndex, { installed: false, status: "done", message: "Uninstalled" });
|
|
43573
|
-
}
|
|
43574
|
-
catch (e) {
|
|
43575
|
-
setRow(selectedIndex, { status: "error", message: e instanceof Error ? e.message : "Failed" });
|
|
43576
|
-
}
|
|
43577
|
-
}
|
|
43578
|
-
else {
|
|
43579
|
-
setRow(selectedIndex, { status: "working", message: "Downloading..." });
|
|
43580
|
-
try {
|
|
43581
|
-
await (0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_3__/* .installSkill */ .rP)(skill);
|
|
43582
|
-
setRow(selectedIndex, { installed: true, status: "done", message: "Installed" });
|
|
43583
|
-
}
|
|
43584
|
-
catch (e) {
|
|
43585
|
-
setRow(selectedIndex, { status: "error", message: e instanceof Error ? e.message : "Failed" });
|
|
43586
|
-
}
|
|
43595
|
+
if (row.status !== "working") {
|
|
43596
|
+
void toggleSkill(selectedIndex, _config_js__WEBPACK_IMPORTED_MODULE_2__/* .SKILLS_CATALOG */ .XI[selectedIndex], row.installed);
|
|
43587
43597
|
}
|
|
43588
43598
|
return;
|
|
43589
43599
|
}
|
|
43590
|
-
if (
|
|
43600
|
+
if (input === "q" || key.escape) {
|
|
43591
43601
|
exit();
|
|
43592
43602
|
}
|
|
43593
43603
|
});
|
|
@@ -43598,13 +43608,10 @@ function SkillsMenu() {
|
|
|
43598
43608
|
_config_js__WEBPACK_IMPORTED_MODULE_2__/* .SKILLS_CATALOG */ .XI.map((skill, i) => {
|
|
43599
43609
|
const row = rows[i];
|
|
43600
43610
|
const isSelected = i === selectedIndex;
|
|
43601
|
-
const statusIcon = row.status === "working" ? "β³"
|
|
43602
|
-
: row.status === "error" ? "β"
|
|
43603
|
-
: row.installed ? "β
" : "β";
|
|
43604
43611
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { key: skill.name, marginY: 0 },
|
|
43605
43612
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Text */ .EY, { color: isSelected ? "cyan" : undefined },
|
|
43606
43613
|
isSelected ? "β― " : " ",
|
|
43607
|
-
statusIcon,
|
|
43614
|
+
statusIcon(row),
|
|
43608
43615
|
" ",
|
|
43609
43616
|
skill.name.padEnd(12)),
|
|
43610
43617
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Text */ .EY, { dimColor: !isSelected }, skill.description),
|
|
@@ -43870,6 +43877,8 @@ function buildDockerShellCommand(githubToken) {
|
|
|
43870
43877
|
`${process.cwd()}:${_config_js__WEBPACK_IMPORTED_MODULE_4__/* .DOCKER_CONFIG */ .e6.workspaceMount}`,
|
|
43871
43878
|
"-v",
|
|
43872
43879
|
`${(0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_5__/* .getSkillsDir */ .YJ)()}:${_config_js__WEBPACK_IMPORTED_MODULE_4__/* .DOCKER_CONFIG */ .e6.skillsMount}`,
|
|
43880
|
+
"-v",
|
|
43881
|
+
`${(0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_5__/* .getOpenCodeConfigPath */ .Jn)()}:${_config_js__WEBPACK_IMPORTED_MODULE_4__/* .DOCKER_CONFIG */ .e6.opencodeConfigMount}`,
|
|
43873
43882
|
"-e",
|
|
43874
43883
|
`GITHUB_TOKEN=${githubToken}`,
|
|
43875
43884
|
"--entrypoint",
|
|
@@ -43887,6 +43896,8 @@ function buildDockerOpencodeCommand(githubToken, prompt) {
|
|
|
43887
43896
|
`${process.cwd()}:${_config_js__WEBPACK_IMPORTED_MODULE_4__/* .DOCKER_CONFIG */ .e6.workspaceMount}`,
|
|
43888
43897
|
"-v",
|
|
43889
43898
|
`${(0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_5__/* .getSkillsDir */ .YJ)()}:${_config_js__WEBPACK_IMPORTED_MODULE_4__/* .DOCKER_CONFIG */ .e6.skillsMount}`,
|
|
43899
|
+
"-v",
|
|
43900
|
+
`${(0,_utils_skills_js__WEBPACK_IMPORTED_MODULE_5__/* .getOpenCodeConfigPath */ .Jn)()}:${_config_js__WEBPACK_IMPORTED_MODULE_4__/* .DOCKER_CONFIG */ .e6.opencodeConfigMount}`,
|
|
43890
43901
|
"-e",
|
|
43891
43902
|
`GITHUB_TOKEN=${githubToken}`,
|
|
43892
43903
|
"--entrypoint",
|
|
@@ -44060,8 +44071,46 @@ const SKILLS_CATALOG = [
|
|
|
44060
44071
|
{
|
|
44061
44072
|
name: "caveman",
|
|
44062
44073
|
description: "Ultra-compressed communication (~75% token reduction)",
|
|
44063
|
-
source: "https://github.com/JuliusBrussee/caveman/archive/refs/heads/main.zip",
|
|
44064
44074
|
homepage: "https://github.com/JuliusBrussee/caveman",
|
|
44075
|
+
builtinInstructions: `---
|
|
44076
|
+
name: caveman
|
|
44077
|
+
description: Ultra-compressed communication mode (ultra β MAX compression, always active).
|
|
44078
|
+
---
|
|
44079
|
+
|
|
44080
|
+
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
44081
|
+
|
|
44082
|
+
## Persistence
|
|
44083
|
+
|
|
44084
|
+
ACTIVE EVERY RESPONSE. No revert. Off only: "stop caveman" / "normal mode".
|
|
44085
|
+
|
|
44086
|
+
Level: **ultra** (fixed).
|
|
44087
|
+
|
|
44088
|
+
## Rules
|
|
44089
|
+
|
|
44090
|
+
Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries, hedging. Fragments OK. Short synonyms. Technical terms exact. Code blocks unchanged. Errors quoted exact.
|
|
44091
|
+
|
|
44092
|
+
Pattern: \`[thing] [action] [reason]. [next step].\`
|
|
44093
|
+
|
|
44094
|
+
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
|
|
44095
|
+
Yes: "Bug in auth middleware. Token expiry check use \`<\` not \`<=\`. Fix:"
|
|
44096
|
+
|
|
44097
|
+
## Ultra intensity
|
|
44098
|
+
|
|
44099
|
+
Abbreviate prose (DB/auth/config/req/res/fn/impl), strip conjunctions, arrows for causality (X β Y), one word when one word enough. Code symbols/fn names/API names/error strings: never abbreviate.
|
|
44100
|
+
|
|
44101
|
+
Example β "Why React re-render?"
|
|
44102
|
+
ultra: "Inline obj prop β new ref β re-render. \`useMemo\`."
|
|
44103
|
+
|
|
44104
|
+
Example β "Explain DB connection pooling."
|
|
44105
|
+
ultra: "Pool = reuse DB conn. Skip handshake β fast under load."
|
|
44106
|
+
|
|
44107
|
+
## Auto-Clarity
|
|
44108
|
+
|
|
44109
|
+
Drop for: security warnings, irreversible ops, steps where order risks misread. Resume after.
|
|
44110
|
+
|
|
44111
|
+
## Boundaries
|
|
44112
|
+
|
|
44113
|
+
Code/commits/PRs: write normal. "stop caveman" or "normal mode": revert.`,
|
|
44065
44114
|
},
|
|
44066
44115
|
];
|
|
44067
44116
|
// Docker configuration
|
|
@@ -44071,7 +44120,8 @@ const DOCKER_CONFIG = {
|
|
|
44071
44120
|
folderName: "docker",
|
|
44072
44121
|
dockerfileName: "Dockerfile",
|
|
44073
44122
|
workspaceMount: "/workspace",
|
|
44074
|
-
skillsMount: "/
|
|
44123
|
+
skillsMount: "/root/.opencode/skills",
|
|
44124
|
+
opencodeConfigMount: "/root/.config/opencode/opencode.json",
|
|
44075
44125
|
shellEntrypoint: "/opt/sith/nix/shell.nix",
|
|
44076
44126
|
};
|
|
44077
44127
|
// Nix configuration
|
|
@@ -44243,6 +44293,7 @@ __webpack_async_result__();
|
|
|
44243
44293
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
|
44244
44294
|
|
|
44245
44295
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
44296
|
+
/* harmony export */ Jn: () => (/* binding */ getOpenCodeConfigPath),
|
|
44246
44297
|
/* harmony export */ YJ: () => (/* binding */ getSkillsDir),
|
|
44247
44298
|
/* harmony export */ j$: () => (/* binding */ isInstalled),
|
|
44248
44299
|
/* harmony export */ rP: () => (/* binding */ installSkill),
|
|
@@ -44254,28 +44305,86 @@ __webpack_async_result__();
|
|
|
44254
44305
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nccwpck_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
|
44255
44306
|
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(857);
|
|
44256
44307
|
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nccwpck_require__.n(os__WEBPACK_IMPORTED_MODULE_2__);
|
|
44257
|
-
/* harmony import */ var
|
|
44308
|
+
/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(6181);
|
|
44309
|
+
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(6878);
|
|
44310
|
+
|
|
44258
44311
|
|
|
44259
44312
|
|
|
44260
44313
|
|
|
44261
44314
|
|
|
44315
|
+
const OPENCODE_SCHEMA = "https://opencode.ai/config.json";
|
|
44316
|
+
function defaultConfig() {
|
|
44317
|
+
return { $schema: OPENCODE_SCHEMA, instructions: [] };
|
|
44318
|
+
}
|
|
44262
44319
|
function getSkillsDir() {
|
|
44263
44320
|
const dir = path__WEBPACK_IMPORTED_MODULE_1___default().join(os__WEBPACK_IMPORTED_MODULE_2___default().homedir(), ".sith", "skills");
|
|
44264
44321
|
fs__WEBPACK_IMPORTED_MODULE_0___default().mkdirSync(dir, { recursive: true });
|
|
44265
44322
|
return dir;
|
|
44266
44323
|
}
|
|
44324
|
+
function getOpenCodeConfigPath() {
|
|
44325
|
+
const configPath = path__WEBPACK_IMPORTED_MODULE_1___default().join(os__WEBPACK_IMPORTED_MODULE_2___default().homedir(), ".sith", "opencode.json");
|
|
44326
|
+
// Docker bind-mount creates a directory if the source doesn't exist; ensure it's a file.
|
|
44327
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(configPath) && fs__WEBPACK_IMPORTED_MODULE_0___default().statSync(configPath).isDirectory()) {
|
|
44328
|
+
fs__WEBPACK_IMPORTED_MODULE_0___default().rmSync(configPath, { recursive: true, force: true });
|
|
44329
|
+
}
|
|
44330
|
+
if (!fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(configPath)) {
|
|
44331
|
+
fs__WEBPACK_IMPORTED_MODULE_0___default().mkdirSync(path__WEBPACK_IMPORTED_MODULE_1___default().dirname(configPath), { recursive: true });
|
|
44332
|
+
fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(configPath, JSON.stringify(defaultConfig(), null, 2));
|
|
44333
|
+
}
|
|
44334
|
+
return configPath;
|
|
44335
|
+
}
|
|
44336
|
+
function readConfig() {
|
|
44337
|
+
const parsed = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_0___default().readFileSync(getOpenCodeConfigPath(), "utf8"));
|
|
44338
|
+
if (!Array.isArray(parsed.instructions))
|
|
44339
|
+
parsed.instructions = [];
|
|
44340
|
+
return parsed;
|
|
44341
|
+
}
|
|
44342
|
+
function writeConfig(config) {
|
|
44343
|
+
fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(getOpenCodeConfigPath(), JSON.stringify(config, null, 2));
|
|
44344
|
+
}
|
|
44345
|
+
function addInstruction(containerPath) {
|
|
44346
|
+
const config = readConfig();
|
|
44347
|
+
if (!config.instructions.includes(containerPath)) {
|
|
44348
|
+
config.instructions.push(containerPath);
|
|
44349
|
+
writeConfig(config);
|
|
44350
|
+
}
|
|
44351
|
+
}
|
|
44352
|
+
function removeInstructionsUnder(skillContainerDir) {
|
|
44353
|
+
const config = readConfig();
|
|
44354
|
+
config.instructions = config.instructions.filter((p) => !p.startsWith(skillContainerDir));
|
|
44355
|
+
writeConfig(config);
|
|
44356
|
+
}
|
|
44357
|
+
function findInstructionsFile(skillDir) {
|
|
44358
|
+
const skillName = path__WEBPACK_IMPORTED_MODULE_1___default().basename(skillDir);
|
|
44359
|
+
const candidates = [
|
|
44360
|
+
"SKILL.md",
|
|
44361
|
+
"CAVEMAN.md",
|
|
44362
|
+
"instructions.md",
|
|
44363
|
+
path__WEBPACK_IMPORTED_MODULE_1___default().join("skills", skillName, "SKILL.md"),
|
|
44364
|
+
"AGENTS.md",
|
|
44365
|
+
];
|
|
44366
|
+
return candidates.find((name) => fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(path__WEBPACK_IMPORTED_MODULE_1___default().join(skillDir, name))) ?? null;
|
|
44367
|
+
}
|
|
44267
44368
|
function isInstalled(name) {
|
|
44268
|
-
|
|
44269
|
-
return fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(skillJson);
|
|
44369
|
+
return fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(path__WEBPACK_IMPORTED_MODULE_1___default().join(getSkillsDir(), name, "skill.json"));
|
|
44270
44370
|
}
|
|
44271
44371
|
async function installSkill(skill) {
|
|
44272
44372
|
const targetDir = path__WEBPACK_IMPORTED_MODULE_1___default().join(getSkillsDir(), skill.name);
|
|
44373
|
+
if (skill.builtinInstructions) {
|
|
44374
|
+
fs__WEBPACK_IMPORTED_MODULE_0___default().mkdirSync(targetDir, { recursive: true });
|
|
44375
|
+
fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(path__WEBPACK_IMPORTED_MODULE_1___default().join(targetDir, "SKILL.md"), skill.builtinInstructions);
|
|
44376
|
+
fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(path__WEBPACK_IMPORTED_MODULE_1___default().join(targetDir, "skill.json"), JSON.stringify({ name: skill.name, version: "builtin" }, null, 2));
|
|
44377
|
+
addInstruction(`${_config_js__WEBPACK_IMPORTED_MODULE_3__/* .DOCKER_CONFIG */ .e6.skillsMount}/${skill.name}/SKILL.md`);
|
|
44378
|
+
return;
|
|
44379
|
+
}
|
|
44380
|
+
if (!skill.source)
|
|
44381
|
+
throw new Error(`Skill "${skill.name}" has no source URL`);
|
|
44273
44382
|
const tmpZip = path__WEBPACK_IMPORTED_MODULE_1___default().join(os__WEBPACK_IMPORTED_MODULE_2___default().tmpdir(), `sith-skill-${skill.name}.zip`);
|
|
44274
44383
|
const tmpExtract = path__WEBPACK_IMPORTED_MODULE_1___default().join(os__WEBPACK_IMPORTED_MODULE_2___default().tmpdir(), `sith-skill-${skill.name}-extract`);
|
|
44275
44384
|
try {
|
|
44276
|
-
await (0,
|
|
44385
|
+
await (0,execa__WEBPACK_IMPORTED_MODULE_4__/* .execa */ .Ho)("curl", ["-fsSL", skill.source, "-o", tmpZip]);
|
|
44277
44386
|
fs__WEBPACK_IMPORTED_MODULE_0___default().mkdirSync(tmpExtract, { recursive: true });
|
|
44278
|
-
await (0,
|
|
44387
|
+
await (0,execa__WEBPACK_IMPORTED_MODULE_4__/* .execa */ .Ho)("unzip", ["-q", "-o", tmpZip, "-d", tmpExtract]);
|
|
44279
44388
|
const entries = fs__WEBPACK_IMPORTED_MODULE_0___default().readdirSync(tmpExtract);
|
|
44280
44389
|
if (entries.length === 0)
|
|
44281
44390
|
throw new Error("Empty archive");
|
|
@@ -44283,11 +44392,14 @@ async function installSkill(skill) {
|
|
|
44283
44392
|
if (fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(targetDir))
|
|
44284
44393
|
fs__WEBPACK_IMPORTED_MODULE_0___default().rmSync(targetDir, { recursive: true, force: true });
|
|
44285
44394
|
fs__WEBPACK_IMPORTED_MODULE_0___default().cpSync(extracted, targetDir, { recursive: true });
|
|
44286
|
-
// Ensure skill.json exists with at minimum a name field
|
|
44287
44395
|
const skillJson = path__WEBPACK_IMPORTED_MODULE_1___default().join(targetDir, "skill.json");
|
|
44288
44396
|
if (!fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(skillJson)) {
|
|
44289
44397
|
fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(skillJson, JSON.stringify({ name: skill.name, version: "local" }, null, 2));
|
|
44290
44398
|
}
|
|
44399
|
+
const instructionsFile = findInstructionsFile(targetDir);
|
|
44400
|
+
if (instructionsFile) {
|
|
44401
|
+
addInstruction(`${_config_js__WEBPACK_IMPORTED_MODULE_3__/* .DOCKER_CONFIG */ .e6.skillsMount}/${skill.name}/${instructionsFile}`);
|
|
44402
|
+
}
|
|
44291
44403
|
}
|
|
44292
44404
|
finally {
|
|
44293
44405
|
fs__WEBPACK_IMPORTED_MODULE_0___default().rmSync(tmpZip, { force: true });
|
|
@@ -44295,6 +44407,7 @@ async function installSkill(skill) {
|
|
|
44295
44407
|
}
|
|
44296
44408
|
}
|
|
44297
44409
|
function uninstallSkill(name) {
|
|
44410
|
+
removeInstructionsUnder(`${_config_js__WEBPACK_IMPORTED_MODULE_3__/* .DOCKER_CONFIG */ .e6.skillsMount}/${name}/`);
|
|
44298
44411
|
const targetDir = path__WEBPACK_IMPORTED_MODULE_1___default().join(getSkillsDir(), name);
|
|
44299
44412
|
if (fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(targetDir)) {
|
|
44300
44413
|
fs__WEBPACK_IMPORTED_MODULE_0___default().rmSync(targetDir, { recursive: true, force: true });
|
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
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;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,EAAE,MAAM,CAAC;
|
|
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"}
|
package/dist/utils/skills.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SkillEntry } from "../types.js";
|
|
2
2
|
export declare function getSkillsDir(): string;
|
|
3
|
+
export declare function getOpenCodeConfigPath(): string;
|
|
3
4
|
export declare function isInstalled(name: string): boolean;
|
|
4
5
|
export declare function installSkill(skill: SkillEntry): Promise<void>;
|
|
5
6
|
export declare function uninstallSkill(name: string): void;
|
|
@@ -1 +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;
|
|
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"}
|
package/docker/Dockerfile
CHANGED
|
@@ -84,10 +84,8 @@ ENV NPM_CONFIG_PREFIX=/root/.npm-global
|
|
|
84
84
|
ENV HOME=/root
|
|
85
85
|
|
|
86
86
|
# === Skills Configuration ===
|
|
87
|
-
# Skills
|
|
88
|
-
# docker run -v ~/.sith/skills:/
|
|
89
|
-
# Each skill must have a skill.json in its directory.
|
|
90
|
-
ENV SITH_EXTERNAL_SKILLS=/opt/sith/external-skills
|
|
87
|
+
# Skills loaded at runtime via volume mount:
|
|
88
|
+
# docker run -v ~/.sith/skills:/root/.opencode/skills ...
|
|
91
89
|
|
|
92
90
|
# Note: Keep running as root due to Nix permission requirements
|
|
93
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,34 +1,28 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
2
|
+
# Display active skills mounted via volume at /root/.opencode/skills/
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
declare -a
|
|
4
|
+
SKILLS_DIR="/root/.opencode/skills"
|
|
5
|
+
declare -a ACTIVE_SKILLS=()
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if [ -d "$EXTERNAL_SKILLS_DIR" ]; then
|
|
10
|
-
for skill_dir in "$EXTERNAL_SKILLS_DIR"/*/; do
|
|
7
|
+
if [ -d "$SKILLS_DIR" ]; then
|
|
8
|
+
for skill_dir in "$SKILLS_DIR"/*/; do
|
|
11
9
|
[ -d "$skill_dir" ] || continue
|
|
12
10
|
[ -f "$skill_dir/skill.json" ] || continue
|
|
13
11
|
skill_name=$(basename "$skill_dir")
|
|
14
|
-
cp -r "$skill_dir" "/root/.agents/skills/$skill_name"
|
|
15
|
-
if [ -f "/root/.agents/skills/$skill_name/skill.sh" ]; then
|
|
16
|
-
source "/root/.agents/skills/$skill_name/skill.sh" 2>/dev/null || true
|
|
17
|
-
fi
|
|
18
12
|
version=$(grep -o '"version":"[^"]*"' "$skill_dir/skill.json" | cut -d'"' -f4 || echo "local")
|
|
19
|
-
|
|
13
|
+
ACTIVE_SKILLS+=("$skill_name|$version")
|
|
20
14
|
done
|
|
21
15
|
fi
|
|
22
16
|
|
|
23
|
-
if [ ${#
|
|
17
|
+
if [ ${#ACTIVE_SKILLS[@]} -gt 0 ]; then
|
|
24
18
|
echo ""
|
|
25
|
-
echo "
|
|
26
|
-
echo "β Skill β Version β
|
|
27
|
-
echo "
|
|
28
|
-
for skill_info in "${
|
|
29
|
-
IFS='|' read -r name version
|
|
30
|
-
printf "β %-15s β %-8s
|
|
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"
|
|
31
25
|
done
|
|
32
|
-
echo "
|
|
26
|
+
echo "βββββββββββββββββββ΄βββββββββββ"
|
|
33
27
|
echo ""
|
|
34
28
|
fi
|
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": {
|