secondbrainos-mcp-server 1.5.3 → 1.5.4
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/build/index.js +13 -7
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -15,6 +15,12 @@ function toSnakeCase(str) {
|
|
|
15
15
|
.replace(/[^a-z0-9]+/g, '_')
|
|
16
16
|
.replace(/^_+|_+$/g, '');
|
|
17
17
|
}
|
|
18
|
+
function toKebabCase(str) {
|
|
19
|
+
return str
|
|
20
|
+
.toLowerCase()
|
|
21
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
22
|
+
.replace(/^-+|-+$/g, '');
|
|
23
|
+
}
|
|
18
24
|
class SecondBrainOSServer {
|
|
19
25
|
constructor(initialSchema) {
|
|
20
26
|
this.originalSpec = initialSchema;
|
|
@@ -605,7 +611,7 @@ class SecondBrainOSServer {
|
|
|
605
611
|
}
|
|
606
612
|
catch { /* skip if unavailable */ }
|
|
607
613
|
const serverUseContent = `---
|
|
608
|
-
name:
|
|
614
|
+
name: server-use
|
|
609
615
|
description: Second Brain OS server context — terminology, architecture, and available agents/skills index
|
|
610
616
|
user-invocable: false
|
|
611
617
|
---
|
|
@@ -627,7 +633,7 @@ An agent definition combines:
|
|
|
627
633
|
This means you can spin up sub-agents from an agent's skill definitions (see \`~/.claude/skills/secondbrainos/tabs/\`).
|
|
628
634
|
|
|
629
635
|
## Accessing Agents & Skills
|
|
630
|
-
- Skill files live at \`~/.claude/skills/secondbrainos/\` (tabs/, workflows/,
|
|
636
|
+
- Skill files live at \`~/.claude/skills/secondbrainos/\` (tabs/, workflows/, knowledge-bases/)
|
|
631
637
|
- All skill files are set to \`user-invocable: false\` to avoid duplicating slash commands already available via MCP prompts
|
|
632
638
|
- **Users** invoke agents or skills via slash commands (e.g. \`/secondbrainos:agent_...\` or \`/secondbrainos:skill_...\`)
|
|
633
639
|
- **Users** cannot invoke MCP tools directly via slash commands — they must ask you to load and call the relevant tool
|
|
@@ -647,7 +653,7 @@ ${skillIndex || '_None configured_'}
|
|
|
647
653
|
for (const agent of agents) {
|
|
648
654
|
if (!agent.name || !agent.id)
|
|
649
655
|
continue;
|
|
650
|
-
const folderName =
|
|
656
|
+
const folderName = toKebabCase(agent.name);
|
|
651
657
|
const agentDocument = {
|
|
652
658
|
agent_id: agent.id,
|
|
653
659
|
name: agent.name,
|
|
@@ -666,7 +672,7 @@ ${skillIndex || '_None configured_'}
|
|
|
666
672
|
}))
|
|
667
673
|
}))
|
|
668
674
|
};
|
|
669
|
-
writeSkill(path.join(skillsBase, 'tabs', folderName), `---\nname:
|
|
675
|
+
writeSkill(path.join(skillsBase, 'tabs', folderName), `---\nname: ${folderName}\ndescription: "${agent.description || agent.name}"\nuser-invocable: false\n---\n\n${JSON.stringify(agentDocument, null, 2)}\n`);
|
|
670
676
|
}
|
|
671
677
|
}
|
|
672
678
|
catch (error) {
|
|
@@ -678,14 +684,14 @@ ${skillIndex || '_None configured_'}
|
|
|
678
684
|
try {
|
|
679
685
|
const workflows = await this.fetchAndEnrichWorkflows();
|
|
680
686
|
for (const wf of workflows) {
|
|
681
|
-
const folderName =
|
|
687
|
+
const folderName = toKebabCase(wf.name);
|
|
682
688
|
const workflowDocument = {
|
|
683
689
|
skill_id: wf.workflow_id,
|
|
684
690
|
name: wf.name,
|
|
685
691
|
description: wf.description || '',
|
|
686
692
|
prompts: wf.prompts
|
|
687
693
|
};
|
|
688
|
-
writeSkill(path.join(skillsBase, 'workflows', folderName), `---\nname:
|
|
694
|
+
writeSkill(path.join(skillsBase, 'workflows', folderName), `---\nname: ${folderName}\ndescription: "${wf.description || wf.name}"\nuser-invocable: false\n---\n\n${JSON.stringify(workflowDocument, null, 2)}\n`);
|
|
689
695
|
}
|
|
690
696
|
}
|
|
691
697
|
catch (error) {
|
|
@@ -701,7 +707,7 @@ ${skillIndex || '_None configured_'}
|
|
|
701
707
|
.filter((id) => id && id.length > 0);
|
|
702
708
|
if (collectionIds.length > 0) {
|
|
703
709
|
const kbDocument = { searchMyKnowledge_collection_ids: collectionIds };
|
|
704
|
-
writeSkill(path.join(skillsBase, '
|
|
710
|
+
writeSkill(path.join(skillsBase, 'knowledge-bases'), `---\nname: knowledge-bases\ndescription: Knowledge base collection IDs available to agents\nuser-invocable: false\n---\n\n${JSON.stringify(kbDocument, null, 2)}\n`);
|
|
705
711
|
}
|
|
706
712
|
}
|
|
707
713
|
catch (error) {
|