@withpica/mcp-server-directory 1.2.0 → 1.4.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/CHANGELOG.md +28 -0
- package/dist/lib/changelog.d.ts +16 -0
- package/dist/lib/changelog.d.ts.map +1 -0
- package/dist/lib/changelog.generated.d.ts +4 -0
- package/dist/lib/changelog.generated.d.ts.map +1 -0
- package/dist/lib/changelog.generated.js +6 -0
- package/dist/lib/changelog.generated.js.map +1 -0
- package/dist/lib/changelog.js +84 -0
- package/dist/lib/changelog.js.map +1 -0
- package/dist/prompts/public-question-atlas.d.ts.map +1 -1
- package/dist/prompts/public-question-atlas.js +30 -0
- package/dist/prompts/public-question-atlas.js.map +1 -1
- package/dist/server.d.ts +20 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +129 -10
- package/dist/server.js.map +1 -1
- package/dist/skills/index.d.ts +32 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +50 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/skills.generated.d.ts +18 -0
- package/dist/skills/skills.generated.d.ts.map +1 -0
- package/dist/skills/skills.generated.js +14 -0
- package/dist/skills/skills.generated.js.map +1 -0
- package/dist/tools/__tests__/release-notes.test.d.ts +2 -0
- package/dist/tools/__tests__/release-notes.test.d.ts.map +1 -0
- package/dist/tools/__tests__/release-notes.test.js +49 -0
- package/dist/tools/__tests__/release-notes.test.js.map +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/release-notes.d.ts +22 -0
- package/dist/tools/release-notes.d.ts.map +1 -0
- package/dist/tools/release-notes.js +102 -0
- package/dist/tools/release-notes.js.map +1 -0
- package/dist/tools/skills.d.ts +19 -0
- package/dist/tools/skills.d.ts.map +1 -0
- package/dist/tools/skills.js +127 -0
- package/dist/tools/skills.js.map +1 -0
- package/package.json +4 -2
- package/scripts/build-changelog.ts +25 -0
- package/scripts/build-skills.ts +192 -0
- package/src/__tests__/skills/skills-registry.test.ts +63 -0
- package/src/__tests__/skills/skills-tools.test.ts +74 -0
- package/src/lib/changelog.ts +119 -0
- package/src/prompts/public-question-atlas.ts +36 -10
- package/src/server.ts +142 -11
- package/src/skills/find-music-for-sync-brief/SKILL.md +89 -0
- package/src/skills/index.ts +63 -0
- package/src/skills/skills.generated.ts +33 -0
- package/src/tools/__tests__/release-notes.test.ts +62 -0
- package/src/tools/index.ts +5 -0
- package/src/tools/release-notes.ts +148 -0
- package/src/tools/skills.ts +146 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Directory MCP skill tools — ADR-140 Phase 2b
|
|
5
|
+
*
|
|
6
|
+
* Sister of mcp-server/src/tools/skills.ts. Two meta-tools — list and get —
|
|
7
|
+
* named `directory_skill_*` to match the directory MCP's `directory_*` prefix
|
|
8
|
+
* convention. Same lazy-loading shape as the creator MCP variant.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { ToolDefinition, ToolExecutor, ToolResult } from "./index.js";
|
|
12
|
+
import { SkillsRegistry, SkillNotFoundError } from "../skills/index.js";
|
|
13
|
+
|
|
14
|
+
export class DirectorySkillsTools {
|
|
15
|
+
private registry: SkillsRegistry;
|
|
16
|
+
|
|
17
|
+
constructor() {
|
|
18
|
+
this.registry = new SkillsRegistry();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
getTools(): Array<{ definition: ToolDefinition; executor: ToolExecutor }> {
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
definition: {
|
|
25
|
+
name: "directory_skill_list",
|
|
26
|
+
tier: "read",
|
|
27
|
+
description:
|
|
28
|
+
"Use when the user asks: 'what skills do you have?', 'what can you do?', 'show me your methodologies', 'how do I find music here?'. " +
|
|
29
|
+
"Returns the list of downloadable directory skill methodologies — name, description, trigger phrases. " +
|
|
30
|
+
"Cheap to call. Use directory_skill_get(name) to load a specific skill's full methodology body.",
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {},
|
|
34
|
+
additionalProperties: false,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
executor: this.listSkills.bind(this),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
definition: {
|
|
41
|
+
name: "directory_skill_get",
|
|
42
|
+
tier: "read",
|
|
43
|
+
description:
|
|
44
|
+
"Use when the user asks: 'what skills do you have?', 'what can you do?', 'show me your methodologies'. " +
|
|
45
|
+
"Returns the full methodology body for one directory skill — markdown with step-by-step instructions and tool chains. " +
|
|
46
|
+
"Call directory_skill_list first to see available skill names, then directory_skill_get to load one. Read once at the start of the workflow; do not re-fetch on every step.",
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
properties: {
|
|
50
|
+
name: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description:
|
|
53
|
+
"Kebab-case skill name from directory_skill_list (e.g. 'find-music-for-sync-brief').",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
required: ["name"],
|
|
57
|
+
additionalProperties: false,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
executor: this.getSkill.bind(this),
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private async listSkills(_args: Record<string, any>): Promise<ToolResult> {
|
|
66
|
+
const skills = this.registry.listSkills();
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: skills.length
|
|
72
|
+
? `Available directory skills (${skills.length}):\n\n` +
|
|
73
|
+
skills
|
|
74
|
+
.map(
|
|
75
|
+
(s) =>
|
|
76
|
+
`- ${s.name} — ${s.description}\n triggers: ${s.triggers.join(", ")}\n audience: ${s.audience}`,
|
|
77
|
+
)
|
|
78
|
+
.join("\n\n") +
|
|
79
|
+
"\n\nCall directory_skill_get(name) to load a skill's full methodology."
|
|
80
|
+
: "No directory skills available.",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
structuredContent: { skills },
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private async getSkill(args: Record<string, any>): Promise<ToolResult> {
|
|
88
|
+
const name = String(args?.name ?? "").trim();
|
|
89
|
+
if (!name) {
|
|
90
|
+
return {
|
|
91
|
+
isError: true,
|
|
92
|
+
content: [
|
|
93
|
+
{
|
|
94
|
+
type: "text",
|
|
95
|
+
text: "Missing required argument: name. Call directory_skill_list to see available skill names.",
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
let skill;
|
|
101
|
+
try {
|
|
102
|
+
skill = this.registry.getSkill(name);
|
|
103
|
+
} catch (err) {
|
|
104
|
+
if (err instanceof SkillNotFoundError) {
|
|
105
|
+
return {
|
|
106
|
+
isError: true,
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: "text",
|
|
110
|
+
text: `Skill not found: ${name}. Call directory_skill_list to see available skill names.`,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
throw err;
|
|
116
|
+
}
|
|
117
|
+
const frontmatterSummary = [
|
|
118
|
+
`# ${skill.name}`,
|
|
119
|
+
"",
|
|
120
|
+
`**Description:** ${skill.description}`,
|
|
121
|
+
`**Audience:** ${skill.audience}`,
|
|
122
|
+
`**Triggers:** ${skill.triggers.join(", ")}`,
|
|
123
|
+
`**Tools used:** ${skill.tools_required.join(", ")}`,
|
|
124
|
+
`**Output:** ${skill.output}`,
|
|
125
|
+
"",
|
|
126
|
+
"---",
|
|
127
|
+
"",
|
|
128
|
+
].join("\n");
|
|
129
|
+
return {
|
|
130
|
+
content: [
|
|
131
|
+
{
|
|
132
|
+
type: "text",
|
|
133
|
+
text: frontmatterSummary + skill.body,
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
structuredContent: {
|
|
137
|
+
name: skill.name,
|
|
138
|
+
description: skill.description,
|
|
139
|
+
triggers: skill.triggers,
|
|
140
|
+
audience: skill.audience,
|
|
141
|
+
tools_required: skill.tools_required,
|
|
142
|
+
output: skill.output,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|