@skillsmith/mcp-server 0.1.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/.tsbuildinfo +1 -0
- package/dist/src/__tests__/get-skill.test.d.ts +6 -0
- package/dist/src/__tests__/get-skill.test.d.ts.map +1 -0
- package/dist/src/__tests__/get-skill.test.js +88 -0
- package/dist/src/__tests__/get-skill.test.js.map +1 -0
- package/dist/src/__tests__/middleware/errorFormatter.test.d.ts +7 -0
- package/dist/src/__tests__/middleware/errorFormatter.test.d.ts.map +1 -0
- package/dist/src/__tests__/middleware/errorFormatter.test.js +304 -0
- package/dist/src/__tests__/middleware/errorFormatter.test.js.map +1 -0
- package/dist/src/__tests__/middleware/license.test.d.ts +7 -0
- package/dist/src/__tests__/middleware/license.test.d.ts.map +1 -0
- package/dist/src/__tests__/middleware/license.test.js +500 -0
- package/dist/src/__tests__/middleware/license.test.js.map +1 -0
- package/dist/src/__tests__/search.test.d.ts +6 -0
- package/dist/src/__tests__/search.test.d.ts.map +1 -0
- package/dist/src/__tests__/search.test.js +86 -0
- package/dist/src/__tests__/search.test.js.map +1 -0
- package/dist/src/__tests__/test-utils.d.ts +19 -0
- package/dist/src/__tests__/test-utils.d.ts.map +1 -0
- package/dist/src/__tests__/test-utils.js +87 -0
- package/dist/src/__tests__/test-utils.js.map +1 -0
- package/dist/src/context/index.d.ts +19 -0
- package/dist/src/context/index.d.ts.map +1 -0
- package/dist/src/context/index.js +25 -0
- package/dist/src/context/index.js.map +1 -0
- package/dist/src/context/project-detector.d.ts +145 -0
- package/dist/src/context/project-detector.d.ts.map +1 -0
- package/dist/src/context/project-detector.js +321 -0
- package/dist/src/context/project-detector.js.map +1 -0
- package/dist/src/context.d.ts +100 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +157 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/core-shim.d.ts +7 -0
- package/dist/src/core-shim.d.ts.map +1 -0
- package/dist/src/core-shim.js +9 -0
- package/dist/src/core-shim.js.map +1 -0
- package/dist/src/health/healthCheck.d.ts +88 -0
- package/dist/src/health/healthCheck.d.ts.map +1 -0
- package/dist/src/health/healthCheck.js +117 -0
- package/dist/src/health/healthCheck.js.map +1 -0
- package/dist/src/health/index.d.ts +21 -0
- package/dist/src/health/index.d.ts.map +1 -0
- package/dist/src/health/index.js +21 -0
- package/dist/src/health/index.js.map +1 -0
- package/dist/src/health/readinessCheck.d.ts +139 -0
- package/dist/src/health/readinessCheck.d.ts.map +1 -0
- package/dist/src/health/readinessCheck.js +266 -0
- package/dist/src/health/readinessCheck.js.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +178 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.test.d.ts +2 -0
- package/dist/src/index.test.d.ts.map +1 -0
- package/dist/src/index.test.js +43 -0
- package/dist/src/index.test.js.map +1 -0
- package/dist/src/logger.d.ts +26 -0
- package/dist/src/logger.d.ts.map +1 -0
- package/dist/src/logger.js +179 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/middleware/__tests__/csp.test.d.ts +2 -0
- package/dist/src/middleware/__tests__/csp.test.d.ts.map +1 -0
- package/dist/src/middleware/__tests__/csp.test.js +389 -0
- package/dist/src/middleware/__tests__/csp.test.js.map +1 -0
- package/dist/src/middleware/csp.d.ts +87 -0
- package/dist/src/middleware/csp.d.ts.map +1 -0
- package/dist/src/middleware/csp.js +273 -0
- package/dist/src/middleware/csp.js.map +1 -0
- package/dist/src/middleware/degradation.d.ts +99 -0
- package/dist/src/middleware/degradation.d.ts.map +1 -0
- package/dist/src/middleware/degradation.js +315 -0
- package/dist/src/middleware/degradation.js.map +1 -0
- package/dist/src/middleware/errorFormatter.d.ts +119 -0
- package/dist/src/middleware/errorFormatter.d.ts.map +1 -0
- package/dist/src/middleware/errorFormatter.js +294 -0
- package/dist/src/middleware/errorFormatter.js.map +1 -0
- package/dist/src/middleware/index.d.ts +10 -0
- package/dist/src/middleware/index.d.ts.map +1 -0
- package/dist/src/middleware/index.js +14 -0
- package/dist/src/middleware/index.js.map +1 -0
- package/dist/src/middleware/license.d.ts +161 -0
- package/dist/src/middleware/license.d.ts.map +1 -0
- package/dist/src/middleware/license.js +281 -0
- package/dist/src/middleware/license.js.map +1 -0
- package/dist/src/middleware/toolFeatureMapping.d.ts +36 -0
- package/dist/src/middleware/toolFeatureMapping.d.ts.map +1 -0
- package/dist/src/middleware/toolFeatureMapping.js +90 -0
- package/dist/src/middleware/toolFeatureMapping.js.map +1 -0
- package/dist/src/onboarding/first-run.d.ts +64 -0
- package/dist/src/onboarding/first-run.d.ts.map +1 -0
- package/dist/src/onboarding/first-run.js +77 -0
- package/dist/src/onboarding/first-run.js.map +1 -0
- package/dist/src/onboarding/index.d.ts +7 -0
- package/dist/src/onboarding/index.d.ts.map +1 -0
- package/dist/src/onboarding/index.js +7 -0
- package/dist/src/onboarding/index.js.map +1 -0
- package/dist/src/suggestions/index.d.ts +21 -0
- package/dist/src/suggestions/index.d.ts.map +1 -0
- package/dist/src/suggestions/index.js +20 -0
- package/dist/src/suggestions/index.js.map +1 -0
- package/dist/src/suggestions/suggestion-engine.d.ts +185 -0
- package/dist/src/suggestions/suggestion-engine.d.ts.map +1 -0
- package/dist/src/suggestions/suggestion-engine.js +352 -0
- package/dist/src/suggestions/suggestion-engine.js.map +1 -0
- package/dist/src/suggestions/types.d.ts +88 -0
- package/dist/src/suggestions/types.d.ts.map +1 -0
- package/dist/src/suggestions/types.js +21 -0
- package/dist/src/suggestions/types.js.map +1 -0
- package/dist/src/tools/analyze.d.ts +151 -0
- package/dist/src/tools/analyze.d.ts.map +1 -0
- package/dist/src/tools/analyze.js +205 -0
- package/dist/src/tools/analyze.js.map +1 -0
- package/dist/src/tools/compare.d.ts +149 -0
- package/dist/src/tools/compare.d.ts.map +1 -0
- package/dist/src/tools/compare.js +464 -0
- package/dist/src/tools/compare.js.map +1 -0
- package/dist/src/tools/get-skill.d.ts +116 -0
- package/dist/src/tools/get-skill.d.ts.map +1 -0
- package/dist/src/tools/get-skill.js +224 -0
- package/dist/src/tools/get-skill.js.map +1 -0
- package/dist/src/tools/index.d.ts +20 -0
- package/dist/src/tools/index.d.ts.map +1 -0
- package/dist/src/tools/index.js +20 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/tools/install.d.ts +122 -0
- package/dist/src/tools/install.d.ts.map +1 -0
- package/dist/src/tools/install.js +314 -0
- package/dist/src/tools/install.js.map +1 -0
- package/dist/src/tools/recommend.d.ts +171 -0
- package/dist/src/tools/recommend.d.ts.map +1 -0
- package/dist/src/tools/recommend.js +325 -0
- package/dist/src/tools/recommend.js.map +1 -0
- package/dist/src/tools/search.d.ts +121 -0
- package/dist/src/tools/search.d.ts.map +1 -0
- package/dist/src/tools/search.js +249 -0
- package/dist/src/tools/search.js.map +1 -0
- package/dist/src/tools/suggest.d.ts +181 -0
- package/dist/src/tools/suggest.d.ts.map +1 -0
- package/dist/src/tools/suggest.js +342 -0
- package/dist/src/tools/suggest.js.map +1 -0
- package/dist/src/tools/uninstall.d.ts +123 -0
- package/dist/src/tools/uninstall.d.ts.map +1 -0
- package/dist/src/tools/uninstall.js +250 -0
- package/dist/src/tools/uninstall.js.map +1 -0
- package/dist/src/tools/validate.d.ts +122 -0
- package/dist/src/tools/validate.d.ts.map +1 -0
- package/dist/src/tools/validate.js +497 -0
- package/dist/src/tools/validate.js.map +1 -0
- package/dist/src/utils/installed-skills.d.ts +101 -0
- package/dist/src/utils/installed-skills.d.ts.map +1 -0
- package/dist/src/utils/installed-skills.js +220 -0
- package/dist/src/utils/installed-skills.js.map +1 -0
- package/dist/src/utils/validation.d.ts +76 -0
- package/dist/src/utils/validation.d.ts.map +1 -0
- package/dist/src/utils/validation.js +153 -0
- package/dist/src/utils/validation.js.map +1 -0
- package/dist/src/webhooks/index.d.ts +8 -0
- package/dist/src/webhooks/index.d.ts.map +1 -0
- package/dist/src/webhooks/index.js +9 -0
- package/dist/src/webhooks/index.js.map +1 -0
- package/dist/src/webhooks/webhook-endpoint.d.ts +149 -0
- package/dist/src/webhooks/webhook-endpoint.d.ts.map +1 -0
- package/dist/src/webhooks/webhook-endpoint.js +339 -0
- package/dist/src/webhooks/webhook-endpoint.js.map +1 -0
- package/dist/tests/compare.test.d.ts +6 -0
- package/dist/tests/compare.test.d.ts.map +1 -0
- package/dist/tests/compare.test.js +225 -0
- package/dist/tests/compare.test.js.map +1 -0
- package/dist/tests/context/project-detector.test.d.ts +6 -0
- package/dist/tests/context/project-detector.test.d.ts.map +1 -0
- package/dist/tests/context/project-detector.test.js +719 -0
- package/dist/tests/context/project-detector.test.js.map +1 -0
- package/dist/tests/e2e/compare.e2e.test.d.ts +10 -0
- package/dist/tests/e2e/compare.e2e.test.d.ts.map +1 -0
- package/dist/tests/e2e/compare.e2e.test.js +286 -0
- package/dist/tests/e2e/compare.e2e.test.js.map +1 -0
- package/dist/tests/e2e/install-flow.e2e.test.d.ts +10 -0
- package/dist/tests/e2e/install-flow.e2e.test.d.ts.map +1 -0
- package/dist/tests/e2e/install-flow.e2e.test.js +209 -0
- package/dist/tests/e2e/install-flow.e2e.test.js.map +1 -0
- package/dist/tests/e2e/recommend.e2e.test.d.ts +12 -0
- package/dist/tests/e2e/recommend.e2e.test.d.ts.map +1 -0
- package/dist/tests/e2e/recommend.e2e.test.js +347 -0
- package/dist/tests/e2e/recommend.e2e.test.js.map +1 -0
- package/dist/tests/e2e/skill-flow.e2e.test.d.ts +10 -0
- package/dist/tests/e2e/skill-flow.e2e.test.d.ts.map +1 -0
- package/dist/tests/e2e/skill-flow.e2e.test.js +280 -0
- package/dist/tests/e2e/skill-flow.e2e.test.js.map +1 -0
- package/dist/tests/e2e/suggest.e2e.test.d.ts +13 -0
- package/dist/tests/e2e/suggest.e2e.test.d.ts.map +1 -0
- package/dist/tests/e2e/suggest.e2e.test.js +347 -0
- package/dist/tests/e2e/suggest.e2e.test.js.map +1 -0
- package/dist/tests/e2e/utils/baseline-collector.d.ts +107 -0
- package/dist/tests/e2e/utils/baseline-collector.d.ts.map +1 -0
- package/dist/tests/e2e/utils/baseline-collector.js +211 -0
- package/dist/tests/e2e/utils/baseline-collector.js.map +1 -0
- package/dist/tests/e2e/utils/hardcoded-detector.d.ts +46 -0
- package/dist/tests/e2e/utils/hardcoded-detector.d.ts.map +1 -0
- package/dist/tests/e2e/utils/hardcoded-detector.js +255 -0
- package/dist/tests/e2e/utils/hardcoded-detector.js.map +1 -0
- package/dist/tests/e2e/utils/index.d.ts +7 -0
- package/dist/tests/e2e/utils/index.d.ts.map +1 -0
- package/dist/tests/e2e/utils/index.js +7 -0
- package/dist/tests/e2e/utils/index.js.map +1 -0
- package/dist/tests/e2e/utils/linear-reporter.d.ts +60 -0
- package/dist/tests/e2e/utils/linear-reporter.d.ts.map +1 -0
- package/dist/tests/e2e/utils/linear-reporter.js +232 -0
- package/dist/tests/e2e/utils/linear-reporter.js.map +1 -0
- package/dist/tests/health.test.d.ts +9 -0
- package/dist/tests/health.test.d.ts.map +1 -0
- package/dist/tests/health.test.js +308 -0
- package/dist/tests/health.test.js.map +1 -0
- package/dist/tests/integration/analyze.integration.test.d.ts +2 -0
- package/dist/tests/integration/analyze.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/analyze.integration.test.js +244 -0
- package/dist/tests/integration/analyze.integration.test.js.map +1 -0
- package/dist/tests/integration/compare.integration.test.d.ts +2 -0
- package/dist/tests/integration/compare.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/compare.integration.test.js +120 -0
- package/dist/tests/integration/compare.integration.test.js.map +1 -0
- package/dist/tests/integration/fixtures/test-skills.d.ts +62 -0
- package/dist/tests/integration/fixtures/test-skills.d.ts.map +1 -0
- package/dist/tests/integration/fixtures/test-skills.js +644 -0
- package/dist/tests/integration/fixtures/test-skills.js.map +1 -0
- package/dist/tests/integration/get-skill.integration.test.d.ts +6 -0
- package/dist/tests/integration/get-skill.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/get-skill.integration.test.js +203 -0
- package/dist/tests/integration/get-skill.integration.test.js.map +1 -0
- package/dist/tests/integration/github-api.integration.test.d.ts +14 -0
- package/dist/tests/integration/github-api.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/github-api.integration.test.js +190 -0
- package/dist/tests/integration/github-api.integration.test.js.map +1 -0
- package/dist/tests/integration/install.integration.test.d.ts +6 -0
- package/dist/tests/integration/install.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/install.integration.test.js +282 -0
- package/dist/tests/integration/install.integration.test.js.map +1 -0
- package/dist/tests/integration/recommend.integration.test.d.ts +2 -0
- package/dist/tests/integration/recommend.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/recommend.integration.test.js +215 -0
- package/dist/tests/integration/recommend.integration.test.js.map +1 -0
- package/dist/tests/integration/search.integration.test.d.ts +6 -0
- package/dist/tests/integration/search.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/search.integration.test.js +229 -0
- package/dist/tests/integration/search.integration.test.js.map +1 -0
- package/dist/tests/integration/setup.d.ts +71 -0
- package/dist/tests/integration/setup.d.ts.map +1 -0
- package/dist/tests/integration/setup.js +124 -0
- package/dist/tests/integration/setup.js.map +1 -0
- package/dist/tests/integration/uninstall.integration.test.d.ts +6 -0
- package/dist/tests/integration/uninstall.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/uninstall.integration.test.js +296 -0
- package/dist/tests/integration/uninstall.integration.test.js.map +1 -0
- package/dist/tests/integration/validate.integration.test.d.ts +2 -0
- package/dist/tests/integration/validate.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/validate.integration.test.js +181 -0
- package/dist/tests/integration/validate.integration.test.js.map +1 -0
- package/dist/tests/onboarding/first-run.test.d.ts +7 -0
- package/dist/tests/onboarding/first-run.test.d.ts.map +1 -0
- package/dist/tests/onboarding/first-run.test.js +258 -0
- package/dist/tests/onboarding/first-run.test.js.map +1 -0
- package/dist/tests/performance/search-performance.test.d.ts +10 -0
- package/dist/tests/performance/search-performance.test.d.ts.map +1 -0
- package/dist/tests/performance/search-performance.test.js +218 -0
- package/dist/tests/performance/search-performance.test.js.map +1 -0
- package/dist/tests/recommend.test.d.ts +6 -0
- package/dist/tests/recommend.test.d.ts.map +1 -0
- package/dist/tests/recommend.test.js +208 -0
- package/dist/tests/recommend.test.js.map +1 -0
- package/dist/tests/suggestions/suggestion-engine.test.d.ts +6 -0
- package/dist/tests/suggestions/suggestion-engine.test.d.ts.map +1 -0
- package/dist/tests/suggestions/suggestion-engine.test.js +448 -0
- package/dist/tests/suggestions/suggestion-engine.test.js.map +1 -0
- package/dist/tests/test-utils.d.ts +74 -0
- package/dist/tests/test-utils.d.ts.map +1 -0
- package/dist/tests/test-utils.js +98 -0
- package/dist/tests/test-utils.js.map +1 -0
- package/dist/tests/tools.test.d.ts +5 -0
- package/dist/tests/tools.test.d.ts.map +1 -0
- package/dist/tests/tools.test.js +138 -0
- package/dist/tests/tools.test.js.map +1 -0
- package/dist/tests/unit/installed-skills.test.d.ts +6 -0
- package/dist/tests/unit/installed-skills.test.d.ts.map +1 -0
- package/dist/tests/unit/installed-skills.test.js +285 -0
- package/dist/tests/unit/installed-skills.test.js.map +1 -0
- package/dist/tests/unit/logger.test.d.ts +6 -0
- package/dist/tests/unit/logger.test.d.ts.map +1 -0
- package/dist/tests/unit/logger.test.js +281 -0
- package/dist/tests/unit/logger.test.js.map +1 -0
- package/dist/tests/validate.test.d.ts +5 -0
- package/dist/tests/validate.test.d.ts.map +1 -0
- package/dist/tests/validate.test.js +303 -0
- package/dist/tests/validate.test.js.map +1 -0
- package/dist/tests/webhooks/proxy-trust.security.test.d.ts +8 -0
- package/dist/tests/webhooks/proxy-trust.security.test.d.ts.map +1 -0
- package/dist/tests/webhooks/proxy-trust.security.test.js +145 -0
- package/dist/tests/webhooks/proxy-trust.security.test.js.map +1 -0
- package/dist/tests/webhooks/rate-limiter.security.test.d.ts +8 -0
- package/dist/tests/webhooks/rate-limiter.security.test.d.ts.map +1 -0
- package/dist/tests/webhooks/rate-limiter.security.test.js +122 -0
- package/dist/tests/webhooks/rate-limiter.security.test.js.map +1 -0
- package/dist/vitest.config.d.ts +6 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/vitest.config.js +13 -0
- package/dist/vitest.config.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview MCP Get Skill Tool for retrieving detailed skill information
|
|
3
|
+
* @module @skillsmith/mcp-server/tools/get-skill
|
|
4
|
+
* @see {@link https://github.com/wrsmith108/skillsmith|Skillsmith Repository}
|
|
5
|
+
* @see SMI-790: Wire get-skill tool to SkillRepository
|
|
6
|
+
*
|
|
7
|
+
* Retrieves comprehensive details for a specific skill including:
|
|
8
|
+
* - Basic metadata (name, author, version, category)
|
|
9
|
+
* - Quality scores with breakdown (quality, popularity, maintenance, security, documentation)
|
|
10
|
+
* - Trust tier with explanation
|
|
11
|
+
* - Repository link and tags
|
|
12
|
+
* - Installation command
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Get skill by ID with context
|
|
16
|
+
* const response = await executeGetSkill({ id: 'anthropic/commit' }, context);
|
|
17
|
+
* console.log(response.skill.description);
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Format for terminal display
|
|
21
|
+
* const response = await executeGetSkill({ id: 'community/jest-helper' }, context);
|
|
22
|
+
* console.log(formatSkillDetails(response));
|
|
23
|
+
*/
|
|
24
|
+
import { z } from 'zod';
|
|
25
|
+
import { TrustTierDescriptions, SkillsmithError, ErrorCodes, } from '@skillsmith/core';
|
|
26
|
+
import { isValidSkillId, mapTrustTierFromDb, extractCategoryFromTags } from '../utils/validation.js';
|
|
27
|
+
/**
|
|
28
|
+
* Zod schema for get-skill input validation
|
|
29
|
+
*/
|
|
30
|
+
export const getSkillInputSchema = z.object({
|
|
31
|
+
id: z.string().min(1, 'Skill ID is required'),
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Get skill tool schema for MCP
|
|
35
|
+
*/
|
|
36
|
+
export const getSkillToolSchema = {
|
|
37
|
+
name: 'get_skill',
|
|
38
|
+
description: 'Get full details for a specific skill by ID',
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
id: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'The skill ID (e.g., "anthropic/commit" or UUID)',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
required: ['id'],
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
// isValidSkillId imported from ../utils/validation.js
|
|
51
|
+
/**
|
|
52
|
+
* Retrieve full details for a specific skill by ID.
|
|
53
|
+
*
|
|
54
|
+
* Uses SkillRepository to fetch skill from the SQLite database.
|
|
55
|
+
*
|
|
56
|
+
* @param input - Input containing the skill ID to retrieve
|
|
57
|
+
* @param context - Tool context with database and services
|
|
58
|
+
* @returns Promise resolving to skill details and install command
|
|
59
|
+
* @throws {SkillsmithError} VALIDATION_REQUIRED_FIELD - When ID is empty
|
|
60
|
+
* @throws {SkillsmithError} SKILL_INVALID_ID - When ID format is invalid
|
|
61
|
+
* @throws {SkillsmithError} SKILL_NOT_FOUND - When skill doesn't exist
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // Get a verified skill
|
|
65
|
+
* const response = await executeGetSkill({ id: 'anthropic/commit' }, context);
|
|
66
|
+
* console.log(response.skill.score); // 95
|
|
67
|
+
* console.log(response.installCommand); // 'claude skill add anthropic/commit'
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* // Handle not found
|
|
71
|
+
* try {
|
|
72
|
+
* await executeGetSkill({ id: 'unknown/skill' }, context);
|
|
73
|
+
* } catch (error) {
|
|
74
|
+
* if (error.code === 'SKILL_NOT_FOUND') {
|
|
75
|
+
* console.log(error.suggestion); // 'Try searching for similar skills...'
|
|
76
|
+
* }
|
|
77
|
+
* }
|
|
78
|
+
*/
|
|
79
|
+
export async function executeGetSkill(input, context) {
|
|
80
|
+
const startTime = performance.now();
|
|
81
|
+
// Validate input
|
|
82
|
+
if (!input.id || input.id.trim().length === 0) {
|
|
83
|
+
throw new SkillsmithError(ErrorCodes.VALIDATION_REQUIRED_FIELD, 'Skill ID is required', {
|
|
84
|
+
details: { field: 'id' },
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const skillId = input.id.trim();
|
|
88
|
+
// Validate ID format
|
|
89
|
+
if (!isValidSkillId(skillId)) {
|
|
90
|
+
throw new SkillsmithError(ErrorCodes.SKILL_INVALID_ID, 'Invalid skill ID format: "' + input.id + '"', {
|
|
91
|
+
details: { id: input.id },
|
|
92
|
+
suggestion: 'Skill IDs should be in format "author/skill-name" (e.g., "anthropic/commit") or a valid UUID',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Look up skill from database using SkillRepository
|
|
96
|
+
const dbSkill = context.skillRepository.findById(skillId);
|
|
97
|
+
if (!dbSkill) {
|
|
98
|
+
throw new SkillsmithError(ErrorCodes.SKILL_NOT_FOUND, 'Skill "' + input.id + '" not found', {
|
|
99
|
+
details: { id: input.id },
|
|
100
|
+
suggestion: 'Try searching for similar skills with the search tool',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
// Convert database skill to MCP skill format
|
|
104
|
+
const skill = {
|
|
105
|
+
id: dbSkill.id,
|
|
106
|
+
name: dbSkill.name,
|
|
107
|
+
description: dbSkill.description || '',
|
|
108
|
+
author: dbSkill.author || 'unknown',
|
|
109
|
+
repository: dbSkill.repoUrl || undefined,
|
|
110
|
+
version: undefined, // Version not stored in current schema
|
|
111
|
+
category: extractCategoryFromTags(dbSkill.tags),
|
|
112
|
+
trustTier: mapTrustTierFromDb(dbSkill.trustTier),
|
|
113
|
+
score: Math.round((dbSkill.qualityScore ?? 0) * 100),
|
|
114
|
+
scoreBreakdown: undefined, // Breakdown not stored in current schema
|
|
115
|
+
tags: dbSkill.tags || [],
|
|
116
|
+
installCommand: 'claude skill add ' + dbSkill.id,
|
|
117
|
+
createdAt: dbSkill.createdAt,
|
|
118
|
+
updatedAt: dbSkill.updatedAt,
|
|
119
|
+
};
|
|
120
|
+
const endTime = performance.now();
|
|
121
|
+
return {
|
|
122
|
+
skill,
|
|
123
|
+
installCommand: skill.installCommand || 'claude skill add ' + skill.id,
|
|
124
|
+
timing: {
|
|
125
|
+
totalMs: Math.round(endTime - startTime),
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Format skill details for terminal/CLI display.
|
|
131
|
+
*
|
|
132
|
+
* Produces a comprehensive human-readable string including:
|
|
133
|
+
* - Basic info (ID, author, version, category)
|
|
134
|
+
* - Full description
|
|
135
|
+
* - Trust tier with explanation
|
|
136
|
+
* - Visual score breakdown bars
|
|
137
|
+
* - Repository and tags
|
|
138
|
+
* - Installation command
|
|
139
|
+
*
|
|
140
|
+
* @param response - Get skill response from executeGetSkill
|
|
141
|
+
* @returns Formatted string suitable for terminal output
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* const response = await executeGetSkill({ id: 'anthropic/commit' });
|
|
145
|
+
* console.log(formatSkillDetails(response));
|
|
146
|
+
* // Output:
|
|
147
|
+
* // === commit ===
|
|
148
|
+
* // ID: anthropic/commit
|
|
149
|
+
* // Author: anthropic
|
|
150
|
+
* // Version: 1.2.0
|
|
151
|
+
* // ...
|
|
152
|
+
*/
|
|
153
|
+
export function formatSkillDetails(response) {
|
|
154
|
+
const skill = response.skill;
|
|
155
|
+
const lines = [];
|
|
156
|
+
lines.push('\n=== ' + skill.name + ' ===\n');
|
|
157
|
+
// Basic info
|
|
158
|
+
lines.push('ID: ' + skill.id);
|
|
159
|
+
lines.push('Author: ' + skill.author);
|
|
160
|
+
lines.push('Version: ' + (skill.version || 'N/A'));
|
|
161
|
+
lines.push('Category: ' + skill.category);
|
|
162
|
+
lines.push('');
|
|
163
|
+
// Description
|
|
164
|
+
lines.push('Description:');
|
|
165
|
+
lines.push(' ' + skill.description);
|
|
166
|
+
lines.push('');
|
|
167
|
+
// Trust tier with explanation
|
|
168
|
+
lines.push('Trust Tier: ' + formatTrustTier(skill.trustTier));
|
|
169
|
+
lines.push(' ' + TrustTierDescriptions[skill.trustTier]);
|
|
170
|
+
lines.push('');
|
|
171
|
+
// Score breakdown
|
|
172
|
+
lines.push('Overall Score: ' + skill.score + '/100');
|
|
173
|
+
if (skill.scoreBreakdown) {
|
|
174
|
+
lines.push('Score Breakdown:');
|
|
175
|
+
lines.push(' Quality: ' + formatScoreBar(skill.scoreBreakdown.quality));
|
|
176
|
+
lines.push(' Popularity: ' + formatScoreBar(skill.scoreBreakdown.popularity));
|
|
177
|
+
lines.push(' Maintenance: ' + formatScoreBar(skill.scoreBreakdown.maintenance));
|
|
178
|
+
lines.push(' Security: ' + formatScoreBar(skill.scoreBreakdown.security));
|
|
179
|
+
lines.push(' Documentation: ' + formatScoreBar(skill.scoreBreakdown.documentation));
|
|
180
|
+
}
|
|
181
|
+
lines.push('');
|
|
182
|
+
// Repository
|
|
183
|
+
if (skill.repository) {
|
|
184
|
+
lines.push('Repository: ' + skill.repository);
|
|
185
|
+
}
|
|
186
|
+
// Tags
|
|
187
|
+
if (skill.tags && skill.tags.length > 0) {
|
|
188
|
+
lines.push('Tags: ' + skill.tags.join(', '));
|
|
189
|
+
}
|
|
190
|
+
lines.push('');
|
|
191
|
+
// Installation
|
|
192
|
+
lines.push('--- Installation ---');
|
|
193
|
+
lines.push(' ' + response.installCommand);
|
|
194
|
+
lines.push('');
|
|
195
|
+
// Timing
|
|
196
|
+
lines.push('---');
|
|
197
|
+
lines.push('Retrieved in ' + response.timing.totalMs + 'ms');
|
|
198
|
+
return lines.join('\n');
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Format trust tier with visual indicator
|
|
202
|
+
*/
|
|
203
|
+
function formatTrustTier(tier) {
|
|
204
|
+
switch (tier) {
|
|
205
|
+
case 'verified':
|
|
206
|
+
return '[*] VERIFIED';
|
|
207
|
+
case 'community':
|
|
208
|
+
return '[+] COMMUNITY';
|
|
209
|
+
case 'standard':
|
|
210
|
+
return '[=] STANDARD';
|
|
211
|
+
case 'unverified':
|
|
212
|
+
return '[?] UNVERIFIED';
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Format score as a visual bar
|
|
217
|
+
*/
|
|
218
|
+
function formatScoreBar(score) {
|
|
219
|
+
const filled = Math.round(score / 10);
|
|
220
|
+
const empty = 10 - filled;
|
|
221
|
+
const bar = '='.repeat(filled) + '-'.repeat(empty);
|
|
222
|
+
return '[' + bar + '] ' + score + '/100';
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=get-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-skill.js","sourceRoot":"","sources":["../../../src/tools/get-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAIL,qBAAqB,EACrB,eAAe,EACf,UAAU,GACX,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAEpG;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC;CAC9C,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,6CAA6C;IAC1D,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,EAAE,EAAE;gBACF,IAAI,EAAE,QAA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Ae,CAAC,IAAe;IACtC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU;YACb,OAAO,cAAc,CAAA;QACvB,KAAK,WAAW;YACd,OAAO,eAAe,CAAA;QACxB,KAAK,UAAU;YACb,OAAO,cAAc,CAAA;QACvB,KAAK,YAAY;YACf,OAAO,gBAAgB,CAAA;IAC3B,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,KAAa;IACnC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAA;IACrC,MAAM,KAAK,GAAG,EAAE,GAAG,MAAM,CAAA;IACzB,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAClD,OAAO,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,CAAA;AAC1C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools exports
|
|
3
|
+
*/
|
|
4
|
+
export { searchToolSchema, executeSearch, formatSearchResults } from './search.js';
|
|
5
|
+
export type { SearchInput } from './search.js';
|
|
6
|
+
export { installTool, installSkill, installInputSchema } from './install.js';
|
|
7
|
+
export type { InstallInput, InstallResult } from './install.js';
|
|
8
|
+
export { uninstallTool, uninstallSkill, uninstallInputSchema, listInstalledSkills, } from './uninstall.js';
|
|
9
|
+
export type { UninstallInput, UninstallResult } from './uninstall.js';
|
|
10
|
+
export { getSkillToolSchema, executeGetSkill } from './get-skill.js';
|
|
11
|
+
export type { GetSkillInput } from './get-skill.js';
|
|
12
|
+
export { recommendToolSchema, recommendInputSchema, executeRecommend, formatRecommendations, } from './recommend.js';
|
|
13
|
+
export type { RecommendInput, SkillRecommendation, RecommendResponse } from './recommend.js';
|
|
14
|
+
export { validateToolSchema, validateInputSchema, executeValidate, formatValidationResults, } from './validate.js';
|
|
15
|
+
export type { ValidateInput, ValidationError, ValidateResponse } from './validate.js';
|
|
16
|
+
export { compareToolSchema, compareInputSchema, executeCompare, formatComparisonResults, } from './compare.js';
|
|
17
|
+
export type { CompareInput, SkillSummary, SkillDifference, CompareResponse } from './compare.js';
|
|
18
|
+
export { analyzeToolSchema, analyzeInputSchema, executeAnalyze, formatAnalysisResults, } from './analyze.js';
|
|
19
|
+
export type { AnalyzeInput, AnalyzeFramework, AnalyzeDependency, AnalyzeResponse, } from './analyze.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAClF,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAG9C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5E,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAG/D,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGrE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACpE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAGnD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAG5F,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,uBAAuB,GACxB,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGrF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,uBAAuB,GACxB,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAGhG,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools exports
|
|
3
|
+
*/
|
|
4
|
+
// Search tool (SMI-581)
|
|
5
|
+
export { searchToolSchema, executeSearch, formatSearchResults } from './search.js';
|
|
6
|
+
// Install tool (SMI-586)
|
|
7
|
+
export { installTool, installSkill, installInputSchema } from './install.js';
|
|
8
|
+
// Uninstall tool (SMI-588)
|
|
9
|
+
export { uninstallTool, uninstallSkill, uninstallInputSchema, listInstalledSkills, } from './uninstall.js';
|
|
10
|
+
// Get skill tool (SMI-582)
|
|
11
|
+
export { getSkillToolSchema, executeGetSkill } from './get-skill.js';
|
|
12
|
+
// Recommend tool (SMI-741)
|
|
13
|
+
export { recommendToolSchema, recommendInputSchema, executeRecommend, formatRecommendations, } from './recommend.js';
|
|
14
|
+
// Validate tool (SMI-742)
|
|
15
|
+
export { validateToolSchema, validateInputSchema, executeValidate, formatValidationResults, } from './validate.js';
|
|
16
|
+
// Compare tool (SMI-743)
|
|
17
|
+
export { compareToolSchema, compareInputSchema, executeCompare, formatComparisonResults, } from './compare.js';
|
|
18
|
+
// Analyze codebase tool (SMI-600)
|
|
19
|
+
export { analyzeToolSchema, analyzeInputSchema, executeAnalyze, formatAnalysisResults, } from './analyze.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAwB;AACxB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGlF,yBAAyB;AACzB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAG5E,2BAA2B;AAC3B,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gBAAgB,CAAA;AAGvB,2BAA2B;AAC3B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGpE,2BAA2B;AAC3B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,gBAAgB,CAAA;AAGvB,0BAA0B;AAC1B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,uBAAuB,GACxB,MAAM,eAAe,CAAA;AAGtB,yBAAyB;AACzB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,uBAAuB,GACxB,MAAM,cAAc,CAAA;AAGrB,kCAAkC;AAClC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview MCP Install Skill Tool for downloading and installing skills
|
|
3
|
+
* @module @skillsmith/mcp-server/tools/install
|
|
4
|
+
* @see {@link https://github.com/wrsmith108/skillsmith|Skillsmith Repository}
|
|
5
|
+
*
|
|
6
|
+
* Provides skill installation functionality with:
|
|
7
|
+
* - GitHub repository fetching (supports owner/repo and full URLs)
|
|
8
|
+
* - Automatic security scanning before installation
|
|
9
|
+
* - SKILL.md validation
|
|
10
|
+
* - Manifest tracking of installed skills
|
|
11
|
+
* - Optional file fetching (README.md, examples.md, config.json)
|
|
12
|
+
*
|
|
13
|
+
* Skills are installed to ~/.claude/skills/ and tracked in ~/.skillsmith/manifest.json
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Install from owner/repo format
|
|
17
|
+
* const result = await installSkill({ skillId: 'anthropic/commit' });
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Install from GitHub URL
|
|
21
|
+
* const result = await installSkill({
|
|
22
|
+
* skillId: 'https://github.com/user/repo/tree/main/skills/my-skill'
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Force reinstall with security scan skip
|
|
27
|
+
* const result = await installSkill({
|
|
28
|
+
* skillId: 'community/helper',
|
|
29
|
+
* force: true,
|
|
30
|
+
* skipScan: true // Not recommended
|
|
31
|
+
* });
|
|
32
|
+
*/
|
|
33
|
+
import { z } from 'zod';
|
|
34
|
+
import { type ScanReport } from '@skillsmith/core';
|
|
35
|
+
import type { ToolContext } from '../context.js';
|
|
36
|
+
export declare const installInputSchema: z.ZodObject<{
|
|
37
|
+
skillId: z.ZodString;
|
|
38
|
+
force: z.ZodDefault<z.ZodBoolean>;
|
|
39
|
+
skipScan: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
skillId: string;
|
|
42
|
+
force: boolean;
|
|
43
|
+
skipScan: boolean;
|
|
44
|
+
}, {
|
|
45
|
+
skillId: string;
|
|
46
|
+
force?: boolean | undefined;
|
|
47
|
+
skipScan?: boolean | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
export type InstallInput = z.infer<typeof installInputSchema>;
|
|
50
|
+
export interface InstallResult {
|
|
51
|
+
success: boolean;
|
|
52
|
+
skillId: string;
|
|
53
|
+
installPath: string;
|
|
54
|
+
securityReport?: ScanReport;
|
|
55
|
+
tips?: string[];
|
|
56
|
+
error?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Install a skill from GitHub to the local Claude Code skills directory.
|
|
60
|
+
*
|
|
61
|
+
* This function:
|
|
62
|
+
* 1. Parses the skill ID or GitHub URL
|
|
63
|
+
* 2. Checks if already installed (returns error unless force=true)
|
|
64
|
+
* 3. Fetches SKILL.md from GitHub (required)
|
|
65
|
+
* 4. Validates SKILL.md content
|
|
66
|
+
* 5. Runs security scan (unless skipScan=true)
|
|
67
|
+
* 6. Creates installation directory at ~/.claude/skills/{skillName}
|
|
68
|
+
* 7. Writes skill files
|
|
69
|
+
* 8. Updates manifest at ~/.skillsmith/manifest.json
|
|
70
|
+
*
|
|
71
|
+
* @param input - Installation parameters
|
|
72
|
+
* @param input.skillId - Skill ID (owner/repo) or full GitHub URL
|
|
73
|
+
* @param input.force - Force reinstall if skill already exists (default: false)
|
|
74
|
+
* @param input.skipScan - Skip security scan (default: false, not recommended)
|
|
75
|
+
* @returns Promise resolving to installation result with success status
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // Successful installation
|
|
79
|
+
* const result = await installSkill({ skillId: 'anthropic/commit' });
|
|
80
|
+
* if (result.success) {
|
|
81
|
+
* console.log(`Installed to ${result.installPath}`);
|
|
82
|
+
* result.tips?.forEach(tip => console.log(tip));
|
|
83
|
+
* }
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* // Handle security scan failure
|
|
87
|
+
* const result = await installSkill({ skillId: 'untrusted/skill' });
|
|
88
|
+
* if (!result.success && result.securityReport) {
|
|
89
|
+
* console.log('Security issues found:');
|
|
90
|
+
* result.securityReport.findings.forEach(f =>
|
|
91
|
+
* console.log(` ${f.severity}: ${f.message}`)
|
|
92
|
+
* );
|
|
93
|
+
* }
|
|
94
|
+
*/
|
|
95
|
+
export declare function installSkill(input: InstallInput, _context?: ToolContext): Promise<InstallResult>;
|
|
96
|
+
/**
|
|
97
|
+
* MCP tool definition
|
|
98
|
+
*/
|
|
99
|
+
export declare const installTool: {
|
|
100
|
+
name: string;
|
|
101
|
+
description: string;
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: "object";
|
|
104
|
+
properties: {
|
|
105
|
+
skillId: {
|
|
106
|
+
type: string;
|
|
107
|
+
description: string;
|
|
108
|
+
};
|
|
109
|
+
force: {
|
|
110
|
+
type: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
skipScan: {
|
|
114
|
+
type: string;
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
required: string[];
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
export default installTool;
|
|
122
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/tools/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAInE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAG7D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,UAAU,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAkID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,WAAW,GACrB,OAAO,CAAC,aAAa,CAAC,CA4HxB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAsBvB,CAAA;AAED,eAAe,WAAW,CAAA"}
|