@alaarab/cortex 1.15.2 → 1.15.3
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/mcp/dist/shell-input.js +5 -1
- package/mcp/dist/shell-view.js +1 -0
- package/mcp/dist/shell.js +21 -0
- package/package.json +1 -1
package/mcp/dist/shell-input.js
CHANGED
|
@@ -758,7 +758,11 @@ export async function doViewAction(host, key) {
|
|
|
758
758
|
});
|
|
759
759
|
}
|
|
760
760
|
else if (key === "a") {
|
|
761
|
-
|
|
761
|
+
if (!project) {
|
|
762
|
+
host.setMessage("Select a project first.");
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
host.startInput("skill-add", "");
|
|
762
766
|
}
|
|
763
767
|
break;
|
|
764
768
|
case "Hooks":
|
package/mcp/dist/shell-view.js
CHANGED
|
@@ -48,6 +48,7 @@ export function renderBottomBar(state, navMode, inputCtx, inputBuf) {
|
|
|
48
48
|
command: "cmd",
|
|
49
49
|
add: "add task",
|
|
50
50
|
"learn-add": "add finding",
|
|
51
|
+
"skill-add": "new skill name",
|
|
51
52
|
"mq-edit": "edit Memory Queue item",
|
|
52
53
|
};
|
|
53
54
|
const label = labels[inputCtx] || inputCtx;
|
package/mcp/dist/shell.js
CHANGED
|
@@ -140,6 +140,27 @@ export class CortexShell {
|
|
|
140
140
|
this.setMessage(` ${resultMsg(addFinding(this.cortexPath, p, buf))}`);
|
|
141
141
|
break;
|
|
142
142
|
}
|
|
143
|
+
case "skill-add": {
|
|
144
|
+
const p = this.ensureProjectSelected();
|
|
145
|
+
if (!p)
|
|
146
|
+
return;
|
|
147
|
+
const name = buf.trim().replace(/\.md$/i, "").replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
148
|
+
if (!name) {
|
|
149
|
+
this.setMessage(" No name entered.");
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const destDir = path.join(this.cortexPath, p, "skills");
|
|
153
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
154
|
+
const dest = path.join(destDir, `${name}.md`);
|
|
155
|
+
if (fs.existsSync(dest)) {
|
|
156
|
+
this.setMessage(` Skill "${name}" already exists.`);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const template = `# ${name}\n\nDescribe what this skill does.\n\n## Usage\n\n\`\`\`\nExample usage here\n\`\`\`\n`;
|
|
160
|
+
fs.writeFileSync(dest, template, "utf8");
|
|
161
|
+
this.setMessage(` Created skill "${name}" — edit ${dest}`);
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
143
164
|
case "mq-edit": {
|
|
144
165
|
const p = this.ensureProjectSelected();
|
|
145
166
|
if (!p)
|