@agllama/mcp 0.6.16 → 0.6.18
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/__tests__/bundle-round-trip.d.ts +13 -0
- package/dist/__tests__/bundle-round-trip.d.ts.map +1 -0
- package/dist/__tests__/bundle-round-trip.js +170 -0
- package/dist/__tests__/bundle-round-trip.js.map +1 -0
- package/dist/api-client.d.ts +38 -13
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +136 -25
- package/dist/api-client.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +78 -39
- package/dist/server.js.map +1 -1
- package/dist/tools/help.d.ts.map +1 -1
- package/dist/tools/help.js +29 -23
- package/dist/tools/help.js.map +1 -1
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/prompts.d.ts +152 -0
- package/dist/tools/prompts.d.ts.map +1 -0
- package/dist/tools/prompts.js +470 -0
- package/dist/tools/prompts.js.map +1 -0
- package/dist/tools/skills.d.ts +152 -0
- package/dist/tools/skills.d.ts.map +1 -0
- package/dist/tools/skills.js +431 -0
- package/dist/tools/skills.js.map +1 -0
- package/dist/types.d.ts +88 -14
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/bundle.d.ts +78 -0
- package/dist/utils/bundle.d.ts.map +1 -0
- package/dist/utils/bundle.js +300 -0
- package/dist/utils/bundle.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getApiClient, LlamaApiError } from '../api-client.js';
|
|
3
|
+
import { bundleSkillDir, unbundleSkillContent } from '../utils/bundle.js';
|
|
4
|
+
// ============================================
|
|
5
|
+
// Create Skill
|
|
6
|
+
// ============================================
|
|
7
|
+
export const createSkillToolName = 'llama_create_skill';
|
|
8
|
+
export const createSkillToolDescription = `Create a Claude skill (reusable procedure). Scope: project (default), organization, or personal (only you, visible across all projects in the org).
|
|
9
|
+
|
|
10
|
+
Multi-file skills: set bundleFromPath to the local directory of a skill (containing SKILL.md + supporting files). The tool walks the directory, bundles sibling files into the content field using the multi-file bundle convention, and infers name/description from SKILL.md frontmatter. 1 MB total size cap, text files only.`;
|
|
11
|
+
export const createSkillToolSchema = z.object({
|
|
12
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
13
|
+
projectKey: z.string().optional().describe('Project key. Required when scope is "project" (default). Not needed for "organization" scope.'),
|
|
14
|
+
scope: z.enum(['project', 'organization', 'personal']).optional().default('project').describe('Skill scope: "project" (default), "organization" (shared across all projects), or "personal" (only visible to you, available in all projects in the org). Personal scope requires projectKey.'),
|
|
15
|
+
name: z.string().optional().describe('Skill name (e.g., "Sprint from TODO Phase"). Required unless bundleFromPath is set (then inferred from SKILL.md frontmatter).'),
|
|
16
|
+
description: z.string().optional().describe('Brief description of what the skill does. If bundleFromPath is set, defaults to the SKILL.md frontmatter description.'),
|
|
17
|
+
content: z.string().optional().describe('Markdown content with {{parameterName}} placeholders for instructions. Required unless bundleFromPath is set (then read from SKILL.md + bundled siblings).'),
|
|
18
|
+
bundleFromPath: z.string().optional().describe('Path to a local .claude/skills/<slug>/ directory. When set, reads SKILL.md for name/description/body and bundles sibling files (guardrails.md, scripts/, etc.) into the content field. Paths may be absolute or relative to the MCP server working directory.'),
|
|
19
|
+
parameters: z.string().optional().describe('JSON array of parameter definitions: [{name, type, required, default?, description?}]. Types: string, number, date, boolean'),
|
|
20
|
+
triggers: z.string().optional().describe('Comma-separated trigger phrases (e.g., "create sprint, plan phase, import TODO")'),
|
|
21
|
+
isEnabled: z
|
|
22
|
+
.preprocess((val) => {
|
|
23
|
+
if (typeof val === 'string') {
|
|
24
|
+
return val.toLowerCase() === 'true';
|
|
25
|
+
}
|
|
26
|
+
return val;
|
|
27
|
+
}, z.boolean())
|
|
28
|
+
.optional()
|
|
29
|
+
.default(true)
|
|
30
|
+
.describe('Whether the skill is active (default: true)'),
|
|
31
|
+
});
|
|
32
|
+
export async function executeCreateSkill(input) {
|
|
33
|
+
try {
|
|
34
|
+
const client = getApiClient();
|
|
35
|
+
const scope = input.scope ?? 'project';
|
|
36
|
+
// Validate: project and personal scopes require projectKey
|
|
37
|
+
if ((scope === 'project' || scope === 'personal') && !input.projectKey) {
|
|
38
|
+
return JSON.stringify({
|
|
39
|
+
success: false,
|
|
40
|
+
error: `projectKey is required when scope is "${scope}"`,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// If bundleFromPath is set, read the directory and derive name/description/content.
|
|
44
|
+
// Explicit input.name / input.description / input.content override frontmatter.
|
|
45
|
+
let resolvedName = input.name;
|
|
46
|
+
let resolvedDescription = input.description;
|
|
47
|
+
let resolvedContent = input.content;
|
|
48
|
+
let bundledFilesCount = 0;
|
|
49
|
+
if (input.bundleFromPath) {
|
|
50
|
+
try {
|
|
51
|
+
const bundle = await bundleSkillDir(input.bundleFromPath);
|
|
52
|
+
resolvedName = resolvedName ?? bundle.name;
|
|
53
|
+
resolvedDescription = resolvedDescription ?? bundle.description;
|
|
54
|
+
resolvedContent = resolvedContent ?? bundle.content;
|
|
55
|
+
bundledFilesCount = bundle.bundledFilesCount;
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
return JSON.stringify({
|
|
59
|
+
success: false,
|
|
60
|
+
error: `Failed to bundle skill from ${input.bundleFromPath}: ${err instanceof Error ? err.message : String(err)}`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (!resolvedName) {
|
|
65
|
+
return JSON.stringify({
|
|
66
|
+
success: false,
|
|
67
|
+
error: 'name is required (pass explicitly or via SKILL.md frontmatter when using bundleFromPath).',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (!resolvedContent) {
|
|
71
|
+
return JSON.stringify({
|
|
72
|
+
success: false,
|
|
73
|
+
error: 'content is required (pass explicitly or via bundleFromPath pointing at a directory with SKILL.md).',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// Parse parameters if provided as JSON string
|
|
77
|
+
let parameters;
|
|
78
|
+
if (input.parameters) {
|
|
79
|
+
try {
|
|
80
|
+
parameters = JSON.parse(input.parameters);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return JSON.stringify({
|
|
84
|
+
success: false,
|
|
85
|
+
error: 'Invalid JSON for parameters. Expected array of {name, type, required, default?, description?}',
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Parse triggers from comma-separated string
|
|
90
|
+
let triggers;
|
|
91
|
+
if (input.triggers) {
|
|
92
|
+
triggers = input.triggers.split(',').map((t) => t.trim()).filter(Boolean);
|
|
93
|
+
}
|
|
94
|
+
const skillInput = {
|
|
95
|
+
name: resolvedName,
|
|
96
|
+
description: resolvedDescription,
|
|
97
|
+
content: resolvedContent,
|
|
98
|
+
parameters,
|
|
99
|
+
triggers,
|
|
100
|
+
isEnabled: input.isEnabled ?? true,
|
|
101
|
+
};
|
|
102
|
+
let skill;
|
|
103
|
+
if (scope === 'organization') {
|
|
104
|
+
skill = await client.createOrgSkill(input.orgSlug, skillInput);
|
|
105
|
+
}
|
|
106
|
+
else if (scope === 'personal') {
|
|
107
|
+
skill = await client.createPersonalSkill(input.orgSlug, input.projectKey, skillInput);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
skill = await client.createSkill(input.orgSlug, input.projectKey, skillInput);
|
|
111
|
+
}
|
|
112
|
+
const bundleSuffix = bundledFilesCount > 0
|
|
113
|
+
? ` (bundled ${bundledFilesCount} supporting file${bundledFilesCount === 1 ? '' : 's'})`
|
|
114
|
+
: '';
|
|
115
|
+
return JSON.stringify({
|
|
116
|
+
success: true,
|
|
117
|
+
message: `Skill "${skill.name}" created successfully (scope: ${scope})${bundleSuffix}`,
|
|
118
|
+
skill: {
|
|
119
|
+
id: skill.id,
|
|
120
|
+
name: skill.name,
|
|
121
|
+
description: skill.description,
|
|
122
|
+
scope: skill.scope,
|
|
123
|
+
triggers: skill.triggers,
|
|
124
|
+
parametersCount: skill.parameters.length,
|
|
125
|
+
isEnabled: skill.isEnabled,
|
|
126
|
+
bundledFilesCount,
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
if (error instanceof LlamaApiError) {
|
|
132
|
+
return JSON.stringify({
|
|
133
|
+
success: false,
|
|
134
|
+
error: `Failed to create skill: ${error.message}`,
|
|
135
|
+
statusCode: error.statusCode,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return JSON.stringify({
|
|
139
|
+
success: false,
|
|
140
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// ============================================
|
|
145
|
+
// Update Skill
|
|
146
|
+
// ============================================
|
|
147
|
+
export const updateSkillToolName = 'llama_update_skill';
|
|
148
|
+
export const updateSkillToolDescription = `Update a Claude skill. Change scope to promote/demote between project and org level.`;
|
|
149
|
+
export const updateSkillToolSchema = z.object({
|
|
150
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
151
|
+
projectKey: z.string().optional().describe('Project key. Required for project-scoped skills, or when demoting an org skill to project scope.'),
|
|
152
|
+
skillId: z.string().describe('Skill ID to update'),
|
|
153
|
+
name: z.string().optional().describe('New skill name'),
|
|
154
|
+
description: z.string().optional().describe('New description'),
|
|
155
|
+
content: z.string().optional().describe('New markdown content with {{parameterName}} placeholders'),
|
|
156
|
+
parameters: z.string().optional().describe('JSON array of parameter definitions: [{name, type, required, default?, description?}]'),
|
|
157
|
+
triggers: z.string().optional().describe('Comma-separated trigger phrases'),
|
|
158
|
+
isEnabled: z
|
|
159
|
+
.preprocess((val) => {
|
|
160
|
+
if (typeof val === 'string') {
|
|
161
|
+
return val.toLowerCase() === 'true';
|
|
162
|
+
}
|
|
163
|
+
return val;
|
|
164
|
+
}, z.boolean())
|
|
165
|
+
.optional()
|
|
166
|
+
.describe('Whether the skill is active'),
|
|
167
|
+
scope: z.enum(['project', 'organization']).optional().describe('Change skill scope: "organization" to promote (share across all projects), "project" to demote (requires projectKey)'),
|
|
168
|
+
});
|
|
169
|
+
export async function executeUpdateSkill(input) {
|
|
170
|
+
try {
|
|
171
|
+
const client = getApiClient();
|
|
172
|
+
// Parse parameters if provided as JSON string
|
|
173
|
+
let parameters;
|
|
174
|
+
if (input.parameters) {
|
|
175
|
+
try {
|
|
176
|
+
parameters = JSON.parse(input.parameters);
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return JSON.stringify({
|
|
180
|
+
success: false,
|
|
181
|
+
error: 'Invalid JSON for parameters. Expected array of {name, type, required, default?, description?}',
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Parse triggers from comma-separated string
|
|
186
|
+
let triggers;
|
|
187
|
+
if (input.triggers) {
|
|
188
|
+
triggers = input.triggers.split(',').map((t) => t.trim()).filter(Boolean);
|
|
189
|
+
}
|
|
190
|
+
const updateData = {};
|
|
191
|
+
if (input.name !== undefined)
|
|
192
|
+
updateData.name = input.name;
|
|
193
|
+
if (input.description !== undefined)
|
|
194
|
+
updateData.description = input.description;
|
|
195
|
+
if (input.content !== undefined)
|
|
196
|
+
updateData.content = input.content;
|
|
197
|
+
if (parameters !== undefined)
|
|
198
|
+
updateData.parameters = parameters;
|
|
199
|
+
if (triggers !== undefined)
|
|
200
|
+
updateData.triggers = triggers;
|
|
201
|
+
if (input.isEnabled !== undefined)
|
|
202
|
+
updateData.isEnabled = input.isEnabled;
|
|
203
|
+
if (input.scope !== undefined)
|
|
204
|
+
updateData.scope = input.scope;
|
|
205
|
+
if (input.projectKey !== undefined)
|
|
206
|
+
updateData.projectKey = input.projectKey;
|
|
207
|
+
// Route to org or project API based on whether projectKey is provided
|
|
208
|
+
const skill = input.projectKey
|
|
209
|
+
? await client.updateSkill(input.orgSlug, input.projectKey, input.skillId, updateData)
|
|
210
|
+
: await client.updateOrgSkill(input.orgSlug, input.skillId, updateData);
|
|
211
|
+
return JSON.stringify({
|
|
212
|
+
success: true,
|
|
213
|
+
message: `Skill "${skill.name}" updated successfully`,
|
|
214
|
+
skill: {
|
|
215
|
+
id: skill.id,
|
|
216
|
+
name: skill.name,
|
|
217
|
+
description: skill.description,
|
|
218
|
+
scope: skill.scope,
|
|
219
|
+
triggers: skill.triggers,
|
|
220
|
+
parametersCount: skill.parameters.length,
|
|
221
|
+
isEnabled: skill.isEnabled,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
if (error instanceof LlamaApiError) {
|
|
227
|
+
return JSON.stringify({
|
|
228
|
+
success: false,
|
|
229
|
+
error: `Failed to update skill: ${error.message}`,
|
|
230
|
+
statusCode: error.statusCode,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return JSON.stringify({
|
|
234
|
+
success: false,
|
|
235
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// ============================================
|
|
240
|
+
// List Skills
|
|
241
|
+
// ============================================
|
|
242
|
+
export const listSkillsToolName = 'llama_list_skills';
|
|
243
|
+
export const listSkillsToolDescription = `List Claude skills for a project. Set includeHidden=true for hidden ones.`;
|
|
244
|
+
export const listSkillsToolSchema = z.object({
|
|
245
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
246
|
+
projectKey: z.string().describe('Project key'),
|
|
247
|
+
includeHidden: z
|
|
248
|
+
.preprocess((val) => {
|
|
249
|
+
if (typeof val === 'string') {
|
|
250
|
+
return val.toLowerCase() === 'true';
|
|
251
|
+
}
|
|
252
|
+
return val;
|
|
253
|
+
}, z.boolean())
|
|
254
|
+
.optional()
|
|
255
|
+
.describe('Include hidden skills (default: false)'),
|
|
256
|
+
});
|
|
257
|
+
export async function executeListSkills(input) {
|
|
258
|
+
try {
|
|
259
|
+
const client = getApiClient();
|
|
260
|
+
const skills = await client.listSkills(input.orgSlug, input.projectKey, input.includeHidden);
|
|
261
|
+
return JSON.stringify({
|
|
262
|
+
success: true,
|
|
263
|
+
skills: skills.map((w) => ({
|
|
264
|
+
id: w.id,
|
|
265
|
+
name: w.name,
|
|
266
|
+
description: w.description,
|
|
267
|
+
scope: w.scope,
|
|
268
|
+
triggers: w.triggers,
|
|
269
|
+
isEnabled: w.isEnabled,
|
|
270
|
+
usageCount: w.usageCount,
|
|
271
|
+
lastUsedAt: w.lastUsedAt,
|
|
272
|
+
...(input.includeHidden && {
|
|
273
|
+
isHidden: w.isHidden,
|
|
274
|
+
hideScope: w.hideScope,
|
|
275
|
+
}),
|
|
276
|
+
})),
|
|
277
|
+
count: skills.length,
|
|
278
|
+
}, null, 2);
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
if (error instanceof LlamaApiError) {
|
|
282
|
+
return JSON.stringify({
|
|
283
|
+
success: false,
|
|
284
|
+
error: `Failed to list skills: ${error.message}`,
|
|
285
|
+
statusCode: error.statusCode,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
return JSON.stringify({
|
|
289
|
+
success: false,
|
|
290
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// ============================================
|
|
295
|
+
// Get Skill
|
|
296
|
+
// ============================================
|
|
297
|
+
export const getSkillToolName = 'llama_get_skill';
|
|
298
|
+
export const getSkillToolDescription = `Get skill content and parameters by ID.`;
|
|
299
|
+
export const getSkillToolSchema = z.object({
|
|
300
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
301
|
+
projectKey: z.string().describe('Project key'),
|
|
302
|
+
skillId: z.string().describe('Skill ID'),
|
|
303
|
+
});
|
|
304
|
+
export async function executeGetSkill(input) {
|
|
305
|
+
try {
|
|
306
|
+
const client = getApiClient();
|
|
307
|
+
const skill = await client.getSkill(input.orgSlug, input.projectKey, input.skillId);
|
|
308
|
+
return JSON.stringify({
|
|
309
|
+
success: true,
|
|
310
|
+
skill: {
|
|
311
|
+
id: skill.id,
|
|
312
|
+
name: skill.name,
|
|
313
|
+
description: skill.description,
|
|
314
|
+
scope: skill.scope,
|
|
315
|
+
content: skill.content,
|
|
316
|
+
parameters: skill.parameters,
|
|
317
|
+
triggers: skill.triggers,
|
|
318
|
+
isEnabled: skill.isEnabled,
|
|
319
|
+
usageCount: skill.usageCount,
|
|
320
|
+
lastUsedAt: skill.lastUsedAt,
|
|
321
|
+
createdBy: skill.createdBy,
|
|
322
|
+
},
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
if (error instanceof LlamaApiError) {
|
|
327
|
+
return JSON.stringify({
|
|
328
|
+
success: false,
|
|
329
|
+
error: `Failed to get skill: ${error.message}`,
|
|
330
|
+
statusCode: error.statusCode,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
return JSON.stringify({
|
|
334
|
+
success: false,
|
|
335
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
// ============================================
|
|
340
|
+
// Set Skill Visibility (hide/unhide consolidated)
|
|
341
|
+
// ============================================
|
|
342
|
+
export const setSkillVisibilityToolName = 'llama_set_skill_visibility';
|
|
343
|
+
export const setSkillVisibilityToolDescription = `Hide or unhide a skill. Scope: user (just you) or project (everyone).`;
|
|
344
|
+
export const setSkillVisibilityToolSchema = z.object({
|
|
345
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
346
|
+
projectKey: z.string().describe('Project key'),
|
|
347
|
+
skillId: z.string().describe('Skill ID'),
|
|
348
|
+
action: z.enum(['hide', 'unhide']).describe('Action: "hide" or "unhide"'),
|
|
349
|
+
scope: z.enum(['user', 'project']).describe('Scope: "user" (just for you) or "project" (for everyone in the project)'),
|
|
350
|
+
});
|
|
351
|
+
export async function executeSetSkillVisibility(input) {
|
|
352
|
+
try {
|
|
353
|
+
const client = getApiClient();
|
|
354
|
+
const method = input.action === 'hide' ? 'hideSkill' : 'unhideSkill';
|
|
355
|
+
await client[method](input.orgSlug, input.projectKey, input.skillId, input.scope);
|
|
356
|
+
return JSON.stringify({
|
|
357
|
+
success: true,
|
|
358
|
+
message: `Skill ${input.action === 'hide' ? 'hidden' : 'unhidden'} at ${input.scope} level`,
|
|
359
|
+
skillId: input.skillId,
|
|
360
|
+
action: input.action,
|
|
361
|
+
scope: input.scope,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
if (error instanceof LlamaApiError) {
|
|
366
|
+
return JSON.stringify({
|
|
367
|
+
success: false,
|
|
368
|
+
error: `Failed to ${input.action} skill: ${error.message}`,
|
|
369
|
+
statusCode: error.statusCode,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
return JSON.stringify({
|
|
373
|
+
success: false,
|
|
374
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
// ============================================
|
|
379
|
+
// Install Skill
|
|
380
|
+
// ============================================
|
|
381
|
+
export const installSkillToolName = 'llama_install_skill';
|
|
382
|
+
export const installSkillToolDescription = `Install a skill from the skill library into the current project. Returns the skill slug, filename, and markdown content for writing to disk.
|
|
383
|
+
|
|
384
|
+
Multi-file skills: if the fetched content contains a bundle block (<!-- SKILL-BUNDLE-START -->...<!-- SKILL-BUNDLE-END -->), the tool automatically strips the block from the main content and returns an additional \`files\` array. Each entry has { path, content, executable } and should be written under .claude/skills/<slug>/<path>. Single-file skills return files: [].`;
|
|
385
|
+
export const installSkillToolSchema = z.object({
|
|
386
|
+
skillId: z.string().describe('Skill ID to install'),
|
|
387
|
+
orgSlug: z.string().optional().describe('Organization slug. Required when not set in session context.'),
|
|
388
|
+
projectKey: z.string().optional().describe('Project key. When omitted, installs via the org-level endpoint.'),
|
|
389
|
+
});
|
|
390
|
+
export async function executeInstallSkill(input) {
|
|
391
|
+
try {
|
|
392
|
+
const client = getApiClient();
|
|
393
|
+
const result = await client.installSkill(input.skillId, input.orgSlug, input.projectKey);
|
|
394
|
+
let unbundled;
|
|
395
|
+
try {
|
|
396
|
+
unbundled = unbundleSkillContent(result.content);
|
|
397
|
+
}
|
|
398
|
+
catch (err) {
|
|
399
|
+
return JSON.stringify({
|
|
400
|
+
success: false,
|
|
401
|
+
error: `Failed to unbundle skill content: ${err instanceof Error ? err.message : String(err)}`,
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
const filesCount = unbundled.files.length;
|
|
405
|
+
const message = filesCount > 0
|
|
406
|
+
? `Skill installed — write SKILL.md plus ${filesCount} bundled file${filesCount === 1 ? '' : 's'} under .claude/skills/${result.slug}/`
|
|
407
|
+
: 'Skill installed successfully';
|
|
408
|
+
return JSON.stringify({
|
|
409
|
+
success: true,
|
|
410
|
+
message,
|
|
411
|
+
slug: result.slug,
|
|
412
|
+
filename: result.filename,
|
|
413
|
+
content: unbundled.main,
|
|
414
|
+
files: unbundled.files,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
if (error instanceof LlamaApiError) {
|
|
419
|
+
return JSON.stringify({
|
|
420
|
+
success: false,
|
|
421
|
+
error: `Failed to install skill: ${error.message}`,
|
|
422
|
+
statusCode: error.statusCode,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
return JSON.stringify({
|
|
426
|
+
success: false,
|
|
427
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/tools/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC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AC,CAAC;IACL,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -388,15 +388,17 @@ export interface CompleteSprintInput {
|
|
|
388
388
|
moveIncompleteToBacklog?: boolean;
|
|
389
389
|
moveIncompleteToSprintId?: string;
|
|
390
390
|
}
|
|
391
|
-
export type
|
|
392
|
-
export interface
|
|
391
|
+
export type SkillParameterType = 'string' | 'number' | 'date' | 'boolean';
|
|
392
|
+
export interface MCPSkillParameter {
|
|
393
393
|
name: string;
|
|
394
|
-
type:
|
|
394
|
+
type: SkillParameterType;
|
|
395
395
|
default?: string;
|
|
396
396
|
required: boolean;
|
|
397
397
|
description?: string;
|
|
398
398
|
}
|
|
399
|
-
|
|
399
|
+
/** @deprecated Use MCPSkillParameter */
|
|
400
|
+
export type MCPWorkflowParameter = MCPSkillParameter;
|
|
401
|
+
export interface MCPSkillSummary {
|
|
400
402
|
id: string;
|
|
401
403
|
name: string;
|
|
402
404
|
description: string | null;
|
|
@@ -417,40 +419,112 @@ export interface MCPWorkflowSummary {
|
|
|
417
419
|
avatarUrl: string | null;
|
|
418
420
|
};
|
|
419
421
|
}
|
|
420
|
-
|
|
422
|
+
/** @deprecated Use MCPSkillSummary */
|
|
423
|
+
export type MCPWorkflowSummary = MCPSkillSummary;
|
|
424
|
+
export interface MCPSkillDetail extends MCPSkillSummary {
|
|
421
425
|
content: string;
|
|
422
|
-
parameters:
|
|
426
|
+
parameters: MCPSkillParameter[];
|
|
423
427
|
organizationId: string | null;
|
|
424
428
|
projectId: string | null;
|
|
425
429
|
}
|
|
426
|
-
|
|
427
|
-
|
|
430
|
+
/** @deprecated Use MCPSkillDetail */
|
|
431
|
+
export type MCPWorkflowDetail = MCPSkillDetail;
|
|
432
|
+
export interface MCPSuggestedSkill {
|
|
433
|
+
skill: MCPSkillSummary;
|
|
428
434
|
score: number;
|
|
429
435
|
matchedTriggers: string[];
|
|
430
436
|
}
|
|
431
|
-
|
|
432
|
-
|
|
437
|
+
/** @deprecated Use MCPSuggestedSkill */
|
|
438
|
+
export type MCPSuggestedWorkflow = MCPSuggestedSkill;
|
|
439
|
+
export interface MCPSkillExecution {
|
|
440
|
+
skill: MCPSkillSummary;
|
|
433
441
|
filledContent: string;
|
|
434
442
|
parameters: Record<string, string>;
|
|
435
443
|
}
|
|
436
|
-
|
|
444
|
+
/** @deprecated Use MCPSkillExecution */
|
|
445
|
+
export type MCPWorkflowExecution = MCPSkillExecution;
|
|
446
|
+
export interface CreateSkillInput {
|
|
437
447
|
name: string;
|
|
438
448
|
description?: string;
|
|
439
449
|
content: string;
|
|
440
|
-
parameters?:
|
|
450
|
+
parameters?: MCPSkillParameter[];
|
|
441
451
|
triggers?: string[];
|
|
442
452
|
isEnabled?: boolean;
|
|
443
453
|
}
|
|
444
|
-
|
|
454
|
+
/** @deprecated Use CreateSkillInput */
|
|
455
|
+
export type CreateClaudeWorkflowInput = CreateSkillInput;
|
|
456
|
+
export interface UpdateSkillInput {
|
|
445
457
|
name?: string;
|
|
446
458
|
description?: string;
|
|
447
459
|
content?: string;
|
|
448
|
-
parameters?:
|
|
460
|
+
parameters?: MCPSkillParameter[];
|
|
449
461
|
triggers?: string[];
|
|
450
462
|
isEnabled?: boolean;
|
|
451
463
|
scope?: 'organization' | 'project' | 'personal';
|
|
452
464
|
projectKey?: string;
|
|
453
465
|
}
|
|
466
|
+
/** @deprecated Use UpdateSkillInput */
|
|
467
|
+
export type UpdateClaudeWorkflowInput = UpdateSkillInput;
|
|
468
|
+
export interface MCPPromptSummary {
|
|
469
|
+
id: string;
|
|
470
|
+
name: string;
|
|
471
|
+
description: string | null;
|
|
472
|
+
scope: 'organization' | 'project' | 'personal';
|
|
473
|
+
organizationId: string | null;
|
|
474
|
+
projectId: string | null;
|
|
475
|
+
userId: string | null;
|
|
476
|
+
folderId: string | null;
|
|
477
|
+
folder: {
|
|
478
|
+
id: string;
|
|
479
|
+
name: string;
|
|
480
|
+
} | null;
|
|
481
|
+
sourcePromptId: string | null;
|
|
482
|
+
createdAt: string;
|
|
483
|
+
updatedAt: string;
|
|
484
|
+
isHidden?: boolean;
|
|
485
|
+
hideScope?: 'user' | 'project' | null;
|
|
486
|
+
createdBy: {
|
|
487
|
+
id: string;
|
|
488
|
+
name: string;
|
|
489
|
+
avatarUrl: string | null;
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
export interface MCPPromptDetail extends MCPPromptSummary {
|
|
493
|
+
content: string;
|
|
494
|
+
}
|
|
495
|
+
export interface CreatePromptInput {
|
|
496
|
+
name: string;
|
|
497
|
+
description?: string | null;
|
|
498
|
+
content: string;
|
|
499
|
+
folderId?: string | null;
|
|
500
|
+
sourcePromptId?: string | null;
|
|
501
|
+
}
|
|
502
|
+
export interface UpdatePromptInput {
|
|
503
|
+
name?: string;
|
|
504
|
+
description?: string | null;
|
|
505
|
+
content?: string;
|
|
506
|
+
folderId?: string | null;
|
|
507
|
+
}
|
|
508
|
+
export interface MCPPromptFolderSummary {
|
|
509
|
+
id: string;
|
|
510
|
+
name: string;
|
|
511
|
+
scope: 'organization' | 'project' | 'personal';
|
|
512
|
+
organizationId: string | null;
|
|
513
|
+
projectId: string | null;
|
|
514
|
+
userId: string | null;
|
|
515
|
+
createdAt: string;
|
|
516
|
+
updatedAt: string;
|
|
517
|
+
createdBy: {
|
|
518
|
+
id: string;
|
|
519
|
+
name: string;
|
|
520
|
+
avatarUrl: string | null;
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
export interface InstallSkillResult {
|
|
524
|
+
slug: string;
|
|
525
|
+
filename: string;
|
|
526
|
+
content: string;
|
|
527
|
+
}
|
|
454
528
|
export type DocumentScope = 'ORG' | 'PROJECT';
|
|
455
529
|
export type DocumentType = 'STATIC' | 'SPRINT_TEMPLATE';
|
|
456
530
|
export type DocumentStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';
|