@skillsmith/core 0.4.15 → 0.4.16
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 -1
- package/dist/src/analysis/DependencyMerger.d.ts +39 -0
- package/dist/src/analysis/DependencyMerger.d.ts.map +1 -0
- package/dist/src/analysis/DependencyMerger.js +191 -0
- package/dist/src/analysis/DependencyMerger.js.map +1 -0
- package/dist/src/analysis/DependencyMerger.test.d.ts +2 -0
- package/dist/src/analysis/DependencyMerger.test.d.ts.map +1 -0
- package/dist/src/analysis/DependencyMerger.test.js +258 -0
- package/dist/src/analysis/DependencyMerger.test.js.map +1 -0
- package/dist/src/analysis/McpReferenceExtractor.d.ts +42 -0
- package/dist/src/analysis/McpReferenceExtractor.d.ts.map +1 -0
- package/dist/src/analysis/McpReferenceExtractor.js +92 -0
- package/dist/src/analysis/McpReferenceExtractor.js.map +1 -0
- package/dist/src/analysis/McpReferenceExtractor.test.d.ts +2 -0
- package/dist/src/analysis/McpReferenceExtractor.test.d.ts.map +1 -0
- package/dist/src/analysis/McpReferenceExtractor.test.js +262 -0
- package/dist/src/analysis/McpReferenceExtractor.test.js.map +1 -0
- package/dist/src/api/schemas.d.ts +4 -4
- package/dist/src/db/drivers/sqljsDriver.d.ts.map +1 -1
- package/dist/src/db/drivers/sqljsDriver.js +4 -8
- package/dist/src/db/drivers/sqljsDriver.js.map +1 -1
- package/dist/src/db/migrations/v10-dependencies.d.ts +18 -0
- package/dist/src/db/migrations/v10-dependencies.d.ts.map +1 -0
- package/dist/src/db/migrations/v10-dependencies.js +50 -0
- package/dist/src/db/migrations/v10-dependencies.js.map +1 -0
- package/dist/src/db/migrations/v2-phase5-columns.d.ts +7 -0
- package/dist/src/db/migrations/v2-phase5-columns.d.ts.map +1 -0
- package/dist/src/db/migrations/v2-phase5-columns.js +16 -0
- package/dist/src/db/migrations/v2-phase5-columns.js.map +1 -0
- package/dist/src/db/migrations/v3-sync-tables.d.ts +6 -0
- package/dist/src/db/migrations/v3-sync-tables.d.ts.map +1 -0
- package/dist/src/db/migrations/v3-sync-tables.js +41 -0
- package/dist/src/db/migrations/v3-sync-tables.js.map +1 -0
- package/dist/src/db/migrations/v4-security-columns.d.ts +7 -0
- package/dist/src/db/migrations/v4-security-columns.d.ts.map +1 -0
- package/dist/src/db/migrations/v4-security-columns.js +17 -0
- package/dist/src/db/migrations/v4-security-columns.js.map +1 -0
- package/dist/src/db/schema.d.ts +1 -1
- package/dist/src/db/schema.d.ts.map +1 -1
- package/dist/src/db/schema.js +14 -58
- package/dist/src/db/schema.js.map +1 -1
- package/dist/src/exports/repositories.d.ts +1 -0
- package/dist/src/exports/repositories.d.ts.map +1 -1
- package/dist/src/exports/repositories.js +4 -0
- package/dist/src/exports/repositories.js.map +1 -1
- package/dist/src/exports/services.d.ts +2 -0
- package/dist/src/exports/services.d.ts.map +1 -1
- package/dist/src/exports/services.js +5 -0
- package/dist/src/exports/services.js.map +1 -1
- package/dist/src/exports/types.d.ts +1 -0
- package/dist/src/exports/types.d.ts.map +1 -1
- package/dist/src/exports/types.js.map +1 -1
- package/dist/src/indexer/GitHubIndexer.d.ts +3 -1
- package/dist/src/indexer/GitHubIndexer.d.ts.map +1 -1
- package/dist/src/indexer/GitHubIndexer.js.map +1 -1
- package/dist/src/indexer/SkillParser.d.ts +20 -9
- package/dist/src/indexer/SkillParser.d.ts.map +1 -1
- package/dist/src/indexer/SkillParser.js +17 -10
- package/dist/src/indexer/SkillParser.js.map +1 -1
- package/dist/src/repositories/IndexerRepository.d.ts.map +1 -1
- package/dist/src/repositories/IndexerRepository.js +5 -1
- package/dist/src/repositories/IndexerRepository.js.map +1 -1
- package/dist/src/repositories/SkillDependencyRepository.d.ts +73 -0
- package/dist/src/repositories/SkillDependencyRepository.d.ts.map +1 -0
- package/dist/src/repositories/SkillDependencyRepository.js +199 -0
- package/dist/src/repositories/SkillDependencyRepository.js.map +1 -0
- package/dist/src/scripts/validation/types.d.ts +2 -2
- package/dist/src/sources/SourceIndexer.d.ts +3 -1
- package/dist/src/sources/SourceIndexer.d.ts.map +1 -1
- package/dist/src/sources/SourceIndexer.js.map +1 -1
- package/dist/src/types/dependencies.d.ts +85 -0
- package/dist/src/types/dependencies.d.ts.map +1 -0
- package/dist/src/types/dependencies.js +11 -0
- package/dist/src/types/dependencies.js.map +1 -0
- package/dist/src/types/skill.d.ts +3 -0
- package/dist/src/types/skill.d.ts.map +1 -1
- package/dist/src/types/skill.js.map +1 -1
- package/dist/src/types.d.ts +2 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tests/DailyIndexPipeline.test.js +3 -3
- package/dist/tests/DailyIndexPipeline.test.js.map +1 -1
- package/dist/tests/GitHubIndexer.test.js +4 -2
- package/dist/tests/GitHubIndexer.test.js.map +1 -1
- package/dist/tests/edge-cases/EdgeCases.test.js +4 -1
- package/dist/tests/edge-cases/EdgeCases.test.js.map +1 -1
- package/dist/tests/repositories/SkillDependencyRepository.test.d.ts +10 -0
- package/dist/tests/repositories/SkillDependencyRepository.test.d.ts.map +1 -0
- package/dist/tests/repositories/SkillDependencyRepository.test.js +336 -0
- package/dist/tests/repositories/SkillDependencyRepository.test.js.map +1 -0
- package/dist/tests/sources.test.js +1 -1
- package/dist/tests/sources.test.js.map +1 -1
- package/dist/tests/unit/migrations/v10-dependencies.test.d.ts +6 -0
- package/dist/tests/unit/migrations/v10-dependencies.test.d.ts.map +1 -0
- package/dist/tests/unit/migrations/v10-dependencies.test.js +166 -0
- package/dist/tests/unit/migrations/v10-dependencies.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Merges declared and inferred dependencies into a flat list
|
|
3
|
+
* @module @skillsmith/core/analysis/DependencyMerger
|
|
4
|
+
* @see SMI-3146: Build DependencyMerger
|
|
5
|
+
*
|
|
6
|
+
* Combines frontmatter-declared dependencies with statically inferred
|
|
7
|
+
* MCP references, deduplicating where declared trumps inferred.
|
|
8
|
+
*/
|
|
9
|
+
import type { DependencyDeclaration, DepSource, DepType } from '../types/dependencies.js';
|
|
10
|
+
import type { McpExtractionResult } from './McpReferenceExtractor.js';
|
|
11
|
+
/** A single merged dependency ready for database insertion */
|
|
12
|
+
export interface MergedDependency {
|
|
13
|
+
/** Dependency category, e.g. 'mcp_server', 'skill_hard' */
|
|
14
|
+
depType: DepType;
|
|
15
|
+
/** Target identifier, e.g. 'linear', 'claude-flow' */
|
|
16
|
+
depTarget: string;
|
|
17
|
+
/** Semver constraint or null */
|
|
18
|
+
depVersion: string | null;
|
|
19
|
+
/** How the dependency was discovered */
|
|
20
|
+
depSource: DepSource;
|
|
21
|
+
/** Confidence score (1.0 for declared, 0.9/0.5 for inferred) */
|
|
22
|
+
confidence: number | null;
|
|
23
|
+
/** JSON-serialized metadata or null */
|
|
24
|
+
metadata: string | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Merge declared dependencies from SKILL.md frontmatter with
|
|
28
|
+
* inferred MCP references from static content analysis.
|
|
29
|
+
*
|
|
30
|
+
* Declared dependencies always take precedence: if a server appears
|
|
31
|
+
* in both declared MCP servers and inferred references, only the
|
|
32
|
+
* declared entry is included.
|
|
33
|
+
*
|
|
34
|
+
* @param declared - Parsed dependency declaration from frontmatter
|
|
35
|
+
* @param inferred - MCP references extracted from content
|
|
36
|
+
* @returns Flat array of merged dependencies
|
|
37
|
+
*/
|
|
38
|
+
export declare function mergeDependencies(declared: DependencyDeclaration | undefined, inferred: McpExtractionResult): MergedDependency[];
|
|
39
|
+
//# sourceMappingURL=DependencyMerger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyMerger.d.ts","sourceRoot":"","sources":["../../../src/analysis/DependencyMerger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAErE,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,OAAO,EAAE,OAAO,CAAA;IAChB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,wCAAwC;IACxC,SAAS,EAAE,SAAS,CAAA;IACpB,gEAAgE;IAChE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,qBAAqB,GAAG,SAAS,EAC3C,QAAQ,EAAE,mBAAmB,GAC5B,gBAAgB,EAAE,CAepB"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Merges declared and inferred dependencies into a flat list
|
|
3
|
+
* @module @skillsmith/core/analysis/DependencyMerger
|
|
4
|
+
* @see SMI-3146: Build DependencyMerger
|
|
5
|
+
*
|
|
6
|
+
* Combines frontmatter-declared dependencies with statically inferred
|
|
7
|
+
* MCP references, deduplicating where declared trumps inferred.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Merge declared dependencies from SKILL.md frontmatter with
|
|
11
|
+
* inferred MCP references from static content analysis.
|
|
12
|
+
*
|
|
13
|
+
* Declared dependencies always take precedence: if a server appears
|
|
14
|
+
* in both declared MCP servers and inferred references, only the
|
|
15
|
+
* declared entry is included.
|
|
16
|
+
*
|
|
17
|
+
* @param declared - Parsed dependency declaration from frontmatter
|
|
18
|
+
* @param inferred - MCP references extracted from content
|
|
19
|
+
* @returns Flat array of merged dependencies
|
|
20
|
+
*/
|
|
21
|
+
export function mergeDependencies(declared, inferred) {
|
|
22
|
+
const result = [];
|
|
23
|
+
const declaredMcpServers = new Set();
|
|
24
|
+
if (declared) {
|
|
25
|
+
addSkillDeps(declared, result);
|
|
26
|
+
addPlatformDeps(declared, result, declaredMcpServers);
|
|
27
|
+
addModelDeps(declared, result);
|
|
28
|
+
addEnvironmentDeps(declared, result);
|
|
29
|
+
addConflicts(declared, result);
|
|
30
|
+
}
|
|
31
|
+
addInferredMcp(inferred, declaredMcpServers, result);
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
/** Add skill-to-skill dependencies */
|
|
35
|
+
function addSkillDeps(declared, result) {
|
|
36
|
+
if (!declared.skills)
|
|
37
|
+
return;
|
|
38
|
+
for (const skill of declared.skills) {
|
|
39
|
+
const depType = skill.type === 'hard' ? 'skill_hard' : skill.type === 'soft' ? 'skill_soft' : 'skill_peer';
|
|
40
|
+
result.push({
|
|
41
|
+
depType,
|
|
42
|
+
depTarget: skill.name,
|
|
43
|
+
depVersion: skill.version ?? null,
|
|
44
|
+
depSource: 'declared',
|
|
45
|
+
confidence: 1.0,
|
|
46
|
+
metadata: skill.reason ? JSON.stringify({ reason: skill.reason }) : null,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** Add platform dependencies (CLI version, MCP servers) */
|
|
51
|
+
function addPlatformDeps(declared, result, declaredMcpServers) {
|
|
52
|
+
if (!declared.platform)
|
|
53
|
+
return;
|
|
54
|
+
if (declared.platform.cli) {
|
|
55
|
+
result.push({
|
|
56
|
+
depType: 'cli_version',
|
|
57
|
+
depTarget: 'claude',
|
|
58
|
+
depVersion: declared.platform.cli,
|
|
59
|
+
depSource: 'declared',
|
|
60
|
+
confidence: 1.0,
|
|
61
|
+
metadata: null,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (declared.platform.mcp_servers) {
|
|
65
|
+
for (const server of declared.platform.mcp_servers) {
|
|
66
|
+
declaredMcpServers.add(server.name);
|
|
67
|
+
result.push({
|
|
68
|
+
depType: 'mcp_server',
|
|
69
|
+
depTarget: server.name,
|
|
70
|
+
depVersion: null,
|
|
71
|
+
depSource: 'declared',
|
|
72
|
+
confidence: 1.0,
|
|
73
|
+
metadata: server.package
|
|
74
|
+
? JSON.stringify({
|
|
75
|
+
package: server.package,
|
|
76
|
+
required: server.required,
|
|
77
|
+
})
|
|
78
|
+
: JSON.stringify({ required: server.required }),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Add model dependencies */
|
|
84
|
+
function addModelDeps(declared, result) {
|
|
85
|
+
if (!declared.models)
|
|
86
|
+
return;
|
|
87
|
+
if (declared.models.minimum) {
|
|
88
|
+
result.push({
|
|
89
|
+
depType: 'model_minimum',
|
|
90
|
+
depTarget: declared.models.minimum,
|
|
91
|
+
depVersion: null,
|
|
92
|
+
depSource: 'declared',
|
|
93
|
+
confidence: 1.0,
|
|
94
|
+
metadata: declared.models.context_window
|
|
95
|
+
? JSON.stringify({ context_window: declared.models.context_window })
|
|
96
|
+
: null,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (declared.models.capabilities) {
|
|
100
|
+
for (const cap of declared.models.capabilities) {
|
|
101
|
+
result.push({
|
|
102
|
+
depType: 'model_capability',
|
|
103
|
+
depTarget: cap,
|
|
104
|
+
depVersion: null,
|
|
105
|
+
depSource: 'declared',
|
|
106
|
+
confidence: 1.0,
|
|
107
|
+
metadata: null,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** Add environment dependencies (tools, OS, Node) */
|
|
113
|
+
function addEnvironmentDeps(declared, result) {
|
|
114
|
+
if (!declared.environment)
|
|
115
|
+
return;
|
|
116
|
+
if (declared.environment.tools) {
|
|
117
|
+
for (const tool of declared.environment.tools) {
|
|
118
|
+
result.push({
|
|
119
|
+
depType: 'env_tool',
|
|
120
|
+
depTarget: tool.name,
|
|
121
|
+
depVersion: null,
|
|
122
|
+
depSource: 'declared',
|
|
123
|
+
confidence: 1.0,
|
|
124
|
+
metadata: JSON.stringify({
|
|
125
|
+
required: tool.required,
|
|
126
|
+
...(tool.check ? { check: tool.check } : {}),
|
|
127
|
+
}),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (declared.environment.os) {
|
|
132
|
+
for (const os of declared.environment.os) {
|
|
133
|
+
result.push({
|
|
134
|
+
depType: 'env_os',
|
|
135
|
+
depTarget: os,
|
|
136
|
+
depVersion: null,
|
|
137
|
+
depSource: 'declared',
|
|
138
|
+
confidence: 1.0,
|
|
139
|
+
metadata: null,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (declared.environment.node) {
|
|
144
|
+
result.push({
|
|
145
|
+
depType: 'env_node',
|
|
146
|
+
depTarget: 'node',
|
|
147
|
+
depVersion: declared.environment.node,
|
|
148
|
+
depSource: 'declared',
|
|
149
|
+
confidence: 1.0,
|
|
150
|
+
metadata: null,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Add conflict declarations — note: DependencyDeclaration doesn't have conflicts field yet */
|
|
155
|
+
function addConflicts(declared, result) {
|
|
156
|
+
// DependencyDeclaration type does not include a conflicts field.
|
|
157
|
+
// This is a forward-looking handler for when the type is extended.
|
|
158
|
+
// Access via type-safe indexing to avoid runtime errors.
|
|
159
|
+
const withConflicts = declared;
|
|
160
|
+
if (!withConflicts.conflicts)
|
|
161
|
+
return;
|
|
162
|
+
for (const conflict of withConflicts.conflicts) {
|
|
163
|
+
result.push({
|
|
164
|
+
depType: 'conflict',
|
|
165
|
+
depTarget: conflict.name,
|
|
166
|
+
depVersion: conflict.versions ?? null,
|
|
167
|
+
depSource: 'declared',
|
|
168
|
+
confidence: 1.0,
|
|
169
|
+
metadata: conflict.reason ? JSON.stringify({ reason: conflict.reason }) : null,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/** Add inferred MCP servers not already declared */
|
|
174
|
+
function addInferredMcp(inferred, declaredMcpServers, result) {
|
|
175
|
+
const highConfidenceSet = new Set(inferred.highConfidenceServers);
|
|
176
|
+
for (const server of inferred.servers) {
|
|
177
|
+
// Declared trumps inferred — skip if already declared
|
|
178
|
+
if (declaredMcpServers.has(server))
|
|
179
|
+
continue;
|
|
180
|
+
const isHighConfidence = highConfidenceSet.has(server);
|
|
181
|
+
result.push({
|
|
182
|
+
depType: 'mcp_server',
|
|
183
|
+
depTarget: server,
|
|
184
|
+
depVersion: null,
|
|
185
|
+
depSource: 'inferred_static',
|
|
186
|
+
confidence: isHighConfidence ? 0.9 : 0.5,
|
|
187
|
+
metadata: null,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=DependencyMerger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyMerger.js","sourceRoot":"","sources":["../../../src/analysis/DependencyMerger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqBH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAA2C,EAC3C,QAA6B;IAE7B,MAAM,MAAM,GAAuB,EAAE,CAAA;IACrC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAA;IAE5C,IAAI,QAAQ,EAAE,CAAC;QACb,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC9B,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAA;QACrD,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC9B,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QACpC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAChC,CAAC;IAED,cAAc,CAAC,QAAQ,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAA;IAEpD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,sCAAsC;AACtC,SAAS,YAA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SAAQ;QAE5C,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAEtD,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,YAAY;YACrB,SAAS,EAAE,MAAM;YACjB,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE,iBAAiB;YAC5B,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;YACxC,QAAQ,EAAE,IAAI;SACf,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyMerger.test.d.ts","sourceRoot":"","sources":["../../../src/analysis/DependencyMerger.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mergeDependencies } from './DependencyMerger.js';
|
|
3
|
+
/** Helper: create an empty McpExtractionResult */
|
|
4
|
+
function emptyInferred() {
|
|
5
|
+
return { references: [], servers: [], highConfidenceServers: [] };
|
|
6
|
+
}
|
|
7
|
+
/** Helper: create a McpExtractionResult with servers */
|
|
8
|
+
function inferredServers(servers, highConfidence = []) {
|
|
9
|
+
return {
|
|
10
|
+
references: servers.map((s) => ({
|
|
11
|
+
server: s,
|
|
12
|
+
tool: 'some_tool',
|
|
13
|
+
line: 1,
|
|
14
|
+
inCodeBlock: !highConfidence.includes(s),
|
|
15
|
+
})),
|
|
16
|
+
servers,
|
|
17
|
+
highConfidenceServers: highConfidence,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
describe('DependencyMerger', () => {
|
|
21
|
+
describe('mergeDependencies', () => {
|
|
22
|
+
it('should return empty array for undefined declared and empty inferred', () => {
|
|
23
|
+
const result = mergeDependencies(undefined, emptyInferred());
|
|
24
|
+
expect(result).toEqual([]);
|
|
25
|
+
});
|
|
26
|
+
it('should include declared skill dependencies', () => {
|
|
27
|
+
const declared = {
|
|
28
|
+
skills: [
|
|
29
|
+
{ name: 'auth-helper', type: 'hard', version: '^1.0.0' },
|
|
30
|
+
{ name: 'logger', type: 'soft' },
|
|
31
|
+
{ name: 'formatter', type: 'peer', reason: 'shared config' },
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
const result = mergeDependencies(declared, emptyInferred());
|
|
35
|
+
expect(result).toHaveLength(3);
|
|
36
|
+
expect(result[0]).toMatchObject({
|
|
37
|
+
depType: 'skill_hard',
|
|
38
|
+
depTarget: 'auth-helper',
|
|
39
|
+
depVersion: '^1.0.0',
|
|
40
|
+
depSource: 'declared',
|
|
41
|
+
confidence: 1.0,
|
|
42
|
+
});
|
|
43
|
+
expect(result[1]).toMatchObject({
|
|
44
|
+
depType: 'skill_soft',
|
|
45
|
+
depTarget: 'logger',
|
|
46
|
+
depVersion: null,
|
|
47
|
+
depSource: 'declared',
|
|
48
|
+
});
|
|
49
|
+
expect(result[2]).toMatchObject({
|
|
50
|
+
depType: 'skill_peer',
|
|
51
|
+
depTarget: 'formatter',
|
|
52
|
+
metadata: JSON.stringify({ reason: 'shared config' }),
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
it('should include declared MCP servers', () => {
|
|
56
|
+
const declared = {
|
|
57
|
+
platform: {
|
|
58
|
+
mcp_servers: [
|
|
59
|
+
{ name: 'linear', required: true, package: '@linear/mcp' },
|
|
60
|
+
{ name: 'slack', required: false },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const result = mergeDependencies(declared, emptyInferred());
|
|
65
|
+
expect(result).toHaveLength(2);
|
|
66
|
+
expect(result[0]).toMatchObject({
|
|
67
|
+
depType: 'mcp_server',
|
|
68
|
+
depTarget: 'linear',
|
|
69
|
+
depSource: 'declared',
|
|
70
|
+
confidence: 1.0,
|
|
71
|
+
});
|
|
72
|
+
expect(JSON.parse(result[0].metadata)).toEqual({
|
|
73
|
+
package: '@linear/mcp',
|
|
74
|
+
required: true,
|
|
75
|
+
});
|
|
76
|
+
expect(result[1]).toMatchObject({
|
|
77
|
+
depType: 'mcp_server',
|
|
78
|
+
depTarget: 'slack',
|
|
79
|
+
depSource: 'declared',
|
|
80
|
+
});
|
|
81
|
+
expect(JSON.parse(result[1].metadata)).toEqual({ required: false });
|
|
82
|
+
});
|
|
83
|
+
it('should add inferred MCP servers when no declared deps', () => {
|
|
84
|
+
const inferred = inferredServers(['linear', 'claude-flow'], ['linear']);
|
|
85
|
+
const result = mergeDependencies(undefined, inferred);
|
|
86
|
+
expect(result).toHaveLength(2);
|
|
87
|
+
const linear = result.find((d) => d.depTarget === 'linear');
|
|
88
|
+
expect(linear.depType).toBe('mcp_server');
|
|
89
|
+
expect(linear.depSource).toBe('inferred_static');
|
|
90
|
+
expect(linear.confidence).toBe(0.9); // high confidence
|
|
91
|
+
const cf = result.find((d) => d.depTarget === 'claude-flow');
|
|
92
|
+
expect(cf.depSource).toBe('inferred_static');
|
|
93
|
+
expect(cf.confidence).toBe(0.5); // low confidence (code block only)
|
|
94
|
+
});
|
|
95
|
+
it('should skip inferred server when already declared (declared trumps)', () => {
|
|
96
|
+
const declared = {
|
|
97
|
+
platform: {
|
|
98
|
+
mcp_servers: [{ name: 'linear', required: true }],
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
const inferred = inferredServers(['linear', 'slack'], ['linear', 'slack']);
|
|
102
|
+
const result = mergeDependencies(declared, inferred);
|
|
103
|
+
// linear: declared only (not duplicated from inferred)
|
|
104
|
+
// slack: inferred (not declared)
|
|
105
|
+
const linearEntries = result.filter((d) => d.depTarget === 'linear');
|
|
106
|
+
expect(linearEntries).toHaveLength(1);
|
|
107
|
+
expect(linearEntries[0].depSource).toBe('declared');
|
|
108
|
+
expect(linearEntries[0].confidence).toBe(1.0);
|
|
109
|
+
const slackEntries = result.filter((d) => d.depTarget === 'slack');
|
|
110
|
+
expect(slackEntries).toHaveLength(1);
|
|
111
|
+
expect(slackEntries[0].depSource).toBe('inferred_static');
|
|
112
|
+
expect(slackEntries[0].confidence).toBe(0.9);
|
|
113
|
+
});
|
|
114
|
+
it('should assign correct confidence: 0.9 high, 0.5 code-block-only', () => {
|
|
115
|
+
const inferred = inferredServers(['high-server', 'low-server'], ['high-server'] // only high-server is high confidence
|
|
116
|
+
);
|
|
117
|
+
const result = mergeDependencies(undefined, inferred);
|
|
118
|
+
const high = result.find((d) => d.depTarget === 'high-server');
|
|
119
|
+
expect(high.confidence).toBe(0.9);
|
|
120
|
+
const low = result.find((d) => d.depTarget === 'low-server');
|
|
121
|
+
expect(low.confidence).toBe(0.5);
|
|
122
|
+
});
|
|
123
|
+
it('should include declared CLI version', () => {
|
|
124
|
+
const declared = {
|
|
125
|
+
platform: { cli: '>=1.0.0' },
|
|
126
|
+
};
|
|
127
|
+
const result = mergeDependencies(declared, emptyInferred());
|
|
128
|
+
expect(result).toHaveLength(1);
|
|
129
|
+
expect(result[0]).toMatchObject({
|
|
130
|
+
depType: 'cli_version',
|
|
131
|
+
depTarget: 'claude',
|
|
132
|
+
depVersion: '>=1.0.0',
|
|
133
|
+
depSource: 'declared',
|
|
134
|
+
confidence: 1.0,
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
it('should include model dependencies', () => {
|
|
138
|
+
const declared = {
|
|
139
|
+
models: {
|
|
140
|
+
minimum: 'claude-3-sonnet',
|
|
141
|
+
capabilities: ['tool_use', 'vision'],
|
|
142
|
+
context_window: 200000,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
const result = mergeDependencies(declared, emptyInferred());
|
|
146
|
+
expect(result).toHaveLength(3);
|
|
147
|
+
const minimum = result.find((d) => d.depType === 'model_minimum');
|
|
148
|
+
expect(minimum.depTarget).toBe('claude-3-sonnet');
|
|
149
|
+
expect(JSON.parse(minimum.metadata)).toEqual({
|
|
150
|
+
context_window: 200000,
|
|
151
|
+
});
|
|
152
|
+
const capabilities = result.filter((d) => d.depType === 'model_capability');
|
|
153
|
+
expect(capabilities).toHaveLength(2);
|
|
154
|
+
expect(capabilities.map((c) => c.depTarget)).toEqual(['tool_use', 'vision']);
|
|
155
|
+
});
|
|
156
|
+
it('should include environment dependencies', () => {
|
|
157
|
+
const declared = {
|
|
158
|
+
environment: {
|
|
159
|
+
tools: [
|
|
160
|
+
{ name: 'git', required: true, check: 'git --version' },
|
|
161
|
+
{ name: 'docker', required: false },
|
|
162
|
+
],
|
|
163
|
+
os: ['linux', 'darwin'],
|
|
164
|
+
node: '>=20.0.0',
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
const result = mergeDependencies(declared, emptyInferred());
|
|
168
|
+
const tools = result.filter((d) => d.depType === 'env_tool');
|
|
169
|
+
expect(tools).toHaveLength(2);
|
|
170
|
+
expect(JSON.parse(tools[0].metadata)).toEqual({
|
|
171
|
+
required: true,
|
|
172
|
+
check: 'git --version',
|
|
173
|
+
});
|
|
174
|
+
expect(JSON.parse(tools[1].metadata)).toEqual({ required: false });
|
|
175
|
+
const osEntries = result.filter((d) => d.depType === 'env_os');
|
|
176
|
+
expect(osEntries).toHaveLength(2);
|
|
177
|
+
expect(osEntries.map((o) => o.depTarget)).toEqual(['linux', 'darwin']);
|
|
178
|
+
const nodeEntry = result.find((d) => d.depType === 'env_node');
|
|
179
|
+
expect(nodeEntry.depTarget).toBe('node');
|
|
180
|
+
expect(nodeEntry.depVersion).toBe('>=20.0.0');
|
|
181
|
+
});
|
|
182
|
+
it('should merge full declared + inferred with no duplicates', () => {
|
|
183
|
+
const declared = {
|
|
184
|
+
skills: [{ name: 'auth', type: 'hard' }],
|
|
185
|
+
platform: {
|
|
186
|
+
cli: '>=1.0.0',
|
|
187
|
+
mcp_servers: [{ name: 'linear', required: true }],
|
|
188
|
+
},
|
|
189
|
+
models: { minimum: 'claude-3-sonnet' },
|
|
190
|
+
};
|
|
191
|
+
const inferred = inferredServers(['linear', 'claude-flow', 'skillsmith'], ['claude-flow', 'skillsmith']);
|
|
192
|
+
const result = mergeDependencies(declared, inferred);
|
|
193
|
+
// Declared: skill_hard(auth) + cli_version + mcp_server(linear) + model_minimum
|
|
194
|
+
// Inferred: mcp_server(claude-flow, skillsmith) — linear skipped
|
|
195
|
+
expect(result).toHaveLength(6);
|
|
196
|
+
const mcpServers = result.filter((d) => d.depType === 'mcp_server');
|
|
197
|
+
expect(mcpServers).toHaveLength(3);
|
|
198
|
+
const linearEntry = mcpServers.find((d) => d.depTarget === 'linear');
|
|
199
|
+
expect(linearEntry.depSource).toBe('declared');
|
|
200
|
+
const cfEntry = mcpServers.find((d) => d.depTarget === 'claude-flow');
|
|
201
|
+
expect(cfEntry.depSource).toBe('inferred_static');
|
|
202
|
+
expect(cfEntry.confidence).toBe(0.9);
|
|
203
|
+
const ssEntry = mcpServers.find((d) => d.depTarget === 'skillsmith');
|
|
204
|
+
expect(ssEntry.depSource).toBe('inferred_static');
|
|
205
|
+
expect(ssEntry.confidence).toBe(0.9);
|
|
206
|
+
});
|
|
207
|
+
it('should handle declared-only with no inferred', () => {
|
|
208
|
+
const declared = {
|
|
209
|
+
skills: [{ name: 'helper', type: 'soft' }],
|
|
210
|
+
};
|
|
211
|
+
const result = mergeDependencies(declared, emptyInferred());
|
|
212
|
+
expect(result).toHaveLength(1);
|
|
213
|
+
expect(result[0].depType).toBe('skill_soft');
|
|
214
|
+
});
|
|
215
|
+
it('should ensure metadata is always a string or null', () => {
|
|
216
|
+
const declared = {
|
|
217
|
+
skills: [
|
|
218
|
+
{ name: 'with-reason', type: 'hard', reason: 'needed for auth' },
|
|
219
|
+
{ name: 'no-reason', type: 'soft' },
|
|
220
|
+
],
|
|
221
|
+
platform: {
|
|
222
|
+
mcp_servers: [{ name: 'linear', required: true }],
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
const result = mergeDependencies(declared, emptyInferred());
|
|
226
|
+
for (const dep of result) {
|
|
227
|
+
expect(dep.metadata === null || typeof dep.metadata === 'string').toBe(true);
|
|
228
|
+
// If metadata is a string, it must be valid JSON
|
|
229
|
+
if (dep.metadata !== null) {
|
|
230
|
+
expect(() => JSON.parse(dep.metadata)).not.toThrow();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
it('should handle conflicts', () => {
|
|
235
|
+
// Use type assertion for forward-looking conflicts field
|
|
236
|
+
const declared = {
|
|
237
|
+
conflicts: [
|
|
238
|
+
{
|
|
239
|
+
name: 'bad-skill',
|
|
240
|
+
versions: '>=2.0.0',
|
|
241
|
+
reason: 'incompatible API',
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
};
|
|
245
|
+
const result = mergeDependencies(declared, emptyInferred());
|
|
246
|
+
expect(result).toHaveLength(1);
|
|
247
|
+
expect(result[0]).toMatchObject({
|
|
248
|
+
depType: 'conflict',
|
|
249
|
+
depTarget: 'bad-skill',
|
|
250
|
+
depVersion: '>=2.0.0',
|
|
251
|
+
depSource: 'declared',
|
|
252
|
+
confidence: 1.0,
|
|
253
|
+
metadata: JSON.stringify({ reason: 'incompatible API' }),
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
//# sourceMappingURL=DependencyMerger.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyMerger.test.js","sourceRoot":"","sources":["../../../src/analysis/DependencyMerger.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAI7C,OAAO,EAAE,iBAAiB,EAAyB,MAAM,uBAAuB,CAAA;AAEhF,kDAAkD;AAClD,SAAS,aAAa;IACpB,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,qBAAqB,EAAE,EAAE,EAAE,CAAA;AACnE,CAAC;AAED,wDAAwD;AACxD,SAAS,eAAe,CAAC,OAAiB,EAAE,iBAA2B,EAAE;IACvE,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC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AU,EAAE,GAAG;gBACf,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;aACzD,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Extracts MCP tool references from SKILL.md content
|
|
3
|
+
* @module @skillsmith/core/analysis/McpReferenceExtractor
|
|
4
|
+
* @see SMI-3145: Build McpReferenceExtractor
|
|
5
|
+
*
|
|
6
|
+
* Scans skill content for `mcp__<server>__<tool>` patterns,
|
|
7
|
+
* tracking whether each reference appears inside a fenced code block.
|
|
8
|
+
*/
|
|
9
|
+
/** A single MCP tool reference found in content */
|
|
10
|
+
export interface McpReference {
|
|
11
|
+
/** MCP server name, e.g. "linear" */
|
|
12
|
+
server: string;
|
|
13
|
+
/** MCP tool name, e.g. "save_issue" */
|
|
14
|
+
tool: string;
|
|
15
|
+
/** 1-indexed line number where the reference appears */
|
|
16
|
+
line: number;
|
|
17
|
+
/** true if the reference is inside a fenced code block */
|
|
18
|
+
inCodeBlock: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Aggregated extraction result */
|
|
21
|
+
export interface McpExtractionResult {
|
|
22
|
+
/** All individual references found */
|
|
23
|
+
references: McpReference[];
|
|
24
|
+
/** Unique server names across all references */
|
|
25
|
+
servers: string[];
|
|
26
|
+
/** Servers referenced at least once outside a code block */
|
|
27
|
+
highConfidenceServers: string[];
|
|
28
|
+
/** true if input exceeded the 100KB cap and was truncated */
|
|
29
|
+
truncated?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Extract all MCP tool references from skill content.
|
|
33
|
+
*
|
|
34
|
+
* Scans each line for `mcp__server__tool` patterns, tracking fenced
|
|
35
|
+
* code block state to distinguish high-confidence (prose) references
|
|
36
|
+
* from low-confidence (code example) references.
|
|
37
|
+
*
|
|
38
|
+
* @param content - Raw SKILL.md content (markdown)
|
|
39
|
+
* @returns Extraction result with references, servers, and confidence info
|
|
40
|
+
*/
|
|
41
|
+
export declare function extractMcpReferences(content: string): McpExtractionResult;
|
|
42
|
+
//# sourceMappingURL=McpReferenceExtractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McpReferenceExtractor.d.ts","sourceRoot":"","sources":["../../../src/analysis/McpReferenceExtractor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,mCAAmC;AACnC,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,UAAU,EAAE,YAAY,EAAE,CAAA;IAC1B,gDAAgD;IAChD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,4DAA4D;IAC5D,qBAAqB,EAAE,MAAM,EAAE,CAAA;IAC/B,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAeD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAyEzE"}
|